claude-mem 3.5.7 → 3.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/claude-mem.min.js +248 -231
  2. package/package.json +1 -1
@@ -1,43 +1,43 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as zw}from"node:module";var $w=Object.create;var{getPrototypeOf:ww,defineProperty:e7,getOwnPropertyNames:Ow}=Object;var vw=Object.prototype.hasOwnProperty;var B6=(q,_,j)=>{j=q!=null?$w(ww(q)):{};let K=_||!q||!q.__esModule?e7(j,"default",{value:q,enumerable:!0}):j;for(let Y of Ow(q))if(!vw.call(K,Y))e7(K,Y,{get:()=>q[Y],enumerable:!0});return K};var q8=(q,_)=>()=>(_||q((_={exports:{}}).exports,_),_.exports);var rq=(q,_)=>{for(var j in _)e7(q,j,{get:_[j],enumerable:!0,configurable:!0,set:(K)=>_[j]=()=>K})};var Q8=(q,_)=>()=>(q&&(_=q(q=0)),_);var h6=zw(import.meta.url);var SK=q8((Ww)=>{class F7 extends Error{constructor(q,_,j){super(j);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=_,this.exitCode=q,this.nestedError=void 0}}class U9 extends F7{constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Ww.CommanderError=F7;Ww.InvalidArgumentError=U9});var m3=q8((kw)=>{var{InvalidArgumentError:Tw}=SK();class s9{constructor(q,_){switch(this.description=_||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(q,_){if(_===this.defaultValue||!Array.isArray(_))return[q];return _.concat(q)}default(q,_){return this.defaultValue=q,this.defaultValueDescription=_,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=(_,j)=>{if(!this.argChoices.includes(_))throw new Tw(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,j);return _},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Zw(q){let _=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+_+">":"["+_+"]"}kw.Argument=s9;kw.humanReadableArgName=Zw});var U7=q8((uw)=>{var{humanReadableArgName:Gw}=m3();class Q9{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let _=q.commands.filter((K)=>!K._hidden),j=q._getHelpCommand();if(j&&!j._hidden)_.push(j);if(this.sortSubcommands)_.sort((K,Y)=>{return K.name().localeCompare(Y.name())});return _}compareOptions(q,_){let j=(K)=>{return K.short?K.short.replace(/^-/,""):K.long.replace(/^--/,"")};return j(q).localeCompare(j(_))}visibleOptions(q){let _=q.options.filter((K)=>!K.hidden),j=q._getHelpOption();if(j&&!j.hidden){let K=j.short&&q._findOption(j.short),Y=j.long&&q._findOption(j.long);if(!K&&!Y)_.push(j);else if(j.long&&!Y)_.push(q.createOption(j.long,j.description));else if(j.short&&!K)_.push(q.createOption(j.short,j.description))}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let _=[];for(let j=q.parent;j;j=j.parent){let K=j.options.filter((Y)=>!Y.hidden);_.push(...K)}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach((_)=>{_.description=_.description||q._argsDescription[_.name()]||""});if(q.registeredArguments.find((_)=>_.description))return q.registeredArguments;return[]}subcommandTerm(q){let _=q.registeredArguments.map((j)=>Gw(j)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+(_?" "+_:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,_){return _.visibleCommands(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleSubcommandTerm(_.subcommandTerm(K))))},0)}longestOptionTermLength(q,_){return _.visibleOptions(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleOptionTerm(_.optionTerm(K))))},0)}longestGlobalOptionTermLength(q,_){return _.visibleGlobalOptions(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleOptionTerm(_.optionTerm(K))))},0)}longestArgumentTermLength(q,_){return _.visibleArguments(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleArgumentTerm(_.argumentTerm(K))))},0)}commandUsage(q){let _=q._name;if(q._aliases[0])_=_+"|"+q._aliases[0];let j="";for(let K=q.parent;K;K=K.parent)j=K.name()+" "+j;return j+_+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let _=[];if(q.argChoices)_.push(`choices: ${q.argChoices.map((j)=>JSON.stringify(j)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")_.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)_.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)_.push(`env: ${q.envVar}`);if(_.length>0){let j=`(${_.join(", ")})`;if(q.description)return`${q.description} ${j}`;return j}return q.description}argumentDescription(q){let _=[];if(q.argChoices)_.push(`choices: ${q.argChoices.map((j)=>JSON.stringify(j)).join(", ")}`);if(q.defaultValue!==void 0)_.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if(_.length>0){let j=`(${_.join(", ")})`;if(q.description)return`${q.description} ${j}`;return j}return q.description}formatItemList(q,_,j){if(_.length===0)return[];return[j.styleTitle(q),..._,""]}groupItems(q,_,j){let K=new Map;return q.forEach((Y)=>{let f=j(Y);if(!K.has(f))K.set(f,[])}),_.forEach((Y)=>{let f=j(Y);if(!K.has(f))K.set(f,[]);K.get(f).push(Y)}),K}formatHelp(q,_){let j=_.padWidth(q,_),K=_.helpWidth??80;function Y(v,z){return _.formatItem(v,j,z,_)}let f=[`${_.styleTitle("Usage:")} ${_.styleUsage(_.commandUsage(q))}`,""],P=_.commandDescription(q);if(P.length>0)f=f.concat([_.boxWrap(_.styleCommandDescription(P),K),""]);let $=_.visibleArguments(q).map((v)=>{return Y(_.styleArgumentTerm(_.argumentTerm(v)),_.styleArgumentDescription(_.argumentDescription(v)))});if(f=f.concat(this.formatItemList("Arguments:",$,_)),this.groupItems(q.options,_.visibleOptions(q),(v)=>v.helpGroupHeading??"Options:").forEach((v,z)=>{let W=v.map((J)=>{return Y(_.styleOptionTerm(_.optionTerm(J)),_.styleOptionDescription(_.optionDescription(J)))});f=f.concat(this.formatItemList(z,W,_))}),_.showGlobalOptions){let v=_.visibleGlobalOptions(q).map((z)=>{return Y(_.styleOptionTerm(_.optionTerm(z)),_.styleOptionDescription(_.optionDescription(z)))});f=f.concat(this.formatItemList("Global Options:",v,_))}return this.groupItems(q.commands,_.visibleCommands(q),(v)=>v.helpGroup()||"Commands:").forEach((v,z)=>{let W=v.map((J)=>{return Y(_.styleSubcommandTerm(_.subcommandTerm(J)),_.styleSubcommandDescription(_.subcommandDescription(J)))});f=f.concat(this.formatItemList(z,W,_))}),f.join(`
3
- `)}displayWidth(q){return q5(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_==="[command]")return this.styleSubcommandText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleCommandText(_)}).join(" ")}styleCommandDescription(q){return this.styleDescriptionText(q)}styleOptionDescription(q){return this.styleDescriptionText(q)}styleSubcommandDescription(q){return this.styleDescriptionText(q)}styleArgumentDescription(q){return this.styleDescriptionText(q)}styleDescriptionText(q){return q}styleOptionTerm(q){return this.styleOptionText(q)}styleSubcommandTerm(q){return q.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleSubcommandText(_)}).join(" ")}styleArgumentTerm(q){return this.styleArgumentText(q)}styleOptionText(q){return q}styleArgumentText(q){return q}styleSubcommandText(q){return q}styleCommandText(q){return q}padWidth(q,_){return Math.max(_.longestOptionTermLength(q,_),_.longestGlobalOptionTermLength(q,_),_.longestSubcommandTermLength(q,_),_.longestArgumentTermLength(q,_))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,_,j,K){let f=" ".repeat(2);if(!j)return f+q;let P=q.padEnd(_+q.length-K.displayWidth(q)),$=2,w=(this.helpWidth??80)-_-$-2,v;if(w<this.minWidthToWrap||K.preformatted(j))v=j;else v=K.boxWrap(j,w).replace(/\n/g,`
4
- `+" ".repeat(_+$));return f+P+" ".repeat($)+v.replace(/\n/g,`
5
- ${f}`)}boxWrap(q,_){if(_<this.minWidthToWrap)return q;let j=q.split(/\r\n|\n/),K=/[\s]*[^\s]+/g,Y=[];return j.forEach((f)=>{let P=f.match(K);if(P===null){Y.push("");return}let $=[P.shift()],O=this.displayWidth($[0]);P.forEach((w)=>{let v=this.displayWidth(w);if(O+v<=_){$.push(w),O+=v;return}Y.push($.join(""));let z=w.trimStart();$=[z],O=this.displayWidth(z)}),Y.push($.join(""))}),Y.join(`
6
- `)}}function q5(q){let _=/\x1b\[\d*(;\d*)*m/g;return q.replace(_,"")}uw.Help=Q9;uw.stripColor=q5});var s7=q8((Mw)=>{var{InvalidArgumentError:Cw}=SK();class K5{constructor(q,_){this.flags=q,this.description=_||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let j=Vw(q);if(this.short=j.shortFlag,this.long=j.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(q,_){return this.defaultValue=q,this.defaultValueDescription=_,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let _=q;if(typeof q==="string")_={[q]:!0};return this.implied=Object.assign(this.implied||{},_),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_concatValue(q,_){if(_===this.defaultValue||!Array.isArray(_))return[q];return _.concat(q)}choices(q){return this.argChoices=q.slice(),this.parseArg=(_,j)=>{if(!this.argChoices.includes(_))throw new Cw(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,j);return _},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return _5(this.name().replace(/^no-/,""));return _5(this.name())}helpGroup(q){return this.helpGroupHeading=q,this}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class j5{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach((_)=>{if(_.negate)this.negativeOptions.set(_.attributeName(),_);else this.positiveOptions.set(_.attributeName(),_)}),this.negativeOptions.forEach((_,j)=>{if(this.positiveOptions.has(j))this.dualOptions.add(j)})}valueFromOption(q,_){let j=_.attributeName();if(!this.dualOptions.has(j))return!0;let K=this.negativeOptions.get(j).presetArg,Y=K!==void 0?K:!1;return _.negate===(Y===q)}}function _5(q){return q.split("-").reduce((_,j)=>{return _+j[0].toUpperCase()+j.slice(1)})}function Vw(q){let _,j,K=/^-[^-]$/,Y=/^--[^-]/,f=q.split(/[ |,]+/).concat("guard");if(K.test(f[0]))_=f.shift();if(Y.test(f[0]))j=f.shift();if(!_&&K.test(f[0]))_=f.shift();if(!_&&Y.test(f[0]))_=j,j=f.shift();if(f[0].startsWith("-")){let P=f[0],$=`option creation failed due to '${P}' in option flags '${q}'`;if(/^-[^-][^-]/.test(P))throw new Error(`${$}
2
+ import{createRequire as Xw}from"node:module";var Hw=Object.create;var{getPrototypeOf:Tw,defineProperty:q4,getOwnPropertyNames:Zw}=Object;var kw=Object.prototype.hasOwnProperty;var e6=(q,_,j)=>{j=q!=null?Hw(Tw(q)):{};let K=_||!q||!q.__esModule?q4(j,"default",{value:q,enumerable:!0}):j;for(let f of Zw(q))if(!kw.call(K,f))q4(K,f,{get:()=>q[f],enumerable:!0});return K};var q8=(q,_)=>()=>(_||q((_={exports:{}}).exports,_),_.exports);var iq=(q,_)=>{for(var j in _)q4(q,j,{get:_[j],enumerable:!0,configurable:!0,set:(K)=>_[j]=()=>K})};var Q8=(q,_)=>()=>(q&&(_=q(q=0)),_);var D6=Xw(import.meta.url);var gK=q8((Aw)=>{class _4 extends Error{constructor(q,_,j){super(j);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=_,this.exitCode=q,this.nestedError=void 0}}class Y5 extends _4{constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Aw.CommanderError=_4;Aw.InvalidArgumentError=Y5});var p3=q8((Cw)=>{var{InvalidArgumentError:hw}=gK();class $5{constructor(q,_){switch(this.description=_||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(q,_){if(_===this.defaultValue||!Array.isArray(_))return[q];return _.concat(q)}default(q,_){return this.defaultValue=q,this.defaultValueDescription=_,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=(_,j)=>{if(!this.argChoices.includes(_))throw new hw(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,j);return _},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Dw(q){let _=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+_+">":"["+_+"]"}Cw.Argument=$5;Cw.humanReadableArgName=Dw});var K4=q8((bw)=>{var{humanReadableArgName:Nw}=p3();class w5{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let _=q.commands.filter((K)=>!K._hidden),j=q._getHelpCommand();if(j&&!j._hidden)_.push(j);if(this.sortSubcommands)_.sort((K,f)=>{return K.name().localeCompare(f.name())});return _}compareOptions(q,_){let j=(K)=>{return K.short?K.short.replace(/^-/,""):K.long.replace(/^--/,"")};return j(q).localeCompare(j(_))}visibleOptions(q){let _=q.options.filter((K)=>!K.hidden),j=q._getHelpOption();if(j&&!j.hidden){let K=j.short&&q._findOption(j.short),f=j.long&&q._findOption(j.long);if(!K&&!f)_.push(j);else if(j.long&&!f)_.push(q.createOption(j.long,j.description));else if(j.short&&!K)_.push(q.createOption(j.short,j.description))}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let _=[];for(let j=q.parent;j;j=j.parent){let K=j.options.filter((f)=>!f.hidden);_.push(...K)}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach((_)=>{_.description=_.description||q._argsDescription[_.name()]||""});if(q.registeredArguments.find((_)=>_.description))return q.registeredArguments;return[]}subcommandTerm(q){let _=q.registeredArguments.map((j)=>Nw(j)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+(_?" "+_:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,_){return _.visibleCommands(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleSubcommandTerm(_.subcommandTerm(K))))},0)}longestOptionTermLength(q,_){return _.visibleOptions(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleOptionTerm(_.optionTerm(K))))},0)}longestGlobalOptionTermLength(q,_){return _.visibleGlobalOptions(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleOptionTerm(_.optionTerm(K))))},0)}longestArgumentTermLength(q,_){return _.visibleArguments(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleArgumentTerm(_.argumentTerm(K))))},0)}commandUsage(q){let _=q._name;if(q._aliases[0])_=_+"|"+q._aliases[0];let j="";for(let K=q.parent;K;K=K.parent)j=K.name()+" "+j;return j+_+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let _=[];if(q.argChoices)_.push(`choices: ${q.argChoices.map((j)=>JSON.stringify(j)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")_.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)_.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)_.push(`env: ${q.envVar}`);if(_.length>0){let j=`(${_.join(", ")})`;if(q.description)return`${q.description} ${j}`;return j}return q.description}argumentDescription(q){let _=[];if(q.argChoices)_.push(`choices: ${q.argChoices.map((j)=>JSON.stringify(j)).join(", ")}`);if(q.defaultValue!==void 0)_.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if(_.length>0){let j=`(${_.join(", ")})`;if(q.description)return`${q.description} ${j}`;return j}return q.description}formatItemList(q,_,j){if(_.length===0)return[];return[j.styleTitle(q),..._,""]}groupItems(q,_,j){let K=new Map;return q.forEach((f)=>{let Y=j(f);if(!K.has(Y))K.set(Y,[])}),_.forEach((f)=>{let Y=j(f);if(!K.has(Y))K.set(Y,[]);K.get(Y).push(f)}),K}formatHelp(q,_){let j=_.padWidth(q,_),K=_.helpWidth??80;function f(v,z){return _.formatItem(v,j,z,_)}let Y=[`${_.styleTitle("Usage:")} ${_.styleUsage(_.commandUsage(q))}`,""],P=_.commandDescription(q);if(P.length>0)Y=Y.concat([_.boxWrap(_.styleCommandDescription(P),K),""]);let $=_.visibleArguments(q).map((v)=>{return f(_.styleArgumentTerm(_.argumentTerm(v)),_.styleArgumentDescription(_.argumentDescription(v)))});if(Y=Y.concat(this.formatItemList("Arguments:",$,_)),this.groupItems(q.options,_.visibleOptions(q),(v)=>v.helpGroupHeading??"Options:").forEach((v,z)=>{let W=v.map((H)=>{return f(_.styleOptionTerm(_.optionTerm(H)),_.styleOptionDescription(_.optionDescription(H)))});Y=Y.concat(this.formatItemList(z,W,_))}),_.showGlobalOptions){let v=_.visibleGlobalOptions(q).map((z)=>{return f(_.styleOptionTerm(_.optionTerm(z)),_.styleOptionDescription(_.optionDescription(z)))});Y=Y.concat(this.formatItemList("Global Options:",v,_))}return this.groupItems(q.commands,_.visibleCommands(q),(v)=>v.helpGroup()||"Commands:").forEach((v,z)=>{let W=v.map((H)=>{return f(_.styleSubcommandTerm(_.subcommandTerm(H)),_.styleSubcommandDescription(_.subcommandDescription(H)))});Y=Y.concat(this.formatItemList(z,W,_))}),Y.join(`
3
+ `)}displayWidth(q){return O5(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_==="[command]")return this.styleSubcommandText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleCommandText(_)}).join(" ")}styleCommandDescription(q){return this.styleDescriptionText(q)}styleOptionDescription(q){return this.styleDescriptionText(q)}styleSubcommandDescription(q){return this.styleDescriptionText(q)}styleArgumentDescription(q){return this.styleDescriptionText(q)}styleDescriptionText(q){return q}styleOptionTerm(q){return this.styleOptionText(q)}styleSubcommandTerm(q){return q.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleSubcommandText(_)}).join(" ")}styleArgumentTerm(q){return this.styleArgumentText(q)}styleOptionText(q){return q}styleArgumentText(q){return q}styleSubcommandText(q){return q}styleCommandText(q){return q}padWidth(q,_){return Math.max(_.longestOptionTermLength(q,_),_.longestGlobalOptionTermLength(q,_),_.longestSubcommandTermLength(q,_),_.longestArgumentTermLength(q,_))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,_,j,K){let Y=" ".repeat(2);if(!j)return Y+q;let P=q.padEnd(_+q.length-K.displayWidth(q)),$=2,w=(this.helpWidth??80)-_-$-2,v;if(w<this.minWidthToWrap||K.preformatted(j))v=j;else v=K.boxWrap(j,w).replace(/\n/g,`
4
+ `+" ".repeat(_+$));return Y+P+" ".repeat($)+v.replace(/\n/g,`
5
+ ${Y}`)}boxWrap(q,_){if(_<this.minWidthToWrap)return q;let j=q.split(/\r\n|\n/),K=/[\s]*[^\s]+/g,f=[];return j.forEach((Y)=>{let P=Y.match(K);if(P===null){f.push("");return}let $=[P.shift()],O=this.displayWidth($[0]);P.forEach((w)=>{let v=this.displayWidth(w);if(O+v<=_){$.push(w),O+=v;return}f.push($.join(""));let z=w.trimStart();$=[z],O=this.displayWidth(z)}),f.push($.join(""))}),f.join(`
6
+ `)}}function O5(q){let _=/\x1b\[\d*(;\d*)*m/g;return q.replace(_,"")}bw.Help=w5;bw.stripColor=O5});var j4=q8((Iw)=>{var{InvalidArgumentError:Rw}=gK();class z5{constructor(q,_){this.flags=q,this.description=_||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let j=mw(q);if(this.short=j.shortFlag,this.long=j.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(q,_){return this.defaultValue=q,this.defaultValueDescription=_,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let _=q;if(typeof q==="string")_={[q]:!0};return this.implied=Object.assign(this.implied||{},_),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_concatValue(q,_){if(_===this.defaultValue||!Array.isArray(_))return[q];return _.concat(q)}choices(q){return this.argChoices=q.slice(),this.parseArg=(_,j)=>{if(!this.argChoices.includes(_))throw new Rw(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,j);return _},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return v5(this.name().replace(/^no-/,""));return v5(this.name())}helpGroup(q){return this.helpGroupHeading=q,this}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class W5{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach((_)=>{if(_.negate)this.negativeOptions.set(_.attributeName(),_);else this.positiveOptions.set(_.attributeName(),_)}),this.negativeOptions.forEach((_,j)=>{if(this.positiveOptions.has(j))this.dualOptions.add(j)})}valueFromOption(q,_){let j=_.attributeName();if(!this.dualOptions.has(j))return!0;let K=this.negativeOptions.get(j).presetArg,f=K!==void 0?K:!1;return _.negate===(f===q)}}function v5(q){return q.split("-").reduce((_,j)=>{return _+j[0].toUpperCase()+j.slice(1)})}function mw(q){let _,j,K=/^-[^-]$/,f=/^--[^-]/,Y=q.split(/[ |,]+/).concat("guard");if(K.test(Y[0]))_=Y.shift();if(f.test(Y[0]))j=Y.shift();if(!_&&K.test(Y[0]))_=Y.shift();if(!_&&f.test(Y[0]))_=j,j=Y.shift();if(Y[0].startsWith("-")){let P=Y[0],$=`option creation failed due to '${P}' in option flags '${q}'`;if(/^-[^-][^-]/.test(P))throw new Error(`${$}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(K.test(P))throw new Error(`${$}
10
- - too many short flags`);if(Y.test(P))throw new Error(`${$}
10
+ - too many short flags`);if(f.test(P))throw new Error(`${$}
11
11
  - too many long flags`);throw new Error(`${$}
12
- - unrecognised flag format`)}if(_===void 0&&j===void 0)throw new Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:_,longFlag:j}}Mw.Option=K5;Mw.DualOptions=j5});var P5=q8((Rw)=>{function Sw(q,_){if(Math.abs(q.length-_.length)>3)return Math.max(q.length,_.length);let j=[];for(let K=0;K<=q.length;K++)j[K]=[K];for(let K=0;K<=_.length;K++)j[0][K]=K;for(let K=1;K<=_.length;K++)for(let Y=1;Y<=q.length;Y++){let f=1;if(q[Y-1]===_[K-1])f=0;else f=1;if(j[Y][K]=Math.min(j[Y-1][K]+1,j[Y][K-1]+1,j[Y-1][K-1]+f),Y>1&&K>1&&q[Y-1]===_[K-2]&&q[Y-2]===_[K-1])j[Y][K]=Math.min(j[Y][K],j[Y-2][K-2]+1)}return j[q.length][_.length]}function Ew(q,_){if(!_||_.length===0)return"";_=Array.from(new Set(_));let j=q.startsWith("--");if(j)q=q.slice(2),_=_.map((P)=>P.slice(2));let K=[],Y=3,f=0.4;if(_.forEach((P)=>{if(P.length<=1)return;let $=Sw(q,P),O=Math.max(q.length,P.length);if((O-$)/O>f){if($<Y)Y=$,K=[P];else if($===Y)K.push(P)}}),K.sort((P,$)=>P.localeCompare($)),j)K=K.map((P)=>`--${P}`);if(K.length>1)return`
12
+ - unrecognised flag format`)}if(_===void 0&&j===void 0)throw new Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:_,longFlag:j}}Iw.Option=z5;Iw.DualOptions=W5});var J5=q8((Lw)=>{function dw(q,_){if(Math.abs(q.length-_.length)>3)return Math.max(q.length,_.length);let j=[];for(let K=0;K<=q.length;K++)j[K]=[K];for(let K=0;K<=_.length;K++)j[0][K]=K;for(let K=1;K<=_.length;K++)for(let f=1;f<=q.length;f++){let Y=1;if(q[f-1]===_[K-1])Y=0;else Y=1;if(j[f][K]=Math.min(j[f-1][K]+1,j[f][K-1]+1,j[f-1][K-1]+Y),f>1&&K>1&&q[f-1]===_[K-2]&&q[f-2]===_[K-1])j[f][K]=Math.min(j[f][K],j[f-2][K-2]+1)}return j[q.length][_.length]}function pw(q,_){if(!_||_.length===0)return"";_=Array.from(new Set(_));let j=q.startsWith("--");if(j)q=q.slice(2),_=_.map((P)=>P.slice(2));let K=[],f=3,Y=0.4;if(_.forEach((P)=>{if(P.length<=1)return;let $=dw(q,P),O=Math.max(q.length,P.length);if((O-$)/O>Y){if($<f)f=$,K=[P];else if($===f)K.push(P)}}),K.sort((P,$)=>P.localeCompare($)),j)K=K.map((P)=>`--${P}`);if(K.length>1)return`
13
13
  (Did you mean one of ${K.join(", ")}?)`;if(K.length===1)return`
14
- (Did you mean ${K[0]}?)`;return""}Rw.suggestSimilar=Ew});var w5=q8((lw)=>{var Iw=h6("node:events").EventEmitter,Q7=h6("node:child_process"),Eq=h6("node:path"),I3=h6("node:fs"),N8=h6("node:process"),{Argument:gw,humanReadableArgName:yw}=m3(),{CommanderError:q4}=SK(),{Help:dw,stripColor:pw}=U7(),{Option:Y5,DualOptions:Lw}=s7(),{suggestSimilar:f5}=P5();class K4 extends Iw{constructor(q){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=q||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(_)=>N8.stdout.write(_),writeErr:(_)=>N8.stderr.write(_),outputError:(_,j)=>j(_),getOutHelpWidth:()=>N8.stdout.isTTY?N8.stdout.columns:void 0,getErrHelpWidth:()=>N8.stderr.isTTY?N8.stderr.columns:void 0,getOutHasColors:()=>_4()??(N8.stdout.isTTY&&N8.stdout.hasColors?.()),getErrHasColors:()=>_4()??(N8.stderr.isTTY&&N8.stderr.hasColors?.()),stripColor:(_)=>pw(_)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let _=this;_;_=_.parent)q.push(_);return q}command(q,_,j){let K=_,Y=j;if(typeof K==="object"&&K!==null)Y=K,K=null;Y=Y||{};let[,f,P]=q.match(/([^ ]+) *(.*)/),$=this.createCommand(f);if(K)$.description(K),$._executableHandler=!0;if(Y.isDefault)this._defaultCommandName=$._name;if($._hidden=!!(Y.noHelp||Y.hidden),$._executableFile=Y.executableFile||null,P)$.arguments(P);if(this._registerCommand($),$.parent=this,$.copyInheritedSettings(this),K)return this;return $}createCommand(q){return new K4(q)}createHelp(){return Object.assign(new dw,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return this._outputConfiguration=Object.assign({},this._outputConfiguration,q),this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,_){if(!q._name)throw new Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);if(_=_||{},_.isDefault)this._defaultCommandName=q._name;if(_.noHelp||_.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,_){return new gw(q,_)}argument(q,_,j,K){let Y=this.createArgument(q,_);if(typeof j==="function")Y.default(K).argParser(j);else Y.default(j);return this.addArgument(Y),this}arguments(q){return q.trim().split(/ +/).forEach((_)=>{this.argument(_)}),this}addArgument(q){let _=this.registeredArguments.slice(-1)[0];if(_&&_.variadic)throw new Error(`only the last argument can be variadic '${_.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,_){if(typeof q==="boolean"){if(this._addImplicitHelpCommand=q,q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let j=q??"help [command]",[,K,Y]=j.match(/([^ ]+) *(.*)/),f=_??"display help for command",P=this.createCommand(K);if(P.helpOption(!1),Y)P.arguments(Y);if(f)P.description(f);if(this._addImplicitHelpCommand=!0,this._helpCommand=P,q||_)this._initCommandGroup(P);return this}addHelpCommand(q,_){if(typeof q!=="object")return this.helpCommand(q,_),this;return this._addImplicitHelpCommand=!0,this._helpCommand=q,this._initCommandGroup(q),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(q,_){let j=["preSubcommand","preAction","postAction"];if(!j.includes(q))throw new Error(`Unexpected value for event passed to hook : '${q}'.
16
- Expecting one of '${j.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push(_);else this._lifeCycleHooks[q]=[_];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=(_)=>{if(_.code!=="commander.executeSubCommandAsync")throw _};return this}_exit(q,_,j){if(this._exitCallback)this._exitCallback(new q4(q,_,j));N8.exit(q)}action(q){let _=(j)=>{let K=this.registeredArguments.length,Y=j.slice(0,K);if(this._storeOptionsAsProperties)Y[K]=this;else Y[K]=this.opts();return Y.push(this),q.apply(this,Y)};return this._actionHandler=_,this}createOption(q,_){return new Y5(q,_)}_callParseArg(q,_,j,K){try{return q.parseArg(_,j)}catch(Y){if(Y.code==="commander.invalidArgument"){let f=`${K} ${Y.message}`;this.error(f,{exitCode:Y.exitCode,code:Y.code})}throw Y}}_registerOption(q){let _=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if(_){let j=q.long&&this._findOption(q.long)?q.long:q.short;throw new Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${j}'
17
- - already used by option '${_.flags}'`)}this._initOptionGroup(q),this.options.push(q)}_registerCommand(q){let _=(K)=>{return[K.name()].concat(K.aliases())},j=_(q).find((K)=>this._findCommand(K));if(j){let K=_(this._findCommand(j)).join("|"),Y=_(q).join("|");throw new Error(`cannot add command '${Y}' as already have command '${K}'`)}this._initCommandGroup(q),this.commands.push(q)}addOption(q){this._registerOption(q);let _=q.name(),j=q.attributeName();if(q.negate){let Y=q.long.replace(/^--no-/,"--");if(!this._findOption(Y))this.setOptionValueWithSource(j,q.defaultValue===void 0?!0:q.defaultValue,"default")}else if(q.defaultValue!==void 0)this.setOptionValueWithSource(j,q.defaultValue,"default");let K=(Y,f,P)=>{if(Y==null&&q.presetArg!==void 0)Y=q.presetArg;let $=this.getOptionValue(j);if(Y!==null&&q.parseArg)Y=this._callParseArg(q,Y,$,f);else if(Y!==null&&q.variadic)Y=q._concatValue(Y,$);if(Y==null)if(q.negate)Y=!1;else if(q.isBoolean()||q.optional)Y=!0;else Y="";this.setOptionValueWithSource(j,Y,P)};if(this.on("option:"+_,(Y)=>{let f=`error: option '${q.flags}' argument '${Y}' is invalid.`;K(Y,f,"cli")}),q.envVar)this.on("optionEnv:"+_,(Y)=>{let f=`error: option '${q.flags}' value '${Y}' from env '${q.envVar}' is invalid.`;K(Y,f,"env")});return this}_optionEx(q,_,j,K,Y){if(typeof _==="object"&&_ instanceof Y5)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let f=this.createOption(_,j);if(f.makeOptionMandatory(!!q.mandatory),typeof K==="function")f.default(Y).argParser(K);else if(K instanceof RegExp){let P=K;K=($,O)=>{let w=P.exec($);return w?w[0]:O},f.default(Y).argParser(K)}else f.default(K);return this.addOption(f)}option(q,_,j,K){return this._optionEx({},q,_,j,K)}requiredOption(q,_,j,K){return this._optionEx({mandatory:!0},q,_,j,K)}combineFlagAndOptionalValue(q=!0){return this._combineFlagAndOptionalValue=!!q,this}allowUnknownOption(q=!0){return this._allowUnknownOption=!!q,this}allowExcessArguments(q=!0){return this._allowExcessArguments=!!q,this}enablePositionalOptions(q=!0){return this._enablePositionalOptions=!!q,this}passThroughOptions(q=!0){return this._passThroughOptions=!!q,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(q=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!q,this}getOptionValue(q){if(this._storeOptionsAsProperties)return this[q];return this._optionValues[q]}setOptionValue(q,_){return this.setOptionValueWithSource(q,_,void 0)}setOptionValueWithSource(q,_,j){if(this._storeOptionsAsProperties)this[q]=_;else this._optionValues[q]=_;return this._optionValueSources[q]=j,this}getOptionValueSource(q){return this._optionValueSources[q]}getOptionValueSourceWithGlobals(q){let _;return this._getCommandAndAncestors().forEach((j)=>{if(j.getOptionValueSource(q)!==void 0)_=j.getOptionValueSource(q)}),_}_prepareUserArgs(q,_){if(q!==void 0&&!Array.isArray(q))throw new Error("first parameter to parse must be array or undefined");if(_=_||{},q===void 0&&_.from===void 0){if(N8.versions?.electron)_.from="electron";let K=N8.execArgv??[];if(K.includes("-e")||K.includes("--eval")||K.includes("-p")||K.includes("--print"))_.from="eval"}if(q===void 0)q=N8.argv;this.rawArgs=q.slice();let j;switch(_.from){case void 0:case"node":this._scriptPath=q[1],j=q.slice(2);break;case"electron":if(N8.defaultApp)this._scriptPath=q[1],j=q.slice(2);else j=q.slice(1);break;case"user":j=q.slice(0);break;case"eval":j=q.slice(1);break;default:throw new Error(`unexpected parse option { from: '${_.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",j}parse(q,_){this._prepareForParse();let j=this._prepareUserArgs(q,_);return this._parseCommand([],j),this}async parseAsync(q,_){this._prepareForParse();let j=this._prepareUserArgs(q,_);return await this._parseCommand([],j),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(q,_,j){if(I3.existsSync(q))return;let K=_?`searched for local subcommand relative to directory '${_}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",Y=`'${q}' does not exist
14
+ (Did you mean ${K[0]}?)`;return""}Lw.suggestSimilar=pw});var k5=q8((aw)=>{var xw=D6("node:events").EventEmitter,P4=D6("node:child_process"),mq=D6("node:path"),L3=D6("node:fs"),N8=D6("node:process"),{Argument:nw,humanReadableArgName:cw}=p3(),{CommanderError:f4}=gK(),{Help:rw,stripColor:iw}=K4(),{Option:H5,DualOptions:ow}=j4(),{suggestSimilar:T5}=J5();class $4 extends xw{constructor(q){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=q||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(_)=>N8.stdout.write(_),writeErr:(_)=>N8.stderr.write(_),outputError:(_,j)=>j(_),getOutHelpWidth:()=>N8.stdout.isTTY?N8.stdout.columns:void 0,getErrHelpWidth:()=>N8.stderr.isTTY?N8.stderr.columns:void 0,getOutHasColors:()=>Y4()??(N8.stdout.isTTY&&N8.stdout.hasColors?.()),getErrHasColors:()=>Y4()??(N8.stderr.isTTY&&N8.stderr.hasColors?.()),stripColor:(_)=>iw(_)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let _=this;_;_=_.parent)q.push(_);return q}command(q,_,j){let K=_,f=j;if(typeof K==="object"&&K!==null)f=K,K=null;f=f||{};let[,Y,P]=q.match(/([^ ]+) *(.*)/),$=this.createCommand(Y);if(K)$.description(K),$._executableHandler=!0;if(f.isDefault)this._defaultCommandName=$._name;if($._hidden=!!(f.noHelp||f.hidden),$._executableFile=f.executableFile||null,P)$.arguments(P);if(this._registerCommand($),$.parent=this,$.copyInheritedSettings(this),K)return this;return $}createCommand(q){return new $4(q)}createHelp(){return Object.assign(new rw,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return this._outputConfiguration=Object.assign({},this._outputConfiguration,q),this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,_){if(!q._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);if(_=_||{},_.isDefault)this._defaultCommandName=q._name;if(_.noHelp||_.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,_){return new nw(q,_)}argument(q,_,j,K){let f=this.createArgument(q,_);if(typeof j==="function")f.default(K).argParser(j);else f.default(j);return this.addArgument(f),this}arguments(q){return q.trim().split(/ +/).forEach((_)=>{this.argument(_)}),this}addArgument(q){let _=this.registeredArguments.slice(-1)[0];if(_&&_.variadic)throw new Error(`only the last argument can be variadic '${_.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,_){if(typeof q==="boolean"){if(this._addImplicitHelpCommand=q,q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let j=q??"help [command]",[,K,f]=j.match(/([^ ]+) *(.*)/),Y=_??"display help for command",P=this.createCommand(K);if(P.helpOption(!1),f)P.arguments(f);if(Y)P.description(Y);if(this._addImplicitHelpCommand=!0,this._helpCommand=P,q||_)this._initCommandGroup(P);return this}addHelpCommand(q,_){if(typeof q!=="object")return this.helpCommand(q,_),this;return this._addImplicitHelpCommand=!0,this._helpCommand=q,this._initCommandGroup(q),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(q,_){let j=["preSubcommand","preAction","postAction"];if(!j.includes(q))throw new Error(`Unexpected value for event passed to hook : '${q}'.
16
+ Expecting one of '${j.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push(_);else this._lifeCycleHooks[q]=[_];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=(_)=>{if(_.code!=="commander.executeSubCommandAsync")throw _};return this}_exit(q,_,j){if(this._exitCallback)this._exitCallback(new f4(q,_,j));N8.exit(q)}action(q){let _=(j)=>{let K=this.registeredArguments.length,f=j.slice(0,K);if(this._storeOptionsAsProperties)f[K]=this;else f[K]=this.opts();return f.push(this),q.apply(this,f)};return this._actionHandler=_,this}createOption(q,_){return new H5(q,_)}_callParseArg(q,_,j,K){try{return q.parseArg(_,j)}catch(f){if(f.code==="commander.invalidArgument"){let Y=`${K} ${f.message}`;this.error(Y,{exitCode:f.exitCode,code:f.code})}throw f}}_registerOption(q){let _=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if(_){let j=q.long&&this._findOption(q.long)?q.long:q.short;throw new Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${j}'
17
+ - already used by option '${_.flags}'`)}this._initOptionGroup(q),this.options.push(q)}_registerCommand(q){let _=(K)=>{return[K.name()].concat(K.aliases())},j=_(q).find((K)=>this._findCommand(K));if(j){let K=_(this._findCommand(j)).join("|"),f=_(q).join("|");throw new Error(`cannot add command '${f}' as already have command '${K}'`)}this._initCommandGroup(q),this.commands.push(q)}addOption(q){this._registerOption(q);let _=q.name(),j=q.attributeName();if(q.negate){let f=q.long.replace(/^--no-/,"--");if(!this._findOption(f))this.setOptionValueWithSource(j,q.defaultValue===void 0?!0:q.defaultValue,"default")}else if(q.defaultValue!==void 0)this.setOptionValueWithSource(j,q.defaultValue,"default");let K=(f,Y,P)=>{if(f==null&&q.presetArg!==void 0)f=q.presetArg;let $=this.getOptionValue(j);if(f!==null&&q.parseArg)f=this._callParseArg(q,f,$,Y);else if(f!==null&&q.variadic)f=q._concatValue(f,$);if(f==null)if(q.negate)f=!1;else if(q.isBoolean()||q.optional)f=!0;else f="";this.setOptionValueWithSource(j,f,P)};if(this.on("option:"+_,(f)=>{let Y=`error: option '${q.flags}' argument '${f}' is invalid.`;K(f,Y,"cli")}),q.envVar)this.on("optionEnv:"+_,(f)=>{let Y=`error: option '${q.flags}' value '${f}' from env '${q.envVar}' is invalid.`;K(f,Y,"env")});return this}_optionEx(q,_,j,K,f){if(typeof _==="object"&&_ instanceof H5)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let Y=this.createOption(_,j);if(Y.makeOptionMandatory(!!q.mandatory),typeof K==="function")Y.default(f).argParser(K);else if(K instanceof RegExp){let P=K;K=($,O)=>{let w=P.exec($);return w?w[0]:O},Y.default(f).argParser(K)}else Y.default(K);return this.addOption(Y)}option(q,_,j,K){return this._optionEx({},q,_,j,K)}requiredOption(q,_,j,K){return this._optionEx({mandatory:!0},q,_,j,K)}combineFlagAndOptionalValue(q=!0){return this._combineFlagAndOptionalValue=!!q,this}allowUnknownOption(q=!0){return this._allowUnknownOption=!!q,this}allowExcessArguments(q=!0){return this._allowExcessArguments=!!q,this}enablePositionalOptions(q=!0){return this._enablePositionalOptions=!!q,this}passThroughOptions(q=!0){return this._passThroughOptions=!!q,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(q=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!q,this}getOptionValue(q){if(this._storeOptionsAsProperties)return this[q];return this._optionValues[q]}setOptionValue(q,_){return this.setOptionValueWithSource(q,_,void 0)}setOptionValueWithSource(q,_,j){if(this._storeOptionsAsProperties)this[q]=_;else this._optionValues[q]=_;return this._optionValueSources[q]=j,this}getOptionValueSource(q){return this._optionValueSources[q]}getOptionValueSourceWithGlobals(q){let _;return this._getCommandAndAncestors().forEach((j)=>{if(j.getOptionValueSource(q)!==void 0)_=j.getOptionValueSource(q)}),_}_prepareUserArgs(q,_){if(q!==void 0&&!Array.isArray(q))throw new Error("first parameter to parse must be array or undefined");if(_=_||{},q===void 0&&_.from===void 0){if(N8.versions?.electron)_.from="electron";let K=N8.execArgv??[];if(K.includes("-e")||K.includes("--eval")||K.includes("-p")||K.includes("--print"))_.from="eval"}if(q===void 0)q=N8.argv;this.rawArgs=q.slice();let j;switch(_.from){case void 0:case"node":this._scriptPath=q[1],j=q.slice(2);break;case"electron":if(N8.defaultApp)this._scriptPath=q[1],j=q.slice(2);else j=q.slice(1);break;case"user":j=q.slice(0);break;case"eval":j=q.slice(1);break;default:throw new Error(`unexpected parse option { from: '${_.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",j}parse(q,_){this._prepareForParse();let j=this._prepareUserArgs(q,_);return this._parseCommand([],j),this}async parseAsync(q,_){this._prepareForParse();let j=this._prepareUserArgs(q,_);return await this._parseCommand([],j),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(q,_,j){if(L3.existsSync(q))return;let K=_?`searched for local subcommand relative to directory '${_}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",f=`'${q}' does not exist
19
19
  - if '${j}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${K}`;throw new Error(Y)}_executeSubCommand(q,_){_=_.slice();let j=!1,K=[".js",".ts",".tsx",".mjs",".cjs"];function Y(w,v){let z=Eq.resolve(w,v);if(I3.existsSync(z))return z;if(K.includes(Eq.extname(v)))return;let W=K.find((J)=>I3.existsSync(`${z}${J}`));if(W)return`${z}${W}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let f=q._executableFile||`${this._name}-${q._name}`,P=this._executableDir||"";if(this._scriptPath){let w;try{w=I3.realpathSync(this._scriptPath)}catch{w=this._scriptPath}P=Eq.resolve(Eq.dirname(w),P)}if(P){let w=Y(P,f);if(!w&&!q._executableFile&&this._scriptPath){let v=Eq.basename(this._scriptPath,Eq.extname(this._scriptPath));if(v!==this._name)w=Y(P,`${v}-${q._name}`)}f=w||f}j=K.includes(Eq.extname(f));let $;if(N8.platform!=="win32")if(j)_.unshift(f),_=$5(N8.execArgv).concat(_),$=Q7.spawn(N8.argv[0],_,{stdio:"inherit"});else $=Q7.spawn(f,_,{stdio:"inherit"});else this._checkForMissingExecutable(f,P,q._name),_.unshift(f),_=$5(N8.execArgv).concat(_),$=Q7.spawn(N8.execPath,_,{stdio:"inherit"});if(!$.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((v)=>{N8.on(v,()=>{if($.killed===!1&&$.exitCode===null)$.kill(v)})});let O=this._exitCallback;$.on("close",(w)=>{if(w=w??1,!O)N8.exit(w);else O(new q4(w,"commander.executeSubCommandAsync","(close)"))}),$.on("error",(w)=>{if(w.code==="ENOENT")this._checkForMissingExecutable(f,P,q._name);else if(w.code==="EACCES")throw new Error(`'${f}' not executable`);if(!O)N8.exit(1);else{let v=new q4(1,"commander.executeSubCommandAsync","(error)");v.nestedError=w,O(v)}}),this.runningCommand=$}_dispatchSubcommand(q,_,j){let K=this._findCommand(q);if(!K)this.help({error:!0});K._prepareForParse();let Y;return Y=this._chainOrCallSubCommandHook(Y,K,"preSubcommand"),Y=this._chainOrCall(Y,()=>{if(K._executableHandler)this._executeSubCommand(K,_.concat(j));else return K._parseCommand(_,j)}),Y}_dispatchHelpCommand(q){if(!q)this.help();let _=this._findCommand(q);if(_&&!_._executableHandler)_.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,_)=>{if(q.required&&this.args[_]==null)this.missingArgument(q.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let q=(j,K,Y)=>{let f=K;if(K!==null&&j.parseArg){let P=`error: command-argument value '${K}' is invalid for argument '${j.name()}'.`;f=this._callParseArg(j,K,Y,P)}return f};this._checkNumberOfArguments();let _=[];this.registeredArguments.forEach((j,K)=>{let Y=j.defaultValue;if(j.variadic){if(K<this.args.length){if(Y=this.args.slice(K),j.parseArg)Y=Y.reduce((f,P)=>{return q(j,P,f)},j.defaultValue)}else if(Y===void 0)Y=[]}else if(K<this.args.length){if(Y=this.args[K],j.parseArg)Y=q(j,Y,j.defaultValue)}_[K]=Y}),this.processedArgs=_}_chainOrCall(q,_){if(q&&q.then&&typeof q.then==="function")return q.then(()=>_());return _()}_chainOrCallHooks(q,_){let j=q,K=[];if(this._getCommandAndAncestors().reverse().filter((Y)=>Y._lifeCycleHooks[_]!==void 0).forEach((Y)=>{Y._lifeCycleHooks[_].forEach((f)=>{K.push({hookedCommand:Y,callback:f})})}),_==="postAction")K.reverse();return K.forEach((Y)=>{j=this._chainOrCall(j,()=>{return Y.callback(Y.hookedCommand,this)})}),j}_chainOrCallSubCommandHook(q,_,j){let K=q;if(this._lifeCycleHooks[j]!==void 0)this._lifeCycleHooks[j].forEach((Y)=>{K=this._chainOrCall(K,()=>{return Y(this,_)})});return K}_parseCommand(q,_){let j=this.parseOptions(_);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(j.operands),_=j.unknown,this.args=q.concat(_),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),_);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(_),this._dispatchSubcommand(this._defaultCommandName,q,_);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(j.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let K=()=>{if(j.unknown.length>0)this.unknownOption(j.unknown[0])},Y=`command:${this.name()}`;if(this._actionHandler){K(),this._processArguments();let f;if(f=this._chainOrCallHooks(f,"preAction"),f=this._chainOrCall(f,()=>this._actionHandler(this.processedArgs)),this.parent)f=this._chainOrCall(f,()=>{this.parent.emit(Y,q,_)});return f=this._chainOrCallHooks(f,"postAction"),f}if(this.parent&&this.parent.listenerCount(Y))K(),this._processArguments(),this.parent.emit(Y,q,_);else if(q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",q,_);if(this.listenerCount("command:*"))this.emit("command:*",q,_);else if(this.commands.length)this.unknownCommand();else K(),this._processArguments()}else if(this.commands.length)K(),this.help({error:!0});else K(),this._processArguments()}_findCommand(q){if(!q)return;return this.commands.find((_)=>_._name===q||_._aliases.includes(q))}_findOption(q){return this.options.find((_)=>_.is(q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((q)=>{q.options.forEach((_)=>{if(_.mandatory&&q.getOptionValue(_.attributeName())===void 0)q.missingMandatoryOptionValue(_)})})}_checkForConflictingLocalOptions(){let q=this.options.filter((j)=>{let K=j.attributeName();if(this.getOptionValue(K)===void 0)return!1;return this.getOptionValueSource(K)!=="default"});q.filter((j)=>j.conflictsWith.length>0).forEach((j)=>{let K=q.find((Y)=>j.conflictsWith.includes(Y.attributeName()));if(K)this._conflictingOption(j,K)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((q)=>{q._checkForConflictingLocalOptions()})}parseOptions(q){let _=[],j=[],K=_,Y=q.slice();function f(O){return O.length>1&&O[0]==="-"}let P=(O)=>{if(!/^-\d*\.?\d+(e[+-]?\d+)?$/.test(O))return!1;return!this._getCommandAndAncestors().some((w)=>w.options.map((v)=>v.short).some((v)=>/^-\d$/.test(v)))},$=null;while(Y.length){let O=Y.shift();if(O==="--"){if(K===j)K.push(O);K.push(...Y);break}if($&&(!f(O)||P(O))){this.emit(`option:${$.name()}`,O);continue}if($=null,f(O)){let w=this._findOption(O);if(w){if(w.required){let v=Y.shift();if(v===void 0)this.optionMissingArgument(w);this.emit(`option:${w.name()}`,v)}else if(w.optional){let v=null;if(Y.length>0&&(!f(Y[0])||P(Y[0])))v=Y.shift();this.emit(`option:${w.name()}`,v)}else this.emit(`option:${w.name()}`);$=w.variadic?w:null;continue}}if(O.length>2&&O[0]==="-"&&O[1]!=="-"){let w=this._findOption(`-${O[1]}`);if(w){if(w.required||w.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${w.name()}`,O.slice(2));else this.emit(`option:${w.name()}`),Y.unshift(`-${O.slice(2)}`);continue}}if(/^--[^=]+=/.test(O)){let w=O.indexOf("="),v=this._findOption(O.slice(0,w));if(v&&(v.required||v.optional)){this.emit(`option:${v.name()}`,O.slice(w+1));continue}}if(K===_&&f(O)&&!(this.commands.length===0&&P(O)))K=j;if((this._enablePositionalOptions||this._passThroughOptions)&&_.length===0&&j.length===0){if(this._findCommand(O)){if(_.push(O),Y.length>0)j.push(...Y);break}else if(this._getHelpCommand()&&O===this._getHelpCommand().name()){if(_.push(O),Y.length>0)_.push(...Y);break}else if(this._defaultCommandName){if(j.push(O),Y.length>0)j.push(...Y);break}}if(this._passThroughOptions){if(K.push(O),Y.length>0)K.push(...Y);break}K.push(O)}return{operands:_,unknown:j}}opts(){if(this._storeOptionsAsProperties){let q={},_=this.options.length;for(let j=0;j<_;j++){let K=this.options[j].attributeName();q[K]=K===this._versionOptionName?this._version:this[K]}return q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((q,_)=>Object.assign(q,_.opts()),{})}error(q,_){if(this._outputConfiguration.outputError(`${q}
21
+ - ${K}`;throw new Error(f)}_executeSubCommand(q,_){_=_.slice();let j=!1,K=[".js",".ts",".tsx",".mjs",".cjs"];function f(w,v){let z=mq.resolve(w,v);if(L3.existsSync(z))return z;if(K.includes(mq.extname(v)))return;let W=K.find((H)=>L3.existsSync(`${z}${H}`));if(W)return`${z}${W}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Y=q._executableFile||`${this._name}-${q._name}`,P=this._executableDir||"";if(this._scriptPath){let w;try{w=L3.realpathSync(this._scriptPath)}catch{w=this._scriptPath}P=mq.resolve(mq.dirname(w),P)}if(P){let w=f(P,Y);if(!w&&!q._executableFile&&this._scriptPath){let v=mq.basename(this._scriptPath,mq.extname(this._scriptPath));if(v!==this._name)w=f(P,`${v}-${q._name}`)}Y=w||Y}j=K.includes(mq.extname(Y));let $;if(N8.platform!=="win32")if(j)_.unshift(Y),_=Z5(N8.execArgv).concat(_),$=P4.spawn(N8.argv[0],_,{stdio:"inherit"});else $=P4.spawn(Y,_,{stdio:"inherit"});else this._checkForMissingExecutable(Y,P,q._name),_.unshift(Y),_=Z5(N8.execArgv).concat(_),$=P4.spawn(N8.execPath,_,{stdio:"inherit"});if(!$.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((v)=>{N8.on(v,()=>{if($.killed===!1&&$.exitCode===null)$.kill(v)})});let O=this._exitCallback;$.on("close",(w)=>{if(w=w??1,!O)N8.exit(w);else O(new f4(w,"commander.executeSubCommandAsync","(close)"))}),$.on("error",(w)=>{if(w.code==="ENOENT")this._checkForMissingExecutable(Y,P,q._name);else if(w.code==="EACCES")throw new Error(`'${Y}' not executable`);if(!O)N8.exit(1);else{let v=new f4(1,"commander.executeSubCommandAsync","(error)");v.nestedError=w,O(v)}}),this.runningCommand=$}_dispatchSubcommand(q,_,j){let K=this._findCommand(q);if(!K)this.help({error:!0});K._prepareForParse();let f;return f=this._chainOrCallSubCommandHook(f,K,"preSubcommand"),f=this._chainOrCall(f,()=>{if(K._executableHandler)this._executeSubCommand(K,_.concat(j));else return K._parseCommand(_,j)}),f}_dispatchHelpCommand(q){if(!q)this.help();let _=this._findCommand(q);if(_&&!_._executableHandler)_.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,_)=>{if(q.required&&this.args[_]==null)this.missingArgument(q.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let q=(j,K,f)=>{let Y=K;if(K!==null&&j.parseArg){let P=`error: command-argument value '${K}' is invalid for argument '${j.name()}'.`;Y=this._callParseArg(j,K,f,P)}return Y};this._checkNumberOfArguments();let _=[];this.registeredArguments.forEach((j,K)=>{let f=j.defaultValue;if(j.variadic){if(K<this.args.length){if(f=this.args.slice(K),j.parseArg)f=f.reduce((Y,P)=>{return q(j,P,Y)},j.defaultValue)}else if(f===void 0)f=[]}else if(K<this.args.length){if(f=this.args[K],j.parseArg)f=q(j,f,j.defaultValue)}_[K]=f}),this.processedArgs=_}_chainOrCall(q,_){if(q&&q.then&&typeof q.then==="function")return q.then(()=>_());return _()}_chainOrCallHooks(q,_){let j=q,K=[];if(this._getCommandAndAncestors().reverse().filter((f)=>f._lifeCycleHooks[_]!==void 0).forEach((f)=>{f._lifeCycleHooks[_].forEach((Y)=>{K.push({hookedCommand:f,callback:Y})})}),_==="postAction")K.reverse();return K.forEach((f)=>{j=this._chainOrCall(j,()=>{return f.callback(f.hookedCommand,this)})}),j}_chainOrCallSubCommandHook(q,_,j){let K=q;if(this._lifeCycleHooks[j]!==void 0)this._lifeCycleHooks[j].forEach((f)=>{K=this._chainOrCall(K,()=>{return f(this,_)})});return K}_parseCommand(q,_){let j=this.parseOptions(_);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(j.operands),_=j.unknown,this.args=q.concat(_),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),_);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(_),this._dispatchSubcommand(this._defaultCommandName,q,_);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(j.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let K=()=>{if(j.unknown.length>0)this.unknownOption(j.unknown[0])},f=`command:${this.name()}`;if(this._actionHandler){K(),this._processArguments();let Y;if(Y=this._chainOrCallHooks(Y,"preAction"),Y=this._chainOrCall(Y,()=>this._actionHandler(this.processedArgs)),this.parent)Y=this._chainOrCall(Y,()=>{this.parent.emit(f,q,_)});return Y=this._chainOrCallHooks(Y,"postAction"),Y}if(this.parent&&this.parent.listenerCount(f))K(),this._processArguments(),this.parent.emit(f,q,_);else if(q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",q,_);if(this.listenerCount("command:*"))this.emit("command:*",q,_);else if(this.commands.length)this.unknownCommand();else K(),this._processArguments()}else if(this.commands.length)K(),this.help({error:!0});else K(),this._processArguments()}_findCommand(q){if(!q)return;return this.commands.find((_)=>_._name===q||_._aliases.includes(q))}_findOption(q){return this.options.find((_)=>_.is(q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((q)=>{q.options.forEach((_)=>{if(_.mandatory&&q.getOptionValue(_.attributeName())===void 0)q.missingMandatoryOptionValue(_)})})}_checkForConflictingLocalOptions(){let q=this.options.filter((j)=>{let K=j.attributeName();if(this.getOptionValue(K)===void 0)return!1;return this.getOptionValueSource(K)!=="default"});q.filter((j)=>j.conflictsWith.length>0).forEach((j)=>{let K=q.find((f)=>j.conflictsWith.includes(f.attributeName()));if(K)this._conflictingOption(j,K)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((q)=>{q._checkForConflictingLocalOptions()})}parseOptions(q){let _=[],j=[],K=_,f=q.slice();function Y(O){return O.length>1&&O[0]==="-"}let P=(O)=>{if(!/^-\d*\.?\d+(e[+-]?\d+)?$/.test(O))return!1;return!this._getCommandAndAncestors().some((w)=>w.options.map((v)=>v.short).some((v)=>/^-\d$/.test(v)))},$=null;while(f.length){let O=f.shift();if(O==="--"){if(K===j)K.push(O);K.push(...f);break}if($&&(!Y(O)||P(O))){this.emit(`option:${$.name()}`,O);continue}if($=null,Y(O)){let w=this._findOption(O);if(w){if(w.required){let v=f.shift();if(v===void 0)this.optionMissingArgument(w);this.emit(`option:${w.name()}`,v)}else if(w.optional){let v=null;if(f.length>0&&(!Y(f[0])||P(f[0])))v=f.shift();this.emit(`option:${w.name()}`,v)}else this.emit(`option:${w.name()}`);$=w.variadic?w:null;continue}}if(O.length>2&&O[0]==="-"&&O[1]!=="-"){let w=this._findOption(`-${O[1]}`);if(w){if(w.required||w.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${w.name()}`,O.slice(2));else this.emit(`option:${w.name()}`),f.unshift(`-${O.slice(2)}`);continue}}if(/^--[^=]+=/.test(O)){let w=O.indexOf("="),v=this._findOption(O.slice(0,w));if(v&&(v.required||v.optional)){this.emit(`option:${v.name()}`,O.slice(w+1));continue}}if(K===_&&Y(O)&&!(this.commands.length===0&&P(O)))K=j;if((this._enablePositionalOptions||this._passThroughOptions)&&_.length===0&&j.length===0){if(this._findCommand(O)){if(_.push(O),f.length>0)j.push(...f);break}else if(this._getHelpCommand()&&O===this._getHelpCommand().name()){if(_.push(O),f.length>0)_.push(...f);break}else if(this._defaultCommandName){if(j.push(O),f.length>0)j.push(...f);break}}if(this._passThroughOptions){if(K.push(O),f.length>0)K.push(...f);break}K.push(O)}return{operands:_,unknown:j}}opts(){if(this._storeOptionsAsProperties){let q={},_=this.options.length;for(let j=0;j<_;j++){let K=this.options[j].attributeName();q[K]=K===this._versionOptionName?this._version:this[K]}return q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((q,_)=>Object.assign(q,_.opts()),{})}error(q,_){if(this._outputConfiguration.outputError(`${q}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0});let j=_||{},K=j.exitCode||1,Y=j.code||"commander.error";this._exit(K,Y,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in N8.env){let _=q.attributeName();if(this.getOptionValue(_)===void 0||["default","config","env"].includes(this.getOptionValueSource(_)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,N8.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new Lw(this.options),_=(j)=>{return this.getOptionValue(j)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(j))};this.options.filter((j)=>j.implied!==void 0&&_(j.attributeName())&&q.valueFromOption(this.getOptionValue(j.attributeName()),j)).forEach((j)=>{Object.keys(j.implied).filter((K)=>!_(K)).forEach((K)=>{this.setOptionValueWithSource(K,j.implied[K],"implied")})})}missingArgument(q){let _=`error: missing required argument '${q}'`;this.error(_,{code:"commander.missingArgument"})}optionMissingArgument(q){let _=`error: option '${q.flags}' argument missing`;this.error(_,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let _=`error: required option '${q.flags}' not specified`;this.error(_,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,_){let j=(f)=>{let P=f.attributeName(),$=this.getOptionValue(P),O=this.options.find((v)=>v.negate&&P===v.attributeName()),w=this.options.find((v)=>!v.negate&&P===v.attributeName());if(O&&(O.presetArg===void 0&&$===!1||O.presetArg!==void 0&&$===O.presetArg))return O;return w||f},K=(f)=>{let P=j(f),$=P.attributeName();if(this.getOptionValueSource($)==="env")return`environment variable '${P.envVar}'`;return`option '${P.flags}'`},Y=`error: ${K(q)} cannot be used with ${K(_)}`;this.error(Y,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let _="";if(q.startsWith("--")&&this._showSuggestionAfterError){let K=[],Y=this;do{let f=Y.createHelp().visibleOptions(Y).filter((P)=>P.long).map((P)=>P.long);K=K.concat(f),Y=Y.parent}while(Y&&!Y._enablePositionalOptions);_=f5(q,K)}let j=`error: unknown option '${q}'${_}`;this.error(j,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let _=this.registeredArguments.length,j=_===1?"":"s",Y=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${_} argument${j} but got ${q.length}.`;this.error(Y,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],_="";if(this._showSuggestionAfterError){let K=[];this.createHelp().visibleCommands(this).forEach((Y)=>{if(K.push(Y.name()),Y.alias())K.push(Y.alias())}),_=f5(q,K)}let j=`error: unknown command '${q}'${_}`;this.error(j,{code:"commander.unknownCommand"})}version(q,_,j){if(q===void 0)return this._version;this._version=q,_=_||"-V, --version",j=j||"output the version number";let K=this.createOption(_,j);return this._versionOptionName=K.attributeName(),this._registerOption(K),this.on("option:"+K.name(),()=>{this._outputConfiguration.writeOut(`${q}
25
- `),this._exit(0,"commander.version",q)}),this}description(q,_){if(q===void 0&&_===void 0)return this._description;if(this._description=q,_)this._argsDescription=_;return this}summary(q){if(q===void 0)return this._summary;return this._summary=q,this}alias(q){if(q===void 0)return this._aliases[0];let _=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)_=this.commands[this.commands.length-1];if(q===_._name)throw new Error("Command alias can't be the same as its name");let j=this.parent?._findCommand(q);if(j){let K=[j.name()].concat(j.aliases()).join("|");throw new Error(`cannot add alias '${q}' to command '${this.name()}' as already have command '${K}'`)}return _._aliases.push(q),this}aliases(q){if(q===void 0)return this._aliases;return q.forEach((_)=>this.alias(_)),this}usage(q){if(q===void 0){if(this._usage)return this._usage;let _=this.registeredArguments.map((j)=>{return yw(j)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?_:[]).join(" ")}return this._usage=q,this}name(q){if(q===void 0)return this._name;return this._name=q,this}helpGroup(q){if(q===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=q,this}commandsGroup(q){if(q===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=q,this}optionsGroup(q){if(q===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=q,this}_initOptionGroup(q){if(this._defaultOptionGroup&&!q.helpGroupHeading)q.helpGroup(this._defaultOptionGroup)}_initCommandGroup(q){if(this._defaultCommandGroup&&!q.helpGroup())q.helpGroup(this._defaultCommandGroup)}nameFromFilename(q){return this._name=Eq.basename(q,Eq.extname(q)),this}executableDir(q){if(q===void 0)return this._executableDir;return this._executableDir=q,this}helpInformation(q){let _=this.createHelp(),j=this._getOutputContext(q);_.prepareContext({error:j.error,helpWidth:j.helpWidth,outputHasColors:j.hasColors});let K=_.formatHelp(this,_);if(j.hasColors)return K;return this._outputConfiguration.stripColor(K)}_getOutputContext(q){q=q||{};let _=!!q.error,j,K,Y;if(_)j=(P)=>this._outputConfiguration.writeErr(P),K=this._outputConfiguration.getErrHasColors(),Y=this._outputConfiguration.getErrHelpWidth();else j=(P)=>this._outputConfiguration.writeOut(P),K=this._outputConfiguration.getOutHasColors(),Y=this._outputConfiguration.getOutHelpWidth();return{error:_,write:(P)=>{if(!K)P=this._outputConfiguration.stripColor(P);return j(P)},hasColors:K,helpWidth:Y}}outputHelp(q){let _;if(typeof q==="function")_=q,q=void 0;let j=this._getOutputContext(q),K={error:j.error,write:j.write,command:this};this._getCommandAndAncestors().reverse().forEach((f)=>f.emit("beforeAllHelp",K)),this.emit("beforeHelp",K);let Y=this.helpInformation({error:j.error});if(_){if(Y=_(Y),typeof Y!=="string"&&!Buffer.isBuffer(Y))throw new Error("outputHelp callback must return a string or a Buffer")}if(j.write(Y),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",K),this._getCommandAndAncestors().forEach((f)=>f.emit("afterAllHelp",K))}helpOption(q,_){if(typeof q==="boolean"){if(q){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(q??"-h, --help",_??"display help for command"),q||_)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(q){return this._helpOption=q,this._initOptionGroup(q),this}help(q){this.outputHelp(q);let _=Number(N8.exitCode??0);if(_===0&&q&&typeof q!=="function"&&q.error)_=1;this._exit(_,"commander.help","(outputHelp)")}addHelpText(q,_){let j=["beforeAll","before","after","afterAll"];if(!j.includes(q))throw new Error(`Unexpected value for position to addHelpText.
26
- Expecting one of '${j.join("', '")}'`);let K=`${q}Help`;return this.on(K,(Y)=>{let f;if(typeof _==="function")f=_({error:Y.error,command:Y.command});else f=_;if(f)Y.write(`${f}
27
- `)}),this}_outputHelpIfRequested(q){let _=this._getHelpOption();if(_&&q.find((K)=>_.is(K)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function $5(q){return q.map((_)=>{if(!_.startsWith("--inspect"))return _;let j,K="127.0.0.1",Y="9229",f;if((f=_.match(/^(--inspect(-brk)?)$/))!==null)j=f[1];else if((f=_.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(j=f[1],/^\d+$/.test(f[3]))Y=f[3];else K=f[3];else if((f=_.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)j=f[1],K=f[3],Y=f[4];if(j&&Y!=="0")return`${j}=${K}:${parseInt(Y)+1}`;return _})}function _4(){if(N8.env.NO_COLOR||N8.env.FORCE_COLOR==="0"||N8.env.FORCE_COLOR==="false")return!1;if(N8.env.FORCE_COLOR||N8.env.CLICOLOR_FORCE!==void 0)return!0;return}lw.Command=K4;lw.useColor=_4});var W5=q8((iw)=>{var{Argument:O5}=m3(),{Command:j4}=w5(),{CommanderError:cw,InvalidArgumentError:v5}=SK(),{Help:rw}=U7(),{Option:z5}=s7();iw.program=new j4;iw.createCommand=(q)=>new j4(q);iw.createOption=(q,_)=>new z5(q,_);iw.createArgument=(q,_)=>new O5(q,_);iw.Command=j4;iw.Option=z5;iw.Argument=O5;iw.Help=rw;iw.CommanderError=cw;iw.InvalidArgumentError=v5;iw.InvalidOptionArgumentError=v5});var D6=q8((kO)=>{kO.__esModule=!0;kO.extend=D5;kO.indexOf=zO;kO.escapeExpression=WO;kO.isEmpty=JO;kO.createFrame=HO;kO.blockParams=TO;kO.appendContextPath=ZO;var $O={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},wO=/[&<>"'`=]/g,OO=/[&<>"'`=]/;function vO(q){return $O[q]}function D5(q){for(var _=1;_<arguments.length;_++)for(var j in arguments[_])if(Object.prototype.hasOwnProperty.call(arguments[_],j))q[j]=arguments[_][j];return q}var Y4=Object.prototype.toString;kO.toString=Y4;var P4=function q(_){return typeof _==="function"};if(P4(/x/))kO.isFunction=P4=function(q){return typeof q==="function"&&Y4.call(q)==="[object Function]"};kO.isFunction=P4;var C5=Array.isArray||function(q){return q&&typeof q==="object"?Y4.call(q)==="[object Array]":!1};kO.isArray=C5;function zO(q,_){for(var j=0,K=q.length;j<K;j++)if(q[j]===_)return j;return-1}function WO(q){if(typeof q!=="string"){if(q&&q.toHTML)return q.toHTML();else if(q==null)return"";else if(!q)return q+"";q=""+q}if(!OO.test(q))return q;return q.replace(wO,vO)}function JO(q){if(!q&&q!==0)return!0;else if(C5(q)&&q.length===0)return!0;else return!1}function HO(q){var _=D5({},q);return _._parent=q,_}function TO(q,_){return q.path=_,q}function ZO(q,_){return(q?q+".":"")+_}});var t6=q8((V5,M5)=>{V5.__esModule=!0;var f4=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function $4(q,_){var j=_&&_.loc,K=void 0,Y=void 0,f=void 0,P=void 0;if(j)K=j.start.line,Y=j.end.line,f=j.start.column,P=j.end.column,q+=" - "+K+":"+f;var $=Error.prototype.constructor.call(this,q);for(var O=0;O<f4.length;O++)this[f4[O]]=$[f4[O]];if(Error.captureStackTrace)Error.captureStackTrace(this,$4);try{if(j)if(this.lineNumber=K,this.endLineNumber=Y,Object.defineProperty)Object.defineProperty(this,"column",{value:f,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:P,enumerable:!0});else this.column=f,this.endColumn=P}catch(w){}}$4.prototype=new Error;V5.default=$4;M5.exports=V5.default});var S5=q8((N5,b5)=>{N5.__esModule=!0;var w4=D6();N5.default=function(q){q.registerHelper("blockHelperMissing",function(_,j){var{inverse:K,fn:Y}=j;if(_===!0)return Y(this);else if(_===!1||_==null)return K(this);else if(w4.isArray(_))if(_.length>0){if(j.ids)j.ids=[j.name];return q.helpers.each(_,j)}else return K(this);else{if(j.data&&j.ids){var f=w4.createFrame(j.data);f.contextPath=w4.appendContextPath(j.data.contextPath,j.name),j={data:f}}return Y(_,j)}})};b5.exports=N5.default});var m5=q8((E5,R5)=>{E5.__esModule=!0;function IO(q){return q&&q.__esModule?q:{default:q}}var EK=D6(),gO=t6(),yO=IO(gO);E5.default=function(q){q.registerHelper("each",function(_,j){if(!j)throw new yO.default("Must pass iterator to #each");var{fn:K,inverse:Y}=j,f=0,P="",$=void 0,O=void 0;if(j.data&&j.ids)O=EK.appendContextPath(j.data.contextPath,j.ids[0])+".";if(EK.isFunction(_))_=_.call(this);if(j.data)$=EK.createFrame(j.data);function w(Z,H,X){if($){if($.key=Z,$.index=H,$.first=H===0,$.last=!!X,O)$.contextPath=O+Z}P=P+K(_[Z],{data:$,blockParams:EK.blockParams([_[Z],Z],[O+Z,null])})}if(_&&typeof _==="object")if(EK.isArray(_)){for(var v=_.length;f<v;f++)if(f in _)w(f,f,f===_.length-1)}else if(typeof Symbol==="function"&&_[Symbol.iterator]){var z=[],W=_[Symbol.iterator]();for(var J=W.next();!J.done;J=W.next())z.push(J.value);_=z;for(var v=_.length;f<v;f++)w(f,f,f===_.length-1)}else(function(){var Z=void 0;if(Object.keys(_).forEach(function(H){if(Z!==void 0)w(Z,f-1);Z=H,f++}),Z!==void 0)w(Z,f-1,!0)})();if(f===0)P=Y(this);return P})};R5.exports=E5.default});var y5=q8((I5,g5)=>{I5.__esModule=!0;function LO(q){return q&&q.__esModule?q:{default:q}}var lO=t6(),xO=LO(lO);I5.default=function(q){q.registerHelper("helperMissing",function(){if(arguments.length===1)return;else throw new xO.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};g5.exports=I5.default});var x5=q8((L5,l5)=>{L5.__esModule=!0;function rO(q){return q&&q.__esModule?q:{default:q}}var d5=D6(),iO=t6(),p5=rO(iO);L5.default=function(q){q.registerHelper("if",function(_,j){if(arguments.length!=2)throw new p5.default("#if requires exactly one argument");if(d5.isFunction(_))_=_.call(this);if(!j.hash.includeZero&&!_||d5.isEmpty(_))return j.inverse(this);else return j.fn(this)}),q.registerHelper("unless",function(_,j){if(arguments.length!=2)throw new p5.default("#unless requires exactly one argument");return q.helpers.if.call(this,_,{fn:j.inverse,inverse:j.fn,hash:j.hash})})};l5.exports=L5.default});var r5=q8((n5,c5)=>{n5.__esModule=!0;n5.default=function(q){q.registerHelper("log",function(){var _=[void 0],j=arguments[arguments.length-1];for(var K=0;K<arguments.length-1;K++)_.push(arguments[K]);var Y=1;if(j.hash.level!=null)Y=j.hash.level;else if(j.data&&j.data.level!=null)Y=j.data.level;_[0]=Y,q.log.apply(q,_)})};c5.exports=n5.default});var a5=q8((i5,o5)=>{i5.__esModule=!0;i5.default=function(q){q.registerHelper("lookup",function(_,j,K){if(!_)return _;return K.lookupProperty(_,j)})};o5.exports=i5.default});var e5=q8((B5,t5)=>{B5.__esModule=!0;function UO(q){return q&&q.__esModule?q:{default:q}}var RK=D6(),sO=t6(),QO=UO(sO);B5.default=function(q){q.registerHelper("with",function(_,j){if(arguments.length!=2)throw new QO.default("#with requires exactly one argument");if(RK.isFunction(_))_=_.call(this);var K=j.fn;if(!RK.isEmpty(_)){var Y=j.data;if(j.data&&j.ids)Y=RK.createFrame(j.data),Y.contextPath=RK.appendContextPath(j.data.contextPath,j.ids[0]);return K(_,{data:Y,blockParams:RK.blockParams([_],[Y&&Y.contextPath])})}else return j.inverse(this)})};t5.exports=B5.default});var O4=q8((Xv)=>{Xv.__esModule=!0;Xv.registerDefaultHelpers=Zv;Xv.moveHelperToHooks=kv;function f_(q){return q&&q.__esModule?q:{default:q}}var Kv=S5(),jv=f_(Kv),Pv=m5(),Yv=f_(Pv),fv=y5(),$v=f_(fv),wv=x5(),Ov=f_(wv),vv=r5(),zv=f_(vv),Wv=a5(),Jv=f_(Wv),Hv=e5(),Tv=f_(Hv);function Zv(q){jv.default(q),Yv.default(q),$v.default(q),Ov.default(q),zv.default(q),Jv.default(q),Tv.default(q)}function kv(q,_,j){if(q.helpers[_]){if(q.hooks[_]=q.helpers[_],!j)delete q.helpers[_]}}});var s5=q8((F5,U5)=>{F5.__esModule=!0;var hv=D6();F5.default=function(q){q.registerDecorator("inline",function(_,j,K,Y){var f=_;if(!j.partials)j.partials={},f=function(P,$){var O=K.partials;K.partials=hv.extend({},O,j.partials);var w=_(P,$);return K.partials=O,w};return j.partials[Y.args[0]]=Y.fn,f})};U5.exports=F5.default});var Q5=q8((Sv)=>{Sv.__esModule=!0;Sv.registerDefaultDecorators=bv;function Vv(q){return q&&q.__esModule?q:{default:q}}var Mv=s5(),Nv=Vv(Mv);function bv(q){Nv.default(q)}});var v4=q8((qj,_j)=>{qj.__esModule=!0;var mv=D6(),y_={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function q(_){if(typeof _==="string"){var j=mv.indexOf(y_.methodMap,_.toLowerCase());if(j>=0)_=j;else _=parseInt(_,10)}return _},log:function q(_){if(_=y_.lookupLevel(_),typeof console!=="undefined"&&y_.lookupLevel(y_.level)<=_){var j=y_.methodMap[_];if(!console[j])j="log";for(var K=arguments.length,Y=Array(K>1?K-1:0),f=1;f<K;f++)Y[f-1]=arguments[f];console[j].apply(console,Y)}}};qj.default=y_;_j.exports=qj.default});var Kj=q8((pv)=>{pv.__esModule=!0;pv.createNewLookupObject=dv;var yv=D6();function dv(){for(var q=arguments.length,_=Array(q),j=0;j<q;j++)_[j]=arguments[j];return yv.extend.apply(void 0,[Object.create(null)].concat(_))}});var z4=q8((Bv)=>{Bv.__esModule=!0;Bv.createProtoAccessControl=rv;Bv.resultIsAllowed=iv;Bv.resetLoggedProperties=av;function xv(q){return q&&q.__esModule?q:{default:q}}var jj=Kj(),nv=v4(),cv=xv(nv),g3=Object.create(null);function rv(q){var _=Object.create(null);_.constructor=!1,_.__defineGetter__=!1,_.__defineSetter__=!1,_.__lookupGetter__=!1;var j=Object.create(null);return j.__proto__=!1,{properties:{whitelist:jj.createNewLookupObject(j,q.allowedProtoProperties),defaultValue:q.allowProtoPropertiesByDefault},methods:{whitelist:jj.createNewLookupObject(_,q.allowedProtoMethods),defaultValue:q.allowProtoMethodsByDefault}}}function iv(q,_,j){if(typeof q==="function")return Pj(_.methods,j);else return Pj(_.properties,j)}function Pj(q,_){if(q.whitelist[_]!==void 0)return q.whitelist[_]===!0;if(q.defaultValue!==void 0)return q.defaultValue;return ov(_),!1}function ov(q){if(g3[q]!==!0)g3[q]=!0,cv.default.log("error",'Handlebars: Access has been denied to resolve the property "'+q+`" because it is not an "own property" of its parent.
24
+ `),this.outputHelp({error:!0});let j=_||{},K=j.exitCode||1,f=j.code||"commander.error";this._exit(K,f,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in N8.env){let _=q.attributeName();if(this.getOptionValue(_)===void 0||["default","config","env"].includes(this.getOptionValueSource(_)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,N8.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new ow(this.options),_=(j)=>{return this.getOptionValue(j)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(j))};this.options.filter((j)=>j.implied!==void 0&&_(j.attributeName())&&q.valueFromOption(this.getOptionValue(j.attributeName()),j)).forEach((j)=>{Object.keys(j.implied).filter((K)=>!_(K)).forEach((K)=>{this.setOptionValueWithSource(K,j.implied[K],"implied")})})}missingArgument(q){let _=`error: missing required argument '${q}'`;this.error(_,{code:"commander.missingArgument"})}optionMissingArgument(q){let _=`error: option '${q.flags}' argument missing`;this.error(_,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let _=`error: required option '${q.flags}' not specified`;this.error(_,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,_){let j=(Y)=>{let P=Y.attributeName(),$=this.getOptionValue(P),O=this.options.find((v)=>v.negate&&P===v.attributeName()),w=this.options.find((v)=>!v.negate&&P===v.attributeName());if(O&&(O.presetArg===void 0&&$===!1||O.presetArg!==void 0&&$===O.presetArg))return O;return w||Y},K=(Y)=>{let P=j(Y),$=P.attributeName();if(this.getOptionValueSource($)==="env")return`environment variable '${P.envVar}'`;return`option '${P.flags}'`},f=`error: ${K(q)} cannot be used with ${K(_)}`;this.error(f,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let _="";if(q.startsWith("--")&&this._showSuggestionAfterError){let K=[],f=this;do{let Y=f.createHelp().visibleOptions(f).filter((P)=>P.long).map((P)=>P.long);K=K.concat(Y),f=f.parent}while(f&&!f._enablePositionalOptions);_=T5(q,K)}let j=`error: unknown option '${q}'${_}`;this.error(j,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let _=this.registeredArguments.length,j=_===1?"":"s",f=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${_} argument${j} but got ${q.length}.`;this.error(f,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],_="";if(this._showSuggestionAfterError){let K=[];this.createHelp().visibleCommands(this).forEach((f)=>{if(K.push(f.name()),f.alias())K.push(f.alias())}),_=T5(q,K)}let j=`error: unknown command '${q}'${_}`;this.error(j,{code:"commander.unknownCommand"})}version(q,_,j){if(q===void 0)return this._version;this._version=q,_=_||"-V, --version",j=j||"output the version number";let K=this.createOption(_,j);return this._versionOptionName=K.attributeName(),this._registerOption(K),this.on("option:"+K.name(),()=>{this._outputConfiguration.writeOut(`${q}
25
+ `),this._exit(0,"commander.version",q)}),this}description(q,_){if(q===void 0&&_===void 0)return this._description;if(this._description=q,_)this._argsDescription=_;return this}summary(q){if(q===void 0)return this._summary;return this._summary=q,this}alias(q){if(q===void 0)return this._aliases[0];let _=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)_=this.commands[this.commands.length-1];if(q===_._name)throw new Error("Command alias can't be the same as its name");let j=this.parent?._findCommand(q);if(j){let K=[j.name()].concat(j.aliases()).join("|");throw new Error(`cannot add alias '${q}' to command '${this.name()}' as already have command '${K}'`)}return _._aliases.push(q),this}aliases(q){if(q===void 0)return this._aliases;return q.forEach((_)=>this.alias(_)),this}usage(q){if(q===void 0){if(this._usage)return this._usage;let _=this.registeredArguments.map((j)=>{return cw(j)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?_:[]).join(" ")}return this._usage=q,this}name(q){if(q===void 0)return this._name;return this._name=q,this}helpGroup(q){if(q===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=q,this}commandsGroup(q){if(q===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=q,this}optionsGroup(q){if(q===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=q,this}_initOptionGroup(q){if(this._defaultOptionGroup&&!q.helpGroupHeading)q.helpGroup(this._defaultOptionGroup)}_initCommandGroup(q){if(this._defaultCommandGroup&&!q.helpGroup())q.helpGroup(this._defaultCommandGroup)}nameFromFilename(q){return this._name=mq.basename(q,mq.extname(q)),this}executableDir(q){if(q===void 0)return this._executableDir;return this._executableDir=q,this}helpInformation(q){let _=this.createHelp(),j=this._getOutputContext(q);_.prepareContext({error:j.error,helpWidth:j.helpWidth,outputHasColors:j.hasColors});let K=_.formatHelp(this,_);if(j.hasColors)return K;return this._outputConfiguration.stripColor(K)}_getOutputContext(q){q=q||{};let _=!!q.error,j,K,f;if(_)j=(P)=>this._outputConfiguration.writeErr(P),K=this._outputConfiguration.getErrHasColors(),f=this._outputConfiguration.getErrHelpWidth();else j=(P)=>this._outputConfiguration.writeOut(P),K=this._outputConfiguration.getOutHasColors(),f=this._outputConfiguration.getOutHelpWidth();return{error:_,write:(P)=>{if(!K)P=this._outputConfiguration.stripColor(P);return j(P)},hasColors:K,helpWidth:f}}outputHelp(q){let _;if(typeof q==="function")_=q,q=void 0;let j=this._getOutputContext(q),K={error:j.error,write:j.write,command:this};this._getCommandAndAncestors().reverse().forEach((Y)=>Y.emit("beforeAllHelp",K)),this.emit("beforeHelp",K);let f=this.helpInformation({error:j.error});if(_){if(f=_(f),typeof f!=="string"&&!Buffer.isBuffer(f))throw new Error("outputHelp callback must return a string or a Buffer")}if(j.write(f),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",K),this._getCommandAndAncestors().forEach((Y)=>Y.emit("afterAllHelp",K))}helpOption(q,_){if(typeof q==="boolean"){if(q){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(q??"-h, --help",_??"display help for command"),q||_)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(q){return this._helpOption=q,this._initOptionGroup(q),this}help(q){this.outputHelp(q);let _=Number(N8.exitCode??0);if(_===0&&q&&typeof q!=="function"&&q.error)_=1;this._exit(_,"commander.help","(outputHelp)")}addHelpText(q,_){let j=["beforeAll","before","after","afterAll"];if(!j.includes(q))throw new Error(`Unexpected value for position to addHelpText.
26
+ Expecting one of '${j.join("', '")}'`);let K=`${q}Help`;return this.on(K,(f)=>{let Y;if(typeof _==="function")Y=_({error:f.error,command:f.command});else Y=_;if(Y)f.write(`${Y}
27
+ `)}),this}_outputHelpIfRequested(q){let _=this._getHelpOption();if(_&&q.find((K)=>_.is(K)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Z5(q){return q.map((_)=>{if(!_.startsWith("--inspect"))return _;let j,K="127.0.0.1",f="9229",Y;if((Y=_.match(/^(--inspect(-brk)?)$/))!==null)j=Y[1];else if((Y=_.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(j=Y[1],/^\d+$/.test(Y[3]))f=Y[3];else K=Y[3];else if((Y=_.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)j=Y[1],K=Y[3],f=Y[4];if(j&&f!=="0")return`${j}=${K}:${parseInt(f)+1}`;return _})}function Y4(){if(N8.env.NO_COLOR||N8.env.FORCE_COLOR==="0"||N8.env.FORCE_COLOR==="false")return!1;if(N8.env.FORCE_COLOR||N8.env.CLICOLOR_FORCE!==void 0)return!0;return}aw.Command=$4;aw.useColor=Y4});var u5=q8((Uw)=>{var{Argument:X5}=p3(),{Command:w4}=k5(),{CommanderError:ew,InvalidArgumentError:A5}=gK(),{Help:Fw}=K4(),{Option:G5}=j4();Uw.program=new w4;Uw.createCommand=(q)=>new w4(q);Uw.createOption=(q,_)=>new G5(q,_);Uw.createArgument=(q,_)=>new X5(q,_);Uw.Command=w4;Uw.Option=G5;Uw.Argument=X5;Uw.Help=Fw;Uw.CommanderError=ew;Uw.InvalidArgumentError=A5;Uw.InvalidOptionArgumentError=A5});var C6=q8((CO)=>{CO.__esModule=!0;CO.extend=m5;CO.indexOf=XO;CO.escapeExpression=AO;CO.isEmpty=GO;CO.createFrame=uO;CO.blockParams=hO;CO.appendContextPath=DO;var HO={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},TO=/[&<>"'`=]/g,ZO=/[&<>"'`=]/;function kO(q){return HO[q]}function m5(q){for(var _=1;_<arguments.length;_++)for(var j in arguments[_])if(Object.prototype.hasOwnProperty.call(arguments[_],j))q[j]=arguments[_][j];return q}var v4=Object.prototype.toString;CO.toString=v4;var O4=function q(_){return typeof _==="function"};if(O4(/x/))CO.isFunction=O4=function(q){return typeof q==="function"&&v4.call(q)==="[object Function]"};CO.isFunction=O4;var I5=Array.isArray||function(q){return q&&typeof q==="object"?v4.call(q)==="[object Array]":!1};CO.isArray=I5;function XO(q,_){for(var j=0,K=q.length;j<K;j++)if(q[j]===_)return j;return-1}function AO(q){if(typeof q!=="string"){if(q&&q.toHTML)return q.toHTML();else if(q==null)return"";else if(!q)return q+"";q=""+q}if(!ZO.test(q))return q;return q.replace(TO,kO)}function GO(q){if(!q&&q!==0)return!0;else if(I5(q)&&q.length===0)return!0;else return!1}function uO(q){var _=m5({},q);return _._parent=q,_}function hO(q,_){return q.path=_,q}function DO(q,_){return(q?q+".":"")+_}});var F6=q8((g5,y5)=>{g5.__esModule=!0;var z4=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function W4(q,_){var j=_&&_.loc,K=void 0,f=void 0,Y=void 0,P=void 0;if(j)K=j.start.line,f=j.end.line,Y=j.start.column,P=j.end.column,q+=" - "+K+":"+Y;var $=Error.prototype.constructor.call(this,q);for(var O=0;O<z4.length;O++)this[z4[O]]=$[z4[O]];if(Error.captureStackTrace)Error.captureStackTrace(this,W4);try{if(j)if(this.lineNumber=K,this.endLineNumber=f,Object.defineProperty)Object.defineProperty(this,"column",{value:Y,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:P,enumerable:!0});else this.column=Y,this.endColumn=P}catch(w){}}W4.prototype=new Error;g5.default=W4;y5.exports=g5.default});var L5=q8((d5,p5)=>{d5.__esModule=!0;var J4=C6();d5.default=function(q){q.registerHelper("blockHelperMissing",function(_,j){var{inverse:K,fn:f}=j;if(_===!0)return f(this);else if(_===!1||_==null)return K(this);else if(J4.isArray(_))if(_.length>0){if(j.ids)j.ids=[j.name];return q.helpers.each(_,j)}else return K(this);else{if(j.data&&j.ids){var Y=J4.createFrame(j.data);Y.contextPath=J4.appendContextPath(j.data.contextPath,j.name),j={data:Y}}return f(_,j)}})};p5.exports=d5.default});var n5=q8((l5,x5)=>{l5.__esModule=!0;function xO(q){return q&&q.__esModule?q:{default:q}}var yK=C6(),nO=F6(),cO=xO(nO);l5.default=function(q){q.registerHelper("each",function(_,j){if(!j)throw new cO.default("Must pass iterator to #each");var{fn:K,inverse:f}=j,Y=0,P="",$=void 0,O=void 0;if(j.data&&j.ids)O=yK.appendContextPath(j.data.contextPath,j.ids[0])+".";if(yK.isFunction(_))_=_.call(this);if(j.data)$=yK.createFrame(j.data);function w(Z,J,X){if($){if($.key=Z,$.index=J,$.first=J===0,$.last=!!X,O)$.contextPath=O+Z}P=P+K(_[Z],{data:$,blockParams:yK.blockParams([_[Z],Z],[O+Z,null])})}if(_&&typeof _==="object")if(yK.isArray(_)){for(var v=_.length;Y<v;Y++)if(Y in _)w(Y,Y,Y===_.length-1)}else if(typeof Symbol==="function"&&_[Symbol.iterator]){var z=[],W=_[Symbol.iterator]();for(var H=W.next();!H.done;H=W.next())z.push(H.value);_=z;for(var v=_.length;Y<v;Y++)w(Y,Y,Y===_.length-1)}else(function(){var Z=void 0;if(Object.keys(_).forEach(function(J){if(Z!==void 0)w(Z,Y-1);Z=J,Y++}),Z!==void 0)w(Z,Y-1,!0)})();if(Y===0)P=f(this);return P})};x5.exports=l5.default});var i5=q8((c5,r5)=>{c5.__esModule=!0;function oO(q){return q&&q.__esModule?q:{default:q}}var aO=F6(),BO=oO(aO);c5.default=function(q){q.registerHelper("helperMissing",function(){if(arguments.length===1)return;else throw new BO.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};r5.exports=c5.default});var e5=q8((B5,t5)=>{B5.__esModule=!0;function FO(q){return q&&q.__esModule?q:{default:q}}var o5=C6(),UO=F6(),a5=FO(UO);B5.default=function(q){q.registerHelper("if",function(_,j){if(arguments.length!=2)throw new a5.default("#if requires exactly one argument");if(o5.isFunction(_))_=_.call(this);if(!j.hash.includeZero&&!_||o5.isEmpty(_))return j.inverse(this);else return j.fn(this)}),q.registerHelper("unless",function(_,j){if(arguments.length!=2)throw new a5.default("#unless requires exactly one argument");return q.helpers.if.call(this,_,{fn:j.inverse,inverse:j.fn,hash:j.hash})})};t5.exports=B5.default});var s5=q8((F5,U5)=>{F5.__esModule=!0;F5.default=function(q){q.registerHelper("log",function(){var _=[void 0],j=arguments[arguments.length-1];for(var K=0;K<arguments.length-1;K++)_.push(arguments[K]);var f=1;if(j.hash.level!=null)f=j.hash.level;else if(j.data&&j.data.level!=null)f=j.data.level;_[0]=f,q.log.apply(q,_)})};U5.exports=F5.default});var _j=q8((Q5,qj)=>{Q5.__esModule=!0;Q5.default=function(q){q.registerHelper("lookup",function(_,j,K){if(!_)return _;return K.lookupProperty(_,j)})};qj.exports=Q5.default});var Pj=q8((Kj,jj)=>{Kj.__esModule=!0;function Pv(q){return q&&q.__esModule?q:{default:q}}var dK=C6(),fv=F6(),Yv=Pv(fv);Kj.default=function(q){q.registerHelper("with",function(_,j){if(arguments.length!=2)throw new Yv.default("#with requires exactly one argument");if(dK.isFunction(_))_=_.call(this);var K=j.fn;if(!dK.isEmpty(_)){var f=j.data;if(j.data&&j.ids)f=dK.createFrame(j.data),f.contextPath=dK.appendContextPath(j.data.contextPath,j.ids[0]);return K(_,{data:f,blockParams:dK.blockParams([_],[f&&f.contextPath])})}else return j.inverse(this)})};jj.exports=Kj.default});var H4=q8((Vv)=>{Vv.__esModule=!0;Vv.registerDefaultHelpers=Dv;Vv.moveHelperToHooks=Cv;function $_(q){return q&&q.__esModule?q:{default:q}}var Ov=L5(),vv=$_(Ov),zv=n5(),Wv=$_(zv),Jv=i5(),Hv=$_(Jv),Tv=e5(),Zv=$_(Tv),kv=s5(),Xv=$_(kv),Av=_j(),Gv=$_(Av),uv=Pj(),hv=$_(uv);function Dv(q){vv.default(q),Wv.default(q),Hv.default(q),Zv.default(q),Xv.default(q),Gv.default(q),hv.default(q)}function Cv(q,_,j){if(q.helpers[_]){if(q.hooks[_]=q.helpers[_],!j)delete q.helpers[_]}}});var $j=q8((fj,Yj)=>{fj.__esModule=!0;var Sv=C6();fj.default=function(q){q.registerDecorator("inline",function(_,j,K,f){var Y=_;if(!j.partials)j.partials={},Y=function(P,$){var O=K.partials;K.partials=Sv.extend({},O,j.partials);var w=_(P,$);return K.partials=O,w};return j.partials[f.args[0]]=f.fn,Y})};Yj.exports=fj.default});var wj=q8((dv)=>{dv.__esModule=!0;dv.registerDefaultDecorators=yv;function mv(q){return q&&q.__esModule?q:{default:q}}var Iv=$j(),gv=mv(Iv);function yv(q){gv.default(q)}});var T4=q8((Oj,vj)=>{Oj.__esModule=!0;var lv=C6(),L_={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function q(_){if(typeof _==="string"){var j=lv.indexOf(L_.methodMap,_.toLowerCase());if(j>=0)_=j;else _=parseInt(_,10)}return _},log:function q(_){if(_=L_.lookupLevel(_),typeof console!=="undefined"&&L_.lookupLevel(L_.level)<=_){var j=L_.methodMap[_];if(!console[j])j="log";for(var K=arguments.length,f=Array(K>1?K-1:0),Y=1;Y<K;Y++)f[Y-1]=arguments[Y];console[j].apply(console,f)}}};Oj.default=L_;vj.exports=Oj.default});var zj=q8((iv)=>{iv.__esModule=!0;iv.createNewLookupObject=rv;var cv=C6();function rv(){for(var q=arguments.length,_=Array(q),j=0;j<q;j++)_[j]=arguments[j];return cv.extend.apply(void 0,[Object.create(null)].concat(_))}});var Z4=q8((qz)=>{qz.__esModule=!0;qz.createProtoAccessControl=Fv;qz.resultIsAllowed=Uv;qz.resetLoggedProperties=Qv;function Bv(q){return q&&q.__esModule?q:{default:q}}var Wj=zj(),tv=T4(),ev=Bv(tv),l3=Object.create(null);function Fv(q){var _=Object.create(null);_.constructor=!1,_.__defineGetter__=!1,_.__defineSetter__=!1,_.__lookupGetter__=!1;var j=Object.create(null);return j.__proto__=!1,{properties:{whitelist:Wj.createNewLookupObject(j,q.allowedProtoProperties),defaultValue:q.allowProtoPropertiesByDefault},methods:{whitelist:Wj.createNewLookupObject(_,q.allowedProtoMethods),defaultValue:q.allowProtoMethodsByDefault}}}function Uv(q,_,j){if(typeof q==="function")return Jj(_.methods,j);else return Jj(_.properties,j)}function Jj(q,_){if(q.whitelist[_]!==void 0)return q.whitelist[_]===!0;if(q.defaultValue!==void 0)return q.defaultValue;return sv(_),!1}function sv(q){if(l3[q]!==!0)l3[q]=!0,ev.default.log("error",'Handlebars: Access has been denied to resolve the property "'+q+`" because it is not an "own property" of its parent.
28
28
  You can add a runtime option to disable the check or this warning:
29
- See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`)}function av(){Object.keys(g3).forEach(function(q){delete g3[q]})}});var d3=q8((wz)=>{wz.__esModule=!0;wz.HandlebarsEnvironment=H4;function Yj(q){return q&&q.__esModule?q:{default:q}}var $_=D6(),sv=t6(),W4=Yj(sv),Qv=O4(),qz=Q5(),_z=v4(),y3=Yj(_z),Kz=z4(),jz="4.7.8";wz.VERSION=jz;var Pz=8;wz.COMPILER_REVISION=Pz;var Yz=7;wz.LAST_COMPATIBLE_COMPILER_REVISION=Yz;var fz={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};wz.REVISION_CHANGES=fz;var J4="[object Object]";function H4(q,_,j){this.helpers=q||{},this.partials=_||{},this.decorators=j||{},Qv.registerDefaultHelpers(this),qz.registerDefaultDecorators(this)}H4.prototype={constructor:H4,logger:y3.default,log:y3.default.log,registerHelper:function q(_,j){if($_.toString.call(_)===J4){if(j)throw new W4.default("Arg not supported with multiple helpers");$_.extend(this.helpers,_)}else this.helpers[_]=j},unregisterHelper:function q(_){delete this.helpers[_]},registerPartial:function q(_,j){if($_.toString.call(_)===J4)$_.extend(this.partials,_);else{if(typeof j==="undefined")throw new W4.default('Attempting to register a partial called "'+_+'" as undefined');this.partials[_]=j}},unregisterPartial:function q(_){delete this.partials[_]},registerDecorator:function q(_,j){if($_.toString.call(_)===J4){if(j)throw new W4.default("Arg not supported with multiple decorators");$_.extend(this.decorators,_)}else this.decorators[_]=j},unregisterDecorator:function q(_){delete this.decorators[_]},resetLoggedPropertyAccesses:function q(){Kz.resetLoggedProperties()}};var $z=y3.default.log;wz.log=$z;wz.createFrame=$_.createFrame;wz.logger=y3.default});var wj=q8((fj,$j)=>{fj.__esModule=!0;function T4(q){this.string=q}T4.prototype.toString=T4.prototype.toHTML=function(){return""+this.string};fj.default=T4;$j.exports=fj.default});var Oj=q8((uz)=>{uz.__esModule=!0;uz.wrapHelper=Gz;function Gz(q,_){if(typeof q!=="function")return q;var j=function K(){var Y=arguments[arguments.length-1];return arguments[arguments.length-1]=_(Y),q.apply(this,arguments)};return j}});var Hj=q8((dz)=>{dz.__esModule=!0;dz.checkRevision=Sz;dz.template=Ez;dz.wrapProgram=p3;dz.resolvePartial=Rz;dz.invokePartial=mz;dz.noop=Wj;function Cz(q){return q&&q.__esModule?q:{default:q}}function Vz(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}var Mz=D6(),Rq=Vz(Mz),Nz=t6(),mq=Cz(Nz),Iq=d3(),vj=O4(),bz=Oj(),zj=z4();function Sz(q){var _=q&&q[0]||1,j=Iq.COMPILER_REVISION;if(_>=Iq.LAST_COMPATIBLE_COMPILER_REVISION&&_<=Iq.COMPILER_REVISION)return;if(_<Iq.LAST_COMPATIBLE_COMPILER_REVISION){var K=Iq.REVISION_CHANGES[j],Y=Iq.REVISION_CHANGES[_];throw new mq.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+K+") or downgrade your runtime to an older version ("+Y+").")}else throw new mq.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+q[1]+").")}function Ez(q,_){if(!_)throw new mq.default("No environment passed to template");if(!q||!q.main)throw new mq.default("Unknown template object: "+typeof q);q.main.decorator=q.main_d,_.VM.checkRevision(q.compiler);var j=q.compiler&&q.compiler[0]===7;function K(P,$,O){if(O.hash){if($=Rq.extend({},$,O.hash),O.ids)O.ids[0]=!0}P=_.VM.resolvePartial.call(this,P,$,O);var w=Rq.extend({},O,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),v=_.VM.invokePartial.call(this,P,$,w);if(v==null&&_.compile)O.partials[O.name]=_.compile(P,q.compilerOptions,_),v=O.partials[O.name]($,w);if(v!=null){if(O.indent){var z=v.split(`
30
- `);for(var W=0,J=z.length;W<J;W++){if(!z[W]&&W+1===J)break;z[W]=O.indent+z[W]}v=z.join(`
31
- `)}return v}else throw new mq.default("The partial "+O.name+" could not be compiled when running in runtime-only mode")}var Y={strict:function P($,O,w){if(!$||!(O in $))throw new mq.default('"'+O+'" not defined in '+$,{loc:w});return Y.lookupProperty($,O)},lookupProperty:function P($,O){var w=$[O];if(w==null)return w;if(Object.prototype.hasOwnProperty.call($,O))return w;if(zj.resultIsAllowed(w,Y.protoAccessControl,O))return w;return},lookup:function P($,O){var w=$.length;for(var v=0;v<w;v++){var z=$[v]&&Y.lookupProperty($[v],O);if(z!=null)return $[v][O]}},lambda:function P($,O){return typeof $==="function"?$.call(O):$},escapeExpression:Rq.escapeExpression,invokePartial:K,fn:function P($){var O=q[$];return O.decorator=q[$+"_d"],O},programs:[],program:function P($,O,w,v,z){var W=this.programs[$],J=this.fn($);if(O||z||v||w)W=p3(this,$,J,O,w,v,z);else if(!W)W=this.programs[$]=p3(this,$,J);return W},data:function P($,O){while($&&O--)$=$._parent;return $},mergeIfNeeded:function P($,O){var w=$||O;if($&&O&&$!==O)w=Rq.extend({},O,$);return w},nullContext:Object.seal({}),noop:_.VM.noop,compilerInfo:q.compiler};function f(P){var $=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],O=$.data;if(f._setup($),!$.partial&&q.useData)O=Iz(P,O);var w=void 0,v=q.useBlockParams?[]:void 0;if(q.useDepths)if($.depths)w=P!=$.depths[0]?[P].concat($.depths):$.depths;else w=[P];function z(W){return""+q.main(Y,W,Y.helpers,Y.partials,O,v,w)}return z=Jj(q.main,z,Y,$.depths||[],O,v),z(P,$)}return f.isTop=!0,f._setup=function(P){if(!P.partial){var $=Rq.extend({},_.helpers,P.helpers);if(gz($,Y),Y.helpers=$,q.usePartial)Y.partials=Y.mergeIfNeeded(P.partials,_.partials);if(q.usePartial||q.useDecorators)Y.decorators=Rq.extend({},_.decorators,P.decorators);Y.hooks={},Y.protoAccessControl=zj.createProtoAccessControl(P);var O=P.allowCallsToHelperMissing||j;vj.moveHelperToHooks(Y,"helperMissing",O),vj.moveHelperToHooks(Y,"blockHelperMissing",O)}else Y.protoAccessControl=P.protoAccessControl,Y.helpers=P.helpers,Y.partials=P.partials,Y.decorators=P.decorators,Y.hooks=P.hooks},f._child=function(P,$,O,w){if(q.useBlockParams&&!O)throw new mq.default("must pass block params");if(q.useDepths&&!w)throw new mq.default("must pass parent depths");return p3(Y,P,q[P],$,0,O,w)},f}function p3(q,_,j,K,Y,f,P){function $(O){var w=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],v=P;if(P&&O!=P[0]&&!(O===q.nullContext&&P[0]===null))v=[O].concat(P);return j(q,O,q.helpers,q.partials,w.data||K,f&&[w.blockParams].concat(f),v)}return $=Jj(j,$,q,P,K,f),$.program=_,$.depth=P?P.length:0,$.blockParams=Y||0,$}function Rz(q,_,j){if(!q)if(j.name==="@partial-block")q=j.data["partial-block"];else q=j.partials[j.name];else if(!q.call&&!j.name)j.name=q,q=j.partials[q];return q}function mz(q,_,j){var K=j.data&&j.data["partial-block"];if(j.partial=!0,j.ids)j.data.contextPath=j.ids[0]||j.data.contextPath;var Y=void 0;if(j.fn&&j.fn!==Wj)(function(){j.data=Iq.createFrame(j.data);var f=j.fn;if(Y=j.data["partial-block"]=function P($){var O=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return O.data=Iq.createFrame(O.data),O.data["partial-block"]=K,f($,O)},f.partials)j.partials=Rq.extend({},j.partials,f.partials)})();if(q===void 0&&Y)q=Y;if(q===void 0)throw new mq.default("The partial "+j.name+" could not be found");else if(q instanceof Function)return q(_,j)}function Wj(){return""}function Iz(q,_){if(!_||!("root"in _))_=_?Iq.createFrame(_):{},_.root=q;return _}function Jj(q,_,j,K,Y,f){if(q.decorator){var P={};_=q.decorator(_,P,j,K&&K[0],Y,f,K),Rq.extend(_,P)}return _}function gz(q,_){Object.keys(q).forEach(function(j){var K=q[j];q[j]=yz(K,_)})}function yz(q,_){var j=_.lookupProperty;return bz.wrapHelper(q,function(K){return Rq.extend({lookupProperty:j},K)})}});var Z4=q8((Tj,Zj)=>{Tj.__esModule=!0;Tj.default=function(q){(function(){if(typeof globalThis==="object")return;Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__})();var _=globalThis.Handlebars;q.noConflict=function(){if(globalThis.Handlebars===q)globalThis.Handlebars=_;return q}};Zj.exports=Tj.default});var hj=q8((Gj,uj)=>{Gj.__esModule=!0;function X4(q){return q&&q.__esModule?q:{default:q}}function A4(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}var az=d3(),kj=A4(az),Bz=wj(),tz=X4(Bz),ez=t6(),Fz=X4(ez),Uz=D6(),k4=A4(Uz),sz=Hj(),Xj=A4(sz),Qz=Z4(),qW=X4(Qz);function Aj(){var q=new kj.HandlebarsEnvironment;return k4.extend(q,kj),q.SafeString=tz.default,q.Exception=Fz.default,q.Utils=k4,q.escapeExpression=k4.escapeExpression,q.VM=Xj,q.template=function(_){return Xj.template(_,q)},q}var mK=Aj();mK.create=Aj;qW.default(mK);mK.default=mK;Gj.default=mK;uj.exports=Gj.default});var G4=q8((Cj,Vj)=>{Cj.__esModule=!0;var Dj={helpers:{helperExpression:function q(_){return _.type==="SubExpression"||(_.type==="MustacheStatement"||_.type==="BlockStatement")&&!!(_.params&&_.params.length||_.hash)},scopedId:function q(_){return/^\.|this\b/.test(_.original)},simpleId:function q(_){return _.parts.length===1&&!Dj.helpers.scopedId(_)&&!_.depth}}};Cj.default=Dj;Vj.exports=Cj.default});var bj=q8((Mj,Nj)=>{Mj.__esModule=!0;var YW=function(){var q={trace:function K(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function K(Y,f,P,$,O,w,v){var z=w.length-1;switch(O){case 1:return w[z-1];case 2:this.$=$.prepareProgram(w[z]);break;case 3:this.$=w[z];break;case 4:this.$=w[z];break;case 5:this.$=w[z];break;case 6:this.$=w[z];break;case 7:this.$=w[z];break;case 8:this.$=w[z];break;case 9:this.$={type:"CommentStatement",value:$.stripComment(w[z]),strip:$.stripFlags(w[z],w[z]),loc:$.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:w[z],value:w[z],loc:$.locInfo(this._$)};break;case 11:this.$=$.prepareRawBlock(w[z-2],w[z-1],w[z],this._$);break;case 12:this.$={path:w[z-3],params:w[z-2],hash:w[z-1]};break;case 13:this.$=$.prepareBlock(w[z-3],w[z-2],w[z-1],w[z],!1,this._$);break;case 14:this.$=$.prepareBlock(w[z-3],w[z-2],w[z-1],w[z],!0,this._$);break;case 15:this.$={open:w[z-5],path:w[z-4],params:w[z-3],hash:w[z-2],blockParams:w[z-1],strip:$.stripFlags(w[z-5],w[z])};break;case 16:this.$={path:w[z-4],params:w[z-3],hash:w[z-2],blockParams:w[z-1],strip:$.stripFlags(w[z-5],w[z])};break;case 17:this.$={path:w[z-4],params:w[z-3],hash:w[z-2],blockParams:w[z-1],strip:$.stripFlags(w[z-5],w[z])};break;case 18:this.$={strip:$.stripFlags(w[z-1],w[z-1]),program:w[z]};break;case 19:var W=$.prepareBlock(w[z-2],w[z-1],w[z],w[z],!1,this._$),J=$.prepareProgram([W],w[z-1].loc);J.chained=!0,this.$={strip:w[z-2].strip,program:J,chain:!0};break;case 20:this.$=w[z];break;case 21:this.$={path:w[z-1],strip:$.stripFlags(w[z-2],w[z])};break;case 22:this.$=$.prepareMustache(w[z-3],w[z-2],w[z-1],w[z-4],$.stripFlags(w[z-4],w[z]),this._$);break;case 23:this.$=$.prepareMustache(w[z-3],w[z-2],w[z-1],w[z-4],$.stripFlags(w[z-4],w[z]),this._$);break;case 24:this.$={type:"PartialStatement",name:w[z-3],params:w[z-2],hash:w[z-1],indent:"",strip:$.stripFlags(w[z-4],w[z]),loc:$.locInfo(this._$)};break;case 25:this.$=$.preparePartialBlock(w[z-2],w[z-1],w[z],this._$);break;case 26:this.$={path:w[z-3],params:w[z-2],hash:w[z-1],strip:$.stripFlags(w[z-4],w[z])};break;case 27:this.$=w[z];break;case 28:this.$=w[z];break;case 29:this.$={type:"SubExpression",path:w[z-3],params:w[z-2],hash:w[z-1],loc:$.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:w[z],loc:$.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:$.id(w[z-2]),value:w[z],loc:$.locInfo(this._$)};break;case 32:this.$=$.id(w[z-1]);break;case 33:this.$=w[z];break;case 34:this.$=w[z];break;case 35:this.$={type:"StringLiteral",value:w[z],original:w[z],loc:$.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(w[z]),original:Number(w[z]),loc:$.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:w[z]==="true",original:w[z]==="true",loc:$.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:$.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:$.locInfo(this._$)};break;case 40:this.$=w[z];break;case 41:this.$=w[z];break;case 42:this.$=$.preparePath(!0,w[z],this._$);break;case 43:this.$=$.preparePath(!1,w[z],this._$);break;case 44:w[z-2].push({part:$.id(w[z]),original:w[z],separator:w[z-1]}),this.$=w[z-2];break;case 45:this.$=[{part:$.id(w[z]),original:w[z]}];break;case 46:this.$=[];break;case 47:w[z-1].push(w[z]);break;case 48:this.$=[];break;case 49:w[z-1].push(w[z]);break;case 50:this.$=[];break;case 51:w[z-1].push(w[z]);break;case 58:this.$=[];break;case 59:w[z-1].push(w[z]);break;case 64:this.$=[];break;case 65:w[z-1].push(w[z]);break;case 70:this.$=[];break;case 71:w[z-1].push(w[z]);break;case 78:this.$=[];break;case 79:w[z-1].push(w[z]);break;case 82:this.$=[];break;case 83:w[z-1].push(w[z]);break;case 86:this.$=[];break;case 87:w[z-1].push(w[z]);break;case 90:this.$=[];break;case 91:w[z-1].push(w[z]);break;case 94:this.$=[];break;case 95:w[z-1].push(w[z]);break;case 98:this.$=[w[z]];break;case 99:w[z-1].push(w[z]);break;case 100:this.$=[w[z]];break;case 101:w[z-1].push(w[z]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function K(Y,f){throw new Error(Y)},parse:function K(Y){var f=this,P=[0],$=[null],O=[],w=this.table,v="",z=0,W=0,J=0,Z=2,H=1;if(this.lexer.setInput(Y),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var X=this.lexer.yylloc;O.push(X);var A=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function G(t){P.length=P.length-2*t,$.length=$.length-t,O.length=O.length-t}function D(){var t=f.lexer.lex()||1;if(typeof t!=="number")t=f.symbols_[t]||t;return t}var M,g,S,b,d,p,r={},l,R,m,y;while(!0){if(S=P[P.length-1],this.defaultActions[S])b=this.defaultActions[S];else{if(M===null||typeof M=="undefined")M=D();b=w[S]&&w[S][M]}if(typeof b==="undefined"||!b.length||!b[0]){var i="";if(!J){y=[];for(l in w[S])if(this.terminals_[l]&&l>2)y.push("'"+this.terminals_[l]+"'");if(this.lexer.showPosition)i="Parse error on line "+(z+1)+`:
29
+ See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`)}function Qv(){Object.keys(l3).forEach(function(q){delete l3[q]})}});var n3=q8((Tz)=>{Tz.__esModule=!0;Tz.HandlebarsEnvironment=A4;function Hj(q){return q&&q.__esModule?q:{default:q}}var w_=C6(),fz=F6(),k4=Hj(fz),Yz=H4(),$z=wj(),wz=T4(),x3=Hj(wz),Oz=Z4(),vz="4.7.8";Tz.VERSION=vz;var zz=8;Tz.COMPILER_REVISION=zz;var Wz=7;Tz.LAST_COMPATIBLE_COMPILER_REVISION=Wz;var Jz={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};Tz.REVISION_CHANGES=Jz;var X4="[object Object]";function A4(q,_,j){this.helpers=q||{},this.partials=_||{},this.decorators=j||{},Yz.registerDefaultHelpers(this),$z.registerDefaultDecorators(this)}A4.prototype={constructor:A4,logger:x3.default,log:x3.default.log,registerHelper:function q(_,j){if(w_.toString.call(_)===X4){if(j)throw new k4.default("Arg not supported with multiple helpers");w_.extend(this.helpers,_)}else this.helpers[_]=j},unregisterHelper:function q(_){delete this.helpers[_]},registerPartial:function q(_,j){if(w_.toString.call(_)===X4)w_.extend(this.partials,_);else{if(typeof j==="undefined")throw new k4.default('Attempting to register a partial called "'+_+'" as undefined');this.partials[_]=j}},unregisterPartial:function q(_){delete this.partials[_]},registerDecorator:function q(_,j){if(w_.toString.call(_)===X4){if(j)throw new k4.default("Arg not supported with multiple decorators");w_.extend(this.decorators,_)}else this.decorators[_]=j},unregisterDecorator:function q(_){delete this.decorators[_]},resetLoggedPropertyAccesses:function q(){Oz.resetLoggedProperties()}};var Hz=x3.default.log;Tz.log=Hz;Tz.createFrame=w_.createFrame;Tz.logger=x3.default});var kj=q8((Tj,Zj)=>{Tj.__esModule=!0;function G4(q){this.string=q}G4.prototype.toString=G4.prototype.toHTML=function(){return""+this.string};Tj.default=G4;Zj.exports=Tj.default});var Xj=q8((bz)=>{bz.__esModule=!0;bz.wrapHelper=Nz;function Nz(q,_){if(typeof q!=="function")return q;var j=function K(){var f=arguments[arguments.length-1];return arguments[arguments.length-1]=_(f),q.apply(this,arguments)};return j}});var Dj=q8((rz)=>{rz.__esModule=!0;rz.checkRevision=dz;rz.template=pz;rz.wrapProgram=c3;rz.resolvePartial=Lz;rz.invokePartial=lz;rz.noop=uj;function Rz(q){return q&&q.__esModule?q:{default:q}}function mz(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}var Iz=C6(),Iq=mz(Iz),gz=F6(),gq=Rz(gz),yq=n3(),Aj=H4(),yz=Xj(),Gj=Z4();function dz(q){var _=q&&q[0]||1,j=yq.COMPILER_REVISION;if(_>=yq.LAST_COMPATIBLE_COMPILER_REVISION&&_<=yq.COMPILER_REVISION)return;if(_<yq.LAST_COMPATIBLE_COMPILER_REVISION){var K=yq.REVISION_CHANGES[j],f=yq.REVISION_CHANGES[_];throw new gq.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+K+") or downgrade your runtime to an older version ("+f+").")}else throw new gq.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+q[1]+").")}function pz(q,_){if(!_)throw new gq.default("No environment passed to template");if(!q||!q.main)throw new gq.default("Unknown template object: "+typeof q);q.main.decorator=q.main_d,_.VM.checkRevision(q.compiler);var j=q.compiler&&q.compiler[0]===7;function K(P,$,O){if(O.hash){if($=Iq.extend({},$,O.hash),O.ids)O.ids[0]=!0}P=_.VM.resolvePartial.call(this,P,$,O);var w=Iq.extend({},O,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),v=_.VM.invokePartial.call(this,P,$,w);if(v==null&&_.compile)O.partials[O.name]=_.compile(P,q.compilerOptions,_),v=O.partials[O.name]($,w);if(v!=null){if(O.indent){var z=v.split(`
30
+ `);for(var W=0,H=z.length;W<H;W++){if(!z[W]&&W+1===H)break;z[W]=O.indent+z[W]}v=z.join(`
31
+ `)}return v}else throw new gq.default("The partial "+O.name+" could not be compiled when running in runtime-only mode")}var f={strict:function P($,O,w){if(!$||!(O in $))throw new gq.default('"'+O+'" not defined in '+$,{loc:w});return f.lookupProperty($,O)},lookupProperty:function P($,O){var w=$[O];if(w==null)return w;if(Object.prototype.hasOwnProperty.call($,O))return w;if(Gj.resultIsAllowed(w,f.protoAccessControl,O))return w;return},lookup:function P($,O){var w=$.length;for(var v=0;v<w;v++){var z=$[v]&&f.lookupProperty($[v],O);if(z!=null)return $[v][O]}},lambda:function P($,O){return typeof $==="function"?$.call(O):$},escapeExpression:Iq.escapeExpression,invokePartial:K,fn:function P($){var O=q[$];return O.decorator=q[$+"_d"],O},programs:[],program:function P($,O,w,v,z){var W=this.programs[$],H=this.fn($);if(O||z||v||w)W=c3(this,$,H,O,w,v,z);else if(!W)W=this.programs[$]=c3(this,$,H);return W},data:function P($,O){while($&&O--)$=$._parent;return $},mergeIfNeeded:function P($,O){var w=$||O;if($&&O&&$!==O)w=Iq.extend({},O,$);return w},nullContext:Object.seal({}),noop:_.VM.noop,compilerInfo:q.compiler};function Y(P){var $=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],O=$.data;if(Y._setup($),!$.partial&&q.useData)O=xz(P,O);var w=void 0,v=q.useBlockParams?[]:void 0;if(q.useDepths)if($.depths)w=P!=$.depths[0]?[P].concat($.depths):$.depths;else w=[P];function z(W){return""+q.main(f,W,f.helpers,f.partials,O,v,w)}return z=hj(q.main,z,f,$.depths||[],O,v),z(P,$)}return Y.isTop=!0,Y._setup=function(P){if(!P.partial){var $=Iq.extend({},_.helpers,P.helpers);if(nz($,f),f.helpers=$,q.usePartial)f.partials=f.mergeIfNeeded(P.partials,_.partials);if(q.usePartial||q.useDecorators)f.decorators=Iq.extend({},_.decorators,P.decorators);f.hooks={},f.protoAccessControl=Gj.createProtoAccessControl(P);var O=P.allowCallsToHelperMissing||j;Aj.moveHelperToHooks(f,"helperMissing",O),Aj.moveHelperToHooks(f,"blockHelperMissing",O)}else f.protoAccessControl=P.protoAccessControl,f.helpers=P.helpers,f.partials=P.partials,f.decorators=P.decorators,f.hooks=P.hooks},Y._child=function(P,$,O,w){if(q.useBlockParams&&!O)throw new gq.default("must pass block params");if(q.useDepths&&!w)throw new gq.default("must pass parent depths");return c3(f,P,q[P],$,0,O,w)},Y}function c3(q,_,j,K,f,Y,P){function $(O){var w=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],v=P;if(P&&O!=P[0]&&!(O===q.nullContext&&P[0]===null))v=[O].concat(P);return j(q,O,q.helpers,q.partials,w.data||K,Y&&[w.blockParams].concat(Y),v)}return $=hj(j,$,q,P,K,Y),$.program=_,$.depth=P?P.length:0,$.blockParams=f||0,$}function Lz(q,_,j){if(!q)if(j.name==="@partial-block")q=j.data["partial-block"];else q=j.partials[j.name];else if(!q.call&&!j.name)j.name=q,q=j.partials[q];return q}function lz(q,_,j){var K=j.data&&j.data["partial-block"];if(j.partial=!0,j.ids)j.data.contextPath=j.ids[0]||j.data.contextPath;var f=void 0;if(j.fn&&j.fn!==uj)(function(){j.data=yq.createFrame(j.data);var Y=j.fn;if(f=j.data["partial-block"]=function P($){var O=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return O.data=yq.createFrame(O.data),O.data["partial-block"]=K,Y($,O)},Y.partials)j.partials=Iq.extend({},j.partials,Y.partials)})();if(q===void 0&&f)q=f;if(q===void 0)throw new gq.default("The partial "+j.name+" could not be found");else if(q instanceof Function)return q(_,j)}function uj(){return""}function xz(q,_){if(!_||!("root"in _))_=_?yq.createFrame(_):{},_.root=q;return _}function hj(q,_,j,K,f,Y){if(q.decorator){var P={};_=q.decorator(_,P,j,K&&K[0],f,Y,K),Iq.extend(_,P)}return _}function nz(q,_){Object.keys(q).forEach(function(j){var K=q[j];q[j]=cz(K,_)})}function cz(q,_){var j=_.lookupProperty;return yz.wrapHelper(q,function(K){return Iq.extend({lookupProperty:j},K)})}});var u4=q8((Cj,Vj)=>{Cj.__esModule=!0;Cj.default=function(q){(function(){if(typeof globalThis==="object")return;Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__})();var _=globalThis.Handlebars;q.noConflict=function(){if(globalThis.Handlebars===q)globalThis.Handlebars=_;return q}};Vj.exports=Cj.default});var Rj=q8((Sj,Ej)=>{Sj.__esModule=!0;function D4(q){return q&&q.__esModule?q:{default:q}}function C4(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}var Qz=n3(),Mj=C4(Qz),qW=kj(),_W=D4(qW),KW=F6(),jW=D4(KW),PW=C6(),h4=C4(PW),fW=Dj(),Nj=C4(fW),YW=u4(),$W=D4(YW);function bj(){var q=new Mj.HandlebarsEnvironment;return h4.extend(q,Mj),q.SafeString=_W.default,q.Exception=jW.default,q.Utils=h4,q.escapeExpression=h4.escapeExpression,q.VM=Nj,q.template=function(_){return Nj.template(_,q)},q}var pK=bj();pK.create=bj;$W.default(pK);pK.default=pK;Sj.default=pK;Ej.exports=Sj.default});var V4=q8((Ij,gj)=>{Ij.__esModule=!0;var mj={helpers:{helperExpression:function q(_){return _.type==="SubExpression"||(_.type==="MustacheStatement"||_.type==="BlockStatement")&&!!(_.params&&_.params.length||_.hash)},scopedId:function q(_){return/^\.|this\b/.test(_.original)},simpleId:function q(_){return _.parts.length===1&&!mj.helpers.scopedId(_)&&!_.depth}}};Ij.default=mj;gj.exports=Ij.default});var pj=q8((yj,dj)=>{yj.__esModule=!0;var WW=function(){var q={trace:function K(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function K(f,Y,P,$,O,w,v){var z=w.length-1;switch(O){case 1:return w[z-1];case 2:this.$=$.prepareProgram(w[z]);break;case 3:this.$=w[z];break;case 4:this.$=w[z];break;case 5:this.$=w[z];break;case 6:this.$=w[z];break;case 7:this.$=w[z];break;case 8:this.$=w[z];break;case 9:this.$={type:"CommentStatement",value:$.stripComment(w[z]),strip:$.stripFlags(w[z],w[z]),loc:$.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:w[z],value:w[z],loc:$.locInfo(this._$)};break;case 11:this.$=$.prepareRawBlock(w[z-2],w[z-1],w[z],this._$);break;case 12:this.$={path:w[z-3],params:w[z-2],hash:w[z-1]};break;case 13:this.$=$.prepareBlock(w[z-3],w[z-2],w[z-1],w[z],!1,this._$);break;case 14:this.$=$.prepareBlock(w[z-3],w[z-2],w[z-1],w[z],!0,this._$);break;case 15:this.$={open:w[z-5],path:w[z-4],params:w[z-3],hash:w[z-2],blockParams:w[z-1],strip:$.stripFlags(w[z-5],w[z])};break;case 16:this.$={path:w[z-4],params:w[z-3],hash:w[z-2],blockParams:w[z-1],strip:$.stripFlags(w[z-5],w[z])};break;case 17:this.$={path:w[z-4],params:w[z-3],hash:w[z-2],blockParams:w[z-1],strip:$.stripFlags(w[z-5],w[z])};break;case 18:this.$={strip:$.stripFlags(w[z-1],w[z-1]),program:w[z]};break;case 19:var W=$.prepareBlock(w[z-2],w[z-1],w[z],w[z],!1,this._$),H=$.prepareProgram([W],w[z-1].loc);H.chained=!0,this.$={strip:w[z-2].strip,program:H,chain:!0};break;case 20:this.$=w[z];break;case 21:this.$={path:w[z-1],strip:$.stripFlags(w[z-2],w[z])};break;case 22:this.$=$.prepareMustache(w[z-3],w[z-2],w[z-1],w[z-4],$.stripFlags(w[z-4],w[z]),this._$);break;case 23:this.$=$.prepareMustache(w[z-3],w[z-2],w[z-1],w[z-4],$.stripFlags(w[z-4],w[z]),this._$);break;case 24:this.$={type:"PartialStatement",name:w[z-3],params:w[z-2],hash:w[z-1],indent:"",strip:$.stripFlags(w[z-4],w[z]),loc:$.locInfo(this._$)};break;case 25:this.$=$.preparePartialBlock(w[z-2],w[z-1],w[z],this._$);break;case 26:this.$={path:w[z-3],params:w[z-2],hash:w[z-1],strip:$.stripFlags(w[z-4],w[z])};break;case 27:this.$=w[z];break;case 28:this.$=w[z];break;case 29:this.$={type:"SubExpression",path:w[z-3],params:w[z-2],hash:w[z-1],loc:$.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:w[z],loc:$.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:$.id(w[z-2]),value:w[z],loc:$.locInfo(this._$)};break;case 32:this.$=$.id(w[z-1]);break;case 33:this.$=w[z];break;case 34:this.$=w[z];break;case 35:this.$={type:"StringLiteral",value:w[z],original:w[z],loc:$.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(w[z]),original:Number(w[z]),loc:$.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:w[z]==="true",original:w[z]==="true",loc:$.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:$.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:$.locInfo(this._$)};break;case 40:this.$=w[z];break;case 41:this.$=w[z];break;case 42:this.$=$.preparePath(!0,w[z],this._$);break;case 43:this.$=$.preparePath(!1,w[z],this._$);break;case 44:w[z-2].push({part:$.id(w[z]),original:w[z],separator:w[z-1]}),this.$=w[z-2];break;case 45:this.$=[{part:$.id(w[z]),original:w[z]}];break;case 46:this.$=[];break;case 47:w[z-1].push(w[z]);break;case 48:this.$=[];break;case 49:w[z-1].push(w[z]);break;case 50:this.$=[];break;case 51:w[z-1].push(w[z]);break;case 58:this.$=[];break;case 59:w[z-1].push(w[z]);break;case 64:this.$=[];break;case 65:w[z-1].push(w[z]);break;case 70:this.$=[];break;case 71:w[z-1].push(w[z]);break;case 78:this.$=[];break;case 79:w[z-1].push(w[z]);break;case 82:this.$=[];break;case 83:w[z-1].push(w[z]);break;case 86:this.$=[];break;case 87:w[z-1].push(w[z]);break;case 90:this.$=[];break;case 91:w[z-1].push(w[z]);break;case 94:this.$=[];break;case 95:w[z-1].push(w[z]);break;case 98:this.$=[w[z]];break;case 99:w[z-1].push(w[z]);break;case 100:this.$=[w[z]];break;case 101:w[z-1].push(w[z]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function K(f,Y){throw new Error(f)},parse:function K(f){var Y=this,P=[0],$=[null],O=[],w=this.table,v="",z=0,W=0,H=0,Z=2,J=1;if(this.lexer.setInput(f),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var X=this.lexer.yylloc;O.push(X);var A=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function G(t){P.length=P.length-2*t,$.length=$.length-t,O.length=O.length-t}function D(){var t=Y.lexer.lex()||1;if(typeof t!=="number")t=Y.symbols_[t]||t;return t}var V,m,S,b,d,p,r={},l,R,I,y;while(!0){if(S=P[P.length-1],this.defaultActions[S])b=this.defaultActions[S];else{if(V===null||typeof V=="undefined")V=D();b=w[S]&&w[S][V]}if(typeof b==="undefined"||!b.length||!b[0]){var i="";if(!H){y=[];for(l in w[S])if(this.terminals_[l]&&l>2)y.push("'"+this.terminals_[l]+"'");if(this.lexer.showPosition)i="Parse error on line "+(z+1)+`:
32
32
  `+this.lexer.showPosition()+`
33
- Expecting `+y.join(", ")+", got '"+(this.terminals_[M]||M)+"'";else i="Parse error on line "+(z+1)+": Unexpected "+(M==1?"end of input":"'"+(this.terminals_[M]||M)+"'");this.parseError(i,{text:this.lexer.match,token:this.terminals_[M]||M,line:this.lexer.yylineno,loc:X,expected:y})}}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+S+", token: "+M);switch(b[0]){case 1:if(P.push(M),$.push(this.lexer.yytext),O.push(this.lexer.yylloc),P.push(b[1]),M=null,!g){if(W=this.lexer.yyleng,v=this.lexer.yytext,z=this.lexer.yylineno,X=this.lexer.yylloc,J>0)J--}else M=g,g=null;break;case 2:if(R=this.productions_[b[1]][1],r.$=$[$.length-R],r._$={first_line:O[O.length-(R||1)].first_line,last_line:O[O.length-1].last_line,first_column:O[O.length-(R||1)].first_column,last_column:O[O.length-1].last_column},A)r._$.range=[O[O.length-(R||1)].range[0],O[O.length-1].range[1]];if(p=this.performAction.call(r,v,W,z,this.yy,b[1],$,O),typeof p!=="undefined")return p;if(R)P=P.slice(0,-1*R*2),$=$.slice(0,-1*R),O=O.slice(0,-1*R);P.push(this.productions_[b[1]][0]),$.push(r.$),O.push(r._$),m=w[P[P.length-2]][P[P.length-1]],P.push(m);break;case 3:return!0}}return!0}},_=function(){var K={EOF:1,parseError:function Y(f,P){if(this.yy.parser)this.yy.parser.parseError(f,P);else throw new Error(f)},setInput:function Y(f){if(this._input=f,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},input:function Y(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var P=f.match(/(?:\r\n?|\n).*/g);if(P)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),f},unput:function Y(f){var P=f.length,$=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P-1),this.offset-=P;var O=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),$.length-1)this.yylineno-=$.length-1;var w=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:$?($.length===O.length?this.yylloc.first_column:0)+O[O.length-$.length].length-$[0].length:this.yylloc.first_column-P},this.options.ranges)this.yylloc.range=[w[0],w[0]+this.yyleng-P];return this},more:function Y(){return this._more=!0,this},less:function Y(f){this.unput(this.match.slice(f))},pastInput:function Y(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},upcomingInput:function Y(){var f=this.match;if(f.length<20)f+=this._input.substr(0,20-f.length);return(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},showPosition:function Y(){var f=this.pastInput(),P=new Array(f.length+1).join("-");return f+this.upcomingInput()+`
34
- `+P+"^"},next:function Y(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var f,P,$,O,w,v;if(!this._more)this.yytext="",this.match="";var z=this._currentRules();for(var W=0;W<z.length;W++)if($=this._input.match(this.rules[z[W]]),$&&(!P||$[0].length>P[0].length)){if(P=$,O=W,!this.options.flex)break}if(P){if(v=P[0].match(/(?:\r\n?|\n).*/g),v)this.yylineno+=v.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:v?v[v.length-1].length-v[v.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+P[0].length},this.yytext+=P[0],this.match+=P[0],this.matches=P,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._input=this._input.slice(P[0].length),this.matched+=P[0],f=this.performAction.call(this,this.yy,this,z[O],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(f)return f;else return}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
35
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function Y(){var f=this.next();if(typeof f!=="undefined")return f;else return this.lex()},begin:function Y(f){this.conditionStack.push(f)},popState:function Y(){return this.conditionStack.pop()},_currentRules:function Y(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function Y(){return this.conditionStack[this.conditionStack.length-2]},pushState:function Y(f){this.begin(f)}};return K.options={},K.performAction=function Y(f,P,$,O){function w(z,W){return P.yytext=P.yytext.substring(z,P.yyleng-W+z)}var v=O;switch($){case 0:if(P.yytext.slice(-2)==="\\\\")w(0,1),this.begin("mu");else if(P.yytext.slice(-1)==="\\")w(0,1),this.begin("emu");else this.begin("mu");if(P.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:if(this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw")return 15;else return w(5,9),"END_RAW_BLOCK";break;case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(P.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return P.yytext=w(1,2).replace(/\\"/g,'"'),80;break;case 32:return P.yytext=w(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return P.yytext=P.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},K.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],K.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},K}();q.lexer=_;function j(){this.yy={}}return j.prototype=q,q.Parser=j,new j}();Mj.default=YW;Nj.exports=Mj.default});var x3=q8((Rj,mj)=>{Rj.__esModule=!0;function wW(q){return q&&q.__esModule?q:{default:q}}var OW=t6(),u4=wW(OW);function L3(){this.parents=[]}L3.prototype={constructor:L3,mutating:!1,acceptKey:function q(_,j){var K=this.accept(_[j]);if(this.mutating){if(K&&!L3.prototype[K.type])throw new u4.default('Unexpected node type "'+K.type+'" found when accepting '+j+" on "+_.type);_[j]=K}},acceptRequired:function q(_,j){if(this.acceptKey(_,j),!_[j])throw new u4.default(_.type+" requires "+j)},acceptArray:function q(_){for(var j=0,K=_.length;j<K;j++)if(this.acceptKey(_,j),!_[j])_.splice(j,1),j--,K--},accept:function q(_){if(!_)return;if(!this[_.type])throw new u4.default("Unknown type: "+_.type,_);if(this.current)this.parents.unshift(this.current);this.current=_;var j=this[_.type](_);if(this.current=this.parents.shift(),!this.mutating||j)return j;else if(j!==!1)return _},Program:function q(_){this.acceptArray(_.body)},MustacheStatement:l3,Decorator:l3,BlockStatement:Sj,DecoratorBlock:Sj,PartialStatement:Ej,PartialBlockStatement:function q(_){Ej.call(this,_),this.acceptKey(_,"program")},ContentStatement:function q(){},CommentStatement:function q(){},SubExpression:l3,PathExpression:function q(){},StringLiteral:function q(){},NumberLiteral:function q(){},BooleanLiteral:function q(){},UndefinedLiteral:function q(){},NullLiteral:function q(){},Hash:function q(_){this.acceptArray(_.pairs)},HashPair:function q(_){this.acceptRequired(_,"value")}};function l3(q){this.acceptRequired(q,"path"),this.acceptArray(q.params),this.acceptKey(q,"hash")}function Sj(q){l3.call(this,q),this.acceptKey(q,"program"),this.acceptKey(q,"inverse")}function Ej(q){this.acceptRequired(q,"name"),this.acceptArray(q.params),this.acceptKey(q,"hash")}Rj.default=L3;mj.exports=Rj.default});var yj=q8((Ij,gj)=>{Ij.__esModule=!0;function WW(q){return q&&q.__esModule?q:{default:q}}var JW=x3(),HW=WW(JW);function Gq(){var q=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=q}Gq.prototype=new HW.default;Gq.prototype.Program=function(q){var _=!this.options.ignoreStandalone,j=!this.isRootSeen;this.isRootSeen=!0;var K=q.body;for(var Y=0,f=K.length;Y<f;Y++){var P=K[Y],$=this.accept(P);if(!$)continue;var O=h4(K,Y,j),w=D4(K,Y,j),v=$.openStandalone&&O,z=$.closeStandalone&&w,W=$.inlineStandalone&&O&&w;if($.close)w_(K,Y,!0);if($.open)oq(K,Y,!0);if(_&&W){if(w_(K,Y),oq(K,Y)){if(P.type==="PartialStatement")P.indent=/([ \t]+$)/.exec(K[Y-1].original)[1]}}if(_&&v)w_((P.program||P.inverse).body),oq(K,Y);if(_&&z)w_(K,Y),oq((P.inverse||P.program).body)}return q};Gq.prototype.BlockStatement=Gq.prototype.DecoratorBlock=Gq.prototype.PartialBlockStatement=function(q){this.accept(q.program),this.accept(q.inverse);var _=q.program||q.inverse,j=q.program&&q.inverse,K=j,Y=j;if(j&&j.chained){K=j.body[0].program;while(Y.chained)Y=Y.body[Y.body.length-1].program}var f={open:q.openStrip.open,close:q.closeStrip.close,openStandalone:D4(_.body),closeStandalone:h4((K||_).body)};if(q.openStrip.close)w_(_.body,null,!0);if(j){var P=q.inverseStrip;if(P.open)oq(_.body,null,!0);if(P.close)w_(K.body,null,!0);if(q.closeStrip.open)oq(Y.body,null,!0);if(!this.options.ignoreStandalone&&h4(_.body)&&D4(K.body))oq(_.body),w_(K.body)}else if(q.closeStrip.open)oq(_.body,null,!0);return f};Gq.prototype.Decorator=Gq.prototype.MustacheStatement=function(q){return q.strip};Gq.prototype.PartialStatement=Gq.prototype.CommentStatement=function(q){var _=q.strip||{};return{inlineStandalone:!0,open:_.open,close:_.close}};function h4(q,_,j){if(_===void 0)_=q.length;var K=q[_-1],Y=q[_-2];if(!K)return j;if(K.type==="ContentStatement")return(Y||!j?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(K.original)}function D4(q,_,j){if(_===void 0)_=-1;var K=q[_+1],Y=q[_+2];if(!K)return j;if(K.type==="ContentStatement")return(Y||!j?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(K.original)}function w_(q,_,j){var K=q[_==null?0:_+1];if(!K||K.type!=="ContentStatement"||!j&&K.rightStripped)return;var Y=K.value;K.value=K.value.replace(j?/^\s+/:/^[ \t]*\r?\n?/,""),K.rightStripped=K.value!==Y}function oq(q,_,j){var K=q[_==null?q.length-1:_-1];if(!K||K.type!=="ContentStatement"||!j&&K.leftStripped)return;var Y=K.value;return K.value=K.value.replace(j?/\s+$/:/[ \t]+$/,""),K.leftStripped=K.value!==Y,K.leftStripped}Ij.default=Gq;gj.exports=Ij.default});var dj=q8((SW)=>{SW.__esModule=!0;SW.SourceLocation=AW;SW.id=GW;SW.stripFlags=uW;SW.stripComment=hW;SW.preparePath=DW;SW.prepareMustache=CW;SW.prepareRawBlock=VW;SW.prepareBlock=MW;SW.prepareProgram=NW;SW.preparePartialBlock=bW;function kW(q){return q&&q.__esModule?q:{default:q}}var XW=t6(),C4=kW(XW);function V4(q,_){if(_=_.path?_.path.original:_,q.path.original!==_){var j={loc:q.path.loc};throw new C4.default(q.path.original+" doesn't match "+_,j)}}function AW(q,_){this.source=q,this.start={line:_.first_line,column:_.first_column},this.end={line:_.last_line,column:_.last_column}}function GW(q){if(/^\[.*\]$/.test(q))return q.substring(1,q.length-1);else return q}function uW(q,_){return{open:q.charAt(2)==="~",close:_.charAt(_.length-3)==="~"}}function hW(q){return q.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function DW(q,_,j){j=this.locInfo(j);var K=q?"@":"",Y=[],f=0;for(var P=0,$=_.length;P<$;P++){var O=_[P].part,w=_[P].original!==O;if(K+=(_[P].separator||"")+O,!w&&(O===".."||O==="."||O==="this")){if(Y.length>0)throw new C4.default("Invalid path: "+K,{loc:j});else if(O==="..")f++}else Y.push(O)}return{type:"PathExpression",data:q,depth:f,parts:Y,original:K,loc:j}}function CW(q,_,j,K,Y,f){var P=K.charAt(3)||K.charAt(2),$=P!=="{"&&P!=="&",O=/\*/.test(K);return{type:O?"Decorator":"MustacheStatement",path:q,params:_,hash:j,escaped:$,strip:Y,loc:this.locInfo(f)}}function VW(q,_,j,K){V4(q,j),K=this.locInfo(K);var Y={type:"Program",body:_,strip:{},loc:K};return{type:"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:Y,openStrip:{},inverseStrip:{},closeStrip:{},loc:K}}function MW(q,_,j,K,Y,f){if(K&&K.path)V4(q,K);var P=/\*/.test(q.open);_.blockParams=q.blockParams;var $=void 0,O=void 0;if(j){if(P)throw new C4.default("Unexpected inverse block on decorator",j);if(j.chain)j.program.body[0].closeStrip=K.strip;O=j.strip,$=j.program}if(Y)Y=$,$=_,_=Y;return{type:P?"DecoratorBlock":"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:_,inverse:$,openStrip:q.strip,inverseStrip:O,closeStrip:K&&K.strip,loc:this.locInfo(f)}}function NW(q,_){if(!_&&q.length){var j=q[0].loc,K=q[q.length-1].loc;if(j&&K)_={source:j.source,start:{line:j.start.line,column:j.start.column},end:{line:K.end.line,column:K.end.column}}}return{type:"Program",body:q,strip:{},loc:_}}function bW(q,_,j,K){return V4(q,j),{type:"PartialBlockStatement",name:q.path,params:q.params,hash:q.hash,program:_,openStrip:q.strip,closeStrip:j&&j.strip,loc:this.locInfo(K)}}});var lj=q8((eW)=>{eW.__esModule=!0;eW.parseWithoutProcessing=Lj;eW.parse=tW;function nW(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}function pj(q){return q&&q.__esModule?q:{default:q}}var cW=bj(),M4=pj(cW),rW=yj(),iW=pj(rW),oW=dj(),aW=nW(oW),BW=D6();eW.parser=M4.default;var n3={};BW.extend(n3,aW);function Lj(q,_){if(q.type==="Program")return q;M4.default.yy=n3,n3.locInfo=function(K){return new n3.SourceLocation(_&&_.srcName,K)};var j=M4.default.parse(q);return j}function tW(q,_){var j=Lj(q,_),K=new iW.default(_);return K.accept(j)}});var rj=q8((YJ)=>{YJ.__esModule=!0;YJ.Compiler=N4;YJ.precompile=jJ;YJ.compile=PJ;function nj(q){return q&&q.__esModule?q:{default:q}}var qJ=t6(),gK=nj(qJ),yK=D6(),_J=G4(),IK=nj(_J),KJ=[].slice;function N4(){}N4.prototype={compiler:N4,equals:function q(_){var j=this.opcodes.length;if(_.opcodes.length!==j)return!1;for(var K=0;K<j;K++){var Y=this.opcodes[K],f=_.opcodes[K];if(Y.opcode!==f.opcode||!cj(Y.args,f.args))return!1}j=this.children.length;for(var K=0;K<j;K++)if(!this.children[K].equals(_.children[K]))return!1;return!0},guid:0,compile:function q(_,j){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=j,this.stringParams=j.stringParams,this.trackIds=j.trackIds,j.blockParams=j.blockParams||[],j.knownHelpers=yK.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},j.knownHelpers),this.accept(_)},compileProgram:function q(_){var j=new this.compiler,K=j.compile(_,this.options),Y=this.guid++;return this.usePartial=this.usePartial||K.usePartial,this.children[Y]=K,this.useDepths=this.useDepths||K.useDepths,Y},accept:function q(_){if(!this[_.type])throw new gK.default("Unknown type: "+_.type,_);this.sourceNode.unshift(_);var j=this[_.type](_);return this.sourceNode.shift(),j},Program:function q(_){this.options.blockParams.unshift(_.blockParams);var j=_.body,K=j.length;for(var Y=0;Y<K;Y++)this.accept(j[Y]);return this.options.blockParams.shift(),this.isSimple=K===1,this.blockParams=_.blockParams?_.blockParams.length:0,this},BlockStatement:function q(_){xj(_);var{program:j,inverse:K}=_;j=j&&this.compileProgram(j),K=K&&this.compileProgram(K);var Y=this.classifySexpr(_);if(Y==="helper")this.helperSexpr(_,j,K);else if(Y==="simple")this.simpleSexpr(_),this.opcode("pushProgram",j),this.opcode("pushProgram",K),this.opcode("emptyHash"),this.opcode("blockValue",_.path.original);else this.ambiguousSexpr(_,j,K),this.opcode("pushProgram",j),this.opcode("pushProgram",K),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue");this.opcode("append")},DecoratorBlock:function q(_){var j=_.program&&this.compileProgram(_.program),K=this.setupFullMustacheParams(_,j,void 0),Y=_.path;this.useDecorators=!0,this.opcode("registerDecorator",K.length,Y.original)},PartialStatement:function q(_){this.usePartial=!0;var j=_.program;if(j)j=this.compileProgram(_.program);var K=_.params;if(K.length>1)throw new gK.default("Unsupported number of partial arguments: "+K.length,_);else if(!K.length)if(this.options.explicitPartialContext)this.opcode("pushLiteral","undefined");else K.push({type:"PathExpression",parts:[],depth:0});var Y=_.name.original,f=_.name.type==="SubExpression";if(f)this.accept(_.name);this.setupFullMustacheParams(_,j,void 0,!0);var P=_.indent||"";if(this.options.preventIndent&&P)this.opcode("appendContent",P),P="";this.opcode("invokePartial",f,Y,P),this.opcode("append")},PartialBlockStatement:function q(_){this.PartialStatement(_)},MustacheStatement:function q(_){if(this.SubExpression(_),_.escaped&&!this.options.noEscape)this.opcode("appendEscaped");else this.opcode("append")},Decorator:function q(_){this.DecoratorBlock(_)},ContentStatement:function q(_){if(_.value)this.opcode("appendContent",_.value)},CommentStatement:function q(){},SubExpression:function q(_){xj(_);var j=this.classifySexpr(_);if(j==="simple")this.simpleSexpr(_);else if(j==="helper")this.helperSexpr(_);else this.ambiguousSexpr(_)},ambiguousSexpr:function q(_,j,K){var Y=_.path,f=Y.parts[0],P=j!=null||K!=null;this.opcode("getContext",Y.depth),this.opcode("pushProgram",j),this.opcode("pushProgram",K),Y.strict=!0,this.accept(Y),this.opcode("invokeAmbiguous",f,P)},simpleSexpr:function q(_){var j=_.path;j.strict=!0,this.accept(j),this.opcode("resolvePossibleLambda")},helperSexpr:function q(_,j,K){var Y=this.setupFullMustacheParams(_,j,K),f=_.path,P=f.parts[0];if(this.options.knownHelpers[P])this.opcode("invokeKnownHelper",Y.length,P);else if(this.options.knownHelpersOnly)throw new gK.default("You specified knownHelpersOnly, but used the unknown helper "+P,_);else f.strict=!0,f.falsy=!0,this.accept(f),this.opcode("invokeHelper",Y.length,f.original,IK.default.helpers.simpleId(f))},PathExpression:function q(_){this.addDepth(_.depth),this.opcode("getContext",_.depth);var j=_.parts[0],K=IK.default.helpers.scopedId(_),Y=!_.depth&&!K&&this.blockParamIndex(j);if(Y)this.opcode("lookupBlockParam",Y,_.parts);else if(!j)this.opcode("pushContext");else if(_.data)this.options.data=!0,this.opcode("lookupData",_.depth,_.parts,_.strict);else this.opcode("lookupOnContext",_.parts,_.falsy,_.strict,K)},StringLiteral:function q(_){this.opcode("pushString",_.value)},NumberLiteral:function q(_){this.opcode("pushLiteral",_.value)},BooleanLiteral:function q(_){this.opcode("pushLiteral",_.value)},UndefinedLiteral:function q(){this.opcode("pushLiteral","undefined")},NullLiteral:function q(){this.opcode("pushLiteral","null")},Hash:function q(_){var j=_.pairs,K=0,Y=j.length;this.opcode("pushHash");for(;K<Y;K++)this.pushParam(j[K].value);while(K--)this.opcode("assignToHash",j[K].key);this.opcode("popHash")},opcode:function q(_){this.opcodes.push({opcode:_,args:KJ.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function q(_){if(!_)return;this.useDepths=!0},classifySexpr:function q(_){var j=IK.default.helpers.simpleId(_.path),K=j&&!!this.blockParamIndex(_.path.parts[0]),Y=!K&&IK.default.helpers.helperExpression(_),f=!K&&(Y||j);if(f&&!Y){var P=_.path.parts[0],$=this.options;if($.knownHelpers[P])Y=!0;else if($.knownHelpersOnly)f=!1}if(Y)return"helper";else if(f)return"ambiguous";else return"simple"},pushParams:function q(_){for(var j=0,K=_.length;j<K;j++)this.pushParam(_[j])},pushParam:function q(_){var j=_.value!=null?_.value:_.original||"";if(this.stringParams){if(j.replace)j=j.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".");if(_.depth)this.addDepth(_.depth);if(this.opcode("getContext",_.depth||0),this.opcode("pushStringParam",j,_.type),_.type==="SubExpression")this.accept(_)}else{if(this.trackIds){var K=void 0;if(_.parts&&!IK.default.helpers.scopedId(_)&&!_.depth)K=this.blockParamIndex(_.parts[0]);if(K){var Y=_.parts.slice(1).join(".");this.opcode("pushId","BlockParam",K,Y)}else{if(j=_.original||j,j.replace)j=j.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"");this.opcode("pushId",_.type,j)}}this.accept(_)}},setupFullMustacheParams:function q(_,j,K,Y){var f=_.params;if(this.pushParams(f),this.opcode("pushProgram",j),this.opcode("pushProgram",K),_.hash)this.accept(_.hash);else this.opcode("emptyHash",Y);return f},blockParamIndex:function q(_){for(var j=0,K=this.options.blockParams.length;j<K;j++){var Y=this.options.blockParams[j],f=Y&&yK.indexOf(Y,_);if(Y&&f>=0)return[j,f]}}};function jJ(q,_,j){if(q==null||typeof q!=="string"&&q.type!=="Program")throw new gK.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+q);if(_=_||{},!("data"in _))_.data=!0;if(_.compat)_.useDepths=!0;var K=j.parse(q,_),Y=new j.Compiler().compile(K,_);return new j.JavaScriptCompiler().compile(Y,_)}function PJ(q,_,j){if(_===void 0)_={};if(q==null||typeof q!=="string"&&q.type!=="Program")throw new gK.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+q);if(_=yK.extend({},_),!("data"in _))_.data=!0;if(_.compat)_.useDepths=!0;var K=void 0;function Y(){var P=j.parse(q,_),$=new j.Compiler().compile(P,_),O=new j.JavaScriptCompiler().compile($,_,void 0,!0);return j.template(O)}function f(P,$){if(!K)K=Y();return K.call(this,P,$)}return f._setup=function(P){if(!K)K=Y();return K._setup(P)},f._child=function(P,$,O,w){if(!K)K=Y();return K._child(P,$,O,w)},f}function cj(q,_){if(q===_)return!0;if(yK.isArray(q)&&yK.isArray(_)&&q.length===_.length){for(var j=0;j<q.length;j++)if(!cj(q[j],_[j]))return!1;return!0}}function xj(q){if(!q.path.parts){var _=q.path;q.path={type:"PathExpression",data:!1,depth:0,parts:[_.original+""],original:_.original+"",loc:_.loc}}}});var oj=q8((vJ)=>{var ij="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");vJ.encode=function(q){if(0<=q&&q<ij.length)return ij[q];throw new TypeError("Must be between 0 and 63: "+q)};vJ.decode=function(q){var _=65,j=90,K=97,Y=122,f=48,P=57,$=43,O=47,w=26,v=52;if(_<=q&&q<=j)return q-_;if(K<=q&&q<=Y)return q-K+w;if(f<=q&&q<=P)return q-f+v;if(q==$)return 62;if(q==O)return 63;return-1}});var S4=q8((TJ)=>{var aj=oj(),b4=5,Bj=1<<b4,tj=Bj-1,ej=Bj;function JJ(q){return q<0?(-q<<1)+1:(q<<1)+0}function HJ(q){var _=(q&1)===1,j=q>>1;return _?-j:j}TJ.encode=function q(_){var j="",K,Y=JJ(_);do{if(K=Y&tj,Y>>>=b4,Y>0)K|=ej;j+=aj.encode(K)}while(Y>0);return j};TJ.decode=function q(_,j,K){var Y=_.length,f=0,P=0,$,O;do{if(j>=Y)throw new Error("Expected more digits in base 64 VLQ value.");if(O=aj.decode(_.charCodeAt(j++)),O===-1)throw new Error("Invalid base64 digit: "+_.charAt(j-1));$=!!(O&ej),O&=tj,f=f+(O<<P),P+=b4}while($);K.value=HJ(f),K.rest=j}});var L_=q8((bJ)=>{function XJ(q,_,j){if(_ in q)return q[_];else if(arguments.length===3)return j;else throw new Error('"'+_+'" is a required argument.')}bJ.getArg=XJ;var Fj=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,AJ=/^data:.+\,.+$/;function dK(q){var _=q.match(Fj);if(!_)return null;return{scheme:_[1],auth:_[2],host:_[3],port:_[4],path:_[5]}}bJ.urlParse=dK;function d_(q){var _="";if(q.scheme)_+=q.scheme+":";if(_+="//",q.auth)_+=q.auth+"@";if(q.host)_+=q.host;if(q.port)_+=":"+q.port;if(q.path)_+=q.path;return _}bJ.urlGenerate=d_;function E4(q){var _=q,j=dK(q);if(j){if(!j.path)return q;_=j.path}var K=bJ.isAbsolute(_),Y=_.split(/\/+/);for(var f,P=0,$=Y.length-1;$>=0;$--)if(f=Y[$],f===".")Y.splice($,1);else if(f==="..")P++;else if(P>0)if(f==="")Y.splice($+1,P),P=0;else Y.splice($,2),P--;if(_=Y.join("/"),_==="")_=K?"/":".";if(j)return j.path=_,d_(j);return _}bJ.normalize=E4;function Uj(q,_){if(q==="")q=".";if(_==="")_=".";var j=dK(_),K=dK(q);if(K)q=K.path||"/";if(j&&!j.scheme){if(K)j.scheme=K.scheme;return d_(j)}if(j||_.match(AJ))return _;if(K&&!K.host&&!K.path)return K.host=_,d_(K);var Y=_.charAt(0)==="/"?_:E4(q.replace(/\/+$/,"")+"/"+_);if(K)return K.path=Y,d_(K);return Y}bJ.join=Uj;bJ.isAbsolute=function(q){return q.charAt(0)==="/"||Fj.test(q)};function GJ(q,_){if(q==="")q=".";q=q.replace(/\/$/,"");var j=0;while(_.indexOf(q+"/")!==0){var K=q.lastIndexOf("/");if(K<0)return _;if(q=q.slice(0,K),q.match(/^([^\/]+:\/)?\/*$/))return _;++j}return Array(j+1).join("../")+_.substr(q.length+1)}bJ.relative=GJ;var sj=function(){var q=Object.create(null);return!("__proto__"in q)}();function Qj(q){return q}function uJ(q){if(q1(q))return"$"+q;return q}bJ.toSetString=sj?Qj:uJ;function hJ(q){if(q1(q))return q.slice(1);return q}bJ.fromSetString=sj?Qj:hJ;function q1(q){if(!q)return!1;var _=q.length;if(_<9)return!1;if(q.charCodeAt(_-1)!==95||q.charCodeAt(_-2)!==95||q.charCodeAt(_-3)!==111||q.charCodeAt(_-4)!==116||q.charCodeAt(_-5)!==111||q.charCodeAt(_-6)!==114||q.charCodeAt(_-7)!==112||q.charCodeAt(_-8)!==95||q.charCodeAt(_-9)!==95)return!1;for(var j=_-10;j>=0;j--)if(q.charCodeAt(j)!==36)return!1;return!0}function DJ(q,_,j){var K=p_(q.source,_.source);if(K!==0)return K;if(K=q.originalLine-_.originalLine,K!==0)return K;if(K=q.originalColumn-_.originalColumn,K!==0||j)return K;if(K=q.generatedColumn-_.generatedColumn,K!==0)return K;if(K=q.generatedLine-_.generatedLine,K!==0)return K;return p_(q.name,_.name)}bJ.compareByOriginalPositions=DJ;function CJ(q,_,j){var K=q.generatedLine-_.generatedLine;if(K!==0)return K;if(K=q.generatedColumn-_.generatedColumn,K!==0||j)return K;if(K=p_(q.source,_.source),K!==0)return K;if(K=q.originalLine-_.originalLine,K!==0)return K;if(K=q.originalColumn-_.originalColumn,K!==0)return K;return p_(q.name,_.name)}bJ.compareByGeneratedPositionsDeflated=CJ;function p_(q,_){if(q===_)return 0;if(q===null)return 1;if(_===null)return-1;if(q>_)return 1;return-1}function VJ(q,_){var j=q.generatedLine-_.generatedLine;if(j!==0)return j;if(j=q.generatedColumn-_.generatedColumn,j!==0)return j;if(j=p_(q.source,_.source),j!==0)return j;if(j=q.originalLine-_.originalLine,j!==0)return j;if(j=q.originalColumn-_.originalColumn,j!==0)return j;return p_(q.name,_.name)}bJ.compareByGeneratedPositionsInflated=VJ;function MJ(q){return JSON.parse(q.replace(/^\)]}'[^\n]*\n/,""))}bJ.parseSourceMapInput=MJ;function NJ(q,_,j){if(_=_||"",q){if(q[q.length-1]!=="/"&&_[0]!=="/")q+="/";_=q+_}if(j){var K=dK(j);if(!K)throw new Error("sourceMapURL could not be parsed");if(K.path){var Y=K.path.lastIndexOf("/");if(Y>=0)K.path=K.path.substring(0,Y+1)}_=Uj(d_(K),_)}return E4(_)}bJ.computeSourceURL=NJ});var I4=q8((rJ)=>{var R4=L_(),m4=Object.prototype.hasOwnProperty,O_=typeof Map!=="undefined";function gq(){this._array=[],this._set=O_?new Map:Object.create(null)}gq.fromArray=function q(_,j){var K=new gq;for(var Y=0,f=_.length;Y<f;Y++)K.add(_[Y],j);return K};gq.prototype.size=function q(){return O_?this._set.size:Object.getOwnPropertyNames(this._set).length};gq.prototype.add=function q(_,j){var K=O_?_:R4.toSetString(_),Y=O_?this.has(_):m4.call(this._set,K),f=this._array.length;if(!Y||j)this._array.push(_);if(!Y)if(O_)this._set.set(_,f);else this._set[K]=f};gq.prototype.has=function q(_){if(O_)return this._set.has(_);else{var j=R4.toSetString(_);return m4.call(this._set,j)}};gq.prototype.indexOf=function q(_){if(O_){var j=this._set.get(_);if(j>=0)return j}else{var K=R4.toSetString(_);if(m4.call(this._set,K))return this._set[K]}throw new Error('"'+_+'" is not in the set.')};gq.prototype.at=function q(_){if(_>=0&&_<this._array.length)return this._array[_];throw new Error("No element indexed by "+_)};gq.prototype.toArray=function q(){return this._array.slice()};rJ.ArraySet=gq});var K1=q8((aJ)=>{var _1=L_();function oJ(q,_){var j=q.generatedLine,K=_.generatedLine,Y=q.generatedColumn,f=_.generatedColumn;return K>j||K==j&&f>=Y||_1.compareByGeneratedPositionsInflated(q,_)<=0}function c3(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}c3.prototype.unsortedForEach=function q(_,j){this._array.forEach(_,j)};c3.prototype.add=function q(_){if(oJ(this._last,_))this._last=_,this._array.push(_);else this._sorted=!1,this._array.push(_)};c3.prototype.toArray=function q(){if(!this._sorted)this._array.sort(_1.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};aJ.MappingList=c3});var g4=q8((eJ)=>{var pK=S4(),q6=L_(),r3=I4().ArraySet,tJ=K1().MappingList;function e6(q){if(!q)q={};this._file=q6.getArg(q,"file",null),this._sourceRoot=q6.getArg(q,"sourceRoot",null),this._skipValidation=q6.getArg(q,"skipValidation",!1),this._sources=new r3,this._names=new r3,this._mappings=new tJ,this._sourcesContents=null}e6.prototype._version=3;e6.fromSourceMap=function q(_){var j=_.sourceRoot,K=new e6({file:_.file,sourceRoot:j});return _.eachMapping(function(Y){var f={generated:{line:Y.generatedLine,column:Y.generatedColumn}};if(Y.source!=null){if(f.source=Y.source,j!=null)f.source=q6.relative(j,f.source);if(f.original={line:Y.originalLine,column:Y.originalColumn},Y.name!=null)f.name=Y.name}K.addMapping(f)}),_.sources.forEach(function(Y){var f=Y;if(j!==null)f=q6.relative(j,Y);if(!K._sources.has(f))K._sources.add(f);var P=_.sourceContentFor(Y);if(P!=null)K.setSourceContent(Y,P)}),K};e6.prototype.addMapping=function q(_){var j=q6.getArg(_,"generated"),K=q6.getArg(_,"original",null),Y=q6.getArg(_,"source",null),f=q6.getArg(_,"name",null);if(!this._skipValidation)this._validateMapping(j,K,Y,f);if(Y!=null){if(Y=String(Y),!this._sources.has(Y))this._sources.add(Y)}if(f!=null){if(f=String(f),!this._names.has(f))this._names.add(f)}this._mappings.add({generatedLine:j.line,generatedColumn:j.column,originalLine:K!=null&&K.line,originalColumn:K!=null&&K.column,source:Y,name:f})};e6.prototype.setSourceContent=function q(_,j){var K=_;if(this._sourceRoot!=null)K=q6.relative(this._sourceRoot,K);if(j!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[q6.toSetString(K)]=j}else if(this._sourcesContents){if(delete this._sourcesContents[q6.toSetString(K)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};e6.prototype.applySourceMap=function q(_,j,K){var Y=j;if(j==null){if(_.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);Y=_.file}var f=this._sourceRoot;if(f!=null)Y=q6.relative(f,Y);var P=new r3,$=new r3;this._mappings.unsortedForEach(function(O){if(O.source===Y&&O.originalLine!=null){var w=_.originalPositionFor({line:O.originalLine,column:O.originalColumn});if(w.source!=null){if(O.source=w.source,K!=null)O.source=q6.join(K,O.source);if(f!=null)O.source=q6.relative(f,O.source);if(O.originalLine=w.line,O.originalColumn=w.column,w.name!=null)O.name=w.name}}var v=O.source;if(v!=null&&!P.has(v))P.add(v);var z=O.name;if(z!=null&&!$.has(z))$.add(z)},this),this._sources=P,this._names=$,_.sources.forEach(function(O){var w=_.sourceContentFor(O);if(w!=null){if(K!=null)O=q6.join(K,O);if(f!=null)O=q6.relative(f,O);this.setSourceContent(O,w)}},this)};e6.prototype._validateMapping=function q(_,j,K,Y){if(j&&typeof j.line!=="number"&&typeof j.column!=="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(_&&"line"in _&&"column"in _&&_.line>0&&_.column>=0&&!j&&!K&&!Y)return;else if(_&&"line"in _&&"column"in _&&j&&"line"in j&&"column"in j&&_.line>0&&_.column>=0&&j.line>0&&j.column>=0&&K)return;else throw new Error("Invalid mapping: "+JSON.stringify({generated:_,source:K,original:j,name:Y}))};e6.prototype._serializeMappings=function q(){var _=0,j=1,K=0,Y=0,f=0,P=0,$="",O,w,v,z,W=this._mappings.toArray();for(var J=0,Z=W.length;J<Z;J++){if(w=W[J],O="",w.generatedLine!==j){_=0;while(w.generatedLine!==j)O+=";",j++}else if(J>0){if(!q6.compareByGeneratedPositionsInflated(w,W[J-1]))continue;O+=","}if(O+=pK.encode(w.generatedColumn-_),_=w.generatedColumn,w.source!=null){if(z=this._sources.indexOf(w.source),O+=pK.encode(z-P),P=z,O+=pK.encode(w.originalLine-1-Y),Y=w.originalLine-1,O+=pK.encode(w.originalColumn-K),K=w.originalColumn,w.name!=null)v=this._names.indexOf(w.name),O+=pK.encode(v-f),f=v}$+=O}return $};e6.prototype._generateSourcesContent=function q(_,j){return _.map(function(K){if(!this._sourcesContents)return null;if(j!=null)K=q6.relative(j,K);var Y=q6.toSetString(K);return Object.prototype.hasOwnProperty.call(this._sourcesContents,Y)?this._sourcesContents[Y]:null},this)};e6.prototype.toJSON=function q(){var _={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)_.file=this._file;if(this._sourceRoot!=null)_.sourceRoot=this._sourceRoot;if(this._sourcesContents)_.sourcesContent=this._generateSourcesContent(_.sources,_.sourceRoot);return _};e6.prototype.toString=function q(){return JSON.stringify(this.toJSON())};eJ.SourceMapGenerator=e6});var P1=q8((UJ)=>{UJ.GREATEST_LOWER_BOUND=1;UJ.LEAST_UPPER_BOUND=2;function y4(q,_,j,K,Y,f){var P=Math.floor((_-q)/2)+q,$=Y(j,K[P],!0);if($===0)return P;else if($>0){if(_-P>1)return y4(P,_,j,K,Y,f);if(f==UJ.LEAST_UPPER_BOUND)return _<K.length?_:-1;else return P}else{if(P-q>1)return y4(q,P,j,K,Y,f);if(f==UJ.LEAST_UPPER_BOUND)return P;else return q<0?-1:q}}UJ.search=function q(_,j,K,Y){if(j.length===0)return-1;var f=y4(-1,j.length,_,j,K,Y||UJ.GREATEST_LOWER_BOUND);if(f<0)return-1;while(f-1>=0){if(K(j[f],j[f-1],!0)!==0)break;--f}return f}});var Y1=q8((qH)=>{function p4(q,_,j){var K=q[_];q[_]=q[j],q[j]=K}function QJ(q,_){return Math.round(q+Math.random()*(_-q))}function L4(q,_,j,K){if(j<K){var Y=QJ(j,K),f=j-1;p4(q,Y,K);var P=q[K];for(var $=j;$<K;$++)if(_(q[$],P)<=0)f+=1,p4(q,f,$);p4(q,f+1,$);var O=f+1;L4(q,_,j,O-1),L4(q,_,O+1,K)}}qH.quickSort=function(q,_){L4(q,_,0,q.length-1)}});var $1=q8((jH)=>{var _8=L_(),l4=P1(),l_=I4().ArraySet,KH=S4(),LK=Y1().quickSort;function I8(q,_){var j=q;if(typeof q==="string")j=_8.parseSourceMapInput(q);return j.sections!=null?new Yq(j,_):new W6(j,_)}I8.fromSourceMap=function(q,_){return W6.fromSourceMap(q,_)};I8.prototype._version=3;I8.prototype.__generatedMappings=null;Object.defineProperty(I8.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__generatedMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__generatedMappings}});I8.prototype.__originalMappings=null;Object.defineProperty(I8.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__originalMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__originalMappings}});I8.prototype._charIsMappingSeparator=function q(_,j){var K=_.charAt(j);return K===";"||K===","};I8.prototype._parseMappings=function q(_,j){throw new Error("Subclasses must implement _parseMappings")};I8.GENERATED_ORDER=1;I8.ORIGINAL_ORDER=2;I8.GREATEST_LOWER_BOUND=1;I8.LEAST_UPPER_BOUND=2;I8.prototype.eachMapping=function q(_,j,K){var Y=j||null,f=K||I8.GENERATED_ORDER,P;switch(f){case I8.GENERATED_ORDER:P=this._generatedMappings;break;case I8.ORIGINAL_ORDER:P=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var $=this.sourceRoot;P.map(function(O){var w=O.source===null?null:this._sources.at(O.source);return w=_8.computeSourceURL($,w,this._sourceMapURL),{source:w,generatedLine:O.generatedLine,generatedColumn:O.generatedColumn,originalLine:O.originalLine,originalColumn:O.originalColumn,name:O.name===null?null:this._names.at(O.name)}},this).forEach(_,Y)};I8.prototype.allGeneratedPositionsFor=function q(_){var j=_8.getArg(_,"line"),K={source:_8.getArg(_,"source"),originalLine:j,originalColumn:_8.getArg(_,"column",0)};if(K.source=this._findSourceIndex(K.source),K.source<0)return[];var Y=[],f=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",_8.compareByOriginalPositions,l4.LEAST_UPPER_BOUND);if(f>=0){var P=this._originalMappings[f];if(_.column===void 0){var $=P.originalLine;while(P&&P.originalLine===$)Y.push({line:_8.getArg(P,"generatedLine",null),column:_8.getArg(P,"generatedColumn",null),lastColumn:_8.getArg(P,"lastGeneratedColumn",null)}),P=this._originalMappings[++f]}else{var O=P.originalColumn;while(P&&P.originalLine===j&&P.originalColumn==O)Y.push({line:_8.getArg(P,"generatedLine",null),column:_8.getArg(P,"generatedColumn",null),lastColumn:_8.getArg(P,"lastGeneratedColumn",null)}),P=this._originalMappings[++f]}}return Y};jH.SourceMapConsumer=I8;function W6(q,_){var j=q;if(typeof q==="string")j=_8.parseSourceMapInput(q);var K=_8.getArg(j,"version"),Y=_8.getArg(j,"sources"),f=_8.getArg(j,"names",[]),P=_8.getArg(j,"sourceRoot",null),$=_8.getArg(j,"sourcesContent",null),O=_8.getArg(j,"mappings"),w=_8.getArg(j,"file",null);if(K!=this._version)throw new Error("Unsupported version: "+K);if(P)P=_8.normalize(P);Y=Y.map(String).map(_8.normalize).map(function(v){return P&&_8.isAbsolute(P)&&_8.isAbsolute(v)?_8.relative(P,v):v}),this._names=l_.fromArray(f.map(String),!0),this._sources=l_.fromArray(Y,!0),this._absoluteSources=this._sources.toArray().map(function(v){return _8.computeSourceURL(P,v,_)}),this.sourceRoot=P,this.sourcesContent=$,this._mappings=O,this._sourceMapURL=_,this.file=w}W6.prototype=Object.create(I8.prototype);W6.prototype.consumer=I8;W6.prototype._findSourceIndex=function(q){var _=q;if(this.sourceRoot!=null)_=_8.relative(this.sourceRoot,_);if(this._sources.has(_))return this._sources.indexOf(_);var j;for(j=0;j<this._absoluteSources.length;++j)if(this._absoluteSources[j]==q)return j;return-1};W6.fromSourceMap=function q(_,j){var K=Object.create(W6.prototype),Y=K._names=l_.fromArray(_._names.toArray(),!0),f=K._sources=l_.fromArray(_._sources.toArray(),!0);K.sourceRoot=_._sourceRoot,K.sourcesContent=_._generateSourcesContent(K._sources.toArray(),K.sourceRoot),K.file=_._file,K._sourceMapURL=j,K._absoluteSources=K._sources.toArray().map(function(J){return _8.computeSourceURL(K.sourceRoot,J,j)});var P=_._mappings.toArray().slice(),$=K.__generatedMappings=[],O=K.__originalMappings=[];for(var w=0,v=P.length;w<v;w++){var z=P[w],W=new f1;if(W.generatedLine=z.generatedLine,W.generatedColumn=z.generatedColumn,z.source){if(W.source=f.indexOf(z.source),W.originalLine=z.originalLine,W.originalColumn=z.originalColumn,z.name)W.name=Y.indexOf(z.name);O.push(W)}$.push(W)}return LK(K.__originalMappings,_8.compareByOriginalPositions),K};W6.prototype._version=3;Object.defineProperty(W6.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function f1(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}W6.prototype._parseMappings=function q(_,j){var K=1,Y=0,f=0,P=0,$=0,O=0,w=_.length,v=0,z={},W={},J=[],Z=[],H,X,A,G,D;while(v<w)if(_.charAt(v)===";")K++,v++,Y=0;else if(_.charAt(v)===",")v++;else{H=new f1,H.generatedLine=K;for(G=v;G<w;G++)if(this._charIsMappingSeparator(_,G))break;if(X=_.slice(v,G),A=z[X],A)v+=X.length;else{A=[];while(v<G)KH.decode(_,v,W),D=W.value,v=W.rest,A.push(D);if(A.length===2)throw new Error("Found a source, but no line and column");if(A.length===3)throw new Error("Found a source and line, but no column");z[X]=A}if(H.generatedColumn=Y+A[0],Y=H.generatedColumn,A.length>1){if(H.source=$+A[1],$+=A[1],H.originalLine=f+A[2],f=H.originalLine,H.originalLine+=1,H.originalColumn=P+A[3],P=H.originalColumn,A.length>4)H.name=O+A[4],O+=A[4]}if(Z.push(H),typeof H.originalLine==="number")J.push(H)}LK(Z,_8.compareByGeneratedPositionsDeflated),this.__generatedMappings=Z,LK(J,_8.compareByOriginalPositions),this.__originalMappings=J};W6.prototype._findMapping=function q(_,j,K,Y,f,P){if(_[K]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+_[K]);if(_[Y]<0)throw new TypeError("Column must be greater than or equal to 0, got "+_[Y]);return l4.search(_,j,f,P)};W6.prototype.computeColumnSpans=function q(){for(var _=0;_<this._generatedMappings.length;++_){var j=this._generatedMappings[_];if(_+1<this._generatedMappings.length){var K=this._generatedMappings[_+1];if(j.generatedLine===K.generatedLine){j.lastGeneratedColumn=K.generatedColumn-1;continue}}j.lastGeneratedColumn=1/0}};W6.prototype.originalPositionFor=function q(_){var j={generatedLine:_8.getArg(_,"line"),generatedColumn:_8.getArg(_,"column")},K=this._findMapping(j,this._generatedMappings,"generatedLine","generatedColumn",_8.compareByGeneratedPositionsDeflated,_8.getArg(_,"bias",I8.GREATEST_LOWER_BOUND));if(K>=0){var Y=this._generatedMappings[K];if(Y.generatedLine===j.generatedLine){var f=_8.getArg(Y,"source",null);if(f!==null)f=this._sources.at(f),f=_8.computeSourceURL(this.sourceRoot,f,this._sourceMapURL);var P=_8.getArg(Y,"name",null);if(P!==null)P=this._names.at(P);return{source:f,line:_8.getArg(Y,"originalLine",null),column:_8.getArg(Y,"originalColumn",null),name:P}}}return{source:null,line:null,column:null,name:null}};W6.prototype.hasContentsOfAllSources=function q(){if(!this.sourcesContent)return!1;return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(_){return _==null})};W6.prototype.sourceContentFor=function q(_,j){if(!this.sourcesContent)return null;var K=this._findSourceIndex(_);if(K>=0)return this.sourcesContent[K];var Y=_;if(this.sourceRoot!=null)Y=_8.relative(this.sourceRoot,Y);var f;if(this.sourceRoot!=null&&(f=_8.urlParse(this.sourceRoot))){var P=Y.replace(/^file:\/\//,"");if(f.scheme=="file"&&this._sources.has(P))return this.sourcesContent[this._sources.indexOf(P)];if((!f.path||f.path=="/")&&this._sources.has("/"+Y))return this.sourcesContent[this._sources.indexOf("/"+Y)]}if(j)return null;else throw new Error('"'+Y+'" is not in the SourceMap.')};W6.prototype.generatedPositionFor=function q(_){var j=_8.getArg(_,"source");if(j=this._findSourceIndex(j),j<0)return{line:null,column:null,lastColumn:null};var K={source:j,originalLine:_8.getArg(_,"line"),originalColumn:_8.getArg(_,"column")},Y=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",_8.compareByOriginalPositions,_8.getArg(_,"bias",I8.GREATEST_LOWER_BOUND));if(Y>=0){var f=this._originalMappings[Y];if(f.source===K.source)return{line:_8.getArg(f,"generatedLine",null),column:_8.getArg(f,"generatedColumn",null),lastColumn:_8.getArg(f,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};jH.BasicSourceMapConsumer=W6;function Yq(q,_){var j=q;if(typeof q==="string")j=_8.parseSourceMapInput(q);var K=_8.getArg(j,"version"),Y=_8.getArg(j,"sections");if(K!=this._version)throw new Error("Unsupported version: "+K);this._sources=new l_,this._names=new l_;var f={line:-1,column:0};this._sections=Y.map(function(P){if(P.url)throw new Error("Support for url field in sections not implemented.");var $=_8.getArg(P,"offset"),O=_8.getArg($,"line"),w=_8.getArg($,"column");if(O<f.line||O===f.line&&w<f.column)throw new Error("Section offsets must be ordered and non-overlapping.");return f=$,{generatedOffset:{generatedLine:O+1,generatedColumn:w+1},consumer:new I8(_8.getArg(P,"map"),_)}})}Yq.prototype=Object.create(I8.prototype);Yq.prototype.constructor=I8;Yq.prototype._version=3;Object.defineProperty(Yq.prototype,"sources",{get:function(){var q=[];for(var _=0;_<this._sections.length;_++)for(var j=0;j<this._sections[_].consumer.sources.length;j++)q.push(this._sections[_].consumer.sources[j]);return q}});Yq.prototype.originalPositionFor=function q(_){var j={generatedLine:_8.getArg(_,"line"),generatedColumn:_8.getArg(_,"column")},K=l4.search(j,this._sections,function(f,P){var $=f.generatedLine-P.generatedOffset.generatedLine;if($)return $;return f.generatedColumn-P.generatedOffset.generatedColumn}),Y=this._sections[K];if(!Y)return{source:null,line:null,column:null,name:null};return Y.consumer.originalPositionFor({line:j.generatedLine-(Y.generatedOffset.generatedLine-1),column:j.generatedColumn-(Y.generatedOffset.generatedLine===j.generatedLine?Y.generatedOffset.generatedColumn-1:0),bias:_.bias})};Yq.prototype.hasContentsOfAllSources=function q(){return this._sections.every(function(_){return _.consumer.hasContentsOfAllSources()})};Yq.prototype.sourceContentFor=function q(_,j){for(var K=0;K<this._sections.length;K++){var Y=this._sections[K],f=Y.consumer.sourceContentFor(_,!0);if(f)return f}if(j)return null;else throw new Error('"'+_+'" is not in the SourceMap.')};Yq.prototype.generatedPositionFor=function q(_){for(var j=0;j<this._sections.length;j++){var K=this._sections[j];if(K.consumer._findSourceIndex(_8.getArg(_,"source"))===-1)continue;var Y=K.consumer.generatedPositionFor(_);if(Y){var f={line:Y.line+(K.generatedOffset.generatedLine-1),column:Y.column+(K.generatedOffset.generatedLine===Y.line?K.generatedOffset.generatedColumn-1:0)};return f}}return{line:null,column:null}};Yq.prototype._parseMappings=function q(_,j){this.__generatedMappings=[],this.__originalMappings=[];for(var K=0;K<this._sections.length;K++){var Y=this._sections[K],f=Y.consumer._generatedMappings;for(var P=0;P<f.length;P++){var $=f[P],O=Y.consumer._sources.at($.source);O=_8.computeSourceURL(Y.consumer.sourceRoot,O,this._sourceMapURL),this._sources.add(O),O=this._sources.indexOf(O);var w=null;if($.name)w=Y.consumer._names.at($.name),this._names.add(w),w=this._names.indexOf(w);var v={source:O,generatedLine:$.generatedLine+(Y.generatedOffset.generatedLine-1),generatedColumn:$.generatedColumn+(Y.generatedOffset.generatedLine===$.generatedLine?Y.generatedOffset.generatedColumn-1:0),originalLine:$.originalLine,originalColumn:$.originalColumn,name:w};if(this.__generatedMappings.push(v),typeof v.originalLine==="number")this.__originalMappings.push(v)}}LK(this.__generatedMappings,_8.compareByGeneratedPositionsDeflated),LK(this.__originalMappings,_8.compareByOriginalPositions)};jH.IndexedSourceMapConsumer=Yq});var w1=q8((vH)=>{var $H=g4().SourceMapGenerator,i3=L_(),wH=/(\r?\n)/,OH=10,x_="$$$isSourceNode$$$";function y6(q,_,j,K,Y){if(this.children=[],this.sourceContents={},this.line=q==null?null:q,this.column=_==null?null:_,this.source=j==null?null:j,this.name=Y==null?null:Y,this[x_]=!0,K!=null)this.add(K)}y6.fromStringWithSourceMap=function q(_,j,K){var Y=new y6,f=_.split(wH),P=0,$=function(){var W=Z(),J=Z()||"";return W+J;function Z(){return P<f.length?f[P++]:void 0}},O=1,w=0,v=null;if(j.eachMapping(function(W){if(v!==null)if(O<W.generatedLine)z(v,$()),O++,w=0;else{var J=f[P]||"",Z=J.substr(0,W.generatedColumn-w);f[P]=J.substr(W.generatedColumn-w),w=W.generatedColumn,z(v,Z),v=W;return}while(O<W.generatedLine)Y.add($()),O++;if(w<W.generatedColumn){var J=f[P]||"";Y.add(J.substr(0,W.generatedColumn)),f[P]=J.substr(W.generatedColumn),w=W.generatedColumn}v=W},this),P<f.length){if(v)z(v,$());Y.add(f.splice(P).join(""))}return j.sources.forEach(function(W){var J=j.sourceContentFor(W);if(J!=null){if(K!=null)W=i3.join(K,W);Y.setSourceContent(W,J)}}),Y;function z(W,J){if(W===null||W.source===void 0)Y.add(J);else{var Z=K?i3.join(K,W.source):W.source;Y.add(new y6(W.originalLine,W.originalColumn,Z,J,W.name))}}};y6.prototype.add=function q(_){if(Array.isArray(_))_.forEach(function(j){this.add(j)},this);else if(_[x_]||typeof _==="string"){if(_)this.children.push(_)}else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+_);return this};y6.prototype.prepend=function q(_){if(Array.isArray(_))for(var j=_.length-1;j>=0;j--)this.prepend(_[j]);else if(_[x_]||typeof _==="string")this.children.unshift(_);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+_);return this};y6.prototype.walk=function q(_){var j;for(var K=0,Y=this.children.length;K<Y;K++)if(j=this.children[K],j[x_])j.walk(_);else if(j!=="")_(j,{source:this.source,line:this.line,column:this.column,name:this.name})};y6.prototype.join=function q(_){var j,K,Y=this.children.length;if(Y>0){j=[];for(K=0;K<Y-1;K++)j.push(this.children[K]),j.push(_);j.push(this.children[K]),this.children=j}return this};y6.prototype.replaceRight=function q(_,j){var K=this.children[this.children.length-1];if(K[x_])K.replaceRight(_,j);else if(typeof K==="string")this.children[this.children.length-1]=K.replace(_,j);else this.children.push("".replace(_,j));return this};y6.prototype.setSourceContent=function q(_,j){this.sourceContents[i3.toSetString(_)]=j};y6.prototype.walkSourceContents=function q(_){for(var j=0,K=this.children.length;j<K;j++)if(this.children[j][x_])this.children[j].walkSourceContents(_);var Y=Object.keys(this.sourceContents);for(var j=0,K=Y.length;j<K;j++)_(i3.fromSetString(Y[j]),this.sourceContents[Y[j]])};y6.prototype.toString=function q(){var _="";return this.walk(function(j){_+=j}),_};y6.prototype.toStringWithSourceMap=function q(_){var j={code:"",line:1,column:0},K=new $H(_),Y=!1,f=null,P=null,$=null,O=null;return this.walk(function(w,v){if(j.code+=w,v.source!==null&&v.line!==null&&v.column!==null){if(f!==v.source||P!==v.line||$!==v.column||O!==v.name)K.addMapping({source:v.source,original:{line:v.line,column:v.column},generated:{line:j.line,column:j.column},name:v.name});f=v.source,P=v.line,$=v.column,O=v.name,Y=!0}else if(Y)K.addMapping({generated:{line:j.line,column:j.column}}),f=null,Y=!1;for(var z=0,W=w.length;z<W;z++)if(w.charCodeAt(z)===OH){if(j.line++,j.column=0,z+1===W)f=null,Y=!1;else if(Y)K.addMapping({source:v.source,original:{line:v.line,column:v.column},generated:{line:j.line,column:j.column},name:v.name})}else j.column++}),this.walkSourceContents(function(w,v){K.setSourceContent(w,v)}),{code:j.code,map:K}};vH.SourceNode=y6});var O1=q8((WH)=>{WH.SourceMapGenerator=g4().SourceMapGenerator;WH.SourceMapConsumer=$1().SourceMapConsumer;WH.SourceNode=w1().SourceNode});var J1=q8((z1,W1)=>{z1.__esModule=!0;var n4=D6(),v_=void 0;try{if(typeof define!=="function"||!define.amd)c4=O1(),v_=c4.SourceNode}catch(q){}var c4;if(!v_)v_=function(q,_,j,K){if(this.src="",K)this.add(K)},v_.prototype={add:function q(_){if(n4.isArray(_))_=_.join("");this.src+=_},prepend:function q(_){if(n4.isArray(_))_=_.join("");this.src=_+this.src},toStringWithSourceMap:function q(){return{code:this.toString()}},toString:function q(){return this.src}};function x4(q,_,j){if(n4.isArray(q)){var K=[];for(var Y=0,f=q.length;Y<f;Y++)K.push(_.wrap(q[Y],j));return K}else if(typeof q==="boolean"||typeof q==="number")return q+"";return q}function v1(q){this.srcFile=q,this.source=[]}v1.prototype={isEmpty:function q(){return!this.source.length},prepend:function q(_,j){this.source.unshift(this.wrap(_,j))},push:function q(_,j){this.source.push(this.wrap(_,j))},merge:function q(){var _=this.empty();return this.each(function(j){_.add([" ",j,`
36
- `])}),_},each:function q(_){for(var j=0,K=this.source.length;j<K;j++)_(this.source[j])},empty:function q(){var _=this.currentLocation||{start:{}};return new v_(_.start.line,_.start.column,this.srcFile)},wrap:function q(_){var j=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];if(_ instanceof v_)return _;return _=x4(_,this,j),new v_(j.start.line,j.start.column,this.srcFile,_)},functionCall:function q(_,j,K){return K=this.generateList(K),this.wrap([_,j?"."+j+"(":"(",K,")"])},quotedString:function q(_){return'"'+(_+"").replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function q(_){var j=this,K=[];Object.keys(_).forEach(function(f){var P=x4(_[f],j);if(P!=="undefined")K.push([j.quotedString(f),":",P])});var Y=this.generateList(K);return Y.prepend("{"),Y.add("}"),Y},generateList:function q(_){var j=this.empty();for(var K=0,Y=_.length;K<Y;K++){if(K)j.add(",");j.add(x4(_[K],this))}return j},generateArray:function q(_){var j=this.generateList(_);return j.prepend("["),j.add("]"),j}};z1.default=v1;W1.exports=z1.default});var A1=q8((k1,X1)=>{k1.__esModule=!0;function Z1(q){return q&&q.__esModule?q:{default:q}}var H1=d3(),XH=t6(),r4=Z1(XH),AH=D6(),GH=J1(),T1=Z1(GH);function n_(q){this.value=q}function c_(){}c_.prototype={nameLookup:function q(_,j){return this.internalNameLookup(_,j)},depthedLookup:function q(_){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(_),")"]},compilerInfo:function q(){var _=H1.COMPILER_REVISION,j=H1.REVISION_CHANGES[_];return[_,j]},appendToBuffer:function q(_,j,K){if(!AH.isArray(_))_=[_];if(_=this.source.wrap(_,j),this.environment.isSimple)return["return ",_,";"];else if(K)return["buffer += ",_,";"];else return _.appendToBuffer=!0,_},initializeBuffer:function q(){return this.quotedString("")},internalNameLookup:function q(_,j){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",_,",",JSON.stringify(j),")"]},lookupPropertyFunctionIsUsed:!1,compile:function q(_,j,K,Y){this.environment=_,this.options=j,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!Y,this.name=this.environment.name,this.isChild=!!K,this.context=K||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(_,j),this.useDepths=this.useDepths||_.useDepths||_.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||_.useBlockParams;var f=_.opcodes,P=void 0,$=void 0,O=void 0,w=void 0;for(O=0,w=f.length;O<w;O++)P=f[O],this.source.currentLocation=P.loc,$=$||P.loc,this[P.opcode].apply(this,P.args);if(this.source.currentLocation=$,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new r4.default("Compile completed with content left on stack");if(!this.decorators.isEmpty())if(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
37
- `]),this.decorators.push("return fn;"),Y)this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]);else this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
33
+ Expecting `+y.join(", ")+", got '"+(this.terminals_[V]||V)+"'";else i="Parse error on line "+(z+1)+": Unexpected "+(V==1?"end of input":"'"+(this.terminals_[V]||V)+"'");this.parseError(i,{text:this.lexer.match,token:this.terminals_[V]||V,line:this.lexer.yylineno,loc:X,expected:y})}}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+S+", token: "+V);switch(b[0]){case 1:if(P.push(V),$.push(this.lexer.yytext),O.push(this.lexer.yylloc),P.push(b[1]),V=null,!m){if(W=this.lexer.yyleng,v=this.lexer.yytext,z=this.lexer.yylineno,X=this.lexer.yylloc,H>0)H--}else V=m,m=null;break;case 2:if(R=this.productions_[b[1]][1],r.$=$[$.length-R],r._$={first_line:O[O.length-(R||1)].first_line,last_line:O[O.length-1].last_line,first_column:O[O.length-(R||1)].first_column,last_column:O[O.length-1].last_column},A)r._$.range=[O[O.length-(R||1)].range[0],O[O.length-1].range[1]];if(p=this.performAction.call(r,v,W,z,this.yy,b[1],$,O),typeof p!=="undefined")return p;if(R)P=P.slice(0,-1*R*2),$=$.slice(0,-1*R),O=O.slice(0,-1*R);P.push(this.productions_[b[1]][0]),$.push(r.$),O.push(r._$),I=w[P[P.length-2]][P[P.length-1]],P.push(I);break;case 3:return!0}}return!0}},_=function(){var K={EOF:1,parseError:function f(Y,P){if(this.yy.parser)this.yy.parser.parseError(Y,P);else throw new Error(Y)},setInput:function f(Y){if(this._input=Y,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},input:function f(){var Y=this._input[0];this.yytext+=Y,this.yyleng++,this.offset++,this.match+=Y,this.matched+=Y;var P=Y.match(/(?:\r\n?|\n).*/g);if(P)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),Y},unput:function f(Y){var P=Y.length,$=Y.split(/(?:\r\n?|\n)/g);this._input=Y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P-1),this.offset-=P;var O=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),$.length-1)this.yylineno-=$.length-1;var w=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:$?($.length===O.length?this.yylloc.first_column:0)+O[O.length-$.length].length-$[0].length:this.yylloc.first_column-P},this.options.ranges)this.yylloc.range=[w[0],w[0]+this.yyleng-P];return this},more:function f(){return this._more=!0,this},less:function f(Y){this.unput(this.match.slice(Y))},pastInput:function f(){var Y=this.matched.substr(0,this.matched.length-this.match.length);return(Y.length>20?"...":"")+Y.substr(-20).replace(/\n/g,"")},upcomingInput:function f(){var Y=this.match;if(Y.length<20)Y+=this._input.substr(0,20-Y.length);return(Y.substr(0,20)+(Y.length>20?"...":"")).replace(/\n/g,"")},showPosition:function f(){var Y=this.pastInput(),P=new Array(Y.length+1).join("-");return Y+this.upcomingInput()+`
34
+ `+P+"^"},next:function f(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var Y,P,$,O,w,v;if(!this._more)this.yytext="",this.match="";var z=this._currentRules();for(var W=0;W<z.length;W++)if($=this._input.match(this.rules[z[W]]),$&&(!P||$[0].length>P[0].length)){if(P=$,O=W,!this.options.flex)break}if(P){if(v=P[0].match(/(?:\r\n?|\n).*/g),v)this.yylineno+=v.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:v?v[v.length-1].length-v[v.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+P[0].length},this.yytext+=P[0],this.match+=P[0],this.matches=P,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._input=this._input.slice(P[0].length),this.matched+=P[0],Y=this.performAction.call(this,this.yy,this,z[O],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(Y)return Y;else return}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
35
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function f(){var Y=this.next();if(typeof Y!=="undefined")return Y;else return this.lex()},begin:function f(Y){this.conditionStack.push(Y)},popState:function f(){return this.conditionStack.pop()},_currentRules:function f(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function f(){return this.conditionStack[this.conditionStack.length-2]},pushState:function f(Y){this.begin(Y)}};return K.options={},K.performAction=function f(Y,P,$,O){function w(z,W){return P.yytext=P.yytext.substring(z,P.yyleng-W+z)}var v=O;switch($){case 0:if(P.yytext.slice(-2)==="\\\\")w(0,1),this.begin("mu");else if(P.yytext.slice(-1)==="\\")w(0,1),this.begin("emu");else this.begin("mu");if(P.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:if(this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw")return 15;else return w(5,9),"END_RAW_BLOCK";break;case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(P.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return P.yytext=w(1,2).replace(/\\"/g,'"'),80;break;case 32:return P.yytext=w(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return P.yytext=P.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},K.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],K.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},K}();q.lexer=_;function j(){this.yy={}}return j.prototype=q,q.Parser=j,new j}();yj.default=WW;dj.exports=yj.default});var o3=q8((xj,nj)=>{xj.__esModule=!0;function TW(q){return q&&q.__esModule?q:{default:q}}var ZW=F6(),M4=TW(ZW);function r3(){this.parents=[]}r3.prototype={constructor:r3,mutating:!1,acceptKey:function q(_,j){var K=this.accept(_[j]);if(this.mutating){if(K&&!r3.prototype[K.type])throw new M4.default('Unexpected node type "'+K.type+'" found when accepting '+j+" on "+_.type);_[j]=K}},acceptRequired:function q(_,j){if(this.acceptKey(_,j),!_[j])throw new M4.default(_.type+" requires "+j)},acceptArray:function q(_){for(var j=0,K=_.length;j<K;j++)if(this.acceptKey(_,j),!_[j])_.splice(j,1),j--,K--},accept:function q(_){if(!_)return;if(!this[_.type])throw new M4.default("Unknown type: "+_.type,_);if(this.current)this.parents.unshift(this.current);this.current=_;var j=this[_.type](_);if(this.current=this.parents.shift(),!this.mutating||j)return j;else if(j!==!1)return _},Program:function q(_){this.acceptArray(_.body)},MustacheStatement:i3,Decorator:i3,BlockStatement:Lj,DecoratorBlock:Lj,PartialStatement:lj,PartialBlockStatement:function q(_){lj.call(this,_),this.acceptKey(_,"program")},ContentStatement:function q(){},CommentStatement:function q(){},SubExpression:i3,PathExpression:function q(){},StringLiteral:function q(){},NumberLiteral:function q(){},BooleanLiteral:function q(){},UndefinedLiteral:function q(){},NullLiteral:function q(){},Hash:function q(_){this.acceptArray(_.pairs)},HashPair:function q(_){this.acceptRequired(_,"value")}};function i3(q){this.acceptRequired(q,"path"),this.acceptArray(q.params),this.acceptKey(q,"hash")}function Lj(q){i3.call(this,q),this.acceptKey(q,"program"),this.acceptKey(q,"inverse")}function lj(q){this.acceptRequired(q,"name"),this.acceptArray(q.params),this.acceptKey(q,"hash")}xj.default=r3;nj.exports=xj.default});var ij=q8((cj,rj)=>{cj.__esModule=!0;function AW(q){return q&&q.__esModule?q:{default:q}}var GW=o3(),uW=AW(GW);function uq(){var q=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=q}uq.prototype=new uW.default;uq.prototype.Program=function(q){var _=!this.options.ignoreStandalone,j=!this.isRootSeen;this.isRootSeen=!0;var K=q.body;for(var f=0,Y=K.length;f<Y;f++){var P=K[f],$=this.accept(P);if(!$)continue;var O=N4(K,f,j),w=b4(K,f,j),v=$.openStandalone&&O,z=$.closeStandalone&&w,W=$.inlineStandalone&&O&&w;if($.close)O_(K,f,!0);if($.open)aq(K,f,!0);if(_&&W){if(O_(K,f),aq(K,f)){if(P.type==="PartialStatement")P.indent=/([ \t]+$)/.exec(K[f-1].original)[1]}}if(_&&v)O_((P.program||P.inverse).body),aq(K,f);if(_&&z)O_(K,f),aq((P.inverse||P.program).body)}return q};uq.prototype.BlockStatement=uq.prototype.DecoratorBlock=uq.prototype.PartialBlockStatement=function(q){this.accept(q.program),this.accept(q.inverse);var _=q.program||q.inverse,j=q.program&&q.inverse,K=j,f=j;if(j&&j.chained){K=j.body[0].program;while(f.chained)f=f.body[f.body.length-1].program}var Y={open:q.openStrip.open,close:q.closeStrip.close,openStandalone:b4(_.body),closeStandalone:N4((K||_).body)};if(q.openStrip.close)O_(_.body,null,!0);if(j){var P=q.inverseStrip;if(P.open)aq(_.body,null,!0);if(P.close)O_(K.body,null,!0);if(q.closeStrip.open)aq(f.body,null,!0);if(!this.options.ignoreStandalone&&N4(_.body)&&b4(K.body))aq(_.body),O_(K.body)}else if(q.closeStrip.open)aq(_.body,null,!0);return Y};uq.prototype.Decorator=uq.prototype.MustacheStatement=function(q){return q.strip};uq.prototype.PartialStatement=uq.prototype.CommentStatement=function(q){var _=q.strip||{};return{inlineStandalone:!0,open:_.open,close:_.close}};function N4(q,_,j){if(_===void 0)_=q.length;var K=q[_-1],f=q[_-2];if(!K)return j;if(K.type==="ContentStatement")return(f||!j?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(K.original)}function b4(q,_,j){if(_===void 0)_=-1;var K=q[_+1],f=q[_+2];if(!K)return j;if(K.type==="ContentStatement")return(f||!j?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(K.original)}function O_(q,_,j){var K=q[_==null?0:_+1];if(!K||K.type!=="ContentStatement"||!j&&K.rightStripped)return;var f=K.value;K.value=K.value.replace(j?/^\s+/:/^[ \t]*\r?\n?/,""),K.rightStripped=K.value!==f}function aq(q,_,j){var K=q[_==null?q.length-1:_-1];if(!K||K.type!=="ContentStatement"||!j&&K.leftStripped)return;var f=K.value;return K.value=K.value.replace(j?/\s+$/:/[ \t]+$/,""),K.leftStripped=K.value!==f,K.leftStripped}cj.default=uq;rj.exports=cj.default});var oj=q8((dW)=>{dW.__esModule=!0;dW.SourceLocation=MW;dW.id=NW;dW.stripFlags=bW;dW.stripComment=SW;dW.preparePath=EW;dW.prepareMustache=RW;dW.prepareRawBlock=mW;dW.prepareBlock=IW;dW.prepareProgram=gW;dW.preparePartialBlock=yW;function CW(q){return q&&q.__esModule?q:{default:q}}var VW=F6(),S4=CW(VW);function E4(q,_){if(_=_.path?_.path.original:_,q.path.original!==_){var j={loc:q.path.loc};throw new S4.default(q.path.original+" doesn't match "+_,j)}}function MW(q,_){this.source=q,this.start={line:_.first_line,column:_.first_column},this.end={line:_.last_line,column:_.last_column}}function NW(q){if(/^\[.*\]$/.test(q))return q.substring(1,q.length-1);else return q}function bW(q,_){return{open:q.charAt(2)==="~",close:_.charAt(_.length-3)==="~"}}function SW(q){return q.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function EW(q,_,j){j=this.locInfo(j);var K=q?"@":"",f=[],Y=0;for(var P=0,$=_.length;P<$;P++){var O=_[P].part,w=_[P].original!==O;if(K+=(_[P].separator||"")+O,!w&&(O===".."||O==="."||O==="this")){if(f.length>0)throw new S4.default("Invalid path: "+K,{loc:j});else if(O==="..")Y++}else f.push(O)}return{type:"PathExpression",data:q,depth:Y,parts:f,original:K,loc:j}}function RW(q,_,j,K,f,Y){var P=K.charAt(3)||K.charAt(2),$=P!=="{"&&P!=="&",O=/\*/.test(K);return{type:O?"Decorator":"MustacheStatement",path:q,params:_,hash:j,escaped:$,strip:f,loc:this.locInfo(Y)}}function mW(q,_,j,K){E4(q,j),K=this.locInfo(K);var f={type:"Program",body:_,strip:{},loc:K};return{type:"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:K}}function IW(q,_,j,K,f,Y){if(K&&K.path)E4(q,K);var P=/\*/.test(q.open);_.blockParams=q.blockParams;var $=void 0,O=void 0;if(j){if(P)throw new S4.default("Unexpected inverse block on decorator",j);if(j.chain)j.program.body[0].closeStrip=K.strip;O=j.strip,$=j.program}if(f)f=$,$=_,_=f;return{type:P?"DecoratorBlock":"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:_,inverse:$,openStrip:q.strip,inverseStrip:O,closeStrip:K&&K.strip,loc:this.locInfo(Y)}}function gW(q,_){if(!_&&q.length){var j=q[0].loc,K=q[q.length-1].loc;if(j&&K)_={source:j.source,start:{line:j.start.line,column:j.start.column},end:{line:K.end.line,column:K.end.column}}}return{type:"Program",body:q,strip:{},loc:_}}function yW(q,_,j,K){return E4(q,j),{type:"PartialBlockStatement",name:q.path,params:q.params,hash:q.hash,program:_,openStrip:q.strip,closeStrip:j&&j.strip,loc:this.locInfo(K)}}});var tj=q8((KJ)=>{KJ.__esModule=!0;KJ.parseWithoutProcessing=Bj;KJ.parse=_J;function tW(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}function aj(q){return q&&q.__esModule?q:{default:q}}var eW=pj(),R4=aj(eW),FW=ij(),UW=aj(FW),sW=oj(),QW=tW(sW),qJ=C6();KJ.parser=R4.default;var a3={};qJ.extend(a3,QW);function Bj(q,_){if(q.type==="Program")return q;R4.default.yy=a3,a3.locInfo=function(K){return new a3.SourceLocation(_&&_.srcName,K)};var j=R4.default.parse(q);return j}function _J(q,_){var j=Bj(q,_),K=new UW.default(_);return K.accept(j)}});var sj=q8((WJ)=>{WJ.__esModule=!0;WJ.Compiler=m4;WJ.precompile=vJ;WJ.compile=zJ;function Fj(q){return q&&q.__esModule?q:{default:q}}var $J=F6(),lK=Fj($J),xK=C6(),wJ=V4(),LK=Fj(wJ),OJ=[].slice;function m4(){}m4.prototype={compiler:m4,equals:function q(_){var j=this.opcodes.length;if(_.opcodes.length!==j)return!1;for(var K=0;K<j;K++){var f=this.opcodes[K],Y=_.opcodes[K];if(f.opcode!==Y.opcode||!Uj(f.args,Y.args))return!1}j=this.children.length;for(var K=0;K<j;K++)if(!this.children[K].equals(_.children[K]))return!1;return!0},guid:0,compile:function q(_,j){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=j,this.stringParams=j.stringParams,this.trackIds=j.trackIds,j.blockParams=j.blockParams||[],j.knownHelpers=xK.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},j.knownHelpers),this.accept(_)},compileProgram:function q(_){var j=new this.compiler,K=j.compile(_,this.options),f=this.guid++;return this.usePartial=this.usePartial||K.usePartial,this.children[f]=K,this.useDepths=this.useDepths||K.useDepths,f},accept:function q(_){if(!this[_.type])throw new lK.default("Unknown type: "+_.type,_);this.sourceNode.unshift(_);var j=this[_.type](_);return this.sourceNode.shift(),j},Program:function q(_){this.options.blockParams.unshift(_.blockParams);var j=_.body,K=j.length;for(var f=0;f<K;f++)this.accept(j[f]);return this.options.blockParams.shift(),this.isSimple=K===1,this.blockParams=_.blockParams?_.blockParams.length:0,this},BlockStatement:function q(_){ej(_);var{program:j,inverse:K}=_;j=j&&this.compileProgram(j),K=K&&this.compileProgram(K);var f=this.classifySexpr(_);if(f==="helper")this.helperSexpr(_,j,K);else if(f==="simple")this.simpleSexpr(_),this.opcode("pushProgram",j),this.opcode("pushProgram",K),this.opcode("emptyHash"),this.opcode("blockValue",_.path.original);else this.ambiguousSexpr(_,j,K),this.opcode("pushProgram",j),this.opcode("pushProgram",K),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue");this.opcode("append")},DecoratorBlock:function q(_){var j=_.program&&this.compileProgram(_.program),K=this.setupFullMustacheParams(_,j,void 0),f=_.path;this.useDecorators=!0,this.opcode("registerDecorator",K.length,f.original)},PartialStatement:function q(_){this.usePartial=!0;var j=_.program;if(j)j=this.compileProgram(_.program);var K=_.params;if(K.length>1)throw new lK.default("Unsupported number of partial arguments: "+K.length,_);else if(!K.length)if(this.options.explicitPartialContext)this.opcode("pushLiteral","undefined");else K.push({type:"PathExpression",parts:[],depth:0});var f=_.name.original,Y=_.name.type==="SubExpression";if(Y)this.accept(_.name);this.setupFullMustacheParams(_,j,void 0,!0);var P=_.indent||"";if(this.options.preventIndent&&P)this.opcode("appendContent",P),P="";this.opcode("invokePartial",Y,f,P),this.opcode("append")},PartialBlockStatement:function q(_){this.PartialStatement(_)},MustacheStatement:function q(_){if(this.SubExpression(_),_.escaped&&!this.options.noEscape)this.opcode("appendEscaped");else this.opcode("append")},Decorator:function q(_){this.DecoratorBlock(_)},ContentStatement:function q(_){if(_.value)this.opcode("appendContent",_.value)},CommentStatement:function q(){},SubExpression:function q(_){ej(_);var j=this.classifySexpr(_);if(j==="simple")this.simpleSexpr(_);else if(j==="helper")this.helperSexpr(_);else this.ambiguousSexpr(_)},ambiguousSexpr:function q(_,j,K){var f=_.path,Y=f.parts[0],P=j!=null||K!=null;this.opcode("getContext",f.depth),this.opcode("pushProgram",j),this.opcode("pushProgram",K),f.strict=!0,this.accept(f),this.opcode("invokeAmbiguous",Y,P)},simpleSexpr:function q(_){var j=_.path;j.strict=!0,this.accept(j),this.opcode("resolvePossibleLambda")},helperSexpr:function q(_,j,K){var f=this.setupFullMustacheParams(_,j,K),Y=_.path,P=Y.parts[0];if(this.options.knownHelpers[P])this.opcode("invokeKnownHelper",f.length,P);else if(this.options.knownHelpersOnly)throw new lK.default("You specified knownHelpersOnly, but used the unknown helper "+P,_);else Y.strict=!0,Y.falsy=!0,this.accept(Y),this.opcode("invokeHelper",f.length,Y.original,LK.default.helpers.simpleId(Y))},PathExpression:function q(_){this.addDepth(_.depth),this.opcode("getContext",_.depth);var j=_.parts[0],K=LK.default.helpers.scopedId(_),f=!_.depth&&!K&&this.blockParamIndex(j);if(f)this.opcode("lookupBlockParam",f,_.parts);else if(!j)this.opcode("pushContext");else if(_.data)this.options.data=!0,this.opcode("lookupData",_.depth,_.parts,_.strict);else this.opcode("lookupOnContext",_.parts,_.falsy,_.strict,K)},StringLiteral:function q(_){this.opcode("pushString",_.value)},NumberLiteral:function q(_){this.opcode("pushLiteral",_.value)},BooleanLiteral:function q(_){this.opcode("pushLiteral",_.value)},UndefinedLiteral:function q(){this.opcode("pushLiteral","undefined")},NullLiteral:function q(){this.opcode("pushLiteral","null")},Hash:function q(_){var j=_.pairs,K=0,f=j.length;this.opcode("pushHash");for(;K<f;K++)this.pushParam(j[K].value);while(K--)this.opcode("assignToHash",j[K].key);this.opcode("popHash")},opcode:function q(_){this.opcodes.push({opcode:_,args:OJ.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function q(_){if(!_)return;this.useDepths=!0},classifySexpr:function q(_){var j=LK.default.helpers.simpleId(_.path),K=j&&!!this.blockParamIndex(_.path.parts[0]),f=!K&&LK.default.helpers.helperExpression(_),Y=!K&&(f||j);if(Y&&!f){var P=_.path.parts[0],$=this.options;if($.knownHelpers[P])f=!0;else if($.knownHelpersOnly)Y=!1}if(f)return"helper";else if(Y)return"ambiguous";else return"simple"},pushParams:function q(_){for(var j=0,K=_.length;j<K;j++)this.pushParam(_[j])},pushParam:function q(_){var j=_.value!=null?_.value:_.original||"";if(this.stringParams){if(j.replace)j=j.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".");if(_.depth)this.addDepth(_.depth);if(this.opcode("getContext",_.depth||0),this.opcode("pushStringParam",j,_.type),_.type==="SubExpression")this.accept(_)}else{if(this.trackIds){var K=void 0;if(_.parts&&!LK.default.helpers.scopedId(_)&&!_.depth)K=this.blockParamIndex(_.parts[0]);if(K){var f=_.parts.slice(1).join(".");this.opcode("pushId","BlockParam",K,f)}else{if(j=_.original||j,j.replace)j=j.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"");this.opcode("pushId",_.type,j)}}this.accept(_)}},setupFullMustacheParams:function q(_,j,K,f){var Y=_.params;if(this.pushParams(Y),this.opcode("pushProgram",j),this.opcode("pushProgram",K),_.hash)this.accept(_.hash);else this.opcode("emptyHash",f);return Y},blockParamIndex:function q(_){for(var j=0,K=this.options.blockParams.length;j<K;j++){var f=this.options.blockParams[j],Y=f&&xK.indexOf(f,_);if(f&&Y>=0)return[j,Y]}}};function vJ(q,_,j){if(q==null||typeof q!=="string"&&q.type!=="Program")throw new lK.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+q);if(_=_||{},!("data"in _))_.data=!0;if(_.compat)_.useDepths=!0;var K=j.parse(q,_),f=new j.Compiler().compile(K,_);return new j.JavaScriptCompiler().compile(f,_)}function zJ(q,_,j){if(_===void 0)_={};if(q==null||typeof q!=="string"&&q.type!=="Program")throw new lK.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+q);if(_=xK.extend({},_),!("data"in _))_.data=!0;if(_.compat)_.useDepths=!0;var K=void 0;function f(){var P=j.parse(q,_),$=new j.Compiler().compile(P,_),O=new j.JavaScriptCompiler().compile($,_,void 0,!0);return j.template(O)}function Y(P,$){if(!K)K=f();return K.call(this,P,$)}return Y._setup=function(P){if(!K)K=f();return K._setup(P)},Y._child=function(P,$,O,w){if(!K)K=f();return K._child(P,$,O,w)},Y}function Uj(q,_){if(q===_)return!0;if(xK.isArray(q)&&xK.isArray(_)&&q.length===_.length){for(var j=0;j<q.length;j++)if(!Uj(q[j],_[j]))return!1;return!0}}function ej(q){if(!q.path.parts){var _=q.path;q.path={type:"PathExpression",data:!1,depth:0,parts:[_.original+""],original:_.original+"",loc:_.loc}}}});var q1=q8((kJ)=>{var Qj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");kJ.encode=function(q){if(0<=q&&q<Qj.length)return Qj[q];throw new TypeError("Must be between 0 and 63: "+q)};kJ.decode=function(q){var _=65,j=90,K=97,f=122,Y=48,P=57,$=43,O=47,w=26,v=52;if(_<=q&&q<=j)return q-_;if(K<=q&&q<=f)return q-K+w;if(Y<=q&&q<=P)return q-Y+v;if(q==$)return 62;if(q==O)return 63;return-1}});var g4=q8((hJ)=>{var _1=q1(),I4=5,K1=1<<I4,j1=K1-1,P1=K1;function GJ(q){return q<0?(-q<<1)+1:(q<<1)+0}function uJ(q){var _=(q&1)===1,j=q>>1;return _?-j:j}hJ.encode=function q(_){var j="",K,f=GJ(_);do{if(K=f&j1,f>>>=I4,f>0)K|=P1;j+=_1.encode(K)}while(f>0);return j};hJ.decode=function q(_,j,K){var f=_.length,Y=0,P=0,$,O;do{if(j>=f)throw new Error("Expected more digits in base 64 VLQ value.");if(O=_1.decode(_.charCodeAt(j++)),O===-1)throw new Error("Invalid base64 digit: "+_.charAt(j-1));$=!!(O&P1),O&=j1,Y=Y+(O<<P),P+=I4}while($);K.value=uJ(Y),K.rest=j}});var n_=q8((yJ)=>{function VJ(q,_,j){if(_ in q)return q[_];else if(arguments.length===3)return j;else throw new Error('"'+_+'" is a required argument.')}yJ.getArg=VJ;var f1=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,MJ=/^data:.+\,.+$/;function nK(q){var _=q.match(f1);if(!_)return null;return{scheme:_[1],auth:_[2],host:_[3],port:_[4],path:_[5]}}yJ.urlParse=nK;function l_(q){var _="";if(q.scheme)_+=q.scheme+":";if(_+="//",q.auth)_+=q.auth+"@";if(q.host)_+=q.host;if(q.port)_+=":"+q.port;if(q.path)_+=q.path;return _}yJ.urlGenerate=l_;function y4(q){var _=q,j=nK(q);if(j){if(!j.path)return q;_=j.path}var K=yJ.isAbsolute(_),f=_.split(/\/+/);for(var Y,P=0,$=f.length-1;$>=0;$--)if(Y=f[$],Y===".")f.splice($,1);else if(Y==="..")P++;else if(P>0)if(Y==="")f.splice($+1,P),P=0;else f.splice($,2),P--;if(_=f.join("/"),_==="")_=K?"/":".";if(j)return j.path=_,l_(j);return _}yJ.normalize=y4;function Y1(q,_){if(q==="")q=".";if(_==="")_=".";var j=nK(_),K=nK(q);if(K)q=K.path||"/";if(j&&!j.scheme){if(K)j.scheme=K.scheme;return l_(j)}if(j||_.match(MJ))return _;if(K&&!K.host&&!K.path)return K.host=_,l_(K);var f=_.charAt(0)==="/"?_:y4(q.replace(/\/+$/,"")+"/"+_);if(K)return K.path=f,l_(K);return f}yJ.join=Y1;yJ.isAbsolute=function(q){return q.charAt(0)==="/"||f1.test(q)};function NJ(q,_){if(q==="")q=".";q=q.replace(/\/$/,"");var j=0;while(_.indexOf(q+"/")!==0){var K=q.lastIndexOf("/");if(K<0)return _;if(q=q.slice(0,K),q.match(/^([^\/]+:\/)?\/*$/))return _;++j}return Array(j+1).join("../")+_.substr(q.length+1)}yJ.relative=NJ;var $1=function(){var q=Object.create(null);return!("__proto__"in q)}();function w1(q){return q}function bJ(q){if(O1(q))return"$"+q;return q}yJ.toSetString=$1?w1:bJ;function SJ(q){if(O1(q))return q.slice(1);return q}yJ.fromSetString=$1?w1:SJ;function O1(q){if(!q)return!1;var _=q.length;if(_<9)return!1;if(q.charCodeAt(_-1)!==95||q.charCodeAt(_-2)!==95||q.charCodeAt(_-3)!==111||q.charCodeAt(_-4)!==116||q.charCodeAt(_-5)!==111||q.charCodeAt(_-6)!==114||q.charCodeAt(_-7)!==112||q.charCodeAt(_-8)!==95||q.charCodeAt(_-9)!==95)return!1;for(var j=_-10;j>=0;j--)if(q.charCodeAt(j)!==36)return!1;return!0}function EJ(q,_,j){var K=x_(q.source,_.source);if(K!==0)return K;if(K=q.originalLine-_.originalLine,K!==0)return K;if(K=q.originalColumn-_.originalColumn,K!==0||j)return K;if(K=q.generatedColumn-_.generatedColumn,K!==0)return K;if(K=q.generatedLine-_.generatedLine,K!==0)return K;return x_(q.name,_.name)}yJ.compareByOriginalPositions=EJ;function RJ(q,_,j){var K=q.generatedLine-_.generatedLine;if(K!==0)return K;if(K=q.generatedColumn-_.generatedColumn,K!==0||j)return K;if(K=x_(q.source,_.source),K!==0)return K;if(K=q.originalLine-_.originalLine,K!==0)return K;if(K=q.originalColumn-_.originalColumn,K!==0)return K;return x_(q.name,_.name)}yJ.compareByGeneratedPositionsDeflated=RJ;function x_(q,_){if(q===_)return 0;if(q===null)return 1;if(_===null)return-1;if(q>_)return 1;return-1}function mJ(q,_){var j=q.generatedLine-_.generatedLine;if(j!==0)return j;if(j=q.generatedColumn-_.generatedColumn,j!==0)return j;if(j=x_(q.source,_.source),j!==0)return j;if(j=q.originalLine-_.originalLine,j!==0)return j;if(j=q.originalColumn-_.originalColumn,j!==0)return j;return x_(q.name,_.name)}yJ.compareByGeneratedPositionsInflated=mJ;function IJ(q){return JSON.parse(q.replace(/^\)]}'[^\n]*\n/,""))}yJ.parseSourceMapInput=IJ;function gJ(q,_,j){if(_=_||"",q){if(q[q.length-1]!=="/"&&_[0]!=="/")q+="/";_=q+_}if(j){var K=nK(j);if(!K)throw new Error("sourceMapURL could not be parsed");if(K.path){var f=K.path.lastIndexOf("/");if(f>=0)K.path=K.path.substring(0,f+1)}_=Y1(l_(K),_)}return y4(_)}yJ.computeSourceURL=gJ});var L4=q8((FJ)=>{var d4=n_(),p4=Object.prototype.hasOwnProperty,v_=typeof Map!=="undefined";function dq(){this._array=[],this._set=v_?new Map:Object.create(null)}dq.fromArray=function q(_,j){var K=new dq;for(var f=0,Y=_.length;f<Y;f++)K.add(_[f],j);return K};dq.prototype.size=function q(){return v_?this._set.size:Object.getOwnPropertyNames(this._set).length};dq.prototype.add=function q(_,j){var K=v_?_:d4.toSetString(_),f=v_?this.has(_):p4.call(this._set,K),Y=this._array.length;if(!f||j)this._array.push(_);if(!f)if(v_)this._set.set(_,Y);else this._set[K]=Y};dq.prototype.has=function q(_){if(v_)return this._set.has(_);else{var j=d4.toSetString(_);return p4.call(this._set,j)}};dq.prototype.indexOf=function q(_){if(v_){var j=this._set.get(_);if(j>=0)return j}else{var K=d4.toSetString(_);if(p4.call(this._set,K))return this._set[K]}throw new Error('"'+_+'" is not in the set.')};dq.prototype.at=function q(_){if(_>=0&&_<this._array.length)return this._array[_];throw new Error("No element indexed by "+_)};dq.prototype.toArray=function q(){return this._array.slice()};FJ.ArraySet=dq});var z1=q8((QJ)=>{var v1=n_();function sJ(q,_){var j=q.generatedLine,K=_.generatedLine,f=q.generatedColumn,Y=_.generatedColumn;return K>j||K==j&&Y>=f||v1.compareByGeneratedPositionsInflated(q,_)<=0}function B3(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}B3.prototype.unsortedForEach=function q(_,j){this._array.forEach(_,j)};B3.prototype.add=function q(_){if(sJ(this._last,_))this._last=_,this._array.push(_);else this._sorted=!1,this._array.push(_)};B3.prototype.toArray=function q(){if(!this._sorted)this._array.sort(v1.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};QJ.MappingList=B3});var l4=q8((KH)=>{var cK=g4(),q6=n_(),t3=L4().ArraySet,_H=z1().MappingList;function U6(q){if(!q)q={};this._file=q6.getArg(q,"file",null),this._sourceRoot=q6.getArg(q,"sourceRoot",null),this._skipValidation=q6.getArg(q,"skipValidation",!1),this._sources=new t3,this._names=new t3,this._mappings=new _H,this._sourcesContents=null}U6.prototype._version=3;U6.fromSourceMap=function q(_){var j=_.sourceRoot,K=new U6({file:_.file,sourceRoot:j});return _.eachMapping(function(f){var Y={generated:{line:f.generatedLine,column:f.generatedColumn}};if(f.source!=null){if(Y.source=f.source,j!=null)Y.source=q6.relative(j,Y.source);if(Y.original={line:f.originalLine,column:f.originalColumn},f.name!=null)Y.name=f.name}K.addMapping(Y)}),_.sources.forEach(function(f){var Y=f;if(j!==null)Y=q6.relative(j,f);if(!K._sources.has(Y))K._sources.add(Y);var P=_.sourceContentFor(f);if(P!=null)K.setSourceContent(f,P)}),K};U6.prototype.addMapping=function q(_){var j=q6.getArg(_,"generated"),K=q6.getArg(_,"original",null),f=q6.getArg(_,"source",null),Y=q6.getArg(_,"name",null);if(!this._skipValidation)this._validateMapping(j,K,f,Y);if(f!=null){if(f=String(f),!this._sources.has(f))this._sources.add(f)}if(Y!=null){if(Y=String(Y),!this._names.has(Y))this._names.add(Y)}this._mappings.add({generatedLine:j.line,generatedColumn:j.column,originalLine:K!=null&&K.line,originalColumn:K!=null&&K.column,source:f,name:Y})};U6.prototype.setSourceContent=function q(_,j){var K=_;if(this._sourceRoot!=null)K=q6.relative(this._sourceRoot,K);if(j!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[q6.toSetString(K)]=j}else if(this._sourcesContents){if(delete this._sourcesContents[q6.toSetString(K)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};U6.prototype.applySourceMap=function q(_,j,K){var f=j;if(j==null){if(_.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);f=_.file}var Y=this._sourceRoot;if(Y!=null)f=q6.relative(Y,f);var P=new t3,$=new t3;this._mappings.unsortedForEach(function(O){if(O.source===f&&O.originalLine!=null){var w=_.originalPositionFor({line:O.originalLine,column:O.originalColumn});if(w.source!=null){if(O.source=w.source,K!=null)O.source=q6.join(K,O.source);if(Y!=null)O.source=q6.relative(Y,O.source);if(O.originalLine=w.line,O.originalColumn=w.column,w.name!=null)O.name=w.name}}var v=O.source;if(v!=null&&!P.has(v))P.add(v);var z=O.name;if(z!=null&&!$.has(z))$.add(z)},this),this._sources=P,this._names=$,_.sources.forEach(function(O){var w=_.sourceContentFor(O);if(w!=null){if(K!=null)O=q6.join(K,O);if(Y!=null)O=q6.relative(Y,O);this.setSourceContent(O,w)}},this)};U6.prototype._validateMapping=function q(_,j,K,f){if(j&&typeof j.line!=="number"&&typeof j.column!=="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(_&&"line"in _&&"column"in _&&_.line>0&&_.column>=0&&!j&&!K&&!f)return;else if(_&&"line"in _&&"column"in _&&j&&"line"in j&&"column"in j&&_.line>0&&_.column>=0&&j.line>0&&j.column>=0&&K)return;else throw new Error("Invalid mapping: "+JSON.stringify({generated:_,source:K,original:j,name:f}))};U6.prototype._serializeMappings=function q(){var _=0,j=1,K=0,f=0,Y=0,P=0,$="",O,w,v,z,W=this._mappings.toArray();for(var H=0,Z=W.length;H<Z;H++){if(w=W[H],O="",w.generatedLine!==j){_=0;while(w.generatedLine!==j)O+=";",j++}else if(H>0){if(!q6.compareByGeneratedPositionsInflated(w,W[H-1]))continue;O+=","}if(O+=cK.encode(w.generatedColumn-_),_=w.generatedColumn,w.source!=null){if(z=this._sources.indexOf(w.source),O+=cK.encode(z-P),P=z,O+=cK.encode(w.originalLine-1-f),f=w.originalLine-1,O+=cK.encode(w.originalColumn-K),K=w.originalColumn,w.name!=null)v=this._names.indexOf(w.name),O+=cK.encode(v-Y),Y=v}$+=O}return $};U6.prototype._generateSourcesContent=function q(_,j){return _.map(function(K){if(!this._sourcesContents)return null;if(j!=null)K=q6.relative(j,K);var f=q6.toSetString(K);return Object.prototype.hasOwnProperty.call(this._sourcesContents,f)?this._sourcesContents[f]:null},this)};U6.prototype.toJSON=function q(){var _={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)_.file=this._file;if(this._sourceRoot!=null)_.sourceRoot=this._sourceRoot;if(this._sourcesContents)_.sourcesContent=this._generateSourcesContent(_.sources,_.sourceRoot);return _};U6.prototype.toString=function q(){return JSON.stringify(this.toJSON())};KH.SourceMapGenerator=U6});var J1=q8((PH)=>{PH.GREATEST_LOWER_BOUND=1;PH.LEAST_UPPER_BOUND=2;function x4(q,_,j,K,f,Y){var P=Math.floor((_-q)/2)+q,$=f(j,K[P],!0);if($===0)return P;else if($>0){if(_-P>1)return x4(P,_,j,K,f,Y);if(Y==PH.LEAST_UPPER_BOUND)return _<K.length?_:-1;else return P}else{if(P-q>1)return x4(q,P,j,K,f,Y);if(Y==PH.LEAST_UPPER_BOUND)return P;else return q<0?-1:q}}PH.search=function q(_,j,K,f){if(j.length===0)return-1;var Y=x4(-1,j.length,_,j,K,f||PH.GREATEST_LOWER_BOUND);if(Y<0)return-1;while(Y-1>=0){if(K(j[Y],j[Y-1],!0)!==0)break;--Y}return Y}});var H1=q8(($H)=>{function c4(q,_,j){var K=q[_];q[_]=q[j],q[j]=K}function YH(q,_){return Math.round(q+Math.random()*(_-q))}function r4(q,_,j,K){if(j<K){var f=YH(j,K),Y=j-1;c4(q,f,K);var P=q[K];for(var $=j;$<K;$++)if(_(q[$],P)<=0)Y+=1,c4(q,Y,$);c4(q,Y+1,$);var O=Y+1;r4(q,_,j,O-1),r4(q,_,O+1,K)}}$H.quickSort=function(q,_){r4(q,_,0,q.length-1)}});var Z1=q8((vH)=>{var _8=n_(),i4=J1(),c_=L4().ArraySet,OH=g4(),rK=H1().quickSort;function I8(q,_){var j=q;if(typeof q==="string")j=_8.parseSourceMapInput(q);return j.sections!=null?new wq(j,_):new J6(j,_)}I8.fromSourceMap=function(q,_){return J6.fromSourceMap(q,_)};I8.prototype._version=3;I8.prototype.__generatedMappings=null;Object.defineProperty(I8.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__generatedMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__generatedMappings}});I8.prototype.__originalMappings=null;Object.defineProperty(I8.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__originalMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__originalMappings}});I8.prototype._charIsMappingSeparator=function q(_,j){var K=_.charAt(j);return K===";"||K===","};I8.prototype._parseMappings=function q(_,j){throw new Error("Subclasses must implement _parseMappings")};I8.GENERATED_ORDER=1;I8.ORIGINAL_ORDER=2;I8.GREATEST_LOWER_BOUND=1;I8.LEAST_UPPER_BOUND=2;I8.prototype.eachMapping=function q(_,j,K){var f=j||null,Y=K||I8.GENERATED_ORDER,P;switch(Y){case I8.GENERATED_ORDER:P=this._generatedMappings;break;case I8.ORIGINAL_ORDER:P=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var $=this.sourceRoot;P.map(function(O){var w=O.source===null?null:this._sources.at(O.source);return w=_8.computeSourceURL($,w,this._sourceMapURL),{source:w,generatedLine:O.generatedLine,generatedColumn:O.generatedColumn,originalLine:O.originalLine,originalColumn:O.originalColumn,name:O.name===null?null:this._names.at(O.name)}},this).forEach(_,f)};I8.prototype.allGeneratedPositionsFor=function q(_){var j=_8.getArg(_,"line"),K={source:_8.getArg(_,"source"),originalLine:j,originalColumn:_8.getArg(_,"column",0)};if(K.source=this._findSourceIndex(K.source),K.source<0)return[];var f=[],Y=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",_8.compareByOriginalPositions,i4.LEAST_UPPER_BOUND);if(Y>=0){var P=this._originalMappings[Y];if(_.column===void 0){var $=P.originalLine;while(P&&P.originalLine===$)f.push({line:_8.getArg(P,"generatedLine",null),column:_8.getArg(P,"generatedColumn",null),lastColumn:_8.getArg(P,"lastGeneratedColumn",null)}),P=this._originalMappings[++Y]}else{var O=P.originalColumn;while(P&&P.originalLine===j&&P.originalColumn==O)f.push({line:_8.getArg(P,"generatedLine",null),column:_8.getArg(P,"generatedColumn",null),lastColumn:_8.getArg(P,"lastGeneratedColumn",null)}),P=this._originalMappings[++Y]}}return f};vH.SourceMapConsumer=I8;function J6(q,_){var j=q;if(typeof q==="string")j=_8.parseSourceMapInput(q);var K=_8.getArg(j,"version"),f=_8.getArg(j,"sources"),Y=_8.getArg(j,"names",[]),P=_8.getArg(j,"sourceRoot",null),$=_8.getArg(j,"sourcesContent",null),O=_8.getArg(j,"mappings"),w=_8.getArg(j,"file",null);if(K!=this._version)throw new Error("Unsupported version: "+K);if(P)P=_8.normalize(P);f=f.map(String).map(_8.normalize).map(function(v){return P&&_8.isAbsolute(P)&&_8.isAbsolute(v)?_8.relative(P,v):v}),this._names=c_.fromArray(Y.map(String),!0),this._sources=c_.fromArray(f,!0),this._absoluteSources=this._sources.toArray().map(function(v){return _8.computeSourceURL(P,v,_)}),this.sourceRoot=P,this.sourcesContent=$,this._mappings=O,this._sourceMapURL=_,this.file=w}J6.prototype=Object.create(I8.prototype);J6.prototype.consumer=I8;J6.prototype._findSourceIndex=function(q){var _=q;if(this.sourceRoot!=null)_=_8.relative(this.sourceRoot,_);if(this._sources.has(_))return this._sources.indexOf(_);var j;for(j=0;j<this._absoluteSources.length;++j)if(this._absoluteSources[j]==q)return j;return-1};J6.fromSourceMap=function q(_,j){var K=Object.create(J6.prototype),f=K._names=c_.fromArray(_._names.toArray(),!0),Y=K._sources=c_.fromArray(_._sources.toArray(),!0);K.sourceRoot=_._sourceRoot,K.sourcesContent=_._generateSourcesContent(K._sources.toArray(),K.sourceRoot),K.file=_._file,K._sourceMapURL=j,K._absoluteSources=K._sources.toArray().map(function(H){return _8.computeSourceURL(K.sourceRoot,H,j)});var P=_._mappings.toArray().slice(),$=K.__generatedMappings=[],O=K.__originalMappings=[];for(var w=0,v=P.length;w<v;w++){var z=P[w],W=new T1;if(W.generatedLine=z.generatedLine,W.generatedColumn=z.generatedColumn,z.source){if(W.source=Y.indexOf(z.source),W.originalLine=z.originalLine,W.originalColumn=z.originalColumn,z.name)W.name=f.indexOf(z.name);O.push(W)}$.push(W)}return rK(K.__originalMappings,_8.compareByOriginalPositions),K};J6.prototype._version=3;Object.defineProperty(J6.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function T1(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}J6.prototype._parseMappings=function q(_,j){var K=1,f=0,Y=0,P=0,$=0,O=0,w=_.length,v=0,z={},W={},H=[],Z=[],J,X,A,G,D;while(v<w)if(_.charAt(v)===";")K++,v++,f=0;else if(_.charAt(v)===",")v++;else{J=new T1,J.generatedLine=K;for(G=v;G<w;G++)if(this._charIsMappingSeparator(_,G))break;if(X=_.slice(v,G),A=z[X],A)v+=X.length;else{A=[];while(v<G)OH.decode(_,v,W),D=W.value,v=W.rest,A.push(D);if(A.length===2)throw new Error("Found a source, but no line and column");if(A.length===3)throw new Error("Found a source and line, but no column");z[X]=A}if(J.generatedColumn=f+A[0],f=J.generatedColumn,A.length>1){if(J.source=$+A[1],$+=A[1],J.originalLine=Y+A[2],Y=J.originalLine,J.originalLine+=1,J.originalColumn=P+A[3],P=J.originalColumn,A.length>4)J.name=O+A[4],O+=A[4]}if(Z.push(J),typeof J.originalLine==="number")H.push(J)}rK(Z,_8.compareByGeneratedPositionsDeflated),this.__generatedMappings=Z,rK(H,_8.compareByOriginalPositions),this.__originalMappings=H};J6.prototype._findMapping=function q(_,j,K,f,Y,P){if(_[K]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+_[K]);if(_[f]<0)throw new TypeError("Column must be greater than or equal to 0, got "+_[f]);return i4.search(_,j,Y,P)};J6.prototype.computeColumnSpans=function q(){for(var _=0;_<this._generatedMappings.length;++_){var j=this._generatedMappings[_];if(_+1<this._generatedMappings.length){var K=this._generatedMappings[_+1];if(j.generatedLine===K.generatedLine){j.lastGeneratedColumn=K.generatedColumn-1;continue}}j.lastGeneratedColumn=1/0}};J6.prototype.originalPositionFor=function q(_){var j={generatedLine:_8.getArg(_,"line"),generatedColumn:_8.getArg(_,"column")},K=this._findMapping(j,this._generatedMappings,"generatedLine","generatedColumn",_8.compareByGeneratedPositionsDeflated,_8.getArg(_,"bias",I8.GREATEST_LOWER_BOUND));if(K>=0){var f=this._generatedMappings[K];if(f.generatedLine===j.generatedLine){var Y=_8.getArg(f,"source",null);if(Y!==null)Y=this._sources.at(Y),Y=_8.computeSourceURL(this.sourceRoot,Y,this._sourceMapURL);var P=_8.getArg(f,"name",null);if(P!==null)P=this._names.at(P);return{source:Y,line:_8.getArg(f,"originalLine",null),column:_8.getArg(f,"originalColumn",null),name:P}}}return{source:null,line:null,column:null,name:null}};J6.prototype.hasContentsOfAllSources=function q(){if(!this.sourcesContent)return!1;return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(_){return _==null})};J6.prototype.sourceContentFor=function q(_,j){if(!this.sourcesContent)return null;var K=this._findSourceIndex(_);if(K>=0)return this.sourcesContent[K];var f=_;if(this.sourceRoot!=null)f=_8.relative(this.sourceRoot,f);var Y;if(this.sourceRoot!=null&&(Y=_8.urlParse(this.sourceRoot))){var P=f.replace(/^file:\/\//,"");if(Y.scheme=="file"&&this._sources.has(P))return this.sourcesContent[this._sources.indexOf(P)];if((!Y.path||Y.path=="/")&&this._sources.has("/"+f))return this.sourcesContent[this._sources.indexOf("/"+f)]}if(j)return null;else throw new Error('"'+f+'" is not in the SourceMap.')};J6.prototype.generatedPositionFor=function q(_){var j=_8.getArg(_,"source");if(j=this._findSourceIndex(j),j<0)return{line:null,column:null,lastColumn:null};var K={source:j,originalLine:_8.getArg(_,"line"),originalColumn:_8.getArg(_,"column")},f=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",_8.compareByOriginalPositions,_8.getArg(_,"bias",I8.GREATEST_LOWER_BOUND));if(f>=0){var Y=this._originalMappings[f];if(Y.source===K.source)return{line:_8.getArg(Y,"generatedLine",null),column:_8.getArg(Y,"generatedColumn",null),lastColumn:_8.getArg(Y,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};vH.BasicSourceMapConsumer=J6;function wq(q,_){var j=q;if(typeof q==="string")j=_8.parseSourceMapInput(q);var K=_8.getArg(j,"version"),f=_8.getArg(j,"sections");if(K!=this._version)throw new Error("Unsupported version: "+K);this._sources=new c_,this._names=new c_;var Y={line:-1,column:0};this._sections=f.map(function(P){if(P.url)throw new Error("Support for url field in sections not implemented.");var $=_8.getArg(P,"offset"),O=_8.getArg($,"line"),w=_8.getArg($,"column");if(O<Y.line||O===Y.line&&w<Y.column)throw new Error("Section offsets must be ordered and non-overlapping.");return Y=$,{generatedOffset:{generatedLine:O+1,generatedColumn:w+1},consumer:new I8(_8.getArg(P,"map"),_)}})}wq.prototype=Object.create(I8.prototype);wq.prototype.constructor=I8;wq.prototype._version=3;Object.defineProperty(wq.prototype,"sources",{get:function(){var q=[];for(var _=0;_<this._sections.length;_++)for(var j=0;j<this._sections[_].consumer.sources.length;j++)q.push(this._sections[_].consumer.sources[j]);return q}});wq.prototype.originalPositionFor=function q(_){var j={generatedLine:_8.getArg(_,"line"),generatedColumn:_8.getArg(_,"column")},K=i4.search(j,this._sections,function(Y,P){var $=Y.generatedLine-P.generatedOffset.generatedLine;if($)return $;return Y.generatedColumn-P.generatedOffset.generatedColumn}),f=this._sections[K];if(!f)return{source:null,line:null,column:null,name:null};return f.consumer.originalPositionFor({line:j.generatedLine-(f.generatedOffset.generatedLine-1),column:j.generatedColumn-(f.generatedOffset.generatedLine===j.generatedLine?f.generatedOffset.generatedColumn-1:0),bias:_.bias})};wq.prototype.hasContentsOfAllSources=function q(){return this._sections.every(function(_){return _.consumer.hasContentsOfAllSources()})};wq.prototype.sourceContentFor=function q(_,j){for(var K=0;K<this._sections.length;K++){var f=this._sections[K],Y=f.consumer.sourceContentFor(_,!0);if(Y)return Y}if(j)return null;else throw new Error('"'+_+'" is not in the SourceMap.')};wq.prototype.generatedPositionFor=function q(_){for(var j=0;j<this._sections.length;j++){var K=this._sections[j];if(K.consumer._findSourceIndex(_8.getArg(_,"source"))===-1)continue;var f=K.consumer.generatedPositionFor(_);if(f){var Y={line:f.line+(K.generatedOffset.generatedLine-1),column:f.column+(K.generatedOffset.generatedLine===f.line?K.generatedOffset.generatedColumn-1:0)};return Y}}return{line:null,column:null}};wq.prototype._parseMappings=function q(_,j){this.__generatedMappings=[],this.__originalMappings=[];for(var K=0;K<this._sections.length;K++){var f=this._sections[K],Y=f.consumer._generatedMappings;for(var P=0;P<Y.length;P++){var $=Y[P],O=f.consumer._sources.at($.source);O=_8.computeSourceURL(f.consumer.sourceRoot,O,this._sourceMapURL),this._sources.add(O),O=this._sources.indexOf(O);var w=null;if($.name)w=f.consumer._names.at($.name),this._names.add(w),w=this._names.indexOf(w);var v={source:O,generatedLine:$.generatedLine+(f.generatedOffset.generatedLine-1),generatedColumn:$.generatedColumn+(f.generatedOffset.generatedLine===$.generatedLine?f.generatedOffset.generatedColumn-1:0),originalLine:$.originalLine,originalColumn:$.originalColumn,name:w};if(this.__generatedMappings.push(v),typeof v.originalLine==="number")this.__originalMappings.push(v)}}rK(this.__generatedMappings,_8.compareByGeneratedPositionsDeflated),rK(this.__originalMappings,_8.compareByOriginalPositions)};vH.IndexedSourceMapConsumer=wq});var k1=q8((kH)=>{var HH=l4().SourceMapGenerator,e3=n_(),TH=/(\r?\n)/,ZH=10,r_="$$$isSourceNode$$$";function y6(q,_,j,K,f){if(this.children=[],this.sourceContents={},this.line=q==null?null:q,this.column=_==null?null:_,this.source=j==null?null:j,this.name=f==null?null:f,this[r_]=!0,K!=null)this.add(K)}y6.fromStringWithSourceMap=function q(_,j,K){var f=new y6,Y=_.split(TH),P=0,$=function(){var W=Z(),H=Z()||"";return W+H;function Z(){return P<Y.length?Y[P++]:void 0}},O=1,w=0,v=null;if(j.eachMapping(function(W){if(v!==null)if(O<W.generatedLine)z(v,$()),O++,w=0;else{var H=Y[P]||"",Z=H.substr(0,W.generatedColumn-w);Y[P]=H.substr(W.generatedColumn-w),w=W.generatedColumn,z(v,Z),v=W;return}while(O<W.generatedLine)f.add($()),O++;if(w<W.generatedColumn){var H=Y[P]||"";f.add(H.substr(0,W.generatedColumn)),Y[P]=H.substr(W.generatedColumn),w=W.generatedColumn}v=W},this),P<Y.length){if(v)z(v,$());f.add(Y.splice(P).join(""))}return j.sources.forEach(function(W){var H=j.sourceContentFor(W);if(H!=null){if(K!=null)W=e3.join(K,W);f.setSourceContent(W,H)}}),f;function z(W,H){if(W===null||W.source===void 0)f.add(H);else{var Z=K?e3.join(K,W.source):W.source;f.add(new y6(W.originalLine,W.originalColumn,Z,H,W.name))}}};y6.prototype.add=function q(_){if(Array.isArray(_))_.forEach(function(j){this.add(j)},this);else if(_[r_]||typeof _==="string"){if(_)this.children.push(_)}else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+_);return this};y6.prototype.prepend=function q(_){if(Array.isArray(_))for(var j=_.length-1;j>=0;j--)this.prepend(_[j]);else if(_[r_]||typeof _==="string")this.children.unshift(_);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+_);return this};y6.prototype.walk=function q(_){var j;for(var K=0,f=this.children.length;K<f;K++)if(j=this.children[K],j[r_])j.walk(_);else if(j!=="")_(j,{source:this.source,line:this.line,column:this.column,name:this.name})};y6.prototype.join=function q(_){var j,K,f=this.children.length;if(f>0){j=[];for(K=0;K<f-1;K++)j.push(this.children[K]),j.push(_);j.push(this.children[K]),this.children=j}return this};y6.prototype.replaceRight=function q(_,j){var K=this.children[this.children.length-1];if(K[r_])K.replaceRight(_,j);else if(typeof K==="string")this.children[this.children.length-1]=K.replace(_,j);else this.children.push("".replace(_,j));return this};y6.prototype.setSourceContent=function q(_,j){this.sourceContents[e3.toSetString(_)]=j};y6.prototype.walkSourceContents=function q(_){for(var j=0,K=this.children.length;j<K;j++)if(this.children[j][r_])this.children[j].walkSourceContents(_);var f=Object.keys(this.sourceContents);for(var j=0,K=f.length;j<K;j++)_(e3.fromSetString(f[j]),this.sourceContents[f[j]])};y6.prototype.toString=function q(){var _="";return this.walk(function(j){_+=j}),_};y6.prototype.toStringWithSourceMap=function q(_){var j={code:"",line:1,column:0},K=new HH(_),f=!1,Y=null,P=null,$=null,O=null;return this.walk(function(w,v){if(j.code+=w,v.source!==null&&v.line!==null&&v.column!==null){if(Y!==v.source||P!==v.line||$!==v.column||O!==v.name)K.addMapping({source:v.source,original:{line:v.line,column:v.column},generated:{line:j.line,column:j.column},name:v.name});Y=v.source,P=v.line,$=v.column,O=v.name,f=!0}else if(f)K.addMapping({generated:{line:j.line,column:j.column}}),Y=null,f=!1;for(var z=0,W=w.length;z<W;z++)if(w.charCodeAt(z)===ZH){if(j.line++,j.column=0,z+1===W)Y=null,f=!1;else if(f)K.addMapping({source:v.source,original:{line:v.line,column:v.column},generated:{line:j.line,column:j.column},name:v.name})}else j.column++}),this.walkSourceContents(function(w,v){K.setSourceContent(w,v)}),{code:j.code,map:K}};kH.SourceNode=y6});var X1=q8((AH)=>{AH.SourceMapGenerator=l4().SourceMapGenerator;AH.SourceMapConsumer=Z1().SourceMapConsumer;AH.SourceNode=k1().SourceNode});var h1=q8((G1,u1)=>{G1.__esModule=!0;var a4=C6(),z_=void 0;try{if(typeof define!=="function"||!define.amd)B4=X1(),z_=B4.SourceNode}catch(q){}var B4;if(!z_)z_=function(q,_,j,K){if(this.src="",K)this.add(K)},z_.prototype={add:function q(_){if(a4.isArray(_))_=_.join("");this.src+=_},prepend:function q(_){if(a4.isArray(_))_=_.join("");this.src=_+this.src},toStringWithSourceMap:function q(){return{code:this.toString()}},toString:function q(){return this.src}};function o4(q,_,j){if(a4.isArray(q)){var K=[];for(var f=0,Y=q.length;f<Y;f++)K.push(_.wrap(q[f],j));return K}else if(typeof q==="boolean"||typeof q==="number")return q+"";return q}function A1(q){this.srcFile=q,this.source=[]}A1.prototype={isEmpty:function q(){return!this.source.length},prepend:function q(_,j){this.source.unshift(this.wrap(_,j))},push:function q(_,j){this.source.push(this.wrap(_,j))},merge:function q(){var _=this.empty();return this.each(function(j){_.add([" ",j,`
36
+ `])}),_},each:function q(_){for(var j=0,K=this.source.length;j<K;j++)_(this.source[j])},empty:function q(){var _=this.currentLocation||{start:{}};return new z_(_.start.line,_.start.column,this.srcFile)},wrap:function q(_){var j=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];if(_ instanceof z_)return _;return _=o4(_,this,j),new z_(j.start.line,j.start.column,this.srcFile,_)},functionCall:function q(_,j,K){return K=this.generateList(K),this.wrap([_,j?"."+j+"(":"(",K,")"])},quotedString:function q(_){return'"'+(_+"").replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function q(_){var j=this,K=[];Object.keys(_).forEach(function(Y){var P=o4(_[Y],j);if(P!=="undefined")K.push([j.quotedString(Y),":",P])});var f=this.generateList(K);return f.prepend("{"),f.add("}"),f},generateList:function q(_){var j=this.empty();for(var K=0,f=_.length;K<f;K++){if(K)j.add(",");j.add(o4(_[K],this))}return j},generateArray:function q(_){var j=this.generateList(_);return j.prepend("["),j.add("]"),j}};G1.default=A1;u1.exports=G1.default});var b1=q8((M1,N1)=>{M1.__esModule=!0;function V1(q){return q&&q.__esModule?q:{default:q}}var D1=n3(),VH=F6(),t4=V1(VH),MH=C6(),NH=h1(),C1=V1(NH);function i_(q){this.value=q}function o_(){}o_.prototype={nameLookup:function q(_,j){return this.internalNameLookup(_,j)},depthedLookup:function q(_){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(_),")"]},compilerInfo:function q(){var _=D1.COMPILER_REVISION,j=D1.REVISION_CHANGES[_];return[_,j]},appendToBuffer:function q(_,j,K){if(!MH.isArray(_))_=[_];if(_=this.source.wrap(_,j),this.environment.isSimple)return["return ",_,";"];else if(K)return["buffer += ",_,";"];else return _.appendToBuffer=!0,_},initializeBuffer:function q(){return this.quotedString("")},internalNameLookup:function q(_,j){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",_,",",JSON.stringify(j),")"]},lookupPropertyFunctionIsUsed:!1,compile:function q(_,j,K,f){this.environment=_,this.options=j,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!f,this.name=this.environment.name,this.isChild=!!K,this.context=K||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(_,j),this.useDepths=this.useDepths||_.useDepths||_.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||_.useBlockParams;var Y=_.opcodes,P=void 0,$=void 0,O=void 0,w=void 0;for(O=0,w=Y.length;O<w;O++)P=Y[O],this.source.currentLocation=P.loc,$=$||P.loc,this[P.opcode].apply(this,P.args);if(this.source.currentLocation=$,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new t4.default("Compile completed with content left on stack");if(!this.decorators.isEmpty())if(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
37
+ `]),this.decorators.push("return fn;"),f)this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]);else this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
38
38
  `),this.decorators.push(`}
39
- `),this.decorators=this.decorators.merge();else this.decorators=void 0;var v=this.createFunctionContext(Y);if(!this.isChild){var z={compiler:this.compilerInfo(),main:v};if(this.decorators)z.main_d=this.decorators,z.useDecorators=!0;var W=this.context,J=W.programs,Z=W.decorators;for(O=0,w=J.length;O<w;O++)if(J[O]){if(z[O]=J[O],Z[O])z[O+"_d"]=Z[O],z.useDecorators=!0}if(this.environment.usePartial)z.usePartial=!0;if(this.options.data)z.useData=!0;if(this.useDepths)z.useDepths=!0;if(this.useBlockParams)z.useBlockParams=!0;if(this.options.compat)z.compat=!0;if(!Y)if(z.compiler=JSON.stringify(z.compiler),this.source.currentLocation={start:{line:1,column:0}},z=this.objectLiteral(z),j.srcName)z=z.toStringWithSourceMap({file:j.destName}),z.map=z.map&&z.map.toString();else z=z.toString();else z.compilerOptions=this.options;return z}else return v},preamble:function q(){this.lastContext=0,this.source=new T1.default(this.options.srcName),this.decorators=new T1.default(this.options.srcName)},createFunctionContext:function q(_){var j=this,K="",Y=this.stackVars.concat(this.registers.list);if(Y.length>0)K+=", "+Y.join(", ");var f=0;if(Object.keys(this.aliases).forEach(function(O){var w=j.aliases[O];if(w.children&&w.referenceCount>1)K+=", alias"+ ++f+"="+O,w.children[0]="alias"+f}),this.lookupPropertyFunctionIsUsed)K+=", "+this.lookupPropertyFunctionVarDeclaration();var P=["container","depth0","helpers","partials","data"];if(this.useBlockParams||this.useDepths)P.push("blockParams");if(this.useDepths)P.push("depths");var $=this.mergeSource(K);if(_)return P.push($),Function.apply(this,P);else return this.source.wrap(["function(",P.join(","),`) {
40
- `,$,"}"])},mergeSource:function q(_){var j=this.environment.isSimple,K=!this.forceBuffer,Y=void 0,f=void 0,P=void 0,$=void 0;if(this.source.each(function(O){if(O.appendToBuffer){if(P)O.prepend(" + ");else P=O;$=O}else{if(P){if(!f)Y=!0;else P.prepend("buffer += ");$.add(";"),P=$=void 0}if(f=!0,!j)K=!1}}),K){if(P)P.prepend("return "),$.add(";");else if(!f)this.source.push('return "";')}else if(_+=", buffer = "+(Y?"":this.initializeBuffer()),P)P.prepend("return buffer + "),$.add(";");else this.source.push("return buffer;");if(_)this.source.prepend("var "+_.substring(2)+(Y?"":`;
39
+ `),this.decorators=this.decorators.merge();else this.decorators=void 0;var v=this.createFunctionContext(f);if(!this.isChild){var z={compiler:this.compilerInfo(),main:v};if(this.decorators)z.main_d=this.decorators,z.useDecorators=!0;var W=this.context,H=W.programs,Z=W.decorators;for(O=0,w=H.length;O<w;O++)if(H[O]){if(z[O]=H[O],Z[O])z[O+"_d"]=Z[O],z.useDecorators=!0}if(this.environment.usePartial)z.usePartial=!0;if(this.options.data)z.useData=!0;if(this.useDepths)z.useDepths=!0;if(this.useBlockParams)z.useBlockParams=!0;if(this.options.compat)z.compat=!0;if(!f)if(z.compiler=JSON.stringify(z.compiler),this.source.currentLocation={start:{line:1,column:0}},z=this.objectLiteral(z),j.srcName)z=z.toStringWithSourceMap({file:j.destName}),z.map=z.map&&z.map.toString();else z=z.toString();else z.compilerOptions=this.options;return z}else return v},preamble:function q(){this.lastContext=0,this.source=new C1.default(this.options.srcName),this.decorators=new C1.default(this.options.srcName)},createFunctionContext:function q(_){var j=this,K="",f=this.stackVars.concat(this.registers.list);if(f.length>0)K+=", "+f.join(", ");var Y=0;if(Object.keys(this.aliases).forEach(function(O){var w=j.aliases[O];if(w.children&&w.referenceCount>1)K+=", alias"+ ++Y+"="+O,w.children[0]="alias"+Y}),this.lookupPropertyFunctionIsUsed)K+=", "+this.lookupPropertyFunctionVarDeclaration();var P=["container","depth0","helpers","partials","data"];if(this.useBlockParams||this.useDepths)P.push("blockParams");if(this.useDepths)P.push("depths");var $=this.mergeSource(K);if(_)return P.push($),Function.apply(this,P);else return this.source.wrap(["function(",P.join(","),`) {
40
+ `,$,"}"])},mergeSource:function q(_){var j=this.environment.isSimple,K=!this.forceBuffer,f=void 0,Y=void 0,P=void 0,$=void 0;if(this.source.each(function(O){if(O.appendToBuffer){if(P)O.prepend(" + ");else P=O;$=O}else{if(P){if(!Y)f=!0;else P.prepend("buffer += ");$.add(";"),P=$=void 0}if(Y=!0,!j)K=!1}}),K){if(P)P.prepend("return "),$.add(";");else if(!Y)this.source.push('return "";')}else if(_+=", buffer = "+(f?"":this.initializeBuffer()),P)P.prepend("return buffer + "),$.add(";");else this.source.push("return buffer;");if(_)this.source.prepend("var "+_.substring(2)+(f?"":`;
41
41
  `));return this.source.merge()},lookupPropertyFunctionVarDeclaration:function q(){return`
42
42
  lookupProperty = container.lookupProperty || function(parent, propertyName) {
43
43
  if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
@@ -45,11 +45,15 @@ Expecting `+y.join(", ")+", got '"+(this.terminals_[M]||M)+"'";else i="Parse err
45
45
  }
46
46
  return undefined
47
47
  }
48
- `.trim()},blockValue:function q(_){var j=this.aliasable("container.hooks.blockHelperMissing"),K=[this.contextName(0)];this.setupHelperArgs(_,0,K);var Y=this.popStack();K.splice(1,0,Y),this.push(this.source.functionCall(j,"call",K))},ambiguousBlockValue:function q(){var _=this.aliasable("container.hooks.blockHelperMissing"),j=[this.contextName(0)];this.setupHelperArgs("",0,j,!0),this.flushInline();var K=this.topStack();j.splice(1,0,K),this.pushSource(["if (!",this.lastHelper,") { ",K," = ",this.source.functionCall(_,"call",j),"}"])},appendContent:function q(_){if(this.pendingContent)_=this.pendingContent+_;else this.pendingLocation=this.source.currentLocation;this.pendingContent=_},append:function q(){if(this.isInline())this.replaceStack(function(j){return[" != null ? ",j,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var _=this.popStack();if(this.pushSource(["if (",_," != null) { ",this.appendToBuffer(_,void 0,!0)," }"]),this.environment.isSimple)this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function q(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function q(_){this.lastContext=_},pushContext:function q(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function q(_,j,K,Y){var f=0;if(!Y&&this.options.compat&&!this.lastContext)this.push(this.depthedLookup(_[f++]));else this.pushContext();this.resolvePath("context",_,f,j,K)},lookupBlockParam:function q(_,j){this.useBlockParams=!0,this.push(["blockParams[",_[0],"][",_[1],"]"]),this.resolvePath("context",j,1)},lookupData:function q(_,j,K){if(!_)this.pushStackLiteral("data");else this.pushStackLiteral("container.data(data, "+_+")");this.resolvePath("data",j,0,!0,K)},resolvePath:function q(_,j,K,Y,f){var P=this;if(this.options.strict||this.options.assumeObjects){this.push(uH(this.options.strict&&f,this,j,K,_));return}var $=j.length;for(;K<$;K++)this.replaceStack(function(O){var w=P.nameLookup(O,j[K],_);if(!Y)return[" != null ? ",w," : ",O];else return[" && ",w]})},resolvePossibleLambda:function q(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function q(_,j){if(this.pushContext(),this.pushString(j),j!=="SubExpression")if(typeof _==="string")this.pushString(_);else this.pushStackLiteral(_)},emptyHash:function q(_){if(this.trackIds)this.push("{}");if(this.stringParams)this.push("{}"),this.push("{}");this.pushStackLiteral(_?"undefined":"{}")},pushHash:function q(){if(this.hash)this.hashes.push(this.hash);this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function q(){var _=this.hash;if(this.hash=this.hashes.pop(),this.trackIds)this.push(this.objectLiteral(_.ids));if(this.stringParams)this.push(this.objectLiteral(_.contexts)),this.push(this.objectLiteral(_.types));this.push(this.objectLiteral(_.values))},pushString:function q(_){this.pushStackLiteral(this.quotedString(_))},pushLiteral:function q(_){this.pushStackLiteral(_)},pushProgram:function q(_){if(_!=null)this.pushStackLiteral(this.programExpression(_));else this.pushStackLiteral(null)},registerDecorator:function q(_,j){var K=this.nameLookup("decorators",j,"decorator"),Y=this.setupHelperArgs(j,_);this.decorators.push(["fn = ",this.decorators.functionCall(K,"",["fn","props","container",Y])," || fn;"])},invokeHelper:function q(_,j,K){var Y=this.popStack(),f=this.setupHelper(_,j),P=[];if(K)P.push(f.name);if(P.push(Y),!this.options.strict)P.push(this.aliasable("container.hooks.helperMissing"));var $=["(",this.itemsSeparatedBy(P,"||"),")"],O=this.source.functionCall($,"call",f.callParams);this.push(O)},itemsSeparatedBy:function q(_,j){var K=[];K.push(_[0]);for(var Y=1;Y<_.length;Y++)K.push(j,_[Y]);return K},invokeKnownHelper:function q(_,j){var K=this.setupHelper(_,j);this.push(this.source.functionCall(K.name,"call",K.callParams))},invokeAmbiguous:function q(_,j){this.useRegister("helper");var K=this.popStack();this.emptyHash();var Y=this.setupHelper(0,_,j),f=this.lastHelper=this.nameLookup("helpers",_,"helper"),P=["(","(helper = ",f," || ",K,")"];if(!this.options.strict)P[0]="(helper = ",P.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"));this.push(["(",P,Y.paramsInit?["),(",Y.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",Y.callParams)," : helper))"])},invokePartial:function q(_,j,K){var Y=[],f=this.setupParams(j,1,Y);if(_)j=this.popStack(),delete f.name;if(K)f.indent=JSON.stringify(K);if(f.helpers="helpers",f.partials="partials",f.decorators="container.decorators",!_)Y.unshift(this.nameLookup("partials",j,"partial"));else Y.unshift(j);if(this.options.compat)f.depths="depths";f=this.objectLiteral(f),Y.push(f),this.push(this.source.functionCall("container.invokePartial","",Y))},assignToHash:function q(_){var j=this.popStack(),K=void 0,Y=void 0,f=void 0;if(this.trackIds)f=this.popStack();if(this.stringParams)Y=this.popStack(),K=this.popStack();var P=this.hash;if(K)P.contexts[_]=K;if(Y)P.types[_]=Y;if(f)P.ids[_]=f;P.values[_]=j},pushId:function q(_,j,K){if(_==="BlockParam")this.pushStackLiteral("blockParams["+j[0]+"].path["+j[1]+"]"+(K?" + "+JSON.stringify("."+K):""));else if(_==="PathExpression")this.pushString(j);else if(_==="SubExpression")this.pushStackLiteral("true");else this.pushStackLiteral("null")},compiler:c_,compileChildren:function q(_,j){var K=_.children,Y=void 0,f=void 0;for(var P=0,$=K.length;P<$;P++){Y=K[P],f=new this.compiler;var O=this.matchExistingProgram(Y);if(O==null){this.context.programs.push("");var w=this.context.programs.length;Y.index=w,Y.name="program"+w,this.context.programs[w]=f.compile(Y,j,this.context,!this.precompile),this.context.decorators[w]=f.decorators,this.context.environments[w]=Y,this.useDepths=this.useDepths||f.useDepths,this.useBlockParams=this.useBlockParams||f.useBlockParams,Y.useDepths=this.useDepths,Y.useBlockParams=this.useBlockParams}else Y.index=O.index,Y.name="program"+O.index,this.useDepths=this.useDepths||O.useDepths,this.useBlockParams=this.useBlockParams||O.useBlockParams}},matchExistingProgram:function q(_){for(var j=0,K=this.context.environments.length;j<K;j++){var Y=this.context.environments[j];if(Y&&Y.equals(_))return Y}},programExpression:function q(_){var j=this.environment.children[_],K=[j.index,"data",j.blockParams];if(this.useBlockParams||this.useDepths)K.push("blockParams");if(this.useDepths)K.push("depths");return"container.program("+K.join(", ")+")"},useRegister:function q(_){if(!this.registers[_])this.registers[_]=!0,this.registers.list.push(_)},push:function q(_){if(!(_ instanceof n_))_=this.source.wrap(_);return this.inlineStack.push(_),_},pushStackLiteral:function q(_){this.push(new n_(_))},pushSource:function q(_){if(this.pendingContent)this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0;if(_)this.source.push(_)},replaceStack:function q(_){var j=["("],K=void 0,Y=void 0,f=void 0;if(!this.isInline())throw new r4.default("replaceStack on non-inline");var P=this.popStack(!0);if(P instanceof n_)K=[P.value],j=["(",K],f=!0;else{Y=!0;var $=this.incrStack();j=["((",this.push($)," = ",P,")"],K=this.topStack()}var O=_.call(this,K);if(!f)this.popStack();if(Y)this.stackSlot--;this.push(j.concat(O,")"))},incrStack:function q(){if(this.stackSlot++,this.stackSlot>this.stackVars.length)this.stackVars.push("stack"+this.stackSlot);return this.topStackName()},topStackName:function q(){return"stack"+this.stackSlot},flushInline:function q(){var _=this.inlineStack;this.inlineStack=[];for(var j=0,K=_.length;j<K;j++){var Y=_[j];if(Y instanceof n_)this.compileStack.push(Y);else{var f=this.incrStack();this.pushSource([f," = ",Y,";"]),this.compileStack.push(f)}}},isInline:function q(){return this.inlineStack.length},popStack:function q(_){var j=this.isInline(),K=(j?this.inlineStack:this.compileStack).pop();if(!_&&K instanceof n_)return K.value;else{if(!j){if(!this.stackSlot)throw new r4.default("Invalid stack pop");this.stackSlot--}return K}},topStack:function q(){var _=this.isInline()?this.inlineStack:this.compileStack,j=_[_.length-1];if(j instanceof n_)return j.value;else return j},contextName:function q(_){if(this.useDepths&&_)return"depths["+_+"]";else return"depth"+_},quotedString:function q(_){return this.source.quotedString(_)},objectLiteral:function q(_){return this.source.objectLiteral(_)},aliasable:function q(_){var j=this.aliases[_];if(j)return j.referenceCount++,j;return j=this.aliases[_]=this.source.wrap(_),j.aliasable=!0,j.referenceCount=1,j},setupHelper:function q(_,j,K){var Y=[],f=this.setupHelperArgs(j,_,Y,K),P=this.nameLookup("helpers",j,"helper"),$=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:Y,paramsInit:f,name:P,callParams:[$].concat(Y)}},setupParams:function q(_,j,K){var Y={},f=[],P=[],$=[],O=!K,w=void 0;if(O)K=[];if(Y.name=this.quotedString(_),Y.hash=this.popStack(),this.trackIds)Y.hashIds=this.popStack();if(this.stringParams)Y.hashTypes=this.popStack(),Y.hashContexts=this.popStack();var v=this.popStack(),z=this.popStack();if(z||v)Y.fn=z||"container.noop",Y.inverse=v||"container.noop";var W=j;while(W--){if(w=this.popStack(),K[W]=w,this.trackIds)$[W]=this.popStack();if(this.stringParams)P[W]=this.popStack(),f[W]=this.popStack()}if(O)Y.args=this.source.generateArray(K);if(this.trackIds)Y.ids=this.source.generateArray($);if(this.stringParams)Y.types=this.source.generateArray(P),Y.contexts=this.source.generateArray(f);if(this.options.data)Y.data="data";if(this.useBlockParams)Y.blockParams="blockParams";return Y},setupHelperArgs:function q(_,j,K,Y){var f=this.setupParams(_,j,K);if(f.loc=JSON.stringify(this.source.currentLocation),f=this.objectLiteral(f),Y)return this.useRegister("options"),K.push("options"),["options=",f];else if(K)return K.push(f),"";else return f}};(function(){var q="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),_=c_.RESERVED_WORDS={};for(var j=0,K=q.length;j<K;j++)_[q[j]]=!0})();c_.isValidJavaScriptVariableName=function(q){return!c_.RESERVED_WORDS[q]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(q)};function uH(q,_,j,K,Y){var f=_.popStack(),P=j.length;if(q)P--;for(;K<P;K++)f=_.nameLookup(f,j[K],Y);if(q)return[_.aliasable("container.strict"),"(",f,", ",_.quotedString(j[K]),", ",JSON.stringify(_.source.currentLocation)," )"];else return f}k1.default=c_;X1.exports=k1.default});var D1=q8((u1,h1)=>{u1.__esModule=!0;function lK(q){return q&&q.__esModule?q:{default:q}}var CH=hj(),VH=lK(CH),MH=G4(),NH=lK(MH),i4=lj(),o4=rj(),bH=A1(),SH=lK(bH),EH=x3(),RH=lK(EH),mH=Z4(),IH=lK(mH),gH=VH.default.create;function G1(){var q=gH();return q.compile=function(_,j){return o4.compile(_,j,q)},q.precompile=function(_,j){return o4.precompile(_,j,q)},q.AST=NH.default,q.Compiler=o4.Compiler,q.JavaScriptCompiler=SH.default,q.Parser=i4.parser,q.parse=i4.parse,q.parseWithoutProcessing=i4.parseWithoutProcessing,q}var r_=G1();r_.create=G1;IH.default(r_);r_.Visitor=RH.default;r_.default=r_;u1.default=r_;h1.exports=u1.default});var C1=q8((nH)=>{nH.__esModule=!0;nH.print=xH;nH.PrintVisitor=o8;function pH(q){return q&&q.__esModule?q:{default:q}}var LH=x3(),lH=pH(LH);function xH(q){return new o8().accept(q)}function o8(){this.padding=0}o8.prototype=new lH.default;o8.prototype.pad=function(q){var _="";for(var j=0,K=this.padding;j<K;j++)_+=" ";return _+=q+`
49
- `,_};o8.prototype.Program=function(q){var _="",j=q.body,K=void 0,Y=void 0;if(q.blockParams){var f="BLOCK PARAMS: [";for(K=0,Y=q.blockParams.length;K<Y;K++)f+=" "+q.blockParams[K];f+=" ]",_+=this.pad(f)}for(K=0,Y=j.length;K<Y;K++)_+=this.accept(j[K]);return this.padding--,_};o8.prototype.MustacheStatement=function(q){return this.pad("{{ "+this.SubExpression(q)+" }}")};o8.prototype.Decorator=function(q){return this.pad("{{ DIRECTIVE "+this.SubExpression(q)+" }}")};o8.prototype.BlockStatement=o8.prototype.DecoratorBlock=function(q){var _="";if(_+=this.pad((q.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,_+=this.pad(this.SubExpression(q)),q.program)_+=this.pad("PROGRAM:"),this.padding++,_+=this.accept(q.program),this.padding--;if(q.inverse){if(q.program)this.padding++;if(_+=this.pad("{{^}}"),this.padding++,_+=this.accept(q.inverse),this.padding--,q.program)this.padding--}return this.padding--,_};o8.prototype.PartialStatement=function(q){var _="PARTIAL:"+q.name.original;if(q.params[0])_+=" "+this.accept(q.params[0]);if(q.hash)_+=" "+this.accept(q.hash);return this.pad("{{> "+_+" }}")};o8.prototype.PartialBlockStatement=function(q){var _="PARTIAL BLOCK:"+q.name.original;if(q.params[0])_+=" "+this.accept(q.params[0]);if(q.hash)_+=" "+this.accept(q.hash);return _+=" "+this.pad("PROGRAM:"),this.padding++,_+=this.accept(q.program),this.padding--,this.pad("{{> "+_+" }}")};o8.prototype.ContentStatement=function(q){return this.pad("CONTENT[ '"+q.value+"' ]")};o8.prototype.CommentStatement=function(q){return this.pad("{{! '"+q.value+"' }}")};o8.prototype.SubExpression=function(q){var _=q.params,j=[],K=void 0;for(var Y=0,f=_.length;Y<f;Y++)j.push(this.accept(_[Y]));return _="["+j.join(", ")+"]",K=q.hash?" "+this.accept(q.hash):"",this.accept(q.path)+" "+_+K};o8.prototype.PathExpression=function(q){var _=q.parts.join("/");return(q.data?"@":"")+"PATH:"+_};o8.prototype.StringLiteral=function(q){return'"'+q.value+'"'};o8.prototype.NumberLiteral=function(q){return"NUMBER{"+q.value+"}"};o8.prototype.BooleanLiteral=function(q){return"BOOLEAN{"+q.value+"}"};o8.prototype.UndefinedLiteral=function(){return"UNDEFINED"};o8.prototype.NullLiteral=function(){return"NULL"};o8.prototype.Hash=function(q){var _=q.pairs,j=[];for(var K=0,Y=_.length;K<Y;K++)j.push(this.accept(_[K]));return"HASH{"+j.join(", ")+"}"};o8.prototype.HashPair=function(q){return q.key+"="+this.accept(q.value)}});var a4=q8((dC,N1)=>{var o3=D1().default,M1=C1();o3.PrintVisitor=M1.PrintVisitor;o3.print=M1.print;N1.exports=o3;function V1(q,_){var j=h6("fs"),K=j.readFileSync(_,"utf8");q.exports=o3.compile(K)}if(h6.extensions)h6.extensions[".handlebars"]=V1,h6.extensions[".hbs"]=V1});function b1(q){try{let _=q instanceof Date?q:new Date(q),K=new Date().getTime()-_.getTime(),Y=Math.floor(K/1000),f=Math.floor(Y/60),P=Math.floor(f/60),$=Math.floor(P/24),O=Math.floor($/7),w=Math.floor($/30);if(Y<60)return"Just now";else if(f<60)return f===1?"1 minute ago":`${f} minutes ago`;else if(P<24)return P===1?"1 hour ago":`${P} hours ago`;else if($===1)return"Yesterday";else if($<7)return`${$} days ago`;else if(O===1)return"1 week ago";else if(O<4)return`${O} weeks ago`;else if(w===1)return"1 month ago";else if(w<12)return`${w} months ago`;else{let v=Math.floor(w/12);return v===1?"1 year ago":`${v} years ago`}}catch(_){return"Recently"}}function S1(q){let _=["timestamp","created_at","date","time"];for(let j of _)if(q[j])try{let K=new Date(q[j]);if(!isNaN(K.getTime()))return K}catch{continue}return null}function E1(q){return{searching:"\uD83D\uDD0D Searching previous memories...",loading:"\uD83D\uDCDA Loading relevant context...",formatting:"✨ Organizing memories for display...",compressing:"\uD83D\uDDDC️ Compressing session transcript...",archiving:"\uD83D\uDCE6 Archiving conversation..."}[q]||`⏳ ${q}...`}function a3(q,_,j){let K=_!==void 0?` (${_} items)`:"",Y=j?`
50
- ${j}`:"";return`✅ ${q} completed successfully${K}${Y}`}function i_(q,_,j){let K=j?`
51
-
52
- \uD83D\uDCA1 ${j}`:"";return`❌ ${q} encountered an issue: ${_}${K}`}function xK(q,..._){let j=BH[q](..._);return i_("Memory system",j.message,j.suggestion)}function R1(q){let _=typeof q==="string"?new Date(q):q,K=new Date().getTime()-_.getTime(),Y=Math.floor(K/60000),f=Math.floor(K/3600000),P=Math.floor(K/86400000);if(Y<1)return"just now";if(Y<60)return`${Y} minute${Y>1?"s":""} ago`;if(f<24)return`${f} hour${f>1?"s":""} ago`;if(P<7)return`${P} day${P>1?"s":""} ago`;return _.toLocaleDateString()}function m1(q,_){let{count:j,duration:K,details:Y}=_,f=K?` in ${K}ms`:"",P=Y?` - ${Y}`:"";return`\uD83D\uDCCA ${{compress:`Compressed ${j} conversation turns${f}${P}`,load:`Loaded ${j} relevant memories${f}${P}`,search:`Found ${j} matching memories${f}${P}`,archive:`Archived ${j} conversation segments${f}${P}`}[q]}`}function tH(q,_=3,j){let K=q.filter((P)=>P.type==="overview");if(K.length===0)return[];let Y=K;if(j){if(Y=K.filter((P)=>P.project===j),Y.length===0)Y=K}return Y.slice(-_).map((P)=>{let $={content:P.content||""},O=S1(P);if(O)$.timestamp=O,$.timeAgo=b1(O);else $.timeAgo="Recently";return $})}function eH(q){if(q.length===0)return[];return q.filter((_)=>_.type==="memory").map((_)=>{let j={summary:_.text||"",sessionId:_.session_id||""};if(_.keywords)j.keywords=_.keywords;if(_.document_id&&!_.document_id.includes("Session:"))j.location=_.document_id;return j}).filter((_)=>_.summary.length>0)}function FH(q){let _=new Map;return q.forEach((j)=>{let K=j.sessionId;if(K){if(!_.has(K))_.set(K,[]);_.get(K).push(j)}}),Array.from(_.entries()).map(([j,K])=>{let Y=K.map((f,P)=>({...f,number:P+1}));return{sessionId:j,memories:Y}})}function I1(q){let{projectName:_,memoryCount:j,lastSessionTime:K,recentObjects:Y}=q,f=tH(Y,3,_),P=eH(Y);if(P.length>0){let $=FH(P);console.log("\uD83D\uDCDA Recent Context"),console.log("===================================================================="),$.forEach((O)=>{console.log(`\uD83D\uDC40 in ${O.sessionId}:`),console.log(""),O.memories.forEach((w)=>{console.log(`${w.number}. ${w.summary}`),console.log(` — ${w.keywords}`),console.log("")})}),console.log("======================================================================")}if(f.length>0)console.log("\uD83E\uDDE0 What's new:"),console.log("===================================================================="),f.forEach(($)=>{console.log(`\uD83D\uDCC5 ${$.timeAgo}:`),console.log($.content),console.log("")}),console.log("====================================================================");else if(P.length===0)console.log(`\uD83E\uDDE0 No recent context found for ${_}`)}var t4,oH=`\uD83E\uDDE0 What's new: {{dateTime}}
48
+ `.trim()},blockValue:function q(_){var j=this.aliasable("container.hooks.blockHelperMissing"),K=[this.contextName(0)];this.setupHelperArgs(_,0,K);var f=this.popStack();K.splice(1,0,f),this.push(this.source.functionCall(j,"call",K))},ambiguousBlockValue:function q(){var _=this.aliasable("container.hooks.blockHelperMissing"),j=[this.contextName(0)];this.setupHelperArgs("",0,j,!0),this.flushInline();var K=this.topStack();j.splice(1,0,K),this.pushSource(["if (!",this.lastHelper,") { ",K," = ",this.source.functionCall(_,"call",j),"}"])},appendContent:function q(_){if(this.pendingContent)_=this.pendingContent+_;else this.pendingLocation=this.source.currentLocation;this.pendingContent=_},append:function q(){if(this.isInline())this.replaceStack(function(j){return[" != null ? ",j,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var _=this.popStack();if(this.pushSource(["if (",_," != null) { ",this.appendToBuffer(_,void 0,!0)," }"]),this.environment.isSimple)this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function q(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function q(_){this.lastContext=_},pushContext:function q(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function q(_,j,K,f){var Y=0;if(!f&&this.options.compat&&!this.lastContext)this.push(this.depthedLookup(_[Y++]));else this.pushContext();this.resolvePath("context",_,Y,j,K)},lookupBlockParam:function q(_,j){this.useBlockParams=!0,this.push(["blockParams[",_[0],"][",_[1],"]"]),this.resolvePath("context",j,1)},lookupData:function q(_,j,K){if(!_)this.pushStackLiteral("data");else this.pushStackLiteral("container.data(data, "+_+")");this.resolvePath("data",j,0,!0,K)},resolvePath:function q(_,j,K,f,Y){var P=this;if(this.options.strict||this.options.assumeObjects){this.push(bH(this.options.strict&&Y,this,j,K,_));return}var $=j.length;for(;K<$;K++)this.replaceStack(function(O){var w=P.nameLookup(O,j[K],_);if(!f)return[" != null ? ",w," : ",O];else return[" && ",w]})},resolvePossibleLambda:function q(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function q(_,j){if(this.pushContext(),this.pushString(j),j!=="SubExpression")if(typeof _==="string")this.pushString(_);else this.pushStackLiteral(_)},emptyHash:function q(_){if(this.trackIds)this.push("{}");if(this.stringParams)this.push("{}"),this.push("{}");this.pushStackLiteral(_?"undefined":"{}")},pushHash:function q(){if(this.hash)this.hashes.push(this.hash);this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function q(){var _=this.hash;if(this.hash=this.hashes.pop(),this.trackIds)this.push(this.objectLiteral(_.ids));if(this.stringParams)this.push(this.objectLiteral(_.contexts)),this.push(this.objectLiteral(_.types));this.push(this.objectLiteral(_.values))},pushString:function q(_){this.pushStackLiteral(this.quotedString(_))},pushLiteral:function q(_){this.pushStackLiteral(_)},pushProgram:function q(_){if(_!=null)this.pushStackLiteral(this.programExpression(_));else this.pushStackLiteral(null)},registerDecorator:function q(_,j){var K=this.nameLookup("decorators",j,"decorator"),f=this.setupHelperArgs(j,_);this.decorators.push(["fn = ",this.decorators.functionCall(K,"",["fn","props","container",f])," || fn;"])},invokeHelper:function q(_,j,K){var f=this.popStack(),Y=this.setupHelper(_,j),P=[];if(K)P.push(Y.name);if(P.push(f),!this.options.strict)P.push(this.aliasable("container.hooks.helperMissing"));var $=["(",this.itemsSeparatedBy(P,"||"),")"],O=this.source.functionCall($,"call",Y.callParams);this.push(O)},itemsSeparatedBy:function q(_,j){var K=[];K.push(_[0]);for(var f=1;f<_.length;f++)K.push(j,_[f]);return K},invokeKnownHelper:function q(_,j){var K=this.setupHelper(_,j);this.push(this.source.functionCall(K.name,"call",K.callParams))},invokeAmbiguous:function q(_,j){this.useRegister("helper");var K=this.popStack();this.emptyHash();var f=this.setupHelper(0,_,j),Y=this.lastHelper=this.nameLookup("helpers",_,"helper"),P=["(","(helper = ",Y," || ",K,")"];if(!this.options.strict)P[0]="(helper = ",P.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"));this.push(["(",P,f.paramsInit?["),(",f.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",f.callParams)," : helper))"])},invokePartial:function q(_,j,K){var f=[],Y=this.setupParams(j,1,f);if(_)j=this.popStack(),delete Y.name;if(K)Y.indent=JSON.stringify(K);if(Y.helpers="helpers",Y.partials="partials",Y.decorators="container.decorators",!_)f.unshift(this.nameLookup("partials",j,"partial"));else f.unshift(j);if(this.options.compat)Y.depths="depths";Y=this.objectLiteral(Y),f.push(Y),this.push(this.source.functionCall("container.invokePartial","",f))},assignToHash:function q(_){var j=this.popStack(),K=void 0,f=void 0,Y=void 0;if(this.trackIds)Y=this.popStack();if(this.stringParams)f=this.popStack(),K=this.popStack();var P=this.hash;if(K)P.contexts[_]=K;if(f)P.types[_]=f;if(Y)P.ids[_]=Y;P.values[_]=j},pushId:function q(_,j,K){if(_==="BlockParam")this.pushStackLiteral("blockParams["+j[0]+"].path["+j[1]+"]"+(K?" + "+JSON.stringify("."+K):""));else if(_==="PathExpression")this.pushString(j);else if(_==="SubExpression")this.pushStackLiteral("true");else this.pushStackLiteral("null")},compiler:o_,compileChildren:function q(_,j){var K=_.children,f=void 0,Y=void 0;for(var P=0,$=K.length;P<$;P++){f=K[P],Y=new this.compiler;var O=this.matchExistingProgram(f);if(O==null){this.context.programs.push("");var w=this.context.programs.length;f.index=w,f.name="program"+w,this.context.programs[w]=Y.compile(f,j,this.context,!this.precompile),this.context.decorators[w]=Y.decorators,this.context.environments[w]=f,this.useDepths=this.useDepths||Y.useDepths,this.useBlockParams=this.useBlockParams||Y.useBlockParams,f.useDepths=this.useDepths,f.useBlockParams=this.useBlockParams}else f.index=O.index,f.name="program"+O.index,this.useDepths=this.useDepths||O.useDepths,this.useBlockParams=this.useBlockParams||O.useBlockParams}},matchExistingProgram:function q(_){for(var j=0,K=this.context.environments.length;j<K;j++){var f=this.context.environments[j];if(f&&f.equals(_))return f}},programExpression:function q(_){var j=this.environment.children[_],K=[j.index,"data",j.blockParams];if(this.useBlockParams||this.useDepths)K.push("blockParams");if(this.useDepths)K.push("depths");return"container.program("+K.join(", ")+")"},useRegister:function q(_){if(!this.registers[_])this.registers[_]=!0,this.registers.list.push(_)},push:function q(_){if(!(_ instanceof i_))_=this.source.wrap(_);return this.inlineStack.push(_),_},pushStackLiteral:function q(_){this.push(new i_(_))},pushSource:function q(_){if(this.pendingContent)this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0;if(_)this.source.push(_)},replaceStack:function q(_){var j=["("],K=void 0,f=void 0,Y=void 0;if(!this.isInline())throw new t4.default("replaceStack on non-inline");var P=this.popStack(!0);if(P instanceof i_)K=[P.value],j=["(",K],Y=!0;else{f=!0;var $=this.incrStack();j=["((",this.push($)," = ",P,")"],K=this.topStack()}var O=_.call(this,K);if(!Y)this.popStack();if(f)this.stackSlot--;this.push(j.concat(O,")"))},incrStack:function q(){if(this.stackSlot++,this.stackSlot>this.stackVars.length)this.stackVars.push("stack"+this.stackSlot);return this.topStackName()},topStackName:function q(){return"stack"+this.stackSlot},flushInline:function q(){var _=this.inlineStack;this.inlineStack=[];for(var j=0,K=_.length;j<K;j++){var f=_[j];if(f instanceof i_)this.compileStack.push(f);else{var Y=this.incrStack();this.pushSource([Y," = ",f,";"]),this.compileStack.push(Y)}}},isInline:function q(){return this.inlineStack.length},popStack:function q(_){var j=this.isInline(),K=(j?this.inlineStack:this.compileStack).pop();if(!_&&K instanceof i_)return K.value;else{if(!j){if(!this.stackSlot)throw new t4.default("Invalid stack pop");this.stackSlot--}return K}},topStack:function q(){var _=this.isInline()?this.inlineStack:this.compileStack,j=_[_.length-1];if(j instanceof i_)return j.value;else return j},contextName:function q(_){if(this.useDepths&&_)return"depths["+_+"]";else return"depth"+_},quotedString:function q(_){return this.source.quotedString(_)},objectLiteral:function q(_){return this.source.objectLiteral(_)},aliasable:function q(_){var j=this.aliases[_];if(j)return j.referenceCount++,j;return j=this.aliases[_]=this.source.wrap(_),j.aliasable=!0,j.referenceCount=1,j},setupHelper:function q(_,j,K){var f=[],Y=this.setupHelperArgs(j,_,f,K),P=this.nameLookup("helpers",j,"helper"),$=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:f,paramsInit:Y,name:P,callParams:[$].concat(f)}},setupParams:function q(_,j,K){var f={},Y=[],P=[],$=[],O=!K,w=void 0;if(O)K=[];if(f.name=this.quotedString(_),f.hash=this.popStack(),this.trackIds)f.hashIds=this.popStack();if(this.stringParams)f.hashTypes=this.popStack(),f.hashContexts=this.popStack();var v=this.popStack(),z=this.popStack();if(z||v)f.fn=z||"container.noop",f.inverse=v||"container.noop";var W=j;while(W--){if(w=this.popStack(),K[W]=w,this.trackIds)$[W]=this.popStack();if(this.stringParams)P[W]=this.popStack(),Y[W]=this.popStack()}if(O)f.args=this.source.generateArray(K);if(this.trackIds)f.ids=this.source.generateArray($);if(this.stringParams)f.types=this.source.generateArray(P),f.contexts=this.source.generateArray(Y);if(this.options.data)f.data="data";if(this.useBlockParams)f.blockParams="blockParams";return f},setupHelperArgs:function q(_,j,K,f){var Y=this.setupParams(_,j,K);if(Y.loc=JSON.stringify(this.source.currentLocation),Y=this.objectLiteral(Y),f)return this.useRegister("options"),K.push("options"),["options=",Y];else if(K)return K.push(Y),"";else return Y}};(function(){var q="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),_=o_.RESERVED_WORDS={};for(var j=0,K=q.length;j<K;j++)_[q[j]]=!0})();o_.isValidJavaScriptVariableName=function(q){return!o_.RESERVED_WORDS[q]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(q)};function bH(q,_,j,K,f){var Y=_.popStack(),P=j.length;if(q)P--;for(;K<P;K++)Y=_.nameLookup(Y,j[K],f);if(q)return[_.aliasable("container.strict"),"(",Y,", ",_.quotedString(j[K]),", ",JSON.stringify(_.source.currentLocation)," )"];else return Y}M1.default=o_;N1.exports=M1.default});var m1=q8((E1,R1)=>{E1.__esModule=!0;function iK(q){return q&&q.__esModule?q:{default:q}}var RH=Rj(),mH=iK(RH),IH=V4(),gH=iK(IH),e4=tj(),F4=sj(),yH=b1(),dH=iK(yH),pH=o3(),LH=iK(pH),lH=u4(),xH=iK(lH),nH=mH.default.create;function S1(){var q=nH();return q.compile=function(_,j){return F4.compile(_,j,q)},q.precompile=function(_,j){return F4.precompile(_,j,q)},q.AST=gH.default,q.Compiler=F4.Compiler,q.JavaScriptCompiler=dH.default,q.Parser=e4.parser,q.parse=e4.parse,q.parseWithoutProcessing=e4.parseWithoutProcessing,q}var a_=S1();a_.create=S1;xH.default(a_);a_.Visitor=LH.default;a_.default=a_;E1.default=a_;R1.exports=E1.default});var I1=q8((tH)=>{tH.__esModule=!0;tH.print=BH;tH.PrintVisitor=a8;function iH(q){return q&&q.__esModule?q:{default:q}}var oH=o3(),aH=iH(oH);function BH(q){return new a8().accept(q)}function a8(){this.padding=0}a8.prototype=new aH.default;a8.prototype.pad=function(q){var _="";for(var j=0,K=this.padding;j<K;j++)_+=" ";return _+=q+`
49
+ `,_};a8.prototype.Program=function(q){var _="",j=q.body,K=void 0,f=void 0;if(q.blockParams){var Y="BLOCK PARAMS: [";for(K=0,f=q.blockParams.length;K<f;K++)Y+=" "+q.blockParams[K];Y+=" ]",_+=this.pad(Y)}for(K=0,f=j.length;K<f;K++)_+=this.accept(j[K]);return this.padding--,_};a8.prototype.MustacheStatement=function(q){return this.pad("{{ "+this.SubExpression(q)+" }}")};a8.prototype.Decorator=function(q){return this.pad("{{ DIRECTIVE "+this.SubExpression(q)+" }}")};a8.prototype.BlockStatement=a8.prototype.DecoratorBlock=function(q){var _="";if(_+=this.pad((q.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,_+=this.pad(this.SubExpression(q)),q.program)_+=this.pad("PROGRAM:"),this.padding++,_+=this.accept(q.program),this.padding--;if(q.inverse){if(q.program)this.padding++;if(_+=this.pad("{{^}}"),this.padding++,_+=this.accept(q.inverse),this.padding--,q.program)this.padding--}return this.padding--,_};a8.prototype.PartialStatement=function(q){var _="PARTIAL:"+q.name.original;if(q.params[0])_+=" "+this.accept(q.params[0]);if(q.hash)_+=" "+this.accept(q.hash);return this.pad("{{> "+_+" }}")};a8.prototype.PartialBlockStatement=function(q){var _="PARTIAL BLOCK:"+q.name.original;if(q.params[0])_+=" "+this.accept(q.params[0]);if(q.hash)_+=" "+this.accept(q.hash);return _+=" "+this.pad("PROGRAM:"),this.padding++,_+=this.accept(q.program),this.padding--,this.pad("{{> "+_+" }}")};a8.prototype.ContentStatement=function(q){return this.pad("CONTENT[ '"+q.value+"' ]")};a8.prototype.CommentStatement=function(q){return this.pad("{{! '"+q.value+"' }}")};a8.prototype.SubExpression=function(q){var _=q.params,j=[],K=void 0;for(var f=0,Y=_.length;f<Y;f++)j.push(this.accept(_[f]));return _="["+j.join(", ")+"]",K=q.hash?" "+this.accept(q.hash):"",this.accept(q.path)+" "+_+K};a8.prototype.PathExpression=function(q){var _=q.parts.join("/");return(q.data?"@":"")+"PATH:"+_};a8.prototype.StringLiteral=function(q){return'"'+q.value+'"'};a8.prototype.NumberLiteral=function(q){return"NUMBER{"+q.value+"}"};a8.prototype.BooleanLiteral=function(q){return"BOOLEAN{"+q.value+"}"};a8.prototype.UndefinedLiteral=function(){return"UNDEFINED"};a8.prototype.NullLiteral=function(){return"NULL"};a8.prototype.Hash=function(q){var _=q.pairs,j=[];for(var K=0,f=_.length;K<f;K++)j.push(this.accept(_[K]));return"HASH{"+j.join(", ")+"}"};a8.prototype.HashPair=function(q){return q.key+"="+this.accept(q.value)}});var U4=q8((BC,d1)=>{var F3=m1().default,y1=I1();F3.PrintVisitor=y1.PrintVisitor;F3.print=y1.print;d1.exports=F3;function g1(q,_){var j=D6("fs"),K=j.readFileSync(_,"utf8");q.exports=F3.compile(K)}if(D6.extensions)D6.extensions[".handlebars"]=g1,D6.extensions[".hbs"]=g1});function Q4(q){try{let _=q instanceof Date?q:new Date(q),K=new Date().getTime()-_.getTime(),f=Math.floor(K/1000),Y=Math.floor(f/60),P=Math.floor(Y/60),$=Math.floor(P/24),O=Math.floor($/7),w=Math.floor($/30);if(f<60)return"Just now";else if(Y<60)return Y===1?"1 minute ago":`${Y} minutes ago`;else if(P<24)return P===1?"1 hour ago":`${P} hours ago`;else if($===1)return"Yesterday";else if($<7)return`${$} days ago`;else if(O===1)return"1 week ago";else if(O<4)return`${O} weeks ago`;else if(w===1)return"1 month ago";else if(w<12)return`${w} months ago`;else{let v=Math.floor(w/12);return v===1?"1 year ago":`${v} years ago`}}catch(_){return"Recently"}}function p1(q){let _=["timestamp","created_at","date","time"];for(let j of _)if(q[j])try{let K=new Date(q[j]);if(!isNaN(K.getTime()))return K}catch{continue}return null}function B_(){let q=process.env.CLAUDE_MEM_WRAP_WIDTH;if(q){let _=parseInt(q,10);if(!Number.isNaN(_)&&_>40&&_<=200)return _}return 80}function sH(q,_){if(!q)return"";if(/^[\-=\u2014_\u2500\u2550]{5,}$/.test(q.trim()))return q;if(q.length<=_)return q;let j=q.match(/^\s*/),K=j?j[0]:"",f=q.slice(K.length),Y=Math.max(10,_-K.length),P=f.split(/(\s+)/),$=[],O="",w=()=>{$.push(K+O.trimEnd()),O=""};for(let v of P){if(v==="")continue;if(!/\s/.test(v)&&v.length>Y){if(O.trim().length>0)w();let z=0;while(z<v.length){let W=v.slice(z,z+Y);$.push(K+W),z+=Y}O="";continue}if(K.length+O.length+v.length>_)w();O+=v}if(O.trim().length>0||$.length===0)w();return $.join(`
50
+ `)}function d6(q,_){if(!q)return"";return q.split(`
51
+ `).map((j)=>sH(j,_)).join(`
52
+ `)}function q2(q="",_=B_()){if(!q||q.length===0)q="-";return q.repeat(_).slice(0,_)}function L1(q){let _={searching:"\uD83D\uDD0D Searching previous memories...",loading:"\uD83D\uDCDA Loading relevant context...",formatting:"✨ Organizing memories for display...",compressing:"\uD83D\uDDDC️ Compressing session transcript...",archiving:"\uD83D\uDCE6 Archiving conversation..."},j=B_();return d6(_[q]||`⏳ ${q}...`,j)}function U3(q,_,j){let K=_!==void 0?` (${_} items)`:"",f=j?`
53
+ ${j}`:"",Y=B_();return d6(`✅ ${q} completed successfully${K}${f}`,Y)}function t_(q,_,j){let K=j?`
54
+
55
+ \uD83D\uDCA1 ${j}`:"",f=B_();return d6(`❌ ${q} encountered an issue: ${_}${K}`,f)}function oK(q,..._){let j=_T[q](..._);return t_("Memory system",j.message,j.suggestion)}function l1(q){let _=typeof q==="string"?new Date(q):q,K=new Date().getTime()-_.getTime(),f=Math.floor(K/60000),Y=Math.floor(K/3600000),P=Math.floor(K/86400000);if(f<1)return"just now";if(f<60)return`${f} minute${f>1?"s":""} ago`;if(Y<24)return`${Y} hour${Y>1?"s":""} ago`;if(P<7)return`${P} day${P>1?"s":""} ago`;return _.toLocaleDateString()}function x1(q,_){let{count:j,duration:K,details:f}=_,Y=K?` in ${K}ms`:"",P=f?` - ${f}`:"",$={compress:`Compressed ${j} conversation turns${Y}${P}`,load:`Loaded ${j} relevant memories${Y}${P}`,search:`Found ${j} matching memories${Y}${P}`,archive:`Archived ${j} conversation segments${Y}${P}`},O=B_();return d6(`\uD83D\uDCCA ${$[q]}`,O)}function KT(q,_=3,j){let K=q.filter((P)=>P.type==="overview");if(K.length===0)return[];let f=K;if(j){if(f=K.filter((P)=>P.project===j),f.length===0)f=K}return f.slice(-_).map((P)=>{let $={content:P.content||"",sessionId:P.sessionId||P.session_id||"unknown"},O=p1(P);if(O)$.timestamp=O,$.timeAgo=Q4(O);else $.timeAgo="Recently";return $})}function jT(q){if(q.length===0)return[];return q.filter((_)=>_.type==="memory").map((_)=>{let j={summary:_.text||"",sessionId:_.session_id||""};if(_.keywords)j.keywords=_.keywords;if(_.document_id&&!_.document_id.includes("Session:"))j.location=_.document_id;return j}).filter((_)=>_.summary.length>0)}function PT(q){let _=new Map;return q.forEach((j)=>{let K=j.sessionId;if(K){if(!_.has(K))_.set(K,[]);_.get(K).push(j)}}),Array.from(_.entries()).map(([j,K])=>{let f=K.map((Y,P)=>({...Y,number:P+1}));return{sessionId:j,memories:f}})}function fT(q){let _=new Map;return q.forEach((j)=>{let K=j.sessionId||"unknown";if(!_.has(K))_.set(K,[]);_.get(K).push(j)}),Array.from(_.entries()).map(([j,K])=>{let f=K.map((P)=>P.timestamp).filter((P)=>P!==void 0).sort((P,$)=>P.getTime()-$.getTime()),Y={sessionId:j,overviews:K};if(f.length>0)Y.earliestTimestamp=f[0],Y.timeAgo=Q4(f[0]);return Y})}function n1(q){let{projectName:_,memoryCount:j,lastSessionTime:K,recentObjects:f}=q,Y=B_(),P=KT(f,10,_),$=jT(f),O=(w,v)=>{let z=w.includes(",")||w.includes(`
56
+ `)?w.split(/[\n,]+/):[w];for(let W of z){let H=W.trim();if(!H)continue;let Z=H.toLowerCase();if(!v.has(Z))v.set(Z,H)}};if($.length>0){let w=PT($);console.log(""),console.log(""),console.log(d6("\uD83D\uDCDA Memories",Y)),w.forEach((v)=>{console.log(q2("─",Y)),console.log(""),console.log(d6(`\uD83D\uDD0D ${v.sessionId}`,Y));let z=new Map;v.memories.forEach((H)=>{if(console.log(""),console.log(d6(`${H.number}. ${H.summary}`,Y)),H.keywords)O(H.keywords,z)});let W=Array.from(z.values());if(W.length>0)console.log(""),console.log(d6(`\uD83C\uDFF7️ ${W.join(", ")}`,Y));console.log("")})}if(P.length>0){let w=fT(P);console.log(""),console.log(d6("\uD83E\uDDE0 Overviews",Y)),console.log(q2("─",Y)),w.forEach((v)=>{console.log(""),console.log(d6(`\uD83D\uDD0D ${v.sessionId}`,Y)),v.overviews.forEach((z,W)=>{if(console.log(""),console.log(d6(`${W+1}. ${z.content}`,Y)),console.log(""),z.timeAgo)console.log(d6(`\uD83D\uDCC5 ${z.timeAgo}`,Y))}),console.log(""),console.log(q2("─",Y))})}else if($.length===0)console.log(d6(`\uD83E\uDDE0 No recent context found for ${_}`,Y))}var _2,QH=`\uD83E\uDDE0 What's new: {{dateTime}}
53
57
  ====================================================================
54
58
  {{#if overview}}{{overview}}{{/if}}
55
59
 
@@ -73,7 +77,7 @@ No relevant memories found - this appears to be your first session or a new proj
73
77
  • Start working and memories will be automatically created
74
78
  • At the end of your session, ask to compress and store the conversation
75
79
  • Next time you return, relevant context will be loaded automatically
76
- {{/if}}`,aH=`\uD83E\uDDE0 What's new: {{dateTime}}
80
+ {{/if}}`,qT=`\uD83E\uDDE0 What's new: {{dateTime}}
77
81
  ====================================================================
78
82
  {{#if hasOverviews}}
79
83
  {{#each overviews}}
@@ -101,13 +105,13 @@ This appears to be your first session. Context will be automatically captured as
101
105
  {{/each}}
102
106
  ======================================================================
103
107
  {{/each}}
104
- END-CONTEXT-DATA -->{{/if}}`,xC,nC,BH;var e4=Q8(()=>{t4=B6(a4(),1),xC=t4.default.compile(oH,{noEscape:!0}),nC=t4.default.compile(aH,{noEscape:!0});BH={NO_MEMORIES:(q)=>({message:`No previous memories found for ${q}`,suggestion:"This appears to be your first session. Memories will be created as you work."}),CONNECTION_FAILED:()=>({message:"Could not connect to memory system",suggestion:"Try restarting Claude Code or check if the MCP server is properly configured."}),SEARCH_FAILED:(q)=>({message:`Search for "${q}" didn't return any results`,suggestion:"Try using different keywords or check if memories exist for this project."}),LOAD_TIMEOUT:()=>({message:"Memory loading timed out",suggestion:"The operation is taking longer than expected. You can continue without loaded context."})}});import{join as L1}from"path";import{fileURLToPath as pT}from"url";import{setMaxListeners as LT}from"events";import{spawn as xT}from"child_process";import{createInterface as nT}from"readline";import*as J8 from"fs";import{stat as cT}from"fs/promises";function t1(q=lT){let _=new AbortController;return LT(q,_.signal),_}function oT(){return iT}class e1{options;child;childStdin;childStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(q){this.options=q,this.abortController=q.abortController||t1(),this.initialize()}initialize(){try{let{prompt:q,additionalDirectories:_=[],cwd:j,executable:K=this.isRunningWithBun()?"bun":"node",executableArgs:Y=[],extraArgs:f={},pathToClaudeCodeExecutable:P,env:$={...process.env},stderr:O,customSystemPrompt:w,appendSystemPrompt:v,maxTurns:z,model:W,fallbackModel:J,permissionMode:Z,permissionPromptToolName:H,continueConversation:X,resume:A,allowedTools:G=[],disallowedTools:D=[],mcpServers:M,strictMcpConfig:g,canUseTool:S}=this.options,b=["--output-format","stream-json","--verbose"];if(w)b.push("--system-prompt",w);if(v)b.push("--append-system-prompt",v);if(z)b.push("--max-turns",z.toString());if(W)b.push("--model",W);if($.DEBUG)b.push("--debug-to-stderr");if(S){if(typeof q==="string")throw new Error("canUseTool callback requires --input-format stream-json. Please set prompt as an AsyncIterable.");if(H)throw new Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");b.push("--permission-prompt-tool","stdio")}else if(H)b.push("--permission-prompt-tool",H);if(X)b.push("--continue");if(A)b.push("--resume",A);if(G.length>0)b.push("--allowedTools",G.join(","));if(D.length>0)b.push("--disallowedTools",D.join(","));if(M&&Object.keys(M).length>0)b.push("--mcp-config",JSON.stringify({mcpServers:M}));if(g)b.push("--strict-mcp-config");if(Z&&Z!=="default")b.push("--permission-mode",Z);if(J){if(W&&J===W)throw new Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");b.push("--fallback-model",J)}if(typeof q==="string")b.push("--print"),b.push("--",q.trim());else b.push("--input-format","stream-json");for(let y of _)b.push("--add-dir",y);for(let[y,i]of Object.entries(f))if(i===null)b.push(`--${y}`);else b.push(`--${y}`,i);if(!$.CLAUDE_CODE_ENTRYPOINT)$.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(!oT().existsSync(P)){let y=l1(P)?`Claude Code native binary not found at ${P}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${P}. Is options.pathToClaudeCodeExecutable set?`;throw new ReferenceError(y)}let p=l1(P),r=p?P:K,l=p?b:[...Y,P,...b];this.logDebug(p?`Spawning Claude Code native binary: ${P} ${b.join(" ")}`:`Spawning Claude Code process: ${K} ${[...Y,P,...b].join(" ")}`);let R=$.DEBUG||O?"pipe":"ignore";if(this.child=xT(r,l,{cwd:j,stdio:["pipe","pipe",R],signal:this.abortController.signal,env:$}),this.childStdin=this.child.stdin,this.childStdout=this.child.stdout,typeof q==="string")this.childStdin.end(),this.childStdin=void 0;if($.DEBUG||O)this.child.stderr.on("data",(y)=>{if(this.logDebug(`Claude Code stderr: ${y.toString()}`),O)O(y.toString())});let m=()=>{if(this.child&&!this.child.killed)this.child.kill("SIGTERM")};this.processExitHandler=m,this.abortHandler=m,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.child.on("error",(y)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new a_("Claude Code process aborted by user");else this.exitError=new Error(`Failed to spawn Claude Code process: ${y.message}`),this.logDebug(this.exitError.message)}),this.child.on("close",(y,i)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new a_("Claude Code process aborted by user");else{let t=this.getProcessExitError(y,i);if(t)this.exitError=t,this.logDebug(t.message)}}),this.ready=!0}catch(q){throw this.ready=!1,q}}getProcessExitError(q,_){if(q!==0&&q!==null)return new Error(`Claude Code process exited with code ${q}`);else if(_)return new Error(`Claude Code process terminated by signal ${_}`);return}isRunningWithBun(){return process.versions.bun!==void 0||process.env.BUN_INSTALL!==void 0}logDebug(q){if(process.env.DEBUG)process.stderr.write(`${q}
105
- `)}write(q){if(this.abortController.signal.aborted)throw new a_("Operation aborted");if(!this.ready||!this.childStdin)throw new Error("ProcessTransport is not ready for writing");if(this.child?.killed||this.child?.exitCode!==null)throw new Error("Cannot write to terminated process");if(this.exitError)throw new Error(`Cannot write to process that exited with error: ${this.exitError.message}`);if(process.env.DEBUG_SDK)process.stderr.write(`[ProcessTransport] Writing to stdin: ${q.substring(0,100)}
106
- `);try{if(!this.childStdin.write(q)&&process.env.DEBUG_SDK)console.warn("[ProcessTransport] Write buffer full, data queued")}catch(_){throw this.ready=!1,new Error(`Failed to write to process stdin: ${_.message}`)}}close(){if(this.childStdin)this.childStdin.end(),this.childStdin=void 0;if(this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;for(let{handler:q}of this.exitListeners)this.child?.off("exit",q);if(this.exitListeners=[],this.child&&!this.child.killed)this.child.kill("SIGTERM"),setTimeout(()=>{if(this.child&&!this.child.killed)this.child.kill("SIGKILL")},5000);this.ready=!1}isReady(){return this.ready}async*readMessages(){if(!this.childStdout)throw new Error("ProcessTransport output stream not available");let q=nT({input:this.childStdout});try{for await(let _ of q)if(_.trim())yield JSON.parse(_);await this.waitForExit()}catch(_){throw _}finally{q.close()}}endInput(){if(this.childStdin)this.childStdin.end()}getInputStream(){return this.childStdin}onExit(q){if(!this.child)return()=>{};let _=(j,K)=>{let Y=this.getProcessExitError(j,K);q(Y)};return this.child.on("exit",_),this.exitListeners.push({callback:q,handler:_}),()=>{if(this.child)this.child.off("exit",_);let j=this.exitListeners.findIndex((K)=>K.handler===_);if(j!==-1)this.exitListeners.splice(j,1)}}async waitForExit(){if(!this.child){if(this.exitError)throw this.exitError;return}if(this.child.exitCode!==null||this.child.killed){if(this.exitError)throw this.exitError;return}return new Promise((q,_)=>{let j=(Y,f)=>{if(this.abortController.signal.aborted){_(new a_("Operation aborted"));return}let P=this.getProcessExitError(Y,f);if(P)_(P);else q()};this.child.once("exit",j);let K=(Y)=>{this.child.off("exit",j),_(Y)};this.child.once("error",K),this.child.once("exit",()=>{this.child.off("error",K)})})}}function l1(q){return![".js",".mjs",".tsx",".ts",".jsx"].some((j)=>q.endsWith(j))}class U1{sendMcpMessage;isClosed=!1;constructor(q){this.sendMcpMessage=q}onclose;onerror;onmessage;async start(){}async send(q){if(this.isClosed)throw new Error("Transport is closed");this.sendMcpMessage(q)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}function tT(q){Q1=q}function B3(){return Q1}function F(q,_){let j=B3(),K=t3({issueData:_,data:q.data,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,j,j===e_?void 0:e_].filter((Y)=>!!Y)});q.common.issues.push(K)}class Z6{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(q,_){let j=[];for(let K of _){if(K.status==="aborted")return O8;if(K.status==="dirty")q.dirty();j.push(K.value)}return{status:q.value,value:j}}static async mergeObjectAsync(q,_){let j=[];for(let K of _){let Y=await K.key,f=await K.value;j.push({key:Y,value:f})}return Z6.mergeObjectSync(q,j)}static mergeObjectSync(q,_){let j={};for(let K of _){let{key:Y,value:f}=K;if(Y.status==="aborted")return O8;if(f.status==="aborted")return O8;if(Y.status==="dirty")q.dirty();if(f.status==="dirty")q.dirty();if(Y.value!=="__proto__"&&(typeof f.value!=="undefined"||K.alwaysSet))j[Y.value]=f.value}return{status:q.value,value:j}}}class Oq{constructor(q,_,j,K){this._cachedPath=[],this.parent=q,this.data=_,this._path=j,this._key=K}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 Z8(q){if(!q)return{};let{errorMap:_,invalid_type_error:j,required_error:K,description:Y}=q;if(_&&(j||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(_)return{errorMap:_,description:Y};return{errorMap:(P,$)=>{let{message:O}=q;if(P.code==="invalid_enum_value")return{message:O??$.defaultError};if(typeof $.data==="undefined")return{message:O??K??$.defaultError};if(P.code!=="invalid_type")return{message:$.defaultError};return{message:O??j??$.defaultError}},description:Y}}class k8{get description(){return this._def.description}_getType(q){return dq(q.data)}_getOrReturnCtx(q,_){return _||{common:q.parent.common,data:q.data,parsedType:dq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}_processInputParams(q){return{status:new Z6,ctx:{common:q.parent.common,data:q.data,parsedType:dq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}}_parseSync(q){let _=this._parse(q);if(nK(_))throw new Error("Synchronous parse encountered promise.");return _}_parseAsync(q){let _=this._parse(q);return Promise.resolve(_)}parse(q,_){let j=this.safeParse(q,_);if(j.success)return j.data;throw j.error}safeParse(q,_){let j={common:{issues:[],async:_?.async??!1,contextualErrorMap:_?.errorMap},path:_?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:dq(q)},K=this._parseSync({data:q,path:j.path,parent:j});return x1(j,K)}"~validate"(q){let _={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:dq(q)};if(!this["~standard"].async)try{let j=this._parseSync({data:q,path:[],parent:_});return z_(j)?{value:j.value}:{issues:_.common.issues}}catch(j){if(j?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;_.common={issues:[],async:!0}}return this._parseAsync({data:q,path:[],parent:_}).then((j)=>z_(j)?{value:j.value}:{issues:_.common.issues})}async parseAsync(q,_){let j=await this.safeParseAsync(q,_);if(j.success)return j.data;throw j.error}async safeParseAsync(q,_){let j={common:{issues:[],contextualErrorMap:_?.errorMap,async:!0},path:_?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:dq(q)},K=this._parse({data:q,path:j.path,parent:j}),Y=await(nK(K)?K:Promise.resolve(K));return x1(j,Y)}refine(q,_){let j=(K)=>{if(typeof _==="string"||typeof _==="undefined")return{message:_};else if(typeof _==="function")return _(K);else return _};return this._refinement((K,Y)=>{let f=q(K),P=()=>Y.addIssue({code:e.custom,...j(K)});if(typeof Promise!=="undefined"&&f instanceof Promise)return f.then(($)=>{if(!$)return P(),!1;else return!0});if(!f)return P(),!1;else return!0})}refinement(q,_){return this._refinement((j,K)=>{if(!q(j))return K.addIssue(typeof _==="function"?_(j,K):_),!1;else return!0})}_refinement(q){return new F6({schema:this,typeName:z8.ZodEffects,effect:{type:"refinement",refinement:q}})}superRefine(q){return this._refinement(q)}constructor(q){this.spa=this.safeParseAsync,this._def=q,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:(_)=>this["~validate"](_)}}optional(){return wq.create(this,this._def)}nullable(){return pq.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $q.create(this)}promise(){return T_.create(this,this._def)}or(q){return Q_.create([this,q],this._def)}and(q){return qK.create(this,q,this._def)}transform(q){return new F6({...Z8(this._def),schema:this,typeName:z8.ZodEffects,effect:{type:"transform",transform:q}})}default(q){let _=typeof q==="function"?q:()=>q;return new PK({...Z8(this._def),innerType:this,defaultValue:_,typeName:z8.ZodDefault})}brand(){return new F3({typeName:z8.ZodBranded,type:this,...Z8(this._def)})}catch(q){let _=typeof q==="function"?q:()=>q;return new YK({...Z8(this._def),innerType:this,catchValue:_,typeName:z8.ZodCatch})}describe(q){return new this.constructor({...this._def,description:q})}pipe(q){return BK.create(this,q)}readonly(){return fK.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function _P(q){let _="[0-5]\\d";if(q.precision)_=`${_}\\.\\d{${q.precision}}`;else if(q.precision==null)_=`${_}(\\.\\d+)?`;let j=q.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${_})${j}`}function WZ(q){return new RegExp(`^${_P(q)}$`)}function KP(q){let _=`${qP}T${_P(q)}`,j=[];if(j.push(q.local?"Z?":"Z"),q.offset)j.push("([+-]\\d{2}:?\\d{2})");return _=`${_}(${j.join("|")})`,new RegExp(`^${_}$`)}function JZ(q,_){if((_==="v4"||!_)&&YZ.test(q))return!0;if((_==="v6"||!_)&&$Z.test(q))return!0;return!1}function HZ(q,_){if(!_Z.test(q))return!1;try{let[j]=q.split(".");if(!j)return!1;let K=j.replace(/-/g,"+").replace(/_/g,"/").padEnd(j.length+(4-j.length%4)%4,"="),Y=JSON.parse(atob(K));if(typeof Y!=="object"||Y===null)return!1;if("typ"in Y&&Y?.typ!=="JWT")return!1;if(!Y.alg)return!1;if(_&&Y.alg!==_)return!1;return!0}catch{return!1}}function TZ(q,_){if((_==="v4"||!_)&&fZ.test(q))return!0;if((_==="v6"||!_)&&wZ.test(q))return!0;return!1}function ZZ(q,_){let j=(q.toString().split(".")[1]||"").length,K=(_.toString().split(".")[1]||"").length,Y=j>K?j:K,f=Number.parseInt(q.toFixed(Y).replace(".","")),P=Number.parseInt(_.toFixed(Y).replace(".",""));return f%P/10**Y}function o_(q){if(q instanceof r8){let _={};for(let j in q.shape){let K=q.shape[j];_[j]=wq.create(o_(K))}return new r8({...q._def,shape:()=>_})}else if(q instanceof $q)return new $q({...q._def,type:o_(q.element)});else if(q instanceof wq)return wq.create(o_(q.unwrap()));else if(q instanceof pq)return pq.create(o_(q.unwrap()));else if(q instanceof hq)return hq.create(q.items.map((_)=>o_(_)));else return q}function _2(q,_){let j=dq(q),K=dq(_);if(q===_)return{valid:!0,data:q};else if(j===Q.object&&K===Q.object){let Y=u8.objectKeys(_),f=u8.objectKeys(q).filter(($)=>Y.indexOf($)!==-1),P={...q,..._};for(let $ of f){let O=_2(q[$],_[$]);if(!O.valid)return{valid:!1};P[$]=O.data}return{valid:!0,data:P}}else if(j===Q.array&&K===Q.array){if(q.length!==_.length)return{valid:!1};let Y=[];for(let f=0;f<q.length;f++){let P=q[f],$=_[f],O=_2(P,$);if(!O.valid)return{valid:!1};Y.push(O.data)}return{valid:!0,data:Y}}else if(j===Q.date&&K===Q.date&&+q===+_)return{valid:!0,data:q};else return{valid:!1}}function jP(q,_){return new eq({values:q,typeName:z8.ZodEnum,...Z8(_)})}function n1(q,_){let j=typeof q==="function"?q(_):typeof q==="string"?{message:q}:q;return typeof j==="string"?{message:j}:j}function PP(q,_={},j){if(q)return J_.create().superRefine((K,Y)=>{let f=q(K);if(f instanceof Promise)return f.then((P)=>{if(!P){let $=n1(_,K),O=$.fatal??j??!0;Y.addIssue({code:"custom",...$,fatal:O})}});if(!f){let P=n1(_,K),$=P.fatal??j??!0;Y.addIssue({code:"custom",...P,fatal:$})}return});return J_.create()}function $X(q){if(!q)return{};let{errorMap:_,invalid_type_error:j,required_error:K,description:Y}=q;if(_&&(j||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(_)return{errorMap:_,description:Y};return{errorMap:(P,$)=>{var O,w;let{message:v}=q;if(P.code==="invalid_enum_value")return{message:v!==null&&v!==void 0?v:$.defaultError};if(typeof $.data==="undefined")return{message:(O=v!==null&&v!==void 0?v:K)!==null&&O!==void 0?O:$.defaultError};if(P.code!=="invalid_type")return{message:$.defaultError};return{message:(w=v!==null&&v!==void 0?v:j)!==null&&w!==void 0?w:$.defaultError}},description:Y}}function z2({prompt:q,options:{abortController:_=t1(),additionalDirectories:j=[],allowedTools:K=[],appendSystemPrompt:Y,canUseTool:f,continue:P,customSystemPrompt:$,cwd:O,disallowedTools:w=[],env:v,executable:z=wX()?"bun":"node",executableArgs:W=[],extraArgs:J={},fallbackModel:Z,hooks:H,maxTurns:X,mcpServers:A,model:G,pathToClaudeCodeExecutable:D,permissionMode:M="default",permissionPromptToolName:g,resume:S,stderr:b,strictMcpConfig:d}={}}){if(!v)v={...process.env};if(!v.CLAUDE_CODE_ENTRYPOINT)v.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(D===void 0){let y=pT(import.meta.url),i=L1(y,"..");D=L1(i,"cli.js")}let p={},r=new Map;if(A)for(let[y,i]of Object.entries(A))if(i.type==="sdk")r.set(y,i.instance),p[y]={type:"sdk",name:y};else p[y]=i;let l=typeof q!=="string",R=new e1({prompt:q,abortController:_,additionalDirectories:j,cwd:O,executable:z,executableArgs:W,extraArgs:J,pathToClaudeCodeExecutable:D,env:v,stderr:b,customSystemPrompt:$,appendSystemPrompt:Y,maxTurns:X,model:G,fallbackModel:Z,permissionMode:M,permissionPromptToolName:g,continueConversation:P,resume:S,allowedTools:K,disallowedTools:w,mcpServers:A,strictMcpConfig:d,canUseTool:!!f,hooks:!!H}),m=new s1(R,l,f,H,_,r);if(typeof q!=="string")m.streamInput(q);return m}function wX(){return process.versions.bun!==void 0||process.env.BUN_INSTALL!==void 0}var UH,sH,U4,QH,qT,_T=(q,_,j)=>{j=q!=null?UH(sH(q)):{};let K=_||!q||!q.__esModule?U4(j,"default",{value:q,enumerable:!0}):j;for(let Y of QH(q))if(!qT.call(K,Y))U4(K,Y,{get:()=>q[Y],enumerable:!0});return K},H8=(q,_)=>()=>(_||q((_={exports:{}}).exports,_),_.exports),KT=(q,_)=>{for(var j in _)U4(q,j,{get:_[j],enumerable:!0,configurable:!0,set:(K)=>_[j]=()=>K})},jT,P2,PT,$K,i1,YT,Y2,f2,o1,a1,fT,$T,wT,OT,vT,zT,WT,JT,HT,TT,ZT,kT,XT,AT,g1,y1,d1,p1,GT,uT,hT,DT,CT,VT,MT,NT,bT,ST,ET,RT,mT,B1,IT,gT,yT,dT,lT=50,rT,iT,a_,F1,s1,k,u8,s4,Q,dq=(q)=>{switch(typeof q){case"undefined":return Q.undefined;case"string":return Q.string;case"number":return Number.isNaN(q)?Q.nan:Q.number;case"boolean":return Q.boolean;case"function":return Q.function;case"bigint":return Q.bigint;case"symbol":return Q.symbol;case"object":if(Array.isArray(q))return Q.array;if(q===null)return Q.null;if(q.then&&typeof q.then==="function"&&q.catch&&typeof q.catch==="function")return Q.promise;if(typeof Map!=="undefined"&&q instanceof Map)return Q.map;if(typeof Set!=="undefined"&&q instanceof Set)return Q.set;if(typeof Date!=="undefined"&&q instanceof Date)return Q.date;return Q.object;default:return Q.unknown}},e,aT=(q)=>{return JSON.stringify(q,null,2).replace(/"([^"]+)":/g,"$1:")},d6,BT=(q,_)=>{let j;switch(q.code){case e.invalid_type:if(q.received===Q.undefined)j="Required";else j=`Expected ${q.expected}, received ${q.received}`;break;case e.invalid_literal:j=`Invalid literal value, expected ${JSON.stringify(q.expected,u8.jsonStringifyReplacer)}`;break;case e.unrecognized_keys:j=`Unrecognized key(s) in object: ${u8.joinValues(q.keys,", ")}`;break;case e.invalid_union:j="Invalid input";break;case e.invalid_union_discriminator:j=`Invalid discriminator value. Expected ${u8.joinValues(q.options)}`;break;case e.invalid_enum_value:j=`Invalid enum value. Expected ${u8.joinValues(q.options)}, received '${q.received}'`;break;case e.invalid_arguments:j="Invalid function arguments";break;case e.invalid_return_type:j="Invalid function return type";break;case e.invalid_date:j="Invalid date";break;case e.invalid_string:if(typeof q.validation==="object")if("includes"in q.validation){if(j=`Invalid input: must include "${q.validation.includes}"`,typeof q.validation.position==="number")j=`${j} at one or more positions greater than or equal to ${q.validation.position}`}else if("startsWith"in q.validation)j=`Invalid input: must start with "${q.validation.startsWith}"`;else if("endsWith"in q.validation)j=`Invalid input: must end with "${q.validation.endsWith}"`;else u8.assertNever(q.validation);else if(q.validation!=="regex")j=`Invalid ${q.validation}`;else j="Invalid";break;case e.too_small:if(q.type==="array")j=`Array must contain ${q.exact?"exactly":q.inclusive?"at least":"more than"} ${q.minimum} element(s)`;else if(q.type==="string")j=`String must contain ${q.exact?"exactly":q.inclusive?"at least":"over"} ${q.minimum} character(s)`;else if(q.type==="number")j=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="bigint")j=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="date")j=`Date must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(q.minimum))}`;else j="Invalid input";break;case e.too_big:if(q.type==="array")j=`Array must contain ${q.exact?"exactly":q.inclusive?"at most":"less than"} ${q.maximum} element(s)`;else if(q.type==="string")j=`String must contain ${q.exact?"exactly":q.inclusive?"at most":"under"} ${q.maximum} character(s)`;else if(q.type==="number")j=`Number must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="bigint")j=`BigInt must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="date")j=`Date must be ${q.exact?"exactly":q.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(q.maximum))}`;else j="Invalid input";break;case e.custom:j="Invalid input";break;case e.invalid_intersection_types:j="Intersection results could not be merged";break;case e.not_multiple_of:j=`Number must be a multiple of ${q.multipleOf}`;break;case e.not_finite:j="Number must be finite";break;default:j=_.defaultError,u8.assertNever(q)}return{message:j}},e_,Q1,t3=(q)=>{let{data:_,path:j,errorMaps:K,issueData:Y}=q,f=[...j,...Y.path||[]],P={...Y,path:f};if(Y.message!==void 0)return{...Y,path:f,message:Y.message};let $="",O=K.filter((w)=>!!w).slice().reverse();for(let w of O)$=w(P,{data:_,defaultError:$}).message;return{...Y,path:f,message:$}},eT,O8,B_=(q)=>({status:"dirty",value:q}),C6=(q)=>({status:"valid",value:q}),Q4=(q)=>q.status==="aborted",q2=(q)=>q.status==="dirty",z_=(q)=>q.status==="valid",nK=(q)=>typeof Promise!=="undefined"&&q instanceof Promise,j8,x1=(q,_)=>{if(z_(_))return{success:!0,data:_.value};else{if(!q.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let j=new d6(q.common.issues);return this._error=j,this._error}}}},FT,UT,sT,QT,qZ,_Z,KZ,jZ,PZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",F4,YZ,fZ,$Z,wZ,OZ,vZ,qP="((\\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])))",zZ,fq,Bq,tq,F_,W_,cK,U_,s_,J_,aq,uq,rK,$q,r8,Q_,yq=(q)=>{if(q instanceof _K)return yq(q.schema);else if(q instanceof F6)return yq(q.innerType());else if(q instanceof KK)return[q.value];else if(q instanceof eq)return q.options;else if(q instanceof jK)return u8.objectValues(q.enum);else if(q instanceof PK)return yq(q._def.innerType);else if(q instanceof U_)return[void 0];else if(q instanceof s_)return[null];else if(q instanceof wq)return[void 0,...yq(q.unwrap())];else if(q instanceof pq)return[null,...yq(q.unwrap())];else if(q instanceof F3)return yq(q.unwrap());else if(q instanceof fK)return yq(q.unwrap());else if(q instanceof YK)return yq(q._def.innerType);else return[]},e3,qK,hq,iK,oK,H_,t_,_K,KK,eq,jK,T_,F6,wq,pq,PK,YK,aK,kZ,F3,BK,fK,XZ,z8,AZ=(q,_={message:`Input not instance of ${q.name}`})=>PP((j)=>j instanceof q,_),YP,fP,GZ,uZ,$P,hZ,DZ,CZ,VZ,MZ,NZ,bZ,SZ,EZ,RZ,mZ,IZ,gZ,yZ,dZ,pZ,LZ,lZ,xZ,nZ,cZ,rZ,iZ,oZ,c1,aZ,BZ,tZ,eZ,FZ=()=>YP().optional(),UZ=()=>fP().optional(),sZ=()=>$P().optional(),QZ,qk,U3="2.0",wP,OP,_k,U6,R6,tK,Dq,s6,s3,Kk,jk,Pk,r1,Yk,eC,vP,zP,eK,WP,fk,$k,wk,Ok,vk,JP,zk,HP,Q3,q7,TP,ZP,$2,kP,XP,Wk,Jk,Hk,Tk,Zk,kk,Xk,Ak,Gk,uk,hk,Dk,Ck,Vk,Mk,Nk,w2,O2,v2,bk,Sk,AP,Ek,Rk,mk,Ik,gk,yk,dk,GP,FC,pk,Lk,uP,lk,xk,nk,ck,rk,ik,ok,ak,Bk,tk,ek,Fk,Uk,sk,Qk,qX,_X,KX,jX,PX,YX,fX,UC,sC,QC,qV,_V,KV,jV,PV,YV,K2,j2;var hP=Q8(()=>{UH=Object.create,sH=Object.getPrototypeOf,U4=Object.defineProperty,QH=Object.getOwnPropertyNames,qT=Object.prototype.hasOwnProperty,jT=H8((q,_)=>{(function(j,K){typeof q==="object"&&typeof _!=="undefined"?K(q):typeof define==="function"&&define.amd?define(["exports"],K):K(j.URI=j.URI||{})})(q,function(j){function K(){for(var N=arguments.length,u=Array(N),E=0;E<N;E++)u[E]=arguments[E];if(u.length>1){u[0]=u[0].slice(0,-1);var L=u.length-1;for(var n=1;n<L;++n)u[n]=u[n].slice(1,-1);return u[L]=u[L].slice(1),u.join("")}else return u[0]}function Y(N){return"(?:"+N+")"}function f(N){return N===void 0?"undefined":N===null?"null":Object.prototype.toString.call(N).split(" ").pop().split("]").shift().toLowerCase()}function P(N){return N.toUpperCase()}function $(N){return N!==void 0&&N!==null?N instanceof Array?N:typeof N.length!=="number"||N.split||N.setInterval||N.call?[N]:Array.prototype.slice.call(N):[]}function O(N,u){var E=N;if(u)for(var L in u)E[L]=u[L];return E}function w(N){var u="[A-Za-z]",E="[\\x0D]",L="[0-9]",n="[\\x22]",s=K(L,"[A-Fa-f]"),X8="[\\x0A]",D8="[\\x20]",b8=Y(Y("%[EFef]"+s+"%"+s+s+"%"+s+s)+"|"+Y("%[89A-Fa-f]"+s+"%"+s+s)+"|"+Y("%"+s+s)),U8="[\\:\\/\\?\\#\\[\\]\\@]",G8="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",n8=K(U8,G8),s8=N?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",d8=N?"[\\uE000-\\uF8FF]":"[]",M8=K(u,L,"[\\-\\.\\_\\~]",s8),c8=Y(u+K(u,L,"[\\+\\-\\.]")+"*"),S8=Y(Y(b8+"|"+K(M8,G8,"[\\:]"))+"*"),j_=Y(Y("25[0-5]")+"|"+Y("2[0-4]"+L)+"|"+Y("1"+L+L)+"|"+Y("[1-9]"+L)+"|"+L),I6=Y(Y("25[0-5]")+"|"+Y("2[0-4]"+L)+"|"+Y("1"+L+L)+"|"+Y("0?[1-9]"+L)+"|0?0?"+L),o6=Y(I6+"\\."+I6+"\\."+I6+"\\."+I6),m8=Y(s+"{1,4}"),g6=Y(Y(m8+"\\:"+m8)+"|"+o6),a6=Y(Y(m8+"\\:")+"{6}"+g6),Aq=Y("\\:\\:"+Y(m8+"\\:")+"{5}"+g6),P_=Y(Y(m8)+"?\\:\\:"+Y(m8+"\\:")+"{4}"+g6),Nq=Y(Y(Y(m8+"\\:")+"{0,1}"+m8)+"?\\:\\:"+Y(m8+"\\:")+"{3}"+g6),CK=Y(Y(Y(m8+"\\:")+"{0,2}"+m8)+"?\\:\\:"+Y(m8+"\\:")+"{2}"+g6),S3=Y(Y(Y(m8+"\\:")+"{0,3}"+m8)+"?\\:\\:"+m8+"\\:"+g6),E3=Y(Y(Y(m8+"\\:")+"{0,4}"+m8)+"?\\:\\:"+g6),S_=Y(Y(Y(m8+"\\:")+"{0,5}"+m8)+"?\\:\\:"+m8),E_=Y(Y(Y(m8+"\\:")+"{0,6}"+m8)+"?\\:\\:"),bq=Y([a6,Aq,P_,Nq,CK,S3,E3,S_,E_].join("|")),R_=Y(Y(M8+"|"+b8)+"+"),B7=Y(bq+"\\%25"+R_),Y_=Y(bq+Y("\\%25|\\%(?!"+s+"{2})")+R_),qw=Y("[vV]"+s+"+\\."+K(M8,G8,"[\\:]")+"+"),_w=Y("\\["+Y(Y_+"|"+bq+"|"+qw)+"\\]"),B9=Y(Y(b8+"|"+K(M8,G8))+"*"),VK=Y(_w+"|"+o6+"(?!"+B9+")|"+B9),MK=Y(L+"*"),t9=Y(Y(S8+"@")+"?"+VK+Y("\\:"+MK)+"?"),NK=Y(b8+"|"+K(M8,G8,"[\\:\\@]")),Kw=Y(NK+"*"),e9=Y(NK+"+"),jw=Y(Y(b8+"|"+K(M8,G8,"[\\@]"))+"+"),Sq=Y(Y("\\/"+Kw)+"*"),m_=Y("\\/"+Y(e9+Sq)+"?"),t7=Y(jw+Sq),R3=Y(e9+Sq),I_="(?!"+NK+")",yD=Y(Sq+"|"+m_+"|"+t7+"|"+R3+"|"+I_),g_=Y(Y(NK+"|"+K("[\\/\\?]",d8))+"*"),bK=Y(Y(NK+"|[\\/\\?]")+"*"),F9=Y(Y("\\/\\/"+t9+Sq)+"|"+m_+"|"+R3+"|"+I_),Pw=Y(c8+"\\:"+F9+Y("\\?"+g_)+"?"+Y("\\#"+bK)+"?"),Yw=Y(Y("\\/\\/"+t9+Sq)+"|"+m_+"|"+t7+"|"+I_),fw=Y(Yw+Y("\\?"+g_)+"?"+Y("\\#"+bK)+"?"),dD=Y(Pw+"|"+fw),pD=Y(c8+"\\:"+F9+Y("\\?"+g_)+"?"),LD="^("+c8+")\\:"+Y(Y("\\/\\/("+Y("("+S8+")@")+"?("+VK+")"+Y("\\:("+MK+")")+"?)")+"?("+Sq+"|"+m_+"|"+R3+"|"+I_+")")+Y("\\?("+g_+")")+"?"+Y("\\#("+bK+")")+"?$",lD="^(){0}"+Y(Y("\\/\\/("+Y("("+S8+")@")+"?("+VK+")"+Y("\\:("+MK+")")+"?)")+"?("+Sq+"|"+m_+"|"+t7+"|"+I_+")")+Y("\\?("+g_+")")+"?"+Y("\\#("+bK+")")+"?$",xD="^("+c8+")\\:"+Y(Y("\\/\\/("+Y("("+S8+")@")+"?("+VK+")"+Y("\\:("+MK+")")+"?)")+"?("+Sq+"|"+m_+"|"+R3+"|"+I_+")")+Y("\\?("+g_+")")+"?$",nD="^"+Y("\\#("+bK+")")+"?$",cD="^"+Y("("+S8+")@")+"?("+VK+")"+Y("\\:("+MK+")")+"?$";return{NOT_SCHEME:new RegExp(K("[^]",u,L,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(K("[^\\%\\:]",M8,G8),"g"),NOT_HOST:new RegExp(K("[^\\%\\[\\]\\:]",M8,G8),"g"),NOT_PATH:new RegExp(K("[^\\%\\/\\:\\@]",M8,G8),"g"),NOT_PATH_NOSCHEME:new RegExp(K("[^\\%\\/\\@]",M8,G8),"g"),NOT_QUERY:new RegExp(K("[^\\%]",M8,G8,"[\\:\\@\\/\\?]",d8),"g"),NOT_FRAGMENT:new RegExp(K("[^\\%]",M8,G8,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(K("[^]",M8,G8),"g"),UNRESERVED:new RegExp(M8,"g"),OTHER_CHARS:new RegExp(K("[^\\%]",M8,n8),"g"),PCT_ENCODED:new RegExp(b8,"g"),IPV4ADDRESS:new RegExp("^("+o6+")$"),IPV6ADDRESS:new RegExp("^\\[?("+bq+")"+Y(Y("\\%25|\\%(?!"+s+"{2})")+"("+R_+")")+"?\\]?$")}}var v=w(!1),z=w(!0),W=function(){function N(u,E){var L=[],n=!0,s=!1,X8=void 0;try{for(var D8=u[Symbol.iterator](),b8;!(n=(b8=D8.next()).done);n=!0)if(L.push(b8.value),E&&L.length===E)break}catch(U8){s=!0,X8=U8}finally{try{if(!n&&D8.return)D8.return()}finally{if(s)throw X8}}return L}return function(u,E){if(Array.isArray(u))return u;else if(Symbol.iterator in Object(u))return N(u,E);else throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),J=function(N){if(Array.isArray(N)){for(var u=0,E=Array(N.length);u<N.length;u++)E[u]=N[u];return E}else return Array.from(N)},Z=2147483647,H=36,X=1,A=26,G=38,D=700,M=72,g=128,S="-",b=/^xn--/,d=/[^\0-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,r={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},l=H-X,R=Math.floor,m=String.fromCharCode;function y(N){throw new RangeError(r[N])}function i(N,u){var E=[],L=N.length;while(L--)E[L]=u(N[L]);return E}function t(N,u){var E=N.split("@"),L="";if(E.length>1)L=E[0]+"@",N=E[1];N=N.replace(p,".");var n=N.split("."),s=i(n,u).join(".");return L+s}function U(N){var u=[],E=0,L=N.length;while(E<L){var n=N.charCodeAt(E++);if(n>=55296&&n<=56319&&E<L){var s=N.charCodeAt(E++);if((s&64512)==56320)u.push(((n&1023)<<10)+(s&1023)+65536);else u.push(n),E--}else u.push(n)}return u}var w8=function N(u){return String.fromCodePoint.apply(String,J(u))},f8=function N(u){if(u-48<10)return u-22;if(u-65<26)return u-65;if(u-97<26)return u-97;return H},T8=function N(u,E){return u+22+75*(u<26)-((E!=0)<<5)},v8=function N(u,E,L){var n=0;u=L?R(u/D):u>>1,u+=R(u/E);for(;u>l*A>>1;n+=H)u=R(u/l);return R(n+(l+1)*u/(u+G))},Y8=function N(u){var E=[],L=u.length,n=0,s=g,X8=M,D8=u.lastIndexOf(S);if(D8<0)D8=0;for(var b8=0;b8<D8;++b8){if(u.charCodeAt(b8)>=128)y("not-basic");E.push(u.charCodeAt(b8))}for(var U8=D8>0?D8+1:0;U8<L;){var G8=n;for(var n8=1,s8=H;;s8+=H){if(U8>=L)y("invalid-input");var d8=f8(u.charCodeAt(U8++));if(d8>=H||d8>R((Z-n)/n8))y("overflow");n+=d8*n8;var M8=s8<=X8?X:s8>=X8+A?A:s8-X8;if(d8<M8)break;var c8=H-M8;if(n8>R(Z/c8))y("overflow");n8*=c8}var S8=E.length+1;if(X8=v8(n-G8,S8,G8==0),R(n/S8)>Z-s)y("overflow");s+=R(n/S8),n%=S8,E.splice(n++,0,s)}return String.fromCodePoint.apply(String,E)},R8=function N(u){var E=[];u=U(u);var L=u.length,n=g,s=0,X8=M,D8=!0,b8=!1,U8=void 0;try{for(var G8=u[Symbol.iterator](),n8;!(D8=(n8=G8.next()).done);D8=!0){var s8=n8.value;if(s8<128)E.push(m(s8))}}catch(Y_){b8=!0,U8=Y_}finally{try{if(!D8&&G8.return)G8.return()}finally{if(b8)throw U8}}var d8=E.length,M8=d8;if(d8)E.push(S);while(M8<L){var c8=Z,S8=!0,j_=!1,I6=void 0;try{for(var o6=u[Symbol.iterator](),m8;!(S8=(m8=o6.next()).done);S8=!0){var g6=m8.value;if(g6>=n&&g6<c8)c8=g6}}catch(Y_){j_=!0,I6=Y_}finally{try{if(!S8&&o6.return)o6.return()}finally{if(j_)throw I6}}var a6=M8+1;if(c8-n>R((Z-s)/a6))y("overflow");s+=(c8-n)*a6,n=c8;var Aq=!0,P_=!1,Nq=void 0;try{for(var CK=u[Symbol.iterator](),S3;!(Aq=(S3=CK.next()).done);Aq=!0){var E3=S3.value;if(E3<n&&++s>Z)y("overflow");if(E3==n){var S_=s;for(var E_=H;;E_+=H){var bq=E_<=X8?X:E_>=X8+A?A:E_-X8;if(S_<bq)break;var R_=S_-bq,B7=H-bq;E.push(m(T8(bq+R_%B7,0))),S_=R(R_/B7)}E.push(m(T8(S_,0))),X8=v8(s,a6,M8==d8),s=0,++M8}}}catch(Y_){P_=!0,Nq=Y_}finally{try{if(!Aq&&CK.return)CK.return()}finally{if(P_)throw Nq}}++s,++n}return E.join("")},Y6=function N(u){return t(u,function(E){return b.test(E)?Y8(E.slice(4).toLowerCase()):E})},j6=function N(u){return t(u,function(E){return d.test(E)?"xn--"+R8(E):E})},h={version:"2.1.0",ucs2:{decode:U,encode:w8},decode:Y8,encode:R8,toASCII:j6,toUnicode:Y6},C={};function T(N){var u=N.charCodeAt(0),E=void 0;if(u<16)E="%0"+u.toString(16).toUpperCase();else if(u<128)E="%"+u.toString(16).toUpperCase();else if(u<2048)E="%"+(u>>6|192).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase();else E="%"+(u>>12|224).toString(16).toUpperCase()+"%"+(u>>6&63|128).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase();return E}function V(N){var u="",E=0,L=N.length;while(E<L){var n=parseInt(N.substr(E+1,2),16);if(n<128)u+=String.fromCharCode(n),E+=3;else if(n>=194&&n<224){if(L-E>=6){var s=parseInt(N.substr(E+4,2),16);u+=String.fromCharCode((n&31)<<6|s&63)}else u+=N.substr(E,6);E+=6}else if(n>=224){if(L-E>=9){var X8=parseInt(N.substr(E+4,2),16),D8=parseInt(N.substr(E+7,2),16);u+=String.fromCharCode((n&15)<<12|(X8&63)<<6|D8&63)}else u+=N.substr(E,9);E+=9}else u+=N.substr(E,3),E+=3}return u}function x(N,u){function E(L){var n=V(L);return!n.match(u.UNRESERVED)?L:n}if(N.scheme)N.scheme=String(N.scheme).replace(u.PCT_ENCODED,E).toLowerCase().replace(u.NOT_SCHEME,"");if(N.userinfo!==void 0)N.userinfo=String(N.userinfo).replace(u.PCT_ENCODED,E).replace(u.NOT_USERINFO,T).replace(u.PCT_ENCODED,P);if(N.host!==void 0)N.host=String(N.host).replace(u.PCT_ENCODED,E).toLowerCase().replace(u.NOT_HOST,T).replace(u.PCT_ENCODED,P);if(N.path!==void 0)N.path=String(N.path).replace(u.PCT_ENCODED,E).replace(N.scheme?u.NOT_PATH:u.NOT_PATH_NOSCHEME,T).replace(u.PCT_ENCODED,P);if(N.query!==void 0)N.query=String(N.query).replace(u.PCT_ENCODED,E).replace(u.NOT_QUERY,T).replace(u.PCT_ENCODED,P);if(N.fragment!==void 0)N.fragment=String(N.fragment).replace(u.PCT_ENCODED,E).replace(u.NOT_FRAGMENT,T).replace(u.PCT_ENCODED,P);return N}function o(N){return N.replace(/^0*(.*)/,"$1")||"0"}function c(N,u){var E=N.match(u.IPV4ADDRESS)||[],L=W(E,2),n=L[1];if(n)return n.split(".").map(o).join(".");else return N}function B(N,u){var E=N.match(u.IPV6ADDRESS)||[],L=W(E,3),n=L[1],s=L[2];if(n){var X8=n.toLowerCase().split("::").reverse(),D8=W(X8,2),b8=D8[0],U8=D8[1],G8=U8?U8.split(":").map(o):[],n8=b8.split(":").map(o),s8=u.IPV4ADDRESS.test(n8[n8.length-1]),d8=s8?7:8,M8=n8.length-d8,c8=Array(d8);for(var S8=0;S8<d8;++S8)c8[S8]=G8[S8]||n8[M8+S8]||"";if(s8)c8[d8-1]=c(c8[d8-1],u);var j_=c8.reduce(function(a6,Aq,P_){if(!Aq||Aq==="0"){var Nq=a6[a6.length-1];if(Nq&&Nq.index+Nq.length===P_)Nq.length++;else a6.push({index:P_,length:1})}return a6},[]),I6=j_.sort(function(a6,Aq){return Aq.length-a6.length})[0],o6=void 0;if(I6&&I6.length>1){var m8=c8.slice(0,I6.index),g6=c8.slice(I6.index+I6.length);o6=m8.join(":")+"::"+g6.join(":")}else o6=c8.join(":");if(s)o6+="%"+s;return o6}else return N}var K8=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,W8="".match(/(){0}/)[1]===void 0;function $8(N){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E={},L=u.iri!==!1?z:v;if(u.reference==="suffix")N=(u.scheme?u.scheme+":":"")+"//"+N;var n=N.match(K8);if(n){if(W8){if(E.scheme=n[1],E.userinfo=n[3],E.host=n[4],E.port=parseInt(n[5],10),E.path=n[6]||"",E.query=n[7],E.fragment=n[8],isNaN(E.port))E.port=n[5]}else if(E.scheme=n[1]||void 0,E.userinfo=N.indexOf("@")!==-1?n[3]:void 0,E.host=N.indexOf("//")!==-1?n[4]:void 0,E.port=parseInt(n[5],10),E.path=n[6]||"",E.query=N.indexOf("?")!==-1?n[7]:void 0,E.fragment=N.indexOf("#")!==-1?n[8]:void 0,isNaN(E.port))E.port=N.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0;if(E.host)E.host=B(c(E.host,L),L);if(E.scheme===void 0&&E.userinfo===void 0&&E.host===void 0&&E.port===void 0&&!E.path&&E.query===void 0)E.reference="same-document";else if(E.scheme===void 0)E.reference="relative";else if(E.fragment===void 0)E.reference="absolute";else E.reference="uri";if(u.reference&&u.reference!=="suffix"&&u.reference!==E.reference)E.error=E.error||"URI is not a "+u.reference+" reference.";var s=C[(u.scheme||E.scheme||"").toLowerCase()];if(!u.unicodeSupport&&(!s||!s.unicodeSupport)){if(E.host&&(u.domainHost||s&&s.domainHost))try{E.host=h.toASCII(E.host.replace(L.PCT_ENCODED,V).toLowerCase())}catch(X8){E.error=E.error||"Host's domain name can not be converted to ASCII via punycode: "+X8}x(E,v)}else x(E,L);if(s&&s.parse)s.parse(E,u)}else E.error=E.error||"URI can not be parsed.";return E}function A8(N,u){var E=u.iri!==!1?z:v,L=[];if(N.userinfo!==void 0)L.push(N.userinfo),L.push("@");if(N.host!==void 0)L.push(B(c(String(N.host),E),E).replace(E.IPV6ADDRESS,function(n,s,X8){return"["+s+(X8?"%25"+X8:"")+"]"}));if(typeof N.port==="number"||typeof N.port==="string")L.push(":"),L.push(String(N.port));return L.length?L.join(""):void 0}var g8=/^\.\.?\//,V8=/^\/\.(\/|$)/,z6=/^\/\.\.(\/|$)/,i8=/^\/?(?:.|\n)*?(?=\/|$)/;function u6(N){var u=[];while(N.length)if(N.match(g8))N=N.replace(g8,"");else if(N.match(V8))N=N.replace(V8,"/");else if(N.match(z6))N=N.replace(z6,"/"),u.pop();else if(N==="."||N==="..")N="";else{var E=N.match(i8);if(E){var L=E[0];N=N.slice(L.length),u.push(L)}else throw new Error("Unexpected dot segment condition")}return u.join("")}function y8(N){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=u.iri?z:v,L=[],n=C[(u.scheme||N.scheme||"").toLowerCase()];if(n&&n.serialize)n.serialize(N,u);if(N.host){if(E.IPV6ADDRESS.test(N.host));else if(u.domainHost||n&&n.domainHost)try{N.host=!u.iri?h.toASCII(N.host.replace(E.PCT_ENCODED,V).toLowerCase()):h.toUnicode(N.host)}catch(D8){N.error=N.error||"Host's domain name can not be converted to "+(!u.iri?"ASCII":"Unicode")+" via punycode: "+D8}}if(x(N,E),u.reference!=="suffix"&&N.scheme)L.push(N.scheme),L.push(":");var s=A8(N,u);if(s!==void 0){if(u.reference!=="suffix")L.push("//");if(L.push(s),N.path&&N.path.charAt(0)!=="/")L.push("/")}if(N.path!==void 0){var X8=N.path;if(!u.absolutePath&&(!n||!n.absolutePath))X8=u6(X8);if(s===void 0)X8=X8.replace(/^\/\//,"/%2F");L.push(X8)}if(N.query!==void 0)L.push("?"),L.push(N.query);if(N.fragment!==void 0)L.push("#"),L.push(N.fragment);return L.join("")}function f6(N,u){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=arguments[3],n={};if(!L)N=$8(y8(N,E),E),u=$8(y8(u,E),E);if(E=E||{},!E.tolerant&&u.scheme)n.scheme=u.scheme,n.userinfo=u.userinfo,n.host=u.host,n.port=u.port,n.path=u6(u.path||""),n.query=u.query;else{if(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0)n.userinfo=u.userinfo,n.host=u.host,n.port=u.port,n.path=u6(u.path||""),n.query=u.query;else{if(!u.path)if(n.path=N.path,u.query!==void 0)n.query=u.query;else n.query=N.query;else{if(u.path.charAt(0)==="/")n.path=u6(u.path);else{if((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path)n.path="/"+u.path;else if(!N.path)n.path=u.path;else n.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+u.path;n.path=u6(n.path)}n.query=u.query}n.userinfo=N.userinfo,n.host=N.host,n.port=N.port}n.scheme=N.scheme}return n.fragment=u.fragment,n}function i6(N,u,E){var L=O({scheme:"null"},E);return y8(f6($8(N,L),$8(u,L),L,!0),L)}function m6(N,u){if(typeof N==="string")N=y8($8(N,u),u);else if(f(N)==="object")N=$8(y8(N,u),u);return N}function b3(N,u,E){if(typeof N==="string")N=y8($8(N,E),E);else if(f(N)==="object")N=y8(N,E);if(typeof u==="string")u=y8($8(u,E),E);else if(f(u)==="object")u=y8(u,E);return N===u}function o7(N,u){return N&&N.toString().replace(!u||!u.iri?v.ESCAPE:z.ESCAPE,T)}function Pq(N,u){return N&&N.toString().replace(!u||!u.iri?v.PCT_ENCODED:z.PCT_ENCODED,V)}var hK={scheme:"http",domainHost:!0,parse:function N(u,E){if(!u.host)u.error=u.error||"HTTP URIs must have a host.";return u},serialize:function N(u,E){var L=String(u.scheme).toLowerCase()==="https";if(u.port===(L?443:80)||u.port==="")u.port=void 0;if(!u.path)u.path="/";return u}},l9={scheme:"https",domainHost:hK.domainHost,parse:hK.parse,serialize:hK.serialize};function x9(N){return typeof N.secure==="boolean"?N.secure:String(N.scheme).toLowerCase()==="wss"}var DK={scheme:"ws",domainHost:!0,parse:function N(u,E){var L=u;return L.secure=x9(L),L.resourceName=(L.path||"/")+(L.query?"?"+L.query:""),L.path=void 0,L.query=void 0,L},serialize:function N(u,E){if(u.port===(x9(u)?443:80)||u.port==="")u.port=void 0;if(typeof u.secure==="boolean")u.scheme=u.secure?"wss":"ws",u.secure=void 0;if(u.resourceName){var L=u.resourceName.split("?"),n=W(L,2),s=n[0],X8=n[1];u.path=s&&s!=="/"?s:void 0,u.query=X8,u.resourceName=void 0}return u.fragment=void 0,u}},n9={scheme:"wss",domainHost:DK.domainHost,parse:DK.parse,serialize:DK.serialize},c$={},r$=!0,c9="[A-Za-z0-9\\-\\.\\_\\~"+(r$?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Xq="[0-9A-Fa-f]",i$=Y(Y("%[EFef]"+Xq+"%"+Xq+Xq+"%"+Xq+Xq)+"|"+Y("%[89A-Fa-f]"+Xq+"%"+Xq+Xq)+"|"+Y("%"+Xq+Xq)),o$="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",a$="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",B$=K(a$,"[\\\"\\\\]"),t$="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",e$=new RegExp(c9,"g"),b_=new RegExp(i$,"g"),F$=new RegExp(K("[^]",o$,"[\\.]","[\\\"]",B$),"g"),r9=new RegExp(K("[^]",c9,t$),"g"),U$=r9;function a7(N){var u=V(N);return!u.match(e$)?N:u}var i9={scheme:"mailto",parse:function N(u,E){var L=u,n=L.to=L.path?L.path.split(","):[];if(L.path=void 0,L.query){var s=!1,X8={},D8=L.query.split("&");for(var b8=0,U8=D8.length;b8<U8;++b8){var G8=D8[b8].split("=");switch(G8[0]){case"to":var n8=G8[1].split(",");for(var s8=0,d8=n8.length;s8<d8;++s8)n.push(n8[s8]);break;case"subject":L.subject=Pq(G8[1],E);break;case"body":L.body=Pq(G8[1],E);break;default:s=!0,X8[Pq(G8[0],E)]=Pq(G8[1],E);break}}if(s)L.headers=X8}L.query=void 0;for(var M8=0,c8=n.length;M8<c8;++M8){var S8=n[M8].split("@");if(S8[0]=Pq(S8[0]),!E.unicodeSupport)try{S8[1]=h.toASCII(Pq(S8[1],E).toLowerCase())}catch(j_){L.error=L.error||"Email address's domain name can not be converted to ASCII via punycode: "+j_}else S8[1]=Pq(S8[1],E).toLowerCase();n[M8]=S8.join("@")}return L},serialize:function N(u,E){var L=u,n=$(u.to);if(n){for(var s=0,X8=n.length;s<X8;++s){var D8=String(n[s]),b8=D8.lastIndexOf("@"),U8=D8.slice(0,b8).replace(b_,a7).replace(b_,P).replace(F$,T),G8=D8.slice(b8+1);try{G8=!E.iri?h.toASCII(Pq(G8,E).toLowerCase()):h.toUnicode(G8)}catch(M8){L.error=L.error||"Email address's domain name can not be converted to "+(!E.iri?"ASCII":"Unicode")+" via punycode: "+M8}n[s]=U8+"@"+G8}L.path=n.join(",")}var n8=u.headers=u.headers||{};if(u.subject)n8.subject=u.subject;if(u.body)n8.body=u.body;var s8=[];for(var d8 in n8)if(n8[d8]!==c$[d8])s8.push(d8.replace(b_,a7).replace(b_,P).replace(r9,T)+"="+n8[d8].replace(b_,a7).replace(b_,P).replace(U$,T));if(s8.length)L.query=s8.join("&");return L}},s$=/^([^\:]+)\:(.*)/,o9={scheme:"urn",parse:function N(u,E){var L=u.path&&u.path.match(s$),n=u;if(L){var s=E.scheme||n.scheme||"urn",X8=L[1].toLowerCase(),D8=L[2],b8=s+":"+(E.nid||X8),U8=C[b8];if(n.nid=X8,n.nss=D8,n.path=void 0,U8)n=U8.parse(n,E)}else n.error=n.error||"URN can not be parsed.";return n},serialize:function N(u,E){var L=E.scheme||u.scheme||"urn",n=u.nid,s=L+":"+(E.nid||n),X8=C[s];if(X8)u=X8.serialize(u,E);var D8=u,b8=u.nss;return D8.path=(n||E.nid)+":"+b8,D8}},Q$=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,a9={scheme:"urn:uuid",parse:function N(u,E){var L=u;if(L.uuid=L.nss,L.nss=void 0,!E.tolerant&&(!L.uuid||!L.uuid.match(Q$)))L.error=L.error||"UUID is not valid.";return L},serialize:function N(u,E){var L=u;return L.nss=(u.uuid||"").toLowerCase(),L}};C[hK.scheme]=hK,C[l9.scheme]=l9,C[DK.scheme]=DK,C[n9.scheme]=n9,C[i9.scheme]=i9,C[o9.scheme]=o9,C[a9.scheme]=a9,j.SCHEMES=C,j.pctEncChar=T,j.pctDecChars=V,j.parse=$8,j.removeDotSegments=u6,j.serialize=y8,j.resolveComponents=f6,j.resolve=i6,j.normalize=m6,j.equal=b3,j.escapeComponent=o7,j.unescapeComponent=Pq,Object.defineProperty(j,"__esModule",{value:!0})})}),P2=H8((q,_)=>{_.exports=function j(K,Y){if(K===Y)return!0;if(K&&Y&&typeof K=="object"&&typeof Y=="object"){if(K.constructor!==Y.constructor)return!1;var f,P,$;if(Array.isArray(K)){if(f=K.length,f!=Y.length)return!1;for(P=f;P--!==0;)if(!j(K[P],Y[P]))return!1;return!0}if(K.constructor===RegExp)return K.source===Y.source&&K.flags===Y.flags;if(K.valueOf!==Object.prototype.valueOf)return K.valueOf()===Y.valueOf();if(K.toString!==Object.prototype.toString)return K.toString()===Y.toString();if($=Object.keys(K),f=$.length,f!==Object.keys(Y).length)return!1;for(P=f;P--!==0;)if(!Object.prototype.hasOwnProperty.call(Y,$[P]))return!1;for(P=f;P--!==0;){var O=$[P];if(!j(K[O],Y[O]))return!1}return!0}return K!==K&&Y!==Y}}),PT=H8((q,_)=>{_.exports=function j(K){var Y=0,f=K.length,P=0,$;while(P<f)if(Y++,$=K.charCodeAt(P++),$>=55296&&$<=56319&&P<f){if($=K.charCodeAt(P),($&64512)==56320)P++}return Y}}),$K=H8((q,_)=>{_.exports={copy:j,checkDataType:K,checkDataTypes:Y,coerceToTypes:P,toHash:$,getProperty:v,escapeQuotes:z,equal:P2(),ucs2length:PT(),varOccurences:W,varReplace:J,schemaHasRules:Z,schemaHasRulesExcept:H,schemaUnknownRules:X,toQuotedString:A,getPathExpr:G,getPath:D,getData:S,unescapeFragment:d,unescapeJsonPointer:l,escapeFragment:p,escapeJsonPointer:r};function j(R,m){m=m||{};for(var y in R)m[y]=R[y];return m}function K(R,m,y,i){var t=i?" !== ":" === ",U=i?" || ":" && ",w8=i?"!":"",f8=i?"":"!";switch(R){case"null":return m+t+"null";case"array":return w8+"Array.isArray("+m+")";case"object":return"("+w8+m+U+"typeof "+m+t+'"object"'+U+f8+"Array.isArray("+m+"))";case"integer":return"(typeof "+m+t+'"number"'+U+f8+"("+m+" % 1)"+U+m+t+m+(y?U+w8+"isFinite("+m+")":"")+")";case"number":return"(typeof "+m+t+'"'+R+'"'+(y?U+w8+"isFinite("+m+")":"")+")";default:return"typeof "+m+t+'"'+R+'"'}}function Y(R,m,y){switch(R.length){case 1:return K(R[0],m,y,!0);default:var i="",t=$(R);if(t.array&&t.object)i=t.null?"(":"(!"+m+" || ",i+="typeof "+m+' !== "object")',delete t.null,delete t.array,delete t.object;if(t.number)delete t.integer;for(var U in t)i+=(i?" && ":"")+K(U,m,y,!0);return i}}var f=$(["string","number","integer","boolean","null"]);function P(R,m){if(Array.isArray(m)){var y=[];for(var i=0;i<m.length;i++){var t=m[i];if(f[t])y[y.length]=t;else if(R==="array"&&t==="array")y[y.length]=t}if(y.length)return y}else if(f[m])return[m];else if(R==="array"&&m==="array")return["array"]}function $(R){var m={};for(var y=0;y<R.length;y++)m[R[y]]=!0;return m}var O=/^[a-z$_][a-z$_0-9]*$/i,w=/'|\\/g;function v(R){return typeof R=="number"?"["+R+"]":O.test(R)?"."+R:"['"+z(R)+"']"}function z(R){return R.replace(w,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function W(R,m){m+="[^0-9]";var y=R.match(new RegExp(m,"g"));return y?y.length:0}function J(R,m,y){return m+="([^0-9])",y=y.replace(/\$/g,"$$$$"),R.replace(new RegExp(m,"g"),y+"$1")}function Z(R,m){if(typeof R=="boolean")return!R;for(var y in R)if(m[y])return!0}function H(R,m,y){if(typeof R=="boolean")return!R&&y!="not";for(var i in R)if(i!=y&&m[i])return!0}function X(R,m){if(typeof R=="boolean")return;for(var y in R)if(!m[y])return y}function A(R){return"'"+z(R)+"'"}function G(R,m,y,i){var t=y?"'/' + "+m+(i?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):i?"'[' + "+m+" + ']'":"'[\\'' + "+m+" + '\\']'";return b(R,t)}function D(R,m,y){var i=y?A("/"+r(m)):A(v(m));return b(R,i)}var M=/^\/(?:[^~]|~0|~1)*$/,g=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function S(R,m,y){var i,t,U,w8;if(R==="")return"rootData";if(R[0]=="/"){if(!M.test(R))throw new Error("Invalid JSON-pointer: "+R);t=R,U="rootData"}else{if(w8=R.match(g),!w8)throw new Error("Invalid JSON-pointer: "+R);if(i=+w8[1],t=w8[2],t=="#"){if(i>=m)throw new Error("Cannot access property/index "+i+" levels up, current level is "+m);return y[m-i]}if(i>m)throw new Error("Cannot access data "+i+" levels up, current level is "+m);if(U="data"+(m-i||""),!t)return U}var f8=U,T8=t.split("/");for(var v8=0;v8<T8.length;v8++){var Y8=T8[v8];if(Y8)U+=v(l(Y8)),f8+=" && "+U}return f8}function b(R,m){if(R=='""')return m;return(R+" + "+m).replace(/([^\\])' \+ '/g,"$1")}function d(R){return l(decodeURIComponent(R))}function p(R){return encodeURIComponent(r(R))}function r(R){return R.replace(/~/g,"~0").replace(/\//g,"~1")}function l(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}}),i1=H8((q,_)=>{var j=$K();_.exports=K;function K(Y){j.copy(Y,this)}}),YT=H8((q,_)=>{var j=_.exports=function(f,P,$){if(typeof P=="function")$=P,P={};$=P.cb||$;var O=typeof $=="function"?$:$.pre||function(){},w=$.post||function(){};K(P,O,w,f,"",f)};j.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},j.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},j.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},j.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 K(f,P,$,O,w,v,z,W,J,Z){if(O&&typeof O=="object"&&!Array.isArray(O)){P(O,w,v,z,W,J,Z);for(var H in O){var X=O[H];if(Array.isArray(X)){if(H in j.arrayKeywords)for(var A=0;A<X.length;A++)K(f,P,$,X[A],w+"/"+H+"/"+A,v,w,H,O,A)}else if(H in j.propsKeywords){if(X&&typeof X=="object")for(var G in X)K(f,P,$,X[G],w+"/"+H+"/"+Y(G),v,w,H,O,G)}else if(H in j.keywords||f.allKeys&&!(H in j.skipKeywords))K(f,P,$,X,w+"/"+H,v,w,H,O)}$(O,w,v,z,W,J,Z)}}function Y(f){return f.replace(/~/g,"~0").replace(/\//g,"~1")}}),Y2=H8((q,_)=>{var j=jT(),K=P2(),Y=$K(),f=i1(),P=YT();_.exports=$,$.normalizeId=D,$.fullPath=X,$.url=M,$.ids=g,$.inlineRef=J,$.schema=O;function $(S,b,d){var p=this._refs[d];if(typeof p=="string")if(this._refs[p])p=this._refs[p];else return $.call(this,S,b,p);if(p=p||this._schemas[d],p instanceof f)return J(p.schema,this._opts.inlineRefs)?p.schema:p.validate||this._compile(p);var r=O.call(this,b,d),l,R,m;if(r)l=r.schema,b=r.root,m=r.baseId;if(l instanceof f)R=l.validate||S.call(this,l.schema,b,void 0,m);else if(l!==void 0)R=J(l,this._opts.inlineRefs)?l:S.call(this,l,b,void 0,m);return R}function O(S,b){var d=j.parse(b),p=A(d),r=X(this._getId(S.schema));if(Object.keys(S.schema).length===0||p!==r){var l=D(p),R=this._refs[l];if(typeof R=="string")return w.call(this,S,R,d);else if(R instanceof f){if(!R.validate)this._compile(R);S=R}else if(R=this._schemas[l],R instanceof f){if(!R.validate)this._compile(R);if(l==D(b))return{schema:R,root:S,baseId:r};S=R}else return;if(!S.schema)return;r=X(this._getId(S.schema))}return z.call(this,d,r,S.schema,S)}function w(S,b,d){var p=O.call(this,S,b);if(p){var{schema:r,baseId:l}=p;S=p.root;var R=this._getId(r);if(R)l=M(l,R);return z.call(this,d,l,r,S)}}var v=Y.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function z(S,b,d,p){if(S.fragment=S.fragment||"",S.fragment.slice(0,1)!="/")return;var r=S.fragment.split("/");for(var l=1;l<r.length;l++){var R=r[l];if(R){if(R=Y.unescapeFragment(R),d=d[R],d===void 0)break;var m;if(!v[R]){if(m=this._getId(d),m)b=M(b,m);if(d.$ref){var y=M(b,d.$ref),i=O.call(this,p,y);if(i)d=i.schema,p=i.root,b=i.baseId}}}}if(d!==void 0&&d!==p.schema)return{schema:d,root:p,baseId:b}}var W=Y.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function J(S,b){if(b===!1)return!1;if(b===void 0||b===!0)return Z(S);else if(b)return H(S)<=b}function Z(S){var b;if(Array.isArray(S)){for(var d=0;d<S.length;d++)if(b=S[d],typeof b=="object"&&!Z(b))return!1}else for(var p in S){if(p=="$ref")return!1;if(b=S[p],typeof b=="object"&&!Z(b))return!1}return!0}function H(S){var b=0,d;if(Array.isArray(S))for(var p=0;p<S.length;p++){if(d=S[p],typeof d=="object")b+=H(d);if(b==1/0)return 1/0}else for(var r in S){if(r=="$ref")return 1/0;if(W[r])b++;else{if(d=S[r],typeof d=="object")b+=H(d)+1;if(b==1/0)return 1/0}}return b}function X(S,b){if(b!==!1)S=D(S);var d=j.parse(S);return A(d)}function A(S){return j.serialize(S).split("#")[0]+"#"}var G=/#\/?$/;function D(S){return S?S.replace(G,""):""}function M(S,b){return b=D(b),j.resolve(S,b)}function g(S){var b=D(this._getId(S)),d={"":b},p={"":X(b,!1)},r={},l=this;return P(S,{allKeys:!0},function(R,m,y,i,t,U,w8){if(m==="")return;var f8=l._getId(R),T8=d[i],v8=p[i]+"/"+t;if(w8!==void 0)v8+="/"+(typeof w8=="number"?w8:Y.escapeFragment(w8));if(typeof f8=="string"){f8=T8=D(T8?j.resolve(T8,f8):f8);var Y8=l._refs[f8];if(typeof Y8=="string")Y8=l._refs[Y8];if(Y8&&Y8.schema){if(!K(R,Y8.schema))throw new Error('id "'+f8+'" resolves to more than one schema')}else if(f8!=D(v8))if(f8[0]=="#"){if(r[f8]&&!K(R,r[f8]))throw new Error('id "'+f8+'" resolves to more than one schema');r[f8]=R}else l._refs[f8]=v8}d[m]=T8,p[m]=v8}),r}}),f2=H8((q,_)=>{var j=Y2();_.exports={Validation:f(K),MissingRef:f(Y)};function K(P){this.message="validation failed",this.errors=P,this.ajv=this.validation=!0}Y.message=function(P,$){return"can't resolve reference "+$+" from id "+P};function Y(P,$,O){this.message=O||Y.message(P,$),this.missingRef=j.url(P,$),this.missingSchema=j.normalizeId(j.fullPath(this.missingRef))}function f(P){return P.prototype=Object.create(Error.prototype),P.prototype.constructor=P,P}}),o1=H8((q,_)=>{_.exports=function(j,K){if(!K)K={};if(typeof K==="function")K={cmp:K};var Y=typeof K.cycles==="boolean"?K.cycles:!1,f=K.cmp&&function($){return function(O){return function(w,v){var z={key:w,value:O[w]},W={key:v,value:O[v]};return $(z,W)}}}(K.cmp),P=[];return function $(O){if(O&&O.toJSON&&typeof O.toJSON==="function")O=O.toJSON();if(O===void 0)return;if(typeof O=="number")return isFinite(O)?""+O:"null";if(typeof O!=="object")return JSON.stringify(O);var w,v;if(Array.isArray(O)){v="[";for(w=0;w<O.length;w++){if(w)v+=",";v+=$(O[w])||"null"}return v+"]"}if(O===null)return"null";if(P.indexOf(O)!==-1){if(Y)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var z=P.push(O)-1,W=Object.keys(O).sort(f&&f(O));v="";for(w=0;w<W.length;w++){var J=W[w],Z=$(O[J]);if(!Z)continue;if(v)v+=",";v+=JSON.stringify(J)+":"+Z}return P.splice(z,1),"{"+v+"}"}(j)}}),a1=H8((q,_)=>{_.exports=function j(K,Y,f){var P="",$=K.schema.$async===!0,O=K.util.schemaHasRulesExcept(K.schema,K.RULES.all,"$ref"),w=K.self._getId(K.schema);if(K.opts.strictKeywords){var v=K.util.schemaUnknownRules(K.schema,K.RULES.keywords);if(v){var z="unknown keyword: "+v;if(K.opts.strictKeywords==="log")K.logger.warn(z);else throw new Error(z)}}if(K.isTop){if(P+=" var validate = ",$)K.async=!0,P+="async ";if(P+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",w&&(K.opts.sourceCode||K.opts.processCode))P+=" "+("/*# sourceURL="+w+" */")+" "}if(typeof K.schema=="boolean"||!(O||K.schema.$ref)){var Y="false schema",W=K.level,J=K.dataLevel,Z=K.schema[Y],H=K.schemaPath+K.util.getProperty(Y),X=K.errSchemaPath+"/"+Y,b=!K.opts.allErrors,r,A="data"+(J||""),S="valid"+W;if(K.schema===!1){if(K.isTop)b=!0;else P+=" var "+S+" = false; ";var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(r||"false schema")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'boolean schema is false' ";if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&b)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else if(K.isTop)if($)P+=" return data; ";else P+=" validate.errors = null; return true; ";else P+=" var "+S+" = true; ";if(K.isTop)P+=" }; return validate; ";return P}if(K.isTop){var M=K.isTop,W=K.level=0,J=K.dataLevel=0,A="data";if(K.rootId=K.resolve.fullPath(K.self._getId(K.root.schema)),K.baseId=K.baseId||K.rootId,delete K.isTop,K.dataPathArr=[""],K.schema.default!==void 0&&K.opts.useDefaults&&K.opts.strictDefaults){var g="default is ignored in the schema root";if(K.opts.strictDefaults==="log")K.logger.warn(g);else throw new Error(g)}P+=" var vErrors = null; ",P+=" var errors = 0; ",P+=" if (rootData === undefined) rootData = data; "}else{var{level:W,dataLevel:J}=K,A="data"+(J||"");if(w)K.baseId=K.resolve.url(K.baseId,w);if($&&!K.async)throw new Error("async schema in sync schema");P+=" var errs_"+W+" = errors;"}var S="valid"+W,b=!K.opts.allErrors,d="",p="",r,l=K.schema.type,R=Array.isArray(l);if(l&&K.opts.nullable&&K.schema.nullable===!0){if(R){if(l.indexOf("null")==-1)l=l.concat("null")}else if(l!="null")l=[l,"null"],R=!0}if(R&&l.length==1)l=l[0],R=!1;if(K.schema.$ref&&O){if(K.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+K.errSchemaPath+'" (see option extendRefs)');else if(K.opts.extendRefs!==!0)O=!1,K.logger.warn('$ref: keywords ignored in schema at path "'+K.errSchemaPath+'"')}if(K.schema.$comment&&K.opts.$comment)P+=" "+K.RULES.all.$comment.code(K,"$comment");if(l){if(K.opts.coerceTypes)var m=K.util.coerceToTypes(K.opts.coerceTypes,l);var y=K.RULES.types[l];if(m||R||y===!0||y&&!i8(y)){var H=K.schemaPath+".type",X=K.errSchemaPath+"/type",H=K.schemaPath+".type",X=K.errSchemaPath+"/type",i=R?"checkDataTypes":"checkDataType";if(P+=" if ("+K.util[i](l,A,K.opts.strictNumbers,!0)+") { ",m){var t="dataType"+W,U="coerced"+W;if(P+=" var "+t+" = typeof "+A+"; var "+U+" = undefined; ",K.opts.coerceTypes=="array")P+=" if ("+t+" == 'object' && Array.isArray("+A+") && "+A+".length == 1) { "+A+" = "+A+"[0]; "+t+" = typeof "+A+"; if ("+K.util.checkDataType(K.schema.type,A,K.opts.strictNumbers)+") "+U+" = "+A+"; } ";P+=" if ("+U+" !== undefined) ; ";var w8=m;if(w8){var f8,T8=-1,v8=w8.length-1;while(T8<v8)if(f8=w8[T8+=1],f8=="string")P+=" else if ("+t+" == 'number' || "+t+" == 'boolean') "+U+" = '' + "+A+"; else if ("+A+" === null) "+U+" = ''; ";else if(f8=="number"||f8=="integer"){if(P+=" else if ("+t+" == 'boolean' || "+A+" === null || ("+t+" == 'string' && "+A+" && "+A+" == +"+A+" ",f8=="integer")P+=" && !("+A+" % 1)";P+=")) "+U+" = +"+A+"; "}else if(f8=="boolean")P+=" else if ("+A+" === 'false' || "+A+" === 0 || "+A+" === null) "+U+" = false; else if ("+A+" === 'true' || "+A+" === 1) "+U+" = true; ";else if(f8=="null")P+=" else if ("+A+" === '' || "+A+" === 0 || "+A+" === false) "+U+" = null; ";else if(K.opts.coerceTypes=="array"&&f8=="array")P+=" else if ("+t+" == 'string' || "+t+" == 'number' || "+t+" == 'boolean' || "+A+" == null) "+U+" = ["+A+"]; "}P+=" else { ";var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(r||"type")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: { type: '",R)P+=""+l.join(",");else P+=""+l;if(P+="' } ",K.opts.messages!==!1){if(P+=" , message: 'should be ",R)P+=""+l.join(",");else P+=""+l;P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+H+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&b)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } if ("+U+" !== undefined) { ";var Y8=J?"data"+(J-1||""):"parentData",R8=J?K.dataPathArr[J]:"parentDataProperty";if(P+=" "+A+" = "+U+"; ",!J)P+="if ("+Y8+" !== undefined)";P+=" "+Y8+"["+R8+"] = "+U+"; } "}else{var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(r||"type")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: { type: '",R)P+=""+l.join(",");else P+=""+l;if(P+="' } ",K.opts.messages!==!1){if(P+=" , message: 'should be ",R)P+=""+l.join(",");else P+=""+l;P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+H+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&b)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}P+=" } "}}if(K.schema.$ref&&!O){if(P+=" "+K.RULES.all.$ref.code(K,"$ref")+" ",b){if(P+=" } if (errors === ",M)P+="0";else P+="errs_"+W;P+=") { ",p+="}"}}else{var Y6=K.RULES;if(Y6){var y,j6=-1,h=Y6.length-1;while(j6<h)if(y=Y6[j6+=1],i8(y)){if(y.type)P+=" if ("+K.util.checkDataType(y.type,A,K.opts.strictNumbers)+") { ";if(K.opts.useDefaults){if(y.type=="object"&&K.schema.properties){var Z=K.schema.properties,C=Object.keys(Z),T=C;if(T){var V,x=-1,o=T.length-1;while(x<o){V=T[x+=1];var c=Z[V];if(c.default!==void 0){var B=A+K.util.getProperty(V);if(K.compositeRule){if(K.opts.strictDefaults){var g="default is ignored for: "+B;if(K.opts.strictDefaults==="log")K.logger.warn(g);else throw new Error(g)}}else{if(P+=" if ("+B+" === undefined ",K.opts.useDefaults=="empty")P+=" || "+B+" === null || "+B+" === '' ";if(P+=" ) "+B+" = ",K.opts.useDefaults=="shared")P+=" "+K.useDefault(c.default)+" ";else P+=" "+JSON.stringify(c.default)+" ";P+="; "}}}}}else if(y.type=="array"&&Array.isArray(K.schema.items)){var K8=K.schema.items;if(K8){var c,T8=-1,W8=K8.length-1;while(T8<W8)if(c=K8[T8+=1],c.default!==void 0){var B=A+"["+T8+"]";if(K.compositeRule){if(K.opts.strictDefaults){var g="default is ignored for: "+B;if(K.opts.strictDefaults==="log")K.logger.warn(g);else throw new Error(g)}}else{if(P+=" if ("+B+" === undefined ",K.opts.useDefaults=="empty")P+=" || "+B+" === null || "+B+" === '' ";if(P+=" ) "+B+" = ",K.opts.useDefaults=="shared")P+=" "+K.useDefault(c.default)+" ";else P+=" "+JSON.stringify(c.default)+" ";P+="; "}}}}}var $8=y.rules;if($8){var A8,g8=-1,V8=$8.length-1;while(g8<V8)if(A8=$8[g8+=1],u6(A8)){var z6=A8.code(K,A8.keyword,y.type);if(z6){if(P+=" "+z6+" ",b)d+="}"}}}if(b)P+=" "+d+" ",d="";if(y.type){if(P+=" } ",l&&l===y.type&&!m){P+=" else { ";var H=K.schemaPath+".type",X=K.errSchemaPath+"/type",G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(r||"type")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: { type: '",R)P+=""+l.join(",");else P+=""+l;if(P+="' } ",K.opts.messages!==!1){if(P+=" , message: 'should be ",R)P+=""+l.join(",");else P+=""+l;P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+H+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&b)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } "}}if(b){if(P+=" if (errors === ",M)P+="0";else P+="errs_"+W;P+=") { ",p+="}"}}}}if(b)P+=" "+p+" ";if(M){if($)P+=" if (errors === 0) return data; ",P+=" else throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; ",P+=" return errors === 0; ";P+=" }; return validate;"}else P+=" var "+S+" = errors === errs_"+W+";";function i8(f6){var i6=f6.rules;for(var m6=0;m6<i6.length;m6++)if(u6(i6[m6]))return!0}function u6(f6){return K.schema[f6.keyword]!==void 0||f6.implements&&y8(f6)}function y8(f6){var i6=f6.implements;for(var m6=0;m6<i6.length;m6++)if(K.schema[i6[m6]]!==void 0)return!0}return P}}),fT=H8((q,_)=>{var j=Y2(),K=$K(),Y=f2(),f=o1(),P=a1(),$=K.ucs2length,O=P2(),w=Y.Validation;_.exports=v;function v(D,M,g,S){var b=this,d=this._opts,p=[void 0],r={},l=[],R={},m=[],y={},i=[];M=M||{schema:D,refVal:p,refs:r};var t=z.call(this,D,M,S),U=this._compilations[t.index];if(t.compiling)return U.callValidate=Y8;var w8=this._formats,f8=this.RULES;try{var T8=R8(D,M,g,S);U.validate=T8;var v8=U.callValidate;if(v8){if(v8.schema=T8.schema,v8.errors=null,v8.refs=T8.refs,v8.refVal=T8.refVal,v8.root=T8.root,v8.$async=T8.$async,d.sourceCode)v8.source=T8.source}return T8}finally{W.call(this,D,M,S)}function Y8(){var c=U.validate,B=c.apply(this,arguments);return Y8.errors=c.errors,B}function R8(c,B,K8,W8){var $8=!B||B&&B.schema==c;if(B.schema!=M.schema)return v.call(b,c,B,K8,W8);var A8=c.$async===!0,g8=P({isTop:!0,schema:c,isRoot:$8,baseId:W8,root:B,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:Y.MissingRef,RULES:f8,validate:P,util:K,resolve:j,resolveRef:Y6,usePattern:V,useDefault:x,useCustomRule:o,opts:d,formats:w8,logger:b.logger,self:b});if(g8=G(p,X)+G(l,Z)+G(m,H)+G(i,A)+g8,d.processCode)g8=d.processCode(g8,c);var V8;try{var z6=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",g8);V8=z6(b,f8,w8,M,p,m,i,O,$,w),p[0]=V8}catch(i8){throw b.logger.error("Error compiling schema, function code:",g8),i8}if(V8.schema=c,V8.errors=null,V8.refs=r,V8.refVal=p,V8.root=$8?V8:B,A8)V8.$async=!0;if(d.sourceCode===!0)V8.source={code:g8,patterns:l,defaults:m};return V8}function Y6(c,B,K8){B=j.url(c,B);var W8=r[B],$8,A8;if(W8!==void 0)return $8=p[W8],A8="refVal["+W8+"]",T($8,A8);if(!K8&&M.refs){var g8=M.refs[B];if(g8!==void 0)return $8=M.refVal[g8],A8=j6(B,$8),T($8,A8)}A8=j6(B);var V8=j.call(b,R8,M,B);if(V8===void 0){var z6=g&&g[B];if(z6)V8=j.inlineRef(z6,d.inlineRefs)?z6:v.call(b,z6,M,g,c)}if(V8===void 0)h(B);else return C(B,V8),T(V8,A8)}function j6(c,B){var K8=p.length;return p[K8]=B,r[c]=K8,"refVal"+K8}function h(c){delete r[c]}function C(c,B){var K8=r[c];p[K8]=B}function T(c,B){return typeof c=="object"||typeof c=="boolean"?{code:B,schema:c,inline:!0}:{code:B,$async:c&&!!c.$async}}function V(c){var B=R[c];if(B===void 0)B=R[c]=l.length,l[B]=c;return"pattern"+B}function x(c){switch(typeof c){case"boolean":case"number":return""+c;case"string":return K.toQuotedString(c);case"object":if(c===null)return"null";var B=f(c),K8=y[B];if(K8===void 0)K8=y[B]=m.length,m[K8]=c;return"default"+K8}}function o(c,B,K8,W8){if(b._opts.validateSchema!==!1){var $8=c.definition.dependencies;if($8&&!$8.every(function(i6){return Object.prototype.hasOwnProperty.call(K8,i6)}))throw new Error("parent schema must have all required keywords: "+$8.join(","));var A8=c.definition.validateSchema;if(A8){var g8=A8(B);if(!g8){var V8="keyword schema is invalid: "+b.errorsText(A8.errors);if(b._opts.validateSchema=="log")b.logger.error(V8);else throw new Error(V8)}}}var z6=c.definition.compile,i8=c.definition.inline,u6=c.definition.macro,y8;if(z6)y8=z6.call(b,B,K8,W8);else if(u6){if(y8=u6.call(b,B,K8,W8),d.validateSchema!==!1)b.validateSchema(y8,!0)}else if(i8)y8=i8.call(b,W8,c.keyword,B,K8);else if(y8=c.definition.validate,!y8)return;if(y8===void 0)throw new Error('custom keyword "'+c.keyword+'"failed to compile');var f6=i.length;return i[f6]=y8,{code:"customRule"+f6,validate:y8}}}function z(D,M,g){var S=J.call(this,D,M,g);if(S>=0)return{index:S,compiling:!0};return S=this._compilations.length,this._compilations[S]={schema:D,root:M,baseId:g},{index:S,compiling:!1}}function W(D,M,g){var S=J.call(this,D,M,g);if(S>=0)this._compilations.splice(S,1)}function J(D,M,g){for(var S=0;S<this._compilations.length;S++){var b=this._compilations[S];if(b.schema==D&&b.root==M&&b.baseId==g)return S}return-1}function Z(D,M){return"var pattern"+D+" = new RegExp("+K.toQuotedString(M[D])+");"}function H(D){return"var default"+D+" = defaults["+D+"];"}function X(D,M){return M[D]===void 0?"":"var refVal"+D+" = refVal["+D+"];"}function A(D){return"var customRule"+D+" = customRules["+D+"];"}function G(D,M){if(!D.length)return"";var g="";for(var S=0;S<D.length;S++)g+=M(S,D);return g}}),$T=H8((q,_)=>{var j=_.exports=function K(){this._cache={}};j.prototype.put=function K(Y,f){this._cache[Y]=f},j.prototype.get=function K(Y){return this._cache[Y]},j.prototype.del=function K(Y){delete this._cache[Y]},j.prototype.clear=function K(){this._cache={}}}),wT=H8((q,_)=>{var j=$K(),K=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Y=[0,31,28,31,30,31,30,31,31,30,31,30,31],f=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,P=/^(?=.{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,$=/^(?:[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,O=/^(?:[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,w=/^(?:(?:[^\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,v=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,z=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,W=/^(?:\/(?:[^~/]|~0|~1)*)*$/,J=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Z=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;_.exports=H;function H(p){return p=p=="full"?"full":"fast",j.copy(H[p])}H.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\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,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":w,url:v,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,hostname:P,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:d,uuid:z,"json-pointer":W,"json-pointer-uri-fragment":J,"relative-json-pointer":Z},H.full={date:A,time:G,"date-time":M,uri:S,"uri-reference":O,"uri-template":w,url:v,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:P,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:d,uuid:z,"json-pointer":W,"json-pointer-uri-fragment":J,"relative-json-pointer":Z};function X(p){return p%4===0&&(p%100!==0||p%400===0)}function A(p){var r=p.match(K);if(!r)return!1;var l=+r[1],R=+r[2],m=+r[3];return R>=1&&R<=12&&m>=1&&m<=(R==2&&X(l)?29:Y[R])}function G(p,r){var l=p.match(f);if(!l)return!1;var R=l[1],m=l[2],y=l[3],i=l[5];return(R<=23&&m<=59&&y<=59||R==23&&m==59&&y==60)&&(!r||i)}var D=/t|\s/i;function M(p){var r=p.split(D);return r.length==2&&A(r[0])&&G(r[1],!0)}var g=/\/|:/;function S(p){return g.test(p)&&$.test(p)}var b=/[^\\]\\Z/;function d(p){if(b.test(p))return!1;try{return new RegExp(p),!0}catch(r){return!1}}}),OT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.errSchemaPath+"/"+Y,z=!K.opts.allErrors,W="data"+(O||""),J="valid"+$,Z,H;if(w=="#"||w=="#/")if(K.isRoot)Z=K.async,H="validate";else Z=K.root.schema.$async===!0,H="root.refVal[0]";else{var X=K.resolveRef(K.baseId,w,K.isRoot);if(X===void 0){var A=K.MissingRefError.message(K.baseId,w);if(K.opts.missingRefs=="fail"){K.logger.error(A);var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(v)+" , params: { ref: '"+K.util.escapeQuotes(w)+"' } ",K.opts.messages!==!1)P+=" , message: 'can\\'t resolve reference "+K.util.escapeQuotes(w)+"' ";if(K.opts.verbose)P+=" , schema: "+K.util.toQuotedString(w)+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+W+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&z)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(z)P+=" if (false) { "}else if(K.opts.missingRefs=="ignore"){if(K.logger.warn(A),z)P+=" if (true) { "}else throw new K.MissingRefError(K.baseId,w,A)}else if(X.inline){var M=K.util.copy(K);M.level++;var g="valid"+M.level;M.schema=X.schema,M.schemaPath="",M.errSchemaPath=w;var S=K.validate(M).replace(/validate\.schema/g,X.code);if(P+=" "+S+" ",z)P+=" if ("+g+") { "}else Z=X.$async===!0||K.async&&X.$async!==!1,H=X.code}if(H){var G=G||[];if(G.push(P),P="",K.opts.passContext)P+=" "+H+".call(this, ";else P+=" "+H+"( ";if(P+=" "+W+", (dataPath || '')",K.errorPath!='""')P+=" + "+K.errorPath;var b=O?"data"+(O-1||""):"parentData",d=O?K.dataPathArr[O]:"parentDataProperty";P+=" , "+b+" , "+d+", rootData) ";var p=P;if(P=G.pop(),Z){if(!K.async)throw new Error("async schema referenced by sync schema");if(z)P+=" var "+J+"; ";if(P+=" try { await "+p+"; ",z)P+=" "+J+" = true; ";if(P+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",z)P+=" "+J+" = false; ";if(P+=" } ",z)P+=" if ("+J+") { "}else if(P+=" if (!"+p+") { if (vErrors === null) vErrors = "+H+".errors; else vErrors = vErrors.concat("+H+".errors); errors = vErrors.length; } ",z)P+=" else { "}return P}}),vT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.schema[Y],O=K.schemaPath+K.util.getProperty(Y),w=K.errSchemaPath+"/"+Y,v=!K.opts.allErrors,z=K.util.copy(K),W="";z.level++;var J="valid"+z.level,Z=z.baseId,H=!0,X=$;if(X){var A,G=-1,D=X.length-1;while(G<D)if(A=X[G+=1],K.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:K.util.schemaHasRules(A,K.RULES.all)){if(H=!1,z.schema=A,z.schemaPath=O+"["+G+"]",z.errSchemaPath=w+"/"+G,P+=" "+K.validate(z)+" ",z.baseId=Z,v)P+=" if ("+J+") { ",W+="}"}}if(v)if(H)P+=" if (true) { ";else P+=" "+W.slice(0,-1)+" ";return P}}),zT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D=w.every(function(r){return K.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===!1:K.util.schemaHasRules(r,K.RULES.all)});if(D){var M=X.baseId;P+=" var "+H+" = errors; var "+Z+" = false; ";var g=K.compositeRule;K.compositeRule=X.compositeRule=!0;var S=w;if(S){var b,d=-1,p=S.length-1;while(d<p)b=S[d+=1],X.schema=b,X.schemaPath=v+"["+d+"]",X.errSchemaPath=z+"/"+d,P+=" "+K.validate(X)+" ",X.baseId=M,P+=" "+Z+" = "+Z+" || "+G+"; if (!"+Z+") { ",A+="}"}if(K.compositeRule=X.compositeRule=g,P+=" "+A+" if (!"+Z+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should match some schema in anyOf' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+=" } else { errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ",K.opts.allErrors)P+=" } "}else if(W)P+=" if (true) { ";return P}}),WT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.schema[Y],O=K.errSchemaPath+"/"+Y,w=!K.opts.allErrors,v=K.util.toQuotedString($);if(K.opts.$comment===!0)P+=" console.log("+v+");";else if(typeof K.opts.$comment=="function")P+=" self._opts.$comment("+v+", "+K.util.toQuotedString(O)+", validate.root.schema);";return P}}),JT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="valid"+$,H=K.opts.$data&&w&&w.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",X="schema"+$;else X=w;if(!H)P+=" var schema"+$+" = validate.schema"+v+";";P+="var "+Z+" = equal("+J+", schema"+$+"); if (!"+Z+") { ";var A=A||[];if(A.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'const' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { allowedValue: schema"+$+" } ",K.opts.messages!==!1)P+=" , message: 'should be equal to constant' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var G=P;if(P=A.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+G+"]); ";else P+=" validate.errors = ["+G+"]; return false; ";else P+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" }",W)P+=" else { ";return P}}),HT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D="i"+$,M=X.dataLevel=K.dataLevel+1,g="data"+M,S=K.baseId,b=K.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:K.util.schemaHasRules(w,K.RULES.all);if(P+="var "+H+" = errors;var "+Z+";",b){var d=K.compositeRule;K.compositeRule=X.compositeRule=!0,X.schema=w,X.schemaPath=v,X.errSchemaPath=z,P+=" var "+G+" = false; for (var "+D+" = 0; "+D+" < "+J+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var p=J+"["+D+"]";X.dataPathArr[M]=D;var r=K.validate(X);if(X.baseId=S,K.util.varOccurences(r,g)<2)P+=" "+K.util.varReplace(r,g,p)+" ";else P+=" var "+g+" = "+p+"; "+r+" ";P+=" if ("+G+") break; } ",K.compositeRule=X.compositeRule=d,P+=" "+A+" if (!"+G+") {"}else P+=" if ("+J+".length == 0) {";var l=l||[];if(l.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should contain a valid item' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var R=P;if(P=l.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+R+"]); ";else P+=" validate.errors = ["+R+"]; return false; ";else P+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else { ",b)P+=" errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ";if(K.opts.allErrors)P+=" } ";return P}}),TT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level,G={},D={},M=K.opts.ownProperties;for(d in w){if(d=="__proto__")continue;var g=w[d],S=Array.isArray(g)?D:G;S[d]=g}P+="var "+Z+" = errors;";var b=K.errorPath;P+="var missing"+$+";";for(var d in D)if(S=D[d],S.length){if(P+=" if ( "+J+K.util.getProperty(d)+" !== undefined ",M)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(d)+"') ";if(W){P+=" && ( ";var p=S;if(p){var r,l=-1,R=p.length-1;while(l<R){if(r=p[l+=1],l)P+=" || ";var m=K.util.getProperty(r),y=J+m;if(P+=" ( ( "+y+" === undefined ",M)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(r)+"') ";P+=") && (missing"+$+" = "+K.util.toQuotedString(K.opts.jsonPointers?r:m)+") ) "}}P+=")) { ";var i="missing"+$,t="' + "+i+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.opts.jsonPointers?K.util.getPathExpr(b,i,!0):b+" + "+i;var U=U||[];if(U.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { property: '"+K.util.escapeQuotes(d)+"', missingProperty: '"+t+"', depsCount: "+S.length+", deps: '"+K.util.escapeQuotes(S.length==1?S[0]:S.join(", "))+"' } ",K.opts.messages!==!1){if(P+=" , message: 'should have ",S.length==1)P+="property "+K.util.escapeQuotes(S[0]);else P+="properties "+K.util.escapeQuotes(S.join(", "));P+=" when property "+K.util.escapeQuotes(d)+" is present' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var w8=P;if(P=U.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+w8+"]); ";else P+=" validate.errors = ["+w8+"]; return false; ";else P+=" var err = "+w8+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{P+=" ) { ";var f8=S;if(f8){var r,T8=-1,v8=f8.length-1;while(T8<v8){r=f8[T8+=1];var m=K.util.getProperty(r),t=K.util.escapeQuotes(r),y=J+m;if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPath(b,r,K.opts.jsonPointers);if(P+=" if ( "+y+" === undefined ",M)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(r)+"') ";if(P+=") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { property: '"+K.util.escapeQuotes(d)+"', missingProperty: '"+t+"', depsCount: "+S.length+", deps: '"+K.util.escapeQuotes(S.length==1?S[0]:S.join(", "))+"' } ",K.opts.messages!==!1){if(P+=" , message: 'should have ",S.length==1)P+="property "+K.util.escapeQuotes(S[0]);else P+="properties "+K.util.escapeQuotes(S.join(", "));P+=" when property "+K.util.escapeQuotes(d)+" is present' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}if(P+=" } ",W)X+="}",P+=" else { "}K.errorPath=b;var Y8=H.baseId;for(var d in G){var g=G[d];if(K.opts.strictKeywords?typeof g=="object"&&Object.keys(g).length>0||g===!1:K.util.schemaHasRules(g,K.RULES.all)){if(P+=" "+A+" = true; if ( "+J+K.util.getProperty(d)+" !== undefined ",M)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(d)+"') ";if(P+=") { ",H.schema=g,H.schemaPath=v+K.util.getProperty(d),H.errSchemaPath=z+"/"+K.util.escapeFragment(d),P+=" "+K.validate(H)+" ",H.baseId=Y8,P+=" } ",W)P+=" if ("+A+") { ",X+="}"}}if(W)P+=" "+X+" if ("+Z+" == errors) {";return P}}),ZT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="valid"+$,H=K.opts.$data&&w&&w.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",X="schema"+$;else X=w;var A="i"+$,G="schema"+$;if(!H)P+=" var "+G+" = validate.schema"+v+";";if(P+="var "+Z+";",H)P+=" if (schema"+$+" === undefined) "+Z+" = true; else if (!Array.isArray(schema"+$+")) "+Z+" = false; else {";if(P+=""+Z+" = false;for (var "+A+"=0; "+A+"<"+G+".length; "+A+"++) if (equal("+J+", "+G+"["+A+"])) { "+Z+" = true; break; }",H)P+=" } ";P+=" if (!"+Z+") { ";var D=D||[];if(D.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { allowedValues: schema"+$+" } ",K.opts.messages!==!1)P+=" , message: 'should be equal to one of the allowed values' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var M=P;if(P=D.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+M+"]); ";else P+=" validate.errors = ["+M+"]; return false; ";else P+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" }",W)P+=" else { ";return P}}),kT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||"");if(K.opts.format===!1){if(W)P+=" if (true) { ";return P}var Z=K.opts.$data&&w&&w.$data,H;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",H="schema"+$;else H=w;var X=K.opts.unknownFormats,A=Array.isArray(X);if(Z){var G="format"+$,D="isObject"+$,M="formatType"+$;if(P+=" var "+G+" = formats["+H+"]; var "+D+" = typeof "+G+" == 'object' && !("+G+" instanceof RegExp) && "+G+".validate; var "+M+" = "+D+" && "+G+".type || 'string'; if ("+D+") { ",K.async)P+=" var async"+$+" = "+G+".async; ";if(P+=" "+G+" = "+G+".validate; } if ( ",Z)P+=" ("+H+" !== undefined && typeof "+H+" != 'string') || ";if(P+=" (",X!="ignore"){if(P+=" ("+H+" && !"+G+" ",A)P+=" && self._opts.unknownFormats.indexOf("+H+") == -1 ";P+=") || "}if(P+=" ("+G+" && "+M+" == '"+f+"' && !(typeof "+G+" == 'function' ? ",K.async)P+=" (async"+$+" ? await "+G+"("+J+") : "+G+"("+J+")) ";else P+=" "+G+"("+J+") ";P+=" : "+G+".test("+J+"))))) {"}else{var G=K.formats[w];if(!G)if(X=="ignore"){if(K.logger.warn('unknown format "'+w+'" ignored in schema at path "'+K.errSchemaPath+'"'),W)P+=" if (true) { ";return P}else if(A&&X.indexOf(w)>=0){if(W)P+=" if (true) { ";return P}else throw new Error('unknown format "'+w+'" is used in schema at path "'+K.errSchemaPath+'"');var D=typeof G=="object"&&!(G instanceof RegExp)&&G.validate,M=D&&G.type||"string";if(D){var g=G.async===!0;G=G.validate}if(M!=f){if(W)P+=" if (true) { ";return P}if(g){if(!K.async)throw new Error("async format in sync schema");var S="formats"+K.util.getProperty(w)+".validate";P+=" if (!(await "+S+"("+J+"))) { "}else{P+=" if (! ";var S="formats"+K.util.getProperty(w);if(D)S+=".validate";if(typeof G=="function")P+=" "+S+"("+J+") ";else P+=" "+S+".test("+J+") ";P+=") { "}}var b=b||[];if(b.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'format' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { format: ",Z)P+=""+H;else P+=""+K.util.toQuotedString(w);if(P+=" } ",K.opts.messages!==!1){if(P+=` , message: 'should match format "`,Z)P+="' + "+H+" + '";else P+=""+K.util.escapeQuotes(w);P+=`"' `}if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+K.util.toQuotedString(w);P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var d=P;if(P=b.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+d+"]); ";else P+=" validate.errors = ["+d+"]; return false; ";else P+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { ";return P}}),XT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="valid"+$,H="errs__"+$,X=K.util.copy(K);X.level++;var A="valid"+X.level,G=K.schema.then,D=K.schema.else,M=G!==void 0&&(K.opts.strictKeywords?typeof G=="object"&&Object.keys(G).length>0||G===!1:K.util.schemaHasRules(G,K.RULES.all)),g=D!==void 0&&(K.opts.strictKeywords?typeof D=="object"&&Object.keys(D).length>0||D===!1:K.util.schemaHasRules(D,K.RULES.all)),S=X.baseId;if(M||g){var b;X.createErrors=!1,X.schema=w,X.schemaPath=v,X.errSchemaPath=z,P+=" var "+H+" = errors; var "+Z+" = true; ";var d=K.compositeRule;if(K.compositeRule=X.compositeRule=!0,P+=" "+K.validate(X)+" ",X.baseId=S,X.createErrors=!0,P+=" errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ",K.compositeRule=X.compositeRule=d,M){if(P+=" if ("+A+") { ",X.schema=K.schema.then,X.schemaPath=K.schemaPath+".then",X.errSchemaPath=K.errSchemaPath+"/then",P+=" "+K.validate(X)+" ",X.baseId=S,P+=" "+Z+" = "+A+"; ",M&&g)b="ifClause"+$,P+=" var "+b+" = 'then'; ";else b="'then'";if(P+=" } ",g)P+=" else { "}else P+=" if (!"+A+") { ";if(g){if(X.schema=K.schema.else,X.schemaPath=K.schemaPath+".else",X.errSchemaPath=K.errSchemaPath+"/else",P+=" "+K.validate(X)+" ",X.baseId=S,P+=" "+Z+" = "+A+"; ",M&&g)b="ifClause"+$,P+=" var "+b+" = 'else'; ";else b="'else'";P+=" } "}if(P+=" if (!"+Z+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'if' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { failingKeyword: "+b+" } ",K.opts.messages!==!1)P+=` , message: 'should match "' + `+b+` + '" schema' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+=" } ",W)P+=" else { "}else if(W)P+=" if (true) { ";return P}}),AT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D="i"+$,M=X.dataLevel=K.dataLevel+1,g="data"+M,S=K.baseId;if(P+="var "+H+" = errors;var "+Z+";",Array.isArray(w)){var b=K.schema.additionalItems;if(b===!1){P+=" "+Z+" = "+J+".length <= "+w.length+"; ";var d=z;z=K.errSchemaPath+"/additionalItems",P+=" if (!"+Z+") { ";var p=p||[];if(p.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+w.length+" } ",K.opts.messages!==!1)P+=" , message: 'should NOT have more than "+w.length+" items' ";if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var r=P;if(P=p.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+r+"]); ";else P+=" validate.errors = ["+r+"]; return false; ";else P+=" var err = "+r+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",z=d,W)A+="}",P+=" else { "}var l=w;if(l){var R,m=-1,y=l.length-1;while(m<y)if(R=l[m+=1],K.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:K.util.schemaHasRules(R,K.RULES.all)){P+=" "+G+" = true; if ("+J+".length > "+m+") { ";var i=J+"["+m+"]";X.schema=R,X.schemaPath=v+"["+m+"]",X.errSchemaPath=z+"/"+m,X.errorPath=K.util.getPathExpr(K.errorPath,m,K.opts.jsonPointers,!0),X.dataPathArr[M]=m;var t=K.validate(X);if(X.baseId=S,K.util.varOccurences(t,g)<2)P+=" "+K.util.varReplace(t,g,i)+" ";else P+=" var "+g+" = "+i+"; "+t+" ";if(P+=" } ",W)P+=" if ("+G+") { ",A+="}"}}if(typeof b=="object"&&(K.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:K.util.schemaHasRules(b,K.RULES.all))){X.schema=b,X.schemaPath=K.schemaPath+".additionalItems",X.errSchemaPath=K.errSchemaPath+"/additionalItems",P+=" "+G+" = true; if ("+J+".length > "+w.length+") { for (var "+D+" = "+w.length+"; "+D+" < "+J+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var i=J+"["+D+"]";X.dataPathArr[M]=D;var t=K.validate(X);if(X.baseId=S,K.util.varOccurences(t,g)<2)P+=" "+K.util.varReplace(t,g,i)+" ";else P+=" var "+g+" = "+i+"; "+t+" ";if(W)P+=" if (!"+G+") break; ";if(P+=" } } ",W)P+=" if ("+G+") { ",A+="}"}}else if(K.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:K.util.schemaHasRules(w,K.RULES.all)){X.schema=w,X.schemaPath=v,X.errSchemaPath=z,P+=" for (var "+D+" = 0; "+D+" < "+J+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var i=J+"["+D+"]";X.dataPathArr[M]=D;var t=K.validate(X);if(X.baseId=S,K.util.varOccurences(t,g)<2)P+=" "+K.util.varReplace(t,g,i)+" ";else P+=" var "+g+" = "+i+"; "+t+" ";if(W)P+=" if (!"+G+") break; ";P+=" }"}if(W)P+=" "+A+" if ("+H+" == errors) {";return P}}),g1=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,S,J="data"+(O||""),Z=K.opts.$data&&w&&w.$data,H;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",H="schema"+$;else H=w;var X=Y=="maximum",A=X?"exclusiveMaximum":"exclusiveMinimum",G=K.schema[A],D=K.opts.$data&&G&&G.$data,M=X?"<":">",g=X?">":"<",S=void 0;if(!(Z||typeof w=="number"||w===void 0))throw new Error(Y+" must be number");if(!(D||G===void 0||typeof G=="number"||typeof G=="boolean"))throw new Error(A+" must be number or boolean");if(D){var b=K.util.getData(G.$data,O,K.dataPathArr),d="exclusive"+$,p="exclType"+$,r="exclIsNumber"+$,l="op"+$,R="' + "+l+" + '";P+=" var schemaExcl"+$+" = "+b+"; ",b="schemaExcl"+$,P+=" var "+d+"; var "+p+" = typeof "+b+"; if ("+p+" != 'boolean' && "+p+" != 'undefined' && "+p+" != 'number') { ";var S=A,m=m||[];if(m.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(S||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: '"+A+" should be boolean' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var y=P;if(P=m.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+y+"]); ";else P+=" validate.errors = ["+y+"]; return false; ";else P+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else if ( ",Z)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";if(P+=" "+p+" == 'number' ? ( ("+d+" = "+H+" === undefined || "+b+" "+M+"= "+H+") ? "+J+" "+g+"= "+b+" : "+J+" "+g+" "+H+" ) : ( ("+d+" = "+b+" === true) ? "+J+" "+g+"= "+H+" : "+J+" "+g+" "+H+" ) || "+J+" !== "+J+") { var op"+$+" = "+d+" ? '"+M+"' : '"+M+"='; ",w===void 0)S=A,z=K.errSchemaPath+"/"+A,H=b,Z=D}else{var r=typeof G=="number",R=M;if(r&&Z){var l="'"+R+"'";if(P+=" if ( ",Z)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" ( "+H+" === undefined || "+G+" "+M+"= "+H+" ? "+J+" "+g+"= "+G+" : "+J+" "+g+" "+H+" ) || "+J+" !== "+J+") { "}else{if(r&&w===void 0)d=!0,S=A,z=K.errSchemaPath+"/"+A,H=G,g+="=";else{if(r)H=Math[X?"min":"max"](G,w);if(G===(r?H:!0))d=!0,S=A,z=K.errSchemaPath+"/"+A,g+="=";else d=!1,R+="="}var l="'"+R+"'";if(P+=" if ( ",Z)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" "+J+" "+g+" "+H+" || "+J+" !== "+J+") { "}}S=S||Y;var m=m||[];if(m.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(S||"_limit")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { comparison: "+l+", limit: "+H+", exclusive: "+d+" } ",K.opts.messages!==!1)if(P+=" , message: 'should be "+R+" ",Z)P+="' + "+H;else P+=""+H+"'";if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var y=P;if(P=m.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+y+"]); ";else P+=" validate.errors = ["+y+"]; return false; ";else P+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { ";return P}}),y1=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(O||""),Z=K.opts.$data&&w&&w.$data,H;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",H="schema"+$;else H=w;if(!(Z||typeof w=="number"))throw new Error(Y+" must be number");var X=Y=="maxItems"?">":"<";if(P+="if ( ",Z)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" "+J+".length "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitItems")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT have ",Y=="maxItems")P+="more";else P+="fewer";if(P+=" than ",Z)P+="' + "+H+" + '";else P+=""+w;P+=" items' "}if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),d1=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(O||""),Z=K.opts.$data&&w&&w.$data,H;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",H="schema"+$;else H=w;if(!(Z||typeof w=="number"))throw new Error(Y+" must be number");var X=Y=="maxLength"?">":"<";if(P+="if ( ",Z)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";if(K.opts.unicode===!1)P+=" "+J+".length ";else P+=" ucs2length("+J+") ";P+=" "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitLength")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT be ",Y=="maxLength")P+="longer";else P+="shorter";if(P+=" than ",Z)P+="' + "+H+" + '";else P+=""+w;P+=" characters' "}if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),p1=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(O||""),Z=K.opts.$data&&w&&w.$data,H;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",H="schema"+$;else H=w;if(!(Z||typeof w=="number"))throw new Error(Y+" must be number");var X=Y=="maxProperties"?">":"<";if(P+="if ( ",Z)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" Object.keys("+J+").length "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitProperties")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT have ",Y=="maxProperties")P+="more";else P+="fewer";if(P+=" than ",Z)P+="' + "+H+" + '";else P+=""+w;P+=" properties' "}if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),GT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z=K.opts.$data&&w&&w.$data,H;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",H="schema"+$;else H=w;if(!(Z||typeof w=="number"))throw new Error(Y+" must be number");if(P+="var division"+$+";if (",Z)P+=" "+H+" !== undefined && ( typeof "+H+" != 'number' || ";if(P+=" (division"+$+" = "+J+" / "+H+", ",K.opts.multipleOfPrecision)P+=" Math.abs(Math.round(division"+$+") - division"+$+") > 1e-"+K.opts.multipleOfPrecision+" ";else P+=" division"+$+" !== parseInt(division"+$+") ";if(P+=" ) ",Z)P+=" ) ";P+=" ) { ";var X=X||[];if(X.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { multipleOf: "+H+" } ",K.opts.messages!==!1)if(P+=" , message: 'should be multiple of ",Z)P+="' + "+H;else P+=""+H+"'";if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var A=P;if(P=X.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+A+"]); ";else P+=" validate.errors = ["+A+"]; return false; ";else P+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),uT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="errs__"+$,H=K.util.copy(K);H.level++;var X="valid"+H.level;if(K.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:K.util.schemaHasRules(w,K.RULES.all)){H.schema=w,H.schemaPath=v,H.errSchemaPath=z,P+=" var "+Z+" = errors; ";var A=K.compositeRule;K.compositeRule=H.compositeRule=!0,H.createErrors=!1;var G;if(H.opts.allErrors)G=H.opts.allErrors,H.opts.allErrors=!1;if(P+=" "+K.validate(H)+" ",H.createErrors=!0,G)H.opts.allErrors=G;K.compositeRule=H.compositeRule=A,P+=" if ("+X+") { ";var D=D||[];if(D.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'not' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should NOT be valid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var M=P;if(P=D.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+M+"]); ";else P+=" validate.errors = ["+M+"]; return false; ";else P+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else { errors = "+Z+"; if (vErrors !== null) { if ("+Z+") vErrors.length = "+Z+"; else vErrors = null; } ",K.opts.allErrors)P+=" } "}else{if(P+=" var err = ",K.createErrors!==!1){if(P+=" { keyword: 'not' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should NOT be valid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",W)P+=" if (false) { "}return P}}),hT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D=X.baseId,M="prevValid"+$,g="passingSchemas"+$;P+="var "+H+" = errors , "+M+" = false , "+Z+" = false , "+g+" = null; ";var S=K.compositeRule;K.compositeRule=X.compositeRule=!0;var b=w;if(b){var d,p=-1,r=b.length-1;while(p<r){if(d=b[p+=1],K.opts.strictKeywords?typeof d=="object"&&Object.keys(d).length>0||d===!1:K.util.schemaHasRules(d,K.RULES.all))X.schema=d,X.schemaPath=v+"["+p+"]",X.errSchemaPath=z+"/"+p,P+=" "+K.validate(X)+" ",X.baseId=D;else P+=" var "+G+" = true; ";if(p)P+=" if ("+G+" && "+M+") { "+Z+" = false; "+g+" = ["+g+", "+p+"]; } else { ",A+="}";P+=" if ("+G+") { "+Z+" = "+M+" = true; "+g+" = "+p+"; }"}}if(K.compositeRule=X.compositeRule=S,P+=""+A+"if (!"+Z+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { passingSchemas: "+g+" } ",K.opts.messages!==!1)P+=" , message: 'should match exactly one schema in oneOf' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+="} else { errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; }",K.opts.allErrors)P+=" } ";return P}}),DT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z=K.opts.$data&&w&&w.$data,H;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",H="schema"+$;else H=w;var X=Z?"(new RegExp("+H+"))":K.usePattern(w);if(P+="if ( ",Z)P+=" ("+H+" !== undefined && typeof "+H+" != 'string') || ";P+=" !"+X+".test("+J+") ) { ";var A=A||[];if(A.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { pattern: ",Z)P+=""+H;else P+=""+K.util.toQuotedString(w);if(P+=" } ",K.opts.messages!==!1){if(P+=` , message: 'should match pattern "`,Z)P+="' + "+H+" + '";else P+=""+K.util.escapeQuotes(w);P+=`"' `}if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+K.util.toQuotedString(w);P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var G=P;if(P=A.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+G+"]); ";else P+=" validate.errors = ["+G+"]; return false; ";else P+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),CT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level,G="key"+$,D="idx"+$,M=H.dataLevel=K.dataLevel+1,g="data"+M,S="dataProperties"+$,b=Object.keys(w||{}).filter(T8),d=K.schema.patternProperties||{},p=Object.keys(d).filter(T8),r=K.schema.additionalProperties,l=b.length||p.length,R=r===!1,m=typeof r=="object"&&Object.keys(r).length,y=K.opts.removeAdditional,i=R||m||y,t=K.opts.ownProperties,U=K.baseId,w8=K.schema.required;if(w8&&!(K.opts.$data&&w8.$data)&&w8.length<K.opts.loopRequired)var f8=K.util.toHash(w8);function T8(Pq){return Pq!=="__proto__"}if(P+="var "+Z+" = errors;var "+A+" = true;",t)P+=" var "+S+" = undefined;";if(i){if(t)P+=" "+S+" = "+S+" || Object.keys("+J+"); for (var "+D+"=0; "+D+"<"+S+".length; "+D+"++) { var "+G+" = "+S+"["+D+"]; ";else P+=" for (var "+G+" in "+J+") { ";if(l){if(P+=" var isAdditional"+$+" = !(false ",b.length)if(b.length>8)P+=" || validate.schema"+v+".hasOwnProperty("+G+") ";else{var v8=b;if(v8){var Y8,R8=-1,Y6=v8.length-1;while(R8<Y6)Y8=v8[R8+=1],P+=" || "+G+" == "+K.util.toQuotedString(Y8)+" "}}if(p.length){var j6=p;if(j6){var h,C=-1,T=j6.length-1;while(C<T)h=j6[C+=1],P+=" || "+K.usePattern(h)+".test("+G+") "}}P+=" ); if (isAdditional"+$+") { "}if(y=="all")P+=" delete "+J+"["+G+"]; ";else{var V=K.errorPath,x="' + "+G+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);if(R)if(y)P+=" delete "+J+"["+G+"]; ";else{P+=" "+A+" = false; ";var o=z;z=K.errSchemaPath+"/additionalProperties";var c=c||[];if(c.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { additionalProperty: '"+x+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is an invalid additional property";else P+="should NOT have additional properties";P+="' "}if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var B=P;if(P=c.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+B+"]); ";else P+=" validate.errors = ["+B+"]; return false; ";else P+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(z=o,W)P+=" break; "}else if(m)if(y=="failing"){P+=" var "+Z+" = errors; ";var K8=K.compositeRule;K.compositeRule=H.compositeRule=!0,H.schema=r,H.schemaPath=K.schemaPath+".additionalProperties",H.errSchemaPath=K.errSchemaPath+"/additionalProperties",H.errorPath=K.opts._errorDataPathProperty?K.errorPath:K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);var W8=J+"["+G+"]";H.dataPathArr[M]=G;var $8=K.validate(H);if(H.baseId=U,K.util.varOccurences($8,g)<2)P+=" "+K.util.varReplace($8,g,W8)+" ";else P+=" var "+g+" = "+W8+"; "+$8+" ";P+=" if (!"+A+") { errors = "+Z+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+J+"["+G+"]; } ",K.compositeRule=H.compositeRule=K8}else{H.schema=r,H.schemaPath=K.schemaPath+".additionalProperties",H.errSchemaPath=K.errSchemaPath+"/additionalProperties",H.errorPath=K.opts._errorDataPathProperty?K.errorPath:K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);var W8=J+"["+G+"]";H.dataPathArr[M]=G;var $8=K.validate(H);if(H.baseId=U,K.util.varOccurences($8,g)<2)P+=" "+K.util.varReplace($8,g,W8)+" ";else P+=" var "+g+" = "+W8+"; "+$8+" ";if(W)P+=" if (!"+A+") break; "}K.errorPath=V}if(l)P+=" } ";if(P+=" } ",W)P+=" if ("+A+") { ",X+="}"}var A8=K.opts.useDefaults&&!K.compositeRule;if(b.length){var g8=b;if(g8){var Y8,V8=-1,z6=g8.length-1;while(V8<z6){Y8=g8[V8+=1];var i8=w[Y8];if(K.opts.strictKeywords?typeof i8=="object"&&Object.keys(i8).length>0||i8===!1:K.util.schemaHasRules(i8,K.RULES.all)){var u6=K.util.getProperty(Y8),W8=J+u6,y8=A8&&i8.default!==void 0;H.schema=i8,H.schemaPath=v+u6,H.errSchemaPath=z+"/"+K.util.escapeFragment(Y8),H.errorPath=K.util.getPath(K.errorPath,Y8,K.opts.jsonPointers),H.dataPathArr[M]=K.util.toQuotedString(Y8);var $8=K.validate(H);if(H.baseId=U,K.util.varOccurences($8,g)<2){$8=K.util.varReplace($8,g,W8);var f6=W8}else{var f6=g;P+=" var "+g+" = "+W8+"; "}if(y8)P+=" "+$8+" ";else{if(f8&&f8[Y8]){if(P+=" if ( "+f6+" === undefined ",t)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(Y8)+"') ";P+=") { "+A+" = false; ";var V=K.errorPath,o=z,i6=K.util.escapeQuotes(Y8);if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPath(V,Y8,K.opts.jsonPointers);z=K.errSchemaPath+"/required";var c=c||[];if(c.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+i6+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+i6+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var B=P;if(P=c.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+B+"]); ";else P+=" validate.errors = ["+B+"]; return false; ";else P+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";z=o,K.errorPath=V,P+=" } else { "}else if(W){if(P+=" if ( "+f6+" === undefined ",t)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(Y8)+"') ";P+=") { "+A+" = true; } else { "}else{if(P+=" if ("+f6+" !== undefined ",t)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(Y8)+"') ";P+=" ) { "}P+=" "+$8+" } "}}if(W)P+=" if ("+A+") { ",X+="}"}}}if(p.length){var m6=p;if(m6){var h,b3=-1,o7=m6.length-1;while(b3<o7){h=m6[b3+=1];var i8=d[h];if(K.opts.strictKeywords?typeof i8=="object"&&Object.keys(i8).length>0||i8===!1:K.util.schemaHasRules(i8,K.RULES.all)){if(H.schema=i8,H.schemaPath=K.schemaPath+".patternProperties"+K.util.getProperty(h),H.errSchemaPath=K.errSchemaPath+"/patternProperties/"+K.util.escapeFragment(h),t)P+=" "+S+" = "+S+" || Object.keys("+J+"); for (var "+D+"=0; "+D+"<"+S+".length; "+D+"++) { var "+G+" = "+S+"["+D+"]; ";else P+=" for (var "+G+" in "+J+") { ";P+=" if ("+K.usePattern(h)+".test("+G+")) { ",H.errorPath=K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);var W8=J+"["+G+"]";H.dataPathArr[M]=G;var $8=K.validate(H);if(H.baseId=U,K.util.varOccurences($8,g)<2)P+=" "+K.util.varReplace($8,g,W8)+" ";else P+=" var "+g+" = "+W8+"; "+$8+" ";if(W)P+=" if (!"+A+") break; ";if(P+=" } ",W)P+=" else "+A+" = true; ";if(P+=" } ",W)P+=" if ("+A+") { ",X+="}"}}}}if(W)P+=" "+X+" if ("+Z+" == errors) {";return P}}),VT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level;if(P+="var "+Z+" = errors;",K.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:K.util.schemaHasRules(w,K.RULES.all)){H.schema=w,H.schemaPath=v,H.errSchemaPath=z;var G="key"+$,D="idx"+$,M="i"+$,g="' + "+G+" + '",S=H.dataLevel=K.dataLevel+1,b="data"+S,d="dataProperties"+$,p=K.opts.ownProperties,r=K.baseId;if(p)P+=" var "+d+" = undefined; ";if(p)P+=" "+d+" = "+d+" || Object.keys("+J+"); for (var "+D+"=0; "+D+"<"+d+".length; "+D+"++) { var "+G+" = "+d+"["+D+"]; ";else P+=" for (var "+G+" in "+J+") { ";P+=" var startErrs"+$+" = errors; ";var l=G,R=K.compositeRule;K.compositeRule=H.compositeRule=!0;var m=K.validate(H);if(H.baseId=r,K.util.varOccurences(m,b)<2)P+=" "+K.util.varReplace(m,b,l)+" ";else P+=" var "+b+" = "+l+"; "+m+" ";if(K.compositeRule=H.compositeRule=R,P+=" if (!"+A+") { for (var "+M+"=startErrs"+$+"; "+M+"<errors; "+M+"++) { vErrors["+M+"].propertyName = "+G+"; } var err = ",K.createErrors!==!1){if(P+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { propertyName: '"+g+"' } ",K.opts.messages!==!1)P+=" , message: 'property name \\'"+g+"\\' is invalid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(W)P+=" break; ";P+=" } }"}if(W)P+=" "+X+" if ("+Z+" == errors) {";return P}}),MT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="valid"+$,H=K.opts.$data&&w&&w.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",X="schema"+$;else X=w;var A="schema"+$;if(!H)if(w.length<K.opts.loopRequired&&K.schema.properties&&Object.keys(K.schema.properties).length){var G=[],D=w;if(D){var M,g=-1,S=D.length-1;while(g<S){M=D[g+=1];var b=K.schema.properties[M];if(!(b&&(K.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:K.util.schemaHasRules(b,K.RULES.all))))G[G.length]=M}}}else var G=w;if(H||G.length){var d=K.errorPath,p=H||G.length>=K.opts.loopRequired,r=K.opts.ownProperties;if(W)if(P+=" var missing"+$+"; ",p){if(!H)P+=" var "+A+" = validate.schema"+v+"; ";var l="i"+$,R="schema"+$+"["+l+"]",m="' + "+R+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPathExpr(d,R,K.opts.jsonPointers);if(P+=" var "+Z+" = true; ",H)P+=" if (schema"+$+" === undefined) "+Z+" = true; else if (!Array.isArray(schema"+$+")) "+Z+" = false; else {";if(P+=" for (var "+l+" = 0; "+l+" < "+A+".length; "+l+"++) { "+Z+" = "+J+"["+A+"["+l+"]] !== undefined ",r)P+=" && Object.prototype.hasOwnProperty.call("+J+", "+A+"["+l+"]) ";if(P+="; if (!"+Z+") break; } ",H)P+=" } ";P+=" if (!"+Z+") { ";var y=y||[];if(y.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+m+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+m+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var i=P;if(P=y.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+i+"]); ";else P+=" validate.errors = ["+i+"]; return false; ";else P+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } else { "}else{P+=" if ( ";var t=G;if(t){var U,l=-1,w8=t.length-1;while(l<w8){if(U=t[l+=1],l)P+=" || ";var f8=K.util.getProperty(U),T8=J+f8;if(P+=" ( ( "+T8+" === undefined ",r)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(U)+"') ";P+=") && (missing"+$+" = "+K.util.toQuotedString(K.opts.jsonPointers?U:f8)+") ) "}}P+=") { ";var R="missing"+$,m="' + "+R+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.opts.jsonPointers?K.util.getPathExpr(d,R,!0):d+" + "+R;var y=y||[];if(y.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+m+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+m+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var i=P;if(P=y.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+i+"]); ";else P+=" validate.errors = ["+i+"]; return false; ";else P+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } else { "}else if(p){if(!H)P+=" var "+A+" = validate.schema"+v+"; ";var l="i"+$,R="schema"+$+"["+l+"]",m="' + "+R+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPathExpr(d,R,K.opts.jsonPointers);if(H){if(P+=" if ("+A+" && !Array.isArray("+A+")) { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+m+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+m+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+A+" !== undefined) { "}if(P+=" for (var "+l+" = 0; "+l+" < "+A+".length; "+l+"++) { if ("+J+"["+A+"["+l+"]] === undefined ",r)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", "+A+"["+l+"]) ";if(P+=") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+m+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+m+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",H)P+=" } "}else{var v8=G;if(v8){var U,Y8=-1,R8=v8.length-1;while(Y8<R8){U=v8[Y8+=1];var f8=K.util.getProperty(U),m=K.util.escapeQuotes(U),T8=J+f8;if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPath(d,U,K.opts.jsonPointers);if(P+=" if ( "+T8+" === undefined ",r)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(U)+"') ";if(P+=") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+m+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+m+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}K.errorPath=d}else if(W)P+=" if (true) {";return P}}),NT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(O||""),Z="valid"+$,H=K.opts.$data&&w&&w.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",X="schema"+$;else X=w;if((w||H)&&K.opts.uniqueItems!==!1){if(H)P+=" var "+Z+"; if ("+X+" === false || "+X+" === undefined) "+Z+" = true; else if (typeof "+X+" != 'boolean') "+Z+" = false; else { ";P+=" var i = "+J+".length , "+Z+" = true , j; if (i > 1) { ";var A=K.schema.items&&K.schema.items.type,G=Array.isArray(A);if(!A||A=="object"||A=="array"||G&&(A.indexOf("object")>=0||A.indexOf("array")>=0))P+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+J+"[i], "+J+"[j])) { "+Z+" = false; break outer; } } } ";else{P+=" var itemIndices = {}, item; for (;i--;) { var item = "+J+"[i]; ";var D="checkDataType"+(G?"s":"");if(P+=" if ("+K.util[D](A,"item",K.opts.strictNumbers,!0)+") continue; ",G)P+=` if (typeof item == 'string') item = '"' + item; `;P+=" if (typeof itemIndices[item] == 'number') { "+Z+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}if(P+=" } ",H)P+=" } ";P+=" if (!"+Z+") { ";var M=M||[];if(M.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { i: i, j: j } ",K.opts.messages!==!1)P+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' ";if(K.opts.verbose){if(P+=" , schema: ",H)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var g=P;if(P=M.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+g+"]); ";else P+=" validate.errors = ["+g+"]; return false; ";else P+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { "}else if(W)P+=" if (true) { ";return P}}),bT=H8((q,_)=>{_.exports={$ref:OT(),allOf:vT(),anyOf:zT(),$comment:WT(),const:JT(),contains:HT(),dependencies:TT(),enum:ZT(),format:kT(),if:XT(),items:AT(),maximum:g1(),minimum:g1(),maxItems:y1(),minItems:y1(),maxLength:d1(),minLength:d1(),maxProperties:p1(),minProperties:p1(),multipleOf:GT(),not:uT(),oneOf:hT(),pattern:DT(),properties:CT(),propertyNames:VT(),required:MT(),uniqueItems:NT(),validate:a1()}}),ST=H8((q,_)=>{var j=bT(),K=$K().toHash;_.exports=function Y(){var f=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],P=["type","$comment"],$=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],O=["number","integer","string","array","object","boolean","null"];return f.all=K(P),f.types=K(O),f.forEach(function(w){if(w.rules=w.rules.map(function(v){var z;if(typeof v=="object"){var W=Object.keys(v)[0];z=v[W],v=W,z.forEach(function(Z){P.push(Z),f.all[Z]=!0})}P.push(v);var J=f.all[v]={keyword:v,code:j[v],implements:z};return J}),f.all.$comment={keyword:"$comment",code:j.$comment},w.type)f.types[w.type]=w}),f.keywords=K(P.concat($)),f.custom={},f}}),ET=H8((q,_)=>{var j=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];_.exports=function(K,Y){for(var f=0;f<Y.length;f++){K=JSON.parse(JSON.stringify(K));var P=Y[f].split("/"),$=K,O;for(O=1;O<P.length;O++)$=$[P[O]];for(O=0;O<j.length;O++){var w=j[O],v=$[w];if(v)$[w]={anyOf:[v,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}}}return K}}),RT=H8((q,_)=>{var j=f2().MissingRef;_.exports=K;function K(Y,f,P){var $=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof f=="function")P=f,f=void 0;var O=w(Y).then(function(){var z=$._addSchema(Y,void 0,f);return z.validate||v(z)});if(P)O.then(function(z){P(null,z)},P);return O;function w(z){var W=z.$schema;return W&&!$.getSchema(W)?K.call($,{$ref:W},!0):Promise.resolve()}function v(z){try{return $._compile(z)}catch(J){if(J instanceof j)return W(J);throw J}function W(J){var Z=J.missingSchema;if(A(Z))throw new Error("Schema "+Z+" is loaded but "+J.missingRef+" cannot be resolved");var H=$._loadingSchemas[Z];if(!H)H=$._loadingSchemas[Z]=$._opts.loadSchema(Z),H.then(X,X);return H.then(function(G){if(!A(Z))return w(G).then(function(){if(!A(Z))$.addSchema(G,Z,void 0,f)})}).then(function(){return v(z)});function X(){delete $._loadingSchemas[Z]}function A(G){return $._refs[G]||$._schemas[G]}}}}}),mT=H8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J,Z="data"+(O||""),H="valid"+$,X="errs__"+$,A=K.opts.$data&&w&&w.$data,G;if(A)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",G="schema"+$;else G=w;var D=this,M="definition"+$,g=D.definition,S="",b,d,p,r,l;if(A&&g.$data){l="keywordValidate"+$;var R=g.validateSchema;P+=" var "+M+" = RULES.custom['"+Y+"'].definition; var "+l+" = "+M+".validate;"}else{if(r=K.useCustomRule(D,w,K.schema,K),!r)return;G="validate.schema"+v,l=r.code,b=g.compile,d=g.inline,p=g.macro}var m=l+".errors",y="i"+$,i="ruleErr"+$,t=g.async;if(t&&!K.async)throw new Error("async keyword in sync schema");if(!(d||p))P+=""+m+" = null;";if(P+="var "+X+" = errors;var "+H+";",A&&g.$data){if(S+="}",P+=" if ("+G+" === undefined) { "+H+" = true; } else { ",R)S+="}",P+=" "+H+" = "+M+".validateSchema("+G+"); if ("+H+") { "}if(d)if(g.statements)P+=" "+r.validate+" ";else P+=" "+H+" = "+r.validate+"; ";else if(p){var U=K.util.copy(K),S="";U.level++;var w8="valid"+U.level;U.schema=r.validate,U.schemaPath="";var f8=K.compositeRule;K.compositeRule=U.compositeRule=!0;var T8=K.validate(U).replace(/validate\.schema/g,l);K.compositeRule=U.compositeRule=f8,P+=" "+T8}else{var v8=v8||[];if(v8.push(P),P="",P+=" "+l+".call( ",K.opts.passContext)P+="this";else P+="self";if(b||g.schema===!1)P+=" , "+Z+" ";else P+=" , "+G+" , "+Z+" , validate.schema"+K.schemaPath+" ";if(P+=" , (dataPath || '')",K.errorPath!='""')P+=" + "+K.errorPath;var Y8=O?"data"+(O-1||""):"parentData",R8=O?K.dataPathArr[O]:"parentDataProperty";P+=" , "+Y8+" , "+R8+" , rootData ) ";var Y6=P;if(P=v8.pop(),g.errors===!1){if(P+=" "+H+" = ",t)P+="await ";P+=""+Y6+"; "}else if(t)m="customErrors"+$,P+=" var "+m+" = null; try { "+H+" = await "+Y6+"; } catch (e) { "+H+" = false; if (e instanceof ValidationError) "+m+" = e.errors; else throw e; } ";else P+=" "+m+" = null; "+H+" = "+Y6+"; "}if(g.modifying)P+=" if ("+Y8+") "+Z+" = "+Y8+"["+R8+"];";if(P+=""+S,g.valid){if(W)P+=" if (true) { "}else{if(P+=" if ( ",g.valid===void 0)if(P+=" !",p)P+=""+w8;else P+=""+H;else P+=" "+!g.valid+" ";P+=") { ",J=D.keyword;var v8=v8||[];v8.push(P),P="";var v8=v8||[];if(v8.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(J||"custom")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { keyword: '"+D.keyword+"' } ",K.opts.messages!==!1)P+=` , message: 'should pass "`+D.keyword+`" keyword validation' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+Z+" ";P+=" } "}else P+=" {} ";var j6=P;if(P=v8.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+j6+"]); ";else P+=" validate.errors = ["+j6+"]; return false; ";else P+=" var err = "+j6+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var h=P;if(P=v8.pop(),d)if(g.errors){if(g.errors!="full"){if(P+=" for (var "+y+"="+X+"; "+y+"<errors; "+y+"++) { var "+i+" = vErrors["+y+"]; if ("+i+".dataPath === undefined) "+i+".dataPath = (dataPath || '') + "+K.errorPath+"; if ("+i+".schemaPath === undefined) { "+i+'.schemaPath = "'+z+'"; } ',K.opts.verbose)P+=" "+i+".schema = "+G+"; "+i+".data = "+Z+"; ";P+=" } "}}else if(g.errors===!1)P+=" "+h+" ";else{if(P+=" if ("+X+" == errors) { "+h+" } else { for (var "+y+"="+X+"; "+y+"<errors; "+y+"++) { var "+i+" = vErrors["+y+"]; if ("+i+".dataPath === undefined) "+i+".dataPath = (dataPath || '') + "+K.errorPath+"; if ("+i+".schemaPath === undefined) { "+i+'.schemaPath = "'+z+'"; } ',K.opts.verbose)P+=" "+i+".schema = "+G+"; "+i+".data = "+Z+"; ";P+=" } } "}else if(p){if(P+=" var err = ",K.createErrors!==!1){if(P+=" { keyword: '"+(J||"custom")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { keyword: '"+D.keyword+"' } ",K.opts.messages!==!1)P+=` , message: 'should pass "`+D.keyword+`" keyword validation' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+Z+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; "}else if(g.errors===!1)P+=" "+h+" ";else{if(P+=" if (Array.isArray("+m+")) { if (vErrors === null) vErrors = "+m+"; else vErrors = vErrors.concat("+m+"); errors = vErrors.length; for (var "+y+"="+X+"; "+y+"<errors; "+y+"++) { var "+i+" = vErrors["+y+"]; if ("+i+".dataPath === undefined) "+i+".dataPath = (dataPath || '') + "+K.errorPath+"; "+i+'.schemaPath = "'+z+'"; ',K.opts.verbose)P+=" "+i+".schema = "+G+"; "+i+".data = "+Z+"; ";P+=" } } else { "+h+" } "}if(P+=" } ",W)P+=" else { "}return P}}),B1=H8((q,_)=>{_.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}}),IT=H8((q,_)=>{var j=B1();_.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:j.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:j.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}}),gT=H8((q,_)=>{var j=/^[a-z_$][a-z0-9_$-]*$/i,K=mT(),Y=IT();_.exports={add:f,get:P,remove:$,validate:O};function f(w,v){var z=this.RULES;if(z.keywords[w])throw new Error("Keyword "+w+" is already defined");if(!j.test(w))throw new Error("Keyword "+w+" is not a valid identifier");if(v){this.validateKeyword(v,!0);var W=v.type;if(Array.isArray(W))for(var J=0;J<W.length;J++)H(w,W[J],v);else H(w,W,v);var Z=v.metaSchema;if(Z){if(v.$data&&this._opts.$data)Z={anyOf:[Z,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]};v.validateSchema=this.compile(Z,!0)}}z.keywords[w]=z.all[w]=!0;function H(X,A,G){var D;for(var M=0;M<z.length;M++){var g=z[M];if(g.type==A){D=g;break}}if(!D)D={type:A,rules:[]},z.push(D);var S={keyword:X,definition:G,custom:!0,code:K,implements:G.implements};D.rules.push(S),z.custom[X]=S}return this}function P(w){var v=this.RULES.custom[w];return v?v.definition:this.RULES.keywords[w]||!1}function $(w){var v=this.RULES;delete v.keywords[w],delete v.all[w],delete v.custom[w];for(var z=0;z<v.length;z++){var W=v[z].rules;for(var J=0;J<W.length;J++)if(W[J].keyword==w){W.splice(J,1);break}}return this}function O(w,v){O.errors=null;var z=this._validateKeyword=this._validateKeyword||this.compile(Y,!0);if(z(w))return!0;if(O.errors=z.errors,v)throw new Error("custom keyword definition is invalid: "+this.errorsText(z.errors));else return!1}}),yT=H8((q,_)=>{_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),dT=H8((q,_)=>{var j=fT(),K=Y2(),Y=$T(),f=i1(),P=o1(),$=wT(),O=ST(),w=ET(),v=$K();_.exports=X,X.prototype.validate=A,X.prototype.compile=G,X.prototype.addSchema=D,X.prototype.addMetaSchema=M,X.prototype.validateSchema=g,X.prototype.getSchema=b,X.prototype.removeSchema=r,X.prototype.addFormat=f8,X.prototype.errorsText=w8,X.prototype._addSchema=R,X.prototype._compile=m,X.prototype.compileAsync=RT();var z=gT();X.prototype.addKeyword=z.add,X.prototype.getKeyword=z.get,X.prototype.removeKeyword=z.remove,X.prototype.validateKeyword=z.validate;var W=f2();X.ValidationError=W.Validation,X.MissingRefError=W.MissingRef,X.$dataMetaSchema=w;var J="http://json-schema.org/draft-07/schema",Z=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],H=["/properties"];function X(T){if(!(this instanceof X))return new X(T);if(T=this._opts=v.copy(T)||{},h(this),this._schemas={},this._refs={},this._fragments={},this._formats=$(T.format),this._cache=T.cache||new Y,this._loadingSchemas={},this._compilations=[],this.RULES=O(),this._getId=y(T),T.loopRequired=T.loopRequired||1/0,T.errorDataPath=="property")T._errorDataPathProperty=!0;if(T.serialize===void 0)T.serialize=P;if(this._metaOpts=j6(this),T.formats)Y8(this);if(T.keywords)R8(this);if(T8(this),typeof T.meta=="object")this.addMetaSchema(T.meta);if(T.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});v8(this)}function A(T,V){var x;if(typeof T=="string"){if(x=this.getSchema(T),!x)throw new Error('no schema with key or ref "'+T+'"')}else{var o=this._addSchema(T);x=o.validate||this._compile(o)}var c=x(V);if(x.$async!==!0)this.errors=x.errors;return c}function G(T,V){var x=this._addSchema(T,void 0,V);return x.validate||this._compile(x)}function D(T,V,x,o){if(Array.isArray(T)){for(var c=0;c<T.length;c++)this.addSchema(T[c],void 0,x,o);return this}var B=this._getId(T);if(B!==void 0&&typeof B!="string")throw new Error("schema id must be string");return V=K.normalizeId(V||B),Y6(this,V),this._schemas[V]=this._addSchema(T,x,o,!0),this}function M(T,V,x){return this.addSchema(T,V,x,!0),this}function g(T,V){var x=T.$schema;if(x!==void 0&&typeof x!="string")throw new Error("$schema must be a string");if(x=x||this._opts.defaultMeta||S(this),!x)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var o=this.validate(x,T);if(!o&&V){var c="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(c);else throw new Error(c)}return o}function S(T){var V=T._opts.meta;return T._opts.defaultMeta=typeof V=="object"?T._getId(V)||V:T.getSchema(J)?J:void 0,T._opts.defaultMeta}function b(T){var V=p(this,T);switch(typeof V){case"object":return V.validate||this._compile(V);case"string":return this.getSchema(V);case"undefined":return d(this,T)}}function d(T,V){var x=K.schema.call(T,{schema:{}},V);if(x){var{schema:o,root:c,baseId:B}=x,K8=j.call(T,o,c,void 0,B);return T._fragments[V]=new f({ref:V,fragment:!0,schema:o,root:c,baseId:B,validate:K8}),K8}}function p(T,V){return V=K.normalizeId(V),T._schemas[V]||T._refs[V]||T._fragments[V]}function r(T){if(T instanceof RegExp)return l(this,this._schemas,T),l(this,this._refs,T),this;switch(typeof T){case"undefined":return l(this,this._schemas),l(this,this._refs),this._cache.clear(),this;case"string":var V=p(this,T);if(V)this._cache.del(V.cacheKey);return delete this._schemas[T],delete this._refs[T],this;case"object":var x=this._opts.serialize,o=x?x(T):T;this._cache.del(o);var c=this._getId(T);if(c)c=K.normalizeId(c),delete this._schemas[c],delete this._refs[c]}return this}function l(T,V,x){for(var o in V){var c=V[o];if(!c.meta&&(!x||x.test(o)))T._cache.del(c.cacheKey),delete V[o]}}function R(T,V,x,o){if(typeof T!="object"&&typeof T!="boolean")throw new Error("schema should be object or boolean");var c=this._opts.serialize,B=c?c(T):T,K8=this._cache.get(B);if(K8)return K8;o=o||this._opts.addUsedSchema!==!1;var W8=K.normalizeId(this._getId(T));if(W8&&o)Y6(this,W8);var $8=this._opts.validateSchema!==!1&&!V,A8;if($8&&!(A8=W8&&W8==K.normalizeId(T.$schema)))this.validateSchema(T,!0);var g8=K.ids.call(this,T),V8=new f({id:W8,schema:T,localRefs:g8,cacheKey:B,meta:x});if(W8[0]!="#"&&o)this._refs[W8]=V8;if(this._cache.put(B,V8),$8&&A8)this.validateSchema(T,!0);return V8}function m(T,V){if(T.compiling){if(T.validate=c,c.schema=T.schema,c.errors=null,c.root=V?V:c,T.schema.$async===!0)c.$async=!0;return c}T.compiling=!0;var x;if(T.meta)x=this._opts,this._opts=this._metaOpts;var o;try{o=j.call(this,T.schema,V,T.localRefs)}catch(B){throw delete T.validate,B}finally{if(T.compiling=!1,T.meta)this._opts=x}return T.validate=o,T.refs=o.refs,T.refVal=o.refVal,T.root=o.root,o;function c(){var B=T.validate,K8=B.apply(this,arguments);return c.errors=B.errors,K8}}function y(T){switch(T.schemaId){case"auto":return U;case"id":return i;default:return t}}function i(T){if(T.$id)this.logger.warn("schema $id ignored",T.$id);return T.id}function t(T){if(T.id)this.logger.warn("schema id ignored",T.id);return T.$id}function U(T){if(T.$id&&T.id&&T.$id!=T.id)throw new Error("schema $id is different from id");return T.$id||T.id}function w8(T,V){if(T=T||this.errors,!T)return"No errors";V=V||{};var x=V.separator===void 0?", ":V.separator,o=V.dataVar===void 0?"data":V.dataVar,c="";for(var B=0;B<T.length;B++){var K8=T[B];if(K8)c+=o+K8.dataPath+" "+K8.message+x}return c.slice(0,-x.length)}function f8(T,V){if(typeof V=="string")V=new RegExp(V);return this._formats[T]=V,this}function T8(T){var V;if(T._opts.$data)V=yT(),T.addMetaSchema(V,V.$id,!0);if(T._opts.meta===!1)return;var x=B1();if(T._opts.$data)x=w(x,H);T.addMetaSchema(x,J,!0),T._refs["http://json-schema.org/schema"]=J}function v8(T){var V=T._opts.schemas;if(!V)return;if(Array.isArray(V))T.addSchema(V);else for(var x in V)T.addSchema(V[x],x)}function Y8(T){for(var V in T._opts.formats){var x=T._opts.formats[V];T.addFormat(V,x)}}function R8(T){for(var V in T._opts.keywords){var x=T._opts.keywords[V];T.addKeyword(V,x)}}function Y6(T,V){if(T._schemas[V]||T._refs[V])throw new Error('schema with key or id "'+V+'" already exists')}function j6(T){var V=v.copy(T._opts);for(var x=0;x<Z.length;x++)delete V[Z[x]];return V}function h(T){var V=T._opts.logger;if(V===!1)T.logger={log:C,warn:C,error:C};else{if(V===void 0)V=console;if(!(typeof V=="object"&&V.log&&V.warn&&V.error))throw new Error("logger must implement log, warn and error methods");T.logger=V}}function C(){}});rT={accessSync(q,_){J8.accessSync(q,_)},cwd(){return process.cwd()},chmodSync(q,_){J8.chmodSync(q,_)},existsSync(q){return J8.existsSync(q)},async stat(q){return cT(q)},statSync(q){return J8.statSync(q)},readFileSync(q,_){return J8.readFileSync(q,{encoding:_.encoding})},readFileBytesSync(q){return J8.readFileSync(q)},readSync(q,_){let j=void 0;try{j=J8.openSync(q,"r");let K=Buffer.alloc(_.length),Y=J8.readSync(j,K,0,_.length,0);return{buffer:K,bytesRead:Y}}finally{if(j)J8.closeSync(j)}},writeFileSync(q,_,j){if(!j.flush){J8.writeFileSync(q,_,{encoding:j.encoding});return}let K;try{K=J8.openSync(q,"w"),J8.writeFileSync(K,_,{encoding:j.encoding}),J8.fsyncSync(K)}finally{if(K)J8.closeSync(K)}},appendFileSync(q,_){J8.appendFileSync(q,_)},copyFileSync(q,_){J8.copyFileSync(q,_)},unlinkSync(q){J8.unlinkSync(q)},renameSync(q,_){J8.renameSync(q,_)},symlinkSync(q,_){J8.symlinkSync(q,_)},readlinkSync(q){return J8.readlinkSync(q)},realpathSync(q){return J8.realpathSync(q)},mkdirSync(q){if(!J8.existsSync(q))J8.mkdirSync(q,{recursive:!0})},readdirSync(q){return J8.readdirSync(q,{withFileTypes:!0})},readdirStringSync(q){return J8.readdirSync(q)},isDirEmptySync(q){return this.readdirSync(q).length===0},rmdirSync(q){J8.rmdirSync(q)},rmSync(q,_){J8.rmSync(q,_)}},iT=rT;a_=class a_ extends Error{};F1=class F1{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(q){this.returned=q}[Symbol.asyncIterator](){if(this.started)throw new Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((q,_)=>{this.readResolve=q,this.readReject=_})}enqueue(q){if(this.readResolve){let _=this.readResolve;this.readResolve=void 0,this.readReject=void 0,_({done:!1,value:q})}else this.queue.push(q)}done(){if(this.isDone=!0,this.readResolve){let q=this.readResolve;this.readResolve=void 0,this.readReject=void 0,q({done:!0,value:void 0})}}error(q){if(this.hasError=q,this.readReject){let _=this.readReject;this.readResolve=void 0,this.readReject=void 0,_(q)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}};s1=class s1{transport;isStreamingMode;canUseTool;hooks;abortController;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new F1;intialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;pendingMcpResponses=new Map;constructor(q,_,j,K,Y,f=new Map){this.transport=q,this.isStreamingMode=_,this.canUseTool=j,this.hooks=K,this.abortController=Y;for(let[P,$]of f){let O=new U1((w)=>this.sendMcpServerMessageToCli(P,w));this.sdkMcpTransports.set(P,O),$.connect(O)}if(this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.isStreamingMode)this.intialization=this.initialize()}setError(q){this.inputStream.error(q)}cleanup(q){if(this.cleanupPerformed)return;this.cleanupPerformed=!0;try{if(this.transport.close(),this.pendingControlResponses.clear(),this.pendingMcpResponses.clear(),q)this.inputStream.error(q);else this.inputStream.done()}catch(_){}}next(...[q]){return this.sdkMessages.next(...[q])}return(q){return this.sdkMessages.return(q)}throw(q){return this.sdkMessages.throw(q)}[Symbol.asyncIterator](){return this.sdkMessages}[Symbol.asyncDispose](){return this.sdkMessages[Symbol.asyncDispose]()}async readMessages(){try{for await(let q of this.transport.readMessages()){if(q.type==="control_response"){let _=this.pendingControlResponses.get(q.response.request_id);if(_)_(q.response);continue}else if(q.type==="control_request"){this.handleControlRequest(q);continue}else if(q.type==="control_cancel_request"){this.handleControlCancelRequest(q);continue}this.inputStream.enqueue(q)}this.inputStream.done(),this.cleanup()}catch(q){this.inputStream.error(q),this.cleanup(q)}}async handleControlRequest(q){let _=new AbortController;this.cancelControllers.set(q.request_id,_);try{let j=await this.processControlRequest(q,_.signal),K={type:"control_response",response:{subtype:"success",request_id:q.request_id,response:j}};await Promise.resolve(this.transport.write(JSON.stringify(K)+`
108
+ END-CONTEXT-DATA -->{{/if}}`,UC,sC,_T;var K2=Q8(()=>{_2=e6(U4(),1);UC=_2.default.compile(QH,{noEscape:!0}),sC=_2.default.compile(qT,{noEscape:!0});_T={NO_MEMORIES:(q)=>({message:`No previous memories found for ${q}`,suggestion:"This appears to be your first session. Memories will be created as you work."}),CONNECTION_FAILED:()=>({message:"Could not connect to memory system",suggestion:"Try restarting Claude Code or check if the MCP server is properly configured."}),SEARCH_FAILED:(q)=>({message:`Search for "${q}" didn't return any results`,suggestion:"Try using different keywords or check if memories exist for this project."}),LOAD_TIMEOUT:()=>({message:"Memory loading timed out",suggestion:"The operation is taking longer than expected. You can continue without loaded context."})}});import{join as a1}from"path";import{fileURLToPath as aT}from"url";import{setMaxListeners as BT}from"events";import{spawn as eT}from"child_process";import{createInterface as FT}from"readline";import*as J8 from"fs";import{stat as UT}from"fs/promises";function KP(q=tT){let _=new AbortController;return BT(q,_.signal),_}function qZ(){return QT}class jP{options;child;childStdin;childStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(q){this.options=q,this.abortController=q.abortController||KP(),this.initialize()}initialize(){try{let{prompt:q,additionalDirectories:_=[],cwd:j,executable:K=this.isRunningWithBun()?"bun":"node",executableArgs:f=[],extraArgs:Y={},pathToClaudeCodeExecutable:P,env:$={...process.env},stderr:O,customSystemPrompt:w,appendSystemPrompt:v,maxTurns:z,model:W,fallbackModel:H,permissionMode:Z,permissionPromptToolName:J,continueConversation:X,resume:A,allowedTools:G=[],disallowedTools:D=[],mcpServers:V,strictMcpConfig:m,canUseTool:S}=this.options,b=["--output-format","stream-json","--verbose"];if(w)b.push("--system-prompt",w);if(v)b.push("--append-system-prompt",v);if(z)b.push("--max-turns",z.toString());if(W)b.push("--model",W);if($.DEBUG)b.push("--debug-to-stderr");if(S){if(typeof q==="string")throw new Error("canUseTool callback requires --input-format stream-json. Please set prompt as an AsyncIterable.");if(J)throw new Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");b.push("--permission-prompt-tool","stdio")}else if(J)b.push("--permission-prompt-tool",J);if(X)b.push("--continue");if(A)b.push("--resume",A);if(G.length>0)b.push("--allowedTools",G.join(","));if(D.length>0)b.push("--disallowedTools",D.join(","));if(V&&Object.keys(V).length>0)b.push("--mcp-config",JSON.stringify({mcpServers:V}));if(m)b.push("--strict-mcp-config");if(Z&&Z!=="default")b.push("--permission-mode",Z);if(H){if(W&&H===W)throw new Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");b.push("--fallback-model",H)}if(typeof q==="string")b.push("--print"),b.push("--",q.trim());else b.push("--input-format","stream-json");for(let y of _)b.push("--add-dir",y);for(let[y,i]of Object.entries(Y))if(i===null)b.push(`--${y}`);else b.push(`--${y}`,i);if(!$.CLAUDE_CODE_ENTRYPOINT)$.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(!qZ().existsSync(P)){let y=B1(P)?`Claude Code native binary not found at ${P}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${P}. Is options.pathToClaudeCodeExecutable set?`;throw new ReferenceError(y)}let p=B1(P),r=p?P:K,l=p?b:[...f,P,...b];this.logDebug(p?`Spawning Claude Code native binary: ${P} ${b.join(" ")}`:`Spawning Claude Code process: ${K} ${[...f,P,...b].join(" ")}`);let R=$.DEBUG||O?"pipe":"ignore";if(this.child=eT(r,l,{cwd:j,stdio:["pipe","pipe",R],signal:this.abortController.signal,env:$}),this.childStdin=this.child.stdin,this.childStdout=this.child.stdout,typeof q==="string")this.childStdin.end(),this.childStdin=void 0;if($.DEBUG||O)this.child.stderr.on("data",(y)=>{if(this.logDebug(`Claude Code stderr: ${y.toString()}`),O)O(y.toString())});let I=()=>{if(this.child&&!this.child.killed)this.child.kill("SIGTERM")};this.processExitHandler=I,this.abortHandler=I,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.child.on("error",(y)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new F_("Claude Code process aborted by user");else this.exitError=new Error(`Failed to spawn Claude Code process: ${y.message}`),this.logDebug(this.exitError.message)}),this.child.on("close",(y,i)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new F_("Claude Code process aborted by user");else{let t=this.getProcessExitError(y,i);if(t)this.exitError=t,this.logDebug(t.message)}}),this.ready=!0}catch(q){throw this.ready=!1,q}}getProcessExitError(q,_){if(q!==0&&q!==null)return new Error(`Claude Code process exited with code ${q}`);else if(_)return new Error(`Claude Code process terminated by signal ${_}`);return}isRunningWithBun(){return process.versions.bun!==void 0||process.env.BUN_INSTALL!==void 0}logDebug(q){if(process.env.DEBUG)process.stderr.write(`${q}
109
+ `)}write(q){if(this.abortController.signal.aborted)throw new F_("Operation aborted");if(!this.ready||!this.childStdin)throw new Error("ProcessTransport is not ready for writing");if(this.child?.killed||this.child?.exitCode!==null)throw new Error("Cannot write to terminated process");if(this.exitError)throw new Error(`Cannot write to process that exited with error: ${this.exitError.message}`);if(process.env.DEBUG_SDK)process.stderr.write(`[ProcessTransport] Writing to stdin: ${q.substring(0,100)}
110
+ `);try{if(!this.childStdin.write(q)&&process.env.DEBUG_SDK)console.warn("[ProcessTransport] Write buffer full, data queued")}catch(_){throw this.ready=!1,new Error(`Failed to write to process stdin: ${_.message}`)}}close(){if(this.childStdin)this.childStdin.end(),this.childStdin=void 0;if(this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;for(let{handler:q}of this.exitListeners)this.child?.off("exit",q);if(this.exitListeners=[],this.child&&!this.child.killed)this.child.kill("SIGTERM"),setTimeout(()=>{if(this.child&&!this.child.killed)this.child.kill("SIGKILL")},5000);this.ready=!1}isReady(){return this.ready}async*readMessages(){if(!this.childStdout)throw new Error("ProcessTransport output stream not available");let q=FT({input:this.childStdout});try{for await(let _ of q)if(_.trim())yield JSON.parse(_);await this.waitForExit()}catch(_){throw _}finally{q.close()}}endInput(){if(this.childStdin)this.childStdin.end()}getInputStream(){return this.childStdin}onExit(q){if(!this.child)return()=>{};let _=(j,K)=>{let f=this.getProcessExitError(j,K);q(f)};return this.child.on("exit",_),this.exitListeners.push({callback:q,handler:_}),()=>{if(this.child)this.child.off("exit",_);let j=this.exitListeners.findIndex((K)=>K.handler===_);if(j!==-1)this.exitListeners.splice(j,1)}}async waitForExit(){if(!this.child){if(this.exitError)throw this.exitError;return}if(this.child.exitCode!==null||this.child.killed){if(this.exitError)throw this.exitError;return}return new Promise((q,_)=>{let j=(f,Y)=>{if(this.abortController.signal.aborted){_(new F_("Operation aborted"));return}let P=this.getProcessExitError(f,Y);if(P)_(P);else q()};this.child.once("exit",j);let K=(f)=>{this.child.off("exit",j),_(f)};this.child.once("error",K),this.child.once("exit",()=>{this.child.off("error",K)})})}}function B1(q){return![".js",".mjs",".tsx",".ts",".jsx"].some((j)=>q.endsWith(j))}class fP{sendMcpMessage;isClosed=!1;constructor(q){this.sendMcpMessage=q}onclose;onerror;onmessage;async start(){}async send(q){if(this.isClosed)throw new Error("Transport is closed");this.sendMcpMessage(q)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}function jZ(q){$P=q}function s3(){return $P}function F(q,_){let j=s3(),K=Q3({issueData:_,data:q.data,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,j,j===Q_?void 0:Q_].filter((f)=>!!f)});q.common.issues.push(K)}class X6{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(q,_){let j=[];for(let K of _){if(K.status==="aborted")return O8;if(K.status==="dirty")q.dirty();j.push(K.value)}return{status:q.value,value:j}}static async mergeObjectAsync(q,_){let j=[];for(let K of _){let f=await K.key,Y=await K.value;j.push({key:f,value:Y})}return X6.mergeObjectSync(q,j)}static mergeObjectSync(q,_){let j={};for(let K of _){let{key:f,value:Y}=K;if(f.status==="aborted")return O8;if(Y.status==="aborted")return O8;if(f.status==="dirty")q.dirty();if(Y.status==="dirty")q.dirty();if(f.value!=="__proto__"&&(typeof Y.value!=="undefined"||K.alwaysSet))j[f.value]=Y.value}return{status:q.value,value:j}}}class Wq{constructor(q,_,j,K){this._cachedPath=[],this.parent=q,this.data=_,this._path=j,this._key=K}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 Z8(q){if(!q)return{};let{errorMap:_,invalid_type_error:j,required_error:K,description:f}=q;if(_&&(j||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(_)return{errorMap:_,description:f};return{errorMap:(P,$)=>{let{message:O}=q;if(P.code==="invalid_enum_value")return{message:O??$.defaultError};if(typeof $.data==="undefined")return{message:O??K??$.defaultError};if(P.code!=="invalid_type")return{message:$.defaultError};return{message:O??j??$.defaultError}},description:f}}class k8{get description(){return this._def.description}_getType(q){return Lq(q.data)}_getOrReturnCtx(q,_){return _||{common:q.parent.common,data:q.data,parsedType:Lq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}_processInputParams(q){return{status:new X6,ctx:{common:q.parent.common,data:q.data,parsedType:Lq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}}_parseSync(q){let _=this._parse(q);if(aK(_))throw new Error("Synchronous parse encountered promise.");return _}_parseAsync(q){let _=this._parse(q);return Promise.resolve(_)}parse(q,_){let j=this.safeParse(q,_);if(j.success)return j.data;throw j.error}safeParse(q,_){let j={common:{issues:[],async:_?.async??!1,contextualErrorMap:_?.errorMap},path:_?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:Lq(q)},K=this._parseSync({data:q,path:j.path,parent:j});return t1(j,K)}"~validate"(q){let _={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:Lq(q)};if(!this["~standard"].async)try{let j=this._parseSync({data:q,path:[],parent:_});return W_(j)?{value:j.value}:{issues:_.common.issues}}catch(j){if(j?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;_.common={issues:[],async:!0}}return this._parseAsync({data:q,path:[],parent:_}).then((j)=>W_(j)?{value:j.value}:{issues:_.common.issues})}async parseAsync(q,_){let j=await this.safeParseAsync(q,_);if(j.success)return j.data;throw j.error}async safeParseAsync(q,_){let j={common:{issues:[],contextualErrorMap:_?.errorMap,async:!0},path:_?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:Lq(q)},K=this._parse({data:q,path:j.path,parent:j}),f=await(aK(K)?K:Promise.resolve(K));return t1(j,f)}refine(q,_){let j=(K)=>{if(typeof _==="string"||typeof _==="undefined")return{message:_};else if(typeof _==="function")return _(K);else return _};return this._refinement((K,f)=>{let Y=q(K),P=()=>f.addIssue({code:e.custom,...j(K)});if(typeof Promise!=="undefined"&&Y instanceof Promise)return Y.then(($)=>{if(!$)return P(),!1;else return!0});if(!Y)return P(),!1;else return!0})}refinement(q,_){return this._refinement((j,K)=>{if(!q(j))return K.addIssue(typeof _==="function"?_(j,K):_),!1;else return!0})}_refinement(q){return new s6({schema:this,typeName:z8.ZodEffects,effect:{type:"refinement",refinement:q}})}superRefine(q){return this._refinement(q)}constructor(q){this.spa=this.safeParseAsync,this._def=q,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:(_)=>this["~validate"](_)}}optional(){return zq.create(this,this._def)}nullable(){return lq.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vq.create(this)}promise(){return Z_.create(this,this._def)}or(q){return jK.create([this,q],this._def)}and(q){return PK.create(this,q,this._def)}transform(q){return new s6({...Z8(this._def),schema:this,typeName:z8.ZodEffects,effect:{type:"transform",transform:q}})}default(q){let _=typeof q==="function"?q:()=>q;return new wK({...Z8(this._def),innerType:this,defaultValue:_,typeName:z8.ZodDefault})}brand(){return new _7({typeName:z8.ZodBranded,type:this,...Z8(this._def)})}catch(q){let _=typeof q==="function"?q:()=>q;return new OK({...Z8(this._def),innerType:this,catchValue:_,typeName:z8.ZodCatch})}describe(q){return new this.constructor({...this._def,description:q})}pipe(q){return sK.create(this,q)}readonly(){return vK.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function OP(q){let _="[0-5]\\d";if(q.precision)_=`${_}\\.\\d{${q.precision}}`;else if(q.precision==null)_=`${_}(\\.\\d+)?`;let j=q.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${_})${j}`}function uZ(q){return new RegExp(`^${OP(q)}$`)}function vP(q){let _=`${wP}T${OP(q)}`,j=[];if(j.push(q.local?"Z?":"Z"),q.offset)j.push("([+-]\\d{2}:?\\d{2})");return _=`${_}(${j.join("|")})`,new RegExp(`^${_}$`)}function hZ(q,_){if((_==="v4"||!_)&&HZ.test(q))return!0;if((_==="v6"||!_)&&ZZ.test(q))return!0;return!1}function DZ(q,_){if(!vZ.test(q))return!1;try{let[j]=q.split(".");if(!j)return!1;let K=j.replace(/-/g,"+").replace(/_/g,"/").padEnd(j.length+(4-j.length%4)%4,"="),f=JSON.parse(atob(K));if(typeof f!=="object"||f===null)return!1;if("typ"in f&&f?.typ!=="JWT")return!1;if(!f.alg)return!1;if(_&&f.alg!==_)return!1;return!0}catch{return!1}}function CZ(q,_){if((_==="v4"||!_)&&TZ.test(q))return!0;if((_==="v6"||!_)&&kZ.test(q))return!0;return!1}function VZ(q,_){let j=(q.toString().split(".")[1]||"").length,K=(_.toString().split(".")[1]||"").length,f=j>K?j:K,Y=Number.parseInt(q.toFixed(f).replace(".","")),P=Number.parseInt(_.toFixed(f).replace(".",""));return Y%P/10**f}function e_(q){if(q instanceof i8){let _={};for(let j in q.shape){let K=q.shape[j];_[j]=zq.create(e_(K))}return new i8({...q._def,shape:()=>_})}else if(q instanceof vq)return new vq({...q._def,type:e_(q.element)});else if(q instanceof zq)return zq.create(e_(q.unwrap()));else if(q instanceof lq)return lq.create(e_(q.unwrap()));else if(q instanceof Dq)return Dq.create(q.items.map((_)=>e_(_)));else return q}function w2(q,_){let j=Lq(q),K=Lq(_);if(q===_)return{valid:!0,data:q};else if(j===Q.object&&K===Q.object){let f=u8.objectKeys(_),Y=u8.objectKeys(q).filter(($)=>f.indexOf($)!==-1),P={...q,..._};for(let $ of Y){let O=w2(q[$],_[$]);if(!O.valid)return{valid:!1};P[$]=O.data}return{valid:!0,data:P}}else if(j===Q.array&&K===Q.array){if(q.length!==_.length)return{valid:!1};let f=[];for(let Y=0;Y<q.length;Y++){let P=q[Y],$=_[Y],O=w2(P,$);if(!O.valid)return{valid:!1};f.push(O.data)}return{valid:!0,data:f}}else if(j===Q.date&&K===Q.date&&+q===+_)return{valid:!0,data:q};else return{valid:!1}}function zP(q,_){return new Fq({values:q,typeName:z8.ZodEnum,...Z8(_)})}function e1(q,_){let j=typeof q==="function"?q(_):typeof q==="string"?{message:q}:q;return typeof j==="string"?{message:j}:j}function WP(q,_={},j){if(q)return H_.create().superRefine((K,f)=>{let Y=q(K);if(Y instanceof Promise)return Y.then((P)=>{if(!P){let $=e1(_,K),O=$.fatal??j??!0;f.addIssue({code:"custom",...$,fatal:O})}});if(!Y){let P=e1(_,K),$=P.fatal??j??!0;f.addIssue({code:"custom",...P,fatal:$})}return});return H_.create()}function ZX(q){if(!q)return{};let{errorMap:_,invalid_type_error:j,required_error:K,description:f}=q;if(_&&(j||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(_)return{errorMap:_,description:f};return{errorMap:(P,$)=>{var O,w;let{message:v}=q;if(P.code==="invalid_enum_value")return{message:v!==null&&v!==void 0?v:$.defaultError};if(typeof $.data==="undefined")return{message:(O=v!==null&&v!==void 0?v:K)!==null&&O!==void 0?O:$.defaultError};if(P.code!=="invalid_type")return{message:$.defaultError};return{message:(w=v!==null&&v!==void 0?v:j)!==null&&w!==void 0?w:$.defaultError}},description:f}}function _3({prompt:q,options:{abortController:_=KP(),additionalDirectories:j=[],allowedTools:K=[],appendSystemPrompt:f,canUseTool:Y,continue:P,customSystemPrompt:$,cwd:O,disallowedTools:w=[],env:v,executable:z=kX()?"bun":"node",executableArgs:W=[],extraArgs:H={},fallbackModel:Z,hooks:J,maxTurns:X,mcpServers:A,model:G,pathToClaudeCodeExecutable:D,permissionMode:V="default",permissionPromptToolName:m,resume:S,stderr:b,strictMcpConfig:d}={}}){if(!v)v={...process.env};if(!v.CLAUDE_CODE_ENTRYPOINT)v.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(D===void 0){let y=aT(import.meta.url),i=a1(y,"..");D=a1(i,"cli.js")}let p={},r=new Map;if(A)for(let[y,i]of Object.entries(A))if(i.type==="sdk")r.set(y,i.instance),p[y]={type:"sdk",name:y};else p[y]=i;let l=typeof q!=="string",R=new jP({prompt:q,abortController:_,additionalDirectories:j,cwd:O,executable:z,executableArgs:W,extraArgs:H,pathToClaudeCodeExecutable:D,env:v,stderr:b,customSystemPrompt:$,appendSystemPrompt:f,maxTurns:X,model:G,fallbackModel:Z,permissionMode:V,permissionPromptToolName:m,continueConversation:P,resume:S,allowedTools:K,disallowedTools:w,mcpServers:A,strictMcpConfig:d,canUseTool:!!Y,hooks:!!J}),I=new YP(R,l,Y,J,_,r);if(typeof q!=="string")I.streamInput(q);return I}function kX(){return process.versions.bun!==void 0||process.env.BUN_INSTALL!==void 0}var YT,$T,P2,wT,OT,vT=(q,_,j)=>{j=q!=null?YT($T(q)):{};let K=_||!q||!q.__esModule?P2(j,"default",{value:q,enumerable:!0}):j;for(let f of wT(q))if(!OT.call(K,f))P2(K,f,{get:()=>q[f],enumerable:!0});return K},H8=(q,_)=>()=>(_||q((_={exports:{}}).exports,_),_.exports),zT=(q,_)=>{for(var j in _)P2(q,j,{get:_[j],enumerable:!0,configurable:!0,set:(K)=>_[j]=()=>K})},WT,z2,JT,zK,s1,HT,W2,J2,Q1,qP,TT,ZT,kT,XT,AT,GT,uT,hT,DT,CT,VT,MT,NT,bT,c1,r1,i1,o1,ST,ET,RT,mT,IT,gT,yT,dT,pT,LT,lT,xT,nT,_P,cT,rT,iT,oT,tT=50,sT,QT,F_,PP,YP,k,u8,f2,Q,Lq=(q)=>{switch(typeof q){case"undefined":return Q.undefined;case"string":return Q.string;case"number":return Number.isNaN(q)?Q.nan:Q.number;case"boolean":return Q.boolean;case"function":return Q.function;case"bigint":return Q.bigint;case"symbol":return Q.symbol;case"object":if(Array.isArray(q))return Q.array;if(q===null)return Q.null;if(q.then&&typeof q.then==="function"&&q.catch&&typeof q.catch==="function")return Q.promise;if(typeof Map!=="undefined"&&q instanceof Map)return Q.map;if(typeof Set!=="undefined"&&q instanceof Set)return Q.set;if(typeof Date!=="undefined"&&q instanceof Date)return Q.date;return Q.object;default:return Q.unknown}},e,_Z=(q)=>{return JSON.stringify(q,null,2).replace(/"([^"]+)":/g,"$1:")},p6,KZ=(q,_)=>{let j;switch(q.code){case e.invalid_type:if(q.received===Q.undefined)j="Required";else j=`Expected ${q.expected}, received ${q.received}`;break;case e.invalid_literal:j=`Invalid literal value, expected ${JSON.stringify(q.expected,u8.jsonStringifyReplacer)}`;break;case e.unrecognized_keys:j=`Unrecognized key(s) in object: ${u8.joinValues(q.keys,", ")}`;break;case e.invalid_union:j="Invalid input";break;case e.invalid_union_discriminator:j=`Invalid discriminator value. Expected ${u8.joinValues(q.options)}`;break;case e.invalid_enum_value:j=`Invalid enum value. Expected ${u8.joinValues(q.options)}, received '${q.received}'`;break;case e.invalid_arguments:j="Invalid function arguments";break;case e.invalid_return_type:j="Invalid function return type";break;case e.invalid_date:j="Invalid date";break;case e.invalid_string:if(typeof q.validation==="object")if("includes"in q.validation){if(j=`Invalid input: must include "${q.validation.includes}"`,typeof q.validation.position==="number")j=`${j} at one or more positions greater than or equal to ${q.validation.position}`}else if("startsWith"in q.validation)j=`Invalid input: must start with "${q.validation.startsWith}"`;else if("endsWith"in q.validation)j=`Invalid input: must end with "${q.validation.endsWith}"`;else u8.assertNever(q.validation);else if(q.validation!=="regex")j=`Invalid ${q.validation}`;else j="Invalid";break;case e.too_small:if(q.type==="array")j=`Array must contain ${q.exact?"exactly":q.inclusive?"at least":"more than"} ${q.minimum} element(s)`;else if(q.type==="string")j=`String must contain ${q.exact?"exactly":q.inclusive?"at least":"over"} ${q.minimum} character(s)`;else if(q.type==="number")j=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="bigint")j=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="date")j=`Date must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(q.minimum))}`;else j="Invalid input";break;case e.too_big:if(q.type==="array")j=`Array must contain ${q.exact?"exactly":q.inclusive?"at most":"less than"} ${q.maximum} element(s)`;else if(q.type==="string")j=`String must contain ${q.exact?"exactly":q.inclusive?"at most":"under"} ${q.maximum} character(s)`;else if(q.type==="number")j=`Number must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="bigint")j=`BigInt must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="date")j=`Date must be ${q.exact?"exactly":q.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(q.maximum))}`;else j="Invalid input";break;case e.custom:j="Invalid input";break;case e.invalid_intersection_types:j="Intersection results could not be merged";break;case e.not_multiple_of:j=`Number must be a multiple of ${q.multipleOf}`;break;case e.not_finite:j="Number must be finite";break;default:j=_.defaultError,u8.assertNever(q)}return{message:j}},Q_,$P,Q3=(q)=>{let{data:_,path:j,errorMaps:K,issueData:f}=q,Y=[...j,...f.path||[]],P={...f,path:Y};if(f.message!==void 0)return{...f,path:Y,message:f.message};let $="",O=K.filter((w)=>!!w).slice().reverse();for(let w of O)$=w(P,{data:_,defaultError:$}).message;return{...f,path:Y,message:$}},PZ,O8,U_=(q)=>({status:"dirty",value:q}),V6=(q)=>({status:"valid",value:q}),Y2=(q)=>q.status==="aborted",$2=(q)=>q.status==="dirty",W_=(q)=>q.status==="valid",aK=(q)=>typeof Promise!=="undefined"&&q instanceof Promise,j8,t1=(q,_)=>{if(W_(_))return{success:!0,data:_.value};else{if(!q.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let j=new p6(q.common.issues);return this._error=j,this._error}}}},fZ,YZ,$Z,wZ,OZ,vZ,zZ,WZ,JZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",j2,HZ,TZ,ZZ,kZ,XZ,AZ,wP="((\\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])))",GZ,Oq,tq,eq,qK,J_,BK,_K,KK,H_,Bq,hq,tK,vq,i8,jK,pq=(q)=>{if(q instanceof fK)return pq(q.schema);else if(q instanceof s6)return pq(q.innerType());else if(q instanceof YK)return[q.value];else if(q instanceof Fq)return q.options;else if(q instanceof $K)return u8.objectValues(q.enum);else if(q instanceof wK)return pq(q._def.innerType);else if(q instanceof _K)return[void 0];else if(q instanceof KK)return[null];else if(q instanceof zq)return[void 0,...pq(q.unwrap())];else if(q instanceof lq)return[null,...pq(q.unwrap())];else if(q instanceof _7)return pq(q.unwrap());else if(q instanceof vK)return pq(q.unwrap());else if(q instanceof OK)return pq(q._def.innerType);else return[]},q7,PK,Dq,eK,FK,T_,s_,fK,YK,Fq,$K,Z_,s6,zq,lq,wK,OK,UK,MZ,_7,sK,vK,NZ,z8,bZ=(q,_={message:`Input not instance of ${q.name}`})=>WP((j)=>j instanceof q,_),JP,HP,SZ,EZ,TP,RZ,mZ,IZ,gZ,yZ,dZ,pZ,LZ,lZ,xZ,nZ,cZ,rZ,iZ,oZ,aZ,BZ,tZ,eZ,FZ,UZ,sZ,QZ,qk,F1,_k,Kk,jk,Pk,fk=()=>JP().optional(),Yk=()=>HP().optional(),$k=()=>TP().optional(),wk,Ok,K7="2.0",ZP,kP,vk,Q6,R6,QK,Cq,qq,j7,zk,Wk,Jk,U1,Hk,YV,XP,AP,q3,GP,Tk,Zk,kk,Xk,Ak,uP,Gk,hP,P7,f7,DP,CP,H2,VP,MP,uk,hk,Dk,Ck,Vk,Mk,Nk,bk,Sk,Ek,Rk,mk,Ik,gk,yk,dk,T2,Z2,k2,pk,Lk,NP,lk,xk,nk,ck,rk,ik,ok,bP,$V,ak,Bk,SP,tk,ek,Fk,Uk,sk,Qk,qX,_X,KX,jX,PX,fX,YX,$X,wX,OX,vX,zX,WX,JX,HX,TX,wV,OV,vV,zV,WV,JV,HV,TV,ZV,O2,v2;var X2=Q8(()=>{YT=Object.create,$T=Object.getPrototypeOf,P2=Object.defineProperty,wT=Object.getOwnPropertyNames,OT=Object.prototype.hasOwnProperty,WT=H8((q,_)=>{(function(j,K){typeof q==="object"&&typeof _!=="undefined"?K(q):typeof define==="function"&&define.amd?define(["exports"],K):K(j.URI=j.URI||{})})(q,function(j){function K(){for(var N=arguments.length,u=Array(N),E=0;E<N;E++)u[E]=arguments[E];if(u.length>1){u[0]=u[0].slice(0,-1);var L=u.length-1;for(var n=1;n<L;++n)u[n]=u[n].slice(1,-1);return u[L]=u[L].slice(1),u.join("")}else return u[0]}function f(N){return"(?:"+N+")"}function Y(N){return N===void 0?"undefined":N===null?"null":Object.prototype.toString.call(N).split(" ").pop().split("]").shift().toLowerCase()}function P(N){return N.toUpperCase()}function $(N){return N!==void 0&&N!==null?N instanceof Array?N:typeof N.length!=="number"||N.split||N.setInterval||N.call?[N]:Array.prototype.slice.call(N):[]}function O(N,u){var E=N;if(u)for(var L in u)E[L]=u[L];return E}function w(N){var u="[A-Za-z]",E="[\\x0D]",L="[0-9]",n="[\\x22]",s=K(L,"[A-Fa-f]"),X8="[\\x0A]",D8="[\\x20]",b8=f(f("%[EFef]"+s+"%"+s+s+"%"+s+s)+"|"+f("%[89A-Fa-f]"+s+"%"+s+s)+"|"+f("%"+s+s)),U8="[\\:\\/\\?\\#\\[\\]\\@]",G8="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c8=K(U8,G8),s8=N?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",d8=N?"[\\uE000-\\uF8FF]":"[]",M8=K(u,L,"[\\-\\.\\_\\~]",s8),r8=f(u+K(u,L,"[\\+\\-\\.]")+"*"),S8=f(f(b8+"|"+K(M8,G8,"[\\:]"))+"*"),P_=f(f("25[0-5]")+"|"+f("2[0-4]"+L)+"|"+f("1"+L+L)+"|"+f("[1-9]"+L)+"|"+L),I6=f(f("25[0-5]")+"|"+f("2[0-4]"+L)+"|"+f("1"+L+L)+"|"+f("0?[1-9]"+L)+"|0?0?"+L),B6=f(I6+"\\."+I6+"\\."+I6+"\\."+I6),m8=f(s+"{1,4}"),g6=f(f(m8+"\\:"+m8)+"|"+B6),t6=f(f(m8+"\\:")+"{6}"+g6),Gq=f("\\:\\:"+f(m8+"\\:")+"{5}"+g6),f_=f(f(m8)+"?\\:\\:"+f(m8+"\\:")+"{4}"+g6),Sq=f(f(f(m8+"\\:")+"{0,1}"+m8)+"?\\:\\:"+f(m8+"\\:")+"{3}"+g6),SK=f(f(f(m8+"\\:")+"{0,2}"+m8)+"?\\:\\:"+f(m8+"\\:")+"{2}"+g6),g3=f(f(f(m8+"\\:")+"{0,3}"+m8)+"?\\:\\:"+m8+"\\:"+g6),y3=f(f(f(m8+"\\:")+"{0,4}"+m8)+"?\\:\\:"+g6),m_=f(f(f(m8+"\\:")+"{0,5}"+m8)+"?\\:\\:"+m8),I_=f(f(f(m8+"\\:")+"{0,6}"+m8)+"?\\:\\:"),Eq=f([t6,Gq,f_,Sq,SK,g3,y3,m_,I_].join("|")),g_=f(f(M8+"|"+b8)+"+"),s7=f(Eq+"\\%25"+g_),Y_=f(Eq+f("\\%25|\\%(?!"+s+"{2})")+g_),$w=f("[vV]"+s+"+\\."+K(M8,G8,"[\\:]")+"+"),ww=f("\\["+f(Y_+"|"+Eq+"|"+$w)+"\\]"),K5=f(f(b8+"|"+K(M8,G8))+"*"),EK=f(ww+"|"+B6+"(?!"+K5+")|"+K5),RK=f(L+"*"),j5=f(f(S8+"@")+"?"+EK+f("\\:"+RK)+"?"),mK=f(b8+"|"+K(M8,G8,"[\\:\\@]")),Ow=f(mK+"*"),P5=f(mK+"+"),vw=f(f(b8+"|"+K(M8,G8,"[\\@]"))+"+"),Rq=f(f("\\/"+Ow)+"*"),y_=f("\\/"+f(P5+Rq)+"?"),Q7=f(vw+Rq),d3=f(P5+Rq),d_="(?!"+mK+")",aD=f(Rq+"|"+y_+"|"+Q7+"|"+d3+"|"+d_),p_=f(f(mK+"|"+K("[\\/\\?]",d8))+"*"),IK=f(f(mK+"|[\\/\\?]")+"*"),f5=f(f("\\/\\/"+j5+Rq)+"|"+y_+"|"+d3+"|"+d_),zw=f(r8+"\\:"+f5+f("\\?"+p_)+"?"+f("\\#"+IK)+"?"),Ww=f(f("\\/\\/"+j5+Rq)+"|"+y_+"|"+Q7+"|"+d_),Jw=f(Ww+f("\\?"+p_)+"?"+f("\\#"+IK)+"?"),BD=f(zw+"|"+Jw),tD=f(r8+"\\:"+f5+f("\\?"+p_)+"?"),eD="^("+r8+")\\:"+f(f("\\/\\/("+f("("+S8+")@")+"?("+EK+")"+f("\\:("+RK+")")+"?)")+"?("+Rq+"|"+y_+"|"+d3+"|"+d_+")")+f("\\?("+p_+")")+"?"+f("\\#("+IK+")")+"?$",FD="^(){0}"+f(f("\\/\\/("+f("("+S8+")@")+"?("+EK+")"+f("\\:("+RK+")")+"?)")+"?("+Rq+"|"+y_+"|"+Q7+"|"+d_+")")+f("\\?("+p_+")")+"?"+f("\\#("+IK+")")+"?$",UD="^("+r8+")\\:"+f(f("\\/\\/("+f("("+S8+")@")+"?("+EK+")"+f("\\:("+RK+")")+"?)")+"?("+Rq+"|"+y_+"|"+d3+"|"+d_+")")+f("\\?("+p_+")")+"?$",sD="^"+f("\\#("+IK+")")+"?$",QD="^"+f("("+S8+")@")+"?("+EK+")"+f("\\:("+RK+")")+"?$";return{NOT_SCHEME:new RegExp(K("[^]",u,L,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(K("[^\\%\\:]",M8,G8),"g"),NOT_HOST:new RegExp(K("[^\\%\\[\\]\\:]",M8,G8),"g"),NOT_PATH:new RegExp(K("[^\\%\\/\\:\\@]",M8,G8),"g"),NOT_PATH_NOSCHEME:new RegExp(K("[^\\%\\/\\@]",M8,G8),"g"),NOT_QUERY:new RegExp(K("[^\\%]",M8,G8,"[\\:\\@\\/\\?]",d8),"g"),NOT_FRAGMENT:new RegExp(K("[^\\%]",M8,G8,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(K("[^]",M8,G8),"g"),UNRESERVED:new RegExp(M8,"g"),OTHER_CHARS:new RegExp(K("[^\\%]",M8,c8),"g"),PCT_ENCODED:new RegExp(b8,"g"),IPV4ADDRESS:new RegExp("^("+B6+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Eq+")"+f(f("\\%25|\\%(?!"+s+"{2})")+"("+g_+")")+"?\\]?$")}}var v=w(!1),z=w(!0),W=function(){function N(u,E){var L=[],n=!0,s=!1,X8=void 0;try{for(var D8=u[Symbol.iterator](),b8;!(n=(b8=D8.next()).done);n=!0)if(L.push(b8.value),E&&L.length===E)break}catch(U8){s=!0,X8=U8}finally{try{if(!n&&D8.return)D8.return()}finally{if(s)throw X8}}return L}return function(u,E){if(Array.isArray(u))return u;else if(Symbol.iterator in Object(u))return N(u,E);else throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),H=function(N){if(Array.isArray(N)){for(var u=0,E=Array(N.length);u<N.length;u++)E[u]=N[u];return E}else return Array.from(N)},Z=2147483647,J=36,X=1,A=26,G=38,D=700,V=72,m=128,S="-",b=/^xn--/,d=/[^\0-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,r={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},l=J-X,R=Math.floor,I=String.fromCharCode;function y(N){throw new RangeError(r[N])}function i(N,u){var E=[],L=N.length;while(L--)E[L]=u(N[L]);return E}function t(N,u){var E=N.split("@"),L="";if(E.length>1)L=E[0]+"@",N=E[1];N=N.replace(p,".");var n=N.split("."),s=i(n,u).join(".");return L+s}function U(N){var u=[],E=0,L=N.length;while(E<L){var n=N.charCodeAt(E++);if(n>=55296&&n<=56319&&E<L){var s=N.charCodeAt(E++);if((s&64512)==56320)u.push(((n&1023)<<10)+(s&1023)+65536);else u.push(n),E--}else u.push(n)}return u}var w8=function N(u){return String.fromCodePoint.apply(String,H(u))},Y8=function N(u){if(u-48<10)return u-22;if(u-65<26)return u-65;if(u-97<26)return u-97;return J},T8=function N(u,E){return u+22+75*(u<26)-((E!=0)<<5)},v8=function N(u,E,L){var n=0;u=L?R(u/D):u>>1,u+=R(u/E);for(;u>l*A>>1;n+=J)u=R(u/l);return R(n+(l+1)*u/(u+G))},f8=function N(u){var E=[],L=u.length,n=0,s=m,X8=V,D8=u.lastIndexOf(S);if(D8<0)D8=0;for(var b8=0;b8<D8;++b8){if(u.charCodeAt(b8)>=128)y("not-basic");E.push(u.charCodeAt(b8))}for(var U8=D8>0?D8+1:0;U8<L;){var G8=n;for(var c8=1,s8=J;;s8+=J){if(U8>=L)y("invalid-input");var d8=Y8(u.charCodeAt(U8++));if(d8>=J||d8>R((Z-n)/c8))y("overflow");n+=d8*c8;var M8=s8<=X8?X:s8>=X8+A?A:s8-X8;if(d8<M8)break;var r8=J-M8;if(c8>R(Z/r8))y("overflow");c8*=r8}var S8=E.length+1;if(X8=v8(n-G8,S8,G8==0),R(n/S8)>Z-s)y("overflow");s+=R(n/S8),n%=S8,E.splice(n++,0,s)}return String.fromCodePoint.apply(String,E)},R8=function N(u){var E=[];u=U(u);var L=u.length,n=m,s=0,X8=V,D8=!0,b8=!1,U8=void 0;try{for(var G8=u[Symbol.iterator](),c8;!(D8=(c8=G8.next()).done);D8=!0){var s8=c8.value;if(s8<128)E.push(I(s8))}}catch(Y_){b8=!0,U8=Y_}finally{try{if(!D8&&G8.return)G8.return()}finally{if(b8)throw U8}}var d8=E.length,M8=d8;if(d8)E.push(S);while(M8<L){var r8=Z,S8=!0,P_=!1,I6=void 0;try{for(var B6=u[Symbol.iterator](),m8;!(S8=(m8=B6.next()).done);S8=!0){var g6=m8.value;if(g6>=n&&g6<r8)r8=g6}}catch(Y_){P_=!0,I6=Y_}finally{try{if(!S8&&B6.return)B6.return()}finally{if(P_)throw I6}}var t6=M8+1;if(r8-n>R((Z-s)/t6))y("overflow");s+=(r8-n)*t6,n=r8;var Gq=!0,f_=!1,Sq=void 0;try{for(var SK=u[Symbol.iterator](),g3;!(Gq=(g3=SK.next()).done);Gq=!0){var y3=g3.value;if(y3<n&&++s>Z)y("overflow");if(y3==n){var m_=s;for(var I_=J;;I_+=J){var Eq=I_<=X8?X:I_>=X8+A?A:I_-X8;if(m_<Eq)break;var g_=m_-Eq,s7=J-Eq;E.push(I(T8(Eq+g_%s7,0))),m_=R(g_/s7)}E.push(I(T8(m_,0))),X8=v8(s,t6,M8==d8),s=0,++M8}}}catch(Y_){f_=!0,Sq=Y_}finally{try{if(!Gq&&SK.return)SK.return()}finally{if(f_)throw Sq}}++s,++n}return E.join("")},f6=function N(u){return t(u,function(E){return b.test(E)?f8(E.slice(4).toLowerCase()):E})},j6=function N(u){return t(u,function(E){return d.test(E)?"xn--"+R8(E):E})},h={version:"2.1.0",ucs2:{decode:U,encode:w8},decode:f8,encode:R8,toASCII:j6,toUnicode:f6},C={};function T(N){var u=N.charCodeAt(0),E=void 0;if(u<16)E="%0"+u.toString(16).toUpperCase();else if(u<128)E="%"+u.toString(16).toUpperCase();else if(u<2048)E="%"+(u>>6|192).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase();else E="%"+(u>>12|224).toString(16).toUpperCase()+"%"+(u>>6&63|128).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase();return E}function M(N){var u="",E=0,L=N.length;while(E<L){var n=parseInt(N.substr(E+1,2),16);if(n<128)u+=String.fromCharCode(n),E+=3;else if(n>=194&&n<224){if(L-E>=6){var s=parseInt(N.substr(E+4,2),16);u+=String.fromCharCode((n&31)<<6|s&63)}else u+=N.substr(E,6);E+=6}else if(n>=224){if(L-E>=9){var X8=parseInt(N.substr(E+4,2),16),D8=parseInt(N.substr(E+7,2),16);u+=String.fromCharCode((n&15)<<12|(X8&63)<<6|D8&63)}else u+=N.substr(E,9);E+=9}else u+=N.substr(E,3),E+=3}return u}function x(N,u){function E(L){var n=M(L);return!n.match(u.UNRESERVED)?L:n}if(N.scheme)N.scheme=String(N.scheme).replace(u.PCT_ENCODED,E).toLowerCase().replace(u.NOT_SCHEME,"");if(N.userinfo!==void 0)N.userinfo=String(N.userinfo).replace(u.PCT_ENCODED,E).replace(u.NOT_USERINFO,T).replace(u.PCT_ENCODED,P);if(N.host!==void 0)N.host=String(N.host).replace(u.PCT_ENCODED,E).toLowerCase().replace(u.NOT_HOST,T).replace(u.PCT_ENCODED,P);if(N.path!==void 0)N.path=String(N.path).replace(u.PCT_ENCODED,E).replace(N.scheme?u.NOT_PATH:u.NOT_PATH_NOSCHEME,T).replace(u.PCT_ENCODED,P);if(N.query!==void 0)N.query=String(N.query).replace(u.PCT_ENCODED,E).replace(u.NOT_QUERY,T).replace(u.PCT_ENCODED,P);if(N.fragment!==void 0)N.fragment=String(N.fragment).replace(u.PCT_ENCODED,E).replace(u.NOT_FRAGMENT,T).replace(u.PCT_ENCODED,P);return N}function o(N){return N.replace(/^0*(.*)/,"$1")||"0"}function c(N,u){var E=N.match(u.IPV4ADDRESS)||[],L=W(E,2),n=L[1];if(n)return n.split(".").map(o).join(".");else return N}function B(N,u){var E=N.match(u.IPV6ADDRESS)||[],L=W(E,3),n=L[1],s=L[2];if(n){var X8=n.toLowerCase().split("::").reverse(),D8=W(X8,2),b8=D8[0],U8=D8[1],G8=U8?U8.split(":").map(o):[],c8=b8.split(":").map(o),s8=u.IPV4ADDRESS.test(c8[c8.length-1]),d8=s8?7:8,M8=c8.length-d8,r8=Array(d8);for(var S8=0;S8<d8;++S8)r8[S8]=G8[S8]||c8[M8+S8]||"";if(s8)r8[d8-1]=c(r8[d8-1],u);var P_=r8.reduce(function(t6,Gq,f_){if(!Gq||Gq==="0"){var Sq=t6[t6.length-1];if(Sq&&Sq.index+Sq.length===f_)Sq.length++;else t6.push({index:f_,length:1})}return t6},[]),I6=P_.sort(function(t6,Gq){return Gq.length-t6.length})[0],B6=void 0;if(I6&&I6.length>1){var m8=r8.slice(0,I6.index),g6=r8.slice(I6.index+I6.length);B6=m8.join(":")+"::"+g6.join(":")}else B6=r8.join(":");if(s)B6+="%"+s;return B6}else return N}var K8=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,W8="".match(/(){0}/)[1]===void 0;function $8(N){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E={},L=u.iri!==!1?z:v;if(u.reference==="suffix")N=(u.scheme?u.scheme+":":"")+"//"+N;var n=N.match(K8);if(n){if(W8){if(E.scheme=n[1],E.userinfo=n[3],E.host=n[4],E.port=parseInt(n[5],10),E.path=n[6]||"",E.query=n[7],E.fragment=n[8],isNaN(E.port))E.port=n[5]}else if(E.scheme=n[1]||void 0,E.userinfo=N.indexOf("@")!==-1?n[3]:void 0,E.host=N.indexOf("//")!==-1?n[4]:void 0,E.port=parseInt(n[5],10),E.path=n[6]||"",E.query=N.indexOf("?")!==-1?n[7]:void 0,E.fragment=N.indexOf("#")!==-1?n[8]:void 0,isNaN(E.port))E.port=N.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0;if(E.host)E.host=B(c(E.host,L),L);if(E.scheme===void 0&&E.userinfo===void 0&&E.host===void 0&&E.port===void 0&&!E.path&&E.query===void 0)E.reference="same-document";else if(E.scheme===void 0)E.reference="relative";else if(E.fragment===void 0)E.reference="absolute";else E.reference="uri";if(u.reference&&u.reference!=="suffix"&&u.reference!==E.reference)E.error=E.error||"URI is not a "+u.reference+" reference.";var s=C[(u.scheme||E.scheme||"").toLowerCase()];if(!u.unicodeSupport&&(!s||!s.unicodeSupport)){if(E.host&&(u.domainHost||s&&s.domainHost))try{E.host=h.toASCII(E.host.replace(L.PCT_ENCODED,M).toLowerCase())}catch(X8){E.error=E.error||"Host's domain name can not be converted to ASCII via punycode: "+X8}x(E,v)}else x(E,L);if(s&&s.parse)s.parse(E,u)}else E.error=E.error||"URI can not be parsed.";return E}function A8(N,u){var E=u.iri!==!1?z:v,L=[];if(N.userinfo!==void 0)L.push(N.userinfo),L.push("@");if(N.host!==void 0)L.push(B(c(String(N.host),E),E).replace(E.IPV6ADDRESS,function(n,s,X8){return"["+s+(X8?"%25"+X8:"")+"]"}));if(typeof N.port==="number"||typeof N.port==="string")L.push(":"),L.push(String(N.port));return L.length?L.join(""):void 0}var g8=/^\.\.?\//,V8=/^\/\.(\/|$)/,W6=/^\/\.\.(\/|$)/,o8=/^\/?(?:.|\n)*?(?=\/|$)/;function h6(N){var u=[];while(N.length)if(N.match(g8))N=N.replace(g8,"");else if(N.match(V8))N=N.replace(V8,"/");else if(N.match(W6))N=N.replace(W6,"/"),u.pop();else if(N==="."||N==="..")N="";else{var E=N.match(o8);if(E){var L=E[0];N=N.slice(L.length),u.push(L)}else throw new Error("Unexpected dot segment condition")}return u.join("")}function y8(N){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=u.iri?z:v,L=[],n=C[(u.scheme||N.scheme||"").toLowerCase()];if(n&&n.serialize)n.serialize(N,u);if(N.host){if(E.IPV6ADDRESS.test(N.host));else if(u.domainHost||n&&n.domainHost)try{N.host=!u.iri?h.toASCII(N.host.replace(E.PCT_ENCODED,M).toLowerCase()):h.toUnicode(N.host)}catch(D8){N.error=N.error||"Host's domain name can not be converted to "+(!u.iri?"ASCII":"Unicode")+" via punycode: "+D8}}if(x(N,E),u.reference!=="suffix"&&N.scheme)L.push(N.scheme),L.push(":");var s=A8(N,u);if(s!==void 0){if(u.reference!=="suffix")L.push("//");if(L.push(s),N.path&&N.path.charAt(0)!=="/")L.push("/")}if(N.path!==void 0){var X8=N.path;if(!u.absolutePath&&(!n||!n.absolutePath))X8=h6(X8);if(s===void 0)X8=X8.replace(/^\/\//,"/%2F");L.push(X8)}if(N.query!==void 0)L.push("?"),L.push(N.query);if(N.fragment!==void 0)L.push("#"),L.push(N.fragment);return L.join("")}function Y6(N,u){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=arguments[3],n={};if(!L)N=$8(y8(N,E),E),u=$8(y8(u,E),E);if(E=E||{},!E.tolerant&&u.scheme)n.scheme=u.scheme,n.userinfo=u.userinfo,n.host=u.host,n.port=u.port,n.path=h6(u.path||""),n.query=u.query;else{if(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0)n.userinfo=u.userinfo,n.host=u.host,n.port=u.port,n.path=h6(u.path||""),n.query=u.query;else{if(!u.path)if(n.path=N.path,u.query!==void 0)n.query=u.query;else n.query=N.query;else{if(u.path.charAt(0)==="/")n.path=h6(u.path);else{if((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path)n.path="/"+u.path;else if(!N.path)n.path=u.path;else n.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+u.path;n.path=h6(n.path)}n.query=u.query}n.userinfo=N.userinfo,n.host=N.host,n.port=N.port}n.scheme=N.scheme}return n.fragment=u.fragment,n}function a6(N,u,E){var L=O({scheme:"null"},E);return y8(Y6($8(N,L),$8(u,L),L,!0),L)}function m6(N,u){if(typeof N==="string")N=y8($8(N,u),u);else if(Y(N)==="object")N=$8(y8(N,u),u);return N}function I3(N,u,E){if(typeof N==="string")N=y8($8(N,E),E);else if(Y(N)==="object")N=y8(N,E);if(typeof u==="string")u=y8($8(u,E),E);else if(Y(u)==="object")u=y8(u,E);return N===u}function F7(N,u){return N&&N.toString().replace(!u||!u.iri?v.ESCAPE:z.ESCAPE,T)}function $q(N,u){return N&&N.toString().replace(!u||!u.iri?v.PCT_ENCODED:z.PCT_ENCODED,M)}var NK={scheme:"http",domainHost:!0,parse:function N(u,E){if(!u.host)u.error=u.error||"HTTP URIs must have a host.";return u},serialize:function N(u,E){var L=String(u.scheme).toLowerCase()==="https";if(u.port===(L?443:80)||u.port==="")u.port=void 0;if(!u.path)u.path="/";return u}},t9={scheme:"https",domainHost:NK.domainHost,parse:NK.parse,serialize:NK.serialize};function e9(N){return typeof N.secure==="boolean"?N.secure:String(N.scheme).toLowerCase()==="wss"}var bK={scheme:"ws",domainHost:!0,parse:function N(u,E){var L=u;return L.secure=e9(L),L.resourceName=(L.path||"/")+(L.query?"?"+L.query:""),L.path=void 0,L.query=void 0,L},serialize:function N(u,E){if(u.port===(e9(u)?443:80)||u.port==="")u.port=void 0;if(typeof u.secure==="boolean")u.scheme=u.secure?"wss":"ws",u.secure=void 0;if(u.resourceName){var L=u.resourceName.split("?"),n=W(L,2),s=n[0],X8=n[1];u.path=s&&s!=="/"?s:void 0,u.query=X8,u.resourceName=void 0}return u.fragment=void 0,u}},F9={scheme:"wss",domainHost:bK.domainHost,parse:bK.parse,serialize:bK.serialize},e$={},F$=!0,U9="[A-Za-z0-9\\-\\.\\_\\~"+(F$?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Aq="[0-9A-Fa-f]",U$=f(f("%[EFef]"+Aq+"%"+Aq+Aq+"%"+Aq+Aq)+"|"+f("%[89A-Fa-f]"+Aq+"%"+Aq+Aq)+"|"+f("%"+Aq+Aq)),s$="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Q$="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",qw=K(Q$,"[\\\"\\\\]"),_w="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Kw=new RegExp(U9,"g"),R_=new RegExp(U$,"g"),jw=new RegExp(K("[^]",s$,"[\\.]","[\\\"]",qw),"g"),s9=new RegExp(K("[^]",U9,_w),"g"),Pw=s9;function U7(N){var u=M(N);return!u.match(Kw)?N:u}var Q9={scheme:"mailto",parse:function N(u,E){var L=u,n=L.to=L.path?L.path.split(","):[];if(L.path=void 0,L.query){var s=!1,X8={},D8=L.query.split("&");for(var b8=0,U8=D8.length;b8<U8;++b8){var G8=D8[b8].split("=");switch(G8[0]){case"to":var c8=G8[1].split(",");for(var s8=0,d8=c8.length;s8<d8;++s8)n.push(c8[s8]);break;case"subject":L.subject=$q(G8[1],E);break;case"body":L.body=$q(G8[1],E);break;default:s=!0,X8[$q(G8[0],E)]=$q(G8[1],E);break}}if(s)L.headers=X8}L.query=void 0;for(var M8=0,r8=n.length;M8<r8;++M8){var S8=n[M8].split("@");if(S8[0]=$q(S8[0]),!E.unicodeSupport)try{S8[1]=h.toASCII($q(S8[1],E).toLowerCase())}catch(P_){L.error=L.error||"Email address's domain name can not be converted to ASCII via punycode: "+P_}else S8[1]=$q(S8[1],E).toLowerCase();n[M8]=S8.join("@")}return L},serialize:function N(u,E){var L=u,n=$(u.to);if(n){for(var s=0,X8=n.length;s<X8;++s){var D8=String(n[s]),b8=D8.lastIndexOf("@"),U8=D8.slice(0,b8).replace(R_,U7).replace(R_,P).replace(jw,T),G8=D8.slice(b8+1);try{G8=!E.iri?h.toASCII($q(G8,E).toLowerCase()):h.toUnicode(G8)}catch(M8){L.error=L.error||"Email address's domain name can not be converted to "+(!E.iri?"ASCII":"Unicode")+" via punycode: "+M8}n[s]=U8+"@"+G8}L.path=n.join(",")}var c8=u.headers=u.headers||{};if(u.subject)c8.subject=u.subject;if(u.body)c8.body=u.body;var s8=[];for(var d8 in c8)if(c8[d8]!==e$[d8])s8.push(d8.replace(R_,U7).replace(R_,P).replace(s9,T)+"="+c8[d8].replace(R_,U7).replace(R_,P).replace(Pw,T));if(s8.length)L.query=s8.join("&");return L}},fw=/^([^\:]+)\:(.*)/,q5={scheme:"urn",parse:function N(u,E){var L=u.path&&u.path.match(fw),n=u;if(L){var s=E.scheme||n.scheme||"urn",X8=L[1].toLowerCase(),D8=L[2],b8=s+":"+(E.nid||X8),U8=C[b8];if(n.nid=X8,n.nss=D8,n.path=void 0,U8)n=U8.parse(n,E)}else n.error=n.error||"URN can not be parsed.";return n},serialize:function N(u,E){var L=E.scheme||u.scheme||"urn",n=u.nid,s=L+":"+(E.nid||n),X8=C[s];if(X8)u=X8.serialize(u,E);var D8=u,b8=u.nss;return D8.path=(n||E.nid)+":"+b8,D8}},Yw=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,_5={scheme:"urn:uuid",parse:function N(u,E){var L=u;if(L.uuid=L.nss,L.nss=void 0,!E.tolerant&&(!L.uuid||!L.uuid.match(Yw)))L.error=L.error||"UUID is not valid.";return L},serialize:function N(u,E){var L=u;return L.nss=(u.uuid||"").toLowerCase(),L}};C[NK.scheme]=NK,C[t9.scheme]=t9,C[bK.scheme]=bK,C[F9.scheme]=F9,C[Q9.scheme]=Q9,C[q5.scheme]=q5,C[_5.scheme]=_5,j.SCHEMES=C,j.pctEncChar=T,j.pctDecChars=M,j.parse=$8,j.removeDotSegments=h6,j.serialize=y8,j.resolveComponents=Y6,j.resolve=a6,j.normalize=m6,j.equal=I3,j.escapeComponent=F7,j.unescapeComponent=$q,Object.defineProperty(j,"__esModule",{value:!0})})}),z2=H8((q,_)=>{_.exports=function j(K,f){if(K===f)return!0;if(K&&f&&typeof K=="object"&&typeof f=="object"){if(K.constructor!==f.constructor)return!1;var Y,P,$;if(Array.isArray(K)){if(Y=K.length,Y!=f.length)return!1;for(P=Y;P--!==0;)if(!j(K[P],f[P]))return!1;return!0}if(K.constructor===RegExp)return K.source===f.source&&K.flags===f.flags;if(K.valueOf!==Object.prototype.valueOf)return K.valueOf()===f.valueOf();if(K.toString!==Object.prototype.toString)return K.toString()===f.toString();if($=Object.keys(K),Y=$.length,Y!==Object.keys(f).length)return!1;for(P=Y;P--!==0;)if(!Object.prototype.hasOwnProperty.call(f,$[P]))return!1;for(P=Y;P--!==0;){var O=$[P];if(!j(K[O],f[O]))return!1}return!0}return K!==K&&f!==f}}),JT=H8((q,_)=>{_.exports=function j(K){var f=0,Y=K.length,P=0,$;while(P<Y)if(f++,$=K.charCodeAt(P++),$>=55296&&$<=56319&&P<Y){if($=K.charCodeAt(P),($&64512)==56320)P++}return f}}),zK=H8((q,_)=>{_.exports={copy:j,checkDataType:K,checkDataTypes:f,coerceToTypes:P,toHash:$,getProperty:v,escapeQuotes:z,equal:z2(),ucs2length:JT(),varOccurences:W,varReplace:H,schemaHasRules:Z,schemaHasRulesExcept:J,schemaUnknownRules:X,toQuotedString:A,getPathExpr:G,getPath:D,getData:S,unescapeFragment:d,unescapeJsonPointer:l,escapeFragment:p,escapeJsonPointer:r};function j(R,I){I=I||{};for(var y in R)I[y]=R[y];return I}function K(R,I,y,i){var t=i?" !== ":" === ",U=i?" || ":" && ",w8=i?"!":"",Y8=i?"":"!";switch(R){case"null":return I+t+"null";case"array":return w8+"Array.isArray("+I+")";case"object":return"("+w8+I+U+"typeof "+I+t+'"object"'+U+Y8+"Array.isArray("+I+"))";case"integer":return"(typeof "+I+t+'"number"'+U+Y8+"("+I+" % 1)"+U+I+t+I+(y?U+w8+"isFinite("+I+")":"")+")";case"number":return"(typeof "+I+t+'"'+R+'"'+(y?U+w8+"isFinite("+I+")":"")+")";default:return"typeof "+I+t+'"'+R+'"'}}function f(R,I,y){switch(R.length){case 1:return K(R[0],I,y,!0);default:var i="",t=$(R);if(t.array&&t.object)i=t.null?"(":"(!"+I+" || ",i+="typeof "+I+' !== "object")',delete t.null,delete t.array,delete t.object;if(t.number)delete t.integer;for(var U in t)i+=(i?" && ":"")+K(U,I,y,!0);return i}}var Y=$(["string","number","integer","boolean","null"]);function P(R,I){if(Array.isArray(I)){var y=[];for(var i=0;i<I.length;i++){var t=I[i];if(Y[t])y[y.length]=t;else if(R==="array"&&t==="array")y[y.length]=t}if(y.length)return y}else if(Y[I])return[I];else if(R==="array"&&I==="array")return["array"]}function $(R){var I={};for(var y=0;y<R.length;y++)I[R[y]]=!0;return I}var O=/^[a-z$_][a-z$_0-9]*$/i,w=/'|\\/g;function v(R){return typeof R=="number"?"["+R+"]":O.test(R)?"."+R:"['"+z(R)+"']"}function z(R){return R.replace(w,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function W(R,I){I+="[^0-9]";var y=R.match(new RegExp(I,"g"));return y?y.length:0}function H(R,I,y){return I+="([^0-9])",y=y.replace(/\$/g,"$$$$"),R.replace(new RegExp(I,"g"),y+"$1")}function Z(R,I){if(typeof R=="boolean")return!R;for(var y in R)if(I[y])return!0}function J(R,I,y){if(typeof R=="boolean")return!R&&y!="not";for(var i in R)if(i!=y&&I[i])return!0}function X(R,I){if(typeof R=="boolean")return;for(var y in R)if(!I[y])return y}function A(R){return"'"+z(R)+"'"}function G(R,I,y,i){var t=y?"'/' + "+I+(i?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):i?"'[' + "+I+" + ']'":"'[\\'' + "+I+" + '\\']'";return b(R,t)}function D(R,I,y){var i=y?A("/"+r(I)):A(v(I));return b(R,i)}var V=/^\/(?:[^~]|~0|~1)*$/,m=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function S(R,I,y){var i,t,U,w8;if(R==="")return"rootData";if(R[0]=="/"){if(!V.test(R))throw new Error("Invalid JSON-pointer: "+R);t=R,U="rootData"}else{if(w8=R.match(m),!w8)throw new Error("Invalid JSON-pointer: "+R);if(i=+w8[1],t=w8[2],t=="#"){if(i>=I)throw new Error("Cannot access property/index "+i+" levels up, current level is "+I);return y[I-i]}if(i>I)throw new Error("Cannot access data "+i+" levels up, current level is "+I);if(U="data"+(I-i||""),!t)return U}var Y8=U,T8=t.split("/");for(var v8=0;v8<T8.length;v8++){var f8=T8[v8];if(f8)U+=v(l(f8)),Y8+=" && "+U}return Y8}function b(R,I){if(R=='""')return I;return(R+" + "+I).replace(/([^\\])' \+ '/g,"$1")}function d(R){return l(decodeURIComponent(R))}function p(R){return encodeURIComponent(r(R))}function r(R){return R.replace(/~/g,"~0").replace(/\//g,"~1")}function l(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}}),s1=H8((q,_)=>{var j=zK();_.exports=K;function K(f){j.copy(f,this)}}),HT=H8((q,_)=>{var j=_.exports=function(Y,P,$){if(typeof P=="function")$=P,P={};$=P.cb||$;var O=typeof $=="function"?$:$.pre||function(){},w=$.post||function(){};K(P,O,w,Y,"",Y)};j.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},j.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},j.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},j.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 K(Y,P,$,O,w,v,z,W,H,Z){if(O&&typeof O=="object"&&!Array.isArray(O)){P(O,w,v,z,W,H,Z);for(var J in O){var X=O[J];if(Array.isArray(X)){if(J in j.arrayKeywords)for(var A=0;A<X.length;A++)K(Y,P,$,X[A],w+"/"+J+"/"+A,v,w,J,O,A)}else if(J in j.propsKeywords){if(X&&typeof X=="object")for(var G in X)K(Y,P,$,X[G],w+"/"+J+"/"+f(G),v,w,J,O,G)}else if(J in j.keywords||Y.allKeys&&!(J in j.skipKeywords))K(Y,P,$,X,w+"/"+J,v,w,J,O)}$(O,w,v,z,W,H,Z)}}function f(Y){return Y.replace(/~/g,"~0").replace(/\//g,"~1")}}),W2=H8((q,_)=>{var j=WT(),K=z2(),f=zK(),Y=s1(),P=HT();_.exports=$,$.normalizeId=D,$.fullPath=X,$.url=V,$.ids=m,$.inlineRef=H,$.schema=O;function $(S,b,d){var p=this._refs[d];if(typeof p=="string")if(this._refs[p])p=this._refs[p];else return $.call(this,S,b,p);if(p=p||this._schemas[d],p instanceof Y)return H(p.schema,this._opts.inlineRefs)?p.schema:p.validate||this._compile(p);var r=O.call(this,b,d),l,R,I;if(r)l=r.schema,b=r.root,I=r.baseId;if(l instanceof Y)R=l.validate||S.call(this,l.schema,b,void 0,I);else if(l!==void 0)R=H(l,this._opts.inlineRefs)?l:S.call(this,l,b,void 0,I);return R}function O(S,b){var d=j.parse(b),p=A(d),r=X(this._getId(S.schema));if(Object.keys(S.schema).length===0||p!==r){var l=D(p),R=this._refs[l];if(typeof R=="string")return w.call(this,S,R,d);else if(R instanceof Y){if(!R.validate)this._compile(R);S=R}else if(R=this._schemas[l],R instanceof Y){if(!R.validate)this._compile(R);if(l==D(b))return{schema:R,root:S,baseId:r};S=R}else return;if(!S.schema)return;r=X(this._getId(S.schema))}return z.call(this,d,r,S.schema,S)}function w(S,b,d){var p=O.call(this,S,b);if(p){var{schema:r,baseId:l}=p;S=p.root;var R=this._getId(r);if(R)l=V(l,R);return z.call(this,d,l,r,S)}}var v=f.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function z(S,b,d,p){if(S.fragment=S.fragment||"",S.fragment.slice(0,1)!="/")return;var r=S.fragment.split("/");for(var l=1;l<r.length;l++){var R=r[l];if(R){if(R=f.unescapeFragment(R),d=d[R],d===void 0)break;var I;if(!v[R]){if(I=this._getId(d),I)b=V(b,I);if(d.$ref){var y=V(b,d.$ref),i=O.call(this,p,y);if(i)d=i.schema,p=i.root,b=i.baseId}}}}if(d!==void 0&&d!==p.schema)return{schema:d,root:p,baseId:b}}var W=f.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function H(S,b){if(b===!1)return!1;if(b===void 0||b===!0)return Z(S);else if(b)return J(S)<=b}function Z(S){var b;if(Array.isArray(S)){for(var d=0;d<S.length;d++)if(b=S[d],typeof b=="object"&&!Z(b))return!1}else for(var p in S){if(p=="$ref")return!1;if(b=S[p],typeof b=="object"&&!Z(b))return!1}return!0}function J(S){var b=0,d;if(Array.isArray(S))for(var p=0;p<S.length;p++){if(d=S[p],typeof d=="object")b+=J(d);if(b==1/0)return 1/0}else for(var r in S){if(r=="$ref")return 1/0;if(W[r])b++;else{if(d=S[r],typeof d=="object")b+=J(d)+1;if(b==1/0)return 1/0}}return b}function X(S,b){if(b!==!1)S=D(S);var d=j.parse(S);return A(d)}function A(S){return j.serialize(S).split("#")[0]+"#"}var G=/#\/?$/;function D(S){return S?S.replace(G,""):""}function V(S,b){return b=D(b),j.resolve(S,b)}function m(S){var b=D(this._getId(S)),d={"":b},p={"":X(b,!1)},r={},l=this;return P(S,{allKeys:!0},function(R,I,y,i,t,U,w8){if(I==="")return;var Y8=l._getId(R),T8=d[i],v8=p[i]+"/"+t;if(w8!==void 0)v8+="/"+(typeof w8=="number"?w8:f.escapeFragment(w8));if(typeof Y8=="string"){Y8=T8=D(T8?j.resolve(T8,Y8):Y8);var f8=l._refs[Y8];if(typeof f8=="string")f8=l._refs[f8];if(f8&&f8.schema){if(!K(R,f8.schema))throw new Error('id "'+Y8+'" resolves to more than one schema')}else if(Y8!=D(v8))if(Y8[0]=="#"){if(r[Y8]&&!K(R,r[Y8]))throw new Error('id "'+Y8+'" resolves to more than one schema');r[Y8]=R}else l._refs[Y8]=v8}d[I]=T8,p[I]=v8}),r}}),J2=H8((q,_)=>{var j=W2();_.exports={Validation:Y(K),MissingRef:Y(f)};function K(P){this.message="validation failed",this.errors=P,this.ajv=this.validation=!0}f.message=function(P,$){return"can't resolve reference "+$+" from id "+P};function f(P,$,O){this.message=O||f.message(P,$),this.missingRef=j.url(P,$),this.missingSchema=j.normalizeId(j.fullPath(this.missingRef))}function Y(P){return P.prototype=Object.create(Error.prototype),P.prototype.constructor=P,P}}),Q1=H8((q,_)=>{_.exports=function(j,K){if(!K)K={};if(typeof K==="function")K={cmp:K};var f=typeof K.cycles==="boolean"?K.cycles:!1,Y=K.cmp&&function($){return function(O){return function(w,v){var z={key:w,value:O[w]},W={key:v,value:O[v]};return $(z,W)}}}(K.cmp),P=[];return function $(O){if(O&&O.toJSON&&typeof O.toJSON==="function")O=O.toJSON();if(O===void 0)return;if(typeof O=="number")return isFinite(O)?""+O:"null";if(typeof O!=="object")return JSON.stringify(O);var w,v;if(Array.isArray(O)){v="[";for(w=0;w<O.length;w++){if(w)v+=",";v+=$(O[w])||"null"}return v+"]"}if(O===null)return"null";if(P.indexOf(O)!==-1){if(f)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var z=P.push(O)-1,W=Object.keys(O).sort(Y&&Y(O));v="";for(w=0;w<W.length;w++){var H=W[w],Z=$(O[H]);if(!Z)continue;if(v)v+=",";v+=JSON.stringify(H)+":"+Z}return P.splice(z,1),"{"+v+"}"}(j)}}),qP=H8((q,_)=>{_.exports=function j(K,f,Y){var P="",$=K.schema.$async===!0,O=K.util.schemaHasRulesExcept(K.schema,K.RULES.all,"$ref"),w=K.self._getId(K.schema);if(K.opts.strictKeywords){var v=K.util.schemaUnknownRules(K.schema,K.RULES.keywords);if(v){var z="unknown keyword: "+v;if(K.opts.strictKeywords==="log")K.logger.warn(z);else throw new Error(z)}}if(K.isTop){if(P+=" var validate = ",$)K.async=!0,P+="async ";if(P+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",w&&(K.opts.sourceCode||K.opts.processCode))P+=" "+("/*# sourceURL="+w+" */")+" "}if(typeof K.schema=="boolean"||!(O||K.schema.$ref)){var f="false schema",W=K.level,H=K.dataLevel,Z=K.schema[f],J=K.schemaPath+K.util.getProperty(f),X=K.errSchemaPath+"/"+f,b=!K.opts.allErrors,r,A="data"+(H||""),S="valid"+W;if(K.schema===!1){if(K.isTop)b=!0;else P+=" var "+S+" = false; ";var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(r||"false schema")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'boolean schema is false' ";if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&b)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else if(K.isTop)if($)P+=" return data; ";else P+=" validate.errors = null; return true; ";else P+=" var "+S+" = true; ";if(K.isTop)P+=" }; return validate; ";return P}if(K.isTop){var V=K.isTop,W=K.level=0,H=K.dataLevel=0,A="data";if(K.rootId=K.resolve.fullPath(K.self._getId(K.root.schema)),K.baseId=K.baseId||K.rootId,delete K.isTop,K.dataPathArr=[""],K.schema.default!==void 0&&K.opts.useDefaults&&K.opts.strictDefaults){var m="default is ignored in the schema root";if(K.opts.strictDefaults==="log")K.logger.warn(m);else throw new Error(m)}P+=" var vErrors = null; ",P+=" var errors = 0; ",P+=" if (rootData === undefined) rootData = data; "}else{var{level:W,dataLevel:H}=K,A="data"+(H||"");if(w)K.baseId=K.resolve.url(K.baseId,w);if($&&!K.async)throw new Error("async schema in sync schema");P+=" var errs_"+W+" = errors;"}var S="valid"+W,b=!K.opts.allErrors,d="",p="",r,l=K.schema.type,R=Array.isArray(l);if(l&&K.opts.nullable&&K.schema.nullable===!0){if(R){if(l.indexOf("null")==-1)l=l.concat("null")}else if(l!="null")l=[l,"null"],R=!0}if(R&&l.length==1)l=l[0],R=!1;if(K.schema.$ref&&O){if(K.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+K.errSchemaPath+'" (see option extendRefs)');else if(K.opts.extendRefs!==!0)O=!1,K.logger.warn('$ref: keywords ignored in schema at path "'+K.errSchemaPath+'"')}if(K.schema.$comment&&K.opts.$comment)P+=" "+K.RULES.all.$comment.code(K,"$comment");if(l){if(K.opts.coerceTypes)var I=K.util.coerceToTypes(K.opts.coerceTypes,l);var y=K.RULES.types[l];if(I||R||y===!0||y&&!o8(y)){var J=K.schemaPath+".type",X=K.errSchemaPath+"/type",J=K.schemaPath+".type",X=K.errSchemaPath+"/type",i=R?"checkDataTypes":"checkDataType";if(P+=" if ("+K.util[i](l,A,K.opts.strictNumbers,!0)+") { ",I){var t="dataType"+W,U="coerced"+W;if(P+=" var "+t+" = typeof "+A+"; var "+U+" = undefined; ",K.opts.coerceTypes=="array")P+=" if ("+t+" == 'object' && Array.isArray("+A+") && "+A+".length == 1) { "+A+" = "+A+"[0]; "+t+" = typeof "+A+"; if ("+K.util.checkDataType(K.schema.type,A,K.opts.strictNumbers)+") "+U+" = "+A+"; } ";P+=" if ("+U+" !== undefined) ; ";var w8=I;if(w8){var Y8,T8=-1,v8=w8.length-1;while(T8<v8)if(Y8=w8[T8+=1],Y8=="string")P+=" else if ("+t+" == 'number' || "+t+" == 'boolean') "+U+" = '' + "+A+"; else if ("+A+" === null) "+U+" = ''; ";else if(Y8=="number"||Y8=="integer"){if(P+=" else if ("+t+" == 'boolean' || "+A+" === null || ("+t+" == 'string' && "+A+" && "+A+" == +"+A+" ",Y8=="integer")P+=" && !("+A+" % 1)";P+=")) "+U+" = +"+A+"; "}else if(Y8=="boolean")P+=" else if ("+A+" === 'false' || "+A+" === 0 || "+A+" === null) "+U+" = false; else if ("+A+" === 'true' || "+A+" === 1) "+U+" = true; ";else if(Y8=="null")P+=" else if ("+A+" === '' || "+A+" === 0 || "+A+" === false) "+U+" = null; ";else if(K.opts.coerceTypes=="array"&&Y8=="array")P+=" else if ("+t+" == 'string' || "+t+" == 'number' || "+t+" == 'boolean' || "+A+" == null) "+U+" = ["+A+"]; "}P+=" else { ";var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(r||"type")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: { type: '",R)P+=""+l.join(",");else P+=""+l;if(P+="' } ",K.opts.messages!==!1){if(P+=" , message: 'should be ",R)P+=""+l.join(",");else P+=""+l;P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+J+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&b)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } if ("+U+" !== undefined) { ";var f8=H?"data"+(H-1||""):"parentData",R8=H?K.dataPathArr[H]:"parentDataProperty";if(P+=" "+A+" = "+U+"; ",!H)P+="if ("+f8+" !== undefined)";P+=" "+f8+"["+R8+"] = "+U+"; } "}else{var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(r||"type")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: { type: '",R)P+=""+l.join(",");else P+=""+l;if(P+="' } ",K.opts.messages!==!1){if(P+=" , message: 'should be ",R)P+=""+l.join(",");else P+=""+l;P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+J+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&b)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}P+=" } "}}if(K.schema.$ref&&!O){if(P+=" "+K.RULES.all.$ref.code(K,"$ref")+" ",b){if(P+=" } if (errors === ",V)P+="0";else P+="errs_"+W;P+=") { ",p+="}"}}else{var f6=K.RULES;if(f6){var y,j6=-1,h=f6.length-1;while(j6<h)if(y=f6[j6+=1],o8(y)){if(y.type)P+=" if ("+K.util.checkDataType(y.type,A,K.opts.strictNumbers)+") { ";if(K.opts.useDefaults){if(y.type=="object"&&K.schema.properties){var Z=K.schema.properties,C=Object.keys(Z),T=C;if(T){var M,x=-1,o=T.length-1;while(x<o){M=T[x+=1];var c=Z[M];if(c.default!==void 0){var B=A+K.util.getProperty(M);if(K.compositeRule){if(K.opts.strictDefaults){var m="default is ignored for: "+B;if(K.opts.strictDefaults==="log")K.logger.warn(m);else throw new Error(m)}}else{if(P+=" if ("+B+" === undefined ",K.opts.useDefaults=="empty")P+=" || "+B+" === null || "+B+" === '' ";if(P+=" ) "+B+" = ",K.opts.useDefaults=="shared")P+=" "+K.useDefault(c.default)+" ";else P+=" "+JSON.stringify(c.default)+" ";P+="; "}}}}}else if(y.type=="array"&&Array.isArray(K.schema.items)){var K8=K.schema.items;if(K8){var c,T8=-1,W8=K8.length-1;while(T8<W8)if(c=K8[T8+=1],c.default!==void 0){var B=A+"["+T8+"]";if(K.compositeRule){if(K.opts.strictDefaults){var m="default is ignored for: "+B;if(K.opts.strictDefaults==="log")K.logger.warn(m);else throw new Error(m)}}else{if(P+=" if ("+B+" === undefined ",K.opts.useDefaults=="empty")P+=" || "+B+" === null || "+B+" === '' ";if(P+=" ) "+B+" = ",K.opts.useDefaults=="shared")P+=" "+K.useDefault(c.default)+" ";else P+=" "+JSON.stringify(c.default)+" ";P+="; "}}}}}var $8=y.rules;if($8){var A8,g8=-1,V8=$8.length-1;while(g8<V8)if(A8=$8[g8+=1],h6(A8)){var W6=A8.code(K,A8.keyword,y.type);if(W6){if(P+=" "+W6+" ",b)d+="}"}}}if(b)P+=" "+d+" ",d="";if(y.type){if(P+=" } ",l&&l===y.type&&!I){P+=" else { ";var J=K.schemaPath+".type",X=K.errSchemaPath+"/type",G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(r||"type")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: { type: '",R)P+=""+l.join(",");else P+=""+l;if(P+="' } ",K.opts.messages!==!1){if(P+=" , message: 'should be ",R)P+=""+l.join(",");else P+=""+l;P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+J+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&b)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } "}}if(b){if(P+=" if (errors === ",V)P+="0";else P+="errs_"+W;P+=") { ",p+="}"}}}}if(b)P+=" "+p+" ";if(V){if($)P+=" if (errors === 0) return data; ",P+=" else throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; ",P+=" return errors === 0; ";P+=" }; return validate;"}else P+=" var "+S+" = errors === errs_"+W+";";function o8(Y6){var a6=Y6.rules;for(var m6=0;m6<a6.length;m6++)if(h6(a6[m6]))return!0}function h6(Y6){return K.schema[Y6.keyword]!==void 0||Y6.implements&&y8(Y6)}function y8(Y6){var a6=Y6.implements;for(var m6=0;m6<a6.length;m6++)if(K.schema[a6[m6]]!==void 0)return!0}return P}}),TT=H8((q,_)=>{var j=W2(),K=zK(),f=J2(),Y=Q1(),P=qP(),$=K.ucs2length,O=z2(),w=f.Validation;_.exports=v;function v(D,V,m,S){var b=this,d=this._opts,p=[void 0],r={},l=[],R={},I=[],y={},i=[];V=V||{schema:D,refVal:p,refs:r};var t=z.call(this,D,V,S),U=this._compilations[t.index];if(t.compiling)return U.callValidate=f8;var w8=this._formats,Y8=this.RULES;try{var T8=R8(D,V,m,S);U.validate=T8;var v8=U.callValidate;if(v8){if(v8.schema=T8.schema,v8.errors=null,v8.refs=T8.refs,v8.refVal=T8.refVal,v8.root=T8.root,v8.$async=T8.$async,d.sourceCode)v8.source=T8.source}return T8}finally{W.call(this,D,V,S)}function f8(){var c=U.validate,B=c.apply(this,arguments);return f8.errors=c.errors,B}function R8(c,B,K8,W8){var $8=!B||B&&B.schema==c;if(B.schema!=V.schema)return v.call(b,c,B,K8,W8);var A8=c.$async===!0,g8=P({isTop:!0,schema:c,isRoot:$8,baseId:W8,root:B,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:f.MissingRef,RULES:Y8,validate:P,util:K,resolve:j,resolveRef:f6,usePattern:M,useDefault:x,useCustomRule:o,opts:d,formats:w8,logger:b.logger,self:b});if(g8=G(p,X)+G(l,Z)+G(I,J)+G(i,A)+g8,d.processCode)g8=d.processCode(g8,c);var V8;try{var W6=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",g8);V8=W6(b,Y8,w8,V,p,I,i,O,$,w),p[0]=V8}catch(o8){throw b.logger.error("Error compiling schema, function code:",g8),o8}if(V8.schema=c,V8.errors=null,V8.refs=r,V8.refVal=p,V8.root=$8?V8:B,A8)V8.$async=!0;if(d.sourceCode===!0)V8.source={code:g8,patterns:l,defaults:I};return V8}function f6(c,B,K8){B=j.url(c,B);var W8=r[B],$8,A8;if(W8!==void 0)return $8=p[W8],A8="refVal["+W8+"]",T($8,A8);if(!K8&&V.refs){var g8=V.refs[B];if(g8!==void 0)return $8=V.refVal[g8],A8=j6(B,$8),T($8,A8)}A8=j6(B);var V8=j.call(b,R8,V,B);if(V8===void 0){var W6=m&&m[B];if(W6)V8=j.inlineRef(W6,d.inlineRefs)?W6:v.call(b,W6,V,m,c)}if(V8===void 0)h(B);else return C(B,V8),T(V8,A8)}function j6(c,B){var K8=p.length;return p[K8]=B,r[c]=K8,"refVal"+K8}function h(c){delete r[c]}function C(c,B){var K8=r[c];p[K8]=B}function T(c,B){return typeof c=="object"||typeof c=="boolean"?{code:B,schema:c,inline:!0}:{code:B,$async:c&&!!c.$async}}function M(c){var B=R[c];if(B===void 0)B=R[c]=l.length,l[B]=c;return"pattern"+B}function x(c){switch(typeof c){case"boolean":case"number":return""+c;case"string":return K.toQuotedString(c);case"object":if(c===null)return"null";var B=Y(c),K8=y[B];if(K8===void 0)K8=y[B]=I.length,I[K8]=c;return"default"+K8}}function o(c,B,K8,W8){if(b._opts.validateSchema!==!1){var $8=c.definition.dependencies;if($8&&!$8.every(function(a6){return Object.prototype.hasOwnProperty.call(K8,a6)}))throw new Error("parent schema must have all required keywords: "+$8.join(","));var A8=c.definition.validateSchema;if(A8){var g8=A8(B);if(!g8){var V8="keyword schema is invalid: "+b.errorsText(A8.errors);if(b._opts.validateSchema=="log")b.logger.error(V8);else throw new Error(V8)}}}var W6=c.definition.compile,o8=c.definition.inline,h6=c.definition.macro,y8;if(W6)y8=W6.call(b,B,K8,W8);else if(h6){if(y8=h6.call(b,B,K8,W8),d.validateSchema!==!1)b.validateSchema(y8,!0)}else if(o8)y8=o8.call(b,W8,c.keyword,B,K8);else if(y8=c.definition.validate,!y8)return;if(y8===void 0)throw new Error('custom keyword "'+c.keyword+'"failed to compile');var Y6=i.length;return i[Y6]=y8,{code:"customRule"+Y6,validate:y8}}}function z(D,V,m){var S=H.call(this,D,V,m);if(S>=0)return{index:S,compiling:!0};return S=this._compilations.length,this._compilations[S]={schema:D,root:V,baseId:m},{index:S,compiling:!1}}function W(D,V,m){var S=H.call(this,D,V,m);if(S>=0)this._compilations.splice(S,1)}function H(D,V,m){for(var S=0;S<this._compilations.length;S++){var b=this._compilations[S];if(b.schema==D&&b.root==V&&b.baseId==m)return S}return-1}function Z(D,V){return"var pattern"+D+" = new RegExp("+K.toQuotedString(V[D])+");"}function J(D){return"var default"+D+" = defaults["+D+"];"}function X(D,V){return V[D]===void 0?"":"var refVal"+D+" = refVal["+D+"];"}function A(D){return"var customRule"+D+" = customRules["+D+"];"}function G(D,V){if(!D.length)return"";var m="";for(var S=0;S<D.length;S++)m+=V(S,D);return m}}),ZT=H8((q,_)=>{var j=_.exports=function K(){this._cache={}};j.prototype.put=function K(f,Y){this._cache[f]=Y},j.prototype.get=function K(f){return this._cache[f]},j.prototype.del=function K(f){delete this._cache[f]},j.prototype.clear=function K(){this._cache={}}}),kT=H8((q,_)=>{var j=zK(),K=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,f=[0,31,28,31,30,31,30,31,31,30,31,30,31],Y=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,P=/^(?=.{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,$=/^(?:[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,O=/^(?:[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,w=/^(?:(?:[^\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,v=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,z=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,W=/^(?:\/(?:[^~/]|~0|~1)*)*$/,H=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Z=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;_.exports=J;function J(p){return p=p=="full"?"full":"fast",j.copy(J[p])}J.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\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,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":w,url:v,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,hostname:P,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:d,uuid:z,"json-pointer":W,"json-pointer-uri-fragment":H,"relative-json-pointer":Z},J.full={date:A,time:G,"date-time":V,uri:S,"uri-reference":O,"uri-template":w,url:v,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:P,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:d,uuid:z,"json-pointer":W,"json-pointer-uri-fragment":H,"relative-json-pointer":Z};function X(p){return p%4===0&&(p%100!==0||p%400===0)}function A(p){var r=p.match(K);if(!r)return!1;var l=+r[1],R=+r[2],I=+r[3];return R>=1&&R<=12&&I>=1&&I<=(R==2&&X(l)?29:f[R])}function G(p,r){var l=p.match(Y);if(!l)return!1;var R=l[1],I=l[2],y=l[3],i=l[5];return(R<=23&&I<=59&&y<=59||R==23&&I==59&&y==60)&&(!r||i)}var D=/t|\s/i;function V(p){var r=p.split(D);return r.length==2&&A(r[0])&&G(r[1],!0)}var m=/\/|:/;function S(p){return m.test(p)&&$.test(p)}var b=/[^\\]\\Z/;function d(p){if(b.test(p))return!1;try{return new RegExp(p),!0}catch(r){return!1}}}),XT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.errSchemaPath+"/"+f,z=!K.opts.allErrors,W="data"+(O||""),H="valid"+$,Z,J;if(w=="#"||w=="#/")if(K.isRoot)Z=K.async,J="validate";else Z=K.root.schema.$async===!0,J="root.refVal[0]";else{var X=K.resolveRef(K.baseId,w,K.isRoot);if(X===void 0){var A=K.MissingRefError.message(K.baseId,w);if(K.opts.missingRefs=="fail"){K.logger.error(A);var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(v)+" , params: { ref: '"+K.util.escapeQuotes(w)+"' } ",K.opts.messages!==!1)P+=" , message: 'can\\'t resolve reference "+K.util.escapeQuotes(w)+"' ";if(K.opts.verbose)P+=" , schema: "+K.util.toQuotedString(w)+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+W+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&z)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(z)P+=" if (false) { "}else if(K.opts.missingRefs=="ignore"){if(K.logger.warn(A),z)P+=" if (true) { "}else throw new K.MissingRefError(K.baseId,w,A)}else if(X.inline){var V=K.util.copy(K);V.level++;var m="valid"+V.level;V.schema=X.schema,V.schemaPath="",V.errSchemaPath=w;var S=K.validate(V).replace(/validate\.schema/g,X.code);if(P+=" "+S+" ",z)P+=" if ("+m+") { "}else Z=X.$async===!0||K.async&&X.$async!==!1,J=X.code}if(J){var G=G||[];if(G.push(P),P="",K.opts.passContext)P+=" "+J+".call(this, ";else P+=" "+J+"( ";if(P+=" "+W+", (dataPath || '')",K.errorPath!='""')P+=" + "+K.errorPath;var b=O?"data"+(O-1||""):"parentData",d=O?K.dataPathArr[O]:"parentDataProperty";P+=" , "+b+" , "+d+", rootData) ";var p=P;if(P=G.pop(),Z){if(!K.async)throw new Error("async schema referenced by sync schema");if(z)P+=" var "+H+"; ";if(P+=" try { await "+p+"; ",z)P+=" "+H+" = true; ";if(P+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",z)P+=" "+H+" = false; ";if(P+=" } ",z)P+=" if ("+H+") { "}else if(P+=" if (!"+p+") { if (vErrors === null) vErrors = "+J+".errors; else vErrors = vErrors.concat("+J+".errors); errors = vErrors.length; } ",z)P+=" else { "}return P}}),AT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.schema[f],O=K.schemaPath+K.util.getProperty(f),w=K.errSchemaPath+"/"+f,v=!K.opts.allErrors,z=K.util.copy(K),W="";z.level++;var H="valid"+z.level,Z=z.baseId,J=!0,X=$;if(X){var A,G=-1,D=X.length-1;while(G<D)if(A=X[G+=1],K.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:K.util.schemaHasRules(A,K.RULES.all)){if(J=!1,z.schema=A,z.schemaPath=O+"["+G+"]",z.errSchemaPath=w+"/"+G,P+=" "+K.validate(z)+" ",z.baseId=Z,v)P+=" if ("+H+") { ",W+="}"}}if(v)if(J)P+=" if (true) { ";else P+=" "+W.slice(0,-1)+" ";return P}}),GT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="valid"+$,J="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D=w.every(function(r){return K.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===!1:K.util.schemaHasRules(r,K.RULES.all)});if(D){var V=X.baseId;P+=" var "+J+" = errors; var "+Z+" = false; ";var m=K.compositeRule;K.compositeRule=X.compositeRule=!0;var S=w;if(S){var b,d=-1,p=S.length-1;while(d<p)b=S[d+=1],X.schema=b,X.schemaPath=v+"["+d+"]",X.errSchemaPath=z+"/"+d,P+=" "+K.validate(X)+" ",X.baseId=V,P+=" "+Z+" = "+Z+" || "+G+"; if (!"+Z+") { ",A+="}"}if(K.compositeRule=X.compositeRule=m,P+=" "+A+" if (!"+Z+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should match some schema in anyOf' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+=" } else { errors = "+J+"; if (vErrors !== null) { if ("+J+") vErrors.length = "+J+"; else vErrors = null; } ",K.opts.allErrors)P+=" } "}else if(W)P+=" if (true) { ";return P}}),uT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.schema[f],O=K.errSchemaPath+"/"+f,w=!K.opts.allErrors,v=K.util.toQuotedString($);if(K.opts.$comment===!0)P+=" console.log("+v+");";else if(typeof K.opts.$comment=="function")P+=" self._opts.$comment("+v+", "+K.util.toQuotedString(O)+", validate.root.schema);";return P}}),hT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="valid"+$,J=K.opts.$data&&w&&w.$data,X;if(J)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",X="schema"+$;else X=w;if(!J)P+=" var schema"+$+" = validate.schema"+v+";";P+="var "+Z+" = equal("+H+", schema"+$+"); if (!"+Z+") { ";var A=A||[];if(A.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'const' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { allowedValue: schema"+$+" } ",K.opts.messages!==!1)P+=" , message: 'should be equal to constant' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";var G=P;if(P=A.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+G+"]); ";else P+=" validate.errors = ["+G+"]; return false; ";else P+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" }",W)P+=" else { ";return P}}),DT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="valid"+$,J="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D="i"+$,V=X.dataLevel=K.dataLevel+1,m="data"+V,S=K.baseId,b=K.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:K.util.schemaHasRules(w,K.RULES.all);if(P+="var "+J+" = errors;var "+Z+";",b){var d=K.compositeRule;K.compositeRule=X.compositeRule=!0,X.schema=w,X.schemaPath=v,X.errSchemaPath=z,P+=" var "+G+" = false; for (var "+D+" = 0; "+D+" < "+H+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var p=H+"["+D+"]";X.dataPathArr[V]=D;var r=K.validate(X);if(X.baseId=S,K.util.varOccurences(r,m)<2)P+=" "+K.util.varReplace(r,m,p)+" ";else P+=" var "+m+" = "+p+"; "+r+" ";P+=" if ("+G+") break; } ",K.compositeRule=X.compositeRule=d,P+=" "+A+" if (!"+G+") {"}else P+=" if ("+H+".length == 0) {";var l=l||[];if(l.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should contain a valid item' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";var R=P;if(P=l.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+R+"]); ";else P+=" validate.errors = ["+R+"]; return false; ";else P+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else { ",b)P+=" errors = "+J+"; if (vErrors !== null) { if ("+J+") vErrors.length = "+J+"; else vErrors = null; } ";if(K.opts.allErrors)P+=" } ";return P}}),CT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="errs__"+$,J=K.util.copy(K),X="";J.level++;var A="valid"+J.level,G={},D={},V=K.opts.ownProperties;for(d in w){if(d=="__proto__")continue;var m=w[d],S=Array.isArray(m)?D:G;S[d]=m}P+="var "+Z+" = errors;";var b=K.errorPath;P+="var missing"+$+";";for(var d in D)if(S=D[d],S.length){if(P+=" if ( "+H+K.util.getProperty(d)+" !== undefined ",V)P+=" && Object.prototype.hasOwnProperty.call("+H+", '"+K.util.escapeQuotes(d)+"') ";if(W){P+=" && ( ";var p=S;if(p){var r,l=-1,R=p.length-1;while(l<R){if(r=p[l+=1],l)P+=" || ";var I=K.util.getProperty(r),y=H+I;if(P+=" ( ( "+y+" === undefined ",V)P+=" || ! Object.prototype.hasOwnProperty.call("+H+", '"+K.util.escapeQuotes(r)+"') ";P+=") && (missing"+$+" = "+K.util.toQuotedString(K.opts.jsonPointers?r:I)+") ) "}}P+=")) { ";var i="missing"+$,t="' + "+i+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.opts.jsonPointers?K.util.getPathExpr(b,i,!0):b+" + "+i;var U=U||[];if(U.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { property: '"+K.util.escapeQuotes(d)+"', missingProperty: '"+t+"', depsCount: "+S.length+", deps: '"+K.util.escapeQuotes(S.length==1?S[0]:S.join(", "))+"' } ",K.opts.messages!==!1){if(P+=" , message: 'should have ",S.length==1)P+="property "+K.util.escapeQuotes(S[0]);else P+="properties "+K.util.escapeQuotes(S.join(", "));P+=" when property "+K.util.escapeQuotes(d)+" is present' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";var w8=P;if(P=U.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+w8+"]); ";else P+=" validate.errors = ["+w8+"]; return false; ";else P+=" var err = "+w8+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{P+=" ) { ";var Y8=S;if(Y8){var r,T8=-1,v8=Y8.length-1;while(T8<v8){r=Y8[T8+=1];var I=K.util.getProperty(r),t=K.util.escapeQuotes(r),y=H+I;if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPath(b,r,K.opts.jsonPointers);if(P+=" if ( "+y+" === undefined ",V)P+=" || ! Object.prototype.hasOwnProperty.call("+H+", '"+K.util.escapeQuotes(r)+"') ";if(P+=") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { property: '"+K.util.escapeQuotes(d)+"', missingProperty: '"+t+"', depsCount: "+S.length+", deps: '"+K.util.escapeQuotes(S.length==1?S[0]:S.join(", "))+"' } ",K.opts.messages!==!1){if(P+=" , message: 'should have ",S.length==1)P+="property "+K.util.escapeQuotes(S[0]);else P+="properties "+K.util.escapeQuotes(S.join(", "));P+=" when property "+K.util.escapeQuotes(d)+" is present' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}if(P+=" } ",W)X+="}",P+=" else { "}K.errorPath=b;var f8=J.baseId;for(var d in G){var m=G[d];if(K.opts.strictKeywords?typeof m=="object"&&Object.keys(m).length>0||m===!1:K.util.schemaHasRules(m,K.RULES.all)){if(P+=" "+A+" = true; if ( "+H+K.util.getProperty(d)+" !== undefined ",V)P+=" && Object.prototype.hasOwnProperty.call("+H+", '"+K.util.escapeQuotes(d)+"') ";if(P+=") { ",J.schema=m,J.schemaPath=v+K.util.getProperty(d),J.errSchemaPath=z+"/"+K.util.escapeFragment(d),P+=" "+K.validate(J)+" ",J.baseId=f8,P+=" } ",W)P+=" if ("+A+") { ",X+="}"}}if(W)P+=" "+X+" if ("+Z+" == errors) {";return P}}),VT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="valid"+$,J=K.opts.$data&&w&&w.$data,X;if(J)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",X="schema"+$;else X=w;var A="i"+$,G="schema"+$;if(!J)P+=" var "+G+" = validate.schema"+v+";";if(P+="var "+Z+";",J)P+=" if (schema"+$+" === undefined) "+Z+" = true; else if (!Array.isArray(schema"+$+")) "+Z+" = false; else {";if(P+=""+Z+" = false;for (var "+A+"=0; "+A+"<"+G+".length; "+A+"++) if (equal("+H+", "+G+"["+A+"])) { "+Z+" = true; break; }",J)P+=" } ";P+=" if (!"+Z+") { ";var D=D||[];if(D.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { allowedValues: schema"+$+" } ",K.opts.messages!==!1)P+=" , message: 'should be equal to one of the allowed values' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";var V=P;if(P=D.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+V+"]); ";else P+=" validate.errors = ["+V+"]; return false; ";else P+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" }",W)P+=" else { ";return P}}),MT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||"");if(K.opts.format===!1){if(W)P+=" if (true) { ";return P}var Z=K.opts.$data&&w&&w.$data,J;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",J="schema"+$;else J=w;var X=K.opts.unknownFormats,A=Array.isArray(X);if(Z){var G="format"+$,D="isObject"+$,V="formatType"+$;if(P+=" var "+G+" = formats["+J+"]; var "+D+" = typeof "+G+" == 'object' && !("+G+" instanceof RegExp) && "+G+".validate; var "+V+" = "+D+" && "+G+".type || 'string'; if ("+D+") { ",K.async)P+=" var async"+$+" = "+G+".async; ";if(P+=" "+G+" = "+G+".validate; } if ( ",Z)P+=" ("+J+" !== undefined && typeof "+J+" != 'string') || ";if(P+=" (",X!="ignore"){if(P+=" ("+J+" && !"+G+" ",A)P+=" && self._opts.unknownFormats.indexOf("+J+") == -1 ";P+=") || "}if(P+=" ("+G+" && "+V+" == '"+Y+"' && !(typeof "+G+" == 'function' ? ",K.async)P+=" (async"+$+" ? await "+G+"("+H+") : "+G+"("+H+")) ";else P+=" "+G+"("+H+") ";P+=" : "+G+".test("+H+"))))) {"}else{var G=K.formats[w];if(!G)if(X=="ignore"){if(K.logger.warn('unknown format "'+w+'" ignored in schema at path "'+K.errSchemaPath+'"'),W)P+=" if (true) { ";return P}else if(A&&X.indexOf(w)>=0){if(W)P+=" if (true) { ";return P}else throw new Error('unknown format "'+w+'" is used in schema at path "'+K.errSchemaPath+'"');var D=typeof G=="object"&&!(G instanceof RegExp)&&G.validate,V=D&&G.type||"string";if(D){var m=G.async===!0;G=G.validate}if(V!=Y){if(W)P+=" if (true) { ";return P}if(m){if(!K.async)throw new Error("async format in sync schema");var S="formats"+K.util.getProperty(w)+".validate";P+=" if (!(await "+S+"("+H+"))) { "}else{P+=" if (! ";var S="formats"+K.util.getProperty(w);if(D)S+=".validate";if(typeof G=="function")P+=" "+S+"("+H+") ";else P+=" "+S+".test("+H+") ";P+=") { "}}var b=b||[];if(b.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'format' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { format: ",Z)P+=""+J;else P+=""+K.util.toQuotedString(w);if(P+=" } ",K.opts.messages!==!1){if(P+=` , message: 'should match format "`,Z)P+="' + "+J+" + '";else P+=""+K.util.escapeQuotes(w);P+=`"' `}if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+K.util.toQuotedString(w);P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" "}P+=" } "}else P+=" {} ";var d=P;if(P=b.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+d+"]); ";else P+=" validate.errors = ["+d+"]; return false; ";else P+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { ";return P}}),NT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="valid"+$,J="errs__"+$,X=K.util.copy(K);X.level++;var A="valid"+X.level,G=K.schema.then,D=K.schema.else,V=G!==void 0&&(K.opts.strictKeywords?typeof G=="object"&&Object.keys(G).length>0||G===!1:K.util.schemaHasRules(G,K.RULES.all)),m=D!==void 0&&(K.opts.strictKeywords?typeof D=="object"&&Object.keys(D).length>0||D===!1:K.util.schemaHasRules(D,K.RULES.all)),S=X.baseId;if(V||m){var b;X.createErrors=!1,X.schema=w,X.schemaPath=v,X.errSchemaPath=z,P+=" var "+J+" = errors; var "+Z+" = true; ";var d=K.compositeRule;if(K.compositeRule=X.compositeRule=!0,P+=" "+K.validate(X)+" ",X.baseId=S,X.createErrors=!0,P+=" errors = "+J+"; if (vErrors !== null) { if ("+J+") vErrors.length = "+J+"; else vErrors = null; } ",K.compositeRule=X.compositeRule=d,V){if(P+=" if ("+A+") { ",X.schema=K.schema.then,X.schemaPath=K.schemaPath+".then",X.errSchemaPath=K.errSchemaPath+"/then",P+=" "+K.validate(X)+" ",X.baseId=S,P+=" "+Z+" = "+A+"; ",V&&m)b="ifClause"+$,P+=" var "+b+" = 'then'; ";else b="'then'";if(P+=" } ",m)P+=" else { "}else P+=" if (!"+A+") { ";if(m){if(X.schema=K.schema.else,X.schemaPath=K.schemaPath+".else",X.errSchemaPath=K.errSchemaPath+"/else",P+=" "+K.validate(X)+" ",X.baseId=S,P+=" "+Z+" = "+A+"; ",V&&m)b="ifClause"+$,P+=" var "+b+" = 'else'; ";else b="'else'";P+=" } "}if(P+=" if (!"+Z+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'if' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { failingKeyword: "+b+" } ",K.opts.messages!==!1)P+=` , message: 'should match "' + `+b+` + '" schema' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+=" } ",W)P+=" else { "}else if(W)P+=" if (true) { ";return P}}),bT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="valid"+$,J="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D="i"+$,V=X.dataLevel=K.dataLevel+1,m="data"+V,S=K.baseId;if(P+="var "+J+" = errors;var "+Z+";",Array.isArray(w)){var b=K.schema.additionalItems;if(b===!1){P+=" "+Z+" = "+H+".length <= "+w.length+"; ";var d=z;z=K.errSchemaPath+"/additionalItems",P+=" if (!"+Z+") { ";var p=p||[];if(p.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+w.length+" } ",K.opts.messages!==!1)P+=" , message: 'should NOT have more than "+w.length+" items' ";if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";var r=P;if(P=p.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+r+"]); ";else P+=" validate.errors = ["+r+"]; return false; ";else P+=" var err = "+r+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",z=d,W)A+="}",P+=" else { "}var l=w;if(l){var R,I=-1,y=l.length-1;while(I<y)if(R=l[I+=1],K.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:K.util.schemaHasRules(R,K.RULES.all)){P+=" "+G+" = true; if ("+H+".length > "+I+") { ";var i=H+"["+I+"]";X.schema=R,X.schemaPath=v+"["+I+"]",X.errSchemaPath=z+"/"+I,X.errorPath=K.util.getPathExpr(K.errorPath,I,K.opts.jsonPointers,!0),X.dataPathArr[V]=I;var t=K.validate(X);if(X.baseId=S,K.util.varOccurences(t,m)<2)P+=" "+K.util.varReplace(t,m,i)+" ";else P+=" var "+m+" = "+i+"; "+t+" ";if(P+=" } ",W)P+=" if ("+G+") { ",A+="}"}}if(typeof b=="object"&&(K.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:K.util.schemaHasRules(b,K.RULES.all))){X.schema=b,X.schemaPath=K.schemaPath+".additionalItems",X.errSchemaPath=K.errSchemaPath+"/additionalItems",P+=" "+G+" = true; if ("+H+".length > "+w.length+") { for (var "+D+" = "+w.length+"; "+D+" < "+H+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var i=H+"["+D+"]";X.dataPathArr[V]=D;var t=K.validate(X);if(X.baseId=S,K.util.varOccurences(t,m)<2)P+=" "+K.util.varReplace(t,m,i)+" ";else P+=" var "+m+" = "+i+"; "+t+" ";if(W)P+=" if (!"+G+") break; ";if(P+=" } } ",W)P+=" if ("+G+") { ",A+="}"}}else if(K.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:K.util.schemaHasRules(w,K.RULES.all)){X.schema=w,X.schemaPath=v,X.errSchemaPath=z,P+=" for (var "+D+" = 0; "+D+" < "+H+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var i=H+"["+D+"]";X.dataPathArr[V]=D;var t=K.validate(X);if(X.baseId=S,K.util.varOccurences(t,m)<2)P+=" "+K.util.varReplace(t,m,i)+" ";else P+=" var "+m+" = "+i+"; "+t+" ";if(W)P+=" if (!"+G+") break; ";P+=" }"}if(W)P+=" "+A+" if ("+J+" == errors) {";return P}}),c1=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,S,H="data"+(O||""),Z=K.opts.$data&&w&&w.$data,J;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",J="schema"+$;else J=w;var X=f=="maximum",A=X?"exclusiveMaximum":"exclusiveMinimum",G=K.schema[A],D=K.opts.$data&&G&&G.$data,V=X?"<":">",m=X?">":"<",S=void 0;if(!(Z||typeof w=="number"||w===void 0))throw new Error(f+" must be number");if(!(D||G===void 0||typeof G=="number"||typeof G=="boolean"))throw new Error(A+" must be number or boolean");if(D){var b=K.util.getData(G.$data,O,K.dataPathArr),d="exclusive"+$,p="exclType"+$,r="exclIsNumber"+$,l="op"+$,R="' + "+l+" + '";P+=" var schemaExcl"+$+" = "+b+"; ",b="schemaExcl"+$,P+=" var "+d+"; var "+p+" = typeof "+b+"; if ("+p+" != 'boolean' && "+p+" != 'undefined' && "+p+" != 'number') { ";var S=A,I=I||[];if(I.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(S||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: '"+A+" should be boolean' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";var y=P;if(P=I.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+y+"]); ";else P+=" validate.errors = ["+y+"]; return false; ";else P+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else if ( ",Z)P+=" ("+J+" !== undefined && typeof "+J+" != 'number') || ";if(P+=" "+p+" == 'number' ? ( ("+d+" = "+J+" === undefined || "+b+" "+V+"= "+J+") ? "+H+" "+m+"= "+b+" : "+H+" "+m+" "+J+" ) : ( ("+d+" = "+b+" === true) ? "+H+" "+m+"= "+J+" : "+H+" "+m+" "+J+" ) || "+H+" !== "+H+") { var op"+$+" = "+d+" ? '"+V+"' : '"+V+"='; ",w===void 0)S=A,z=K.errSchemaPath+"/"+A,J=b,Z=D}else{var r=typeof G=="number",R=V;if(r&&Z){var l="'"+R+"'";if(P+=" if ( ",Z)P+=" ("+J+" !== undefined && typeof "+J+" != 'number') || ";P+=" ( "+J+" === undefined || "+G+" "+V+"= "+J+" ? "+H+" "+m+"= "+G+" : "+H+" "+m+" "+J+" ) || "+H+" !== "+H+") { "}else{if(r&&w===void 0)d=!0,S=A,z=K.errSchemaPath+"/"+A,J=G,m+="=";else{if(r)J=Math[X?"min":"max"](G,w);if(G===(r?J:!0))d=!0,S=A,z=K.errSchemaPath+"/"+A,m+="=";else d=!1,R+="="}var l="'"+R+"'";if(P+=" if ( ",Z)P+=" ("+J+" !== undefined && typeof "+J+" != 'number') || ";P+=" "+H+" "+m+" "+J+" || "+H+" !== "+H+") { "}}S=S||f;var I=I||[];if(I.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(S||"_limit")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { comparison: "+l+", limit: "+J+", exclusive: "+d+" } ",K.opts.messages!==!1)if(P+=" , message: 'should be "+R+" ",Z)P+="' + "+J;else P+=""+J+"'";if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" "}P+=" } "}else P+=" {} ";var y=P;if(P=I.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+y+"]); ";else P+=" validate.errors = ["+y+"]; return false; ";else P+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { ";return P}}),r1=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,A,H="data"+(O||""),Z=K.opts.$data&&w&&w.$data,J;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",J="schema"+$;else J=w;if(!(Z||typeof w=="number"))throw new Error(f+" must be number");var X=f=="maxItems"?">":"<";if(P+="if ( ",Z)P+=" ("+J+" !== undefined && typeof "+J+" != 'number') || ";P+=" "+H+".length "+X+" "+J+") { ";var A=f,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitItems")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+J+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT have ",f=="maxItems")P+="more";else P+="fewer";if(P+=" than ",Z)P+="' + "+J+" + '";else P+=""+w;P+=" items' "}if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),i1=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,A,H="data"+(O||""),Z=K.opts.$data&&w&&w.$data,J;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",J="schema"+$;else J=w;if(!(Z||typeof w=="number"))throw new Error(f+" must be number");var X=f=="maxLength"?">":"<";if(P+="if ( ",Z)P+=" ("+J+" !== undefined && typeof "+J+" != 'number') || ";if(K.opts.unicode===!1)P+=" "+H+".length ";else P+=" ucs2length("+H+") ";P+=" "+X+" "+J+") { ";var A=f,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitLength")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+J+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT be ",f=="maxLength")P+="longer";else P+="shorter";if(P+=" than ",Z)P+="' + "+J+" + '";else P+=""+w;P+=" characters' "}if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),o1=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,A,H="data"+(O||""),Z=K.opts.$data&&w&&w.$data,J;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",J="schema"+$;else J=w;if(!(Z||typeof w=="number"))throw new Error(f+" must be number");var X=f=="maxProperties"?">":"<";if(P+="if ( ",Z)P+=" ("+J+" !== undefined && typeof "+J+" != 'number') || ";P+=" Object.keys("+H+").length "+X+" "+J+") { ";var A=f,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitProperties")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+J+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT have ",f=="maxProperties")P+="more";else P+="fewer";if(P+=" than ",Z)P+="' + "+J+" + '";else P+=""+w;P+=" properties' "}if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),ST=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z=K.opts.$data&&w&&w.$data,J;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",J="schema"+$;else J=w;if(!(Z||typeof w=="number"))throw new Error(f+" must be number");if(P+="var division"+$+";if (",Z)P+=" "+J+" !== undefined && ( typeof "+J+" != 'number' || ";if(P+=" (division"+$+" = "+H+" / "+J+", ",K.opts.multipleOfPrecision)P+=" Math.abs(Math.round(division"+$+") - division"+$+") > 1e-"+K.opts.multipleOfPrecision+" ";else P+=" division"+$+" !== parseInt(division"+$+") ";if(P+=" ) ",Z)P+=" ) ";P+=" ) { ";var X=X||[];if(X.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { multipleOf: "+J+" } ",K.opts.messages!==!1)if(P+=" , message: 'should be multiple of ",Z)P+="' + "+J;else P+=""+J+"'";if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" "}P+=" } "}else P+=" {} ";var A=P;if(P=X.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+A+"]); ";else P+=" validate.errors = ["+A+"]; return false; ";else P+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),ET=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="errs__"+$,J=K.util.copy(K);J.level++;var X="valid"+J.level;if(K.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:K.util.schemaHasRules(w,K.RULES.all)){J.schema=w,J.schemaPath=v,J.errSchemaPath=z,P+=" var "+Z+" = errors; ";var A=K.compositeRule;K.compositeRule=J.compositeRule=!0,J.createErrors=!1;var G;if(J.opts.allErrors)G=J.opts.allErrors,J.opts.allErrors=!1;if(P+=" "+K.validate(J)+" ",J.createErrors=!0,G)J.opts.allErrors=G;K.compositeRule=J.compositeRule=A,P+=" if ("+X+") { ";var D=D||[];if(D.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'not' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should NOT be valid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";var V=P;if(P=D.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+V+"]); ";else P+=" validate.errors = ["+V+"]; return false; ";else P+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else { errors = "+Z+"; if (vErrors !== null) { if ("+Z+") vErrors.length = "+Z+"; else vErrors = null; } ",K.opts.allErrors)P+=" } "}else{if(P+=" var err = ",K.createErrors!==!1){if(P+=" { keyword: 'not' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should NOT be valid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",W)P+=" if (false) { "}return P}}),RT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="valid"+$,J="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D=X.baseId,V="prevValid"+$,m="passingSchemas"+$;P+="var "+J+" = errors , "+V+" = false , "+Z+" = false , "+m+" = null; ";var S=K.compositeRule;K.compositeRule=X.compositeRule=!0;var b=w;if(b){var d,p=-1,r=b.length-1;while(p<r){if(d=b[p+=1],K.opts.strictKeywords?typeof d=="object"&&Object.keys(d).length>0||d===!1:K.util.schemaHasRules(d,K.RULES.all))X.schema=d,X.schemaPath=v+"["+p+"]",X.errSchemaPath=z+"/"+p,P+=" "+K.validate(X)+" ",X.baseId=D;else P+=" var "+G+" = true; ";if(p)P+=" if ("+G+" && "+V+") { "+Z+" = false; "+m+" = ["+m+", "+p+"]; } else { ",A+="}";P+=" if ("+G+") { "+Z+" = "+V+" = true; "+m+" = "+p+"; }"}}if(K.compositeRule=X.compositeRule=S,P+=""+A+"if (!"+Z+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { passingSchemas: "+m+" } ",K.opts.messages!==!1)P+=" , message: 'should match exactly one schema in oneOf' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+="} else { errors = "+J+"; if (vErrors !== null) { if ("+J+") vErrors.length = "+J+"; else vErrors = null; }",K.opts.allErrors)P+=" } ";return P}}),mT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z=K.opts.$data&&w&&w.$data,J;if(Z)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",J="schema"+$;else J=w;var X=Z?"(new RegExp("+J+"))":K.usePattern(w);if(P+="if ( ",Z)P+=" ("+J+" !== undefined && typeof "+J+" != 'string') || ";P+=" !"+X+".test("+H+") ) { ";var A=A||[];if(A.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { pattern: ",Z)P+=""+J;else P+=""+K.util.toQuotedString(w);if(P+=" } ",K.opts.messages!==!1){if(P+=` , message: 'should match pattern "`,Z)P+="' + "+J+" + '";else P+=""+K.util.escapeQuotes(w);P+=`"' `}if(K.opts.verbose){if(P+=" , schema: ",Z)P+="validate.schema"+v;else P+=""+K.util.toQuotedString(w);P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" "}P+=" } "}else P+=" {} ";var G=P;if(P=A.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+G+"]); ";else P+=" validate.errors = ["+G+"]; return false; ";else P+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),IT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="errs__"+$,J=K.util.copy(K),X="";J.level++;var A="valid"+J.level,G="key"+$,D="idx"+$,V=J.dataLevel=K.dataLevel+1,m="data"+V,S="dataProperties"+$,b=Object.keys(w||{}).filter(T8),d=K.schema.patternProperties||{},p=Object.keys(d).filter(T8),r=K.schema.additionalProperties,l=b.length||p.length,R=r===!1,I=typeof r=="object"&&Object.keys(r).length,y=K.opts.removeAdditional,i=R||I||y,t=K.opts.ownProperties,U=K.baseId,w8=K.schema.required;if(w8&&!(K.opts.$data&&w8.$data)&&w8.length<K.opts.loopRequired)var Y8=K.util.toHash(w8);function T8($q){return $q!=="__proto__"}if(P+="var "+Z+" = errors;var "+A+" = true;",t)P+=" var "+S+" = undefined;";if(i){if(t)P+=" "+S+" = "+S+" || Object.keys("+H+"); for (var "+D+"=0; "+D+"<"+S+".length; "+D+"++) { var "+G+" = "+S+"["+D+"]; ";else P+=" for (var "+G+" in "+H+") { ";if(l){if(P+=" var isAdditional"+$+" = !(false ",b.length)if(b.length>8)P+=" || validate.schema"+v+".hasOwnProperty("+G+") ";else{var v8=b;if(v8){var f8,R8=-1,f6=v8.length-1;while(R8<f6)f8=v8[R8+=1],P+=" || "+G+" == "+K.util.toQuotedString(f8)+" "}}if(p.length){var j6=p;if(j6){var h,C=-1,T=j6.length-1;while(C<T)h=j6[C+=1],P+=" || "+K.usePattern(h)+".test("+G+") "}}P+=" ); if (isAdditional"+$+") { "}if(y=="all")P+=" delete "+H+"["+G+"]; ";else{var M=K.errorPath,x="' + "+G+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);if(R)if(y)P+=" delete "+H+"["+G+"]; ";else{P+=" "+A+" = false; ";var o=z;z=K.errSchemaPath+"/additionalProperties";var c=c||[];if(c.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { additionalProperty: '"+x+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is an invalid additional property";else P+="should NOT have additional properties";P+="' "}if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";var B=P;if(P=c.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+B+"]); ";else P+=" validate.errors = ["+B+"]; return false; ";else P+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(z=o,W)P+=" break; "}else if(I)if(y=="failing"){P+=" var "+Z+" = errors; ";var K8=K.compositeRule;K.compositeRule=J.compositeRule=!0,J.schema=r,J.schemaPath=K.schemaPath+".additionalProperties",J.errSchemaPath=K.errSchemaPath+"/additionalProperties",J.errorPath=K.opts._errorDataPathProperty?K.errorPath:K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);var W8=H+"["+G+"]";J.dataPathArr[V]=G;var $8=K.validate(J);if(J.baseId=U,K.util.varOccurences($8,m)<2)P+=" "+K.util.varReplace($8,m,W8)+" ";else P+=" var "+m+" = "+W8+"; "+$8+" ";P+=" if (!"+A+") { errors = "+Z+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+H+"["+G+"]; } ",K.compositeRule=J.compositeRule=K8}else{J.schema=r,J.schemaPath=K.schemaPath+".additionalProperties",J.errSchemaPath=K.errSchemaPath+"/additionalProperties",J.errorPath=K.opts._errorDataPathProperty?K.errorPath:K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);var W8=H+"["+G+"]";J.dataPathArr[V]=G;var $8=K.validate(J);if(J.baseId=U,K.util.varOccurences($8,m)<2)P+=" "+K.util.varReplace($8,m,W8)+" ";else P+=" var "+m+" = "+W8+"; "+$8+" ";if(W)P+=" if (!"+A+") break; "}K.errorPath=M}if(l)P+=" } ";if(P+=" } ",W)P+=" if ("+A+") { ",X+="}"}var A8=K.opts.useDefaults&&!K.compositeRule;if(b.length){var g8=b;if(g8){var f8,V8=-1,W6=g8.length-1;while(V8<W6){f8=g8[V8+=1];var o8=w[f8];if(K.opts.strictKeywords?typeof o8=="object"&&Object.keys(o8).length>0||o8===!1:K.util.schemaHasRules(o8,K.RULES.all)){var h6=K.util.getProperty(f8),W8=H+h6,y8=A8&&o8.default!==void 0;J.schema=o8,J.schemaPath=v+h6,J.errSchemaPath=z+"/"+K.util.escapeFragment(f8),J.errorPath=K.util.getPath(K.errorPath,f8,K.opts.jsonPointers),J.dataPathArr[V]=K.util.toQuotedString(f8);var $8=K.validate(J);if(J.baseId=U,K.util.varOccurences($8,m)<2){$8=K.util.varReplace($8,m,W8);var Y6=W8}else{var Y6=m;P+=" var "+m+" = "+W8+"; "}if(y8)P+=" "+$8+" ";else{if(Y8&&Y8[f8]){if(P+=" if ( "+Y6+" === undefined ",t)P+=" || ! Object.prototype.hasOwnProperty.call("+H+", '"+K.util.escapeQuotes(f8)+"') ";P+=") { "+A+" = false; ";var M=K.errorPath,o=z,a6=K.util.escapeQuotes(f8);if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPath(M,f8,K.opts.jsonPointers);z=K.errSchemaPath+"/required";var c=c||[];if(c.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+a6+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+a6+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";var B=P;if(P=c.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+B+"]); ";else P+=" validate.errors = ["+B+"]; return false; ";else P+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";z=o,K.errorPath=M,P+=" } else { "}else if(W){if(P+=" if ( "+Y6+" === undefined ",t)P+=" || ! Object.prototype.hasOwnProperty.call("+H+", '"+K.util.escapeQuotes(f8)+"') ";P+=") { "+A+" = true; } else { "}else{if(P+=" if ("+Y6+" !== undefined ",t)P+=" && Object.prototype.hasOwnProperty.call("+H+", '"+K.util.escapeQuotes(f8)+"') ";P+=" ) { "}P+=" "+$8+" } "}}if(W)P+=" if ("+A+") { ",X+="}"}}}if(p.length){var m6=p;if(m6){var h,I3=-1,F7=m6.length-1;while(I3<F7){h=m6[I3+=1];var o8=d[h];if(K.opts.strictKeywords?typeof o8=="object"&&Object.keys(o8).length>0||o8===!1:K.util.schemaHasRules(o8,K.RULES.all)){if(J.schema=o8,J.schemaPath=K.schemaPath+".patternProperties"+K.util.getProperty(h),J.errSchemaPath=K.errSchemaPath+"/patternProperties/"+K.util.escapeFragment(h),t)P+=" "+S+" = "+S+" || Object.keys("+H+"); for (var "+D+"=0; "+D+"<"+S+".length; "+D+"++) { var "+G+" = "+S+"["+D+"]; ";else P+=" for (var "+G+" in "+H+") { ";P+=" if ("+K.usePattern(h)+".test("+G+")) { ",J.errorPath=K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);var W8=H+"["+G+"]";J.dataPathArr[V]=G;var $8=K.validate(J);if(J.baseId=U,K.util.varOccurences($8,m)<2)P+=" "+K.util.varReplace($8,m,W8)+" ";else P+=" var "+m+" = "+W8+"; "+$8+" ";if(W)P+=" if (!"+A+") break; ";if(P+=" } ",W)P+=" else "+A+" = true; ";if(P+=" } ",W)P+=" if ("+A+") { ",X+="}"}}}}if(W)P+=" "+X+" if ("+Z+" == errors) {";return P}}),gT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="errs__"+$,J=K.util.copy(K),X="";J.level++;var A="valid"+J.level;if(P+="var "+Z+" = errors;",K.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:K.util.schemaHasRules(w,K.RULES.all)){J.schema=w,J.schemaPath=v,J.errSchemaPath=z;var G="key"+$,D="idx"+$,V="i"+$,m="' + "+G+" + '",S=J.dataLevel=K.dataLevel+1,b="data"+S,d="dataProperties"+$,p=K.opts.ownProperties,r=K.baseId;if(p)P+=" var "+d+" = undefined; ";if(p)P+=" "+d+" = "+d+" || Object.keys("+H+"); for (var "+D+"=0; "+D+"<"+d+".length; "+D+"++) { var "+G+" = "+d+"["+D+"]; ";else P+=" for (var "+G+" in "+H+") { ";P+=" var startErrs"+$+" = errors; ";var l=G,R=K.compositeRule;K.compositeRule=J.compositeRule=!0;var I=K.validate(J);if(J.baseId=r,K.util.varOccurences(I,b)<2)P+=" "+K.util.varReplace(I,b,l)+" ";else P+=" var "+b+" = "+l+"; "+I+" ";if(K.compositeRule=J.compositeRule=R,P+=" if (!"+A+") { for (var "+V+"=startErrs"+$+"; "+V+"<errors; "+V+"++) { vErrors["+V+"].propertyName = "+G+"; } var err = ",K.createErrors!==!1){if(P+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { propertyName: '"+m+"' } ",K.opts.messages!==!1)P+=" , message: 'property name \\'"+m+"\\' is invalid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(W)P+=" break; ";P+=" } }"}if(W)P+=" "+X+" if ("+Z+" == errors) {";return P}}),yT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="valid"+$,J=K.opts.$data&&w&&w.$data,X;if(J)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",X="schema"+$;else X=w;var A="schema"+$;if(!J)if(w.length<K.opts.loopRequired&&K.schema.properties&&Object.keys(K.schema.properties).length){var G=[],D=w;if(D){var V,m=-1,S=D.length-1;while(m<S){V=D[m+=1];var b=K.schema.properties[V];if(!(b&&(K.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:K.util.schemaHasRules(b,K.RULES.all))))G[G.length]=V}}}else var G=w;if(J||G.length){var d=K.errorPath,p=J||G.length>=K.opts.loopRequired,r=K.opts.ownProperties;if(W)if(P+=" var missing"+$+"; ",p){if(!J)P+=" var "+A+" = validate.schema"+v+"; ";var l="i"+$,R="schema"+$+"["+l+"]",I="' + "+R+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPathExpr(d,R,K.opts.jsonPointers);if(P+=" var "+Z+" = true; ",J)P+=" if (schema"+$+" === undefined) "+Z+" = true; else if (!Array.isArray(schema"+$+")) "+Z+" = false; else {";if(P+=" for (var "+l+" = 0; "+l+" < "+A+".length; "+l+"++) { "+Z+" = "+H+"["+A+"["+l+"]] !== undefined ",r)P+=" && Object.prototype.hasOwnProperty.call("+H+", "+A+"["+l+"]) ";if(P+="; if (!"+Z+") break; } ",J)P+=" } ";P+=" if (!"+Z+") { ";var y=y||[];if(y.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+I+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+I+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";var i=P;if(P=y.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+i+"]); ";else P+=" validate.errors = ["+i+"]; return false; ";else P+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } else { "}else{P+=" if ( ";var t=G;if(t){var U,l=-1,w8=t.length-1;while(l<w8){if(U=t[l+=1],l)P+=" || ";var Y8=K.util.getProperty(U),T8=H+Y8;if(P+=" ( ( "+T8+" === undefined ",r)P+=" || ! Object.prototype.hasOwnProperty.call("+H+", '"+K.util.escapeQuotes(U)+"') ";P+=") && (missing"+$+" = "+K.util.toQuotedString(K.opts.jsonPointers?U:Y8)+") ) "}}P+=") { ";var R="missing"+$,I="' + "+R+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.opts.jsonPointers?K.util.getPathExpr(d,R,!0):d+" + "+R;var y=y||[];if(y.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+I+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+I+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";var i=P;if(P=y.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+i+"]); ";else P+=" validate.errors = ["+i+"]; return false; ";else P+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } else { "}else if(p){if(!J)P+=" var "+A+" = validate.schema"+v+"; ";var l="i"+$,R="schema"+$+"["+l+"]",I="' + "+R+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPathExpr(d,R,K.opts.jsonPointers);if(J){if(P+=" if ("+A+" && !Array.isArray("+A+")) { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+I+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+I+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+A+" !== undefined) { "}if(P+=" for (var "+l+" = 0; "+l+" < "+A+".length; "+l+"++) { if ("+H+"["+A+"["+l+"]] === undefined ",r)P+=" || ! Object.prototype.hasOwnProperty.call("+H+", "+A+"["+l+"]) ";if(P+=") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+I+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+I+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",J)P+=" } "}else{var v8=G;if(v8){var U,f8=-1,R8=v8.length-1;while(f8<R8){U=v8[f8+=1];var Y8=K.util.getProperty(U),I=K.util.escapeQuotes(U),T8=H+Y8;if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPath(d,U,K.opts.jsonPointers);if(P+=" if ( "+T8+" === undefined ",r)P+=" || ! Object.prototype.hasOwnProperty.call("+H+", '"+K.util.escapeQuotes(U)+"') ";if(P+=") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+I+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+I+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" ";P+=" } "}else P+=" {} ";P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}K.errorPath=d}else if(W)P+=" if (true) {";return P}}),dT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H="data"+(O||""),Z="valid"+$,J=K.opts.$data&&w&&w.$data,X;if(J)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",X="schema"+$;else X=w;if((w||J)&&K.opts.uniqueItems!==!1){if(J)P+=" var "+Z+"; if ("+X+" === false || "+X+" === undefined) "+Z+" = true; else if (typeof "+X+" != 'boolean') "+Z+" = false; else { ";P+=" var i = "+H+".length , "+Z+" = true , j; if (i > 1) { ";var A=K.schema.items&&K.schema.items.type,G=Array.isArray(A);if(!A||A=="object"||A=="array"||G&&(A.indexOf("object")>=0||A.indexOf("array")>=0))P+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+H+"[i], "+H+"[j])) { "+Z+" = false; break outer; } } } ";else{P+=" var itemIndices = {}, item; for (;i--;) { var item = "+H+"[i]; ";var D="checkDataType"+(G?"s":"");if(P+=" if ("+K.util[D](A,"item",K.opts.strictNumbers,!0)+") continue; ",G)P+=` if (typeof item == 'string') item = '"' + item; `;P+=" if (typeof itemIndices[item] == 'number') { "+Z+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}if(P+=" } ",J)P+=" } ";P+=" if (!"+Z+") { ";var V=V||[];if(V.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { i: i, j: j } ",K.opts.messages!==!1)P+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' ";if(K.opts.verbose){if(P+=" , schema: ",J)P+="validate.schema"+v;else P+=""+w;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+H+" "}P+=" } "}else P+=" {} ";var m=P;if(P=V.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+m+"]); ";else P+=" validate.errors = ["+m+"]; return false; ";else P+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { "}else if(W)P+=" if (true) { ";return P}}),pT=H8((q,_)=>{_.exports={$ref:XT(),allOf:AT(),anyOf:GT(),$comment:uT(),const:hT(),contains:DT(),dependencies:CT(),enum:VT(),format:MT(),if:NT(),items:bT(),maximum:c1(),minimum:c1(),maxItems:r1(),minItems:r1(),maxLength:i1(),minLength:i1(),maxProperties:o1(),minProperties:o1(),multipleOf:ST(),not:ET(),oneOf:RT(),pattern:mT(),properties:IT(),propertyNames:gT(),required:yT(),uniqueItems:dT(),validate:qP()}}),LT=H8((q,_)=>{var j=pT(),K=zK().toHash;_.exports=function f(){var Y=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],P=["type","$comment"],$=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],O=["number","integer","string","array","object","boolean","null"];return Y.all=K(P),Y.types=K(O),Y.forEach(function(w){if(w.rules=w.rules.map(function(v){var z;if(typeof v=="object"){var W=Object.keys(v)[0];z=v[W],v=W,z.forEach(function(Z){P.push(Z),Y.all[Z]=!0})}P.push(v);var H=Y.all[v]={keyword:v,code:j[v],implements:z};return H}),Y.all.$comment={keyword:"$comment",code:j.$comment},w.type)Y.types[w.type]=w}),Y.keywords=K(P.concat($)),Y.custom={},Y}}),lT=H8((q,_)=>{var j=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];_.exports=function(K,f){for(var Y=0;Y<f.length;Y++){K=JSON.parse(JSON.stringify(K));var P=f[Y].split("/"),$=K,O;for(O=1;O<P.length;O++)$=$[P[O]];for(O=0;O<j.length;O++){var w=j[O],v=$[w];if(v)$[w]={anyOf:[v,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}}}return K}}),xT=H8((q,_)=>{var j=J2().MissingRef;_.exports=K;function K(f,Y,P){var $=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof Y=="function")P=Y,Y=void 0;var O=w(f).then(function(){var z=$._addSchema(f,void 0,Y);return z.validate||v(z)});if(P)O.then(function(z){P(null,z)},P);return O;function w(z){var W=z.$schema;return W&&!$.getSchema(W)?K.call($,{$ref:W},!0):Promise.resolve()}function v(z){try{return $._compile(z)}catch(H){if(H instanceof j)return W(H);throw H}function W(H){var Z=H.missingSchema;if(A(Z))throw new Error("Schema "+Z+" is loaded but "+H.missingRef+" cannot be resolved");var J=$._loadingSchemas[Z];if(!J)J=$._loadingSchemas[Z]=$._opts.loadSchema(Z),J.then(X,X);return J.then(function(G){if(!A(Z))return w(G).then(function(){if(!A(Z))$.addSchema(G,Z,void 0,Y)})}).then(function(){return v(z)});function X(){delete $._loadingSchemas[Z]}function A(G){return $._refs[G]||$._schemas[G]}}}}}),nT=H8((q,_)=>{_.exports=function j(K,f,Y){var P=" ",$=K.level,O=K.dataLevel,w=K.schema[f],v=K.schemaPath+K.util.getProperty(f),z=K.errSchemaPath+"/"+f,W=!K.opts.allErrors,H,Z="data"+(O||""),J="valid"+$,X="errs__"+$,A=K.opts.$data&&w&&w.$data,G;if(A)P+=" var schema"+$+" = "+K.util.getData(w.$data,O,K.dataPathArr)+"; ",G="schema"+$;else G=w;var D=this,V="definition"+$,m=D.definition,S="",b,d,p,r,l;if(A&&m.$data){l="keywordValidate"+$;var R=m.validateSchema;P+=" var "+V+" = RULES.custom['"+f+"'].definition; var "+l+" = "+V+".validate;"}else{if(r=K.useCustomRule(D,w,K.schema,K),!r)return;G="validate.schema"+v,l=r.code,b=m.compile,d=m.inline,p=m.macro}var I=l+".errors",y="i"+$,i="ruleErr"+$,t=m.async;if(t&&!K.async)throw new Error("async keyword in sync schema");if(!(d||p))P+=""+I+" = null;";if(P+="var "+X+" = errors;var "+J+";",A&&m.$data){if(S+="}",P+=" if ("+G+" === undefined) { "+J+" = true; } else { ",R)S+="}",P+=" "+J+" = "+V+".validateSchema("+G+"); if ("+J+") { "}if(d)if(m.statements)P+=" "+r.validate+" ";else P+=" "+J+" = "+r.validate+"; ";else if(p){var U=K.util.copy(K),S="";U.level++;var w8="valid"+U.level;U.schema=r.validate,U.schemaPath="";var Y8=K.compositeRule;K.compositeRule=U.compositeRule=!0;var T8=K.validate(U).replace(/validate\.schema/g,l);K.compositeRule=U.compositeRule=Y8,P+=" "+T8}else{var v8=v8||[];if(v8.push(P),P="",P+=" "+l+".call( ",K.opts.passContext)P+="this";else P+="self";if(b||m.schema===!1)P+=" , "+Z+" ";else P+=" , "+G+" , "+Z+" , validate.schema"+K.schemaPath+" ";if(P+=" , (dataPath || '')",K.errorPath!='""')P+=" + "+K.errorPath;var f8=O?"data"+(O-1||""):"parentData",R8=O?K.dataPathArr[O]:"parentDataProperty";P+=" , "+f8+" , "+R8+" , rootData ) ";var f6=P;if(P=v8.pop(),m.errors===!1){if(P+=" "+J+" = ",t)P+="await ";P+=""+f6+"; "}else if(t)I="customErrors"+$,P+=" var "+I+" = null; try { "+J+" = await "+f6+"; } catch (e) { "+J+" = false; if (e instanceof ValidationError) "+I+" = e.errors; else throw e; } ";else P+=" "+I+" = null; "+J+" = "+f6+"; "}if(m.modifying)P+=" if ("+f8+") "+Z+" = "+f8+"["+R8+"];";if(P+=""+S,m.valid){if(W)P+=" if (true) { "}else{if(P+=" if ( ",m.valid===void 0)if(P+=" !",p)P+=""+w8;else P+=""+J;else P+=" "+!m.valid+" ";P+=") { ",H=D.keyword;var v8=v8||[];v8.push(P),P="";var v8=v8||[];if(v8.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(H||"custom")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { keyword: '"+D.keyword+"' } ",K.opts.messages!==!1)P+=` , message: 'should pass "`+D.keyword+`" keyword validation' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+Z+" ";P+=" } "}else P+=" {} ";var j6=P;if(P=v8.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+j6+"]); ";else P+=" validate.errors = ["+j6+"]; return false; ";else P+=" var err = "+j6+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var h=P;if(P=v8.pop(),d)if(m.errors){if(m.errors!="full"){if(P+=" for (var "+y+"="+X+"; "+y+"<errors; "+y+"++) { var "+i+" = vErrors["+y+"]; if ("+i+".dataPath === undefined) "+i+".dataPath = (dataPath || '') + "+K.errorPath+"; if ("+i+".schemaPath === undefined) { "+i+'.schemaPath = "'+z+'"; } ',K.opts.verbose)P+=" "+i+".schema = "+G+"; "+i+".data = "+Z+"; ";P+=" } "}}else if(m.errors===!1)P+=" "+h+" ";else{if(P+=" if ("+X+" == errors) { "+h+" } else { for (var "+y+"="+X+"; "+y+"<errors; "+y+"++) { var "+i+" = vErrors["+y+"]; if ("+i+".dataPath === undefined) "+i+".dataPath = (dataPath || '') + "+K.errorPath+"; if ("+i+".schemaPath === undefined) { "+i+'.schemaPath = "'+z+'"; } ',K.opts.verbose)P+=" "+i+".schema = "+G+"; "+i+".data = "+Z+"; ";P+=" } } "}else if(p){if(P+=" var err = ",K.createErrors!==!1){if(P+=" { keyword: '"+(H||"custom")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { keyword: '"+D.keyword+"' } ",K.opts.messages!==!1)P+=` , message: 'should pass "`+D.keyword+`" keyword validation' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+Z+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; "}else if(m.errors===!1)P+=" "+h+" ";else{if(P+=" if (Array.isArray("+I+")) { if (vErrors === null) vErrors = "+I+"; else vErrors = vErrors.concat("+I+"); errors = vErrors.length; for (var "+y+"="+X+"; "+y+"<errors; "+y+"++) { var "+i+" = vErrors["+y+"]; if ("+i+".dataPath === undefined) "+i+".dataPath = (dataPath || '') + "+K.errorPath+"; "+i+'.schemaPath = "'+z+'"; ',K.opts.verbose)P+=" "+i+".schema = "+G+"; "+i+".data = "+Z+"; ";P+=" } } else { "+h+" } "}if(P+=" } ",W)P+=" else { "}return P}}),_P=H8((q,_)=>{_.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}}),cT=H8((q,_)=>{var j=_P();_.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:j.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:j.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}}),rT=H8((q,_)=>{var j=/^[a-z_$][a-z0-9_$-]*$/i,K=nT(),f=cT();_.exports={add:Y,get:P,remove:$,validate:O};function Y(w,v){var z=this.RULES;if(z.keywords[w])throw new Error("Keyword "+w+" is already defined");if(!j.test(w))throw new Error("Keyword "+w+" is not a valid identifier");if(v){this.validateKeyword(v,!0);var W=v.type;if(Array.isArray(W))for(var H=0;H<W.length;H++)J(w,W[H],v);else J(w,W,v);var Z=v.metaSchema;if(Z){if(v.$data&&this._opts.$data)Z={anyOf:[Z,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]};v.validateSchema=this.compile(Z,!0)}}z.keywords[w]=z.all[w]=!0;function J(X,A,G){var D;for(var V=0;V<z.length;V++){var m=z[V];if(m.type==A){D=m;break}}if(!D)D={type:A,rules:[]},z.push(D);var S={keyword:X,definition:G,custom:!0,code:K,implements:G.implements};D.rules.push(S),z.custom[X]=S}return this}function P(w){var v=this.RULES.custom[w];return v?v.definition:this.RULES.keywords[w]||!1}function $(w){var v=this.RULES;delete v.keywords[w],delete v.all[w],delete v.custom[w];for(var z=0;z<v.length;z++){var W=v[z].rules;for(var H=0;H<W.length;H++)if(W[H].keyword==w){W.splice(H,1);break}}return this}function O(w,v){O.errors=null;var z=this._validateKeyword=this._validateKeyword||this.compile(f,!0);if(z(w))return!0;if(O.errors=z.errors,v)throw new Error("custom keyword definition is invalid: "+this.errorsText(z.errors));else return!1}}),iT=H8((q,_)=>{_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),oT=H8((q,_)=>{var j=TT(),K=W2(),f=ZT(),Y=s1(),P=Q1(),$=kT(),O=LT(),w=lT(),v=zK();_.exports=X,X.prototype.validate=A,X.prototype.compile=G,X.prototype.addSchema=D,X.prototype.addMetaSchema=V,X.prototype.validateSchema=m,X.prototype.getSchema=b,X.prototype.removeSchema=r,X.prototype.addFormat=Y8,X.prototype.errorsText=w8,X.prototype._addSchema=R,X.prototype._compile=I,X.prototype.compileAsync=xT();var z=rT();X.prototype.addKeyword=z.add,X.prototype.getKeyword=z.get,X.prototype.removeKeyword=z.remove,X.prototype.validateKeyword=z.validate;var W=J2();X.ValidationError=W.Validation,X.MissingRefError=W.MissingRef,X.$dataMetaSchema=w;var H="http://json-schema.org/draft-07/schema",Z=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],J=["/properties"];function X(T){if(!(this instanceof X))return new X(T);if(T=this._opts=v.copy(T)||{},h(this),this._schemas={},this._refs={},this._fragments={},this._formats=$(T.format),this._cache=T.cache||new f,this._loadingSchemas={},this._compilations=[],this.RULES=O(),this._getId=y(T),T.loopRequired=T.loopRequired||1/0,T.errorDataPath=="property")T._errorDataPathProperty=!0;if(T.serialize===void 0)T.serialize=P;if(this._metaOpts=j6(this),T.formats)f8(this);if(T.keywords)R8(this);if(T8(this),typeof T.meta=="object")this.addMetaSchema(T.meta);if(T.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});v8(this)}function A(T,M){var x;if(typeof T=="string"){if(x=this.getSchema(T),!x)throw new Error('no schema with key or ref "'+T+'"')}else{var o=this._addSchema(T);x=o.validate||this._compile(o)}var c=x(M);if(x.$async!==!0)this.errors=x.errors;return c}function G(T,M){var x=this._addSchema(T,void 0,M);return x.validate||this._compile(x)}function D(T,M,x,o){if(Array.isArray(T)){for(var c=0;c<T.length;c++)this.addSchema(T[c],void 0,x,o);return this}var B=this._getId(T);if(B!==void 0&&typeof B!="string")throw new Error("schema id must be string");return M=K.normalizeId(M||B),f6(this,M),this._schemas[M]=this._addSchema(T,x,o,!0),this}function V(T,M,x){return this.addSchema(T,M,x,!0),this}function m(T,M){var x=T.$schema;if(x!==void 0&&typeof x!="string")throw new Error("$schema must be a string");if(x=x||this._opts.defaultMeta||S(this),!x)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var o=this.validate(x,T);if(!o&&M){var c="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(c);else throw new Error(c)}return o}function S(T){var M=T._opts.meta;return T._opts.defaultMeta=typeof M=="object"?T._getId(M)||M:T.getSchema(H)?H:void 0,T._opts.defaultMeta}function b(T){var M=p(this,T);switch(typeof M){case"object":return M.validate||this._compile(M);case"string":return this.getSchema(M);case"undefined":return d(this,T)}}function d(T,M){var x=K.schema.call(T,{schema:{}},M);if(x){var{schema:o,root:c,baseId:B}=x,K8=j.call(T,o,c,void 0,B);return T._fragments[M]=new Y({ref:M,fragment:!0,schema:o,root:c,baseId:B,validate:K8}),K8}}function p(T,M){return M=K.normalizeId(M),T._schemas[M]||T._refs[M]||T._fragments[M]}function r(T){if(T instanceof RegExp)return l(this,this._schemas,T),l(this,this._refs,T),this;switch(typeof T){case"undefined":return l(this,this._schemas),l(this,this._refs),this._cache.clear(),this;case"string":var M=p(this,T);if(M)this._cache.del(M.cacheKey);return delete this._schemas[T],delete this._refs[T],this;case"object":var x=this._opts.serialize,o=x?x(T):T;this._cache.del(o);var c=this._getId(T);if(c)c=K.normalizeId(c),delete this._schemas[c],delete this._refs[c]}return this}function l(T,M,x){for(var o in M){var c=M[o];if(!c.meta&&(!x||x.test(o)))T._cache.del(c.cacheKey),delete M[o]}}function R(T,M,x,o){if(typeof T!="object"&&typeof T!="boolean")throw new Error("schema should be object or boolean");var c=this._opts.serialize,B=c?c(T):T,K8=this._cache.get(B);if(K8)return K8;o=o||this._opts.addUsedSchema!==!1;var W8=K.normalizeId(this._getId(T));if(W8&&o)f6(this,W8);var $8=this._opts.validateSchema!==!1&&!M,A8;if($8&&!(A8=W8&&W8==K.normalizeId(T.$schema)))this.validateSchema(T,!0);var g8=K.ids.call(this,T),V8=new Y({id:W8,schema:T,localRefs:g8,cacheKey:B,meta:x});if(W8[0]!="#"&&o)this._refs[W8]=V8;if(this._cache.put(B,V8),$8&&A8)this.validateSchema(T,!0);return V8}function I(T,M){if(T.compiling){if(T.validate=c,c.schema=T.schema,c.errors=null,c.root=M?M:c,T.schema.$async===!0)c.$async=!0;return c}T.compiling=!0;var x;if(T.meta)x=this._opts,this._opts=this._metaOpts;var o;try{o=j.call(this,T.schema,M,T.localRefs)}catch(B){throw delete T.validate,B}finally{if(T.compiling=!1,T.meta)this._opts=x}return T.validate=o,T.refs=o.refs,T.refVal=o.refVal,T.root=o.root,o;function c(){var B=T.validate,K8=B.apply(this,arguments);return c.errors=B.errors,K8}}function y(T){switch(T.schemaId){case"auto":return U;case"id":return i;default:return t}}function i(T){if(T.$id)this.logger.warn("schema $id ignored",T.$id);return T.id}function t(T){if(T.id)this.logger.warn("schema id ignored",T.id);return T.$id}function U(T){if(T.$id&&T.id&&T.$id!=T.id)throw new Error("schema $id is different from id");return T.$id||T.id}function w8(T,M){if(T=T||this.errors,!T)return"No errors";M=M||{};var x=M.separator===void 0?", ":M.separator,o=M.dataVar===void 0?"data":M.dataVar,c="";for(var B=0;B<T.length;B++){var K8=T[B];if(K8)c+=o+K8.dataPath+" "+K8.message+x}return c.slice(0,-x.length)}function Y8(T,M){if(typeof M=="string")M=new RegExp(M);return this._formats[T]=M,this}function T8(T){var M;if(T._opts.$data)M=iT(),T.addMetaSchema(M,M.$id,!0);if(T._opts.meta===!1)return;var x=_P();if(T._opts.$data)x=w(x,J);T.addMetaSchema(x,H,!0),T._refs["http://json-schema.org/schema"]=H}function v8(T){var M=T._opts.schemas;if(!M)return;if(Array.isArray(M))T.addSchema(M);else for(var x in M)T.addSchema(M[x],x)}function f8(T){for(var M in T._opts.formats){var x=T._opts.formats[M];T.addFormat(M,x)}}function R8(T){for(var M in T._opts.keywords){var x=T._opts.keywords[M];T.addKeyword(M,x)}}function f6(T,M){if(T._schemas[M]||T._refs[M])throw new Error('schema with key or id "'+M+'" already exists')}function j6(T){var M=v.copy(T._opts);for(var x=0;x<Z.length;x++)delete M[Z[x]];return M}function h(T){var M=T._opts.logger;if(M===!1)T.logger={log:C,warn:C,error:C};else{if(M===void 0)M=console;if(!(typeof M=="object"&&M.log&&M.warn&&M.error))throw new Error("logger must implement log, warn and error methods");T.logger=M}}function C(){}});sT={accessSync(q,_){J8.accessSync(q,_)},cwd(){return process.cwd()},chmodSync(q,_){J8.chmodSync(q,_)},existsSync(q){return J8.existsSync(q)},async stat(q){return UT(q)},statSync(q){return J8.statSync(q)},readFileSync(q,_){return J8.readFileSync(q,{encoding:_.encoding})},readFileBytesSync(q){return J8.readFileSync(q)},readSync(q,_){let j=void 0;try{j=J8.openSync(q,"r");let K=Buffer.alloc(_.length),f=J8.readSync(j,K,0,_.length,0);return{buffer:K,bytesRead:f}}finally{if(j)J8.closeSync(j)}},writeFileSync(q,_,j){if(!j.flush){J8.writeFileSync(q,_,{encoding:j.encoding});return}let K;try{K=J8.openSync(q,"w"),J8.writeFileSync(K,_,{encoding:j.encoding}),J8.fsyncSync(K)}finally{if(K)J8.closeSync(K)}},appendFileSync(q,_){J8.appendFileSync(q,_)},copyFileSync(q,_){J8.copyFileSync(q,_)},unlinkSync(q){J8.unlinkSync(q)},renameSync(q,_){J8.renameSync(q,_)},symlinkSync(q,_){J8.symlinkSync(q,_)},readlinkSync(q){return J8.readlinkSync(q)},realpathSync(q){return J8.realpathSync(q)},mkdirSync(q){if(!J8.existsSync(q))J8.mkdirSync(q,{recursive:!0})},readdirSync(q){return J8.readdirSync(q,{withFileTypes:!0})},readdirStringSync(q){return J8.readdirSync(q)},isDirEmptySync(q){return this.readdirSync(q).length===0},rmdirSync(q){J8.rmdirSync(q)},rmSync(q,_){J8.rmSync(q,_)}},QT=sT;F_=class F_ extends Error{};PP=class PP{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(q){this.returned=q}[Symbol.asyncIterator](){if(this.started)throw new Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((q,_)=>{this.readResolve=q,this.readReject=_})}enqueue(q){if(this.readResolve){let _=this.readResolve;this.readResolve=void 0,this.readReject=void 0,_({done:!1,value:q})}else this.queue.push(q)}done(){if(this.isDone=!0,this.readResolve){let q=this.readResolve;this.readResolve=void 0,this.readReject=void 0,q({done:!0,value:void 0})}}error(q){if(this.hasError=q,this.readReject){let _=this.readReject;this.readResolve=void 0,this.readReject=void 0,_(q)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}};YP=class YP{transport;isStreamingMode;canUseTool;hooks;abortController;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new PP;intialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;pendingMcpResponses=new Map;constructor(q,_,j,K,f,Y=new Map){this.transport=q,this.isStreamingMode=_,this.canUseTool=j,this.hooks=K,this.abortController=f;for(let[P,$]of Y){let O=new fP((w)=>this.sendMcpServerMessageToCli(P,w));this.sdkMcpTransports.set(P,O),$.connect(O)}if(this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.isStreamingMode)this.intialization=this.initialize()}setError(q){this.inputStream.error(q)}cleanup(q){if(this.cleanupPerformed)return;this.cleanupPerformed=!0;try{if(this.transport.close(),this.pendingControlResponses.clear(),this.pendingMcpResponses.clear(),q)this.inputStream.error(q);else this.inputStream.done()}catch(_){}}next(...[q]){return this.sdkMessages.next(...[q])}return(q){return this.sdkMessages.return(q)}throw(q){return this.sdkMessages.throw(q)}[Symbol.asyncIterator](){return this.sdkMessages}[Symbol.asyncDispose](){return this.sdkMessages[Symbol.asyncDispose]()}async readMessages(){try{for await(let q of this.transport.readMessages()){if(q.type==="control_response"){let _=this.pendingControlResponses.get(q.response.request_id);if(_)_(q.response);continue}else if(q.type==="control_request"){this.handleControlRequest(q);continue}else if(q.type==="control_cancel_request"){this.handleControlCancelRequest(q);continue}this.inputStream.enqueue(q)}this.inputStream.done(),this.cleanup()}catch(q){this.inputStream.error(q),this.cleanup(q)}}async handleControlRequest(q){let _=new AbortController;this.cancelControllers.set(q.request_id,_);try{let j=await this.processControlRequest(q,_.signal),K={type:"control_response",response:{subtype:"success",request_id:q.request_id,response:j}};await Promise.resolve(this.transport.write(JSON.stringify(K)+`
107
111
  `))}catch(j){let K={type:"control_response",response:{subtype:"error",request_id:q.request_id,error:j.message||String(j)}};await Promise.resolve(this.transport.write(JSON.stringify(K)+`
108
- `))}finally{this.cancelControllers.delete(q.request_id)}}handleControlCancelRequest(q){let _=this.cancelControllers.get(q.request_id);if(_)_.abort(),this.cancelControllers.delete(q.request_id)}async processControlRequest(q,_){if(q.request.subtype==="can_use_tool"){if(!this.canUseTool)throw new Error("canUseTool callback is not provided.");return this.canUseTool(q.request.tool_name,q.request.input,{signal:_,suggestions:q.request.permission_suggestions})}else if(q.request.subtype==="hook_callback")return await this.handleHookCallbacks(q.request.callback_id,q.request.input,q.request.tool_use_id,_);else if(q.request.subtype==="mcp_message"){let j=q.request,K=this.sdkMcpTransports.get(j.server_name);if(!K)throw new Error(`SDK MCP server not found: ${j.server_name}`);if("method"in j.message&&"id"in j.message&&j.message.id!==null)return{mcp_response:await this.handleMcpControlRequest(j.server_name,j,K)};else{if(K.onmessage)K.onmessage(j.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}throw new Error("Unsupported control request subtype: "+q.request.subtype)}async*readSdkMessages(){for await(let q of this.inputStream)yield q}async initialize(){let q;if(this.hooks){q={};for(let[K,Y]of Object.entries(this.hooks))if(Y.length>0)q[K]=Y.map((f)=>{let P=[];for(let $ of f.hooks){let O=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(O,$),P.push(O)}return{matcher:f.matcher,hookCallbackIds:P}})}let _={subtype:"initialize",hooks:q};return(await this.request(_)).response}async interrupt(){if(!this.isStreamingMode)throw new Error("Interrupt requires --input-format stream-json");await this.request({subtype:"interrupt"})}async setPermissionMode(q){if(!this.isStreamingMode)throw new Error("setPermissionMode requires --input-format stream-json");await this.request({subtype:"set_permission_mode",mode:q})}request(q){let _=Math.random().toString(36).substring(2,15),j={request_id:_,type:"control_request",request:q};return new Promise((K,Y)=>{this.pendingControlResponses.set(_,(f)=>{if(f.subtype==="success")K(f);else Y(new Error(f.error))}),Promise.resolve(this.transport.write(JSON.stringify(j)+`
112
+ `))}finally{this.cancelControllers.delete(q.request_id)}}handleControlCancelRequest(q){let _=this.cancelControllers.get(q.request_id);if(_)_.abort(),this.cancelControllers.delete(q.request_id)}async processControlRequest(q,_){if(q.request.subtype==="can_use_tool"){if(!this.canUseTool)throw new Error("canUseTool callback is not provided.");return this.canUseTool(q.request.tool_name,q.request.input,{signal:_,suggestions:q.request.permission_suggestions})}else if(q.request.subtype==="hook_callback")return await this.handleHookCallbacks(q.request.callback_id,q.request.input,q.request.tool_use_id,_);else if(q.request.subtype==="mcp_message"){let j=q.request,K=this.sdkMcpTransports.get(j.server_name);if(!K)throw new Error(`SDK MCP server not found: ${j.server_name}`);if("method"in j.message&&"id"in j.message&&j.message.id!==null)return{mcp_response:await this.handleMcpControlRequest(j.server_name,j,K)};else{if(K.onmessage)K.onmessage(j.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}throw new Error("Unsupported control request subtype: "+q.request.subtype)}async*readSdkMessages(){for await(let q of this.inputStream)yield q}async initialize(){let q;if(this.hooks){q={};for(let[K,f]of Object.entries(this.hooks))if(f.length>0)q[K]=f.map((Y)=>{let P=[];for(let $ of Y.hooks){let O=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(O,$),P.push(O)}return{matcher:Y.matcher,hookCallbackIds:P}})}let _={subtype:"initialize",hooks:q};return(await this.request(_)).response}async interrupt(){if(!this.isStreamingMode)throw new Error("Interrupt requires --input-format stream-json");await this.request({subtype:"interrupt"})}async setPermissionMode(q){if(!this.isStreamingMode)throw new Error("setPermissionMode requires --input-format stream-json");await this.request({subtype:"set_permission_mode",mode:q})}request(q){let _=Math.random().toString(36).substring(2,15),j={request_id:_,type:"control_request",request:q};return new Promise((K,f)=>{this.pendingControlResponses.set(_,(Y)=>{if(Y.subtype==="success")K(Y);else f(new Error(Y.error))}),Promise.resolve(this.transport.write(JSON.stringify(j)+`
109
113
  `))})}async supportedCommands(){if(!this.isStreamingMode)throw new Error("supportedCommands requires --input-format stream-json");if(!this.intialization)throw new Error("supportedCommands requires transport with bidirectional communication");return(await this.intialization).commands}async streamInput(q){try{for await(let _ of q){if(this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(JSON.stringify(_)+`
110
- `))}this.transport.endInput()}catch(_){if(!(_ instanceof a_))throw _}}handleHookCallbacks(q,_,j,K){let Y=this.hookCallbacks.get(q);if(!Y)throw new Error(`No hook callback found for ID: ${q}`);return Y(_,j,{signal:K})}sendMcpServerMessageToCli(q,_){if("id"in _&&_.id!==null&&_.id!==void 0){let j=`${q}:${_.id}`,K=this.pendingMcpResponses.get(j);if(K){K.resolve(_),this.pendingMcpResponses.delete(j);return}}throw new Error("No pending request found")}handleMcpControlRequest(q,_,j){let K="id"in _.message?_.message.id:null,Y=`${q}:${K}`;return new Promise((f,P)=>{let $=null,O=()=>{if($)clearTimeout($);this.pendingMcpResponses.delete(Y)},w=(z)=>{O(),f(z)},v=(z)=>{O(),P(z)};if(this.pendingMcpResponses.set(Y,{resolve:w,reject:v}),j.onmessage)j.onmessage(_.message);else{O(),P(new Error("No message handler registered"));return}$=setTimeout(()=>{if(this.pendingMcpResponses.has(Y))O(),P(new Error("Request timeout"))},30000)})}};k={};KT(k,{void:()=>SZ,util:()=>u8,unknown:()=>NZ,union:()=>IZ,undefined:()=>CZ,tuple:()=>dZ,transformer:()=>c1,symbol:()=>DZ,string:()=>YP,strictObject:()=>mZ,setErrorMap:()=>tT,set:()=>lZ,record:()=>pZ,quotelessJson:()=>aT,promise:()=>oZ,preprocess:()=>tZ,pipeline:()=>eZ,ostring:()=>FZ,optional:()=>aZ,onumber:()=>UZ,oboolean:()=>sZ,objectUtil:()=>s4,object:()=>RZ,number:()=>fP,nullable:()=>BZ,null:()=>VZ,never:()=>bZ,nativeEnum:()=>iZ,nan:()=>GZ,map:()=>LZ,makeIssue:()=>t3,literal:()=>cZ,lazy:()=>nZ,late:()=>XZ,isValid:()=>z_,isDirty:()=>q2,isAsync:()=>nK,isAborted:()=>Q4,intersection:()=>yZ,instanceof:()=>AZ,getParsedType:()=>dq,getErrorMap:()=>B3,function:()=>xZ,enum:()=>rZ,effect:()=>c1,discriminatedUnion:()=>gZ,defaultErrorMap:()=>e_,datetimeRegex:()=>KP,date:()=>hZ,custom:()=>PP,coerce:()=>QZ,boolean:()=>$P,bigint:()=>uZ,array:()=>EZ,any:()=>MZ,addIssueToContext:()=>F,ZodVoid:()=>rK,ZodUnknown:()=>aq,ZodUnion:()=>Q_,ZodUndefined:()=>U_,ZodType:()=>k8,ZodTuple:()=>hq,ZodTransformer:()=>F6,ZodSymbol:()=>cK,ZodString:()=>fq,ZodSet:()=>H_,ZodSchema:()=>k8,ZodRecord:()=>iK,ZodReadonly:()=>fK,ZodPromise:()=>T_,ZodPipeline:()=>BK,ZodParsedType:()=>Q,ZodOptional:()=>wq,ZodObject:()=>r8,ZodNumber:()=>Bq,ZodNullable:()=>pq,ZodNull:()=>s_,ZodNever:()=>uq,ZodNativeEnum:()=>jK,ZodNaN:()=>aK,ZodMap:()=>oK,ZodLiteral:()=>KK,ZodLazy:()=>_K,ZodIssueCode:()=>e,ZodIntersection:()=>qK,ZodFunction:()=>t_,ZodFirstPartyTypeKind:()=>z8,ZodError:()=>d6,ZodEnum:()=>eq,ZodEffects:()=>F6,ZodDiscriminatedUnion:()=>e3,ZodDefault:()=>PK,ZodDate:()=>W_,ZodCatch:()=>YK,ZodBranded:()=>F3,ZodBoolean:()=>F_,ZodBigInt:()=>tq,ZodArray:()=>$q,ZodAny:()=>J_,Schema:()=>k8,ParseStatus:()=>Z6,OK:()=>C6,NEVER:()=>qk,INVALID:()=>O8,EMPTY_PATH:()=>eT,DIRTY:()=>B_,BRAND:()=>kZ});(function(q){q.assertEqual=(Y)=>{};function _(Y){}q.assertIs=_;function j(Y){throw new Error}q.assertNever=j,q.arrayToEnum=(Y)=>{let f={};for(let P of Y)f[P]=P;return f},q.getValidEnumValues=(Y)=>{let f=q.objectKeys(Y).filter(($)=>typeof Y[Y[$]]!=="number"),P={};for(let $ of f)P[$]=Y[$];return q.objectValues(P)},q.objectValues=(Y)=>{return q.objectKeys(Y).map(function(f){return Y[f]})},q.objectKeys=typeof Object.keys==="function"?(Y)=>Object.keys(Y):(Y)=>{let f=[];for(let P in Y)if(Object.prototype.hasOwnProperty.call(Y,P))f.push(P);return f},q.find=(Y,f)=>{for(let P of Y)if(f(P))return P;return},q.isInteger=typeof Number.isInteger==="function"?(Y)=>Number.isInteger(Y):(Y)=>typeof Y==="number"&&Number.isFinite(Y)&&Math.floor(Y)===Y;function K(Y,f=" | "){return Y.map((P)=>typeof P==="string"?`'${P}'`:P).join(f)}q.joinValues=K,q.jsonStringifyReplacer=(Y,f)=>{if(typeof f==="bigint")return f.toString();return f}})(u8||(u8={}));(function(q){q.mergeShapes=(_,j)=>{return{..._,...j}}})(s4||(s4={}));Q=u8.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),e=u8.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"]);d6=class d6 extends Error{get errors(){return this.issues}constructor(q){super();this.issues=[],this.addIssue=(j)=>{this.issues=[...this.issues,j]},this.addIssues=(j=[])=>{this.issues=[...this.issues,...j]};let _=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,_);else this.__proto__=_;this.name="ZodError",this.issues=q}format(q){let _=q||function(Y){return Y.message},j={_errors:[]},K=(Y)=>{for(let f of Y.issues)if(f.code==="invalid_union")f.unionErrors.map(K);else if(f.code==="invalid_return_type")K(f.returnTypeError);else if(f.code==="invalid_arguments")K(f.argumentsError);else if(f.path.length===0)j._errors.push(_(f));else{let P=j,$=0;while($<f.path.length){let O=f.path[$];if($!==f.path.length-1)P[O]=P[O]||{_errors:[]};else P[O]=P[O]||{_errors:[]},P[O]._errors.push(_(f));P=P[O],$++}}};return K(this),j}static assert(q){if(!(q instanceof d6))throw new Error(`Not a ZodError: ${q}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,u8.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(q=(_)=>_.message){let _={},j=[];for(let K of this.issues)if(K.path.length>0){let Y=K.path[0];_[Y]=_[Y]||[],_[Y].push(q(K))}else j.push(q(K));return{formErrors:j,fieldErrors:_}}get formErrors(){return this.flatten()}};d6.create=(q)=>{return new d6(q)};e_=BT,Q1=e_;eT=[];O8=Object.freeze({status:"aborted"});(function(q){q.errToObj=(_)=>typeof _==="string"?{message:_}:_||{},q.toString=(_)=>typeof _==="string"?_:_?.message})(j8||(j8={}));FT=/^c[^\s-]{8,}$/i,UT=/^[0-9a-z]+$/,sT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,QT=/^[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,qZ=/^[a-z0-9_-]{21}$/i,_Z=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,KZ=/^[-+]?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)?)??$/,jZ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,YZ=/^(?:(?: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])$/,fZ=/^(?:(?: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])$/,$Z=/^(([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]))$/,wZ=/^(([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])$/,OZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vZ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zZ=new RegExp(`^${qP}$`);fq=class fq extends k8{_parse(q){if(this._def.coerce)q.data=String(q.data);if(this._getType(q)!==Q.string){let Y=this._getOrReturnCtx(q);return F(Y,{code:e.invalid_type,expected:Q.string,received:Y.parsedType}),O8}let j=new Z6,K=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(q.data.length<Y.value)K=this._getOrReturnCtx(q,K),F(K,{code:e.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),j.dirty()}else if(Y.kind==="max"){if(q.data.length>Y.value)K=this._getOrReturnCtx(q,K),F(K,{code:e.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),j.dirty()}else if(Y.kind==="length"){let f=q.data.length>Y.value,P=q.data.length<Y.value;if(f||P){if(K=this._getOrReturnCtx(q,K),f)F(K,{code:e.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});else if(P)F(K,{code:e.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});j.dirty()}}else if(Y.kind==="email"){if(!jZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"email",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="emoji"){if(!F4)F4=new RegExp(PZ,"u");if(!F4.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"emoji",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="uuid"){if(!QT.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"uuid",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="nanoid"){if(!qZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"nanoid",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="cuid"){if(!FT.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"cuid",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="cuid2"){if(!UT.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"cuid2",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="ulid"){if(!sT.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"ulid",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="url")try{new URL(q.data)}catch{K=this._getOrReturnCtx(q,K),F(K,{validation:"url",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="regex"){if(Y.regex.lastIndex=0,!Y.regex.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"regex",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="trim")q.data=q.data.trim();else if(Y.kind==="includes"){if(!q.data.includes(Y.value,Y.position))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:{includes:Y.value,position:Y.position},message:Y.message}),j.dirty()}else if(Y.kind==="toLowerCase")q.data=q.data.toLowerCase();else if(Y.kind==="toUpperCase")q.data=q.data.toUpperCase();else if(Y.kind==="startsWith"){if(!q.data.startsWith(Y.value))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:{startsWith:Y.value},message:Y.message}),j.dirty()}else if(Y.kind==="endsWith"){if(!q.data.endsWith(Y.value))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:{endsWith:Y.value},message:Y.message}),j.dirty()}else if(Y.kind==="datetime"){if(!KP(Y).test(q.data))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:"datetime",message:Y.message}),j.dirty()}else if(Y.kind==="date"){if(!zZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:"date",message:Y.message}),j.dirty()}else if(Y.kind==="time"){if(!WZ(Y).test(q.data))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:"time",message:Y.message}),j.dirty()}else if(Y.kind==="duration"){if(!KZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"duration",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="ip"){if(!JZ(q.data,Y.version))K=this._getOrReturnCtx(q,K),F(K,{validation:"ip",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="jwt"){if(!HZ(q.data,Y.alg))K=this._getOrReturnCtx(q,K),F(K,{validation:"jwt",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="cidr"){if(!TZ(q.data,Y.version))K=this._getOrReturnCtx(q,K),F(K,{validation:"cidr",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="base64"){if(!OZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"base64",code:e.invalid_string,message:Y.message}),j.dirty()}else if(Y.kind==="base64url"){if(!vZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"base64url",code:e.invalid_string,message:Y.message}),j.dirty()}else u8.assertNever(Y);return{status:j.value,value:q.data}}_regex(q,_,j){return this.refinement((K)=>q.test(K),{validation:_,code:e.invalid_string,...j8.errToObj(j)})}_addCheck(q){return new fq({...this._def,checks:[...this._def.checks,q]})}email(q){return this._addCheck({kind:"email",...j8.errToObj(q)})}url(q){return this._addCheck({kind:"url",...j8.errToObj(q)})}emoji(q){return this._addCheck({kind:"emoji",...j8.errToObj(q)})}uuid(q){return this._addCheck({kind:"uuid",...j8.errToObj(q)})}nanoid(q){return this._addCheck({kind:"nanoid",...j8.errToObj(q)})}cuid(q){return this._addCheck({kind:"cuid",...j8.errToObj(q)})}cuid2(q){return this._addCheck({kind:"cuid2",...j8.errToObj(q)})}ulid(q){return this._addCheck({kind:"ulid",...j8.errToObj(q)})}base64(q){return this._addCheck({kind:"base64",...j8.errToObj(q)})}base64url(q){return this._addCheck({kind:"base64url",...j8.errToObj(q)})}jwt(q){return this._addCheck({kind:"jwt",...j8.errToObj(q)})}ip(q){return this._addCheck({kind:"ip",...j8.errToObj(q)})}cidr(q){return this._addCheck({kind:"cidr",...j8.errToObj(q)})}datetime(q){if(typeof q==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:q});return this._addCheck({kind:"datetime",precision:typeof q?.precision==="undefined"?null:q?.precision,offset:q?.offset??!1,local:q?.local??!1,...j8.errToObj(q?.message)})}date(q){return this._addCheck({kind:"date",message:q})}time(q){if(typeof q==="string")return this._addCheck({kind:"time",precision:null,message:q});return this._addCheck({kind:"time",precision:typeof q?.precision==="undefined"?null:q?.precision,...j8.errToObj(q?.message)})}duration(q){return this._addCheck({kind:"duration",...j8.errToObj(q)})}regex(q,_){return this._addCheck({kind:"regex",regex:q,...j8.errToObj(_)})}includes(q,_){return this._addCheck({kind:"includes",value:q,position:_?.position,...j8.errToObj(_?.message)})}startsWith(q,_){return this._addCheck({kind:"startsWith",value:q,...j8.errToObj(_)})}endsWith(q,_){return this._addCheck({kind:"endsWith",value:q,...j8.errToObj(_)})}min(q,_){return this._addCheck({kind:"min",value:q,...j8.errToObj(_)})}max(q,_){return this._addCheck({kind:"max",value:q,...j8.errToObj(_)})}length(q,_){return this._addCheck({kind:"length",value:q,...j8.errToObj(_)})}nonempty(q){return this.min(1,j8.errToObj(q))}trim(){return new fq({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fq({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fq({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((q)=>q.kind==="datetime")}get isDate(){return!!this._def.checks.find((q)=>q.kind==="date")}get isTime(){return!!this._def.checks.find((q)=>q.kind==="time")}get isDuration(){return!!this._def.checks.find((q)=>q.kind==="duration")}get isEmail(){return!!this._def.checks.find((q)=>q.kind==="email")}get isURL(){return!!this._def.checks.find((q)=>q.kind==="url")}get isEmoji(){return!!this._def.checks.find((q)=>q.kind==="emoji")}get isUUID(){return!!this._def.checks.find((q)=>q.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((q)=>q.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((q)=>q.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((q)=>q.kind==="cuid2")}get isULID(){return!!this._def.checks.find((q)=>q.kind==="ulid")}get isIP(){return!!this._def.checks.find((q)=>q.kind==="ip")}get isCIDR(){return!!this._def.checks.find((q)=>q.kind==="cidr")}get isBase64(){return!!this._def.checks.find((q)=>q.kind==="base64")}get isBase64url(){return!!this._def.checks.find((q)=>q.kind==="base64url")}get minLength(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxLength(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q}};fq.create=(q)=>{return new fq({checks:[],typeName:z8.ZodString,coerce:q?.coerce??!1,...Z8(q)})};Bq=class Bq extends k8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(q){if(this._def.coerce)q.data=Number(q.data);if(this._getType(q)!==Q.number){let Y=this._getOrReturnCtx(q);return F(Y,{code:e.invalid_type,expected:Q.number,received:Y.parsedType}),O8}let j=void 0,K=new Z6;for(let Y of this._def.checks)if(Y.kind==="int"){if(!u8.isInteger(q.data))j=this._getOrReturnCtx(q,j),F(j,{code:e.invalid_type,expected:"integer",received:"float",message:Y.message}),K.dirty()}else if(Y.kind==="min"){if(Y.inclusive?q.data<Y.value:q.data<=Y.value)j=this._getOrReturnCtx(q,j),F(j,{code:e.too_small,minimum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),K.dirty()}else if(Y.kind==="max"){if(Y.inclusive?q.data>Y.value:q.data>=Y.value)j=this._getOrReturnCtx(q,j),F(j,{code:e.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),K.dirty()}else if(Y.kind==="multipleOf"){if(ZZ(q.data,Y.value)!==0)j=this._getOrReturnCtx(q,j),F(j,{code:e.not_multiple_of,multipleOf:Y.value,message:Y.message}),K.dirty()}else if(Y.kind==="finite"){if(!Number.isFinite(q.data))j=this._getOrReturnCtx(q,j),F(j,{code:e.not_finite,message:Y.message}),K.dirty()}else u8.assertNever(Y);return{status:K.value,value:q.data}}gte(q,_){return this.setLimit("min",q,!0,j8.toString(_))}gt(q,_){return this.setLimit("min",q,!1,j8.toString(_))}lte(q,_){return this.setLimit("max",q,!0,j8.toString(_))}lt(q,_){return this.setLimit("max",q,!1,j8.toString(_))}setLimit(q,_,j,K){return new Bq({...this._def,checks:[...this._def.checks,{kind:q,value:_,inclusive:j,message:j8.toString(K)}]})}_addCheck(q){return new Bq({...this._def,checks:[...this._def.checks,q]})}int(q){return this._addCheck({kind:"int",message:j8.toString(q)})}positive(q){return this._addCheck({kind:"min",value:0,inclusive:!1,message:j8.toString(q)})}negative(q){return this._addCheck({kind:"max",value:0,inclusive:!1,message:j8.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:0,inclusive:!0,message:j8.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:0,inclusive:!0,message:j8.toString(q)})}multipleOf(q,_){return this._addCheck({kind:"multipleOf",value:q,message:j8.toString(_)})}finite(q){return this._addCheck({kind:"finite",message:j8.toString(q)})}safe(q){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:j8.toString(q)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:j8.toString(q)})}get minValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q}get isInt(){return!!this._def.checks.find((q)=>q.kind==="int"||q.kind==="multipleOf"&&u8.isInteger(q.value))}get isFinite(){let q=null,_=null;for(let j of this._def.checks)if(j.kind==="finite"||j.kind==="int"||j.kind==="multipleOf")return!0;else if(j.kind==="min"){if(_===null||j.value>_)_=j.value}else if(j.kind==="max"){if(q===null||j.value<q)q=j.value}return Number.isFinite(_)&&Number.isFinite(q)}};Bq.create=(q)=>{return new Bq({checks:[],typeName:z8.ZodNumber,coerce:q?.coerce||!1,...Z8(q)})};tq=class tq extends k8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(q){if(this._def.coerce)try{q.data=BigInt(q.data)}catch{return this._getInvalidInput(q)}if(this._getType(q)!==Q.bigint)return this._getInvalidInput(q);let j=void 0,K=new Z6;for(let Y of this._def.checks)if(Y.kind==="min"){if(Y.inclusive?q.data<Y.value:q.data<=Y.value)j=this._getOrReturnCtx(q,j),F(j,{code:e.too_small,type:"bigint",minimum:Y.value,inclusive:Y.inclusive,message:Y.message}),K.dirty()}else if(Y.kind==="max"){if(Y.inclusive?q.data>Y.value:q.data>=Y.value)j=this._getOrReturnCtx(q,j),F(j,{code:e.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),K.dirty()}else if(Y.kind==="multipleOf"){if(q.data%Y.value!==BigInt(0))j=this._getOrReturnCtx(q,j),F(j,{code:e.not_multiple_of,multipleOf:Y.value,message:Y.message}),K.dirty()}else u8.assertNever(Y);return{status:K.value,value:q.data}}_getInvalidInput(q){let _=this._getOrReturnCtx(q);return F(_,{code:e.invalid_type,expected:Q.bigint,received:_.parsedType}),O8}gte(q,_){return this.setLimit("min",q,!0,j8.toString(_))}gt(q,_){return this.setLimit("min",q,!1,j8.toString(_))}lte(q,_){return this.setLimit("max",q,!0,j8.toString(_))}lt(q,_){return this.setLimit("max",q,!1,j8.toString(_))}setLimit(q,_,j,K){return new tq({...this._def,checks:[...this._def.checks,{kind:q,value:_,inclusive:j,message:j8.toString(K)}]})}_addCheck(q){return new tq({...this._def,checks:[...this._def.checks,q]})}positive(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:j8.toString(q)})}negative(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:j8.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:j8.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:j8.toString(q)})}multipleOf(q,_){return this._addCheck({kind:"multipleOf",value:q,message:j8.toString(_)})}get minValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q}};tq.create=(q)=>{return new tq({checks:[],typeName:z8.ZodBigInt,coerce:q?.coerce??!1,...Z8(q)})};F_=class F_ extends k8{_parse(q){if(this._def.coerce)q.data=Boolean(q.data);if(this._getType(q)!==Q.boolean){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.boolean,received:j.parsedType}),O8}return C6(q.data)}};F_.create=(q)=>{return new F_({typeName:z8.ZodBoolean,coerce:q?.coerce||!1,...Z8(q)})};W_=class W_ extends k8{_parse(q){if(this._def.coerce)q.data=new Date(q.data);if(this._getType(q)!==Q.date){let Y=this._getOrReturnCtx(q);return F(Y,{code:e.invalid_type,expected:Q.date,received:Y.parsedType}),O8}if(Number.isNaN(q.data.getTime())){let Y=this._getOrReturnCtx(q);return F(Y,{code:e.invalid_date}),O8}let j=new Z6,K=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(q.data.getTime()<Y.value)K=this._getOrReturnCtx(q,K),F(K,{code:e.too_small,message:Y.message,inclusive:!0,exact:!1,minimum:Y.value,type:"date"}),j.dirty()}else if(Y.kind==="max"){if(q.data.getTime()>Y.value)K=this._getOrReturnCtx(q,K),F(K,{code:e.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),j.dirty()}else u8.assertNever(Y);return{status:j.value,value:new Date(q.data.getTime())}}_addCheck(q){return new W_({...this._def,checks:[...this._def.checks,q]})}min(q,_){return this._addCheck({kind:"min",value:q.getTime(),message:j8.toString(_)})}max(q,_){return this._addCheck({kind:"max",value:q.getTime(),message:j8.toString(_)})}get minDate(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q!=null?new Date(q):null}get maxDate(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q!=null?new Date(q):null}};W_.create=(q)=>{return new W_({checks:[],coerce:q?.coerce||!1,typeName:z8.ZodDate,...Z8(q)})};cK=class cK extends k8{_parse(q){if(this._getType(q)!==Q.symbol){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.symbol,received:j.parsedType}),O8}return C6(q.data)}};cK.create=(q)=>{return new cK({typeName:z8.ZodSymbol,...Z8(q)})};U_=class U_ extends k8{_parse(q){if(this._getType(q)!==Q.undefined){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.undefined,received:j.parsedType}),O8}return C6(q.data)}};U_.create=(q)=>{return new U_({typeName:z8.ZodUndefined,...Z8(q)})};s_=class s_ extends k8{_parse(q){if(this._getType(q)!==Q.null){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.null,received:j.parsedType}),O8}return C6(q.data)}};s_.create=(q)=>{return new s_({typeName:z8.ZodNull,...Z8(q)})};J_=class J_ extends k8{constructor(){super(...arguments);this._any=!0}_parse(q){return C6(q.data)}};J_.create=(q)=>{return new J_({typeName:z8.ZodAny,...Z8(q)})};aq=class aq extends k8{constructor(){super(...arguments);this._unknown=!0}_parse(q){return C6(q.data)}};aq.create=(q)=>{return new aq({typeName:z8.ZodUnknown,...Z8(q)})};uq=class uq extends k8{_parse(q){let _=this._getOrReturnCtx(q);return F(_,{code:e.invalid_type,expected:Q.never,received:_.parsedType}),O8}};uq.create=(q)=>{return new uq({typeName:z8.ZodNever,...Z8(q)})};rK=class rK extends k8{_parse(q){if(this._getType(q)!==Q.undefined){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.void,received:j.parsedType}),O8}return C6(q.data)}};rK.create=(q)=>{return new rK({typeName:z8.ZodVoid,...Z8(q)})};$q=class $q extends k8{_parse(q){let{ctx:_,status:j}=this._processInputParams(q),K=this._def;if(_.parsedType!==Q.array)return F(_,{code:e.invalid_type,expected:Q.array,received:_.parsedType}),O8;if(K.exactLength!==null){let f=_.data.length>K.exactLength.value,P=_.data.length<K.exactLength.value;if(f||P)F(_,{code:f?e.too_big:e.too_small,minimum:P?K.exactLength.value:void 0,maximum:f?K.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:K.exactLength.message}),j.dirty()}if(K.minLength!==null){if(_.data.length<K.minLength.value)F(_,{code:e.too_small,minimum:K.minLength.value,type:"array",inclusive:!0,exact:!1,message:K.minLength.message}),j.dirty()}if(K.maxLength!==null){if(_.data.length>K.maxLength.value)F(_,{code:e.too_big,maximum:K.maxLength.value,type:"array",inclusive:!0,exact:!1,message:K.maxLength.message}),j.dirty()}if(_.common.async)return Promise.all([..._.data].map((f,P)=>{return K.type._parseAsync(new Oq(_,f,_.path,P))})).then((f)=>{return Z6.mergeArray(j,f)});let Y=[..._.data].map((f,P)=>{return K.type._parseSync(new Oq(_,f,_.path,P))});return Z6.mergeArray(j,Y)}get element(){return this._def.type}min(q,_){return new $q({...this._def,minLength:{value:q,message:j8.toString(_)}})}max(q,_){return new $q({...this._def,maxLength:{value:q,message:j8.toString(_)}})}length(q,_){return new $q({...this._def,exactLength:{value:q,message:j8.toString(_)}})}nonempty(q){return this.min(1,q)}};$q.create=(q,_)=>{return new $q({type:q,minLength:null,maxLength:null,exactLength:null,typeName:z8.ZodArray,...Z8(_)})};r8=class r8 extends k8{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let q=this._def.shape(),_=u8.objectKeys(q);return this._cached={shape:q,keys:_},this._cached}_parse(q){if(this._getType(q)!==Q.object){let O=this._getOrReturnCtx(q);return F(O,{code:e.invalid_type,expected:Q.object,received:O.parsedType}),O8}let{status:j,ctx:K}=this._processInputParams(q),{shape:Y,keys:f}=this._getCached(),P=[];if(!(this._def.catchall instanceof uq&&this._def.unknownKeys==="strip")){for(let O in K.data)if(!f.includes(O))P.push(O)}let $=[];for(let O of f){let w=Y[O],v=K.data[O];$.push({key:{status:"valid",value:O},value:w._parse(new Oq(K,v,K.path,O)),alwaysSet:O in K.data})}if(this._def.catchall instanceof uq){let O=this._def.unknownKeys;if(O==="passthrough")for(let w of P)$.push({key:{status:"valid",value:w},value:{status:"valid",value:K.data[w]}});else if(O==="strict"){if(P.length>0)F(K,{code:e.unrecognized_keys,keys:P}),j.dirty()}else if(O==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let O=this._def.catchall;for(let w of P){let v=K.data[w];$.push({key:{status:"valid",value:w},value:O._parse(new Oq(K,v,K.path,w)),alwaysSet:w in K.data})}}if(K.common.async)return Promise.resolve().then(async()=>{let O=[];for(let w of $){let v=await w.key,z=await w.value;O.push({key:v,value:z,alwaysSet:w.alwaysSet})}return O}).then((O)=>{return Z6.mergeObjectSync(j,O)});else return Z6.mergeObjectSync(j,$)}get shape(){return this._def.shape()}strict(q){return j8.errToObj,new r8({...this._def,unknownKeys:"strict",...q!==void 0?{errorMap:(_,j)=>{let K=this._def.errorMap?.(_,j).message??j.defaultError;if(_.code==="unrecognized_keys")return{message:j8.errToObj(q).message??K};return{message:K}}}:{}})}strip(){return new r8({...this._def,unknownKeys:"strip"})}passthrough(){return new r8({...this._def,unknownKeys:"passthrough"})}extend(q){return new r8({...this._def,shape:()=>({...this._def.shape(),...q})})}merge(q){return new r8({unknownKeys:q._def.unknownKeys,catchall:q._def.catchall,shape:()=>({...this._def.shape(),...q._def.shape()}),typeName:z8.ZodObject})}setKey(q,_){return this.augment({[q]:_})}catchall(q){return new r8({...this._def,catchall:q})}pick(q){let _={};for(let j of u8.objectKeys(q))if(q[j]&&this.shape[j])_[j]=this.shape[j];return new r8({...this._def,shape:()=>_})}omit(q){let _={};for(let j of u8.objectKeys(this.shape))if(!q[j])_[j]=this.shape[j];return new r8({...this._def,shape:()=>_})}deepPartial(){return o_(this)}partial(q){let _={};for(let j of u8.objectKeys(this.shape)){let K=this.shape[j];if(q&&!q[j])_[j]=K;else _[j]=K.optional()}return new r8({...this._def,shape:()=>_})}required(q){let _={};for(let j of u8.objectKeys(this.shape))if(q&&!q[j])_[j]=this.shape[j];else{let Y=this.shape[j];while(Y instanceof wq)Y=Y._def.innerType;_[j]=Y}return new r8({...this._def,shape:()=>_})}keyof(){return jP(u8.objectKeys(this.shape))}};r8.create=(q,_)=>{return new r8({shape:()=>q,unknownKeys:"strip",catchall:uq.create(),typeName:z8.ZodObject,...Z8(_)})};r8.strictCreate=(q,_)=>{return new r8({shape:()=>q,unknownKeys:"strict",catchall:uq.create(),typeName:z8.ZodObject,...Z8(_)})};r8.lazycreate=(q,_)=>{return new r8({shape:q,unknownKeys:"strip",catchall:uq.create(),typeName:z8.ZodObject,...Z8(_)})};Q_=class Q_ extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=this._def.options;function K(Y){for(let P of Y)if(P.result.status==="valid")return P.result;for(let P of Y)if(P.result.status==="dirty")return _.common.issues.push(...P.ctx.common.issues),P.result;let f=Y.map((P)=>new d6(P.ctx.common.issues));return F(_,{code:e.invalid_union,unionErrors:f}),O8}if(_.common.async)return Promise.all(j.map(async(Y)=>{let f={..._,common:{..._.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:_.data,path:_.path,parent:f}),ctx:f}})).then(K);else{let Y=void 0,f=[];for(let $ of j){let O={..._,common:{..._.common,issues:[]},parent:null},w=$._parseSync({data:_.data,path:_.path,parent:O});if(w.status==="valid")return w;else if(w.status==="dirty"&&!Y)Y={result:w,ctx:O};if(O.common.issues.length)f.push(O.common.issues)}if(Y)return _.common.issues.push(...Y.ctx.common.issues),Y.result;let P=f.map(($)=>new d6($));return F(_,{code:e.invalid_union,unionErrors:P}),O8}}get options(){return this._def.options}};Q_.create=(q,_)=>{return new Q_({options:q,typeName:z8.ZodUnion,...Z8(_)})};e3=class e3 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==Q.object)return F(_,{code:e.invalid_type,expected:Q.object,received:_.parsedType}),O8;let j=this.discriminator,K=_.data[j],Y=this.optionsMap.get(K);if(!Y)return F(_,{code:e.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[j]}),O8;if(_.common.async)return Y._parseAsync({data:_.data,path:_.path,parent:_});else return Y._parseSync({data:_.data,path:_.path,parent:_})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(q,_,j){let K=new Map;for(let Y of _){let f=yq(Y.shape[q]);if(!f.length)throw new Error(`A discriminator value for key \`${q}\` could not be extracted from all schema options`);for(let P of f){if(K.has(P))throw new Error(`Discriminator property ${String(q)} has duplicate value ${String(P)}`);K.set(P,Y)}}return new e3({typeName:z8.ZodDiscriminatedUnion,discriminator:q,options:_,optionsMap:K,...Z8(j)})}};qK=class qK extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q),K=(Y,f)=>{if(Q4(Y)||Q4(f))return O8;let P=_2(Y.value,f.value);if(!P.valid)return F(j,{code:e.invalid_intersection_types}),O8;if(q2(Y)||q2(f))_.dirty();return{status:_.value,value:P.data}};if(j.common.async)return Promise.all([this._def.left._parseAsync({data:j.data,path:j.path,parent:j}),this._def.right._parseAsync({data:j.data,path:j.path,parent:j})]).then(([Y,f])=>K(Y,f));else return K(this._def.left._parseSync({data:j.data,path:j.path,parent:j}),this._def.right._parseSync({data:j.data,path:j.path,parent:j}))}};qK.create=(q,_,j)=>{return new qK({left:q,right:_,typeName:z8.ZodIntersection,...Z8(j)})};hq=class hq extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.array)return F(j,{code:e.invalid_type,expected:Q.array,received:j.parsedType}),O8;if(j.data.length<this._def.items.length)return F(j,{code:e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),O8;if(!this._def.rest&&j.data.length>this._def.items.length)F(j,{code:e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_.dirty();let Y=[...j.data].map((f,P)=>{let $=this._def.items[P]||this._def.rest;if(!$)return null;return $._parse(new Oq(j,f,j.path,P))}).filter((f)=>!!f);if(j.common.async)return Promise.all(Y).then((f)=>{return Z6.mergeArray(_,f)});else return Z6.mergeArray(_,Y)}get items(){return this._def.items}rest(q){return new hq({...this._def,rest:q})}};hq.create=(q,_)=>{if(!Array.isArray(q))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new hq({items:q,typeName:z8.ZodTuple,rest:null,...Z8(_)})};iK=class iK extends k8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.object)return F(j,{code:e.invalid_type,expected:Q.object,received:j.parsedType}),O8;let K=[],Y=this._def.keyType,f=this._def.valueType;for(let P in j.data)K.push({key:Y._parse(new Oq(j,P,j.path,P)),value:f._parse(new Oq(j,j.data[P],j.path,P)),alwaysSet:P in j.data});if(j.common.async)return Z6.mergeObjectAsync(_,K);else return Z6.mergeObjectSync(_,K)}get element(){return this._def.valueType}static create(q,_,j){if(_ instanceof k8)return new iK({keyType:q,valueType:_,typeName:z8.ZodRecord,...Z8(j)});return new iK({keyType:fq.create(),valueType:q,typeName:z8.ZodRecord,...Z8(_)})}};oK=class oK extends k8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.map)return F(j,{code:e.invalid_type,expected:Q.map,received:j.parsedType}),O8;let K=this._def.keyType,Y=this._def.valueType,f=[...j.data.entries()].map(([P,$],O)=>{return{key:K._parse(new Oq(j,P,j.path,[O,"key"])),value:Y._parse(new Oq(j,$,j.path,[O,"value"]))}});if(j.common.async){let P=new Map;return Promise.resolve().then(async()=>{for(let $ of f){let O=await $.key,w=await $.value;if(O.status==="aborted"||w.status==="aborted")return O8;if(O.status==="dirty"||w.status==="dirty")_.dirty();P.set(O.value,w.value)}return{status:_.value,value:P}})}else{let P=new Map;for(let $ of f){let{key:O,value:w}=$;if(O.status==="aborted"||w.status==="aborted")return O8;if(O.status==="dirty"||w.status==="dirty")_.dirty();P.set(O.value,w.value)}return{status:_.value,value:P}}}};oK.create=(q,_,j)=>{return new oK({valueType:_,keyType:q,typeName:z8.ZodMap,...Z8(j)})};H_=class H_ extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.set)return F(j,{code:e.invalid_type,expected:Q.set,received:j.parsedType}),O8;let K=this._def;if(K.minSize!==null){if(j.data.size<K.minSize.value)F(j,{code:e.too_small,minimum:K.minSize.value,type:"set",inclusive:!0,exact:!1,message:K.minSize.message}),_.dirty()}if(K.maxSize!==null){if(j.data.size>K.maxSize.value)F(j,{code:e.too_big,maximum:K.maxSize.value,type:"set",inclusive:!0,exact:!1,message:K.maxSize.message}),_.dirty()}let Y=this._def.valueType;function f($){let O=new Set;for(let w of $){if(w.status==="aborted")return O8;if(w.status==="dirty")_.dirty();O.add(w.value)}return{status:_.value,value:O}}let P=[...j.data.values()].map(($,O)=>Y._parse(new Oq(j,$,j.path,O)));if(j.common.async)return Promise.all(P).then(($)=>f($));else return f(P)}min(q,_){return new H_({...this._def,minSize:{value:q,message:j8.toString(_)}})}max(q,_){return new H_({...this._def,maxSize:{value:q,message:j8.toString(_)}})}size(q,_){return this.min(q,_).max(q,_)}nonempty(q){return this.min(1,q)}};H_.create=(q,_)=>{return new H_({valueType:q,minSize:null,maxSize:null,typeName:z8.ZodSet,...Z8(_)})};t_=class t_ extends k8{constructor(){super(...arguments);this.validate=this.implement}_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==Q.function)return F(_,{code:e.invalid_type,expected:Q.function,received:_.parsedType}),O8;function j(P,$){return t3({data:P,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,B3(),e_].filter((O)=>!!O),issueData:{code:e.invalid_arguments,argumentsError:$}})}function K(P,$){return t3({data:P,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,B3(),e_].filter((O)=>!!O),issueData:{code:e.invalid_return_type,returnTypeError:$}})}let Y={errorMap:_.common.contextualErrorMap},f=_.data;if(this._def.returns instanceof T_){let P=this;return C6(async function(...$){let O=new d6([]),w=await P._def.args.parseAsync($,Y).catch((W)=>{throw O.addIssue(j($,W)),O}),v=await Reflect.apply(f,this,w);return await P._def.returns._def.type.parseAsync(v,Y).catch((W)=>{throw O.addIssue(K(v,W)),O})})}else{let P=this;return C6(function(...$){let O=P._def.args.safeParse($,Y);if(!O.success)throw new d6([j($,O.error)]);let w=Reflect.apply(f,this,O.data),v=P._def.returns.safeParse(w,Y);if(!v.success)throw new d6([K(w,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...q){return new t_({...this._def,args:hq.create(q).rest(aq.create())})}returns(q){return new t_({...this._def,returns:q})}implement(q){return this.parse(q)}strictImplement(q){return this.parse(q)}static create(q,_,j){return new t_({args:q?q:hq.create([]).rest(aq.create()),returns:_||aq.create(),typeName:z8.ZodFunction,...Z8(j)})}};_K=class _K extends k8{get schema(){return this._def.getter()}_parse(q){let{ctx:_}=this._processInputParams(q);return this._def.getter()._parse({data:_.data,path:_.path,parent:_})}};_K.create=(q,_)=>{return new _K({getter:q,typeName:z8.ZodLazy,...Z8(_)})};KK=class KK extends k8{_parse(q){if(q.data!==this._def.value){let _=this._getOrReturnCtx(q);return F(_,{received:_.data,code:e.invalid_literal,expected:this._def.value}),O8}return{status:"valid",value:q.data}}get value(){return this._def.value}};KK.create=(q,_)=>{return new KK({value:q,typeName:z8.ZodLiteral,...Z8(_)})};eq=class eq extends k8{_parse(q){if(typeof q.data!=="string"){let _=this._getOrReturnCtx(q),j=this._def.values;return F(_,{expected:u8.joinValues(j),received:_.parsedType,code:e.invalid_type}),O8}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(q.data)){let _=this._getOrReturnCtx(q),j=this._def.values;return F(_,{received:_.data,code:e.invalid_enum_value,options:j}),O8}return C6(q.data)}get options(){return this._def.values}get enum(){let q={};for(let _ of this._def.values)q[_]=_;return q}get Values(){let q={};for(let _ of this._def.values)q[_]=_;return q}get Enum(){let q={};for(let _ of this._def.values)q[_]=_;return q}extract(q,_=this._def){return eq.create(q,{...this._def,..._})}exclude(q,_=this._def){return eq.create(this.options.filter((j)=>!q.includes(j)),{...this._def,..._})}};eq.create=jP;jK=class jK extends k8{_parse(q){let _=u8.getValidEnumValues(this._def.values),j=this._getOrReturnCtx(q);if(j.parsedType!==Q.string&&j.parsedType!==Q.number){let K=u8.objectValues(_);return F(j,{expected:u8.joinValues(K),received:j.parsedType,code:e.invalid_type}),O8}if(!this._cache)this._cache=new Set(u8.getValidEnumValues(this._def.values));if(!this._cache.has(q.data)){let K=u8.objectValues(_);return F(j,{received:j.data,code:e.invalid_enum_value,options:K}),O8}return C6(q.data)}get enum(){return this._def.values}};jK.create=(q,_)=>{return new jK({values:q,typeName:z8.ZodNativeEnum,...Z8(_)})};T_=class T_ extends k8{unwrap(){return this._def.type}_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==Q.promise&&_.common.async===!1)return F(_,{code:e.invalid_type,expected:Q.promise,received:_.parsedType}),O8;let j=_.parsedType===Q.promise?_.data:Promise.resolve(_.data);return C6(j.then((K)=>{return this._def.type.parseAsync(K,{path:_.path,errorMap:_.common.contextualErrorMap})}))}};T_.create=(q,_)=>{return new T_({type:q,typeName:z8.ZodPromise,...Z8(_)})};F6=class F6 extends k8{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z8.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(q){let{status:_,ctx:j}=this._processInputParams(q),K=this._def.effect||null,Y={addIssue:(f)=>{if(F(j,f),f.fatal)_.abort();else _.dirty()},get path(){return j.path}};if(Y.addIssue=Y.addIssue.bind(Y),K.type==="preprocess"){let f=K.transform(j.data,Y);if(j.common.async)return Promise.resolve(f).then(async(P)=>{if(_.value==="aborted")return O8;let $=await this._def.schema._parseAsync({data:P,path:j.path,parent:j});if($.status==="aborted")return O8;if($.status==="dirty")return B_($.value);if(_.value==="dirty")return B_($.value);return $});else{if(_.value==="aborted")return O8;let P=this._def.schema._parseSync({data:f,path:j.path,parent:j});if(P.status==="aborted")return O8;if(P.status==="dirty")return B_(P.value);if(_.value==="dirty")return B_(P.value);return P}}if(K.type==="refinement"){let f=(P)=>{let $=K.refinement(P,Y);if(j.common.async)return Promise.resolve($);if($ instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return P};if(j.common.async===!1){let P=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(P.status==="aborted")return O8;if(P.status==="dirty")_.dirty();return f(P.value),{status:_.value,value:P.value}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then((P)=>{if(P.status==="aborted")return O8;if(P.status==="dirty")_.dirty();return f(P.value).then(()=>{return{status:_.value,value:P.value}})})}if(K.type==="transform")if(j.common.async===!1){let f=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(!z_(f))return O8;let P=K.transform(f.value,Y);if(P instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:_.value,value:P}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then((f)=>{if(!z_(f))return O8;return Promise.resolve(K.transform(f.value,Y)).then((P)=>({status:_.value,value:P}))});u8.assertNever(K)}};F6.create=(q,_,j)=>{return new F6({schema:q,typeName:z8.ZodEffects,effect:_,...Z8(j)})};F6.createWithPreprocess=(q,_,j)=>{return new F6({schema:_,effect:{type:"preprocess",transform:q},typeName:z8.ZodEffects,...Z8(j)})};wq=class wq extends k8{_parse(q){if(this._getType(q)===Q.undefined)return C6(void 0);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}};wq.create=(q,_)=>{return new wq({innerType:q,typeName:z8.ZodOptional,...Z8(_)})};pq=class pq extends k8{_parse(q){if(this._getType(q)===Q.null)return C6(null);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}};pq.create=(q,_)=>{return new pq({innerType:q,typeName:z8.ZodNullable,...Z8(_)})};PK=class PK extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;if(_.parsedType===Q.undefined)j=this._def.defaultValue();return this._def.innerType._parse({data:j,path:_.path,parent:_})}removeDefault(){return this._def.innerType}};PK.create=(q,_)=>{return new PK({innerType:q,typeName:z8.ZodDefault,defaultValue:typeof _.default==="function"?_.default:()=>_.default,...Z8(_)})};YK=class YK extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j={..._,common:{..._.common,issues:[]}},K=this._def.innerType._parse({data:j.data,path:j.path,parent:{...j}});if(nK(K))return K.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new d6(j.common.issues)},input:j.data})}});else return{status:"valid",value:K.status==="valid"?K.value:this._def.catchValue({get error(){return new d6(j.common.issues)},input:j.data})}}removeCatch(){return this._def.innerType}};YK.create=(q,_)=>{return new YK({innerType:q,typeName:z8.ZodCatch,catchValue:typeof _.catch==="function"?_.catch:()=>_.catch,...Z8(_)})};aK=class aK extends k8{_parse(q){if(this._getType(q)!==Q.nan){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.nan,received:j.parsedType}),O8}return{status:"valid",value:q.data}}};aK.create=(q)=>{return new aK({typeName:z8.ZodNaN,...Z8(q)})};kZ=Symbol("zod_brand");F3=class F3 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;return this._def.type._parse({data:j,path:_.path,parent:_})}unwrap(){return this._def.type}};BK=class BK extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.common.async)return(async()=>{let Y=await this._def.in._parseAsync({data:j.data,path:j.path,parent:j});if(Y.status==="aborted")return O8;if(Y.status==="dirty")return _.dirty(),B_(Y.value);else return this._def.out._parseAsync({data:Y.value,path:j.path,parent:j})})();else{let K=this._def.in._parseSync({data:j.data,path:j.path,parent:j});if(K.status==="aborted")return O8;if(K.status==="dirty")return _.dirty(),{status:"dirty",value:K.value};else return this._def.out._parseSync({data:K.value,path:j.path,parent:j})}}static create(q,_){return new BK({in:q,out:_,typeName:z8.ZodPipeline})}};fK=class fK extends k8{_parse(q){let _=this._def.innerType._parse(q),j=(K)=>{if(z_(K))K.value=Object.freeze(K.value);return K};return nK(_)?_.then((K)=>j(K)):j(_)}unwrap(){return this._def.innerType}};fK.create=(q,_)=>{return new fK({innerType:q,typeName:z8.ZodReadonly,...Z8(_)})};XZ={object:r8.lazycreate};(function(q){q.ZodString="ZodString",q.ZodNumber="ZodNumber",q.ZodNaN="ZodNaN",q.ZodBigInt="ZodBigInt",q.ZodBoolean="ZodBoolean",q.ZodDate="ZodDate",q.ZodSymbol="ZodSymbol",q.ZodUndefined="ZodUndefined",q.ZodNull="ZodNull",q.ZodAny="ZodAny",q.ZodUnknown="ZodUnknown",q.ZodNever="ZodNever",q.ZodVoid="ZodVoid",q.ZodArray="ZodArray",q.ZodObject="ZodObject",q.ZodUnion="ZodUnion",q.ZodDiscriminatedUnion="ZodDiscriminatedUnion",q.ZodIntersection="ZodIntersection",q.ZodTuple="ZodTuple",q.ZodRecord="ZodRecord",q.ZodMap="ZodMap",q.ZodSet="ZodSet",q.ZodFunction="ZodFunction",q.ZodLazy="ZodLazy",q.ZodLiteral="ZodLiteral",q.ZodEnum="ZodEnum",q.ZodEffects="ZodEffects",q.ZodNativeEnum="ZodNativeEnum",q.ZodOptional="ZodOptional",q.ZodNullable="ZodNullable",q.ZodDefault="ZodDefault",q.ZodCatch="ZodCatch",q.ZodPromise="ZodPromise",q.ZodBranded="ZodBranded",q.ZodPipeline="ZodPipeline",q.ZodReadonly="ZodReadonly"})(z8||(z8={}));YP=fq.create,fP=Bq.create,GZ=aK.create,uZ=tq.create,$P=F_.create,hZ=W_.create,DZ=cK.create,CZ=U_.create,VZ=s_.create,MZ=J_.create,NZ=aq.create,bZ=uq.create,SZ=rK.create,EZ=$q.create,RZ=r8.create,mZ=r8.strictCreate,IZ=Q_.create,gZ=e3.create,yZ=qK.create,dZ=hq.create,pZ=iK.create,LZ=oK.create,lZ=H_.create,xZ=t_.create,nZ=_K.create,cZ=KK.create,rZ=eq.create,iZ=jK.create,oZ=T_.create,c1=F6.create,aZ=wq.create,BZ=pq.create,tZ=F6.createWithPreprocess,eZ=BK.create,QZ={string:(q)=>fq.create({...q,coerce:!0}),number:(q)=>Bq.create({...q,coerce:!0}),boolean:(q)=>F_.create({...q,coerce:!0}),bigint:(q)=>tq.create({...q,coerce:!0}),date:(q)=>W_.create({...q,coerce:!0})},qk=O8,wP=k.union([k.string(),k.number().int()]),OP=k.string(),_k=k.object({progressToken:k.optional(wP)}).passthrough(),U6=k.object({_meta:k.optional(_k)}).passthrough(),R6=k.object({method:k.string(),params:k.optional(U6)}),tK=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),Dq=k.object({method:k.string(),params:k.optional(tK)}),s6=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),s3=k.union([k.string(),k.number().int()]),Kk=k.object({jsonrpc:k.literal(U3),id:s3}).merge(R6).strict(),jk=k.object({jsonrpc:k.literal(U3)}).merge(Dq).strict(),Pk=k.object({jsonrpc:k.literal(U3),id:s3,result:s6}).strict();(function(q){q[q.ConnectionClosed=-32000]="ConnectionClosed",q[q.RequestTimeout=-32001]="RequestTimeout",q[q.ParseError=-32700]="ParseError",q[q.InvalidRequest=-32600]="InvalidRequest",q[q.MethodNotFound=-32601]="MethodNotFound",q[q.InvalidParams=-32602]="InvalidParams",q[q.InternalError=-32603]="InternalError"})(r1||(r1={}));Yk=k.object({jsonrpc:k.literal(U3),id:s3,error:k.object({code:k.number().int(),message:k.string(),data:k.optional(k.unknown())})}).strict(),eC=k.union([Kk,jk,Pk,Yk]),vP=s6.strict(),zP=Dq.extend({method:k.literal("notifications/cancelled"),params:tK.extend({requestId:s3,reason:k.string().optional()})}),eK=k.object({name:k.string(),title:k.optional(k.string())}).passthrough(),WP=eK.extend({version:k.string()}),fk=k.object({experimental:k.optional(k.object({}).passthrough()),sampling:k.optional(k.object({}).passthrough()),elicitation:k.optional(k.object({}).passthrough()),roots:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),$k=R6.extend({method:k.literal("initialize"),params:U6.extend({protocolVersion:k.string(),capabilities:fk,clientInfo:WP})}),wk=k.object({experimental:k.optional(k.object({}).passthrough()),logging:k.optional(k.object({}).passthrough()),completions:k.optional(k.object({}).passthrough()),prompts:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough()),resources:k.optional(k.object({subscribe:k.optional(k.boolean()),listChanged:k.optional(k.boolean())}).passthrough()),tools:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),Ok=s6.extend({protocolVersion:k.string(),capabilities:wk,serverInfo:WP,instructions:k.optional(k.string())}),vk=Dq.extend({method:k.literal("notifications/initialized")}),JP=R6.extend({method:k.literal("ping")}),zk=k.object({progress:k.number(),total:k.optional(k.number()),message:k.optional(k.string())}).passthrough(),HP=Dq.extend({method:k.literal("notifications/progress"),params:tK.merge(zk).extend({progressToken:wP})}),Q3=R6.extend({params:U6.extend({cursor:k.optional(OP)}).optional()}),q7=s6.extend({nextCursor:k.optional(OP)}),TP=k.object({uri:k.string(),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),ZP=TP.extend({text:k.string()}),$2=k.string().refine((q)=>{try{return atob(q),!0}catch(_){return!1}},{message:"Invalid Base64 string"}),kP=TP.extend({blob:$2}),XP=eK.extend({uri:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),Wk=eK.extend({uriTemplate:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),Jk=Q3.extend({method:k.literal("resources/list")}),Hk=q7.extend({resources:k.array(XP)}),Tk=Q3.extend({method:k.literal("resources/templates/list")}),Zk=q7.extend({resourceTemplates:k.array(Wk)}),kk=R6.extend({method:k.literal("resources/read"),params:U6.extend({uri:k.string()})}),Xk=s6.extend({contents:k.array(k.union([ZP,kP]))}),Ak=Dq.extend({method:k.literal("notifications/resources/list_changed")}),Gk=R6.extend({method:k.literal("resources/subscribe"),params:U6.extend({uri:k.string()})}),uk=R6.extend({method:k.literal("resources/unsubscribe"),params:U6.extend({uri:k.string()})}),hk=Dq.extend({method:k.literal("notifications/resources/updated"),params:tK.extend({uri:k.string()})}),Dk=k.object({name:k.string(),description:k.optional(k.string()),required:k.optional(k.boolean())}).passthrough(),Ck=eK.extend({description:k.optional(k.string()),arguments:k.optional(k.array(Dk)),_meta:k.optional(k.object({}).passthrough())}),Vk=Q3.extend({method:k.literal("prompts/list")}),Mk=q7.extend({prompts:k.array(Ck)}),Nk=R6.extend({method:k.literal("prompts/get"),params:U6.extend({name:k.string(),arguments:k.optional(k.record(k.string()))})}),w2=k.object({type:k.literal("text"),text:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),O2=k.object({type:k.literal("image"),data:$2,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),v2=k.object({type:k.literal("audio"),data:$2,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),bk=k.object({type:k.literal("resource"),resource:k.union([ZP,kP]),_meta:k.optional(k.object({}).passthrough())}).passthrough(),Sk=XP.extend({type:k.literal("resource_link")}),AP=k.union([w2,O2,v2,Sk,bk]),Ek=k.object({role:k.enum(["user","assistant"]),content:AP}).passthrough(),Rk=s6.extend({description:k.optional(k.string()),messages:k.array(Ek)}),mk=Dq.extend({method:k.literal("notifications/prompts/list_changed")}),Ik=k.object({title:k.optional(k.string()),readOnlyHint:k.optional(k.boolean()),destructiveHint:k.optional(k.boolean()),idempotentHint:k.optional(k.boolean()),openWorldHint:k.optional(k.boolean())}).passthrough(),gk=eK.extend({description:k.optional(k.string()),inputSchema:k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough(),outputSchema:k.optional(k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough()),annotations:k.optional(Ik),_meta:k.optional(k.object({}).passthrough())}),yk=Q3.extend({method:k.literal("tools/list")}),dk=q7.extend({tools:k.array(gk)}),GP=s6.extend({content:k.array(AP).default([]),structuredContent:k.object({}).passthrough().optional(),isError:k.optional(k.boolean())}),FC=GP.or(s6.extend({toolResult:k.unknown()})),pk=R6.extend({method:k.literal("tools/call"),params:U6.extend({name:k.string(),arguments:k.optional(k.record(k.unknown()))})}),Lk=Dq.extend({method:k.literal("notifications/tools/list_changed")}),uP=k.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),lk=R6.extend({method:k.literal("logging/setLevel"),params:U6.extend({level:uP})}),xk=Dq.extend({method:k.literal("notifications/message"),params:tK.extend({level:uP,logger:k.optional(k.string()),data:k.unknown()})}),nk=k.object({name:k.string().optional()}).passthrough(),ck=k.object({hints:k.optional(k.array(nk)),costPriority:k.optional(k.number().min(0).max(1)),speedPriority:k.optional(k.number().min(0).max(1)),intelligencePriority:k.optional(k.number().min(0).max(1))}).passthrough(),rk=k.object({role:k.enum(["user","assistant"]),content:k.union([w2,O2,v2])}).passthrough(),ik=R6.extend({method:k.literal("sampling/createMessage"),params:U6.extend({messages:k.array(rk),systemPrompt:k.optional(k.string()),includeContext:k.optional(k.enum(["none","thisServer","allServers"])),temperature:k.optional(k.number()),maxTokens:k.number().int(),stopSequences:k.optional(k.array(k.string())),metadata:k.optional(k.object({}).passthrough()),modelPreferences:k.optional(ck)})}),ok=s6.extend({model:k.string(),stopReason:k.optional(k.enum(["endTurn","stopSequence","maxTokens"]).or(k.string())),role:k.enum(["user","assistant"]),content:k.discriminatedUnion("type",[w2,O2,v2])}),ak=k.object({type:k.literal("boolean"),title:k.optional(k.string()),description:k.optional(k.string()),default:k.optional(k.boolean())}).passthrough(),Bk=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),minLength:k.optional(k.number()),maxLength:k.optional(k.number()),format:k.optional(k.enum(["email","uri","date","date-time"]))}).passthrough(),tk=k.object({type:k.enum(["number","integer"]),title:k.optional(k.string()),description:k.optional(k.string()),minimum:k.optional(k.number()),maximum:k.optional(k.number())}).passthrough(),ek=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),enum:k.array(k.string()),enumNames:k.optional(k.array(k.string()))}).passthrough(),Fk=k.union([ak,Bk,tk,ek]),Uk=R6.extend({method:k.literal("elicitation/create"),params:U6.extend({message:k.string(),requestedSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),Fk),required:k.optional(k.array(k.string()))}).passthrough()})}),sk=s6.extend({action:k.enum(["accept","decline","cancel"]),content:k.optional(k.record(k.string(),k.unknown()))}),Qk=k.object({type:k.literal("ref/resource"),uri:k.string()}).passthrough(),qX=k.object({type:k.literal("ref/prompt"),name:k.string()}).passthrough(),_X=R6.extend({method:k.literal("completion/complete"),params:U6.extend({ref:k.union([qX,Qk]),argument:k.object({name:k.string(),value:k.string()}).passthrough(),context:k.optional(k.object({arguments:k.optional(k.record(k.string(),k.string()))}))})}),KX=s6.extend({completion:k.object({values:k.array(k.string()).max(100),total:k.optional(k.number().int()),hasMore:k.optional(k.boolean())}).passthrough()}),jX=k.object({uri:k.string().startsWith("file://"),name:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),PX=R6.extend({method:k.literal("roots/list")}),YX=s6.extend({roots:k.array(jX)}),fX=Dq.extend({method:k.literal("notifications/roots/list_changed")}),UC=k.union([JP,$k,_X,lk,Nk,Vk,Jk,Tk,kk,Gk,uk,pk,yk]),sC=k.union([zP,HP,vk,fX]),QC=k.union([vP,ok,sk,YX]),qV=k.union([JP,ik,Uk,PX]),_V=k.union([zP,HP,xk,hk,Ak,Lk,mk]),KV=k.union([vP,Ok,KX,Rk,Mk,Hk,Zk,Xk,GP,dk]),jV=_T(dT(),1),PV=Symbol("Let zodToJsonSchema decide on which parser to use"),YV=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");(function(q){q.Completable="McpCompletable"})(K2||(K2={}));j2=class j2 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;return this._def.type._parse({data:j,path:_.path,parent:_})}unwrap(){return this._def.type}};j2.create=(q,_)=>{return new j2({type:q,typeName:K2.Completable,complete:_.complete,...$X(_)})}});var DP={};rq(DP,{version:()=>vX,type:()=>WX,scripts:()=>HX,repository:()=>XX,publishConfig:()=>uX,name:()=>OX,main:()=>JX,license:()=>kX,keywords:()=>TX,homepage:()=>AX,files:()=>MX,engines:()=>CX,devDependencies:()=>DX,description:()=>zX,dependencies:()=>hX,default:()=>NX,bugs:()=>GX,bin:()=>VX,author:()=>ZX});var OX="claude-mem",vX="3.5.7",zX="Memory compression system for Claude Code - persist context across sessions",WX="module",JX="claude-mem",HX,TX,ZX="Alex Newman",kX="SEE LICENSE IN LICENSE",XX,AX="https://github.com/thedotmack/claude-mem#readme",GX,uX,hX,DX,CX,VX,MX,NX;var CP=Q8(()=>{HX={dev:"tsx src/bin/cli.ts","dev:install":"node dist/claude-mem.min.js install --force","dev:status":"node dist/claude-mem.min.js status","dev:compress":"node dist/claude-mem.min.js compress","dev:load":"node dist/claude-mem.min.js load-context","dev:uninstall":"node dist/claude-mem.min.js uninstall",build:"./scripts/build-minified.sh","test:watch":"npm test -- --watch",lint:"eslint 'src/**/*.ts' 'hooks/**/*.ts' 'test/**/*.ts'","lint:fix":"npm run lint -- --fix",format:"prettier --write 'src/**/*.ts' 'hooks/**/*.ts' 'test/**/*.ts'","build:npm":"./scripts/npm-publish.sh",publish:"./scripts/publish-all.sh","publish:latest":"npm version patch && ./scripts/publish-all.sh","publish:github":"./scripts/github-publish.sh"},TX=["claude","claude-code","mcp","memory","compression","knowledge-graph","transcript","cli","typescript","bun"],XX={type:"git",url:"https://github.com/thedotmack/claude-mem.git"},GX={url:"https://github.com/thedotmack/claude-mem/issues"},uX={access:"public",registry:"https://registry.npmjs.org/"},hX={"@anthropic-ai/claude-code":"^1.0.88","@clack/prompts":"^0.11.0","@modelcontextprotocol/sdk":"^0.5.0",boxen:"^8.0.1",chalk:"^5.6.0",chromadb:"^3.0.14",commander:"^14.0.0",cors:"^2.8.5",express:"^5.1.0",glob:"^11.0.3","gradient-string":"^3.0.0",handlebars:"^4.7.8",http:"^0.0.1-security","oh-my-logo":"^0.3.2",open:"^10.2.0"},DX={"@types/chai":"^4.3.0","@types/handlebars":"^4.0.40","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0",chai:"^4.3.0",eslint:"^8.0.0",prettier:"^3.0.0","ts-node":"^10.0.0",tsx:"^4.20.5",typescript:"^5.0.0"},CX={node:">=18.0.0",bun:">=1.0.0"},VX={"claude-mem":"dist/claude-mem.min.js"},MX=["dist","hooks","commands","docs"],NX={name:OX,version:vX,description:zX,type:WX,main:JX,scripts:HX,keywords:TX,author:ZX,license:kX,repository:XX,homepage:AX,bugs:GX,publishConfig:uX,dependencies:hX,devDependencies:DX,engines:CX,bin:VX,files:MX}});import{join as B8,dirname as _7,sep as bX}from"path";import{homedir as W2}from"os";import{existsSync as FK,statSync as SX}from"fs";import{execSync as EX}from"child_process";import{fileURLToPath as RX}from"url";class P8{static instance=null;_dataDirectory=null;_packageRoot=null;_claudeConfigDirectory=null;static getInstance(){if(!P8.instance)P8.instance=new P8;return P8.instance}getDataDirectory(){if(this._dataDirectory)return this._dataDirectory;return this._dataDirectory=process.env.CLAUDE_MEM_DATA_DIR||B8(W2(),".claude-mem"),this._dataDirectory}getArchivesDirectory(){return B8(this.getDataDirectory(),"archives")}getHooksDirectory(){return B8(this.getDataDirectory(),"hooks")}getLogsDirectory(){return B8(this.getDataDirectory(),"logs")}getIndexDirectory(){return this.getDataDirectory()}getIndexPath(){return B8(this.getIndexDirectory(),"claude-mem-index.jsonl")}getTrashDirectory(){return B8(this.getDataDirectory(),"trash")}getBackupsDirectory(){return B8(this.getDataDirectory(),"backups")}getChromaDirectory(){return B8(this.getDataDirectory(),"chroma")}getProjectArchiveDirectory(q){return B8(this.getArchivesDirectory(),q)}getUserSettingsPath(){return B8(this.getDataDirectory(),"settings.json")}getClaudeConfigDirectory(){if(this._claudeConfigDirectory)return this._claudeConfigDirectory;return this._claudeConfigDirectory=process.env.CLAUDE_CONFIG_DIR||B8(W2(),".claude"),this._claudeConfigDirectory}getClaudeSettingsPath(){return B8(this.getClaudeConfigDirectory(),"settings.json")}getClaudeCommandsDirectory(){return B8(this.getClaudeConfigDirectory(),"commands")}getClaudeMdPath(){return B8(this.getClaudeConfigDirectory(),"CLAUDE.md")}getMcpConfigPath(){return B8(W2(),".claude.json")}getProjectMcpConfigPath(){return B8(process.cwd(),".mcp.json")}getPackageRoot(){if(this._packageRoot)return this._packageRoot;try{let j=h6.resolve("/Users/alexnewman/Scripts/claude-mem-source/package.json");return this._packageRoot=_7(j),this._packageRoot}catch{}let q=RX(import.meta.url),_=_7(q);for(let j=0;j<10;j++){let K=B8(_,"package.json");if(FK(K))try{if(h6(K).name==="claude-mem")return this._packageRoot=_,this._packageRoot}catch{}let Y=_7(_);if(Y===_)break;_=Y}try{let j=EX("npm list -g claude-mem --json 2>/dev/null || npm list claude-mem --json 2>/dev/null",{encoding:"utf8"}),K=JSON.parse(j);if(K.dependencies?.["claude-mem"]?.resolved)return this._packageRoot=_7(K.dependencies["claude-mem"].resolved),this._packageRoot}catch{}throw new Error("Cannot locate claude-mem package root. Ensure claude-mem is properly installed.")}findPackageHooksDirectory(){let q=this.getPackageRoot(),_=B8(q,"hooks"),j=["pre-compact.js","session-start.js"];for(let K of j)if(!FK(B8(_,K)))throw new Error(`Package hooks directory missing required file: ${K}`);return _}findPackageCommandsDirectory(){let q=this.getPackageRoot(),_=B8(q,"commands"),j=["save.md"];for(let K of j)if(!FK(B8(_,K)))throw new Error(`Package commands directory missing required file: ${K}`);return _}ensureDirectory(q){if(!FK(q))h6("fs").mkdirSync(q,{recursive:!0})}ensureDirectories(q){q.forEach((_)=>this.ensureDirectory(_))}ensureAllDataDirectories(){this.ensureDirectories([this.getDataDirectory(),this.getArchivesDirectory(),this.getHooksDirectory(),this.getLogsDirectory(),this.getTrashDirectory(),this.getBackupsDirectory(),this.getChromaDirectory()])}ensureAllClaudeDirectories(){this.ensureDirectories([this.getClaudeConfigDirectory(),this.getClaudeCommandsDirectory()])}static extractProjectName(q){let _=q.split(bX),j=["src","lib","app","project","workspace"];for(let K=_.length-1;K>=0;K--)if(j.includes(_[K])&&K>0)return _[K-1];if(_.length>1)return _[_.length-2];return"unknown-project"}static getCurrentProjectName(){return h6("path").basename(process.cwd())}static createBackupFilename(q){let _=new Date().toISOString().replace(/[:.]/g,"-").replace("T","_").slice(0,19);return`${q}.backup.${_}`}static isPathAccessible(q){try{return FK(q)&&SX(q).isDirectory()}catch{return!1}}static getDataDirectory(){return P8.getInstance().getDataDirectory()}static getArchivesDirectory(){return P8.getInstance().getArchivesDirectory()}static getHooksDirectory(){return P8.getInstance().getHooksDirectory()}static getLogsDirectory(){return P8.getInstance().getLogsDirectory()}static getClaudeSettingsPath(){return P8.getInstance().getClaudeSettingsPath()}static getClaudeMdPath(){return P8.getInstance().getClaudeMdPath()}static findPackageHooksDirectory(){return P8.getInstance().findPackageHooksDirectory()}static findPackageCommandsDirectory(){return P8.getInstance().findPackageCommandsDirectory()}}var WV;var p6=Q8(()=>{WV=P8.getInstance()});class Lq{pathDiscovery;constructor(){this.pathDiscovery=P8.getInstance()}getConfigDir(){return this.pathDiscovery.getDataDirectory()}getIndexDir(){return this.pathDiscovery.getIndexDirectory()}getIndexPath(){return this.pathDiscovery.getIndexPath()}getArchiveDir(){return this.pathDiscovery.getArchivesDirectory()}getProjectArchiveDir(q){return this.pathDiscovery.getProjectArchiveDirectory(q)}getLogsDir(){return this.pathDiscovery.getLogsDirectory()}static ensureDirectory(q){P8.getInstance().ensureDirectory(q)}static ensureDirectories(q){P8.getInstance().ensureDirectories(q)}static extractProjectName(q){return P8.extractProjectName(q)}static getCurrentProjectPrefix(){return P8.getCurrentProjectName()}static getCurrentProjectName(){return P8.getCurrentProjectName()}}var J2=Q8(()=>{p6()});function gX(q,_,j,K){let Y={projectPrefix:q,sessionId:_,timestamp:j||new Date().toISOString(),archiveFilename:K||`${_}.jsonl.archive`};return IX(Y)}function MP(q,_,j,K){let Y=gX(j,_,K),f=`
114
+ `))}this.transport.endInput()}catch(_){if(!(_ instanceof F_))throw _}}handleHookCallbacks(q,_,j,K){let f=this.hookCallbacks.get(q);if(!f)throw new Error(`No hook callback found for ID: ${q}`);return f(_,j,{signal:K})}sendMcpServerMessageToCli(q,_){if("id"in _&&_.id!==null&&_.id!==void 0){let j=`${q}:${_.id}`,K=this.pendingMcpResponses.get(j);if(K){K.resolve(_),this.pendingMcpResponses.delete(j);return}}throw new Error("No pending request found")}handleMcpControlRequest(q,_,j){let K="id"in _.message?_.message.id:null,f=`${q}:${K}`;return new Promise((Y,P)=>{let $=null,O=()=>{if($)clearTimeout($);this.pendingMcpResponses.delete(f)},w=(z)=>{O(),Y(z)},v=(z)=>{O(),P(z)};if(this.pendingMcpResponses.set(f,{resolve:w,reject:v}),j.onmessage)j.onmessage(_.message);else{O(),P(new Error("No message handler registered"));return}$=setTimeout(()=>{if(this.pendingMcpResponses.has(f))O(),P(new Error("Request timeout"))},30000)})}};k={};zT(k,{void:()=>LZ,util:()=>u8,unknown:()=>dZ,union:()=>cZ,undefined:()=>IZ,tuple:()=>oZ,transformer:()=>F1,symbol:()=>mZ,string:()=>JP,strictObject:()=>nZ,setErrorMap:()=>jZ,set:()=>tZ,record:()=>aZ,quotelessJson:()=>_Z,promise:()=>qk,preprocess:()=>jk,pipeline:()=>Pk,ostring:()=>fk,optional:()=>_k,onumber:()=>Yk,oboolean:()=>$k,objectUtil:()=>f2,object:()=>xZ,number:()=>HP,nullable:()=>Kk,null:()=>gZ,never:()=>pZ,nativeEnum:()=>QZ,nan:()=>SZ,map:()=>BZ,makeIssue:()=>Q3,literal:()=>UZ,lazy:()=>FZ,late:()=>NZ,isValid:()=>W_,isDirty:()=>$2,isAsync:()=>aK,isAborted:()=>Y2,intersection:()=>iZ,instanceof:()=>bZ,getParsedType:()=>Lq,getErrorMap:()=>s3,function:()=>eZ,enum:()=>sZ,effect:()=>F1,discriminatedUnion:()=>rZ,defaultErrorMap:()=>Q_,datetimeRegex:()=>vP,date:()=>RZ,custom:()=>WP,coerce:()=>wk,boolean:()=>TP,bigint:()=>EZ,array:()=>lZ,any:()=>yZ,addIssueToContext:()=>F,ZodVoid:()=>tK,ZodUnknown:()=>Bq,ZodUnion:()=>jK,ZodUndefined:()=>_K,ZodType:()=>k8,ZodTuple:()=>Dq,ZodTransformer:()=>s6,ZodSymbol:()=>BK,ZodString:()=>Oq,ZodSet:()=>T_,ZodSchema:()=>k8,ZodRecord:()=>eK,ZodReadonly:()=>vK,ZodPromise:()=>Z_,ZodPipeline:()=>sK,ZodParsedType:()=>Q,ZodOptional:()=>zq,ZodObject:()=>i8,ZodNumber:()=>tq,ZodNullable:()=>lq,ZodNull:()=>KK,ZodNever:()=>hq,ZodNativeEnum:()=>$K,ZodNaN:()=>UK,ZodMap:()=>FK,ZodLiteral:()=>YK,ZodLazy:()=>fK,ZodIssueCode:()=>e,ZodIntersection:()=>PK,ZodFunction:()=>s_,ZodFirstPartyTypeKind:()=>z8,ZodError:()=>p6,ZodEnum:()=>Fq,ZodEffects:()=>s6,ZodDiscriminatedUnion:()=>q7,ZodDefault:()=>wK,ZodDate:()=>J_,ZodCatch:()=>OK,ZodBranded:()=>_7,ZodBoolean:()=>qK,ZodBigInt:()=>eq,ZodArray:()=>vq,ZodAny:()=>H_,Schema:()=>k8,ParseStatus:()=>X6,OK:()=>V6,NEVER:()=>Ok,INVALID:()=>O8,EMPTY_PATH:()=>PZ,DIRTY:()=>U_,BRAND:()=>MZ});(function(q){q.assertEqual=(f)=>{};function _(f){}q.assertIs=_;function j(f){throw new Error}q.assertNever=j,q.arrayToEnum=(f)=>{let Y={};for(let P of f)Y[P]=P;return Y},q.getValidEnumValues=(f)=>{let Y=q.objectKeys(f).filter(($)=>typeof f[f[$]]!=="number"),P={};for(let $ of Y)P[$]=f[$];return q.objectValues(P)},q.objectValues=(f)=>{return q.objectKeys(f).map(function(Y){return f[Y]})},q.objectKeys=typeof Object.keys==="function"?(f)=>Object.keys(f):(f)=>{let Y=[];for(let P in f)if(Object.prototype.hasOwnProperty.call(f,P))Y.push(P);return Y},q.find=(f,Y)=>{for(let P of f)if(Y(P))return P;return},q.isInteger=typeof Number.isInteger==="function"?(f)=>Number.isInteger(f):(f)=>typeof f==="number"&&Number.isFinite(f)&&Math.floor(f)===f;function K(f,Y=" | "){return f.map((P)=>typeof P==="string"?`'${P}'`:P).join(Y)}q.joinValues=K,q.jsonStringifyReplacer=(f,Y)=>{if(typeof Y==="bigint")return Y.toString();return Y}})(u8||(u8={}));(function(q){q.mergeShapes=(_,j)=>{return{..._,...j}}})(f2||(f2={}));Q=u8.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),e=u8.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"]);p6=class p6 extends Error{get errors(){return this.issues}constructor(q){super();this.issues=[],this.addIssue=(j)=>{this.issues=[...this.issues,j]},this.addIssues=(j=[])=>{this.issues=[...this.issues,...j]};let _=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,_);else this.__proto__=_;this.name="ZodError",this.issues=q}format(q){let _=q||function(f){return f.message},j={_errors:[]},K=(f)=>{for(let Y of f.issues)if(Y.code==="invalid_union")Y.unionErrors.map(K);else if(Y.code==="invalid_return_type")K(Y.returnTypeError);else if(Y.code==="invalid_arguments")K(Y.argumentsError);else if(Y.path.length===0)j._errors.push(_(Y));else{let P=j,$=0;while($<Y.path.length){let O=Y.path[$];if($!==Y.path.length-1)P[O]=P[O]||{_errors:[]};else P[O]=P[O]||{_errors:[]},P[O]._errors.push(_(Y));P=P[O],$++}}};return K(this),j}static assert(q){if(!(q instanceof p6))throw new Error(`Not a ZodError: ${q}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,u8.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(q=(_)=>_.message){let _={},j=[];for(let K of this.issues)if(K.path.length>0){let f=K.path[0];_[f]=_[f]||[],_[f].push(q(K))}else j.push(q(K));return{formErrors:j,fieldErrors:_}}get formErrors(){return this.flatten()}};p6.create=(q)=>{return new p6(q)};Q_=KZ,$P=Q_;PZ=[];O8=Object.freeze({status:"aborted"});(function(q){q.errToObj=(_)=>typeof _==="string"?{message:_}:_||{},q.toString=(_)=>typeof _==="string"?_:_?.message})(j8||(j8={}));fZ=/^c[^\s-]{8,}$/i,YZ=/^[0-9a-z]+$/,$Z=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wZ=/^[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,OZ=/^[a-z0-9_-]{21}$/i,vZ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,zZ=/^[-+]?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)?)??$/,WZ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,HZ=/^(?:(?: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])$/,TZ=/^(?:(?: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])$/,ZZ=/^(([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]))$/,kZ=/^(([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])$/,XZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,AZ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,GZ=new RegExp(`^${wP}$`);Oq=class Oq extends k8{_parse(q){if(this._def.coerce)q.data=String(q.data);if(this._getType(q)!==Q.string){let f=this._getOrReturnCtx(q);return F(f,{code:e.invalid_type,expected:Q.string,received:f.parsedType}),O8}let j=new X6,K=void 0;for(let f of this._def.checks)if(f.kind==="min"){if(q.data.length<f.value)K=this._getOrReturnCtx(q,K),F(K,{code:e.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),j.dirty()}else if(f.kind==="max"){if(q.data.length>f.value)K=this._getOrReturnCtx(q,K),F(K,{code:e.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),j.dirty()}else if(f.kind==="length"){let Y=q.data.length>f.value,P=q.data.length<f.value;if(Y||P){if(K=this._getOrReturnCtx(q,K),Y)F(K,{code:e.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message});else if(P)F(K,{code:e.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message});j.dirty()}}else if(f.kind==="email"){if(!WZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"email",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="emoji"){if(!j2)j2=new RegExp(JZ,"u");if(!j2.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"emoji",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="uuid"){if(!wZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"uuid",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="nanoid"){if(!OZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"nanoid",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="cuid"){if(!fZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"cuid",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="cuid2"){if(!YZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"cuid2",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="ulid"){if(!$Z.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"ulid",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="url")try{new URL(q.data)}catch{K=this._getOrReturnCtx(q,K),F(K,{validation:"url",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="regex"){if(f.regex.lastIndex=0,!f.regex.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"regex",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="trim")q.data=q.data.trim();else if(f.kind==="includes"){if(!q.data.includes(f.value,f.position))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),j.dirty()}else if(f.kind==="toLowerCase")q.data=q.data.toLowerCase();else if(f.kind==="toUpperCase")q.data=q.data.toUpperCase();else if(f.kind==="startsWith"){if(!q.data.startsWith(f.value))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:{startsWith:f.value},message:f.message}),j.dirty()}else if(f.kind==="endsWith"){if(!q.data.endsWith(f.value))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:{endsWith:f.value},message:f.message}),j.dirty()}else if(f.kind==="datetime"){if(!vP(f).test(q.data))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:"datetime",message:f.message}),j.dirty()}else if(f.kind==="date"){if(!GZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:"date",message:f.message}),j.dirty()}else if(f.kind==="time"){if(!uZ(f).test(q.data))K=this._getOrReturnCtx(q,K),F(K,{code:e.invalid_string,validation:"time",message:f.message}),j.dirty()}else if(f.kind==="duration"){if(!zZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"duration",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="ip"){if(!hZ(q.data,f.version))K=this._getOrReturnCtx(q,K),F(K,{validation:"ip",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="jwt"){if(!DZ(q.data,f.alg))K=this._getOrReturnCtx(q,K),F(K,{validation:"jwt",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="cidr"){if(!CZ(q.data,f.version))K=this._getOrReturnCtx(q,K),F(K,{validation:"cidr",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="base64"){if(!XZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"base64",code:e.invalid_string,message:f.message}),j.dirty()}else if(f.kind==="base64url"){if(!AZ.test(q.data))K=this._getOrReturnCtx(q,K),F(K,{validation:"base64url",code:e.invalid_string,message:f.message}),j.dirty()}else u8.assertNever(f);return{status:j.value,value:q.data}}_regex(q,_,j){return this.refinement((K)=>q.test(K),{validation:_,code:e.invalid_string,...j8.errToObj(j)})}_addCheck(q){return new Oq({...this._def,checks:[...this._def.checks,q]})}email(q){return this._addCheck({kind:"email",...j8.errToObj(q)})}url(q){return this._addCheck({kind:"url",...j8.errToObj(q)})}emoji(q){return this._addCheck({kind:"emoji",...j8.errToObj(q)})}uuid(q){return this._addCheck({kind:"uuid",...j8.errToObj(q)})}nanoid(q){return this._addCheck({kind:"nanoid",...j8.errToObj(q)})}cuid(q){return this._addCheck({kind:"cuid",...j8.errToObj(q)})}cuid2(q){return this._addCheck({kind:"cuid2",...j8.errToObj(q)})}ulid(q){return this._addCheck({kind:"ulid",...j8.errToObj(q)})}base64(q){return this._addCheck({kind:"base64",...j8.errToObj(q)})}base64url(q){return this._addCheck({kind:"base64url",...j8.errToObj(q)})}jwt(q){return this._addCheck({kind:"jwt",...j8.errToObj(q)})}ip(q){return this._addCheck({kind:"ip",...j8.errToObj(q)})}cidr(q){return this._addCheck({kind:"cidr",...j8.errToObj(q)})}datetime(q){if(typeof q==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:q});return this._addCheck({kind:"datetime",precision:typeof q?.precision==="undefined"?null:q?.precision,offset:q?.offset??!1,local:q?.local??!1,...j8.errToObj(q?.message)})}date(q){return this._addCheck({kind:"date",message:q})}time(q){if(typeof q==="string")return this._addCheck({kind:"time",precision:null,message:q});return this._addCheck({kind:"time",precision:typeof q?.precision==="undefined"?null:q?.precision,...j8.errToObj(q?.message)})}duration(q){return this._addCheck({kind:"duration",...j8.errToObj(q)})}regex(q,_){return this._addCheck({kind:"regex",regex:q,...j8.errToObj(_)})}includes(q,_){return this._addCheck({kind:"includes",value:q,position:_?.position,...j8.errToObj(_?.message)})}startsWith(q,_){return this._addCheck({kind:"startsWith",value:q,...j8.errToObj(_)})}endsWith(q,_){return this._addCheck({kind:"endsWith",value:q,...j8.errToObj(_)})}min(q,_){return this._addCheck({kind:"min",value:q,...j8.errToObj(_)})}max(q,_){return this._addCheck({kind:"max",value:q,...j8.errToObj(_)})}length(q,_){return this._addCheck({kind:"length",value:q,...j8.errToObj(_)})}nonempty(q){return this.min(1,j8.errToObj(q))}trim(){return new Oq({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Oq({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Oq({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((q)=>q.kind==="datetime")}get isDate(){return!!this._def.checks.find((q)=>q.kind==="date")}get isTime(){return!!this._def.checks.find((q)=>q.kind==="time")}get isDuration(){return!!this._def.checks.find((q)=>q.kind==="duration")}get isEmail(){return!!this._def.checks.find((q)=>q.kind==="email")}get isURL(){return!!this._def.checks.find((q)=>q.kind==="url")}get isEmoji(){return!!this._def.checks.find((q)=>q.kind==="emoji")}get isUUID(){return!!this._def.checks.find((q)=>q.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((q)=>q.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((q)=>q.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((q)=>q.kind==="cuid2")}get isULID(){return!!this._def.checks.find((q)=>q.kind==="ulid")}get isIP(){return!!this._def.checks.find((q)=>q.kind==="ip")}get isCIDR(){return!!this._def.checks.find((q)=>q.kind==="cidr")}get isBase64(){return!!this._def.checks.find((q)=>q.kind==="base64")}get isBase64url(){return!!this._def.checks.find((q)=>q.kind==="base64url")}get minLength(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxLength(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q}};Oq.create=(q)=>{return new Oq({checks:[],typeName:z8.ZodString,coerce:q?.coerce??!1,...Z8(q)})};tq=class tq extends k8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(q){if(this._def.coerce)q.data=Number(q.data);if(this._getType(q)!==Q.number){let f=this._getOrReturnCtx(q);return F(f,{code:e.invalid_type,expected:Q.number,received:f.parsedType}),O8}let j=void 0,K=new X6;for(let f of this._def.checks)if(f.kind==="int"){if(!u8.isInteger(q.data))j=this._getOrReturnCtx(q,j),F(j,{code:e.invalid_type,expected:"integer",received:"float",message:f.message}),K.dirty()}else if(f.kind==="min"){if(f.inclusive?q.data<f.value:q.data<=f.value)j=this._getOrReturnCtx(q,j),F(j,{code:e.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),K.dirty()}else if(f.kind==="max"){if(f.inclusive?q.data>f.value:q.data>=f.value)j=this._getOrReturnCtx(q,j),F(j,{code:e.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),K.dirty()}else if(f.kind==="multipleOf"){if(VZ(q.data,f.value)!==0)j=this._getOrReturnCtx(q,j),F(j,{code:e.not_multiple_of,multipleOf:f.value,message:f.message}),K.dirty()}else if(f.kind==="finite"){if(!Number.isFinite(q.data))j=this._getOrReturnCtx(q,j),F(j,{code:e.not_finite,message:f.message}),K.dirty()}else u8.assertNever(f);return{status:K.value,value:q.data}}gte(q,_){return this.setLimit("min",q,!0,j8.toString(_))}gt(q,_){return this.setLimit("min",q,!1,j8.toString(_))}lte(q,_){return this.setLimit("max",q,!0,j8.toString(_))}lt(q,_){return this.setLimit("max",q,!1,j8.toString(_))}setLimit(q,_,j,K){return new tq({...this._def,checks:[...this._def.checks,{kind:q,value:_,inclusive:j,message:j8.toString(K)}]})}_addCheck(q){return new tq({...this._def,checks:[...this._def.checks,q]})}int(q){return this._addCheck({kind:"int",message:j8.toString(q)})}positive(q){return this._addCheck({kind:"min",value:0,inclusive:!1,message:j8.toString(q)})}negative(q){return this._addCheck({kind:"max",value:0,inclusive:!1,message:j8.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:0,inclusive:!0,message:j8.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:0,inclusive:!0,message:j8.toString(q)})}multipleOf(q,_){return this._addCheck({kind:"multipleOf",value:q,message:j8.toString(_)})}finite(q){return this._addCheck({kind:"finite",message:j8.toString(q)})}safe(q){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:j8.toString(q)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:j8.toString(q)})}get minValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q}get isInt(){return!!this._def.checks.find((q)=>q.kind==="int"||q.kind==="multipleOf"&&u8.isInteger(q.value))}get isFinite(){let q=null,_=null;for(let j of this._def.checks)if(j.kind==="finite"||j.kind==="int"||j.kind==="multipleOf")return!0;else if(j.kind==="min"){if(_===null||j.value>_)_=j.value}else if(j.kind==="max"){if(q===null||j.value<q)q=j.value}return Number.isFinite(_)&&Number.isFinite(q)}};tq.create=(q)=>{return new tq({checks:[],typeName:z8.ZodNumber,coerce:q?.coerce||!1,...Z8(q)})};eq=class eq extends k8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(q){if(this._def.coerce)try{q.data=BigInt(q.data)}catch{return this._getInvalidInput(q)}if(this._getType(q)!==Q.bigint)return this._getInvalidInput(q);let j=void 0,K=new X6;for(let f of this._def.checks)if(f.kind==="min"){if(f.inclusive?q.data<f.value:q.data<=f.value)j=this._getOrReturnCtx(q,j),F(j,{code:e.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),K.dirty()}else if(f.kind==="max"){if(f.inclusive?q.data>f.value:q.data>=f.value)j=this._getOrReturnCtx(q,j),F(j,{code:e.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),K.dirty()}else if(f.kind==="multipleOf"){if(q.data%f.value!==BigInt(0))j=this._getOrReturnCtx(q,j),F(j,{code:e.not_multiple_of,multipleOf:f.value,message:f.message}),K.dirty()}else u8.assertNever(f);return{status:K.value,value:q.data}}_getInvalidInput(q){let _=this._getOrReturnCtx(q);return F(_,{code:e.invalid_type,expected:Q.bigint,received:_.parsedType}),O8}gte(q,_){return this.setLimit("min",q,!0,j8.toString(_))}gt(q,_){return this.setLimit("min",q,!1,j8.toString(_))}lte(q,_){return this.setLimit("max",q,!0,j8.toString(_))}lt(q,_){return this.setLimit("max",q,!1,j8.toString(_))}setLimit(q,_,j,K){return new eq({...this._def,checks:[...this._def.checks,{kind:q,value:_,inclusive:j,message:j8.toString(K)}]})}_addCheck(q){return new eq({...this._def,checks:[...this._def.checks,q]})}positive(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:j8.toString(q)})}negative(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:j8.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:j8.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:j8.toString(q)})}multipleOf(q,_){return this._addCheck({kind:"multipleOf",value:q,message:j8.toString(_)})}get minValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q}};eq.create=(q)=>{return new eq({checks:[],typeName:z8.ZodBigInt,coerce:q?.coerce??!1,...Z8(q)})};qK=class qK extends k8{_parse(q){if(this._def.coerce)q.data=Boolean(q.data);if(this._getType(q)!==Q.boolean){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.boolean,received:j.parsedType}),O8}return V6(q.data)}};qK.create=(q)=>{return new qK({typeName:z8.ZodBoolean,coerce:q?.coerce||!1,...Z8(q)})};J_=class J_ extends k8{_parse(q){if(this._def.coerce)q.data=new Date(q.data);if(this._getType(q)!==Q.date){let f=this._getOrReturnCtx(q);return F(f,{code:e.invalid_type,expected:Q.date,received:f.parsedType}),O8}if(Number.isNaN(q.data.getTime())){let f=this._getOrReturnCtx(q);return F(f,{code:e.invalid_date}),O8}let j=new X6,K=void 0;for(let f of this._def.checks)if(f.kind==="min"){if(q.data.getTime()<f.value)K=this._getOrReturnCtx(q,K),F(K,{code:e.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),j.dirty()}else if(f.kind==="max"){if(q.data.getTime()>f.value)K=this._getOrReturnCtx(q,K),F(K,{code:e.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),j.dirty()}else u8.assertNever(f);return{status:j.value,value:new Date(q.data.getTime())}}_addCheck(q){return new J_({...this._def,checks:[...this._def.checks,q]})}min(q,_){return this._addCheck({kind:"min",value:q.getTime(),message:j8.toString(_)})}max(q,_){return this._addCheck({kind:"max",value:q.getTime(),message:j8.toString(_)})}get minDate(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q!=null?new Date(q):null}get maxDate(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value<q)q=_.value}return q!=null?new Date(q):null}};J_.create=(q)=>{return new J_({checks:[],coerce:q?.coerce||!1,typeName:z8.ZodDate,...Z8(q)})};BK=class BK extends k8{_parse(q){if(this._getType(q)!==Q.symbol){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.symbol,received:j.parsedType}),O8}return V6(q.data)}};BK.create=(q)=>{return new BK({typeName:z8.ZodSymbol,...Z8(q)})};_K=class _K extends k8{_parse(q){if(this._getType(q)!==Q.undefined){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.undefined,received:j.parsedType}),O8}return V6(q.data)}};_K.create=(q)=>{return new _K({typeName:z8.ZodUndefined,...Z8(q)})};KK=class KK extends k8{_parse(q){if(this._getType(q)!==Q.null){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.null,received:j.parsedType}),O8}return V6(q.data)}};KK.create=(q)=>{return new KK({typeName:z8.ZodNull,...Z8(q)})};H_=class H_ extends k8{constructor(){super(...arguments);this._any=!0}_parse(q){return V6(q.data)}};H_.create=(q)=>{return new H_({typeName:z8.ZodAny,...Z8(q)})};Bq=class Bq extends k8{constructor(){super(...arguments);this._unknown=!0}_parse(q){return V6(q.data)}};Bq.create=(q)=>{return new Bq({typeName:z8.ZodUnknown,...Z8(q)})};hq=class hq extends k8{_parse(q){let _=this._getOrReturnCtx(q);return F(_,{code:e.invalid_type,expected:Q.never,received:_.parsedType}),O8}};hq.create=(q)=>{return new hq({typeName:z8.ZodNever,...Z8(q)})};tK=class tK extends k8{_parse(q){if(this._getType(q)!==Q.undefined){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.void,received:j.parsedType}),O8}return V6(q.data)}};tK.create=(q)=>{return new tK({typeName:z8.ZodVoid,...Z8(q)})};vq=class vq extends k8{_parse(q){let{ctx:_,status:j}=this._processInputParams(q),K=this._def;if(_.parsedType!==Q.array)return F(_,{code:e.invalid_type,expected:Q.array,received:_.parsedType}),O8;if(K.exactLength!==null){let Y=_.data.length>K.exactLength.value,P=_.data.length<K.exactLength.value;if(Y||P)F(_,{code:Y?e.too_big:e.too_small,minimum:P?K.exactLength.value:void 0,maximum:Y?K.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:K.exactLength.message}),j.dirty()}if(K.minLength!==null){if(_.data.length<K.minLength.value)F(_,{code:e.too_small,minimum:K.minLength.value,type:"array",inclusive:!0,exact:!1,message:K.minLength.message}),j.dirty()}if(K.maxLength!==null){if(_.data.length>K.maxLength.value)F(_,{code:e.too_big,maximum:K.maxLength.value,type:"array",inclusive:!0,exact:!1,message:K.maxLength.message}),j.dirty()}if(_.common.async)return Promise.all([..._.data].map((Y,P)=>{return K.type._parseAsync(new Wq(_,Y,_.path,P))})).then((Y)=>{return X6.mergeArray(j,Y)});let f=[..._.data].map((Y,P)=>{return K.type._parseSync(new Wq(_,Y,_.path,P))});return X6.mergeArray(j,f)}get element(){return this._def.type}min(q,_){return new vq({...this._def,minLength:{value:q,message:j8.toString(_)}})}max(q,_){return new vq({...this._def,maxLength:{value:q,message:j8.toString(_)}})}length(q,_){return new vq({...this._def,exactLength:{value:q,message:j8.toString(_)}})}nonempty(q){return this.min(1,q)}};vq.create=(q,_)=>{return new vq({type:q,minLength:null,maxLength:null,exactLength:null,typeName:z8.ZodArray,...Z8(_)})};i8=class i8 extends k8{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let q=this._def.shape(),_=u8.objectKeys(q);return this._cached={shape:q,keys:_},this._cached}_parse(q){if(this._getType(q)!==Q.object){let O=this._getOrReturnCtx(q);return F(O,{code:e.invalid_type,expected:Q.object,received:O.parsedType}),O8}let{status:j,ctx:K}=this._processInputParams(q),{shape:f,keys:Y}=this._getCached(),P=[];if(!(this._def.catchall instanceof hq&&this._def.unknownKeys==="strip")){for(let O in K.data)if(!Y.includes(O))P.push(O)}let $=[];for(let O of Y){let w=f[O],v=K.data[O];$.push({key:{status:"valid",value:O},value:w._parse(new Wq(K,v,K.path,O)),alwaysSet:O in K.data})}if(this._def.catchall instanceof hq){let O=this._def.unknownKeys;if(O==="passthrough")for(let w of P)$.push({key:{status:"valid",value:w},value:{status:"valid",value:K.data[w]}});else if(O==="strict"){if(P.length>0)F(K,{code:e.unrecognized_keys,keys:P}),j.dirty()}else if(O==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let O=this._def.catchall;for(let w of P){let v=K.data[w];$.push({key:{status:"valid",value:w},value:O._parse(new Wq(K,v,K.path,w)),alwaysSet:w in K.data})}}if(K.common.async)return Promise.resolve().then(async()=>{let O=[];for(let w of $){let v=await w.key,z=await w.value;O.push({key:v,value:z,alwaysSet:w.alwaysSet})}return O}).then((O)=>{return X6.mergeObjectSync(j,O)});else return X6.mergeObjectSync(j,$)}get shape(){return this._def.shape()}strict(q){return j8.errToObj,new i8({...this._def,unknownKeys:"strict",...q!==void 0?{errorMap:(_,j)=>{let K=this._def.errorMap?.(_,j).message??j.defaultError;if(_.code==="unrecognized_keys")return{message:j8.errToObj(q).message??K};return{message:K}}}:{}})}strip(){return new i8({...this._def,unknownKeys:"strip"})}passthrough(){return new i8({...this._def,unknownKeys:"passthrough"})}extend(q){return new i8({...this._def,shape:()=>({...this._def.shape(),...q})})}merge(q){return new i8({unknownKeys:q._def.unknownKeys,catchall:q._def.catchall,shape:()=>({...this._def.shape(),...q._def.shape()}),typeName:z8.ZodObject})}setKey(q,_){return this.augment({[q]:_})}catchall(q){return new i8({...this._def,catchall:q})}pick(q){let _={};for(let j of u8.objectKeys(q))if(q[j]&&this.shape[j])_[j]=this.shape[j];return new i8({...this._def,shape:()=>_})}omit(q){let _={};for(let j of u8.objectKeys(this.shape))if(!q[j])_[j]=this.shape[j];return new i8({...this._def,shape:()=>_})}deepPartial(){return e_(this)}partial(q){let _={};for(let j of u8.objectKeys(this.shape)){let K=this.shape[j];if(q&&!q[j])_[j]=K;else _[j]=K.optional()}return new i8({...this._def,shape:()=>_})}required(q){let _={};for(let j of u8.objectKeys(this.shape))if(q&&!q[j])_[j]=this.shape[j];else{let f=this.shape[j];while(f instanceof zq)f=f._def.innerType;_[j]=f}return new i8({...this._def,shape:()=>_})}keyof(){return zP(u8.objectKeys(this.shape))}};i8.create=(q,_)=>{return new i8({shape:()=>q,unknownKeys:"strip",catchall:hq.create(),typeName:z8.ZodObject,...Z8(_)})};i8.strictCreate=(q,_)=>{return new i8({shape:()=>q,unknownKeys:"strict",catchall:hq.create(),typeName:z8.ZodObject,...Z8(_)})};i8.lazycreate=(q,_)=>{return new i8({shape:q,unknownKeys:"strip",catchall:hq.create(),typeName:z8.ZodObject,...Z8(_)})};jK=class jK extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=this._def.options;function K(f){for(let P of f)if(P.result.status==="valid")return P.result;for(let P of f)if(P.result.status==="dirty")return _.common.issues.push(...P.ctx.common.issues),P.result;let Y=f.map((P)=>new p6(P.ctx.common.issues));return F(_,{code:e.invalid_union,unionErrors:Y}),O8}if(_.common.async)return Promise.all(j.map(async(f)=>{let Y={..._,common:{..._.common,issues:[]},parent:null};return{result:await f._parseAsync({data:_.data,path:_.path,parent:Y}),ctx:Y}})).then(K);else{let f=void 0,Y=[];for(let $ of j){let O={..._,common:{..._.common,issues:[]},parent:null},w=$._parseSync({data:_.data,path:_.path,parent:O});if(w.status==="valid")return w;else if(w.status==="dirty"&&!f)f={result:w,ctx:O};if(O.common.issues.length)Y.push(O.common.issues)}if(f)return _.common.issues.push(...f.ctx.common.issues),f.result;let P=Y.map(($)=>new p6($));return F(_,{code:e.invalid_union,unionErrors:P}),O8}}get options(){return this._def.options}};jK.create=(q,_)=>{return new jK({options:q,typeName:z8.ZodUnion,...Z8(_)})};q7=class q7 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==Q.object)return F(_,{code:e.invalid_type,expected:Q.object,received:_.parsedType}),O8;let j=this.discriminator,K=_.data[j],f=this.optionsMap.get(K);if(!f)return F(_,{code:e.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[j]}),O8;if(_.common.async)return f._parseAsync({data:_.data,path:_.path,parent:_});else return f._parseSync({data:_.data,path:_.path,parent:_})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(q,_,j){let K=new Map;for(let f of _){let Y=pq(f.shape[q]);if(!Y.length)throw new Error(`A discriminator value for key \`${q}\` could not be extracted from all schema options`);for(let P of Y){if(K.has(P))throw new Error(`Discriminator property ${String(q)} has duplicate value ${String(P)}`);K.set(P,f)}}return new q7({typeName:z8.ZodDiscriminatedUnion,discriminator:q,options:_,optionsMap:K,...Z8(j)})}};PK=class PK extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q),K=(f,Y)=>{if(Y2(f)||Y2(Y))return O8;let P=w2(f.value,Y.value);if(!P.valid)return F(j,{code:e.invalid_intersection_types}),O8;if($2(f)||$2(Y))_.dirty();return{status:_.value,value:P.data}};if(j.common.async)return Promise.all([this._def.left._parseAsync({data:j.data,path:j.path,parent:j}),this._def.right._parseAsync({data:j.data,path:j.path,parent:j})]).then(([f,Y])=>K(f,Y));else return K(this._def.left._parseSync({data:j.data,path:j.path,parent:j}),this._def.right._parseSync({data:j.data,path:j.path,parent:j}))}};PK.create=(q,_,j)=>{return new PK({left:q,right:_,typeName:z8.ZodIntersection,...Z8(j)})};Dq=class Dq extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.array)return F(j,{code:e.invalid_type,expected:Q.array,received:j.parsedType}),O8;if(j.data.length<this._def.items.length)return F(j,{code:e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),O8;if(!this._def.rest&&j.data.length>this._def.items.length)F(j,{code:e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_.dirty();let f=[...j.data].map((Y,P)=>{let $=this._def.items[P]||this._def.rest;if(!$)return null;return $._parse(new Wq(j,Y,j.path,P))}).filter((Y)=>!!Y);if(j.common.async)return Promise.all(f).then((Y)=>{return X6.mergeArray(_,Y)});else return X6.mergeArray(_,f)}get items(){return this._def.items}rest(q){return new Dq({...this._def,rest:q})}};Dq.create=(q,_)=>{if(!Array.isArray(q))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Dq({items:q,typeName:z8.ZodTuple,rest:null,...Z8(_)})};eK=class eK extends k8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.object)return F(j,{code:e.invalid_type,expected:Q.object,received:j.parsedType}),O8;let K=[],f=this._def.keyType,Y=this._def.valueType;for(let P in j.data)K.push({key:f._parse(new Wq(j,P,j.path,P)),value:Y._parse(new Wq(j,j.data[P],j.path,P)),alwaysSet:P in j.data});if(j.common.async)return X6.mergeObjectAsync(_,K);else return X6.mergeObjectSync(_,K)}get element(){return this._def.valueType}static create(q,_,j){if(_ instanceof k8)return new eK({keyType:q,valueType:_,typeName:z8.ZodRecord,...Z8(j)});return new eK({keyType:Oq.create(),valueType:q,typeName:z8.ZodRecord,...Z8(_)})}};FK=class FK extends k8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.map)return F(j,{code:e.invalid_type,expected:Q.map,received:j.parsedType}),O8;let K=this._def.keyType,f=this._def.valueType,Y=[...j.data.entries()].map(([P,$],O)=>{return{key:K._parse(new Wq(j,P,j.path,[O,"key"])),value:f._parse(new Wq(j,$,j.path,[O,"value"]))}});if(j.common.async){let P=new Map;return Promise.resolve().then(async()=>{for(let $ of Y){let O=await $.key,w=await $.value;if(O.status==="aborted"||w.status==="aborted")return O8;if(O.status==="dirty"||w.status==="dirty")_.dirty();P.set(O.value,w.value)}return{status:_.value,value:P}})}else{let P=new Map;for(let $ of Y){let{key:O,value:w}=$;if(O.status==="aborted"||w.status==="aborted")return O8;if(O.status==="dirty"||w.status==="dirty")_.dirty();P.set(O.value,w.value)}return{status:_.value,value:P}}}};FK.create=(q,_,j)=>{return new FK({valueType:_,keyType:q,typeName:z8.ZodMap,...Z8(j)})};T_=class T_ extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==Q.set)return F(j,{code:e.invalid_type,expected:Q.set,received:j.parsedType}),O8;let K=this._def;if(K.minSize!==null){if(j.data.size<K.minSize.value)F(j,{code:e.too_small,minimum:K.minSize.value,type:"set",inclusive:!0,exact:!1,message:K.minSize.message}),_.dirty()}if(K.maxSize!==null){if(j.data.size>K.maxSize.value)F(j,{code:e.too_big,maximum:K.maxSize.value,type:"set",inclusive:!0,exact:!1,message:K.maxSize.message}),_.dirty()}let f=this._def.valueType;function Y($){let O=new Set;for(let w of $){if(w.status==="aborted")return O8;if(w.status==="dirty")_.dirty();O.add(w.value)}return{status:_.value,value:O}}let P=[...j.data.values()].map(($,O)=>f._parse(new Wq(j,$,j.path,O)));if(j.common.async)return Promise.all(P).then(($)=>Y($));else return Y(P)}min(q,_){return new T_({...this._def,minSize:{value:q,message:j8.toString(_)}})}max(q,_){return new T_({...this._def,maxSize:{value:q,message:j8.toString(_)}})}size(q,_){return this.min(q,_).max(q,_)}nonempty(q){return this.min(1,q)}};T_.create=(q,_)=>{return new T_({valueType:q,minSize:null,maxSize:null,typeName:z8.ZodSet,...Z8(_)})};s_=class s_ extends k8{constructor(){super(...arguments);this.validate=this.implement}_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==Q.function)return F(_,{code:e.invalid_type,expected:Q.function,received:_.parsedType}),O8;function j(P,$){return Q3({data:P,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,s3(),Q_].filter((O)=>!!O),issueData:{code:e.invalid_arguments,argumentsError:$}})}function K(P,$){return Q3({data:P,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,s3(),Q_].filter((O)=>!!O),issueData:{code:e.invalid_return_type,returnTypeError:$}})}let f={errorMap:_.common.contextualErrorMap},Y=_.data;if(this._def.returns instanceof Z_){let P=this;return V6(async function(...$){let O=new p6([]),w=await P._def.args.parseAsync($,f).catch((W)=>{throw O.addIssue(j($,W)),O}),v=await Reflect.apply(Y,this,w);return await P._def.returns._def.type.parseAsync(v,f).catch((W)=>{throw O.addIssue(K(v,W)),O})})}else{let P=this;return V6(function(...$){let O=P._def.args.safeParse($,f);if(!O.success)throw new p6([j($,O.error)]);let w=Reflect.apply(Y,this,O.data),v=P._def.returns.safeParse(w,f);if(!v.success)throw new p6([K(w,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...q){return new s_({...this._def,args:Dq.create(q).rest(Bq.create())})}returns(q){return new s_({...this._def,returns:q})}implement(q){return this.parse(q)}strictImplement(q){return this.parse(q)}static create(q,_,j){return new s_({args:q?q:Dq.create([]).rest(Bq.create()),returns:_||Bq.create(),typeName:z8.ZodFunction,...Z8(j)})}};fK=class fK extends k8{get schema(){return this._def.getter()}_parse(q){let{ctx:_}=this._processInputParams(q);return this._def.getter()._parse({data:_.data,path:_.path,parent:_})}};fK.create=(q,_)=>{return new fK({getter:q,typeName:z8.ZodLazy,...Z8(_)})};YK=class YK extends k8{_parse(q){if(q.data!==this._def.value){let _=this._getOrReturnCtx(q);return F(_,{received:_.data,code:e.invalid_literal,expected:this._def.value}),O8}return{status:"valid",value:q.data}}get value(){return this._def.value}};YK.create=(q,_)=>{return new YK({value:q,typeName:z8.ZodLiteral,...Z8(_)})};Fq=class Fq extends k8{_parse(q){if(typeof q.data!=="string"){let _=this._getOrReturnCtx(q),j=this._def.values;return F(_,{expected:u8.joinValues(j),received:_.parsedType,code:e.invalid_type}),O8}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(q.data)){let _=this._getOrReturnCtx(q),j=this._def.values;return F(_,{received:_.data,code:e.invalid_enum_value,options:j}),O8}return V6(q.data)}get options(){return this._def.values}get enum(){let q={};for(let _ of this._def.values)q[_]=_;return q}get Values(){let q={};for(let _ of this._def.values)q[_]=_;return q}get Enum(){let q={};for(let _ of this._def.values)q[_]=_;return q}extract(q,_=this._def){return Fq.create(q,{...this._def,..._})}exclude(q,_=this._def){return Fq.create(this.options.filter((j)=>!q.includes(j)),{...this._def,..._})}};Fq.create=zP;$K=class $K extends k8{_parse(q){let _=u8.getValidEnumValues(this._def.values),j=this._getOrReturnCtx(q);if(j.parsedType!==Q.string&&j.parsedType!==Q.number){let K=u8.objectValues(_);return F(j,{expected:u8.joinValues(K),received:j.parsedType,code:e.invalid_type}),O8}if(!this._cache)this._cache=new Set(u8.getValidEnumValues(this._def.values));if(!this._cache.has(q.data)){let K=u8.objectValues(_);return F(j,{received:j.data,code:e.invalid_enum_value,options:K}),O8}return V6(q.data)}get enum(){return this._def.values}};$K.create=(q,_)=>{return new $K({values:q,typeName:z8.ZodNativeEnum,...Z8(_)})};Z_=class Z_ extends k8{unwrap(){return this._def.type}_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==Q.promise&&_.common.async===!1)return F(_,{code:e.invalid_type,expected:Q.promise,received:_.parsedType}),O8;let j=_.parsedType===Q.promise?_.data:Promise.resolve(_.data);return V6(j.then((K)=>{return this._def.type.parseAsync(K,{path:_.path,errorMap:_.common.contextualErrorMap})}))}};Z_.create=(q,_)=>{return new Z_({type:q,typeName:z8.ZodPromise,...Z8(_)})};s6=class s6 extends k8{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z8.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(q){let{status:_,ctx:j}=this._processInputParams(q),K=this._def.effect||null,f={addIssue:(Y)=>{if(F(j,Y),Y.fatal)_.abort();else _.dirty()},get path(){return j.path}};if(f.addIssue=f.addIssue.bind(f),K.type==="preprocess"){let Y=K.transform(j.data,f);if(j.common.async)return Promise.resolve(Y).then(async(P)=>{if(_.value==="aborted")return O8;let $=await this._def.schema._parseAsync({data:P,path:j.path,parent:j});if($.status==="aborted")return O8;if($.status==="dirty")return U_($.value);if(_.value==="dirty")return U_($.value);return $});else{if(_.value==="aborted")return O8;let P=this._def.schema._parseSync({data:Y,path:j.path,parent:j});if(P.status==="aborted")return O8;if(P.status==="dirty")return U_(P.value);if(_.value==="dirty")return U_(P.value);return P}}if(K.type==="refinement"){let Y=(P)=>{let $=K.refinement(P,f);if(j.common.async)return Promise.resolve($);if($ instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return P};if(j.common.async===!1){let P=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(P.status==="aborted")return O8;if(P.status==="dirty")_.dirty();return Y(P.value),{status:_.value,value:P.value}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then((P)=>{if(P.status==="aborted")return O8;if(P.status==="dirty")_.dirty();return Y(P.value).then(()=>{return{status:_.value,value:P.value}})})}if(K.type==="transform")if(j.common.async===!1){let Y=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(!W_(Y))return O8;let P=K.transform(Y.value,f);if(P instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:_.value,value:P}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then((Y)=>{if(!W_(Y))return O8;return Promise.resolve(K.transform(Y.value,f)).then((P)=>({status:_.value,value:P}))});u8.assertNever(K)}};s6.create=(q,_,j)=>{return new s6({schema:q,typeName:z8.ZodEffects,effect:_,...Z8(j)})};s6.createWithPreprocess=(q,_,j)=>{return new s6({schema:_,effect:{type:"preprocess",transform:q},typeName:z8.ZodEffects,...Z8(j)})};zq=class zq extends k8{_parse(q){if(this._getType(q)===Q.undefined)return V6(void 0);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}};zq.create=(q,_)=>{return new zq({innerType:q,typeName:z8.ZodOptional,...Z8(_)})};lq=class lq extends k8{_parse(q){if(this._getType(q)===Q.null)return V6(null);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}};lq.create=(q,_)=>{return new lq({innerType:q,typeName:z8.ZodNullable,...Z8(_)})};wK=class wK extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;if(_.parsedType===Q.undefined)j=this._def.defaultValue();return this._def.innerType._parse({data:j,path:_.path,parent:_})}removeDefault(){return this._def.innerType}};wK.create=(q,_)=>{return new wK({innerType:q,typeName:z8.ZodDefault,defaultValue:typeof _.default==="function"?_.default:()=>_.default,...Z8(_)})};OK=class OK extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j={..._,common:{..._.common,issues:[]}},K=this._def.innerType._parse({data:j.data,path:j.path,parent:{...j}});if(aK(K))return K.then((f)=>{return{status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new p6(j.common.issues)},input:j.data})}});else return{status:"valid",value:K.status==="valid"?K.value:this._def.catchValue({get error(){return new p6(j.common.issues)},input:j.data})}}removeCatch(){return this._def.innerType}};OK.create=(q,_)=>{return new OK({innerType:q,typeName:z8.ZodCatch,catchValue:typeof _.catch==="function"?_.catch:()=>_.catch,...Z8(_)})};UK=class UK extends k8{_parse(q){if(this._getType(q)!==Q.nan){let j=this._getOrReturnCtx(q);return F(j,{code:e.invalid_type,expected:Q.nan,received:j.parsedType}),O8}return{status:"valid",value:q.data}}};UK.create=(q)=>{return new UK({typeName:z8.ZodNaN,...Z8(q)})};MZ=Symbol("zod_brand");_7=class _7 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;return this._def.type._parse({data:j,path:_.path,parent:_})}unwrap(){return this._def.type}};sK=class sK extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.common.async)return(async()=>{let f=await this._def.in._parseAsync({data:j.data,path:j.path,parent:j});if(f.status==="aborted")return O8;if(f.status==="dirty")return _.dirty(),U_(f.value);else return this._def.out._parseAsync({data:f.value,path:j.path,parent:j})})();else{let K=this._def.in._parseSync({data:j.data,path:j.path,parent:j});if(K.status==="aborted")return O8;if(K.status==="dirty")return _.dirty(),{status:"dirty",value:K.value};else return this._def.out._parseSync({data:K.value,path:j.path,parent:j})}}static create(q,_){return new sK({in:q,out:_,typeName:z8.ZodPipeline})}};vK=class vK extends k8{_parse(q){let _=this._def.innerType._parse(q),j=(K)=>{if(W_(K))K.value=Object.freeze(K.value);return K};return aK(_)?_.then((K)=>j(K)):j(_)}unwrap(){return this._def.innerType}};vK.create=(q,_)=>{return new vK({innerType:q,typeName:z8.ZodReadonly,...Z8(_)})};NZ={object:i8.lazycreate};(function(q){q.ZodString="ZodString",q.ZodNumber="ZodNumber",q.ZodNaN="ZodNaN",q.ZodBigInt="ZodBigInt",q.ZodBoolean="ZodBoolean",q.ZodDate="ZodDate",q.ZodSymbol="ZodSymbol",q.ZodUndefined="ZodUndefined",q.ZodNull="ZodNull",q.ZodAny="ZodAny",q.ZodUnknown="ZodUnknown",q.ZodNever="ZodNever",q.ZodVoid="ZodVoid",q.ZodArray="ZodArray",q.ZodObject="ZodObject",q.ZodUnion="ZodUnion",q.ZodDiscriminatedUnion="ZodDiscriminatedUnion",q.ZodIntersection="ZodIntersection",q.ZodTuple="ZodTuple",q.ZodRecord="ZodRecord",q.ZodMap="ZodMap",q.ZodSet="ZodSet",q.ZodFunction="ZodFunction",q.ZodLazy="ZodLazy",q.ZodLiteral="ZodLiteral",q.ZodEnum="ZodEnum",q.ZodEffects="ZodEffects",q.ZodNativeEnum="ZodNativeEnum",q.ZodOptional="ZodOptional",q.ZodNullable="ZodNullable",q.ZodDefault="ZodDefault",q.ZodCatch="ZodCatch",q.ZodPromise="ZodPromise",q.ZodBranded="ZodBranded",q.ZodPipeline="ZodPipeline",q.ZodReadonly="ZodReadonly"})(z8||(z8={}));JP=Oq.create,HP=tq.create,SZ=UK.create,EZ=eq.create,TP=qK.create,RZ=J_.create,mZ=BK.create,IZ=_K.create,gZ=KK.create,yZ=H_.create,dZ=Bq.create,pZ=hq.create,LZ=tK.create,lZ=vq.create,xZ=i8.create,nZ=i8.strictCreate,cZ=jK.create,rZ=q7.create,iZ=PK.create,oZ=Dq.create,aZ=eK.create,BZ=FK.create,tZ=T_.create,eZ=s_.create,FZ=fK.create,UZ=YK.create,sZ=Fq.create,QZ=$K.create,qk=Z_.create,F1=s6.create,_k=zq.create,Kk=lq.create,jk=s6.createWithPreprocess,Pk=sK.create,wk={string:(q)=>Oq.create({...q,coerce:!0}),number:(q)=>tq.create({...q,coerce:!0}),boolean:(q)=>qK.create({...q,coerce:!0}),bigint:(q)=>eq.create({...q,coerce:!0}),date:(q)=>J_.create({...q,coerce:!0})},Ok=O8,ZP=k.union([k.string(),k.number().int()]),kP=k.string(),vk=k.object({progressToken:k.optional(ZP)}).passthrough(),Q6=k.object({_meta:k.optional(vk)}).passthrough(),R6=k.object({method:k.string(),params:k.optional(Q6)}),QK=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),Cq=k.object({method:k.string(),params:k.optional(QK)}),qq=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),j7=k.union([k.string(),k.number().int()]),zk=k.object({jsonrpc:k.literal(K7),id:j7}).merge(R6).strict(),Wk=k.object({jsonrpc:k.literal(K7)}).merge(Cq).strict(),Jk=k.object({jsonrpc:k.literal(K7),id:j7,result:qq}).strict();(function(q){q[q.ConnectionClosed=-32000]="ConnectionClosed",q[q.RequestTimeout=-32001]="RequestTimeout",q[q.ParseError=-32700]="ParseError",q[q.InvalidRequest=-32600]="InvalidRequest",q[q.MethodNotFound=-32601]="MethodNotFound",q[q.InvalidParams=-32602]="InvalidParams",q[q.InternalError=-32603]="InternalError"})(U1||(U1={}));Hk=k.object({jsonrpc:k.literal(K7),id:j7,error:k.object({code:k.number().int(),message:k.string(),data:k.optional(k.unknown())})}).strict(),YV=k.union([zk,Wk,Jk,Hk]),XP=qq.strict(),AP=Cq.extend({method:k.literal("notifications/cancelled"),params:QK.extend({requestId:j7,reason:k.string().optional()})}),q3=k.object({name:k.string(),title:k.optional(k.string())}).passthrough(),GP=q3.extend({version:k.string()}),Tk=k.object({experimental:k.optional(k.object({}).passthrough()),sampling:k.optional(k.object({}).passthrough()),elicitation:k.optional(k.object({}).passthrough()),roots:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),Zk=R6.extend({method:k.literal("initialize"),params:Q6.extend({protocolVersion:k.string(),capabilities:Tk,clientInfo:GP})}),kk=k.object({experimental:k.optional(k.object({}).passthrough()),logging:k.optional(k.object({}).passthrough()),completions:k.optional(k.object({}).passthrough()),prompts:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough()),resources:k.optional(k.object({subscribe:k.optional(k.boolean()),listChanged:k.optional(k.boolean())}).passthrough()),tools:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),Xk=qq.extend({protocolVersion:k.string(),capabilities:kk,serverInfo:GP,instructions:k.optional(k.string())}),Ak=Cq.extend({method:k.literal("notifications/initialized")}),uP=R6.extend({method:k.literal("ping")}),Gk=k.object({progress:k.number(),total:k.optional(k.number()),message:k.optional(k.string())}).passthrough(),hP=Cq.extend({method:k.literal("notifications/progress"),params:QK.merge(Gk).extend({progressToken:ZP})}),P7=R6.extend({params:Q6.extend({cursor:k.optional(kP)}).optional()}),f7=qq.extend({nextCursor:k.optional(kP)}),DP=k.object({uri:k.string(),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),CP=DP.extend({text:k.string()}),H2=k.string().refine((q)=>{try{return atob(q),!0}catch(_){return!1}},{message:"Invalid Base64 string"}),VP=DP.extend({blob:H2}),MP=q3.extend({uri:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),uk=q3.extend({uriTemplate:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),hk=P7.extend({method:k.literal("resources/list")}),Dk=f7.extend({resources:k.array(MP)}),Ck=P7.extend({method:k.literal("resources/templates/list")}),Vk=f7.extend({resourceTemplates:k.array(uk)}),Mk=R6.extend({method:k.literal("resources/read"),params:Q6.extend({uri:k.string()})}),Nk=qq.extend({contents:k.array(k.union([CP,VP]))}),bk=Cq.extend({method:k.literal("notifications/resources/list_changed")}),Sk=R6.extend({method:k.literal("resources/subscribe"),params:Q6.extend({uri:k.string()})}),Ek=R6.extend({method:k.literal("resources/unsubscribe"),params:Q6.extend({uri:k.string()})}),Rk=Cq.extend({method:k.literal("notifications/resources/updated"),params:QK.extend({uri:k.string()})}),mk=k.object({name:k.string(),description:k.optional(k.string()),required:k.optional(k.boolean())}).passthrough(),Ik=q3.extend({description:k.optional(k.string()),arguments:k.optional(k.array(mk)),_meta:k.optional(k.object({}).passthrough())}),gk=P7.extend({method:k.literal("prompts/list")}),yk=f7.extend({prompts:k.array(Ik)}),dk=R6.extend({method:k.literal("prompts/get"),params:Q6.extend({name:k.string(),arguments:k.optional(k.record(k.string()))})}),T2=k.object({type:k.literal("text"),text:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),Z2=k.object({type:k.literal("image"),data:H2,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),k2=k.object({type:k.literal("audio"),data:H2,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),pk=k.object({type:k.literal("resource"),resource:k.union([CP,VP]),_meta:k.optional(k.object({}).passthrough())}).passthrough(),Lk=MP.extend({type:k.literal("resource_link")}),NP=k.union([T2,Z2,k2,Lk,pk]),lk=k.object({role:k.enum(["user","assistant"]),content:NP}).passthrough(),xk=qq.extend({description:k.optional(k.string()),messages:k.array(lk)}),nk=Cq.extend({method:k.literal("notifications/prompts/list_changed")}),ck=k.object({title:k.optional(k.string()),readOnlyHint:k.optional(k.boolean()),destructiveHint:k.optional(k.boolean()),idempotentHint:k.optional(k.boolean()),openWorldHint:k.optional(k.boolean())}).passthrough(),rk=q3.extend({description:k.optional(k.string()),inputSchema:k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough(),outputSchema:k.optional(k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough()),annotations:k.optional(ck),_meta:k.optional(k.object({}).passthrough())}),ik=P7.extend({method:k.literal("tools/list")}),ok=f7.extend({tools:k.array(rk)}),bP=qq.extend({content:k.array(NP).default([]),structuredContent:k.object({}).passthrough().optional(),isError:k.optional(k.boolean())}),$V=bP.or(qq.extend({toolResult:k.unknown()})),ak=R6.extend({method:k.literal("tools/call"),params:Q6.extend({name:k.string(),arguments:k.optional(k.record(k.unknown()))})}),Bk=Cq.extend({method:k.literal("notifications/tools/list_changed")}),SP=k.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),tk=R6.extend({method:k.literal("logging/setLevel"),params:Q6.extend({level:SP})}),ek=Cq.extend({method:k.literal("notifications/message"),params:QK.extend({level:SP,logger:k.optional(k.string()),data:k.unknown()})}),Fk=k.object({name:k.string().optional()}).passthrough(),Uk=k.object({hints:k.optional(k.array(Fk)),costPriority:k.optional(k.number().min(0).max(1)),speedPriority:k.optional(k.number().min(0).max(1)),intelligencePriority:k.optional(k.number().min(0).max(1))}).passthrough(),sk=k.object({role:k.enum(["user","assistant"]),content:k.union([T2,Z2,k2])}).passthrough(),Qk=R6.extend({method:k.literal("sampling/createMessage"),params:Q6.extend({messages:k.array(sk),systemPrompt:k.optional(k.string()),includeContext:k.optional(k.enum(["none","thisServer","allServers"])),temperature:k.optional(k.number()),maxTokens:k.number().int(),stopSequences:k.optional(k.array(k.string())),metadata:k.optional(k.object({}).passthrough()),modelPreferences:k.optional(Uk)})}),qX=qq.extend({model:k.string(),stopReason:k.optional(k.enum(["endTurn","stopSequence","maxTokens"]).or(k.string())),role:k.enum(["user","assistant"]),content:k.discriminatedUnion("type",[T2,Z2,k2])}),_X=k.object({type:k.literal("boolean"),title:k.optional(k.string()),description:k.optional(k.string()),default:k.optional(k.boolean())}).passthrough(),KX=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),minLength:k.optional(k.number()),maxLength:k.optional(k.number()),format:k.optional(k.enum(["email","uri","date","date-time"]))}).passthrough(),jX=k.object({type:k.enum(["number","integer"]),title:k.optional(k.string()),description:k.optional(k.string()),minimum:k.optional(k.number()),maximum:k.optional(k.number())}).passthrough(),PX=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),enum:k.array(k.string()),enumNames:k.optional(k.array(k.string()))}).passthrough(),fX=k.union([_X,KX,jX,PX]),YX=R6.extend({method:k.literal("elicitation/create"),params:Q6.extend({message:k.string(),requestedSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),fX),required:k.optional(k.array(k.string()))}).passthrough()})}),$X=qq.extend({action:k.enum(["accept","decline","cancel"]),content:k.optional(k.record(k.string(),k.unknown()))}),wX=k.object({type:k.literal("ref/resource"),uri:k.string()}).passthrough(),OX=k.object({type:k.literal("ref/prompt"),name:k.string()}).passthrough(),vX=R6.extend({method:k.literal("completion/complete"),params:Q6.extend({ref:k.union([OX,wX]),argument:k.object({name:k.string(),value:k.string()}).passthrough(),context:k.optional(k.object({arguments:k.optional(k.record(k.string(),k.string()))}))})}),zX=qq.extend({completion:k.object({values:k.array(k.string()).max(100),total:k.optional(k.number().int()),hasMore:k.optional(k.boolean())}).passthrough()}),WX=k.object({uri:k.string().startsWith("file://"),name:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),JX=R6.extend({method:k.literal("roots/list")}),HX=qq.extend({roots:k.array(WX)}),TX=Cq.extend({method:k.literal("notifications/roots/list_changed")}),wV=k.union([uP,Zk,vX,tk,dk,gk,hk,Ck,Mk,Sk,Ek,ak,ik]),OV=k.union([AP,hP,Ak,TX]),vV=k.union([XP,qX,$X,HX]),zV=k.union([uP,Qk,YX,JX]),WV=k.union([AP,hP,ek,Rk,bk,Bk,nk]),JV=k.union([XP,Xk,zX,xk,yk,Dk,Vk,Nk,bP,ok]),HV=vT(oT(),1),TV=Symbol("Let zodToJsonSchema decide on which parser to use"),ZV=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");(function(q){q.Completable="McpCompletable"})(O2||(O2={}));v2=class v2 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;return this._def.type._parse({data:j,path:_.path,parent:_})}unwrap(){return this._def.type}};v2.create=(q,_)=>{return new v2({type:q,typeName:O2.Completable,complete:_.complete,...ZX(_)})}});var EP={};iq(EP,{version:()=>AX,type:()=>uX,scripts:()=>DX,repository:()=>NX,publishConfig:()=>EX,name:()=>XX,main:()=>hX,license:()=>MX,keywords:()=>CX,homepage:()=>bX,files:()=>yX,engines:()=>IX,devDependencies:()=>mX,description:()=>GX,dependencies:()=>RX,default:()=>dX,bugs:()=>SX,bin:()=>gX,author:()=>VX});var XX="claude-mem",AX="3.5.9",GX="Memory compression system for Claude Code - persist context across sessions",uX="module",hX="claude-mem",DX,CX,VX="Alex Newman",MX="SEE LICENSE IN LICENSE",NX,bX="https://github.com/thedotmack/claude-mem#readme",SX,EX,RX,mX,IX,gX,yX,dX;var RP=Q8(()=>{DX={dev:"tsx src/bin/cli.ts","dev:install":"node dist/claude-mem.min.js install --force","dev:status":"node dist/claude-mem.min.js status","dev:compress":"node dist/claude-mem.min.js compress","dev:load":"node dist/claude-mem.min.js load-context","dev:uninstall":"node dist/claude-mem.min.js uninstall",build:"./scripts/build-minified.sh","test:watch":"npm test -- --watch",lint:"eslint 'src/**/*.ts' 'hooks/**/*.ts' 'test/**/*.ts'","lint:fix":"npm run lint -- --fix",format:"prettier --write 'src/**/*.ts' 'hooks/**/*.ts' 'test/**/*.ts'","build:npm":"./scripts/npm-publish.sh",publish:"./scripts/publish-all.sh","publish:latest":"npm version patch && ./scripts/publish-all.sh","publish:github":"./scripts/github-publish.sh"},CX=["claude","claude-code","mcp","memory","compression","knowledge-graph","transcript","cli","typescript","bun"],NX={type:"git",url:"https://github.com/thedotmack/claude-mem.git"},SX={url:"https://github.com/thedotmack/claude-mem/issues"},EX={access:"public",registry:"https://registry.npmjs.org/"},RX={"@anthropic-ai/claude-code":"^1.0.88","@clack/prompts":"^0.11.0","@modelcontextprotocol/sdk":"^0.5.0",boxen:"^8.0.1",chalk:"^5.6.0",chromadb:"^3.0.14",commander:"^14.0.0",cors:"^2.8.5",express:"^5.1.0",glob:"^11.0.3","gradient-string":"^3.0.0",handlebars:"^4.7.8",http:"^0.0.1-security","oh-my-logo":"^0.3.2",open:"^10.2.0"},mX={"@types/chai":"^4.3.0","@types/handlebars":"^4.0.40","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0",chai:"^4.3.0",eslint:"^8.0.0",prettier:"^3.0.0","ts-node":"^10.0.0",tsx:"^4.20.5",typescript:"^5.0.0"},IX={node:">=18.0.0",bun:">=1.0.0"},gX={"claude-mem":"dist/claude-mem.min.js"},yX=["dist","hooks","commands","docs"],dX={name:XX,version:AX,description:GX,type:uX,main:hX,scripts:DX,keywords:CX,author:VX,license:MX,repository:NX,homepage:bX,bugs:SX,publishConfig:EX,dependencies:RX,devDependencies:mX,engines:IX,bin:gX,files:yX}});import{join as t8,dirname as Y7,sep as pX}from"path";import{homedir as A2}from"os";import{existsSync as K3,statSync as LX}from"fs";import{execSync as lX}from"child_process";import{fileURLToPath as xX}from"url";class P8{static instance=null;_dataDirectory=null;_packageRoot=null;_claudeConfigDirectory=null;static getInstance(){if(!P8.instance)P8.instance=new P8;return P8.instance}getDataDirectory(){if(this._dataDirectory)return this._dataDirectory;return this._dataDirectory=process.env.CLAUDE_MEM_DATA_DIR||t8(A2(),".claude-mem"),this._dataDirectory}getArchivesDirectory(){return t8(this.getDataDirectory(),"archives")}getHooksDirectory(){return t8(this.getDataDirectory(),"hooks")}getLogsDirectory(){return t8(this.getDataDirectory(),"logs")}getIndexDirectory(){return this.getDataDirectory()}getIndexPath(){return t8(this.getIndexDirectory(),"claude-mem-index.jsonl")}getTrashDirectory(){return t8(this.getDataDirectory(),"trash")}getBackupsDirectory(){return t8(this.getDataDirectory(),"backups")}getChromaDirectory(){return t8(this.getDataDirectory(),"chroma")}getProjectArchiveDirectory(q){return t8(this.getArchivesDirectory(),q)}getUserSettingsPath(){return t8(this.getDataDirectory(),"settings.json")}getClaudeConfigDirectory(){if(this._claudeConfigDirectory)return this._claudeConfigDirectory;return this._claudeConfigDirectory=process.env.CLAUDE_CONFIG_DIR||t8(A2(),".claude"),this._claudeConfigDirectory}getClaudeSettingsPath(){return t8(this.getClaudeConfigDirectory(),"settings.json")}getClaudeCommandsDirectory(){return t8(this.getClaudeConfigDirectory(),"commands")}getClaudeMdPath(){return t8(this.getClaudeConfigDirectory(),"CLAUDE.md")}getMcpConfigPath(){return t8(A2(),".claude.json")}getProjectMcpConfigPath(){return t8(process.cwd(),".mcp.json")}getPackageRoot(){if(this._packageRoot)return this._packageRoot;try{let j=D6.resolve("/Users/alexnewman/Scripts/claude-mem-source/package.json");return this._packageRoot=Y7(j),this._packageRoot}catch{}let q=xX(import.meta.url),_=Y7(q);for(let j=0;j<10;j++){let K=t8(_,"package.json");if(K3(K))try{if(D6(K).name==="claude-mem")return this._packageRoot=_,this._packageRoot}catch{}let f=Y7(_);if(f===_)break;_=f}try{let j=lX("npm list -g claude-mem --json 2>/dev/null || npm list claude-mem --json 2>/dev/null",{encoding:"utf8"}),K=JSON.parse(j);if(K.dependencies?.["claude-mem"]?.resolved)return this._packageRoot=Y7(K.dependencies["claude-mem"].resolved),this._packageRoot}catch{}throw new Error("Cannot locate claude-mem package root. Ensure claude-mem is properly installed.")}findPackageHooksDirectory(){let q=this.getPackageRoot(),_=t8(q,"hooks"),j=["pre-compact.js","session-start.js"];for(let K of j)if(!K3(t8(_,K)))throw new Error(`Package hooks directory missing required file: ${K}`);return _}findPackageCommandsDirectory(){let q=this.getPackageRoot(),_=t8(q,"commands"),j=["save.md"];for(let K of j)if(!K3(t8(_,K)))throw new Error(`Package commands directory missing required file: ${K}`);return _}ensureDirectory(q){if(!K3(q))D6("fs").mkdirSync(q,{recursive:!0})}ensureDirectories(q){q.forEach((_)=>this.ensureDirectory(_))}ensureAllDataDirectories(){this.ensureDirectories([this.getDataDirectory(),this.getArchivesDirectory(),this.getHooksDirectory(),this.getLogsDirectory(),this.getTrashDirectory(),this.getBackupsDirectory(),this.getChromaDirectory()])}ensureAllClaudeDirectories(){this.ensureDirectories([this.getClaudeConfigDirectory(),this.getClaudeCommandsDirectory()])}static extractProjectName(q){let _=q.split(pX),j=["src","lib","app","project","workspace"];for(let K=_.length-1;K>=0;K--)if(j.includes(_[K])&&K>0)return _[K-1];if(_.length>1)return _[_.length-2];return"unknown-project"}static getCurrentProjectName(){return D6("path").basename(process.cwd())}static createBackupFilename(q){let _=new Date().toISOString().replace(/[:.]/g,"-").replace("T","_").slice(0,19);return`${q}.backup.${_}`}static isPathAccessible(q){try{return K3(q)&&LX(q).isDirectory()}catch{return!1}}static getDataDirectory(){return P8.getInstance().getDataDirectory()}static getArchivesDirectory(){return P8.getInstance().getArchivesDirectory()}static getHooksDirectory(){return P8.getInstance().getHooksDirectory()}static getLogsDirectory(){return P8.getInstance().getLogsDirectory()}static getClaudeSettingsPath(){return P8.getInstance().getClaudeSettingsPath()}static getClaudeMdPath(){return P8.getInstance().getClaudeMdPath()}static findPackageHooksDirectory(){return P8.getInstance().findPackageHooksDirectory()}static findPackageCommandsDirectory(){return P8.getInstance().findPackageCommandsDirectory()}}var DV;var L6=Q8(()=>{DV=P8.getInstance()});class xq{pathDiscovery;constructor(){this.pathDiscovery=P8.getInstance()}getConfigDir(){return this.pathDiscovery.getDataDirectory()}getIndexDir(){return this.pathDiscovery.getIndexDirectory()}getIndexPath(){return this.pathDiscovery.getIndexPath()}getArchiveDir(){return this.pathDiscovery.getArchivesDirectory()}getProjectArchiveDir(q){return this.pathDiscovery.getProjectArchiveDirectory(q)}getLogsDir(){return this.pathDiscovery.getLogsDirectory()}static ensureDirectory(q){P8.getInstance().ensureDirectory(q)}static ensureDirectories(q){P8.getInstance().ensureDirectories(q)}static extractProjectName(q){return P8.extractProjectName(q)}static getCurrentProjectPrefix(){return P8.getCurrentProjectName()}static getCurrentProjectName(){return P8.getCurrentProjectName()}}var G2=Q8(()=>{L6()});function rX(q,_,j,K){let f={projectPrefix:q,sessionId:_,timestamp:j||new Date().toISOString(),archiveFilename:K||`${_}.jsonl.archive`};return cX(f)}function IP(q,_,j,K){let f=rX(j,_,K),Y=`
111
115
 
112
116
  RESPONSE FORMAT:
113
117
  After storing memories in Chroma, return EXACTLY this JSON structure wrapped in tags:
@@ -133,9 +137,9 @@ IMPORTANT:
133
137
  - If tool calls fail, still return the JSON response with summaries
134
138
  - The JSON must be valid and complete
135
139
  - Place NOTHING outside the <JSONResponse> tags
136
- - Do not include any explanatory text before or after the JSON`;return Y+`
140
+ - Do not include any explanatory text before or after the JSON`;return f+`
137
141
 
138
- `+q+f}var VP,mX=`You are analyzing a Claude Code conversation transcript to create memories using the Chroma MCP memory system.
142
+ `+q+Y}var mP,nX=`You are analyzing a Claude Code conversation transcript to create memories using the Chroma MCP memory system.
139
143
 
140
144
  YOUR TASK:
141
145
  1. Extract key learnings and accomplishments as natural language memories
@@ -168,160 +172,160 @@ If any tool calls fail, continue and return the JSON response anyway.
168
172
  Project: {{projectPrefix}}
169
173
  Session ID: {{sessionId}}
170
174
 
171
- Conversation to compress:`,IX;var NP=Q8(()=>{VP=B6(a4(),1),IX=VP.default.compile(mX,{noEscape:!0})});class H2{projectName;constructor(q="claude-mem"){this.projectName=q}createAnalysisPrompt(q){let _=new Date().toISOString();return{prompt:this.buildAnalysisPrompt(q),context:q,type:"analysis",timestamp:_}}createSessionStartPrompt(q){let _=new Date().toISOString();return{message:this.buildSessionStartMessage(q),context:q,type:"session",timestamp:_}}createHookResponse(q){let _=new Date().toISOString();return{...this.buildHookResponse(q),context:q,type:"hook",timestamp:_}}buildAnalysisPrompt(q){let{transcriptContent:_,sessionId:j,projectName:K=this.projectName}=q,Y=K.replace(/[-\s]/g,"_").toLowerCase();return MP(_,j,Y)}buildSessionStartMessage(q){let{sessionId:_,source:j,projectName:K=this.projectName,additionalContext:Y,transcriptPath:f,cwd:P}=q,$=`## Session Started (${j})
175
+ Conversation to compress:`,cX;var gP=Q8(()=>{mP=e6(U4(),1),cX=mP.default.compile(nX,{noEscape:!0})});class u2{projectName;constructor(q="claude-mem"){this.projectName=q}createAnalysisPrompt(q){let _=new Date().toISOString();return{prompt:this.buildAnalysisPrompt(q),context:q,type:"analysis",timestamp:_}}createSessionStartPrompt(q){let _=new Date().toISOString();return{message:this.buildSessionStartMessage(q),context:q,type:"session",timestamp:_}}createHookResponse(q){let _=new Date().toISOString();return{...this.buildHookResponse(q),context:q,type:"hook",timestamp:_}}buildAnalysisPrompt(q){let{transcriptContent:_,sessionId:j,projectName:K=this.projectName}=q,f=K.replace(/[-\s]/g,"_").toLowerCase();return IP(_,j,f)}buildSessionStartMessage(q){let{sessionId:_,source:j,projectName:K=this.projectName,additionalContext:f,transcriptPath:Y,cwd:P}=q,$=`## Session Started (${j})
172
176
 
173
177
  **Project**: ${K}
174
- **Session ID**: ${_} `;if(f)$+=`**Transcript**: ${f} `;if(P)$+=`**Working Directory**: ${P} `;if(Y)$+=`
178
+ **Session ID**: ${_} `;if(Y)$+=`**Transcript**: ${Y} `;if(P)$+=`**Working Directory**: ${P} `;if(f)$+=`
175
179
  ### Additional Context
176
- ${Y}`;return $+=`
180
+ ${f}`;return $+=`
177
181
 
178
- Memory system is active and ready to preserve context across sessions.`,$}buildHookResponse(q){let{hookEventName:_,success:j,message:K,data:Y,shouldContinue:f=j,stopReason:P}=q,$={continue:f,suppressOutput:!1};if(!f&&P)$.stopReason=P;if(_==="SessionStart")$.hookSpecificOutput={hookEventName:"SessionStart",additionalContext:K,...Y};else if(Y)$.hookSpecificOutput=Y;return $}validateAnalysisContext(q){return!!(q.transcriptContent&&q.sessionId)}validateSessionContext(q){return!!(q.sessionId&&q.source)}validateHookContext(q){return!!(q.hookEventName&&q.sessionId&&typeof q.success==="boolean")}getProjectName(){return this.projectName}setProjectName(q){this.projectName=q}}function bP(q,_,j={}){return{transcriptContent:q,sessionId:_,...j}}var SP=Q8(()=>{NP()});var Z_;var EP=Q8(()=>{Z_={COMPRESSION_STARTED:"\uD83D\uDE80 COMPRESSION STARTED",TRANSCRIPT_PATH:(q)=>`\uD83D\uDCC1 Transcript Path: ${q}`,SESSION_ID:(q)=>`\uD83D\uDD0D Session ID: ${q}`,PROJECT_NAME:(q)=>`\uD83D\uDCDD PROJECT NAME: ${q}`,CLAUDE_SDK_CALL:"\uD83E\uDD16 Calling Claude SDK to analyze and populate memory database...",TRANSCRIPT_STATS:(q,_)=>`\uD83D\uDCCA Transcript size: ${q} characters, ${_} messages`,COMPRESSION_COMPLETE:(q)=>`✅ COMPRESSION COMPLETE
179
- Total summaries extracted: ${q}`,CLAUDE_PATH_FOUND:(q)=>`\uD83C\uDFAF Found Claude Code at: ${q}`,MCP_CONFIG_USED:(q)=>`\uD83D\uDCCB Using MCP config: ${q}`}});class RP{level=wK.INFO;setLevel(q){this.level=wK[q]}debug(q,..._){if(this.level<=wK.DEBUG)console.debug(`[DEBUG] ${q}`,..._)}info(q,..._){if(this.level<=wK.INFO)console.info(`[INFO] ${q}`,..._)}warn(q,..._){if(this.level<=wK.WARN)console.warn(`[WARN] ${q}`,..._)}error(q,_,j){if(this.level<=wK.ERROR){if(console.error(`[ERROR] ${q}`),_)console.error(_);if(j)console.error("Context:",j)}}}var wK,a8;var mP=Q8(()=>{wK={DEBUG:0,INFO:1,WARN:2,ERROR:3};a8=new RP});import{readFileSync as yX,existsSync as dX}from"fs";import{join as pX}from"path";function UK(){return IP.getClaudePath()}var IP;var gP=Q8(()=>{J2();IP=class IP{static settingsPath;static cachedSettings=null;static{let q=new Lq;this.settingsPath=pX(q.getConfigDir(),"settings.json")}static readSettings(){if(this.cachedSettings!==null)return this.cachedSettings;try{if(dX(this.settingsPath)){let _=yX(this.settingsPath,"utf-8"),j=JSON.parse(_);return this.cachedSettings=j,j}}catch{}let q={};return this.cachedSettings=q,q}static getSetting(q,_){return this.readSettings()[q]??_}static getClaudePath(){return this.getSetting("claudePath","claude")}static clearCache(){this.cachedSettings=null}}});class k_{static DEFAULT_MAX_TOKENS=28000;static DEFAULT_MAX_BYTES=98000;static DEFAULT_CONTEXT_OVERLAP=2;static CHARS_PER_TOKEN_ESTIMATE=3.5;options;constructor(q={}){this.options={maxTokensPerChunk:q.maxTokensPerChunk??k_.DEFAULT_MAX_TOKENS,maxBytesPerChunk:q.maxBytesPerChunk??k_.DEFAULT_MAX_BYTES,preserveContext:q.preserveContext??!0,contextOverlap:q.contextOverlap??k_.DEFAULT_CONTEXT_OVERLAP,parallel:q.parallel??!1}}estimateTokenCount(q){return Math.ceil(q.length/k_.CHARS_PER_TOKEN_ESTIMATE)}parseFilteredOutput(q){let _=q.split(`
180
- `).filter((K)=>K.trim()),j=[];for(let K of _)if(K.startsWith("- ")){let Y=K.substring(2);j.push({content:Y,estimatedTokens:this.estimateTokenCount(Y)})}return j}chunkTranscript(q){let _=this.parseFilteredOutput(q),j=[],K=[],Y=0,f=0,P=0;for(let $=0;$<_.length;$++){let O=_[$],w=this.formatMessage(O),v=Buffer.byteLength(w,"utf8"),z=O.estimatedTokens;if(K.length>0&&(Y+z>this.options.maxTokensPerChunk||f+v>this.options.maxBytesPerChunk)){let W=this.formatChunk(K);if(j.push({content:W,metadata:{chunkNumber:j.length+1,totalChunks:0,startIndex:P,endIndex:$-1,messageCount:K.length,estimatedTokens:Y,sizeBytes:f,hasOverlap:!1}}),K=[],Y=0,f=0,P=$,this.options.preserveContext&&j.length>0){let J=Math.max(0,$-this.options.contextOverlap);for(let Z=J;Z<$;Z++){let H=_[Z],X=this.formatMessage(H);K.push(H),Y+=H.estimatedTokens,f+=Buffer.byteLength(X,"utf8")}if(K.length>0)P=J}}K.push(O),Y+=z,f+=v}if(K.length>0){let $=this.formatChunk(K);j.push({content:$,metadata:{chunkNumber:j.length+1,totalChunks:0,startIndex:P,endIndex:_.length-1,messageCount:K.length,estimatedTokens:Y,sizeBytes:f,hasOverlap:this.options.preserveContext&&j.length>0}})}return j.forEach(($)=>{$.metadata.totalChunks=j.length}),j}formatMessage(q){return`- ${q.content}`}formatChunk(q){return q.map((_)=>this.formatMessage(_)).join(`
182
+ Memory system is active and ready to preserve context across sessions.`,$}buildHookResponse(q){let{hookEventName:_,success:j,message:K,data:f,shouldContinue:Y=j,stopReason:P}=q,$={continue:Y,suppressOutput:!1};if(!Y&&P)$.stopReason=P;if(_==="SessionStart")$.hookSpecificOutput={hookEventName:"SessionStart",additionalContext:K,...f};else if(f)$.hookSpecificOutput=f;return $}validateAnalysisContext(q){return!!(q.transcriptContent&&q.sessionId)}validateSessionContext(q){return!!(q.sessionId&&q.source)}validateHookContext(q){return!!(q.hookEventName&&q.sessionId&&typeof q.success==="boolean")}getProjectName(){return this.projectName}setProjectName(q){this.projectName=q}}function yP(q,_,j={}){return{transcriptContent:q,sessionId:_,...j}}var dP=Q8(()=>{gP()});var k_;var pP=Q8(()=>{k_={COMPRESSION_STARTED:"\uD83D\uDE80 COMPRESSION STARTED",TRANSCRIPT_PATH:(q)=>`\uD83D\uDCC1 Transcript Path: ${q}`,SESSION_ID:(q)=>`\uD83D\uDD0D Session ID: ${q}`,PROJECT_NAME:(q)=>`\uD83D\uDCDD PROJECT NAME: ${q}`,CLAUDE_SDK_CALL:"\uD83E\uDD16 Calling Claude SDK to analyze and populate memory database...",TRANSCRIPT_STATS:(q,_)=>`\uD83D\uDCCA Transcript size: ${q} characters, ${_} messages`,COMPRESSION_COMPLETE:(q)=>`✅ COMPRESSION COMPLETE
183
+ Total summaries extracted: ${q}`,CLAUDE_PATH_FOUND:(q)=>`\uD83C\uDFAF Found Claude Code at: ${q}`,MCP_CONFIG_USED:(q)=>`\uD83D\uDCCB Using MCP config: ${q}`}});class LP{level=WK.INFO;setLevel(q){this.level=WK[q]}debug(q,..._){if(this.level<=WK.DEBUG)console.debug(`[DEBUG] ${q}`,..._)}info(q,..._){if(this.level<=WK.INFO)console.info(`[INFO] ${q}`,..._)}warn(q,..._){if(this.level<=WK.WARN)console.warn(`[WARN] ${q}`,..._)}error(q,_,j){if(this.level<=WK.ERROR){if(console.error(`[ERROR] ${q}`),_)console.error(_);if(j)console.error("Context:",j)}}}var WK,B8;var lP=Q8(()=>{WK={DEBUG:0,INFO:1,WARN:2,ERROR:3};B8=new LP});import{readFileSync as iX,existsSync as oX}from"fs";import{join as aX}from"path";function X_(){return xP.getClaudePath()}var xP;var h2=Q8(()=>{G2();xP=class xP{static settingsPath;static cachedSettings=null;static{let q=new xq;this.settingsPath=aX(q.getConfigDir(),"settings.json")}static readSettings(){if(this.cachedSettings!==null)return this.cachedSettings;try{if(oX(this.settingsPath)){let _=iX(this.settingsPath,"utf-8"),j=JSON.parse(_);return this.cachedSettings=j,j}}catch{}let q={};return this.cachedSettings=q,q}static getSetting(q,_){return this.readSettings()[q]??_}static getClaudePath(){return this.getSetting("claudePath","claude")}static clearCache(){this.cachedSettings=null}}});class A_{static DEFAULT_MAX_TOKENS=28000;static DEFAULT_MAX_BYTES=98000;static DEFAULT_CONTEXT_OVERLAP=2;static CHARS_PER_TOKEN_ESTIMATE=3.5;options;constructor(q={}){this.options={maxTokensPerChunk:q.maxTokensPerChunk??A_.DEFAULT_MAX_TOKENS,maxBytesPerChunk:q.maxBytesPerChunk??A_.DEFAULT_MAX_BYTES,preserveContext:q.preserveContext??!0,contextOverlap:q.contextOverlap??A_.DEFAULT_CONTEXT_OVERLAP,parallel:q.parallel??!1}}estimateTokenCount(q){return Math.ceil(q.length/A_.CHARS_PER_TOKEN_ESTIMATE)}parseFilteredOutput(q){let _=q.split(`
184
+ `).filter((K)=>K.trim()),j=[];for(let K of _)if(K.startsWith("- ")){let f=K.substring(2);j.push({content:f,estimatedTokens:this.estimateTokenCount(f)})}return j}chunkTranscript(q){let _=this.parseFilteredOutput(q),j=[],K=[],f=0,Y=0,P=0;for(let $=0;$<_.length;$++){let O=_[$],w=this.formatMessage(O),v=Buffer.byteLength(w,"utf8"),z=O.estimatedTokens;if(K.length>0&&(f+z>this.options.maxTokensPerChunk||Y+v>this.options.maxBytesPerChunk)){let W=this.formatChunk(K);if(j.push({content:W,metadata:{chunkNumber:j.length+1,totalChunks:0,startIndex:P,endIndex:$-1,messageCount:K.length,estimatedTokens:f,sizeBytes:Y,hasOverlap:!1}}),K=[],f=0,Y=0,P=$,this.options.preserveContext&&j.length>0){let H=Math.max(0,$-this.options.contextOverlap);for(let Z=H;Z<$;Z++){let J=_[Z],X=this.formatMessage(J);K.push(J),f+=J.estimatedTokens,Y+=Buffer.byteLength(X,"utf8")}if(K.length>0)P=H}}K.push(O),f+=z,Y+=v}if(K.length>0){let $=this.formatChunk(K);j.push({content:$,metadata:{chunkNumber:j.length+1,totalChunks:0,startIndex:P,endIndex:_.length-1,messageCount:K.length,estimatedTokens:f,sizeBytes:Y,hasOverlap:this.options.preserveContext&&j.length>0}})}return j.forEach(($)=>{$.metadata.totalChunks=j.length}),j}formatMessage(q){return`- ${q.content}`}formatChunk(q){return q.map((_)=>this.formatMessage(_)).join(`
181
185
  `)}createChunkHeader(q){let _=[];if(q.firstTimestamp&&q.lastTimestamp)_.push(`# ${q.firstTimestamp} to ${q.lastTimestamp} (chunk ${q.chunkNumber}/${q.totalChunks})`);else _.push(`# Chunk ${q.chunkNumber} of ${q.totalChunks}`);return _.join(`
182
186
  `)+`
183
- `}needsChunking(q){let _=this.estimateTokenCount(q),j=Buffer.byteLength(q,"utf8");return _>this.options.maxTokensPerChunk||j>this.options.maxBytesPerChunk}getChunkingStats(q){let _=q.reduce((Y,f)=>Y+f.metadata.messageCount,0),j=q.reduce((Y,f)=>Y+f.metadata.estimatedTokens,0),K=q.reduce((Y,f)=>Y+f.metadata.sizeBytes,0);return["\uD83D\uDCCA Chunking Statistics:",` • Total chunks: ${q.length}`,` • Total messages: ${_}`,` • Total estimated tokens: ${j.toLocaleString()}`,` • Total size: ${(K/1024).toFixed(1)} KB`,` • Average tokens per chunk: ${Math.round(j/q.length).toLocaleString()}`,` • Average size per chunk: ${(K/q.length/1024).toFixed(1)} KB`].join(`
184
- `)}}var yP={};rq(yP,{TranscriptCompressor:()=>OK});import L6,{createWriteStream as LX}from"fs";import K7,{join as T2}from"path";class OK{paths;logStream=null;logFile=null;promptOrchestrator;chunkManager;constructor(q={}){this.paths=new Lq,this.promptOrchestrator=new H2,this.chunkManager=new k_,this.ensureClaudeMemStructure(),this.initializeLogging(),a8.debug("\uD83E\uDD16 TranscriptCompressor initialized")}ensureClaudeMemStructure(){let q=this.paths.getConfigDir(),_=this.paths.getIndexDir(),j=this.paths.getArchiveDir(),K=this.paths.getLogsDir();Lq.ensureDirectories([q,_,j,K])}initializeLogging(){let q=this.paths.getLogsDir(),_=new Date().toISOString().replace(/[:.]/g,"-");this.logFile=T2(q,`claude-mem-${_}.log`),this.logStream=LX(this.logFile,{flags:"a"}),this.debugLog("\uD83D\uDE80 DEBUG LOG STARTED"),this.debugLog(`\uD83D\uDCC1 Log file: ${this.logFile}`),this.debugLog("═".repeat(60))}debugLog(q){if(!this.logStream)return;let j=`[${new Date().toISOString()}] ${q}
185
- `;this.logStream.write(j)}closeLogging(){if(this.logStream)this.debugLog("✅ DEBUG LOG ENDED"),this.logStream.end()}async compress(q,_,j){this.debugLog(`\uD83D\uDE80 Starting compression for: ${q}`),this.debugLog(`\uD83D\uDCCB Session ID: ${_||"auto-generated"}`);try{let K=j||Lq.getCurrentProjectPrefix();a8.debug(Z_.PROJECT_NAME(K)),this.debugLog(`\uD83D\uDCDD PROJECT PREFIX: ${K}`);let Y=L6.readFileSync(q,"utf-8");this.debugLog(`\uD83D\uDCD6 Reading transcript: ${Y.length} bytes`);let f=Y.trim().split(`
186
- `).filter((X)=>X.trim()),P=[],$=0;for(let X=0;X<f.length;X++)try{let A=JSON.parse(f[X]);P.push(A)}catch(A){$++,a8.debug(`Parse error on line ${X+1}: ${A.message}`)}if(a8.debug(Z_.TRANSCRIPT_STATS(Y.length,P.length)),$>0)a8.debug(`Parse errors: ${$}`);this.debugLog(`\uD83D\uDCCA Transcript loaded: ${f.length} lines, ${P.length} messages, ${$} parse errors`);let O=_||K7.basename(q,".jsonl"),w=new Date().toISOString();for(let X=P.length-1;X>=0;X--){let A=P[X];if(A.timestamp)try{let G=A.timestamp,D;if(typeof G==="string"&&G.includes("T"))D=new Date(G);else{let M=Number(G),g=M<10000000000?M*1000:M;D=new Date(g)}if(!isNaN(D.getTime())){w=D.toISOString(),this.debugLog(`\uD83D\uDCC5 Using timestamp from last message: ${w}`);break}}catch(G){this.debugLog(`⚠️ Invalid timestamp in message: ${A.timestamp}, trying earlier message`)}}let v=`${O}.jsonl.archive`,z=this.formatConversationForPrompt(P),W=this.chunkManager.needsChunking(z),J=[],Z=null;if(W){let X=await this.compressInChunks(P,O,K);J=X.summaries,Z=X.overview}else{let X=bP(z,O,{projectName:K,trigger:"manual"}),A=this.promptOrchestrator.createAnalysisPrompt(X);a8.debug("\uD83D\uDCE4 Analysis prompt created"),a8.debug(`\uD83D\uDCCA Prompt length: ${A.prompt.length} characters`);let G=K7.join(this.paths.getLogsDir(),`claude-prompt-${Date.now()}.txt`);L6.writeFileSync(G,`=== CLAUDE ANALYSIS PROMPT ===
187
+ `}needsChunking(q){let _=this.estimateTokenCount(q),j=Buffer.byteLength(q,"utf8");return _>this.options.maxTokensPerChunk||j>this.options.maxBytesPerChunk}getChunkingStats(q){let _=q.reduce((f,Y)=>f+Y.metadata.messageCount,0),j=q.reduce((f,Y)=>f+Y.metadata.estimatedTokens,0),K=q.reduce((f,Y)=>f+Y.metadata.sizeBytes,0);return["\uD83D\uDCCA Chunking Statistics:",` • Total chunks: ${q.length}`,` • Total messages: ${_}`,` • Total estimated tokens: ${j.toLocaleString()}`,` • Total size: ${(K/1024).toFixed(1)} KB`,` • Average tokens per chunk: ${Math.round(j/q.length).toLocaleString()}`,` • Average size per chunk: ${(K/q.length/1024).toFixed(1)} KB`].join(`
188
+ `)}}var nP={};iq(nP,{TranscriptCompressor:()=>JK});import l6,{createWriteStream as BX}from"fs";import $7,{join as D2}from"path";class JK{paths;logStream=null;logFile=null;promptOrchestrator;chunkManager;constructor(q={}){this.paths=new xq,this.promptOrchestrator=new u2,this.chunkManager=new A_,this.ensureClaudeMemStructure(),this.initializeLogging(),B8.debug("\uD83E\uDD16 TranscriptCompressor initialized")}ensureClaudeMemStructure(){let q=this.paths.getConfigDir(),_=this.paths.getIndexDir(),j=this.paths.getArchiveDir(),K=this.paths.getLogsDir();xq.ensureDirectories([q,_,j,K])}initializeLogging(){let q=this.paths.getLogsDir(),_=new Date().toISOString().replace(/[:.]/g,"-");this.logFile=D2(q,`claude-mem-${_}.log`),this.logStream=BX(this.logFile,{flags:"a"}),this.debugLog("\uD83D\uDE80 DEBUG LOG STARTED"),this.debugLog(`\uD83D\uDCC1 Log file: ${this.logFile}`),this.debugLog("═".repeat(60))}debugLog(q){if(!this.logStream)return;let j=`[${new Date().toISOString()}] ${q}
189
+ `;this.logStream.write(j)}closeLogging(){if(this.logStream)this.debugLog("✅ DEBUG LOG ENDED"),this.logStream.end()}async compress(q,_,j){this.debugLog(`\uD83D\uDE80 Starting compression for: ${q}`),this.debugLog(`\uD83D\uDCCB Session ID: ${_||"auto-generated"}`);try{let K=j||xq.getCurrentProjectPrefix();B8.debug(k_.PROJECT_NAME(K)),this.debugLog(`\uD83D\uDCDD PROJECT PREFIX: ${K}`);let f=l6.readFileSync(q,"utf-8");this.debugLog(`\uD83D\uDCD6 Reading transcript: ${f.length} bytes`);let Y=f.trim().split(`
190
+ `).filter((X)=>X.trim()),P=[],$=0;for(let X=0;X<Y.length;X++)try{let A=JSON.parse(Y[X]);P.push(A)}catch(A){$++,B8.debug(`Parse error on line ${X+1}: ${A.message}`)}if(B8.debug(k_.TRANSCRIPT_STATS(f.length,P.length)),$>0)B8.debug(`Parse errors: ${$}`);this.debugLog(`\uD83D\uDCCA Transcript loaded: ${Y.length} lines, ${P.length} messages, ${$} parse errors`);let O=_||$7.basename(q,".jsonl"),w=new Date().toISOString();for(let X=P.length-1;X>=0;X--){let A=P[X];if(A.timestamp)try{let G=A.timestamp,D;if(typeof G==="string"&&G.includes("T"))D=new Date(G);else{let V=Number(G),m=V<10000000000?V*1000:V;D=new Date(m)}if(!isNaN(D.getTime())){w=D.toISOString(),this.debugLog(`\uD83D\uDCC5 Using timestamp from last message: ${w}`);break}}catch(G){this.debugLog(`⚠️ Invalid timestamp in message: ${A.timestamp}, trying earlier message`)}}let v=`${O}.jsonl.archive`,z=this.formatConversationForPrompt(P),W=this.chunkManager.needsChunking(z),H=[],Z=null;if(W){let X=await this.compressInChunks(P,O,K);H=X.summaries,Z=X.overview}else{let X=yP(z,O,{projectName:K,trigger:"manual"}),A=this.promptOrchestrator.createAnalysisPrompt(X);B8.debug("\uD83D\uDCE4 Analysis prompt created"),B8.debug(`\uD83D\uDCCA Prompt length: ${A.prompt.length} characters`);let G=$7.join(this.paths.getLogsDir(),`claude-prompt-${Date.now()}.txt`);l6.writeFileSync(G,`=== CLAUDE ANALYSIS PROMPT ===
187
191
  ${A.prompt}
188
- `),this.debugLog(`\uD83D\uDCDD Full prompt saved to: ${G}`);let D=UK(),M=this.findMCPConfig();if(a8.debug(Z_.CLAUDE_PATH_FOUND(D)),M)a8.debug(Z_.MCP_CONFIG_USED(M));this.debugLog("\uD83E\uDD16 Calling Claude SDK with MCP tools...");let g=await z2({prompt:A.prompt,options:{allowedTools:["mcp__claude-mem__chroma_list_collections","mcp__claude-mem__chroma_create_collection","mcp__claude-mem__chroma_peek_collection","mcp__claude-mem__chroma_get_collection_info","mcp__claude-mem__chroma_get_collection_count","mcp__claude-mem__chroma_modify_collection","mcp__claude-mem__chroma_fork_collection","mcp__claude-mem__chroma_delete_collection","mcp__claude-mem__chroma_add_documents","mcp__claude-mem__chroma_query_documents","mcp__claude-mem__chroma_get_documents","mcp__claude-mem__chroma_update_documents","mcp__claude-mem__chroma_delete_documents"],pathToClaudeCodeExecutable:UK()}});this.debugLog("✅ Claude SDK response received"),this.debugLog("\uD83D\uDD04 Processing Claude JSON response...");let S=await this.processClaudeResponse(g);if(this.debugLog(`\uD83D\uDCCB Extracted ${S.summaries.length} summaries from JSON`),S.overview)this.debugLog(`\uD83D\uDCDD Overview: ${S.overview}`);J=S.summaries,Z=S.overview}a8.debug(Z_.COMPRESSION_COMPLETE(J.length));let H=this.createArchive(q,K,O,Y);return this.debugLog(`\uD83D\uDCE6 Archive created: ${H}`),this.appendToIndex(J,Z,K,O,P,H,w),this.debugLog(`\uD83D\uDCE5 Written ${J.length} summaries to index`),a8.debug("✅ SUCCESS"),a8.debug(`Archive created: ${H}`),a8.debug(`Summaries created: ${J.length}`),this.debugLog("✅ Compression completed successfully"),this.closeLogging(),H}catch(K){throw a8.error("COMPRESSION FAILED",K,{transcriptPath:q,sessionId:_}),this.debugLog(`❌ ERROR: ${K instanceof Error?K.message:String(K)}`),this.closeLogging(),K}}findMCPConfig(){let q=P8.getInstance();return[q.getProjectMcpConfigPath(),q.getMcpConfigPath(),T2(q.getClaudeConfigDirectory(),".mcp.json")].find(L6.existsSync)||q.getMcpConfigPath()}async processClaudeResponse(q){let _="";_=await this.extractResponseContent(q,[]),this.debugLog(`\uD83D\uDD0D Claude response content length: ${_.length}`);let j=K7.join(this.paths.getLogsDir(),`claude-response-${Date.now()}.txt`);L6.writeFileSync(j,`=== CLAUDE RAW RESPONSE ===
192
+ `),this.debugLog(`\uD83D\uDCDD Full prompt saved to: ${G}`);let D=X_(),V=this.findMCPConfig();if(B8.debug(k_.CLAUDE_PATH_FOUND(D)),V)B8.debug(k_.MCP_CONFIG_USED(V));this.debugLog("\uD83E\uDD16 Calling Claude SDK with MCP tools...");let m=await _3({prompt:A.prompt,options:{allowedTools:["mcp__claude-mem__chroma_list_collections","mcp__claude-mem__chroma_create_collection","mcp__claude-mem__chroma_peek_collection","mcp__claude-mem__chroma_get_collection_info","mcp__claude-mem__chroma_get_collection_count","mcp__claude-mem__chroma_modify_collection","mcp__claude-mem__chroma_fork_collection","mcp__claude-mem__chroma_delete_collection","mcp__claude-mem__chroma_add_documents","mcp__claude-mem__chroma_query_documents","mcp__claude-mem__chroma_get_documents","mcp__claude-mem__chroma_update_documents","mcp__claude-mem__chroma_delete_documents"],pathToClaudeCodeExecutable:X_()}});this.debugLog("✅ Claude SDK response received"),this.debugLog("\uD83D\uDD04 Processing Claude JSON response...");let S=await this.processClaudeResponse(m);if(this.debugLog(`\uD83D\uDCCB Extracted ${S.summaries.length} summaries from JSON`),S.overview)this.debugLog(`\uD83D\uDCDD Overview: ${S.overview}`);H=S.summaries,Z=S.overview}B8.debug(k_.COMPRESSION_COMPLETE(H.length));let J=this.createArchive(q,K,O,f);return this.debugLog(`\uD83D\uDCE6 Archive created: ${J}`),this.appendToIndex(H,Z,K,O,P,J,w),this.debugLog(`\uD83D\uDCE5 Written ${H.length} summaries to index`),B8.debug("✅ SUCCESS"),B8.debug(`Archive created: ${J}`),B8.debug(`Summaries created: ${H.length}`),this.debugLog("✅ Compression completed successfully"),this.closeLogging(),J}catch(K){throw B8.error("COMPRESSION FAILED",K,{transcriptPath:q,sessionId:_}),this.debugLog(`❌ ERROR: ${K instanceof Error?K.message:String(K)}`),this.closeLogging(),K}}findMCPConfig(){let q=P8.getInstance();return[q.getProjectMcpConfigPath(),q.getMcpConfigPath(),D2(q.getClaudeConfigDirectory(),".mcp.json")].find(l6.existsSync)||q.getMcpConfigPath()}async processClaudeResponse(q){let _="";_=await this.extractResponseContent(q,[]),this.debugLog(`\uD83D\uDD0D Claude response content length: ${_.length}`);let j=$7.join(this.paths.getLogsDir(),`claude-response-${Date.now()}.txt`);l6.writeFileSync(j,`=== CLAUDE RAW RESPONSE ===
189
193
  ${_}
190
- `),this.debugLog(`\uD83D\uDCDD Raw response saved to: ${j}`);let K=this.extractJSONResponse(_);if(this.debugLog(`\uD83D\uDCCA Extracted ${K.summaries.length} summaries from JSON`),K.summaries.length===0)this.debugLog("⚠️ No summaries found in JSON response");return K}async extractResponseContent(q,_){if(q&&typeof q==="object"&&Symbol.asyncIterator in q){let j="";for await(let K of q){let Y=this.extractMessageContent(K);if(j+=Y,Y)process.stdout.write(Y);if(K?.type==="result"&&K?.result)j=K.result}return j}if(typeof q==="string")return q;if(Array.isArray(q))return q.map((j)=>{if(typeof j==="string")return j;if(j?.text)return j.text;if(j?.content)return j.content;return""}).filter(Boolean).join(`
191
- `);if(typeof q==="object"&&q!==null){if(q?.text)return q.text;if(q?.content)return q.content;if(q?.message)return q.message;return""}return""}extractMessageContent(q){let _="";if(q?.content)_+=q.content;if(q?.text)_+=q.text;if(q?.data)_+=q.data;if(q?.message?.content&&Array.isArray(q.message.content))q.message.content.forEach((j)=>{if(j.type==="text"&&j.text)_+=j.text});return _}extractJSONResponse(q){try{let _=q.match(/<JSONResponse>([\s\S]*?)<\/JSONResponse>/);if(!_)return this.debugLog("⚠️ No <JSONResponse> tags found in response"),{overview:null,summaries:[]};let j=_[1].trim();this.debugLog(`✅ Found JSON response: ${j.length} chars`);let K=JSON.parse(j);if(!K.summaries||!Array.isArray(K.summaries))return this.debugLog("⚠️ Invalid JSON structure: missing summaries array"),{overview:null,summaries:[]};let Y=[];if(K.summaries.forEach((f,P)=>{if(!f.text||!f.document_id){this.debugLog(`⚠️ Skipping invalid summary at index ${P}`);return}let $={text:f.text,document_id:f.document_id,keywords:f.keywords||"",timestamp:f.timestamp||new Date().toISOString(),archive:f.archive||`${f.document_id}.jsonl.archive`};Y.push($),this.debugLog(`✅ Valid summary ${P+1}: ${f.document_id}`)}),K.overview)this.debugLog(`\uD83D\uDCDD Session overview: ${K.overview}`);return{overview:K.overview||null,summaries:Y}}catch(_){return this.debugLog(`❌ Failed to parse JSON response: ${_}`),this.debugLog("\uD83D\uDD04 Attempting fallback to pipe-separated format..."),{overview:null,summaries:this.extractLegacyPipeSeparatedLines(q).map((Y,f)=>{let P=Y.split(" | ");return{text:P[0]||"",document_id:P[1]||`legacy_${Date.now()}_${f}`,keywords:P[2]||"",timestamp:P[3]||new Date().toISOString(),archive:P[4]||`legacy_${Date.now()}_${f}.jsonl.archive`}})}}}extractLegacyPipeSeparatedLines(q){let _=q.split(`
192
- `),j=[];return _.forEach((K)=>{let Y=K.trim();if(Y&&Y.includes(" | ")&&Y.split(" | ").length>=3)j.push(Y)}),this.debugLog(`\uD83D\uDCCA Fallback extracted ${j.length} pipe-separated lines`),j}async compressInChunks(q,_,j){this.debugLog("\uD83D\uDCE6 Large transcript detected, processing in chunks...");let K=[];q.forEach((w,v)=>{let W=this.extractContent(w).replace(/\r\n/g,"\\n").replace(/\n/g,"\\n").replace(/\r/g,"\\n");K.push(`- ${W}`)});let Y=K.join(`
193
- `),f=this.chunkManager.chunkTranscript(Y);this.debugLog(this.chunkManager.getChunkingStats(f)),console.log(`
194
- \uD83D\uDCCA Processing ${f.length} chunks...`);let P=[],$=[];for(let w=0;w<f.length;w++){let v=f[w];console.log(`
195
- \uD83D\uDD04 Processing chunk ${w+1}/${f.length}...`);let z=`Analyze this chunk (${w+1}/${f.length}) of a larger conversation transcript.
194
+ `),this.debugLog(`\uD83D\uDCDD Raw response saved to: ${j}`);let K=this.extractJSONResponse(_);if(this.debugLog(`\uD83D\uDCCA Extracted ${K.summaries.length} summaries from JSON`),K.summaries.length===0)this.debugLog("⚠️ No summaries found in JSON response");return K}async extractResponseContent(q,_){if(q&&typeof q==="object"&&Symbol.asyncIterator in q){let j="",K=!1;for await(let f of q){let Y=this.extractMessageContent(f);if(j+=Y,Y.includes("<JSONResponse>"))K=!0;if(Y.includes("</JSONResponse>")){K=!1;continue}if(Y&&!K)process.stdout.write(Y);if(f?.type==="result"&&f?.result)j=f.result}return j}if(typeof q==="string")return q;if(Array.isArray(q))return q.map((j)=>{if(typeof j==="string")return j;if(j?.text)return j.text;if(j?.content)return j.content;return""}).filter(Boolean).join(`
195
+ `);if(typeof q==="object"&&q!==null){if(q?.text)return q.text;if(q?.content)return q.content;if(q?.message)return q.message;return""}return""}extractMessageContent(q){let _="";if(q?.content)_+=q.content;if(q?.text)_+=q.text;if(q?.data)_+=q.data;if(q?.message?.content&&Array.isArray(q.message.content))q.message.content.forEach((j)=>{if(j.type==="text"&&j.text)_+=j.text});return _}extractJSONResponse(q){try{let _=q.match(/<JSONResponse>([\s\S]*?)<\/JSONResponse>/);if(!_)return this.debugLog("⚠️ No <JSONResponse> tags found in response"),{overview:null,summaries:[]};let j=_[1].trim();this.debugLog(`✅ Found JSON response: ${j.length} chars`);let K=JSON.parse(j);if(!K.summaries||!Array.isArray(K.summaries))return this.debugLog("⚠️ Invalid JSON structure: missing summaries array"),{overview:null,summaries:[]};let f=[];if(K.summaries.forEach((Y,P)=>{if(!Y.text||!Y.document_id){this.debugLog(`⚠️ Skipping invalid summary at index ${P}`);return}let $={text:Y.text,document_id:Y.document_id,keywords:Y.keywords||"",timestamp:Y.timestamp||new Date().toISOString(),archive:Y.archive||`${Y.document_id}.jsonl.archive`};f.push($),this.debugLog(`✅ Valid summary ${P+1}: ${Y.document_id}`)}),K.overview)this.debugLog(`\uD83D\uDCDD Session overview: ${K.overview}`);return{overview:K.overview||null,summaries:f}}catch(_){return this.debugLog(`❌ Failed to parse JSON response: ${_}`),this.debugLog("\uD83D\uDD04 Attempting fallback to pipe-separated format..."),{overview:null,summaries:this.extractLegacyPipeSeparatedLines(q).map((f,Y)=>{let P=f.split(" | ");return{text:P[0]||"",document_id:P[1]||`legacy_${Date.now()}_${Y}`,keywords:P[2]||"",timestamp:P[3]||new Date().toISOString(),archive:P[4]||`legacy_${Date.now()}_${Y}.jsonl.archive`}})}}}extractLegacyPipeSeparatedLines(q){let _=q.split(`
196
+ `),j=[];return _.forEach((K)=>{let f=K.trim();if(f&&f.includes(" | ")&&f.split(" | ").length>=3)j.push(f)}),this.debugLog(`\uD83D\uDCCA Fallback extracted ${j.length} pipe-separated lines`),j}async compressInChunks(q,_,j){this.debugLog("\uD83D\uDCE6 Large transcript detected, processing in chunks...");let K=[];q.forEach((w,v)=>{let W=this.extractContent(w).replace(/\r\n/g,"\\n").replace(/\n/g,"\\n").replace(/\r/g,"\\n");K.push(`- ${W}`)});let f=K.join(`
197
+ `),Y=this.chunkManager.chunkTranscript(f);this.debugLog(this.chunkManager.getChunkingStats(Y)),console.log(`
198
+ \uD83D\uDCCA Processing ${Y.length} chunks...`);let P=[],$=[];for(let w=0;w<Y.length;w++){let v=Y[w];console.log(`
199
+ \uD83D\uDD04 Processing chunk ${w+1}/${Y.length}...`);let z=`Analyze this chunk (${w+1}/${Y.length}) of a larger conversation transcript.
196
200
 
197
201
  ${v.metadata.hasOverlap?`Note: This chunk includes ${v.metadata.overlapMessages||2} messages from the previous chunk for context continuity.`:""}
198
202
 
199
203
  Chunk contains messages ${v.metadata.startIndex+1} to ${v.metadata.endIndex+1}.
200
204
 
201
- ${v.content}`,W=this.promptOrchestrator.createAnalysisPrompt({transcriptContent:z,sessionId:_,projectName:j,trigger:"manual",originalTokens:v.metadata.estimatedTokens}),J=UK(),Z=this.findMCPConfig();if(Z)a8.debug(Z_.MCP_CONFIG_USED(Z));let H=await z2({prompt:W.prompt,options:{allowedTools:["mcp__claude-mem__chroma_list_collections","mcp__claude-mem__chroma_create_collection","mcp__claude-mem__chroma_peek_collection","mcp__claude-mem__chroma_get_collection_info","mcp__claude-mem__chroma_get_collection_count","mcp__claude-mem__chroma_modify_collection","mcp__claude-mem__chroma_fork_collection","mcp__claude-mem__chroma_delete_collection","mcp__claude-mem__chroma_add_documents","mcp__claude-mem__chroma_query_documents","mcp__claude-mem__chroma_get_documents","mcp__claude-mem__chroma_update_documents","mcp__claude-mem__chroma_delete_documents"],pathToClaudeCodeExecutable:UK()}}),X=await this.extractResponseContent(H,[]),A=this.extractJSONResponse(X);if(A.summaries.length>0)console.log(` ✅ Extracted ${A.summaries.length} memories from chunk ${w+1}`),P.push(...A.summaries);else console.log(` ⚠️ No memories extracted from chunk ${w+1}`);if(A.overview)console.log(` \uD83D\uDCDD Overview extracted from chunk ${w+1}`),$.push(A.overview)}let O=$.length>0?$.join(`
205
+ ${v.content}`,W=this.promptOrchestrator.createAnalysisPrompt({transcriptContent:z,sessionId:_,projectName:j,trigger:"manual",originalTokens:v.metadata.estimatedTokens}),H=X_(),Z=this.findMCPConfig();if(Z)B8.debug(k_.MCP_CONFIG_USED(Z));let J=await _3({prompt:W.prompt,options:{allowedTools:["mcp__claude-mem__chroma_list_collections","mcp__claude-mem__chroma_create_collection","mcp__claude-mem__chroma_peek_collection","mcp__claude-mem__chroma_get_collection_info","mcp__claude-mem__chroma_get_collection_count","mcp__claude-mem__chroma_modify_collection","mcp__claude-mem__chroma_fork_collection","mcp__claude-mem__chroma_delete_collection","mcp__claude-mem__chroma_add_documents","mcp__claude-mem__chroma_query_documents","mcp__claude-mem__chroma_get_documents","mcp__claude-mem__chroma_update_documents","mcp__claude-mem__chroma_delete_documents"],pathToClaudeCodeExecutable:X_()}}),X=await this.extractResponseContent(J,[]),A=this.extractJSONResponse(X);if(A.summaries.length>0)console.log(` ✅ Extracted ${A.summaries.length} memories from chunk ${w+1}`),P.push(...A.summaries);else console.log(` ⚠️ No memories extracted from chunk ${w+1}`);if(A.overview)console.log(` \uD83D\uDCDD Overview extracted from chunk ${w+1}`),$.push(A.overview)}let O=$.length>0?$.join(`
202
206
 
203
- `):null;return{summaries:P,overview:O}}formatConversationForPrompt(q){let _=[];return q.forEach((j,K)=>{let Y=j.type==="assistant"?"assistant":j.type==="user"?"user":j.type==="result"||j.type==="system"||j.type==="summary"?"system":j.message?.role||j.role,f=this.extractContent(j),P=j.session_id||"",$=this.normalizeTimestamp(j),O=j.uuid||"",v=`${f.replace(/\|/g,"\\|")} | ${P} | ${Y} | ${$} | ${O}`;_.push(v)}),a8.debug(`Field filtering complete: ${_.length} messages processed`),`<!-- TRANSCRIPT -->
207
+ `):null;return{summaries:P,overview:O}}formatConversationForPrompt(q){let _=[];return q.forEach((j,K)=>{let f=j.type==="assistant"?"assistant":j.type==="user"?"user":j.type==="result"||j.type==="system"||j.type==="summary"?"system":j.message?.role||j.role,Y=this.extractContent(j),P=j.session_id||"",$=this.normalizeTimestamp(j),O=j.uuid||"",v=`${Y.replace(/\|/g,"\\|")} | ${P} | ${f} | ${$} | ${O}`;_.push(v)}),B8.debug(`Field filtering complete: ${_.length} messages processed`),`<!-- TRANSCRIPT -->
204
208
  ${_.join(`
205
209
  `)}
206
210
  <!-- /TRANSCRIPT -->`}extractContent(q){let _="";if(q.type==="tool_result")return this.extractToolResultContent(q);if(q.type==="assistant"||q.type==="user"){let j=q.message?.content;if(Array.isArray(j))_=j.map((K)=>this.extractContentItem(K)).filter(Boolean).join(" ");else if(j)_=String(j).trim()}else if(q.type==="summary")_=q.summary||"";else if(q.type==="result"){if(q.subtype==="success"&&q.result)_=`[Result: ${q.result}]`;else if(q.subtype==="error_max_turns")_="[Error: Maximum turns reached]";else if(q.subtype==="error_during_execution")_="[Error during execution]"}else if(q.type==="system")if(q.subtype==="init")_=`[System initialized: ${q.model}, tools: ${q.tools?.length||0}, MCP servers: ${q.mcp_servers?.length||0}]`;else _=String(q.content||"").trim();if(!_){if(_=String(q.message?.content||q.content||""),Array.isArray(_))_=_.map((j)=>j.text||j.content||"").filter(Boolean).join(" ")}if(q.toolUseResult){let j=this.summarizeToolResult(q.toolUseResult,_);if(j)_=_?`${_}
207
211
 
208
- ${j}`:j}return String(_).trim()}extractContentItem(q){if(!q||typeof q!=="object")return String(q||"").trim();if(q.type==="text")return q.text||"";else if(q.type==="thinking")return q.thinking||"";else if(q.type==="tool_use"){let _=q.name||"unknown",j=q.id||"";return`[Tool: ${_}${j?` (${j})`:""}]`}else if(q.type==="tool_result"){let _=this.getToolResultSize(q);if(_>1048576)return`[FILTERED: Large tool result ~${Math.round(_/1048576*10)/10}MB - tool output to assistant]`;return this.extractToolResultFromItem(q)}else return q.text||q.content||q.thinking||JSON.stringify(q)}getToolResultSize(q){if(!q.content)return 0;if(Array.isArray(q.content))return q.content.reduce((_,j)=>{return _+(j.text_length||j.text?.length||j.content?.length||0)},0);if(typeof q.content==="string")return q.content.length;return JSON.stringify(q.content).length}extractToolResultContent(q){if(q.content&&Array.isArray(q.content)){let j=q.content.reduce((K,Y)=>{return K+(Y.text_length||Y.text?.length||0)},0);if(j>1048576)return`[FILTERED: Large tool result ~${Math.round(j/1048576*10)/10}MB - tool output to assistant]`;return q.content.map((K)=>this.extractToolResultFromItem(K)).filter(Boolean).join(" ")}if(q.content&&typeof q.content==="string"&&q.content.length>1048576)return`[FILTERED: Large tool result ~${Math.round(q.content.length/1048576*10)/10}MB - tool output to assistant]`;return this.extractToolResultFromItem(q)}extractToolResultFromItem(q){if(q.type==="text"&&q.text)return q.text;if(!q.content)return"[Tool result: no content]";if(Array.isArray(q.content))return q.content.map((_)=>{if(_.type==="text"&&_.text)return _.text;return _.text||_.content||""}).filter(Boolean).join(" ");if(typeof q.content==="string")return q.content;if(typeof q.content==="object")return q.content.text||q.content.content||"[Tool result: complex object]";return String(q.content||"")}createMessageFlowLabel(q,_){if(this.messageContainsToolResult(q))return`Message ${_} (tool → assistant)`;switch(q.type){case"user":return`Message ${_} (user → assistant)`;case"assistant":return`Message ${_} (assistant → user)`;case"system":return`Message ${_} (system)`;case"tool_result":return`Message ${_} (tool → assistant)`;case"summary":return`Message ${_} (session summary)`;case"result":if(q.subtype==="success")return`Message ${_} (session result)`;else if(q.subtype==="error_max_turns")return`Message ${_} (session error: max turns)`;else if(q.subtype==="error_during_execution")return`Message ${_} (session error: execution)`;return`Message ${_} (session result)`;default:return`Message ${_} (${q.type})`}}messageContainsToolResult(q){if(q.type==="user"&&q.message?.content&&Array.isArray(q.message.content))return q.message.content.some((_)=>_.type==="tool_result");if(q.type==="tool_result")return!0;if(q.content&&Array.isArray(q.content))return q.content.some((_)=>_.type==="tool_result");return!1}showFilteredOutput(q,_=!0){let K=L6.readFileSync(q,"utf-8").trim().split(`
209
- `).filter((v)=>v.trim()),Y=[];for(let v of K)try{let z=JSON.parse(v);Y.push(z)}catch(z){continue}let f=[],P=Y.length>0?this.normalizeTimestamp(Y[0]):"",$=Y.length>0?this.normalizeTimestamp(Y[Y.length-1]):"";Y.forEach((v,z)=>{let J=this.extractContent(v).replace(/\r\n/g,"\\n").replace(/\n/g,"\\n").replace(/\r/g,"\\n");f.push(`- ${J}`)});let O=f.join(`
212
+ ${j}`:j}return String(_).trim()}extractContentItem(q){if(!q||typeof q!=="object")return String(q||"").trim();if(q.type==="text")return q.text||"";else if(q.type==="thinking")return q.thinking||"";else if(q.type==="tool_use"){let _=q.name||"unknown",j=q.id||"";return`[Tool: ${_}${j?` (${j})`:""}]`}else if(q.type==="tool_result"){let _=this.getToolResultSize(q);if(_>1048576)return`[FILTERED: Large tool result ~${Math.round(_/1048576*10)/10}MB - tool output to assistant]`;return this.extractToolResultFromItem(q)}else return q.text||q.content||q.thinking||JSON.stringify(q)}getToolResultSize(q){if(!q.content)return 0;if(Array.isArray(q.content))return q.content.reduce((_,j)=>{return _+(j.text_length||j.text?.length||j.content?.length||0)},0);if(typeof q.content==="string")return q.content.length;return JSON.stringify(q.content).length}extractToolResultContent(q){if(q.content&&Array.isArray(q.content)){let j=q.content.reduce((K,f)=>{return K+(f.text_length||f.text?.length||0)},0);if(j>1048576)return`[FILTERED: Large tool result ~${Math.round(j/1048576*10)/10}MB - tool output to assistant]`;return q.content.map((K)=>this.extractToolResultFromItem(K)).filter(Boolean).join(" ")}if(q.content&&typeof q.content==="string"&&q.content.length>1048576)return`[FILTERED: Large tool result ~${Math.round(q.content.length/1048576*10)/10}MB - tool output to assistant]`;return this.extractToolResultFromItem(q)}extractToolResultFromItem(q){if(q.type==="text"&&q.text)return q.text;if(!q.content)return"[Tool result: no content]";if(Array.isArray(q.content))return q.content.map((_)=>{if(_.type==="text"&&_.text)return _.text;return _.text||_.content||""}).filter(Boolean).join(" ");if(typeof q.content==="string")return q.content;if(typeof q.content==="object")return q.content.text||q.content.content||"[Tool result: complex object]";return String(q.content||"")}createMessageFlowLabel(q,_){if(this.messageContainsToolResult(q))return`Message ${_} (tool → assistant)`;switch(q.type){case"user":return`Message ${_} (user → assistant)`;case"assistant":return`Message ${_} (assistant → user)`;case"system":return`Message ${_} (system)`;case"tool_result":return`Message ${_} (tool → assistant)`;case"summary":return`Message ${_} (session summary)`;case"result":if(q.subtype==="success")return`Message ${_} (session result)`;else if(q.subtype==="error_max_turns")return`Message ${_} (session error: max turns)`;else if(q.subtype==="error_during_execution")return`Message ${_} (session error: execution)`;return`Message ${_} (session result)`;default:return`Message ${_} (${q.type})`}}messageContainsToolResult(q){if(q.type==="user"&&q.message?.content&&Array.isArray(q.message.content))return q.message.content.some((_)=>_.type==="tool_result");if(q.type==="tool_result")return!0;if(q.content&&Array.isArray(q.content))return q.content.some((_)=>_.type==="tool_result");return!1}showFilteredOutput(q,_=!0){let K=l6.readFileSync(q,"utf-8").trim().split(`
213
+ `).filter((v)=>v.trim()),f=[];for(let v of K)try{let z=JSON.parse(v);f.push(z)}catch(z){continue}let Y=[],P=f.length>0?this.normalizeTimestamp(f[0]):"",$=f.length>0?this.normalizeTimestamp(f[f.length-1]):"";f.forEach((v,z)=>{let H=this.extractContent(v).replace(/\r\n/g,"\\n").replace(/\n/g,"\\n").replace(/\r/g,"\\n");Y.push(`- ${H}`)});let O=Y.join(`
210
214
  `),w=`/tmp/filtered-transcript-${Date.now()}`;if(_&&this.chunkManager.needsChunking(O)){console.log(`
211
- \uD83D\uDCE6 Large transcript detected, chunking output...`);let v=this.chunkManager.chunkTranscript(O);console.log(this.chunkManager.getChunkingStats(v)),v.forEach((z,W)=>{let J=`${w}-chunk-${W+1}.txt`,Z=z.metadata.startIndex,H=Math.min(z.metadata.endIndex,Y.length-1),X=Y[Z]?this.normalizeTimestamp(Y[Z]):"",A=Y[H]?this.normalizeTimestamp(Y[H]):"";z.metadata.firstTimestamp=X,z.metadata.lastTimestamp=A;let G=this.chunkManager.createChunkHeader(z.metadata)+z.content;L6.writeFileSync(J,G,"utf-8"),console.log(` ✅ Chunk ${W+1}/${v.length} saved to: ${J}`)}),console.log(`Processed ${Y.length} messages from transcript into ${v.length} chunks`),console.log(`\uD83D\uDCC5 Time range: ${P} to ${$}`)}else{let v=`${w}.txt`,z=`# ${P} to ${$}
212
- ${O}`;L6.writeFileSync(v,z,"utf-8"),console.log(`
213
- Filtered output saved to: ${v}`),console.log(`Processed ${Y.length} messages from transcript`),console.log(`\uD83D\uDCC5 Time range: ${P} to ${$}`)}}summarizeToolResult(q,_){let j=[];if(q.stdout){let K=String(q.stdout);if(K.length>200){let Y=K.split(`
214
- `).length,f=K.length,P=K.split(`
215
+ \uD83D\uDCE6 Large transcript detected, chunking output...`);let v=this.chunkManager.chunkTranscript(O);console.log(this.chunkManager.getChunkingStats(v)),v.forEach((z,W)=>{let H=`${w}-chunk-${W+1}.txt`,Z=z.metadata.startIndex,J=Math.min(z.metadata.endIndex,f.length-1),X=f[Z]?this.normalizeTimestamp(f[Z]):"",A=f[J]?this.normalizeTimestamp(f[J]):"";z.metadata.firstTimestamp=X,z.metadata.lastTimestamp=A;let G=this.chunkManager.createChunkHeader(z.metadata)+z.content;l6.writeFileSync(H,G,"utf-8"),console.log(` ✅ Chunk ${W+1}/${v.length} saved to: ${H}`)}),console.log(`Processed ${f.length} messages from transcript into ${v.length} chunks`),console.log(`\uD83D\uDCC5 Time range: ${P} to ${$}`)}else{let v=`${w}.txt`,z=`# ${P} to ${$}
216
+ ${O}`;l6.writeFileSync(v,z,"utf-8"),console.log(`
217
+ Filtered output saved to: ${v}`),console.log(`Processed ${f.length} messages from transcript`),console.log(`\uD83D\uDCC5 Time range: ${P} to ${$}`)}}summarizeToolResult(q,_){let j=[];if(q.stdout){let K=String(q.stdout);if(K.length>200){let f=K.split(`
218
+ `).length,Y=K.length,P=K.split(`
215
219
  `),$=P.slice(0,3).join(`
216
220
  `),O=P.length>6?`
217
221
  ...
218
222
  ${P.slice(-2).join(`
219
- `)}`:"";j.push(`Result: ${$}${O} (${Y} lines, ${f} chars)`)}else j.push(`Result: ${K}`)}if(q.stderr&&q.stderr.trim())j.push(`Error: ${q.stderr}`);if(q.interrupted)j.push("(interrupted)");if(q.isImage)j.push("(image output)");return j.join(`
220
- `)}normalizeTimestamp(q){let _=q.timestamp||q.message?.timestamp||q.created_at||q.message?.created_at;if(!_)return"";try{let j=new Date(_);if(isNaN(j.getTime()))return"";return j.toISOString().replace("T"," ")}catch(j){return a8.debug(`Invalid timestamp format: ${_}`),""}}createArchive(q,_,j,K){let Y=this.paths.getProjectArchiveDir(_);Lq.ensureDirectory(Y);let f=T2(Y,`${j}.jsonl.archive`);return L6.writeFileSync(f,K),a8.debug(`\uD83D\uDCE6 Created archive: ${f}`),f}appendToIndex(q,_,j,K,Y,f,P){let $=this.paths.getIndexPath(),O=this.paths.getConfigDir();Lq.ensureDirectory(O);let w={type:"session",session_id:K,timestamp:P,project:j};if(L6.appendFileSync($,JSON.stringify(w)+`
221
- `),_){let v={type:"overview",content:_,session_id:K,project:j,timestamp:P};L6.appendFileSync($,JSON.stringify(v)+`
222
- `)}if(!q||q.length===0){a8.debug("\uD83D\uDCDD No summaries extracted from JSON response");let v={type:"diagnostic",message:"NO SUMMARIES EXTRACTED - Check logs for valid JSON response",session_id:K,project:j,timestamp:P};L6.appendFileSync($,JSON.stringify(v)+`
223
- `),this.debugLog(`⚠️ No summaries for session ${K} - Check if Claude returned valid JSON in <JSONResponse> tags`)}else q.forEach((v)=>{let z={type:"memory",text:v.text,document_id:v.document_id,keywords:v.keywords,session_id:K,project:j,timestamp:v.timestamp||P,archive:K7.basename(f)};L6.appendFileSync($,JSON.stringify(z)+`
224
- `)}),a8.debug(`\uD83D\uDCDD Appended ${q.length} summaries to index as JSONL`);a8.debug(`Index path: ${$}`)}}var j7=Q8(()=>{hP();J2();p6();SP();EP();mP();gP()});var pP={};rq(pP,{compress:()=>vK});import{basename as dP}from"path";async function vK(q,_={}){if(console.log(E1("compressing")),!q){console.log(i_("Compression","No transcript file provided","Please provide a path to a transcript file"));return}try{let j=Date.now(),{TranscriptCompressor:K}=await Promise.resolve().then(() => (j7(),yP)),Y=new K({verbose:_.verbose||!1}),f=_.sessionId||dP(q,".jsonl"),P=await Y.compress(q,f),$=Date.now()-j;console.log(a3("Compression",void 0,`Session archived as ${dP(P)}`)),console.log(m1("compress",{count:1,duration:$,details:`Session: ${f}`}))}catch(j){let K=j instanceof Error?j.message:String(j);throw console.log(i_("Compression",K,"Check that the transcript file exists and you have write permissions")),j}}var P7=Q8(()=>{e4()});var k2=q8((rV,LP)=>{var Z2={to(q,_){if(!_)return`\x1B[${q+1}G`;return`\x1B[${_+1};${q+1}H`},move(q,_){let j="";if(q<0)j+=`\x1B[${-q}D`;else if(q>0)j+=`\x1B[${q}C`;if(_<0)j+=`\x1B[${-_}A`;else if(_>0)j+=`\x1B[${_}B`;return j},up:(q=1)=>`\x1B[${q}A`,down:(q=1)=>`\x1B[${q}B`,forward:(q=1)=>`\x1B[${q}C`,backward:(q=1)=>`\x1B[${q}D`,nextLine:(q=1)=>"\x1B[E".repeat(q),prevLine:(q=1)=>"\x1B[F".repeat(q),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},lX={up:(q=1)=>"\x1B[S".repeat(q),down:(q=1)=>"\x1B[T".repeat(q)},xX={screen:"\x1B[2J",up:(q=1)=>"\x1B[1J".repeat(q),down:(q=1)=>"\x1B[J".repeat(q),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(q){let _="";for(let j=0;j<q;j++)_+=this.line+(j<q-1?Z2.up():"");if(q)_+=Z2.left;return _}};LP.exports={cursor:Z2,scroll:lX,erase:xX,beep:"\x07"}});var A2=q8((iV,X2)=>{var f7=process||{},lP=f7.argv||[],Y7=f7.env||{},nX=!(!!Y7.NO_COLOR||lP.includes("--no-color"))&&(!!Y7.FORCE_COLOR||lP.includes("--color")||f7.platform==="win32"||(f7.stdout||{}).isTTY&&Y7.TERM!=="dumb"||!!Y7.CI),cX=(q,_,j=q)=>(K)=>{let Y=""+K,f=Y.indexOf(_,q.length);return~f?q+rX(Y,_,j,f)+_:q+Y+_},rX=(q,_,j,K)=>{let Y="",f=0;do Y+=q.substring(f,K)+j,f=K+_.length,K=q.indexOf(_,f);while(~K);return Y+q.substring(f)},xP=(q=nX)=>{let _=q?cX:()=>String;return{isColorSupported:q,reset:_("\x1B[0m","\x1B[0m"),bold:_("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:_("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:_("\x1B[3m","\x1B[23m"),underline:_("\x1B[4m","\x1B[24m"),inverse:_("\x1B[7m","\x1B[27m"),hidden:_("\x1B[8m","\x1B[28m"),strikethrough:_("\x1B[9m","\x1B[29m"),black:_("\x1B[30m","\x1B[39m"),red:_("\x1B[31m","\x1B[39m"),green:_("\x1B[32m","\x1B[39m"),yellow:_("\x1B[33m","\x1B[39m"),blue:_("\x1B[34m","\x1B[39m"),magenta:_("\x1B[35m","\x1B[39m"),cyan:_("\x1B[36m","\x1B[39m"),white:_("\x1B[37m","\x1B[39m"),gray:_("\x1B[90m","\x1B[39m"),bgBlack:_("\x1B[40m","\x1B[49m"),bgRed:_("\x1B[41m","\x1B[49m"),bgGreen:_("\x1B[42m","\x1B[49m"),bgYellow:_("\x1B[43m","\x1B[49m"),bgBlue:_("\x1B[44m","\x1B[49m"),bgMagenta:_("\x1B[45m","\x1B[49m"),bgCyan:_("\x1B[46m","\x1B[49m"),bgWhite:_("\x1B[47m","\x1B[49m"),blackBright:_("\x1B[90m","\x1B[39m"),redBright:_("\x1B[91m","\x1B[39m"),greenBright:_("\x1B[92m","\x1B[39m"),yellowBright:_("\x1B[93m","\x1B[39m"),blueBright:_("\x1B[94m","\x1B[39m"),magentaBright:_("\x1B[95m","\x1B[39m"),cyanBright:_("\x1B[96m","\x1B[39m"),whiteBright:_("\x1B[97m","\x1B[39m"),bgBlackBright:_("\x1B[100m","\x1B[49m"),bgRedBright:_("\x1B[101m","\x1B[49m"),bgGreenBright:_("\x1B[102m","\x1B[49m"),bgYellowBright:_("\x1B[103m","\x1B[49m"),bgBlueBright:_("\x1B[104m","\x1B[49m"),bgMagentaBright:_("\x1B[105m","\x1B[49m"),bgCyanBright:_("\x1B[106m","\x1B[49m"),bgWhiteBright:_("\x1B[107m","\x1B[49m")}};X2.exports=xP();X2.exports.createColors=xP});import{stdin as FP,stdout as UP}from"node:process";import*as Fq from"node:readline";import nP from"node:readline";import{Writable as iX}from"node:stream";function oX({onlyFirst:q=!1}={}){let _=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(_,q?void 0:"g")}function QP(q){if(typeof q!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(aX,"")}function qY(q){return q&&q.__esModule&&Object.prototype.hasOwnProperty.call(q,"default")?q.default:q}function sK(q,_={}){if(typeof q!="string"||q.length===0||(_={ambiguousIsNarrow:!0,..._},q=QP(q),q.length===0))return 0;q=q.replace(FX()," ");let j=_.ambiguousIsNarrow?1:2,K=0;for(let Y of q){let f=Y.codePointAt(0);if(f<=31||f>=127&&f<=159||f>=768&&f<=879)continue;switch(tX.eastAsianWidth(Y)){case"F":case"W":K+=2;break;case"A":K+=j;break;default:K+=1}}return K}function QX(){let q=new Map;for(let[_,j]of Object.entries(p8)){for(let[K,Y]of Object.entries(j))p8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=p8[K],q.set(Y[0],Y[1]);Object.defineProperty(p8,_,{value:j,enumerable:!1})}return Object.defineProperty(p8,"codes",{value:q,enumerable:!1}),p8.color.close="\x1B[39m",p8.bgColor.close="\x1B[49m",p8.color.ansi=cP(),p8.color.ansi256=rP(),p8.color.ansi16m=iP(),p8.bgColor.ansi=cP(G2),p8.bgColor.ansi256=rP(G2),p8.bgColor.ansi16m=iP(G2),Object.defineProperties(p8,{rgbToAnsi256:{value:(_,j,K)=>_===j&&j===K?_<8?16:_>248?231:Math.round((_-8)/247*24)+232:16+36*Math.round(_/255*5)+6*Math.round(j/255*5)+Math.round(K/255*5),enumerable:!1},hexToRgb:{value:(_)=>{let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;K.length===3&&(K=[...K].map((f)=>f+f).join(""));let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>p8.rgbToAnsi256(...p8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value:(_)=>{if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));return f===2&&(P+=60),P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>p8.ansi256ToAnsi(p8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>p8.ansi256ToAnsi(p8.hexToAnsi256(_)),enumerable:!1}}),p8}function BP(q,_,j){return String(q).normalize().replace(/\r\n/g,`
223
+ `)}`:"";j.push(`Result: ${$}${O} (${f} lines, ${Y} chars)`)}else j.push(`Result: ${K}`)}if(q.stderr&&q.stderr.trim())j.push(`Error: ${q.stderr}`);if(q.interrupted)j.push("(interrupted)");if(q.isImage)j.push("(image output)");return j.join(`
224
+ `)}normalizeTimestamp(q){let _=q.timestamp||q.message?.timestamp||q.created_at||q.message?.created_at;if(!_)return"";try{let j=new Date(_);if(isNaN(j.getTime()))return"";return j.toISOString().replace("T"," ")}catch(j){return B8.debug(`Invalid timestamp format: ${_}`),""}}createArchive(q,_,j,K){let f=this.paths.getProjectArchiveDir(_);xq.ensureDirectory(f);let Y=D2(f,`${j}.jsonl.archive`);return l6.writeFileSync(Y,K),B8.debug(`\uD83D\uDCE6 Created archive: ${Y}`),Y}appendToIndex(q,_,j,K,f,Y,P){let $=this.paths.getIndexPath(),O=this.paths.getConfigDir();xq.ensureDirectory(O);let w={type:"session",session_id:K,timestamp:P,project:j};if(l6.appendFileSync($,JSON.stringify(w)+`
225
+ `),_){let v={type:"overview",content:_,session_id:K,project:j,timestamp:P};l6.appendFileSync($,JSON.stringify(v)+`
226
+ `)}if(!q||q.length===0){B8.debug("\uD83D\uDCDD No summaries extracted from JSON response");let v={type:"diagnostic",message:"NO SUMMARIES EXTRACTED - Check logs for valid JSON response",session_id:K,project:j,timestamp:P};l6.appendFileSync($,JSON.stringify(v)+`
227
+ `),this.debugLog(`⚠️ No summaries for session ${K} - Check if Claude returned valid JSON in <JSONResponse> tags`)}else q.forEach((v)=>{let z={type:"memory",text:v.text,document_id:v.document_id,keywords:v.keywords,session_id:K,project:j,timestamp:v.timestamp||P,archive:$7.basename(Y)};l6.appendFileSync($,JSON.stringify(z)+`
228
+ `)}),B8.debug(`\uD83D\uDCDD Appended ${q.length} summaries to index as JSONL`);B8.debug(`Index path: ${$}`)}}var w7=Q8(()=>{X2();G2();L6();dP();pP();lP();h2()});var rP={};iq(rP,{compress:()=>HK});import{basename as cP}from"path";async function HK(q,_={}){if(console.log(L1("compressing")),!q){console.log(t_("Compression","No transcript file provided","Please provide a path to a transcript file"));return}try{let j=Date.now(),{TranscriptCompressor:K}=await Promise.resolve().then(() => (w7(),nP)),f=new K({verbose:_.verbose||!1}),Y=_.sessionId||cP(q,".jsonl"),P=await f.compress(q,Y),$=Date.now()-j;console.log(U3("Compression",void 0,`Session archived as ${cP(P)}`)),console.log(x1("compress",{count:1,duration:$,details:`Session: ${Y}`}))}catch(j){let K=j instanceof Error?j.message:String(j);throw console.log(t_("Compression",K,"Check that the transcript file exists and you have write permissions")),j}}var O7=Q8(()=>{K2()});var V2=q8((qM,iP)=>{var C2={to(q,_){if(!_)return`\x1B[${q+1}G`;return`\x1B[${_+1};${q+1}H`},move(q,_){let j="";if(q<0)j+=`\x1B[${-q}D`;else if(q>0)j+=`\x1B[${q}C`;if(_<0)j+=`\x1B[${-_}A`;else if(_>0)j+=`\x1B[${_}B`;return j},up:(q=1)=>`\x1B[${q}A`,down:(q=1)=>`\x1B[${q}B`,forward:(q=1)=>`\x1B[${q}C`,backward:(q=1)=>`\x1B[${q}D`,nextLine:(q=1)=>"\x1B[E".repeat(q),prevLine:(q=1)=>"\x1B[F".repeat(q),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},tX={up:(q=1)=>"\x1B[S".repeat(q),down:(q=1)=>"\x1B[T".repeat(q)},eX={screen:"\x1B[2J",up:(q=1)=>"\x1B[1J".repeat(q),down:(q=1)=>"\x1B[J".repeat(q),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(q){let _="";for(let j=0;j<q;j++)_+=this.line+(j<q-1?C2.up():"");if(q)_+=C2.left;return _}};iP.exports={cursor:C2,scroll:tX,erase:eX,beep:"\x07"}});var N2=q8((_M,M2)=>{var z7=process||{},oP=z7.argv||[],v7=z7.env||{},FX=!(!!v7.NO_COLOR||oP.includes("--no-color"))&&(!!v7.FORCE_COLOR||oP.includes("--color")||z7.platform==="win32"||(z7.stdout||{}).isTTY&&v7.TERM!=="dumb"||!!v7.CI),UX=(q,_,j=q)=>(K)=>{let f=""+K,Y=f.indexOf(_,q.length);return~Y?q+sX(f,_,j,Y)+_:q+f+_},sX=(q,_,j,K)=>{let f="",Y=0;do f+=q.substring(Y,K)+j,Y=K+_.length,K=q.indexOf(_,Y);while(~K);return f+q.substring(Y)},aP=(q=FX)=>{let _=q?UX:()=>String;return{isColorSupported:q,reset:_("\x1B[0m","\x1B[0m"),bold:_("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:_("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:_("\x1B[3m","\x1B[23m"),underline:_("\x1B[4m","\x1B[24m"),inverse:_("\x1B[7m","\x1B[27m"),hidden:_("\x1B[8m","\x1B[28m"),strikethrough:_("\x1B[9m","\x1B[29m"),black:_("\x1B[30m","\x1B[39m"),red:_("\x1B[31m","\x1B[39m"),green:_("\x1B[32m","\x1B[39m"),yellow:_("\x1B[33m","\x1B[39m"),blue:_("\x1B[34m","\x1B[39m"),magenta:_("\x1B[35m","\x1B[39m"),cyan:_("\x1B[36m","\x1B[39m"),white:_("\x1B[37m","\x1B[39m"),gray:_("\x1B[90m","\x1B[39m"),bgBlack:_("\x1B[40m","\x1B[49m"),bgRed:_("\x1B[41m","\x1B[49m"),bgGreen:_("\x1B[42m","\x1B[49m"),bgYellow:_("\x1B[43m","\x1B[49m"),bgBlue:_("\x1B[44m","\x1B[49m"),bgMagenta:_("\x1B[45m","\x1B[49m"),bgCyan:_("\x1B[46m","\x1B[49m"),bgWhite:_("\x1B[47m","\x1B[49m"),blackBright:_("\x1B[90m","\x1B[39m"),redBright:_("\x1B[91m","\x1B[39m"),greenBright:_("\x1B[92m","\x1B[39m"),yellowBright:_("\x1B[93m","\x1B[39m"),blueBright:_("\x1B[94m","\x1B[39m"),magentaBright:_("\x1B[95m","\x1B[39m"),cyanBright:_("\x1B[96m","\x1B[39m"),whiteBright:_("\x1B[97m","\x1B[39m"),bgBlackBright:_("\x1B[100m","\x1B[49m"),bgRedBright:_("\x1B[101m","\x1B[49m"),bgGreenBright:_("\x1B[102m","\x1B[49m"),bgYellowBright:_("\x1B[103m","\x1B[49m"),bgBlueBright:_("\x1B[104m","\x1B[49m"),bgMagentaBright:_("\x1B[105m","\x1B[49m"),bgCyanBright:_("\x1B[106m","\x1B[49m"),bgWhiteBright:_("\x1B[107m","\x1B[49m")}};M2.exports=aP();M2.exports.createColors=aP});import{stdin as Kf,stdout as jf}from"node:process";import*as Uq from"node:readline";import BP from"node:readline";import{Writable as QX}from"node:stream";function qA({onlyFirst:q=!1}={}){let _=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(_,q?void 0:"g")}function ff(q){if(typeof q!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(_A,"")}function Yf(q){return q&&q.__esModule&&Object.prototype.hasOwnProperty.call(q,"default")?q.default:q}function j3(q,_={}){if(typeof q!="string"||q.length===0||(_={ambiguousIsNarrow:!0,..._},q=ff(q),q.length===0))return 0;q=q.replace(fA()," ");let j=_.ambiguousIsNarrow?1:2,K=0;for(let f of q){let Y=f.codePointAt(0);if(Y<=31||Y>=127&&Y<=159||Y>=768&&Y<=879)continue;switch(jA.eastAsianWidth(f)){case"F":case"W":K+=2;break;case"A":K+=j;break;default:K+=1}}return K}function wA(){let q=new Map;for(let[_,j]of Object.entries(p8)){for(let[K,f]of Object.entries(j))p8[K]={open:`\x1B[${f[0]}m`,close:`\x1B[${f[1]}m`},j[K]=p8[K],q.set(f[0],f[1]);Object.defineProperty(p8,_,{value:j,enumerable:!1})}return Object.defineProperty(p8,"codes",{value:q,enumerable:!1}),p8.color.close="\x1B[39m",p8.bgColor.close="\x1B[49m",p8.color.ansi=tP(),p8.color.ansi256=eP(),p8.color.ansi16m=FP(),p8.bgColor.ansi=tP(b2),p8.bgColor.ansi256=eP(b2),p8.bgColor.ansi16m=FP(b2),Object.defineProperties(p8,{rgbToAnsi256:{value:(_,j,K)=>_===j&&j===K?_<8?16:_>248?231:Math.round((_-8)/247*24)+232:16+36*Math.round(_/255*5)+6*Math.round(j/255*5)+Math.round(K/255*5),enumerable:!1},hexToRgb:{value:(_)=>{let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;K.length===3&&(K=[...K].map((Y)=>Y+Y).join(""));let f=Number.parseInt(K,16);return[f>>16&255,f>>8&255,f&255]},enumerable:!1},hexToAnsi256:{value:(_)=>p8.rgbToAnsi256(...p8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value:(_)=>{if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,f;if(_>=232)j=((_-232)*10+8)/255,K=j,f=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,f=$%6/5}let Y=Math.max(j,K,f)*2;if(Y===0)return 30;let P=30+(Math.round(f)<<2|Math.round(K)<<1|Math.round(j));return Y===2&&(P+=60),P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>p8.ansi256ToAnsi(p8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>p8.ansi256ToAnsi(p8.hexToAnsi256(_)),enumerable:!1}}),p8}function QP(q,_,j){return String(q).normalize().replace(/\r\n/g,`
225
229
  `).split(`
226
- `).map((K)=>YA(K,_,j)).join(`
227
- `)}function V2(q,_){if(typeof q=="string")return w7.aliases.get(q)===_;for(let j of q)if(j!==void 0&&V2(j,_))return!0;return!1}function $A(q,_){if(q===_)return;let j=q.split(`
230
+ `).map((K)=>HA(K,_,j)).join(`
231
+ `)}function I2(q,_){if(typeof q=="string")return J7.aliases.get(q)===_;for(let j of q)if(j!==void 0&&I2(j,_))return!0;return!1}function ZA(q,_){if(q===_)return;let j=q.split(`
228
232
  `),K=_.split(`
229
- `),Y=[];for(let f=0;f<Math.max(j.length,K.length);f++)j[f]!==K[f]&&Y.push(f);return Y}function t8(q){return q===h2}function $7(q,_){let j=q;j.isTTY&&j.setRawMode(_)}function PY({input:q=FP,output:_=UP,overwrite:j=!0,hideCursor:K=!0}={}){let Y=Fq.createInterface({input:q,output:_,prompt:"",tabSize:1});Fq.emitKeypressEvents(q,Y),q.isTTY&&q.setRawMode(!0);let f=(P,{name:$,sequence:O})=>{let w=String(P);if(V2([w,$,O],"cancel")){K&&_.write(k6.cursor.show),process.exit(0);return}if(!j)return;Fq.moveCursor(_,$==="return"?0:-1,$==="return"?-1:0,()=>{Fq.clearLine(_,1,()=>{q.once("keypress",f)})})};return K&&_.write(k6.cursor.hide),q.once("keypress",f),()=>{q.off("keypress",f),K&&_.write(k6.cursor.show),q.isTTY&&!wA&&q.setRawMode(!1),Y.terminal=!1,Y.close()}}class QK{constructor(q,_=!0){l6(this,"input"),l6(this,"output"),l6(this,"_abortSignal"),l6(this,"rl"),l6(this,"opts"),l6(this,"_render"),l6(this,"_track",!1),l6(this,"_prevFrame",""),l6(this,"_subscribers",new Map),l6(this,"_cursor",0),l6(this,"state","initial"),l6(this,"error",""),l6(this,"value");let{input:j=FP,output:K=UP,render:Y,signal:f,...P}=q;this.opts=P,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=Y.bind(this),this._track=_,this._abortSignal=f,this.input=j,this.output=K}unsubscribe(){this._subscribers.clear()}setSubscriber(q,_){let j=this._subscribers.get(q)??[];j.push(_),this._subscribers.set(q,j)}on(q,_){this.setSubscriber(q,{cb:_})}once(q,_){this.setSubscriber(q,{cb:_,once:!0})}emit(q,..._){let j=this._subscribers.get(q)??[],K=[];for(let Y of j)Y.cb(..._),Y.once&&K.push(()=>j.splice(j.indexOf(Y),1));for(let Y of K)Y()}prompt(){return new Promise((q,_)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),q(h2);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let j=new iX;j._write=(K,Y,f)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),f()},this.input.pipe(j),this.rl=nP.createInterface({input:this.input,output:j,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),nP.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),$7(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(k6.cursor.show),this.output.off("resize",this.render),$7(this.input,!1),q(this.value)}),this.once("cancel",()=>{this.output.write(k6.cursor.show),this.output.off("resize",this.render),$7(this.input,!1),q(h2)})})}onKeypress(q,_){if(this.state==="error"&&(this.state="active"),_?.name&&(!this._track&&w7.aliases.has(_.name)&&this.emit("cursor",w7.aliases.get(_.name)),w7.actions.has(_.name)&&this.emit("cursor",_.name)),q&&(q.toLowerCase()==="y"||q.toLowerCase()==="n")&&this.emit("confirm",q.toLowerCase()==="y"),q==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),q&&this.emit("key",q.toLowerCase()),_?.name==="return"){if(this.opts.validate){let j=this.opts.validate(this.value);j&&(this.error=j instanceof Error?j.message:j,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}V2([q,_?.name,_?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
230
- `),$7(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let q=BP(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
231
- `).length-1;this.output.write(k6.cursor.move(-999,q*-1))}render(){let q=BP(this._render(this)??"",process.stdout.columns,{hard:!0});if(q!==this._prevFrame){if(this.state==="initial")this.output.write(k6.cursor.hide);else{let _=$A(this._prevFrame,q);if(this.restoreCursor(),_&&_?.length===1){let j=_[0];this.output.write(k6.cursor.move(0,j)),this.output.write(k6.erase.lines(1));let K=q.split(`
232
- `);this.output.write(K[j]),this._prevFrame=q,this.output.write(k6.cursor.move(0,K.length-j-1));return}if(_&&_?.length>1){let j=_[0];this.output.write(k6.cursor.move(0,j)),this.output.write(k6.erase.down());let K=q.split(`
233
+ `),f=[];for(let Y=0;Y<Math.max(j.length,K.length);Y++)j[Y]!==K[Y]&&f.push(Y);return f}function L8(q){return q===E2}function W7(q,_){let j=q;j.isTTY&&j.setRawMode(_)}function vf({input:q=Kf,output:_=jf,overwrite:j=!0,hideCursor:K=!0}={}){let f=Uq.createInterface({input:q,output:_,prompt:"",tabSize:1});Uq.emitKeypressEvents(q,f),q.isTTY&&q.setRawMode(!0);let Y=(P,{name:$,sequence:O})=>{let w=String(P);if(I2([w,$,O],"cancel")){K&&_.write(A6.cursor.show),process.exit(0);return}if(!j)return;Uq.moveCursor(_,$==="return"?0:-1,$==="return"?-1:0,()=>{Uq.clearLine(_,1,()=>{q.once("keypress",Y)})})};return K&&_.write(A6.cursor.hide),q.once("keypress",Y),()=>{q.off("keypress",Y),K&&_.write(A6.cursor.show),q.isTTY&&!kA&&q.setRawMode(!1),f.terminal=!1,f.close()}}class P3{constructor(q,_=!0){x6(this,"input"),x6(this,"output"),x6(this,"_abortSignal"),x6(this,"rl"),x6(this,"opts"),x6(this,"_render"),x6(this,"_track",!1),x6(this,"_prevFrame",""),x6(this,"_subscribers",new Map),x6(this,"_cursor",0),x6(this,"state","initial"),x6(this,"error",""),x6(this,"value");let{input:j=Kf,output:K=jf,render:f,signal:Y,...P}=q;this.opts=P,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=f.bind(this),this._track=_,this._abortSignal=Y,this.input=j,this.output=K}unsubscribe(){this._subscribers.clear()}setSubscriber(q,_){let j=this._subscribers.get(q)??[];j.push(_),this._subscribers.set(q,j)}on(q,_){this.setSubscriber(q,{cb:_})}once(q,_){this.setSubscriber(q,{cb:_,once:!0})}emit(q,..._){let j=this._subscribers.get(q)??[],K=[];for(let f of j)f.cb(..._),f.once&&K.push(()=>j.splice(j.indexOf(f),1));for(let f of K)f()}prompt(){return new Promise((q,_)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),q(E2);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let j=new QX;j._write=(K,f,Y)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),Y()},this.input.pipe(j),this.rl=BP.createInterface({input:this.input,output:j,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),BP.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),W7(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(A6.cursor.show),this.output.off("resize",this.render),W7(this.input,!1),q(this.value)}),this.once("cancel",()=>{this.output.write(A6.cursor.show),this.output.off("resize",this.render),W7(this.input,!1),q(E2)})})}onKeypress(q,_){if(this.state==="error"&&(this.state="active"),_?.name&&(!this._track&&J7.aliases.has(_.name)&&this.emit("cursor",J7.aliases.get(_.name)),J7.actions.has(_.name)&&this.emit("cursor",_.name)),q&&(q.toLowerCase()==="y"||q.toLowerCase()==="n")&&this.emit("confirm",q.toLowerCase()==="y"),q==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),q&&this.emit("key",q.toLowerCase()),_?.name==="return"){if(this.opts.validate){let j=this.opts.validate(this.value);j&&(this.error=j instanceof Error?j.message:j,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}I2([q,_?.name,_?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
234
+ `),W7(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let q=QP(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
235
+ `).length-1;this.output.write(A6.cursor.move(-999,q*-1))}render(){let q=QP(this._render(this)??"",process.stdout.columns,{hard:!0});if(q!==this._prevFrame){if(this.state==="initial")this.output.write(A6.cursor.hide);else{let _=ZA(this._prevFrame,q);if(this.restoreCursor(),_&&_?.length===1){let j=_[0];this.output.write(A6.cursor.move(0,j)),this.output.write(A6.erase.lines(1));let K=q.split(`
236
+ `);this.output.write(K[j]),this._prevFrame=q,this.output.write(A6.cursor.move(0,K.length-j-1));return}if(_&&_?.length>1){let j=_[0];this.output.write(A6.cursor.move(0,j)),this.output.write(A6.erase.down());let K=q.split(`
233
237
  `).slice(j);this.output.write(K.join(`
234
- `)),this._prevFrame=q;return}this.output.write(k6.erase.down())}this.output.write(q),this.state==="initial"&&(this.state="active"),this._prevFrame=q}}}var k6,sP,aX,_Y,BX,tX,eX=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\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])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\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\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\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-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*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\u26A7\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-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\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[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},FX,G2=10,cP=(q=0)=>(_)=>`\x1B[${_+q}m`,rP=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,iP=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,p8,UX,sX,qA,O7,_A=39,D2="\x07",KY="[",KA="]",jY="m",C2,oP=(q)=>`${O7.values().next().value}${KY}${q}${jY}`,aP=(q)=>`${O7.values().next().value}${C2}${q}${D2}`,jA=(q)=>q.split(" ").map((_)=>sK(_)),u2=(q,_,j)=>{let K=[..._],Y=!1,f=!1,P=sK(QP(q[q.length-1]));for(let[$,O]of K.entries()){let w=sK(O);if(P+w<=j?q[q.length-1]+=O:(q.push(O),P=0),O7.has(O)&&(Y=!0,f=K.slice($+1).join("").startsWith(C2)),Y){f?O===D2&&(Y=!1,f=!1):O===jY&&(Y=!1);continue}P+=w,P===j&&$<K.length-1&&(q.push(""),P=0)}!P&&q[q.length-1].length>0&&q.length>1&&(q[q.length-2]+=q.pop())},PA=(q)=>{let _=q.split(" "),j=_.length;for(;j>0&&!(sK(_[j-1])>0);)j--;return j===_.length?q:_.slice(0,j).join(" ")+_.slice(j).join("")},YA=(q,_,j={})=>{if(j.trim!==!1&&q.trim()==="")return"";let K="",Y,f,P=jA(q),$=[""];for(let[w,v]of q.split(" ").entries()){j.trim!==!1&&($[$.length-1]=$[$.length-1].trimStart());let z=sK($[$.length-1]);if(w!==0&&(z>=_&&(j.wordWrap===!1||j.trim===!1)&&($.push(""),z=0),(z>0||j.trim===!1)&&($[$.length-1]+=" ",z++)),j.hard&&P[w]>_){let W=_-z,J=1+Math.floor((P[w]-W-1)/_);Math.floor((P[w]-1)/_)<J&&$.push(""),u2($,v,_);continue}if(z+P[w]>_&&z>0&&P[w]>0){if(j.wordWrap===!1&&z<_){u2($,v,_);continue}$.push("")}if(z+P[w]>_&&j.wordWrap===!1){u2($,v,_);continue}$[$.length-1]+=v}j.trim!==!1&&($=$.map((w)=>PA(w)));let O=[...$.join(`
235
- `)];for(let[w,v]of O.entries()){if(K+=v,O7.has(v)){let{groups:W}=new RegExp(`(?:\\${KY}(?<code>\\d+)m|\\${C2}(?<uri>.*)${D2})`).exec(O.slice(w).join(""))||{groups:{}};if(W.code!==void 0){let J=Number.parseFloat(W.code);Y=J===_A?void 0:J}else W.uri!==void 0&&(f=W.uri.length===0?void 0:W.uri)}let z=qA.codes.get(Number(Y));O[w+1]===`
236
- `?(f&&(K+=aP("")),Y&&z&&(K+=oP(z))):v===`
237
- `&&(Y&&z&&(K+=oP(Y)),f&&(K+=aP(f)))}return K},fA,w7,wA,h2,OA,vA=(q,_,j)=>(_ in q)?OA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,l6=(q,_,j)=>(vA(q,typeof _!="symbol"?_+"":_,j),j),M2,zA,WA,JA=(q,_,j)=>(_ in q)?WA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,tP=(q,_,j)=>(JA(q,typeof _!="symbol"?_+"":_,j),j),YY,HA,TA=(q,_,j)=>(_ in q)?HA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,eP=(q,_,j)=>(TA(q,typeof _!="symbol"?_+"":_,j),j),N2,b2;var S2=Q8(()=>{k6=B6(k2(),1),sP=B6(A2(),1);aX=oX();_Y={exports:{}};(function(q){var _={};q.exports=_,_.eastAsianWidth=function(K){var Y=K.charCodeAt(0),f=K.length==2?K.charCodeAt(1):0,P=Y;return 55296<=Y&&Y<=56319&&56320<=f&&f<=57343&&(Y&=1023,f&=1023,P=Y<<10|f,P+=65536),P==12288||65281<=P&&P<=65376||65504<=P&&P<=65510?"F":P==8361||65377<=P&&P<=65470||65474<=P&&P<=65479||65482<=P&&P<=65487||65490<=P&&P<=65495||65498<=P&&P<=65500||65512<=P&&P<=65518?"H":4352<=P&&P<=4447||4515<=P&&P<=4519||4602<=P&&P<=4607||9001<=P&&P<=9002||11904<=P&&P<=11929||11931<=P&&P<=12019||12032<=P&&P<=12245||12272<=P&&P<=12283||12289<=P&&P<=12350||12353<=P&&P<=12438||12441<=P&&P<=12543||12549<=P&&P<=12589||12593<=P&&P<=12686||12688<=P&&P<=12730||12736<=P&&P<=12771||12784<=P&&P<=12830||12832<=P&&P<=12871||12880<=P&&P<=13054||13056<=P&&P<=19903||19968<=P&&P<=42124||42128<=P&&P<=42182||43360<=P&&P<=43388||44032<=P&&P<=55203||55216<=P&&P<=55238||55243<=P&&P<=55291||63744<=P&&P<=64255||65040<=P&&P<=65049||65072<=P&&P<=65106||65108<=P&&P<=65126||65128<=P&&P<=65131||110592<=P&&P<=110593||127488<=P&&P<=127490||127504<=P&&P<=127546||127552<=P&&P<=127560||127568<=P&&P<=127569||131072<=P&&P<=194367||177984<=P&&P<=196605||196608<=P&&P<=262141?"W":32<=P&&P<=126||162<=P&&P<=163||165<=P&&P<=166||P==172||P==175||10214<=P&&P<=10221||10629<=P&&P<=10630?"Na":P==161||P==164||167<=P&&P<=168||P==170||173<=P&&P<=174||176<=P&&P<=180||182<=P&&P<=186||188<=P&&P<=191||P==198||P==208||215<=P&&P<=216||222<=P&&P<=225||P==230||232<=P&&P<=234||236<=P&&P<=237||P==240||242<=P&&P<=243||247<=P&&P<=250||P==252||P==254||P==257||P==273||P==275||P==283||294<=P&&P<=295||P==299||305<=P&&P<=307||P==312||319<=P&&P<=322||P==324||328<=P&&P<=331||P==333||338<=P&&P<=339||358<=P&&P<=359||P==363||P==462||P==464||P==466||P==468||P==470||P==472||P==474||P==476||P==593||P==609||P==708||P==711||713<=P&&P<=715||P==717||P==720||728<=P&&P<=731||P==733||P==735||768<=P&&P<=879||913<=P&&P<=929||931<=P&&P<=937||945<=P&&P<=961||963<=P&&P<=969||P==1025||1040<=P&&P<=1103||P==1105||P==8208||8211<=P&&P<=8214||8216<=P&&P<=8217||8220<=P&&P<=8221||8224<=P&&P<=8226||8228<=P&&P<=8231||P==8240||8242<=P&&P<=8243||P==8245||P==8251||P==8254||P==8308||P==8319||8321<=P&&P<=8324||P==8364||P==8451||P==8453||P==8457||P==8467||P==8470||8481<=P&&P<=8482||P==8486||P==8491||8531<=P&&P<=8532||8539<=P&&P<=8542||8544<=P&&P<=8555||8560<=P&&P<=8569||P==8585||8592<=P&&P<=8601||8632<=P&&P<=8633||P==8658||P==8660||P==8679||P==8704||8706<=P&&P<=8707||8711<=P&&P<=8712||P==8715||P==8719||P==8721||P==8725||P==8730||8733<=P&&P<=8736||P==8739||P==8741||8743<=P&&P<=8748||P==8750||8756<=P&&P<=8759||8764<=P&&P<=8765||P==8776||P==8780||P==8786||8800<=P&&P<=8801||8804<=P&&P<=8807||8810<=P&&P<=8811||8814<=P&&P<=8815||8834<=P&&P<=8835||8838<=P&&P<=8839||P==8853||P==8857||P==8869||P==8895||P==8978||9312<=P&&P<=9449||9451<=P&&P<=9547||9552<=P&&P<=9587||9600<=P&&P<=9615||9618<=P&&P<=9621||9632<=P&&P<=9633||9635<=P&&P<=9641||9650<=P&&P<=9651||9654<=P&&P<=9655||9660<=P&&P<=9661||9664<=P&&P<=9665||9670<=P&&P<=9672||P==9675||9678<=P&&P<=9681||9698<=P&&P<=9701||P==9711||9733<=P&&P<=9734||P==9737||9742<=P&&P<=9743||9748<=P&&P<=9749||P==9756||P==9758||P==9792||P==9794||9824<=P&&P<=9825||9827<=P&&P<=9829||9831<=P&&P<=9834||9836<=P&&P<=9837||P==9839||9886<=P&&P<=9887||9918<=P&&P<=9919||9924<=P&&P<=9933||9935<=P&&P<=9953||P==9955||9960<=P&&P<=9983||P==10045||P==10071||10102<=P&&P<=10111||11093<=P&&P<=11097||12872<=P&&P<=12879||57344<=P&&P<=63743||65024<=P&&P<=65039||P==65533||127232<=P&&P<=127242||127248<=P&&P<=127277||127280<=P&&P<=127337||127344<=P&&P<=127386||917760<=P&&P<=917999||983040<=P&&P<=1048573||1048576<=P&&P<=1114109?"A":"N"},_.characterLength=function(K){var Y=this.eastAsianWidth(K);return Y=="F"||Y=="W"||Y=="A"?2:1};function j(K){return K.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}_.length=function(K){for(var Y=j(K),f=0,P=0;P<Y.length;P++)f=f+this.characterLength(Y[P]);return f},_.slice=function(K,Y,f){textLen=_.length(K),Y=Y||0,f=f||1,Y<0&&(Y=textLen+Y),f<0&&(f=textLen+f);for(var P="",$=0,O=j(K),w=0;w<O.length;w++){var v=O[w],z=_.length(v);if($>=Y-(z==2?1:0))if($+z<=f)P+=v;else break;$+=z}return P}})(_Y);BX=_Y.exports,tX=qY(BX),FX=qY(eX);p8={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(p8.modifier);UX=Object.keys(p8.color),sX=Object.keys(p8.bgColor);[...UX];qA=QX(),O7=new Set(["\x1B","›"]),C2=`${KA}8;;`;fA=["up","down","left","right","space","enter","cancel"],w7={actions:new Set(fA),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};wA=globalThis.process.platform.startsWith("win"),h2=Symbol("clack:cancel");OA=Object.defineProperty;M2=class M2 extends QK{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(q){super(q,!1),this.value=!!q.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(_)=>{this.output.write(k6.cursor.move(0,-1)),this.value=_,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};zA=new WeakMap;WA=Object.defineProperty,YY=class extends QK{constructor(q){super(q,!1),tP(this,"options"),tP(this,"cursor",0),this.options=q.options,this.value=[...q.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:_})=>_===q.cursorAt),0),this.on("key",(_)=>{_==="a"&&this.toggleAll()}),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let q=this.value.length===this.options.length;this.value=q?[]:this.options.map((_)=>_.value)}toggleValue(){let q=this.value.includes(this._value);this.value=q?this.value.filter((_)=>_!==this._value):[...this.value,this._value]}},HA=Object.defineProperty;N2=class N2 extends QK{constructor(q){super(q,!1),eP(this,"options"),eP(this,"cursor",0),this.options=q.options,this.cursor=this.options.findIndex(({value:_})=>_===q.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};b2=class b2 extends QK{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;let q=this.value.slice(0,this.cursor),[_,...j]=this.value.slice(this.cursor);return`${q}${sP.default.inverse(_)}${j.join("")}`}get cursor(){return this._cursor}constructor(q){super(q),this.on("finalize",()=>{this.value||(this.value=q.defaultValue)})}}});import{stripVTControlCharacters as E2}from"node:util";import vq from"node:process";function ZA(){return vq.platform!=="win32"?vq.env.TERM!=="linux":!!vq.env.CI||!!vq.env.WT_SESSION||!!vq.env.TERMINUS_SUBLIME||vq.env.ConEmuTask==="{cmd::Cmder}"||vq.env.TERM_PROGRAM==="Terminus-Sublime"||vq.env.TERM_PROGRAM==="vscode"||vq.env.TERM==="xterm-256color"||vq.env.TERM==="alacritty"||vq.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var a,v7,R2,e8=(q,_)=>R2?q:_,kA,wY,OY,z7,XA,h8,Uq,m2,I2,AA,fY,GA,jM,$Y,uA,hA,DA,CA,VA,MA,NA,W7=(q)=>{switch(q){case"initial":case"active":return a.default.cyan(kA);case"cancel":return a.default.red(wY);case"error":return a.default.yellow(OY);case"submit":return a.default.green(z7)}},g2=(q)=>{let{cursor:_,options:j,style:K}=q,Y=q.maxItems??Number.POSITIVE_INFINITY,f=Math.max(process.stdout.rows-4,0),P=Math.min(f,Math.max(Y,5)),$=0;_>=$+P-3?$=Math.max(Math.min(_-P+3,j.length-P),0):_<$+2&&($=Math.max(_-2,0));let O=P<j.length&&$>0,w=P<j.length&&$+P<j.length;return j.slice($,$+P).map((v,z,W)=>{let J=z===0&&O,Z=z===W.length-1&&w;return J||Z?a.default.dim("..."):K(v,z+$===_)})},X_=(q)=>new b2({validate:q.validate,placeholder:q.placeholder,defaultValue:q.defaultValue,initialValue:q.initialValue,render(){let _=`${a.default.gray(h8)}
238
- ${W7(this.state)} ${q.message}
238
+ `)),this._prevFrame=q;return}this.output.write(A6.erase.down())}this.output.write(q),this.state==="initial"&&(this.state="active"),this._prevFrame=q}}}var A6,Pf,_A,$f,KA,jA,PA=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\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])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\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\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\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-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*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\u26A7\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-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\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[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},fA,b2=10,tP=(q=0)=>(_)=>`\x1B[${_+q}m`,eP=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,FP=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,p8,YA,$A,OA,H7,vA=39,R2="\x07",wf="[",zA="]",Of="m",m2,UP=(q)=>`${H7.values().next().value}${wf}${q}${Of}`,sP=(q)=>`${H7.values().next().value}${m2}${q}${R2}`,WA=(q)=>q.split(" ").map((_)=>j3(_)),S2=(q,_,j)=>{let K=[..._],f=!1,Y=!1,P=j3(ff(q[q.length-1]));for(let[$,O]of K.entries()){let w=j3(O);if(P+w<=j?q[q.length-1]+=O:(q.push(O),P=0),H7.has(O)&&(f=!0,Y=K.slice($+1).join("").startsWith(m2)),f){Y?O===R2&&(f=!1,Y=!1):O===Of&&(f=!1);continue}P+=w,P===j&&$<K.length-1&&(q.push(""),P=0)}!P&&q[q.length-1].length>0&&q.length>1&&(q[q.length-2]+=q.pop())},JA=(q)=>{let _=q.split(" "),j=_.length;for(;j>0&&!(j3(_[j-1])>0);)j--;return j===_.length?q:_.slice(0,j).join(" ")+_.slice(j).join("")},HA=(q,_,j={})=>{if(j.trim!==!1&&q.trim()==="")return"";let K="",f,Y,P=WA(q),$=[""];for(let[w,v]of q.split(" ").entries()){j.trim!==!1&&($[$.length-1]=$[$.length-1].trimStart());let z=j3($[$.length-1]);if(w!==0&&(z>=_&&(j.wordWrap===!1||j.trim===!1)&&($.push(""),z=0),(z>0||j.trim===!1)&&($[$.length-1]+=" ",z++)),j.hard&&P[w]>_){let W=_-z,H=1+Math.floor((P[w]-W-1)/_);Math.floor((P[w]-1)/_)<H&&$.push(""),S2($,v,_);continue}if(z+P[w]>_&&z>0&&P[w]>0){if(j.wordWrap===!1&&z<_){S2($,v,_);continue}$.push("")}if(z+P[w]>_&&j.wordWrap===!1){S2($,v,_);continue}$[$.length-1]+=v}j.trim!==!1&&($=$.map((w)=>JA(w)));let O=[...$.join(`
239
+ `)];for(let[w,v]of O.entries()){if(K+=v,H7.has(v)){let{groups:W}=new RegExp(`(?:\\${wf}(?<code>\\d+)m|\\${m2}(?<uri>.*)${R2})`).exec(O.slice(w).join(""))||{groups:{}};if(W.code!==void 0){let H=Number.parseFloat(W.code);f=H===vA?void 0:H}else W.uri!==void 0&&(Y=W.uri.length===0?void 0:W.uri)}let z=OA.codes.get(Number(f));O[w+1]===`
240
+ `?(Y&&(K+=sP("")),f&&z&&(K+=UP(z))):v===`
241
+ `&&(f&&z&&(K+=UP(f)),Y&&(K+=sP(Y)))}return K},TA,J7,kA,E2,XA,AA=(q,_,j)=>(_ in q)?XA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,x6=(q,_,j)=>(AA(q,typeof _!="symbol"?_+"":_,j),j),g2,GA,uA,hA=(q,_,j)=>(_ in q)?uA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,qf=(q,_,j)=>(hA(q,typeof _!="symbol"?_+"":_,j),j),zf,DA,CA=(q,_,j)=>(_ in q)?DA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,_f=(q,_,j)=>(CA(q,typeof _!="symbol"?_+"":_,j),j),y2,d2;var p2=Q8(()=>{A6=e6(V2(),1),Pf=e6(N2(),1);_A=qA();$f={exports:{}};(function(q){var _={};q.exports=_,_.eastAsianWidth=function(K){var f=K.charCodeAt(0),Y=K.length==2?K.charCodeAt(1):0,P=f;return 55296<=f&&f<=56319&&56320<=Y&&Y<=57343&&(f&=1023,Y&=1023,P=f<<10|Y,P+=65536),P==12288||65281<=P&&P<=65376||65504<=P&&P<=65510?"F":P==8361||65377<=P&&P<=65470||65474<=P&&P<=65479||65482<=P&&P<=65487||65490<=P&&P<=65495||65498<=P&&P<=65500||65512<=P&&P<=65518?"H":4352<=P&&P<=4447||4515<=P&&P<=4519||4602<=P&&P<=4607||9001<=P&&P<=9002||11904<=P&&P<=11929||11931<=P&&P<=12019||12032<=P&&P<=12245||12272<=P&&P<=12283||12289<=P&&P<=12350||12353<=P&&P<=12438||12441<=P&&P<=12543||12549<=P&&P<=12589||12593<=P&&P<=12686||12688<=P&&P<=12730||12736<=P&&P<=12771||12784<=P&&P<=12830||12832<=P&&P<=12871||12880<=P&&P<=13054||13056<=P&&P<=19903||19968<=P&&P<=42124||42128<=P&&P<=42182||43360<=P&&P<=43388||44032<=P&&P<=55203||55216<=P&&P<=55238||55243<=P&&P<=55291||63744<=P&&P<=64255||65040<=P&&P<=65049||65072<=P&&P<=65106||65108<=P&&P<=65126||65128<=P&&P<=65131||110592<=P&&P<=110593||127488<=P&&P<=127490||127504<=P&&P<=127546||127552<=P&&P<=127560||127568<=P&&P<=127569||131072<=P&&P<=194367||177984<=P&&P<=196605||196608<=P&&P<=262141?"W":32<=P&&P<=126||162<=P&&P<=163||165<=P&&P<=166||P==172||P==175||10214<=P&&P<=10221||10629<=P&&P<=10630?"Na":P==161||P==164||167<=P&&P<=168||P==170||173<=P&&P<=174||176<=P&&P<=180||182<=P&&P<=186||188<=P&&P<=191||P==198||P==208||215<=P&&P<=216||222<=P&&P<=225||P==230||232<=P&&P<=234||236<=P&&P<=237||P==240||242<=P&&P<=243||247<=P&&P<=250||P==252||P==254||P==257||P==273||P==275||P==283||294<=P&&P<=295||P==299||305<=P&&P<=307||P==312||319<=P&&P<=322||P==324||328<=P&&P<=331||P==333||338<=P&&P<=339||358<=P&&P<=359||P==363||P==462||P==464||P==466||P==468||P==470||P==472||P==474||P==476||P==593||P==609||P==708||P==711||713<=P&&P<=715||P==717||P==720||728<=P&&P<=731||P==733||P==735||768<=P&&P<=879||913<=P&&P<=929||931<=P&&P<=937||945<=P&&P<=961||963<=P&&P<=969||P==1025||1040<=P&&P<=1103||P==1105||P==8208||8211<=P&&P<=8214||8216<=P&&P<=8217||8220<=P&&P<=8221||8224<=P&&P<=8226||8228<=P&&P<=8231||P==8240||8242<=P&&P<=8243||P==8245||P==8251||P==8254||P==8308||P==8319||8321<=P&&P<=8324||P==8364||P==8451||P==8453||P==8457||P==8467||P==8470||8481<=P&&P<=8482||P==8486||P==8491||8531<=P&&P<=8532||8539<=P&&P<=8542||8544<=P&&P<=8555||8560<=P&&P<=8569||P==8585||8592<=P&&P<=8601||8632<=P&&P<=8633||P==8658||P==8660||P==8679||P==8704||8706<=P&&P<=8707||8711<=P&&P<=8712||P==8715||P==8719||P==8721||P==8725||P==8730||8733<=P&&P<=8736||P==8739||P==8741||8743<=P&&P<=8748||P==8750||8756<=P&&P<=8759||8764<=P&&P<=8765||P==8776||P==8780||P==8786||8800<=P&&P<=8801||8804<=P&&P<=8807||8810<=P&&P<=8811||8814<=P&&P<=8815||8834<=P&&P<=8835||8838<=P&&P<=8839||P==8853||P==8857||P==8869||P==8895||P==8978||9312<=P&&P<=9449||9451<=P&&P<=9547||9552<=P&&P<=9587||9600<=P&&P<=9615||9618<=P&&P<=9621||9632<=P&&P<=9633||9635<=P&&P<=9641||9650<=P&&P<=9651||9654<=P&&P<=9655||9660<=P&&P<=9661||9664<=P&&P<=9665||9670<=P&&P<=9672||P==9675||9678<=P&&P<=9681||9698<=P&&P<=9701||P==9711||9733<=P&&P<=9734||P==9737||9742<=P&&P<=9743||9748<=P&&P<=9749||P==9756||P==9758||P==9792||P==9794||9824<=P&&P<=9825||9827<=P&&P<=9829||9831<=P&&P<=9834||9836<=P&&P<=9837||P==9839||9886<=P&&P<=9887||9918<=P&&P<=9919||9924<=P&&P<=9933||9935<=P&&P<=9953||P==9955||9960<=P&&P<=9983||P==10045||P==10071||10102<=P&&P<=10111||11093<=P&&P<=11097||12872<=P&&P<=12879||57344<=P&&P<=63743||65024<=P&&P<=65039||P==65533||127232<=P&&P<=127242||127248<=P&&P<=127277||127280<=P&&P<=127337||127344<=P&&P<=127386||917760<=P&&P<=917999||983040<=P&&P<=1048573||1048576<=P&&P<=1114109?"A":"N"},_.characterLength=function(K){var f=this.eastAsianWidth(K);return f=="F"||f=="W"||f=="A"?2:1};function j(K){return K.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}_.length=function(K){for(var f=j(K),Y=0,P=0;P<f.length;P++)Y=Y+this.characterLength(f[P]);return Y},_.slice=function(K,f,Y){textLen=_.length(K),f=f||0,Y=Y||1,f<0&&(f=textLen+f),Y<0&&(Y=textLen+Y);for(var P="",$=0,O=j(K),w=0;w<O.length;w++){var v=O[w],z=_.length(v);if($>=f-(z==2?1:0))if($+z<=Y)P+=v;else break;$+=z}return P}})($f);KA=$f.exports,jA=Yf(KA),fA=Yf(PA);p8={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(p8.modifier);YA=Object.keys(p8.color),$A=Object.keys(p8.bgColor);[...YA];OA=wA(),H7=new Set(["\x1B","›"]),m2=`${zA}8;;`;TA=["up","down","left","right","space","enter","cancel"],J7={actions:new Set(TA),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};kA=globalThis.process.platform.startsWith("win"),E2=Symbol("clack:cancel");XA=Object.defineProperty;g2=class g2 extends P3{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(q){super(q,!1),this.value=!!q.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(_)=>{this.output.write(A6.cursor.move(0,-1)),this.value=_,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};GA=new WeakMap;uA=Object.defineProperty,zf=class extends P3{constructor(q){super(q,!1),qf(this,"options"),qf(this,"cursor",0),this.options=q.options,this.value=[...q.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:_})=>_===q.cursorAt),0),this.on("key",(_)=>{_==="a"&&this.toggleAll()}),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let q=this.value.length===this.options.length;this.value=q?[]:this.options.map((_)=>_.value)}toggleValue(){let q=this.value.includes(this._value);this.value=q?this.value.filter((_)=>_!==this._value):[...this.value,this._value]}},DA=Object.defineProperty;y2=class y2 extends P3{constructor(q){super(q,!1),_f(this,"options"),_f(this,"cursor",0),this.options=q.options,this.cursor=this.options.findIndex(({value:_})=>_===q.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};d2=class d2 extends P3{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;let q=this.value.slice(0,this.cursor),[_,...j]=this.value.slice(this.cursor);return`${q}${Pf.default.inverse(_)}${j.join("")}`}get cursor(){return this._cursor}constructor(q){super(q),this.on("finalize",()=>{this.value||(this.value=q.defaultValue)})}}});import{stripVTControlCharacters as L2}from"node:util";import Jq from"node:process";function VA(){return Jq.platform!=="win32"?Jq.env.TERM!=="linux":!!Jq.env.CI||!!Jq.env.WT_SESSION||!!Jq.env.TERMINUS_SUBLIME||Jq.env.ConEmuTask==="{cmd::Cmder}"||Jq.env.TERM_PROGRAM==="Terminus-Sublime"||Jq.env.TERM_PROGRAM==="vscode"||Jq.env.TERM==="xterm-256color"||Jq.env.TERM==="alacritty"||Jq.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var a,T7,l2,e8=(q,_)=>l2?q:_,MA,Hf,Tf,Z7,NA,h8,sq,x2,n2,bA,Wf,SA,HM,Jf,EA,RA,mA,IA,gA,yA,dA,k7=(q)=>{switch(q){case"initial":case"active":return a.default.cyan(MA);case"cancel":return a.default.red(Hf);case"error":return a.default.yellow(Tf);case"submit":return a.default.green(Z7)}},c2=(q)=>{let{cursor:_,options:j,style:K}=q,f=q.maxItems??Number.POSITIVE_INFINITY,Y=Math.max(process.stdout.rows-4,0),P=Math.min(Y,Math.max(f,5)),$=0;_>=$+P-3?$=Math.max(Math.min(_-P+3,j.length-P),0):_<$+2&&($=Math.max(_-2,0));let O=P<j.length&&$>0,w=P<j.length&&$+P<j.length;return j.slice($,$+P).map((v,z,W)=>{let H=z===0&&O,Z=z===W.length-1&&w;return H||Z?a.default.dim("..."):K(v,z+$===_)})},G_=(q)=>new d2({validate:q.validate,placeholder:q.placeholder,defaultValue:q.defaultValue,initialValue:q.initialValue,render(){let _=`${a.default.gray(h8)}
242
+ ${k7(this.state)} ${q.message}
239
243
  `,j=q.placeholder?a.default.inverse(q.placeholder[0])+a.default.dim(q.placeholder.slice(1)):a.default.inverse(a.default.hidden("_")),K=this.value?this.valueWithCursor:j;switch(this.state){case"error":return`${_.trim()}
240
244
  ${a.default.yellow(h8)} ${K}
241
- ${a.default.yellow(Uq)} ${a.default.yellow(this.error)}
245
+ ${a.default.yellow(sq)} ${a.default.yellow(this.error)}
242
246
  `;case"submit":return`${_}${a.default.gray(h8)} ${a.default.dim(this.value||q.placeholder)}`;case"cancel":return`${_}${a.default.gray(h8)} ${a.default.strikethrough(a.default.dim(this.value??""))}${this.value?.trim()?`
243
247
  ${a.default.gray(h8)}`:""}`;default:return`${_}${a.default.cyan(h8)} ${K}
244
- ${a.default.cyan(Uq)}
245
- `}}}).prompt(),zq=(q)=>{let _=q.active??"Yes",j=q.inactive??"No";return new M2({active:_,inactive:j,initialValue:q.initialValue??!0,render(){let K=`${a.default.gray(h8)}
246
- ${W7(this.state)} ${q.message}
247
- `,Y=this.value?_:j;switch(this.state){case"submit":return`${K}${a.default.gray(h8)} ${a.default.dim(Y)}`;case"cancel":return`${K}${a.default.gray(h8)} ${a.default.strikethrough(a.default.dim(Y))}
248
- ${a.default.gray(h8)}`;default:return`${K}${a.default.cyan(h8)} ${this.value?`${a.default.green(m2)} ${_}`:`${a.default.dim(I2)} ${a.default.dim(_)}`} ${a.default.dim("/")} ${this.value?`${a.default.dim(I2)} ${a.default.dim(j)}`:`${a.default.green(m2)} ${j}`}
249
- ${a.default.cyan(Uq)}
250
- `}}}).prompt()},X6=(q)=>{let _=(j,K)=>{let Y=j.label??String(j.value);switch(K){case"selected":return`${a.default.dim(Y)}`;case"active":return`${a.default.green(m2)} ${Y} ${j.hint?a.default.dim(`(${j.hint})`):""}`;case"cancelled":return`${a.default.strikethrough(a.default.dim(Y))}`;default:return`${a.default.dim(I2)} ${a.default.dim(Y)}`}};return new N2({options:q.options,initialValue:q.initialValue,render(){let j=`${a.default.gray(h8)}
251
- ${W7(this.state)} ${q.message}
248
+ ${a.default.cyan(sq)}
249
+ `}}}).prompt(),n6=(q)=>{let _=q.active??"Yes",j=q.inactive??"No";return new g2({active:_,inactive:j,initialValue:q.initialValue??!0,render(){let K=`${a.default.gray(h8)}
250
+ ${k7(this.state)} ${q.message}
251
+ `,f=this.value?_:j;switch(this.state){case"submit":return`${K}${a.default.gray(h8)} ${a.default.dim(f)}`;case"cancel":return`${K}${a.default.gray(h8)} ${a.default.strikethrough(a.default.dim(f))}
252
+ ${a.default.gray(h8)}`;default:return`${K}${a.default.cyan(h8)} ${this.value?`${a.default.green(x2)} ${_}`:`${a.default.dim(n2)} ${a.default.dim(_)}`} ${a.default.dim("/")} ${this.value?`${a.default.dim(n2)} ${a.default.dim(j)}`:`${a.default.green(x2)} ${j}`}
253
+ ${a.default.cyan(sq)}
254
+ `}}}).prompt()},H6=(q)=>{let _=(j,K)=>{let f=j.label??String(j.value);switch(K){case"selected":return`${a.default.dim(f)}`;case"active":return`${a.default.green(x2)} ${f} ${j.hint?a.default.dim(`(${j.hint})`):""}`;case"cancelled":return`${a.default.strikethrough(a.default.dim(f))}`;default:return`${a.default.dim(n2)} ${a.default.dim(f)}`}};return new y2({options:q.options,initialValue:q.initialValue,render(){let j=`${a.default.gray(h8)}
255
+ ${k7(this.state)} ${q.message}
252
256
  `;switch(this.state){case"submit":return`${j}${a.default.gray(h8)} ${_(this.options[this.cursor],"selected")}`;case"cancel":return`${j}${a.default.gray(h8)} ${_(this.options[this.cursor],"cancelled")}
253
- ${a.default.gray(h8)}`;default:return`${j}${a.default.cyan(h8)} ${g2({cursor:this.cursor,options:this.options,maxItems:q.maxItems,style:(K,Y)=>_(K,Y?"active":"inactive")}).join(`
257
+ ${a.default.gray(h8)}`;default:return`${j}${a.default.cyan(h8)} ${c2({cursor:this.cursor,options:this.options,maxItems:q.maxItems,style:(K,f)=>_(K,f?"active":"inactive")}).join(`
254
258
  ${a.default.cyan(h8)} `)}
255
- ${a.default.cyan(Uq)}
256
- `}}}).prompt()},y2=(q)=>{let _=(j,K)=>{let Y=j.label??String(j.value);return K==="active"?`${a.default.cyan(AA)} ${Y} ${j.hint?a.default.dim(`(${j.hint})`):""}`:K==="selected"?`${a.default.green(fY)} ${a.default.dim(Y)} ${j.hint?a.default.dim(`(${j.hint})`):""}`:K==="cancelled"?`${a.default.strikethrough(a.default.dim(Y))}`:K==="active-selected"?`${a.default.green(fY)} ${Y} ${j.hint?a.default.dim(`(${j.hint})`):""}`:K==="submitted"?`${a.default.dim(Y)}`:`${a.default.dim(GA)} ${a.default.dim(Y)}`};return new YY({options:q.options,initialValues:q.initialValues,required:q.required??!0,cursorAt:q.cursorAt,validate(j){if(this.required&&j.length===0)return`Please select at least one option.
259
+ ${a.default.cyan(sq)}
260
+ `}}}).prompt()},r2=(q)=>{let _=(j,K)=>{let f=j.label??String(j.value);return K==="active"?`${a.default.cyan(bA)} ${f} ${j.hint?a.default.dim(`(${j.hint})`):""}`:K==="selected"?`${a.default.green(Wf)} ${a.default.dim(f)} ${j.hint?a.default.dim(`(${j.hint})`):""}`:K==="cancelled"?`${a.default.strikethrough(a.default.dim(f))}`:K==="active-selected"?`${a.default.green(Wf)} ${f} ${j.hint?a.default.dim(`(${j.hint})`):""}`:K==="submitted"?`${a.default.dim(f)}`:`${a.default.dim(SA)} ${a.default.dim(f)}`};return new zf({options:q.options,initialValues:q.initialValues,required:q.required??!0,cursorAt:q.cursorAt,validate(j){if(this.required&&j.length===0)return`Please select at least one option.
257
261
  ${a.default.reset(a.default.dim(`Press ${a.default.gray(a.default.bgWhite(a.default.inverse(" space ")))} to select, ${a.default.gray(a.default.bgWhite(a.default.inverse(" enter ")))} to submit`))}`},render(){let j=`${a.default.gray(h8)}
258
- ${W7(this.state)} ${q.message}
259
- `,K=(Y,f)=>{let P=this.value.includes(Y.value);return f&&P?_(Y,"active-selected"):P?_(Y,"selected"):_(Y,f?"active":"inactive")};switch(this.state){case"submit":return`${j}${a.default.gray(h8)} ${this.options.filter(({value:Y})=>this.value.includes(Y)).map((Y)=>_(Y,"submitted")).join(a.default.dim(", "))||a.default.dim("none")}`;case"cancel":{let Y=this.options.filter(({value:f})=>this.value.includes(f)).map((f)=>_(f,"cancelled")).join(a.default.dim(", "));return`${j}${a.default.gray(h8)} ${Y.trim()?`${Y}
260
- ${a.default.gray(h8)}`:""}`}case"error":{let Y=this.error.split(`
261
- `).map((f,P)=>P===0?`${a.default.yellow(Uq)} ${a.default.yellow(f)}`:` ${f}`).join(`
262
- `);return`${j+a.default.yellow(h8)} ${g2({options:this.options,cursor:this.cursor,maxItems:q.maxItems,style:K}).join(`
262
+ ${k7(this.state)} ${q.message}
263
+ `,K=(f,Y)=>{let P=this.value.includes(f.value);return Y&&P?_(f,"active-selected"):P?_(f,"selected"):_(f,Y?"active":"inactive")};switch(this.state){case"submit":return`${j}${a.default.gray(h8)} ${this.options.filter(({value:f})=>this.value.includes(f)).map((f)=>_(f,"submitted")).join(a.default.dim(", "))||a.default.dim("none")}`;case"cancel":{let f=this.options.filter(({value:Y})=>this.value.includes(Y)).map((Y)=>_(Y,"cancelled")).join(a.default.dim(", "));return`${j}${a.default.gray(h8)} ${f.trim()?`${f}
264
+ ${a.default.gray(h8)}`:""}`}case"error":{let f=this.error.split(`
265
+ `).map((Y,P)=>P===0?`${a.default.yellow(sq)} ${a.default.yellow(Y)}`:` ${Y}`).join(`
266
+ `);return`${j+a.default.yellow(h8)} ${c2({options:this.options,cursor:this.cursor,maxItems:q.maxItems,style:K}).join(`
263
267
  ${a.default.yellow(h8)} `)}
264
- ${Y}
265
- `}default:return`${j}${a.default.cyan(h8)} ${g2({options:this.options,cursor:this.cursor,maxItems:q.maxItems,style:K}).join(`
268
+ ${f}
269
+ `}default:return`${j}${a.default.cyan(h8)} ${c2({options:this.options,cursor:this.cursor,maxItems:q.maxItems,style:K}).join(`
266
270
  ${a.default.cyan(h8)} `)}
267
- ${a.default.cyan(Uq)}
268
- `}}}).prompt()},vY=(q="",_="")=>{let j=`
271
+ ${a.default.cyan(sq)}
272
+ `}}}).prompt()},i2=(q="",_="")=>{let j=`
269
273
  ${q}
270
274
  `.split(`
271
- `),K=E2(_).length,Y=Math.max(j.reduce((P,$)=>{let O=E2($);return O.length>P?O.length:P},0),K)+2,f=j.map((P)=>`${a.default.gray(h8)} ${a.default.dim(P)}${" ".repeat(Y-E2(P).length)}${a.default.gray(h8)}`).join(`
275
+ `),K=L2(_).length,f=Math.max(j.reduce((P,$)=>{let O=L2($);return O.length>P?O.length:P},0),K)+2,Y=j.map((P)=>`${a.default.gray(h8)} ${a.default.dim(P)}${" ".repeat(f-L2(P).length)}${a.default.gray(h8)}`).join(`
272
276
  `);process.stdout.write(`${a.default.gray(h8)}
273
- ${a.default.green(z7)} ${a.default.reset(_)} ${a.default.gray($Y.repeat(Math.max(Y-K-1,1))+uA)}
274
- ${f}
275
- ${a.default.gray(hA+$Y.repeat(Y+2)+DA)}
276
- `)},V6=(q="")=>{process.stdout.write(`${a.default.gray(Uq)} ${a.default.red(q)}
277
+ ${a.default.green(Z7)} ${a.default.reset(_)} ${a.default.gray(Jf.repeat(Math.max(f-K-1,1))+EA)}
278
+ ${Y}
279
+ ${a.default.gray(RA+Jf.repeat(f+2)+mA)}
280
+ `)},$6=(q="")=>{process.stdout.write(`${a.default.gray(sq)} ${a.default.red(q)}
277
281
 
278
- `)},J7=(q="")=>{process.stdout.write(`${a.default.gray(XA)} ${q}
279
- `)},Wq=(q="")=>{process.stdout.write(`${a.default.gray(h8)}
280
- ${a.default.gray(Uq)} ${q}
282
+ `)},X7=(q="")=>{process.stdout.write(`${a.default.gray(NA)} ${q}
283
+ `)},Hq=(q="")=>{process.stdout.write(`${a.default.gray(h8)}
284
+ ${a.default.gray(sq)} ${q}
281
285
 
282
- `)},_6,PM,Jq=({indicator:q="dots"}={})=>{let _=R2?["◒","◐","◓","◑"]:["•","o","O","0"],j=R2?80:120,K=process.env.CI==="true",Y,f,P=!1,$="",O,w=performance.now(),v=(M)=>{let g=M>1?"Something went wrong":"Canceled";P&&D(g,M)},z=()=>v(2),W=()=>v(1),J=()=>{process.on("uncaughtExceptionMonitor",z),process.on("unhandledRejection",z),process.on("SIGINT",W),process.on("SIGTERM",W),process.on("exit",v)},Z=()=>{process.removeListener("uncaughtExceptionMonitor",z),process.removeListener("unhandledRejection",z),process.removeListener("SIGINT",W),process.removeListener("SIGTERM",W),process.removeListener("exit",v)},H=()=>{if(O===void 0)return;K&&process.stdout.write(`
283
- `);let M=O.split(`
284
- `);process.stdout.write(v7.cursor.move(-999,M.length-1)),process.stdout.write(v7.erase.down(M.length))},X=(M)=>M.replace(/\.+$/,""),A=(M)=>{let g=(performance.now()-M)/1000,S=Math.floor(g/60),b=Math.floor(g%60);return S>0?`[${S}m ${b}s]`:`[${b}s]`},G=(M="")=>{P=!0,Y=PY(),$=X(M),w=performance.now(),process.stdout.write(`${a.default.gray(h8)}
285
- `);let g=0,S=0;J(),f=setInterval(()=>{if(K&&$===O)return;H(),O=$;let b=a.default.magenta(_[g]);if(K)process.stdout.write(`${b} ${$}...`);else if(q==="timer")process.stdout.write(`${b} ${$} ${A(w)}`);else{let d=".".repeat(Math.floor(S)).slice(0,3);process.stdout.write(`${b} ${$}${d}`)}g=g+1<_.length?g+1:0,S=S<_.length?S+0.125:0},j)},D=(M="",g=0)=>{P=!1,clearInterval(f),H();let S=g===0?a.default.green(z7):g===1?a.default.red(wY):a.default.red(OY);$=X(M??$),q==="timer"?process.stdout.write(`${S} ${$} ${A(w)}
286
+ `)},_6,TM,_q=({indicator:q="dots"}={})=>{let _=l2?["◒","◐","◓","◑"]:["•","o","O","0"],j=l2?80:120,K=process.env.CI==="true",f,Y,P=!1,$="",O,w=performance.now(),v=(V)=>{let m=V>1?"Something went wrong":"Canceled";P&&D(m,V)},z=()=>v(2),W=()=>v(1),H=()=>{process.on("uncaughtExceptionMonitor",z),process.on("unhandledRejection",z),process.on("SIGINT",W),process.on("SIGTERM",W),process.on("exit",v)},Z=()=>{process.removeListener("uncaughtExceptionMonitor",z),process.removeListener("unhandledRejection",z),process.removeListener("SIGINT",W),process.removeListener("SIGTERM",W),process.removeListener("exit",v)},J=()=>{if(O===void 0)return;K&&process.stdout.write(`
287
+ `);let V=O.split(`
288
+ `);process.stdout.write(T7.cursor.move(-999,V.length-1)),process.stdout.write(T7.erase.down(V.length))},X=(V)=>V.replace(/\.+$/,""),A=(V)=>{let m=(performance.now()-V)/1000,S=Math.floor(m/60),b=Math.floor(m%60);return S>0?`[${S}m ${b}s]`:`[${b}s]`},G=(V="")=>{P=!0,f=vf(),$=X(V),w=performance.now(),process.stdout.write(`${a.default.gray(h8)}
289
+ `);let m=0,S=0;H(),Y=setInterval(()=>{if(K&&$===O)return;J(),O=$;let b=a.default.magenta(_[m]);if(K)process.stdout.write(`${b} ${$}...`);else if(q==="timer")process.stdout.write(`${b} ${$} ${A(w)}`);else{let d=".".repeat(Math.floor(S)).slice(0,3);process.stdout.write(`${b} ${$}${d}`)}m=m+1<_.length?m+1:0,S=S<_.length?S+0.125:0},j)},D=(V="",m=0)=>{P=!1,clearInterval(Y),J();let S=m===0?a.default.green(Z7):m===1?a.default.red(Hf):a.default.red(Tf);$=X(V??$),q==="timer"?process.stdout.write(`${S} ${$} ${A(w)}
286
290
  `):process.stdout.write(`${S} ${$}
287
- `),Z(),Y()};return{start:G,stop:D,message:(M="")=>{$=X(M??$)}}};var sq=Q8(()=>{S2();S2();a=B6(A2(),1),v7=B6(k2(),1);R2=ZA(),kA=e8("◆","*"),wY=e8("■","x"),OY=e8("▲","x"),z7=e8("◇","o"),XA=e8("┌","T"),h8=e8("│","|"),Uq=e8("└","—"),m2=e8("●",">"),I2=e8("○"," "),AA=e8("◻","[•]"),fY=e8("◼","[+]"),GA=e8("◻","[ ]"),jM=e8("▪","•"),$Y=e8("─","-"),uA=e8("╮","+"),hA=e8("├","+"),DA=e8("╯","+"),CA=e8("●","•"),VA=e8("◆","*"),MA=e8("▲","!"),NA=e8("■","x"),_6={message:(q="",{symbol:_=a.default.gray(h8)}={})=>{let j=[`${a.default.gray(h8)}`];if(q){let[K,...Y]=q.split(`
288
- `);j.push(`${_} ${K}`,...Y.map((f)=>`${a.default.gray(h8)} ${f}`))}process.stdout.write(`${j.join(`
291
+ `),Z(),f()};return{start:G,stop:D,message:(V="")=>{$=X(V??$)}}};var Qq=Q8(()=>{p2();p2();a=e6(N2(),1),T7=e6(V2(),1);l2=VA(),MA=e8("◆","*"),Hf=e8("■","x"),Tf=e8("▲","x"),Z7=e8("◇","o"),NA=e8("┌","T"),h8=e8("│","|"),sq=e8("└","—"),x2=e8("●",">"),n2=e8("○"," "),bA=e8("◻","[•]"),Wf=e8("◼","[+]"),SA=e8("◻","[ ]"),HM=e8("▪","•"),Jf=e8("─","-"),EA=e8("╮","+"),RA=e8("├","+"),mA=e8("╯","+"),IA=e8("●","•"),gA=e8("◆","*"),yA=e8("▲","!"),dA=e8("■","x"),_6={message:(q="",{symbol:_=a.default.gray(h8)}={})=>{let j=[`${a.default.gray(h8)}`];if(q){let[K,...f]=q.split(`
292
+ `);j.push(`${_} ${K}`,...f.map((Y)=>`${a.default.gray(h8)} ${Y}`))}process.stdout.write(`${j.join(`
289
293
  `)}
290
- `)},info:(q)=>{_6.message(q,{symbol:a.default.blue(CA)})},success:(q)=>{_6.message(q,{symbol:a.default.green(VA)})},step:(q)=>{_6.message(q,{symbol:a.default.green(z7)})},warn:(q)=>{_6.message(q,{symbol:a.default.yellow(MA)})},warning:(q)=>{_6.warn(q)},error:(q)=>{_6.message(q,{symbol:a.default.red(NA)})}},PM=`${a.default.gray(h8)} `});var hY=q8((x2,n2)=>{(function(q,_){typeof x2==="object"&&typeof n2!=="undefined"?n2.exports=_():typeof define==="function"&&define.amd?define(_):(q=typeof globalThis!=="undefined"?globalThis:q||self,q.tinycolor=_())})(x2,function(){function q(h){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},q(h)}var _=/^\s+/,j=/\s+$/;function K(h,C){if(h=h?h:"",C=C||{},h instanceof K)return h;if(!(this instanceof K))return new K(h,C);var T=Y(h);if(this._originalInput=h,this._r=T.r,this._g=T.g,this._b=T.b,this._a=T.a,this._roundA=Math.round(100*this._a)/100,this._format=C.format||T.format,this._gradientType=C.gradientType,this._r<1)this._r=Math.round(this._r);if(this._g<1)this._g=Math.round(this._g);if(this._b<1)this._b=Math.round(this._b);this._ok=T.ok}K.prototype={isDark:function h(){return this.getBrightness()<128},isLight:function h(){return!this.isDark()},isValid:function h(){return this._ok},getOriginalInput:function h(){return this._originalInput},getFormat:function h(){return this._format},getAlpha:function h(){return this._a},getBrightness:function h(){var C=this.toRgb();return(C.r*299+C.g*587+C.b*114)/1000},getLuminance:function h(){var C=this.toRgb(),T,V,x,o,c,B;if(T=C.r/255,V=C.g/255,x=C.b/255,T<=0.03928)o=T/12.92;else o=Math.pow((T+0.055)/1.055,2.4);if(V<=0.03928)c=V/12.92;else c=Math.pow((V+0.055)/1.055,2.4);if(x<=0.03928)B=x/12.92;else B=Math.pow((x+0.055)/1.055,2.4);return 0.2126*o+0.7152*c+0.0722*B},setAlpha:function h(C){return this._a=R(C),this._roundA=Math.round(100*this._a)/100,this},toHsv:function h(){var C=O(this._r,this._g,this._b);return{h:C.h*360,s:C.s,v:C.v,a:this._a}},toHsvString:function h(){var C=O(this._r,this._g,this._b),T=Math.round(C.h*360),V=Math.round(C.s*100),x=Math.round(C.v*100);return this._a==1?"hsv("+T+", "+V+"%, "+x+"%)":"hsva("+T+", "+V+"%, "+x+"%, "+this._roundA+")"},toHsl:function h(){var C=P(this._r,this._g,this._b);return{h:C.h*360,s:C.s,l:C.l,a:this._a}},toHslString:function h(){var C=P(this._r,this._g,this._b),T=Math.round(C.h*360),V=Math.round(C.s*100),x=Math.round(C.l*100);return this._a==1?"hsl("+T+", "+V+"%, "+x+"%)":"hsla("+T+", "+V+"%, "+x+"%, "+this._roundA+")"},toHex:function h(C){return v(this._r,this._g,this._b,C)},toHexString:function h(C){return"#"+this.toHex(C)},toHex8:function h(C){return z(this._r,this._g,this._b,this._a,C)},toHex8String:function h(C){return"#"+this.toHex8(C)},toRgb:function h(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function h(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function h(){return{r:Math.round(m(this._r,255)*100)+"%",g:Math.round(m(this._g,255)*100)+"%",b:Math.round(m(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function h(){return this._a==1?"rgb("+Math.round(m(this._r,255)*100)+"%, "+Math.round(m(this._g,255)*100)+"%, "+Math.round(m(this._b,255)*100)+"%)":"rgba("+Math.round(m(this._r,255)*100)+"%, "+Math.round(m(this._g,255)*100)+"%, "+Math.round(m(this._b,255)*100)+"%, "+this._roundA+")"},toName:function h(){if(this._a===0)return"transparent";if(this._a<1)return!1;return r[v(this._r,this._g,this._b,!0)]||!1},toFilter:function h(C){var T="#"+W(this._r,this._g,this._b,this._a),V=T,x=this._gradientType?"GradientType = 1, ":"";if(C){var o=K(C);V="#"+W(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+x+"startColorstr="+T+",endColorstr="+V+")"},toString:function h(C){var T=!!C;C=C||this._format;var V=!1,x=this._a<1&&this._a>=0,o=!T&&x&&(C==="hex"||C==="hex6"||C==="hex3"||C==="hex4"||C==="hex8"||C==="name");if(o){if(C==="name"&&this._a===0)return this.toName();return this.toRgbString()}if(C==="rgb")V=this.toRgbString();if(C==="prgb")V=this.toPercentageRgbString();if(C==="hex"||C==="hex6")V=this.toHexString();if(C==="hex3")V=this.toHexString(!0);if(C==="hex4")V=this.toHex8String(!0);if(C==="hex8")V=this.toHex8String();if(C==="name")V=this.toName();if(C==="hsl")V=this.toHslString();if(C==="hsv")V=this.toHsvString();return V||this.toHexString()},clone:function h(){return K(this.toString())},_applyModification:function h(C,T){var V=C.apply(null,[this].concat([].slice.call(T)));return this._r=V._r,this._g=V._g,this._b=V._b,this.setAlpha(V._a),this},lighten:function h(){return this._applyModification(X,arguments)},brighten:function h(){return this._applyModification(A,arguments)},darken:function h(){return this._applyModification(G,arguments)},desaturate:function h(){return this._applyModification(J,arguments)},saturate:function h(){return this._applyModification(Z,arguments)},greyscale:function h(){return this._applyModification(H,arguments)},spin:function h(){return this._applyModification(D,arguments)},_applyCombination:function h(C,T){return C.apply(null,[this].concat([].slice.call(T)))},analogous:function h(){return this._applyCombination(b,arguments)},complement:function h(){return this._applyCombination(M,arguments)},monochromatic:function h(){return this._applyCombination(d,arguments)},splitcomplement:function h(){return this._applyCombination(S,arguments)},triad:function h(){return this._applyCombination(g,[3])},tetrad:function h(){return this._applyCombination(g,[4])}},K.fromRatio=function(h,C){if(q(h)=="object"){var T={};for(var V in h)if(h.hasOwnProperty(V))if(V==="a")T[V]=h[V];else T[V]=f8(h[V]);h=T}return K(h,C)};function Y(h){var C={r:0,g:0,b:0},T=1,V=null,x=null,o=null,c=!1,B=!1;if(typeof h=="string")h=Y6(h);if(q(h)=="object"){if(R8(h.r)&&R8(h.g)&&R8(h.b))C=f(h.r,h.g,h.b),c=!0,B=String(h.r).substr(-1)==="%"?"prgb":"rgb";else if(R8(h.h)&&R8(h.s)&&R8(h.v))V=f8(h.s),x=f8(h.v),C=w(h.h,V,x),c=!0,B="hsv";else if(R8(h.h)&&R8(h.s)&&R8(h.l))V=f8(h.s),o=f8(h.l),C=$(h.h,V,o),c=!0,B="hsl";if(h.hasOwnProperty("a"))T=h.a}return T=R(T),{ok:c,format:h.format||B,r:Math.min(255,Math.max(C.r,0)),g:Math.min(255,Math.max(C.g,0)),b:Math.min(255,Math.max(C.b,0)),a:T}}function f(h,C,T){return{r:m(h,255)*255,g:m(C,255)*255,b:m(T,255)*255}}function P(h,C,T){h=m(h,255),C=m(C,255),T=m(T,255);var V=Math.max(h,C,T),x=Math.min(h,C,T),o,c,B=(V+x)/2;if(V==x)o=c=0;else{var K8=V-x;switch(c=B>0.5?K8/(2-V-x):K8/(V+x),V){case h:o=(C-T)/K8+(C<T?6:0);break;case C:o=(T-h)/K8+2;break;case T:o=(h-C)/K8+4;break}o/=6}return{h:o,s:c,l:B}}function $(h,C,T){var V,x,o;h=m(h,360),C=m(C,100),T=m(T,100);function c(W8,$8,A8){if(A8<0)A8+=1;if(A8>1)A8-=1;if(A8<0.16666666666666666)return W8+($8-W8)*6*A8;if(A8<0.5)return $8;if(A8<0.6666666666666666)return W8+($8-W8)*(0.6666666666666666-A8)*6;return W8}if(C===0)V=x=o=T;else{var B=T<0.5?T*(1+C):T+C-T*C,K8=2*T-B;V=c(K8,B,h+0.3333333333333333),x=c(K8,B,h),o=c(K8,B,h-0.3333333333333333)}return{r:V*255,g:x*255,b:o*255}}function O(h,C,T){h=m(h,255),C=m(C,255),T=m(T,255);var V=Math.max(h,C,T),x=Math.min(h,C,T),o,c,B=V,K8=V-x;if(c=V===0?0:K8/V,V==x)o=0;else{switch(V){case h:o=(C-T)/K8+(C<T?6:0);break;case C:o=(T-h)/K8+2;break;case T:o=(h-C)/K8+4;break}o/=6}return{h:o,s:c,v:B}}function w(h,C,T){h=m(h,360)*6,C=m(C,100),T=m(T,100);var V=Math.floor(h),x=h-V,o=T*(1-C),c=T*(1-x*C),B=T*(1-(1-x)*C),K8=V%6,W8=[T,c,o,o,B,T][K8],$8=[B,T,T,c,o,o][K8],A8=[o,o,B,T,T,c][K8];return{r:W8*255,g:$8*255,b:A8*255}}function v(h,C,T,V){var x=[w8(Math.round(h).toString(16)),w8(Math.round(C).toString(16)),w8(Math.round(T).toString(16))];if(V&&x[0].charAt(0)==x[0].charAt(1)&&x[1].charAt(0)==x[1].charAt(1)&&x[2].charAt(0)==x[2].charAt(1))return x[0].charAt(0)+x[1].charAt(0)+x[2].charAt(0);return x.join("")}function z(h,C,T,V,x){var o=[w8(Math.round(h).toString(16)),w8(Math.round(C).toString(16)),w8(Math.round(T).toString(16)),w8(T8(V))];if(x&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}function W(h,C,T,V){var x=[w8(T8(V)),w8(Math.round(h).toString(16)),w8(Math.round(C).toString(16)),w8(Math.round(T).toString(16))];return x.join("")}K.equals=function(h,C){if(!h||!C)return!1;return K(h).toRgbString()==K(C).toRgbString()},K.random=function(){return K.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function J(h,C){C=C===0?0:C||10;var T=K(h).toHsl();return T.s-=C/100,T.s=y(T.s),K(T)}function Z(h,C){C=C===0?0:C||10;var T=K(h).toHsl();return T.s+=C/100,T.s=y(T.s),K(T)}function H(h){return K(h).desaturate(100)}function X(h,C){C=C===0?0:C||10;var T=K(h).toHsl();return T.l+=C/100,T.l=y(T.l),K(T)}function A(h,C){C=C===0?0:C||10;var T=K(h).toRgb();return T.r=Math.max(0,Math.min(255,T.r-Math.round(255*-(C/100)))),T.g=Math.max(0,Math.min(255,T.g-Math.round(255*-(C/100)))),T.b=Math.max(0,Math.min(255,T.b-Math.round(255*-(C/100)))),K(T)}function G(h,C){C=C===0?0:C||10;var T=K(h).toHsl();return T.l-=C/100,T.l=y(T.l),K(T)}function D(h,C){var T=K(h).toHsl(),V=(T.h+C)%360;return T.h=V<0?360+V:V,K(T)}function M(h){var C=K(h).toHsl();return C.h=(C.h+180)%360,K(C)}function g(h,C){if(isNaN(C)||C<=0)throw new Error("Argument to polyad must be a positive number");var T=K(h).toHsl(),V=[K(h)],x=360/C;for(var o=1;o<C;o++)V.push(K({h:(T.h+o*x)%360,s:T.s,l:T.l}));return V}function S(h){var C=K(h).toHsl(),T=C.h;return[K(h),K({h:(T+72)%360,s:C.s,l:C.l}),K({h:(T+216)%360,s:C.s,l:C.l})]}function b(h,C,T){C=C||6,T=T||30;var V=K(h).toHsl(),x=360/T,o=[K(h)];for(V.h=(V.h-(x*C>>1)+720)%360;--C;)V.h=(V.h+x)%360,o.push(K(V));return o}function d(h,C){C=C||6;var T=K(h).toHsv(),V=T.h,x=T.s,o=T.v,c=[],B=1/C;while(C--)c.push(K({h:V,s:x,v:o})),o=(o+B)%1;return c}K.mix=function(h,C,T){T=T===0?0:T||50;var V=K(h).toRgb(),x=K(C).toRgb(),o=T/100,c={r:(x.r-V.r)*o+V.r,g:(x.g-V.g)*o+V.g,b:(x.b-V.b)*o+V.b,a:(x.a-V.a)*o+V.a};return K(c)},K.readability=function(h,C){var T=K(h),V=K(C);return(Math.max(T.getLuminance(),V.getLuminance())+0.05)/(Math.min(T.getLuminance(),V.getLuminance())+0.05)},K.isReadable=function(h,C,T){var V=K.readability(h,C),x,o;switch(o=!1,x=j6(T),x.level+x.size){case"AAsmall":case"AAAlarge":o=V>=4.5;break;case"AAlarge":o=V>=3;break;case"AAAsmall":o=V>=7;break}return o},K.mostReadable=function(h,C,T){var V=null,x=0,o,c,B,K8;T=T||{},c=T.includeFallbackColors,B=T.level,K8=T.size;for(var W8=0;W8<C.length;W8++)if(o=K.readability(h,C[W8]),o>x)x=o,V=K(C[W8]);if(K.isReadable(h,V,{level:B,size:K8})||!c)return V;else return T.includeFallbackColors=!1,K.mostReadable(h,["#fff","#000"],T)};var p=K.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},r=K.hexNames=l(p);function l(h){var C={};for(var T in h)if(h.hasOwnProperty(T))C[h[T]]=T;return C}function R(h){if(h=parseFloat(h),isNaN(h)||h<0||h>1)h=1;return h}function m(h,C){if(t(h))h="100%";var T=U(h);if(h=Math.min(C,Math.max(0,parseFloat(h))),T)h=parseInt(h*C,10)/100;if(Math.abs(h-C)<0.000001)return 1;return h%C/parseFloat(C)}function y(h){return Math.min(1,Math.max(0,h))}function i(h){return parseInt(h,16)}function t(h){return typeof h=="string"&&h.indexOf(".")!=-1&&parseFloat(h)===1}function U(h){return typeof h==="string"&&h.indexOf("%")!=-1}function w8(h){return h.length==1?"0"+h:""+h}function f8(h){if(h<=1)h=h*100+"%";return h}function T8(h){return Math.round(parseFloat(h)*255).toString(16)}function v8(h){return i(h)/255}var Y8=function(){var h="[-\\+]?\\d+%?",C="[-\\+]?\\d*\\.\\d+%?",T="(?:"+C+")|(?:"+h+")",V="[\\s|\\(]+("+T+")[,|\\s]+("+T+")[,|\\s]+("+T+")\\s*\\)?",x="[\\s|\\(]+("+T+")[,|\\s]+("+T+")[,|\\s]+("+T+")[,|\\s]+("+T+")\\s*\\)?";return{CSS_UNIT:new RegExp(T),rgb:new RegExp("rgb"+V),rgba:new RegExp("rgba"+x),hsl:new RegExp("hsl"+V),hsla:new RegExp("hsla"+x),hsv:new RegExp("hsv"+V),hsva:new RegExp("hsva"+x),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function R8(h){return!!Y8.CSS_UNIT.exec(h)}function Y6(h){h=h.replace(_,"").replace(j,"").toLowerCase();var C=!1;if(p[h])h=p[h],C=!0;else if(h=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var T;if(T=Y8.rgb.exec(h))return{r:T[1],g:T[2],b:T[3]};if(T=Y8.rgba.exec(h))return{r:T[1],g:T[2],b:T[3],a:T[4]};if(T=Y8.hsl.exec(h))return{h:T[1],s:T[2],l:T[3]};if(T=Y8.hsla.exec(h))return{h:T[1],s:T[2],l:T[3],a:T[4]};if(T=Y8.hsv.exec(h))return{h:T[1],s:T[2],v:T[3]};if(T=Y8.hsva.exec(h))return{h:T[1],s:T[2],v:T[3],a:T[4]};if(T=Y8.hex8.exec(h))return{r:i(T[1]),g:i(T[2]),b:i(T[3]),a:v8(T[4]),format:C?"name":"hex8"};if(T=Y8.hex6.exec(h))return{r:i(T[1]),g:i(T[2]),b:i(T[3]),format:C?"name":"hex"};if(T=Y8.hex4.exec(h))return{r:i(T[1]+""+T[1]),g:i(T[2]+""+T[2]),b:i(T[3]+""+T[3]),a:v8(T[4]+""+T[4]),format:C?"name":"hex8"};if(T=Y8.hex3.exec(h))return{r:i(T[1]+""+T[1]),g:i(T[2]+""+T[2]),b:i(T[3]+""+T[3]),format:C?"name":"hex"};return!1}function j6(h){var C,T;if(h=h||{level:"AA",size:"small"},C=(h.level||"AA").toUpperCase(),T=(h.size||"small").toLowerCase(),C!=="AA"&&C!=="AAA")C="AA";if(T!=="small"&&T!=="large")T="small";return{level:C,size:T}}return K})});var SY=q8((AM,bY)=>{var j3=hY(),MY={r:256,g:256,b:256,a:1},NY={h:360,s:1,v:1,a:1};function r2(q,_,j){let K={};for(let Y in q)if(q.hasOwnProperty(Y))K[Y]=j===0?0:(_[Y]-q[Y])/j;return K}function i2(q,_,j,K){let Y={};for(let f in _)if(_.hasOwnProperty(f))Y[f]=q[f]*j+_[f],Y[f]=Y[f]<0?Y[f]+K[f]:K[f]!==1?Y[f]%K[f]:Y[f];return Y}function c2(q,_,j){let K=q.color.toRgb(),Y=_.color.toRgb(),f=r2(K,Y,j),P=[q.color];for(let $=1;$<j;$++){let O=i2(f,K,$,MY);P.push(j3(O))}return P}function DY(q,_,j,K){let Y=q.color.toHsv(),f=_.color.toHsv();if(Y.s===0||f.s===0)return c2(q,_,j);let P;if(typeof K==="boolean")P=K;else{let v=Y.h<f.h&&f.h-Y.h<180||Y.h>f.h&&Y.h-f.h>180;P=K==="long"&&v||K==="short"&&!v}let $=r2(Y,f,j),O=[q.color],w;if(Y.h<=f.h&&!P||Y.h>=f.h&&P)w=f.h-Y.h;else if(P)w=360-f.h+Y.h;else w=360-Y.h+f.h;$.h=Math.pow(-1,P?1:0)*Math.abs(w)/j;for(let v=1;v<j;v++){let z=i2($,Y,v,NY);O.push(j3(z))}return O}function CY(q,_){let j=q.length;if(_=parseInt(_,10),isNaN(_)||_<2)throw new Error("Invalid number of steps (< 2)");if(_<j)throw new Error("Number of steps cannot be inferior to number of stops");let K=[];for(let f=1;f<j;f++){let P=(_-1)*(q[f].pos-q[f-1].pos);K.push(Math.max(1,Math.round(P)))}let Y=1;for(let f=j-1;f--;)Y+=K[f];while(Y!==_)if(Y<_){let f=Math.min.apply(null,K);K[K.indexOf(f)]++,Y++}else{let f=Math.max.apply(null,K);K[K.indexOf(f)]--,Y--}return K}function VY(q,_,j,K){if(_<0||_>1)throw new Error("Position must be between 0 and 1");let Y,f;for(let O=0,w=q.length;O<w-1;O++)if(_>=q[O].pos&&_<q[O+1].pos){Y=q[O],f=q[O+1];break}if(!Y)Y=f=q[q.length-1];let P=r2(Y.color[j](),f.color[j](),(f.pos-Y.pos)*100),$=i2(P,Y.color[j](),(_-Y.pos)*100,K);return j3($)}class Z7{constructor(q){if(q.length<2)throw new Error("Invalid number of stops (< 2)");let _=q[0].pos!==void 0,j=q.length,K=-1,Y=!1;if(this.stops=q.map((f,P)=>{let $=f.pos!==void 0;if(_^$)throw new Error("Cannot mix positionned and not posionned color stops");if($){let O=f.color!==void 0;if(!O&&(Y||P===0||P===j-1))throw new Error("Cannot define two consecutive position-only stops");if(Y=!O,f={color:O?j3(f.color):null,colorLess:!O,pos:f.pos},f.pos<0||f.pos>1)throw new Error("Color stops positions must be between 0 and 1");else if(f.pos<K)throw new Error("Color stops positions are not ordered");K=f.pos}else f={color:j3(f.color!==void 0?f.color:f),pos:P/(j-1)};return f}),this.stops[0].pos!==0)this.stops.unshift({color:this.stops[0].color,pos:0}),j++;if(this.stops[j-1].pos!==1)this.stops.push({color:this.stops[j-1].color,pos:1})}reverse(){let q=[];return this.stops.forEach(function(_){q.push({color:_.color,pos:1-_.pos})}),new Z7(q.reverse())}loop(){let q=[],_=[];return this.stops.forEach((j)=>{q.push({color:j.color,pos:j.pos/2})}),this.stops.slice(0,-1).forEach((j)=>{_.push({color:j.color,pos:1-j.pos/2})}),new Z7(q.concat(_.reverse()))}rgb(q){let _=CY(this.stops,q),j=[];this.stops.forEach((K,Y)=>{if(K.colorLess)K.color=c2(this.stops[Y-1],this.stops[Y+1],2)[1]});for(let K=0,Y=this.stops.length;K<Y-1;K++){let f=c2(this.stops[K],this.stops[K+1],_[K]);j.splice(j.length,0,...f)}return j.push(this.stops[this.stops.length-1].color),j}hsv(q,_){let j=CY(this.stops,q),K=[];this.stops.forEach((Y,f)=>{if(Y.colorLess)Y.color=DY(this.stops[f-1],this.stops[f+1],2,_)[1]});for(let Y=0,f=this.stops.length;Y<f-1;Y++){let P=DY(this.stops[Y],this.stops[Y+1],j[Y],_);K.splice(K.length,0,...P)}return K.push(this.stops[this.stops.length-1].color),K}css(q,_){q=q||"linear",_=_||(q==="linear"?"to right":"ellipse at center");let j=q+"-gradient("+_;return this.stops.forEach(function(K){j+=", "+(K.colorLess?"":K.color.toRgbString()+" ")+K.pos*100+"%"}),j+=")",j}rgbAt(q){return VY(this.stops,q,"toRgb",MY)}hsvAt(q){return VY(this.stops,q,"toHsv",NY)}}bY.exports=function(q){if(arguments.length===1){if(!Array.isArray(arguments[0]))throw new Error('"stops" is not an array');q=arguments[0]}else q=Array.prototype.slice.call(arguments);return new Z7(q)}});var dY=q8((SM,yY)=>{yY.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var LY=q8((yM,wG)=>{wG.exports={single:{topLeft:"┌",top:"─",topRight:"┐",right:"│",bottomRight:"┘",bottom:"─",bottomLeft:"└",left:"│"},double:{topLeft:"╔",top:"═",topRight:"╗",right:"║",bottomRight:"╝",bottom:"═",bottomLeft:"╚",left:"║"},round:{topLeft:"╭",top:"─",topRight:"╮",right:"│",bottomRight:"╯",bottom:"─",bottomLeft:"╰",left:"│"},bold:{topLeft:"┏",top:"━",topRight:"┓",right:"┃",bottomRight:"┛",bottom:"━",bottomLeft:"┗",left:"┃"},singleDouble:{topLeft:"╓",top:"─",topRight:"╖",right:"║",bottomRight:"╜",bottom:"─",bottomLeft:"╙",left:"║"},doubleSingle:{topLeft:"╒",top:"═",topRight:"╕",right:"│",bottomRight:"╛",bottom:"═",bottomLeft:"╘",left:"│"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"↘",top:"↓",topRight:"↙",right:"←",bottomRight:"↖",bottom:"↑",bottomLeft:"↗",left:"→"}}});var F2=q8((dM,e2)=>{var lY=LY();e2.exports=lY;e2.exports.default=lY});var oY=q8((LM,iY)=>{iY.exports=({onlyFirst:q=!1}={})=>{let _=["[\\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(_,q?void 0:"g")}});var BY=q8((lM,aY)=>{var TG=oY();aY.exports=(q)=>typeof q==="string"?q.replace(TG(),""):q});var eY=q8((xM,Q2)=>{var tY=(q)=>{if(Number.isNaN(q))return!1;if(q>=4352&&(q<=4447||q===9001||q===9002||11904<=q&&q<=12871&&q!==12351||12880<=q&&q<=19903||19968<=q&&q<=42182||43360<=q&&q<=43388||44032<=q&&q<=55203||63744<=q&&q<=64255||65040<=q&&q<=65049||65072<=q&&q<=65131||65281<=q&&q<=65376||65504<=q&&q<=65510||110592<=q&&q<=110593||127488<=q&&q<=127569||131072<=q&&q<=262141))return!0;return!1};Q2.exports=tY;Q2.exports.default=tY});var UY=q8((nM,FY)=>{FY.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 QY=q8((cM,q9)=>{var ZG=BY(),kG=eY(),XG=UY(),sY=(q)=>{if(typeof q!=="string"||q.length===0)return 0;if(q=ZG(q),q.length===0)return 0;q=q.replace(XG()," ");let _=0;for(let j=0;j<q.length;j++){let K=q.codePointAt(j);if(K<=31||K>=127&&K<=159)continue;if(K>=768&&K<=879)continue;if(K>65535)j++;_+=kG(K)?2:1}return _};q9.exports=sY;q9.exports.default=sY});var _f=q8((rM,qf)=>{var AG=QY();function A_(q,_){if(!q)return q;_=_||{};let j=_.align||"center";if(j==="left")return q;let K=_.split||`
291
- `,Y=_.pad||" ",f=j!=="right"?GG:uG,P=!1;if(!Array.isArray(q))P=!0,q=String(q).split(K);let $,O=0;return q=q.map(function(w){return w=String(w),$=AG(w),O=Math.max($,O),{str:w,width:$}}).map(function(w){return new Array(f(O,w.width)+1).join(Y)+w.str}),P?q.join(K):q}A_.left=function q(_){return A_(_,{align:"left"})};A_.center=function q(_){return A_(_,{align:"center"})};A_.right=function q(_){return A_(_,{align:"right"})};qf.exports=A_;function GG(q,_){return Math.floor((q-_)/2)}function uG(q,_){return q-_}});var Gf={};rq(Gf,{status:()=>z9});import{readFileSync as v9,existsSync as w3,readdirSync as Yu,statSync as fu}from"fs";import{join as D_,dirname as $u}from"path";import{execSync as wu}from"child_process";import{fileURLToPath as Ou}from"url";async function z9(){console.log("\uD83D\uDD0D Claude Memory System Status Check"),console.log(`=====================================
292
- `),console.log("\uD83D\uDCC2 Installed Hook Scripts:");let q=P8.getInstance(),_=q.getHooksDirectory(),j=D_(_,"pre-compact.js"),K=D_(_,"session-start.js"),Y=D_(_,"session-end.js"),f=(J,Z)=>{if(w3(J))console.log(` ✅ ${Z}: Found at ${J}`);else console.log(` ❌ ${Z}: Not found at ${J}`)};f(j,"pre-compact.js"),f(K,"session-start.js"),f(Y,"session-end.js"),console.log(""),console.log("⚙️ Settings Configuration:");let P=(J,Z)=>{if(!w3(Z)){console.log(` ⏭️ ${J}: No settings file`);return}console.log(` \uD83D\uDCCB ${J}: ${Z}`);try{let H=JSON.parse(v9(Z,"utf8")),X=H.hooks?.PreCompact?.some((D)=>D.hooks?.some((M)=>M.command?.includes("pre-compact.js")||M.command?.includes("claude-mem"))),A=H.hooks?.SessionStart?.some((D)=>D.hooks?.some((M)=>M.command?.includes("session-start.js")||M.command?.includes("claude-mem"))),G=H.hooks?.SessionEnd?.some((D)=>D.hooks?.some((M)=>M.command?.includes("session-end.js")||M.command?.includes("claude-mem")));console.log(` PreCompact: ${X?"✅":"❌"}`),console.log(` SessionStart: ${A?"✅":"❌"}`),console.log(` SessionEnd: ${G?"✅":"❌"}`)}catch(H){console.log(" ⚠️ Could not parse settings")}};P("Global",q.getClaudeSettingsPath()),P("Project",D_(process.cwd(),".claude","settings.json")),console.log(""),console.log("\uD83D\uDCE6 Compressed Transcripts:");let $=D_(q.getClaudeConfigDirectory(),"projects");if(w3($))try{let J=0,Z=0,H=(X,A=0)=>{if(A>3)return;let G=Yu(X);for(let D of G){let M=D_(X,D);if(fu(M).isDirectory()&&!D.startsWith("."))H(M,A+1);else if(D.endsWith(".jsonl.compressed"))J++;else if(D.endsWith(".jsonl.archive"))Z++}};H($),console.log(` Compressed files: ${J}`),console.log(` Archive files: ${Z}`)}catch(J){console.log(" ⚠️ Could not scan projects directory")}else console.log(" ℹ️ No Claude projects directory found");console.log(""),console.log("\uD83D\uDD27 Runtime Environment:");let O=(J,Z)=>{try{let H=wu(`${J} --version`,{encoding:"utf8"}).trim();console.log(` ✅ ${Z}: ${H}`)}catch{console.log(` ❌ ${Z}: Not found`)}};O("node","Node.js"),O("bun","Bun"),console.log(""),console.log("\uD83E\uDDE0 Chroma Storage Status:"),console.log(" ✅ Storage backend: Chroma MCP"),console.log(` \uD83D\uDCCD Data location: ${q.getChromaDirectory()}`),console.log(" \uD83D\uDD0D Features: Vector search, semantic similarity, document storage"),console.log(""),console.log("\uD83D\uDCCA Summary:");let w=q.getClaudeSettingsPath(),v=D_(process.cwd(),".claude","settings.json"),z=!1,W="Not installed";try{if(w3(w)){let J=JSON.parse(v9(w,"utf8"));if(J.hooks?.PreCompact||J.hooks?.SessionStart||J.hooks?.SessionEnd)z=!0,W="Global"}if(w3(v)){let J=JSON.parse(v9(v,"utf8"));if(J.hooks?.PreCompact||J.hooks?.SessionStart||J.hooks?.SessionEnd)z=!0,W=W==="Global"?"Global + Project":"Project"}}catch{}if(z)console.log(` ✅ Claude Memory System is installed (${W})`),console.log(""),console.log("\uD83D\uDCA1 To test: Use /compact in Claude Code");else console.log(" ❌ Claude Memory System is not installed"),console.log(""),console.log("\uD83D\uDCA1 To install: claude-mem install")}var S0;var W9=Q8(()=>{p6();S0=$u(Ou(import.meta.url))});var hf={};rq(hf,{logs:()=>J9});import{readFileSync as vu,readdirSync as zu,statSync as Wu}from"fs";import{join as uf}from"path";async function Ju(q,_,j){try{let f=vu(q,"utf8").split(`
293
- `).filter((P)=>P.trim()).slice(-j);if(console.log(`\uD83D\uDCCB ${_} Logs (last ${j} lines):`),console.log(` File: ${q}`),console.log(""),f.length===0)console.log(" No log entries found");else f.forEach((P)=>{console.log(` ${P}`)});console.log("")}catch(K){console.log(`❌ Could not read ${_.toLowerCase()} log: ${q}`)}}async function J9(q={}){let _=P8.getLogsDirectory(),j=parseInt(q.tail)||20;try{let Y=zu(_).filter((f)=>f.startsWith("claude-mem-")&&f.endsWith(".log")).map((f)=>({name:f,path:uf(_,f),mtime:Wu(uf(_,f)).mtime})).sort((f,P)=>P.mtime.getTime()-f.mtime.getTime());if(Y.length===0){console.log("❌ No log files found in ~/.claude-mem/logs/");return}if(await Ju(Y[0].path,"Most Recent",j),q.all&&Y.length>1)console.log(`\uD83D\uDCDA Found ${Y.length} total log files`)}catch(K){console.log("❌ Could not read logs directory: ~/.claude-mem/logs/"),console.log(" Run a compression first to generate logs")}if(q.follow)console.log("Following logs... (Press Ctrl+C to stop)"),setInterval(()=>{},1000)}var H9=Q8(()=>{p6()});import O3 from"fs";import{join as Hu}from"path";function Tu(q){if(q===0)return"0 B";let _=1024,j=["B","KB","MB","GB"],K=Math.floor(Math.log(q)/Math.log(_));return parseFloat((q/Math.pow(_,K)).toFixed(1))+" "+j[K]}function Zu(){let q=P8.getInstance().getTrashDirectory();if(!O3.existsSync(q))return{folderCount:0,fileCount:0,totalSize:0,isEmpty:!0};let _=O3.readdirSync(q);if(_.length===0)return{folderCount:0,fileCount:0,totalSize:0,isEmpty:!0};let j=0,K=0,Y=0;for(let f of _){let P=Hu(q,f),$=O3.statSync(P);if($.isDirectory())j++;else K++;Y+=$.size}return{folderCount:j,fileCount:K,totalSize:Y,isEmpty:!1}}async function D7(q={}){let j=P8.getInstance().getIndexPath();try{if(!O3.existsSync(j)){if(q.format==="session-start")console.log(xK("NO_MEMORIES",q.project||"this project"));return}let Y=O3.readFileSync(j,"utf-8").trim().split(`
294
- `).filter((w)=>w.trim());if(Y.length===0){if(q.format==="session-start")console.log(xK("NO_MEMORIES",q.project||"this project"));return}let f=[];for(let w of Y)try{if(!w.trim().startsWith("{"))continue;let v=JSON.parse(w);f.push(v)}catch(v){continue}if(f.length===0){if(q.format==="session-start")console.log(xK("NO_MEMORIES",q.project||"this project"));return}let P=f;if(q.project)P=f.filter((w)=>w.project===q.project);let $=q.format==="session-start"?30:10,O=P.slice(-$);if(q.format==="session-start"){let w="recently",v=O.map((z)=>{return z.timestamp?new Date(z.timestamp):null}).filter((z)=>z!==null).sort((z,W)=>W.getTime()-z.getTime());if(v.length>0)w=R1(v[0]);I1({projectName:q.project||"your project",memoryCount:O.length,lastSessionTime:w,recentObjects:O})}else if(q.format==="json")console.log(JSON.stringify(O));else console.log(a3("Context loading",O.length,"recent memories found")),O.forEach((w)=>{if(w.type==="memory")console.log(`${w.text} | ${w.document_id} | ${w.keywords}`);else if(w.type==="overview")console.log(`**Overview:** ${w.content}`);else if(w.type==="session")console.log(`# Session: ${w.session_id} [${w.timestamp}]`);else console.log(JSON.stringify(w))});if(q.format!=="json"){let w=Zu();if(!w.isEmpty){let v=Tu(w.totalSize);console.log(`\uD83D\uDDD1️ Trash – ${w.folderCount} folders | ${w.fileCount} files | ${v} – use \`$ claude-mem restore\` for more options.`)}}}catch(K){let Y=K instanceof Error?K.message:String(K);if(q.format==="session-start")console.log(xK("CONNECTION_FAILED",Y));else console.log(i_("Context loading",Y,"Check file permissions and try again"))}}var T9=Q8(()=>{p6();e4()});var d$={};rq(d$,{viewTrash:()=>MD});import{readdirSync as m$,statSync as I$}from"fs";import{join as g$}from"path";function VD(q){let _=q.lastIndexOf(".");if(_===-1)return{name:q,timestamp:0};let j=parseInt(q.substring(_+1));if(isNaN(j))return{name:q,timestamp:0};return{name:q.substring(0,_),timestamp:j}}function R$(q){if(q===0)return"0 B";let _=1024,j=["B","KB","MB","GB"],K=Math.floor(Math.log(q)/Math.log(_));return parseFloat((q/Math.pow(_,K)).toFixed(2))+" "+j[K]}function y$(q){let _=0,j=m$(q);for(let K of j){let Y=g$(q,K),f=I$(Y);if(f.isDirectory())_+=y$(Y);else _+=f.size}return _}async function MD(){let q=P8.getInstance().getTrashDirectory();try{let _=m$(q);if(_.length===0){_6.info("\uD83D\uDDD1️ Trash is empty");return}let j=_.map((P)=>{let $=g$(q,P),O=I$($),{name:w,timestamp:v}=VD(P),z=O.isDirectory()?y$($):O.size;return{originalName:w,trashedName:P,size:z,trashedAt:new Date(v),isDirectory:O.isDirectory()}});j.sort((P,$)=>$.trashedAt.getTime()-P.trashedAt.getTime()),console.log(`
294
+ `)},info:(q)=>{_6.message(q,{symbol:a.default.blue(IA)})},success:(q)=>{_6.message(q,{symbol:a.default.green(gA)})},step:(q)=>{_6.message(q,{symbol:a.default.green(Z7)})},warn:(q)=>{_6.message(q,{symbol:a.default.yellow(yA)})},warning:(q)=>{_6.warn(q)},error:(q)=>{_6.message(q,{symbol:a.default.red(dA)})}},TM=`${a.default.gray(h8)} `});var Nf=q8((e2,F2)=>{(function(q,_){typeof e2==="object"&&typeof F2!=="undefined"?F2.exports=_():typeof define==="function"&&define.amd?define(_):(q=typeof globalThis!=="undefined"?globalThis:q||self,q.tinycolor=_())})(e2,function(){function q(h){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},q(h)}var _=/^\s+/,j=/\s+$/;function K(h,C){if(h=h?h:"",C=C||{},h instanceof K)return h;if(!(this instanceof K))return new K(h,C);var T=f(h);if(this._originalInput=h,this._r=T.r,this._g=T.g,this._b=T.b,this._a=T.a,this._roundA=Math.round(100*this._a)/100,this._format=C.format||T.format,this._gradientType=C.gradientType,this._r<1)this._r=Math.round(this._r);if(this._g<1)this._g=Math.round(this._g);if(this._b<1)this._b=Math.round(this._b);this._ok=T.ok}K.prototype={isDark:function h(){return this.getBrightness()<128},isLight:function h(){return!this.isDark()},isValid:function h(){return this._ok},getOriginalInput:function h(){return this._originalInput},getFormat:function h(){return this._format},getAlpha:function h(){return this._a},getBrightness:function h(){var C=this.toRgb();return(C.r*299+C.g*587+C.b*114)/1000},getLuminance:function h(){var C=this.toRgb(),T,M,x,o,c,B;if(T=C.r/255,M=C.g/255,x=C.b/255,T<=0.03928)o=T/12.92;else o=Math.pow((T+0.055)/1.055,2.4);if(M<=0.03928)c=M/12.92;else c=Math.pow((M+0.055)/1.055,2.4);if(x<=0.03928)B=x/12.92;else B=Math.pow((x+0.055)/1.055,2.4);return 0.2126*o+0.7152*c+0.0722*B},setAlpha:function h(C){return this._a=R(C),this._roundA=Math.round(100*this._a)/100,this},toHsv:function h(){var C=O(this._r,this._g,this._b);return{h:C.h*360,s:C.s,v:C.v,a:this._a}},toHsvString:function h(){var C=O(this._r,this._g,this._b),T=Math.round(C.h*360),M=Math.round(C.s*100),x=Math.round(C.v*100);return this._a==1?"hsv("+T+", "+M+"%, "+x+"%)":"hsva("+T+", "+M+"%, "+x+"%, "+this._roundA+")"},toHsl:function h(){var C=P(this._r,this._g,this._b);return{h:C.h*360,s:C.s,l:C.l,a:this._a}},toHslString:function h(){var C=P(this._r,this._g,this._b),T=Math.round(C.h*360),M=Math.round(C.s*100),x=Math.round(C.l*100);return this._a==1?"hsl("+T+", "+M+"%, "+x+"%)":"hsla("+T+", "+M+"%, "+x+"%, "+this._roundA+")"},toHex:function h(C){return v(this._r,this._g,this._b,C)},toHexString:function h(C){return"#"+this.toHex(C)},toHex8:function h(C){return z(this._r,this._g,this._b,this._a,C)},toHex8String:function h(C){return"#"+this.toHex8(C)},toRgb:function h(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function h(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function h(){return{r:Math.round(I(this._r,255)*100)+"%",g:Math.round(I(this._g,255)*100)+"%",b:Math.round(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function h(){return this._a==1?"rgb("+Math.round(I(this._r,255)*100)+"%, "+Math.round(I(this._g,255)*100)+"%, "+Math.round(I(this._b,255)*100)+"%)":"rgba("+Math.round(I(this._r,255)*100)+"%, "+Math.round(I(this._g,255)*100)+"%, "+Math.round(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function h(){if(this._a===0)return"transparent";if(this._a<1)return!1;return r[v(this._r,this._g,this._b,!0)]||!1},toFilter:function h(C){var T="#"+W(this._r,this._g,this._b,this._a),M=T,x=this._gradientType?"GradientType = 1, ":"";if(C){var o=K(C);M="#"+W(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+x+"startColorstr="+T+",endColorstr="+M+")"},toString:function h(C){var T=!!C;C=C||this._format;var M=!1,x=this._a<1&&this._a>=0,o=!T&&x&&(C==="hex"||C==="hex6"||C==="hex3"||C==="hex4"||C==="hex8"||C==="name");if(o){if(C==="name"&&this._a===0)return this.toName();return this.toRgbString()}if(C==="rgb")M=this.toRgbString();if(C==="prgb")M=this.toPercentageRgbString();if(C==="hex"||C==="hex6")M=this.toHexString();if(C==="hex3")M=this.toHexString(!0);if(C==="hex4")M=this.toHex8String(!0);if(C==="hex8")M=this.toHex8String();if(C==="name")M=this.toName();if(C==="hsl")M=this.toHslString();if(C==="hsv")M=this.toHsvString();return M||this.toHexString()},clone:function h(){return K(this.toString())},_applyModification:function h(C,T){var M=C.apply(null,[this].concat([].slice.call(T)));return this._r=M._r,this._g=M._g,this._b=M._b,this.setAlpha(M._a),this},lighten:function h(){return this._applyModification(X,arguments)},brighten:function h(){return this._applyModification(A,arguments)},darken:function h(){return this._applyModification(G,arguments)},desaturate:function h(){return this._applyModification(H,arguments)},saturate:function h(){return this._applyModification(Z,arguments)},greyscale:function h(){return this._applyModification(J,arguments)},spin:function h(){return this._applyModification(D,arguments)},_applyCombination:function h(C,T){return C.apply(null,[this].concat([].slice.call(T)))},analogous:function h(){return this._applyCombination(b,arguments)},complement:function h(){return this._applyCombination(V,arguments)},monochromatic:function h(){return this._applyCombination(d,arguments)},splitcomplement:function h(){return this._applyCombination(S,arguments)},triad:function h(){return this._applyCombination(m,[3])},tetrad:function h(){return this._applyCombination(m,[4])}},K.fromRatio=function(h,C){if(q(h)=="object"){var T={};for(var M in h)if(h.hasOwnProperty(M))if(M==="a")T[M]=h[M];else T[M]=Y8(h[M]);h=T}return K(h,C)};function f(h){var C={r:0,g:0,b:0},T=1,M=null,x=null,o=null,c=!1,B=!1;if(typeof h=="string")h=f6(h);if(q(h)=="object"){if(R8(h.r)&&R8(h.g)&&R8(h.b))C=Y(h.r,h.g,h.b),c=!0,B=String(h.r).substr(-1)==="%"?"prgb":"rgb";else if(R8(h.h)&&R8(h.s)&&R8(h.v))M=Y8(h.s),x=Y8(h.v),C=w(h.h,M,x),c=!0,B="hsv";else if(R8(h.h)&&R8(h.s)&&R8(h.l))M=Y8(h.s),o=Y8(h.l),C=$(h.h,M,o),c=!0,B="hsl";if(h.hasOwnProperty("a"))T=h.a}return T=R(T),{ok:c,format:h.format||B,r:Math.min(255,Math.max(C.r,0)),g:Math.min(255,Math.max(C.g,0)),b:Math.min(255,Math.max(C.b,0)),a:T}}function Y(h,C,T){return{r:I(h,255)*255,g:I(C,255)*255,b:I(T,255)*255}}function P(h,C,T){h=I(h,255),C=I(C,255),T=I(T,255);var M=Math.max(h,C,T),x=Math.min(h,C,T),o,c,B=(M+x)/2;if(M==x)o=c=0;else{var K8=M-x;switch(c=B>0.5?K8/(2-M-x):K8/(M+x),M){case h:o=(C-T)/K8+(C<T?6:0);break;case C:o=(T-h)/K8+2;break;case T:o=(h-C)/K8+4;break}o/=6}return{h:o,s:c,l:B}}function $(h,C,T){var M,x,o;h=I(h,360),C=I(C,100),T=I(T,100);function c(W8,$8,A8){if(A8<0)A8+=1;if(A8>1)A8-=1;if(A8<0.16666666666666666)return W8+($8-W8)*6*A8;if(A8<0.5)return $8;if(A8<0.6666666666666666)return W8+($8-W8)*(0.6666666666666666-A8)*6;return W8}if(C===0)M=x=o=T;else{var B=T<0.5?T*(1+C):T+C-T*C,K8=2*T-B;M=c(K8,B,h+0.3333333333333333),x=c(K8,B,h),o=c(K8,B,h-0.3333333333333333)}return{r:M*255,g:x*255,b:o*255}}function O(h,C,T){h=I(h,255),C=I(C,255),T=I(T,255);var M=Math.max(h,C,T),x=Math.min(h,C,T),o,c,B=M,K8=M-x;if(c=M===0?0:K8/M,M==x)o=0;else{switch(M){case h:o=(C-T)/K8+(C<T?6:0);break;case C:o=(T-h)/K8+2;break;case T:o=(h-C)/K8+4;break}o/=6}return{h:o,s:c,v:B}}function w(h,C,T){h=I(h,360)*6,C=I(C,100),T=I(T,100);var M=Math.floor(h),x=h-M,o=T*(1-C),c=T*(1-x*C),B=T*(1-(1-x)*C),K8=M%6,W8=[T,c,o,o,B,T][K8],$8=[B,T,T,c,o,o][K8],A8=[o,o,B,T,T,c][K8];return{r:W8*255,g:$8*255,b:A8*255}}function v(h,C,T,M){var x=[w8(Math.round(h).toString(16)),w8(Math.round(C).toString(16)),w8(Math.round(T).toString(16))];if(M&&x[0].charAt(0)==x[0].charAt(1)&&x[1].charAt(0)==x[1].charAt(1)&&x[2].charAt(0)==x[2].charAt(1))return x[0].charAt(0)+x[1].charAt(0)+x[2].charAt(0);return x.join("")}function z(h,C,T,M,x){var o=[w8(Math.round(h).toString(16)),w8(Math.round(C).toString(16)),w8(Math.round(T).toString(16)),w8(T8(M))];if(x&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}function W(h,C,T,M){var x=[w8(T8(M)),w8(Math.round(h).toString(16)),w8(Math.round(C).toString(16)),w8(Math.round(T).toString(16))];return x.join("")}K.equals=function(h,C){if(!h||!C)return!1;return K(h).toRgbString()==K(C).toRgbString()},K.random=function(){return K.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function H(h,C){C=C===0?0:C||10;var T=K(h).toHsl();return T.s-=C/100,T.s=y(T.s),K(T)}function Z(h,C){C=C===0?0:C||10;var T=K(h).toHsl();return T.s+=C/100,T.s=y(T.s),K(T)}function J(h){return K(h).desaturate(100)}function X(h,C){C=C===0?0:C||10;var T=K(h).toHsl();return T.l+=C/100,T.l=y(T.l),K(T)}function A(h,C){C=C===0?0:C||10;var T=K(h).toRgb();return T.r=Math.max(0,Math.min(255,T.r-Math.round(255*-(C/100)))),T.g=Math.max(0,Math.min(255,T.g-Math.round(255*-(C/100)))),T.b=Math.max(0,Math.min(255,T.b-Math.round(255*-(C/100)))),K(T)}function G(h,C){C=C===0?0:C||10;var T=K(h).toHsl();return T.l-=C/100,T.l=y(T.l),K(T)}function D(h,C){var T=K(h).toHsl(),M=(T.h+C)%360;return T.h=M<0?360+M:M,K(T)}function V(h){var C=K(h).toHsl();return C.h=(C.h+180)%360,K(C)}function m(h,C){if(isNaN(C)||C<=0)throw new Error("Argument to polyad must be a positive number");var T=K(h).toHsl(),M=[K(h)],x=360/C;for(var o=1;o<C;o++)M.push(K({h:(T.h+o*x)%360,s:T.s,l:T.l}));return M}function S(h){var C=K(h).toHsl(),T=C.h;return[K(h),K({h:(T+72)%360,s:C.s,l:C.l}),K({h:(T+216)%360,s:C.s,l:C.l})]}function b(h,C,T){C=C||6,T=T||30;var M=K(h).toHsl(),x=360/T,o=[K(h)];for(M.h=(M.h-(x*C>>1)+720)%360;--C;)M.h=(M.h+x)%360,o.push(K(M));return o}function d(h,C){C=C||6;var T=K(h).toHsv(),M=T.h,x=T.s,o=T.v,c=[],B=1/C;while(C--)c.push(K({h:M,s:x,v:o})),o=(o+B)%1;return c}K.mix=function(h,C,T){T=T===0?0:T||50;var M=K(h).toRgb(),x=K(C).toRgb(),o=T/100,c={r:(x.r-M.r)*o+M.r,g:(x.g-M.g)*o+M.g,b:(x.b-M.b)*o+M.b,a:(x.a-M.a)*o+M.a};return K(c)},K.readability=function(h,C){var T=K(h),M=K(C);return(Math.max(T.getLuminance(),M.getLuminance())+0.05)/(Math.min(T.getLuminance(),M.getLuminance())+0.05)},K.isReadable=function(h,C,T){var M=K.readability(h,C),x,o;switch(o=!1,x=j6(T),x.level+x.size){case"AAsmall":case"AAAlarge":o=M>=4.5;break;case"AAlarge":o=M>=3;break;case"AAAsmall":o=M>=7;break}return o},K.mostReadable=function(h,C,T){var M=null,x=0,o,c,B,K8;T=T||{},c=T.includeFallbackColors,B=T.level,K8=T.size;for(var W8=0;W8<C.length;W8++)if(o=K.readability(h,C[W8]),o>x)x=o,M=K(C[W8]);if(K.isReadable(h,M,{level:B,size:K8})||!c)return M;else return T.includeFallbackColors=!1,K.mostReadable(h,["#fff","#000"],T)};var p=K.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},r=K.hexNames=l(p);function l(h){var C={};for(var T in h)if(h.hasOwnProperty(T))C[h[T]]=T;return C}function R(h){if(h=parseFloat(h),isNaN(h)||h<0||h>1)h=1;return h}function I(h,C){if(t(h))h="100%";var T=U(h);if(h=Math.min(C,Math.max(0,parseFloat(h))),T)h=parseInt(h*C,10)/100;if(Math.abs(h-C)<0.000001)return 1;return h%C/parseFloat(C)}function y(h){return Math.min(1,Math.max(0,h))}function i(h){return parseInt(h,16)}function t(h){return typeof h=="string"&&h.indexOf(".")!=-1&&parseFloat(h)===1}function U(h){return typeof h==="string"&&h.indexOf("%")!=-1}function w8(h){return h.length==1?"0"+h:""+h}function Y8(h){if(h<=1)h=h*100+"%";return h}function T8(h){return Math.round(parseFloat(h)*255).toString(16)}function v8(h){return i(h)/255}var f8=function(){var h="[-\\+]?\\d+%?",C="[-\\+]?\\d*\\.\\d+%?",T="(?:"+C+")|(?:"+h+")",M="[\\s|\\(]+("+T+")[,|\\s]+("+T+")[,|\\s]+("+T+")\\s*\\)?",x="[\\s|\\(]+("+T+")[,|\\s]+("+T+")[,|\\s]+("+T+")[,|\\s]+("+T+")\\s*\\)?";return{CSS_UNIT:new RegExp(T),rgb:new RegExp("rgb"+M),rgba:new RegExp("rgba"+x),hsl:new RegExp("hsl"+M),hsla:new RegExp("hsla"+x),hsv:new RegExp("hsv"+M),hsva:new RegExp("hsva"+x),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function R8(h){return!!f8.CSS_UNIT.exec(h)}function f6(h){h=h.replace(_,"").replace(j,"").toLowerCase();var C=!1;if(p[h])h=p[h],C=!0;else if(h=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var T;if(T=f8.rgb.exec(h))return{r:T[1],g:T[2],b:T[3]};if(T=f8.rgba.exec(h))return{r:T[1],g:T[2],b:T[3],a:T[4]};if(T=f8.hsl.exec(h))return{h:T[1],s:T[2],l:T[3]};if(T=f8.hsla.exec(h))return{h:T[1],s:T[2],l:T[3],a:T[4]};if(T=f8.hsv.exec(h))return{h:T[1],s:T[2],v:T[3]};if(T=f8.hsva.exec(h))return{h:T[1],s:T[2],v:T[3],a:T[4]};if(T=f8.hex8.exec(h))return{r:i(T[1]),g:i(T[2]),b:i(T[3]),a:v8(T[4]),format:C?"name":"hex8"};if(T=f8.hex6.exec(h))return{r:i(T[1]),g:i(T[2]),b:i(T[3]),format:C?"name":"hex"};if(T=f8.hex4.exec(h))return{r:i(T[1]+""+T[1]),g:i(T[2]+""+T[2]),b:i(T[3]+""+T[3]),a:v8(T[4]+""+T[4]),format:C?"name":"hex8"};if(T=f8.hex3.exec(h))return{r:i(T[1]+""+T[1]),g:i(T[2]+""+T[2]),b:i(T[3]+""+T[3]),format:C?"name":"hex"};return!1}function j6(h){var C,T;if(h=h||{level:"AA",size:"small"},C=(h.level||"AA").toUpperCase(),T=(h.size||"small").toLowerCase(),C!=="AA"&&C!=="AAA")C="AA";if(T!=="small"&&T!=="large")T="small";return{level:C,size:T}}return K})});var gf=q8((EM,If)=>{var w3=Nf(),Rf={r:256,g:256,b:256,a:1},mf={h:360,s:1,v:1,a:1};function s2(q,_,j){let K={};for(let f in q)if(q.hasOwnProperty(f))K[f]=j===0?0:(_[f]-q[f])/j;return K}function Q2(q,_,j,K){let f={};for(let Y in _)if(_.hasOwnProperty(Y))f[Y]=q[Y]*j+_[Y],f[Y]=f[Y]<0?f[Y]+K[Y]:K[Y]!==1?f[Y]%K[Y]:f[Y];return f}function U2(q,_,j){let K=q.color.toRgb(),f=_.color.toRgb(),Y=s2(K,f,j),P=[q.color];for(let $=1;$<j;$++){let O=Q2(Y,K,$,Rf);P.push(w3(O))}return P}function bf(q,_,j,K){let f=q.color.toHsv(),Y=_.color.toHsv();if(f.s===0||Y.s===0)return U2(q,_,j);let P;if(typeof K==="boolean")P=K;else{let v=f.h<Y.h&&Y.h-f.h<180||f.h>Y.h&&f.h-Y.h>180;P=K==="long"&&v||K==="short"&&!v}let $=s2(f,Y,j),O=[q.color],w;if(f.h<=Y.h&&!P||f.h>=Y.h&&P)w=Y.h-f.h;else if(P)w=360-Y.h+f.h;else w=360-f.h+Y.h;$.h=Math.pow(-1,P?1:0)*Math.abs(w)/j;for(let v=1;v<j;v++){let z=Q2($,f,v,mf);O.push(w3(z))}return O}function Sf(q,_){let j=q.length;if(_=parseInt(_,10),isNaN(_)||_<2)throw new Error("Invalid number of steps (< 2)");if(_<j)throw new Error("Number of steps cannot be inferior to number of stops");let K=[];for(let Y=1;Y<j;Y++){let P=(_-1)*(q[Y].pos-q[Y-1].pos);K.push(Math.max(1,Math.round(P)))}let f=1;for(let Y=j-1;Y--;)f+=K[Y];while(f!==_)if(f<_){let Y=Math.min.apply(null,K);K[K.indexOf(Y)]++,f++}else{let Y=Math.max.apply(null,K);K[K.indexOf(Y)]--,f--}return K}function Ef(q,_,j,K){if(_<0||_>1)throw new Error("Position must be between 0 and 1");let f,Y;for(let O=0,w=q.length;O<w-1;O++)if(_>=q[O].pos&&_<q[O+1].pos){f=q[O],Y=q[O+1];break}if(!f)f=Y=q[q.length-1];let P=s2(f.color[j](),Y.color[j](),(Y.pos-f.pos)*100),$=Q2(P,f.color[j](),(_-f.pos)*100,K);return w3($)}class u7{constructor(q){if(q.length<2)throw new Error("Invalid number of stops (< 2)");let _=q[0].pos!==void 0,j=q.length,K=-1,f=!1;if(this.stops=q.map((Y,P)=>{let $=Y.pos!==void 0;if(_^$)throw new Error("Cannot mix positionned and not posionned color stops");if($){let O=Y.color!==void 0;if(!O&&(f||P===0||P===j-1))throw new Error("Cannot define two consecutive position-only stops");if(f=!O,Y={color:O?w3(Y.color):null,colorLess:!O,pos:Y.pos},Y.pos<0||Y.pos>1)throw new Error("Color stops positions must be between 0 and 1");else if(Y.pos<K)throw new Error("Color stops positions are not ordered");K=Y.pos}else Y={color:w3(Y.color!==void 0?Y.color:Y),pos:P/(j-1)};return Y}),this.stops[0].pos!==0)this.stops.unshift({color:this.stops[0].color,pos:0}),j++;if(this.stops[j-1].pos!==1)this.stops.push({color:this.stops[j-1].color,pos:1})}reverse(){let q=[];return this.stops.forEach(function(_){q.push({color:_.color,pos:1-_.pos})}),new u7(q.reverse())}loop(){let q=[],_=[];return this.stops.forEach((j)=>{q.push({color:j.color,pos:j.pos/2})}),this.stops.slice(0,-1).forEach((j)=>{_.push({color:j.color,pos:1-j.pos/2})}),new u7(q.concat(_.reverse()))}rgb(q){let _=Sf(this.stops,q),j=[];this.stops.forEach((K,f)=>{if(K.colorLess)K.color=U2(this.stops[f-1],this.stops[f+1],2)[1]});for(let K=0,f=this.stops.length;K<f-1;K++){let Y=U2(this.stops[K],this.stops[K+1],_[K]);j.splice(j.length,0,...Y)}return j.push(this.stops[this.stops.length-1].color),j}hsv(q,_){let j=Sf(this.stops,q),K=[];this.stops.forEach((f,Y)=>{if(f.colorLess)f.color=bf(this.stops[Y-1],this.stops[Y+1],2,_)[1]});for(let f=0,Y=this.stops.length;f<Y-1;f++){let P=bf(this.stops[f],this.stops[f+1],j[f],_);K.splice(K.length,0,...P)}return K.push(this.stops[this.stops.length-1].color),K}css(q,_){q=q||"linear",_=_||(q==="linear"?"to right":"ellipse at center");let j=q+"-gradient("+_;return this.stops.forEach(function(K){j+=", "+(K.colorLess?"":K.color.toRgbString()+" ")+K.pos*100+"%"}),j+=")",j}rgbAt(q){return Ef(this.stops,q,"toRgb",Rf)}hsvAt(q){return Ef(this.stops,q,"toHsv",mf)}}If.exports=function(q){if(arguments.length===1){if(!Array.isArray(arguments[0]))throw new Error('"stops" is not an array');q=arguments[0]}else q=Array.prototype.slice.call(arguments);return new u7(q)}});var nf=q8((xM,xf)=>{xf.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var rf=q8((aM,kG)=>{kG.exports={single:{topLeft:"┌",top:"─",topRight:"┐",right:"│",bottomRight:"┘",bottom:"─",bottomLeft:"└",left:"│"},double:{topLeft:"╔",top:"═",topRight:"╗",right:"║",bottomRight:"╝",bottom:"═",bottomLeft:"╚",left:"║"},round:{topLeft:"╭",top:"─",topRight:"╮",right:"│",bottomRight:"╯",bottom:"─",bottomLeft:"╰",left:"│"},bold:{topLeft:"┏",top:"━",topRight:"┓",right:"┃",bottomRight:"┛",bottom:"━",bottomLeft:"┗",left:"┃"},singleDouble:{topLeft:"╓",top:"─",topRight:"╖",right:"║",bottomRight:"╜",bottom:"─",bottomLeft:"╙",left:"║"},doubleSingle:{topLeft:"╒",top:"═",topRight:"╕",right:"│",bottomRight:"╛",bottom:"═",bottomLeft:"╘",left:"│"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"↘",top:"↓",topRight:"↙",right:"←",bottomRight:"↖",bottom:"↑",bottomLeft:"↗",left:"→"}}});var f9=q8((BM,P9)=>{var of=rf();P9.exports=of;P9.exports.default=of});var Uf=q8((eM,Ff)=>{Ff.exports=({onlyFirst:q=!1}={})=>{let _=["[\\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(_,q?void 0:"g")}});var Qf=q8((FM,sf)=>{var CG=Uf();sf.exports=(q)=>typeof q==="string"?q.replace(CG(),""):q});var _Y=q8((UM,w9)=>{var qY=(q)=>{if(Number.isNaN(q))return!1;if(q>=4352&&(q<=4447||q===9001||q===9002||11904<=q&&q<=12871&&q!==12351||12880<=q&&q<=19903||19968<=q&&q<=42182||43360<=q&&q<=43388||44032<=q&&q<=55203||63744<=q&&q<=64255||65040<=q&&q<=65049||65072<=q&&q<=65131||65281<=q&&q<=65376||65504<=q&&q<=65510||110592<=q&&q<=110593||127488<=q&&q<=127569||131072<=q&&q<=262141))return!0;return!1};w9.exports=qY;w9.exports.default=qY});var jY=q8((sM,KY)=>{KY.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 fY=q8((QM,O9)=>{var VG=Qf(),MG=_Y(),NG=jY(),PY=(q)=>{if(typeof q!=="string"||q.length===0)return 0;if(q=VG(q),q.length===0)return 0;q=q.replace(NG()," ");let _=0;for(let j=0;j<q.length;j++){let K=q.codePointAt(j);if(K<=31||K>=127&&K<=159)continue;if(K>=768&&K<=879)continue;if(K>65535)j++;_+=MG(K)?2:1}return _};O9.exports=PY;O9.exports.default=PY});var $Y=q8((q0,YY)=>{var bG=fY();function u_(q,_){if(!q)return q;_=_||{};let j=_.align||"center";if(j==="left")return q;let K=_.split||`
295
+ `,f=_.pad||" ",Y=j!=="right"?SG:EG,P=!1;if(!Array.isArray(q))P=!0,q=String(q).split(K);let $,O=0;return q=q.map(function(w){return w=String(w),$=bG(w),O=Math.max($,O),{str:w,width:$}}).map(function(w){return new Array(Y(O,w.width)+1).join(f)+w.str}),P?q.join(K):q}u_.left=function q(_){return u_(_,{align:"left"})};u_.center=function q(_){return u_(_,{align:"center"})};u_.right=function q(_){return u_(_,{align:"right"})};YY.exports=u_;function SG(q,_){return Math.floor((q-_)/2)}function EG(q,_){return q-_}});var MY={};iq(MY,{status:()=>G9});import{readFileSync as A9,existsSync as J3,readdirSync as Hu,statSync as Tu}from"fs";import{join as V_,dirname as Zu}from"path";import{execSync as ku}from"child_process";import{fileURLToPath as Xu}from"url";async function G9(){console.log("\uD83D\uDD0D Claude Memory System Status Check"),console.log(`=====================================
296
+ `),console.log("\uD83D\uDCC2 Installed Hook Scripts:");let q=P8.getInstance(),_=q.getHooksDirectory(),j=V_(_,"pre-compact.js"),K=V_(_,"session-start.js"),f=V_(_,"session-end.js"),Y=(H,Z)=>{if(J3(H))console.log(` ✅ ${Z}: Found at ${H}`);else console.log(` ❌ ${Z}: Not found at ${H}`)};Y(j,"pre-compact.js"),Y(K,"session-start.js"),Y(f,"session-end.js"),console.log(""),console.log("⚙️ Settings Configuration:");let P=(H,Z)=>{if(!J3(Z)){console.log(` ⏭️ ${H}: No settings file`);return}console.log(` \uD83D\uDCCB ${H}: ${Z}`);try{let J=JSON.parse(A9(Z,"utf8")),X=J.hooks?.PreCompact?.some((D)=>D.hooks?.some((V)=>V.command?.includes("pre-compact.js")||V.command?.includes("claude-mem"))),A=J.hooks?.SessionStart?.some((D)=>D.hooks?.some((V)=>V.command?.includes("session-start.js")||V.command?.includes("claude-mem"))),G=J.hooks?.SessionEnd?.some((D)=>D.hooks?.some((V)=>V.command?.includes("session-end.js")||V.command?.includes("claude-mem")));console.log(` PreCompact: ${X?"✅":"❌"}`),console.log(` SessionStart: ${A?"✅":"❌"}`),console.log(` SessionEnd: ${G?"✅":"❌"}`)}catch(J){console.log(" ⚠️ Could not parse settings")}};P("Global",q.getClaudeSettingsPath()),P("Project",V_(process.cwd(),".claude","settings.json")),console.log(""),console.log("\uD83D\uDCE6 Compressed Transcripts:");let $=V_(q.getClaudeConfigDirectory(),"projects");if(J3($))try{let H=0,Z=0,J=(X,A=0)=>{if(A>3)return;let G=Hu(X);for(let D of G){let V=V_(X,D);if(Tu(V).isDirectory()&&!D.startsWith("."))J(V,A+1);else if(D.endsWith(".jsonl.compressed"))H++;else if(D.endsWith(".jsonl.archive"))Z++}};J($),console.log(` Compressed files: ${H}`),console.log(` Archive files: ${Z}`)}catch(H){console.log(" ⚠️ Could not scan projects directory")}else console.log(" ℹ️ No Claude projects directory found");console.log(""),console.log("\uD83D\uDD27 Runtime Environment:");let O=(H,Z)=>{try{let J=ku(`${H} --version`,{encoding:"utf8"}).trim();console.log(` ✅ ${Z}: ${J}`)}catch{console.log(` ❌ ${Z}: Not found`)}};O("node","Node.js"),O("bun","Bun"),console.log(""),console.log("\uD83E\uDDE0 Chroma Storage Status:"),console.log(" ✅ Storage backend: Chroma MCP"),console.log(` \uD83D\uDCCD Data location: ${q.getChromaDirectory()}`),console.log(" \uD83D\uDD0D Features: Vector search, semantic similarity, document storage"),console.log(""),console.log("\uD83D\uDCCA Summary:");let w=q.getClaudeSettingsPath(),v=V_(process.cwd(),".claude","settings.json"),z=!1,W="Not installed";try{if(J3(w)){let H=JSON.parse(A9(w,"utf8"));if(H.hooks?.PreCompact||H.hooks?.SessionStart||H.hooks?.SessionEnd)z=!0,W="Global"}if(J3(v)){let H=JSON.parse(A9(v,"utf8"));if(H.hooks?.PreCompact||H.hooks?.SessionStart||H.hooks?.SessionEnd)z=!0,W=W==="Global"?"Global + Project":"Project"}}catch{}if(z)console.log(` ✅ Claude Memory System is installed (${W})`),console.log(""),console.log("\uD83D\uDCA1 To test: Use /compact in Claude Code");else console.log(" ❌ Claude Memory System is not installed"),console.log(""),console.log("\uD83D\uDCA1 To install: claude-mem install")}var x0;var u9=Q8(()=>{L6();x0=Zu(Xu(import.meta.url))});var bY={};iq(bY,{logs:()=>h9});import{readFileSync as Au,readdirSync as Gu,statSync as uu}from"fs";import{join as NY}from"path";async function hu(q,_,j){try{let Y=Au(q,"utf8").split(`
297
+ `).filter((P)=>P.trim()).slice(-j);if(console.log(`\uD83D\uDCCB ${_} Logs (last ${j} lines):`),console.log(` File: ${q}`),console.log(""),Y.length===0)console.log(" No log entries found");else Y.forEach((P)=>{console.log(` ${P}`)});console.log("")}catch(K){console.log(`❌ Could not read ${_.toLowerCase()} log: ${q}`)}}async function h9(q={}){let _=P8.getLogsDirectory(),j=parseInt(q.tail)||20;try{let f=Gu(_).filter((Y)=>Y.startsWith("claude-mem-")&&Y.endsWith(".log")).map((Y)=>({name:Y,path:NY(_,Y),mtime:uu(NY(_,Y)).mtime})).sort((Y,P)=>P.mtime.getTime()-Y.mtime.getTime());if(f.length===0){console.log("❌ No log files found in ~/.claude-mem/logs/");return}if(await hu(f[0].path,"Most Recent",j),q.all&&f.length>1)console.log(`\uD83D\uDCDA Found ${f.length} total log files`)}catch(K){console.log("❌ Could not read logs directory: ~/.claude-mem/logs/"),console.log(" Run a compression first to generate logs")}if(q.follow)console.log("Following logs... (Press Ctrl+C to stop)"),setInterval(()=>{},1000)}var D9=Q8(()=>{L6()});import H3 from"fs";import{join as Du}from"path";function Cu(q){if(q===0)return"0 B";let _=1024,j=["B","KB","MB","GB"],K=Math.floor(Math.log(q)/Math.log(_));return parseFloat((q/Math.pow(_,K)).toFixed(1))+" "+j[K]}function Vu(){let q=P8.getInstance().getTrashDirectory();if(!H3.existsSync(q))return{folderCount:0,fileCount:0,totalSize:0,isEmpty:!0};let _=H3.readdirSync(q);if(_.length===0)return{folderCount:0,fileCount:0,totalSize:0,isEmpty:!0};let j=0,K=0,f=0;for(let Y of _){let P=Du(q,Y),$=H3.statSync(P);if($.isDirectory())j++;else K++;f+=$.size}return{folderCount:j,fileCount:K,totalSize:f,isEmpty:!1}}async function b7(q={}){let j=P8.getInstance().getIndexPath();try{if(!H3.existsSync(j)){if(q.format==="session-start")console.log(oK("NO_MEMORIES",q.project||"this project"));return}let f=H3.readFileSync(j,"utf-8").trim().split(`
298
+ `).filter((w)=>w.trim());if(f.length===0){if(q.format==="session-start")console.log(oK("NO_MEMORIES",q.project||"this project"));return}let Y=[];for(let w of f)try{if(!w.trim().startsWith("{"))continue;let v=JSON.parse(w);Y.push(v)}catch(v){continue}if(Y.length===0){if(q.format==="session-start")console.log(oK("NO_MEMORIES",q.project||"this project"));return}let P=Y;if(q.project)P=Y.filter((w)=>w.project===q.project);let $=q.format==="session-start"?10:10,O=P.slice(-$);if(q.format==="session-start"){let w="recently",v=O.map((z)=>{return z.timestamp?new Date(z.timestamp):null}).filter((z)=>z!==null).sort((z,W)=>W.getTime()-z.getTime());if(v.length>0)w=l1(v[0]);n1({projectName:q.project||"your project",memoryCount:O.length,lastSessionTime:w,recentObjects:O})}else if(q.format==="json")console.log(JSON.stringify(O));else console.log(U3("Context loading",O.length,"recent memories found")),O.forEach((w)=>{if(w.type==="memory")console.log(`${w.text} | ${w.document_id} | ${w.keywords}`);else if(w.type==="overview")console.log(`**Overview:** ${w.content}`);else if(w.type==="session")console.log(`# Session: ${w.session_id} [${w.timestamp}]`);else console.log(JSON.stringify(w))});if(q.format!=="json"){let w=Vu();if(!w.isEmpty){let v=Cu(w.totalSize);console.log(`\uD83D\uDDD1️ Trash – ${w.folderCount} folders | ${w.fileCount} files | ${v} – use \`$ claude-mem restore\``)}}}catch(K){let f=K instanceof Error?K.message:String(K);if(q.format==="session-start")console.log(oK("CONNECTION_FAILED",f));else console.log(t_("Context loading",f,"Check file permissions and try again"))}}var C9=Q8(()=>{L6();K2()});var r$={};iq(r$,{viewTrash:()=>pD});import{readdirSync as l$,statSync as x$}from"fs";import{join as n$}from"path";function dD(q){let _=q.lastIndexOf(".");if(_===-1)return{name:q,timestamp:0};let j=parseInt(q.substring(_+1));if(isNaN(j))return{name:q,timestamp:0};return{name:q.substring(0,_),timestamp:j}}function L$(q){if(q===0)return"0 B";let _=1024,j=["B","KB","MB","GB"],K=Math.floor(Math.log(q)/Math.log(_));return parseFloat((q/Math.pow(_,K)).toFixed(2))+" "+j[K]}function c$(q){let _=0,j=l$(q);for(let K of j){let f=n$(q,K),Y=x$(f);if(Y.isDirectory())_+=c$(f);else _+=Y.size}return _}async function pD(){let q=P8.getInstance().getTrashDirectory();try{let _=l$(q);if(_.length===0){_6.info("\uD83D\uDDD1️ Trash is empty");return}let j=_.map((P)=>{let $=n$(q,P),O=x$($),{name:w,timestamp:v}=dD(P),z=O.isDirectory()?c$($):O.size;return{originalName:w,trashedName:P,size:z,trashedAt:new Date(v),isDirectory:O.isDirectory()}});j.sort((P,$)=>$.trashedAt.getTime()-P.trashedAt.getTime()),console.log(`
295
299
  \uD83D\uDDD1️ Trash Contents
296
- `),console.log("─".repeat(80));let K=0,Y=0,f=0;for(let P of j){if(K+=P.size,P.isDirectory)Y++;else f++;let $=P.isDirectory?"\uD83D\uDCC1":"\uD83D\uDCC4",O=P.trashedAt.toLocaleString(),w=R$(P.size);console.log(`${$} ${P.originalName}`),console.log(` Size: ${w} | Trashed: ${O}`),console.log(` ID: ${P.trashedName}`),console.log()}console.log("─".repeat(80)),console.log(`Total: ${Y} folders, ${f} files (${R$(K)})`),console.log(`
297
- To restore files: claude-mem restore`),console.log("To empty trash: claude-mem trash empty")}catch(_){if(_.code==="ENOENT")_6.info("\uD83D\uDDD1️ Trash is empty");else _6.error("Failed to read trash directory"),console.error(_)}}var p$=Q8(()=>{sq();p6()});var l$={};rq(l$,{emptyTrash:()=>RD});import{rmSync as ND,readdirSync as bD,existsSync as SD,statSync as ED}from"fs";import{join as L$}from"path";async function RD(q={}){let _=P8.getInstance().getTrashDirectory();if(!SD(_)){_6.info("\uD83D\uDDD1️ Trash is already empty");return}try{let j=bD(_);if(j.length===0){_6.info("\uD83D\uDDD1️ Trash is already empty");return}let K=0,Y=0;for(let P of j){let $=L$(_,P);if(ED($).isDirectory())K++;else Y++}if(!q.force){let P=await zq({message:`Permanently delete ${K} folders and ${Y} files from trash?`,initialValue:!1});if(t8(P)||!P){_6.info("Cancelled - trash not emptied");return}}let f=Jq();f.start("Emptying trash...");for(let P of j){let $=L$(_,P);ND($,{recursive:!0,force:!0})}f.stop(`\uD83D\uDDD1️ Trash emptied - permanently deleted ${K} folders and ${Y} files`)}catch(j){_6.error("Failed to empty trash"),console.error(j),process.exit(1)}}var x$=Q8(()=>{sq();p6()});var r7={};rq(r7,{sessionStartHook:()=>ID,sessionEndHook:()=>gD,preCompactHook:()=>mD});import{basename as n$}from"path";async function mD(){try{let q="";process.stdin.setEncoding("utf8");for await(let j of process.stdin)q+=j;let _;if(q)try{_=JSON.parse(q).transcript_path}catch(j){_=q.trim()}if(!_)_=process.env.TRANSCRIPT_PATH||process.argv[2];if(!_){console.log("\uD83D\uDDDC️ Compressing session transcript..."),console.log("❌ No transcript path provided to pre-compact hook"),console.log("Hook data received:",q||"none"),console.log("Environment TRANSCRIPT_PATH:",process.env.TRANSCRIPT_PATH||"not set"),console.log("Command line args:",process.argv.slice(2));return}await vK(_,{dryRun:!1})}catch(q){console.error("Pre-compact hook failed:",q.message),process.exit(1)}}async function ID(){try{let q="";process.stdin.setEncoding("utf8");for await(let j of process.stdin)q+=j;let _;if(q)try{let j=JSON.parse(q);if(j.cwd)_=n$(j.cwd)}catch(j){console.error("Failed to parse session-start hook data:",j)}if(!_)_=n$(process.cwd());await D7({format:"session-start",count:"10",project:_})}catch(q){console.error("Session-start hook failed:",q.message),process.exit(1)}}async function gD(){try{let q="";process.stdin.setEncoding("utf8");for await(let _ of process.stdin)q+=_;if(q)try{let _=JSON.parse(q);if(_.reason==="clear"&&_.transcript_path)console.log("\uD83D\uDDDC️ Compressing current session before /clear..."),await vK(_.transcript_path,{dryRun:!1})}catch(_){console.error("Failed to parse hook data:",_)}console.log("Session ended successfully")}catch(q){console.error("Session-end hook failed:",q.message),process.exit(1)}}var i7=Q8(()=>{P7();T9()});var J5=B6(W5(),1),{program:sD,createCommand:QD,createArgument:qC,createOption:_C,CommanderError:KC,InvalidArgumentError:jC,InvalidOptionArgumentError:PC,Command:H5,Argument:YC,Option:fC,Help:$C}=J5.default;import{readFileSync as KO,existsSync as jO}from"fs";import{join as PO,dirname as YO}from"path";import{fileURLToPath as fO}from"url";var T5="claude-mem",Z5="3.5.7",k5="Memory compression system for Claude Code - persist context across sessions",X5=T5,A5=Z5,G5=k5;try{let q=fO(import.meta.url),_=YO(q),j=PO(_,"..","..","package.json");if(jO(j)){let K=JSON.parse(KO(j,"utf-8"));X5=K.name||T5,A5=K.version||Z5,G5=K.description||k5}}catch{}var iq=X5,u5=A5,h5=G5;P7();sq();import{readFileSync as JK,writeFileSync as h_,existsSync as E8,chmodSync as nG,mkdirSync as TK,copyFileSync as u_,statSync as cG,readdirSync as rG}from"fs";import{join as C8,dirname as HK}from"path";import{homedir as $9}from"os";import{execSync as G_}from"child_process";import{fileURLToPath as Zf}from"url";var zY=(q=0)=>(_)=>`\x1B[${_+q}m`,WY=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,JY=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,L8={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},fM=Object.keys(L8.modifier),bA=Object.keys(L8.color),SA=Object.keys(L8.bgColor),$M=[...bA,...SA];function EA(){let q=new Map;for(let[_,j]of Object.entries(L8)){for(let[K,Y]of Object.entries(j))L8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=L8[K],q.set(Y[0],Y[1]);Object.defineProperty(L8,_,{value:j,enumerable:!1})}return Object.defineProperty(L8,"codes",{value:q,enumerable:!1}),L8.color.close="\x1B[39m",L8.bgColor.close="\x1B[49m",L8.color.ansi=zY(),L8.color.ansi256=WY(),L8.color.ansi16m=JY(),L8.bgColor.ansi=zY(10),L8.bgColor.ansi256=WY(10),L8.bgColor.ansi16m=JY(10),Object.defineProperties(L8,{rgbToAnsi256:{value(_,j,K){if(_===j&&j===K){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(j/255*5)+Math.round(K/255*5)},enumerable:!1},hexToRgb:{value(_){let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;if(K.length===3)K=[...K].map((f)=>f+f).join("");let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>L8.rgbToAnsi256(...L8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value(_){if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));if(f===2)P+=60;return P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>L8.ansi256ToAnsi(L8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>L8.ansi256ToAnsi(L8.hexToAnsi256(_)),enumerable:!1}}),L8}var RA=EA(),Hq=RA;import d2 from"node:process";import mA from"node:os";import HY from"node:tty";function Q6(q,_=globalThis.Deno?globalThis.Deno.args:d2.argv){let j=q.startsWith("-")?"":q.length===1?"-":"--",K=_.indexOf(j+q),Y=_.indexOf("--");return K!==-1&&(Y===-1||K<Y)}var{env:l8}=d2,H7;if(Q6("no-color")||Q6("no-colors")||Q6("color=false")||Q6("color=never"))H7=0;else if(Q6("color")||Q6("colors")||Q6("color=true")||Q6("color=always"))H7=1;function IA(){if("FORCE_COLOR"in l8){if(l8.FORCE_COLOR==="true")return 1;if(l8.FORCE_COLOR==="false")return 0;return l8.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(l8.FORCE_COLOR,10),3)}}function gA(q){if(q===0)return!1;return{level:q,hasBasic:!0,has256:q>=2,has16m:q>=3}}function yA(q,{streamIsTTY:_,sniffFlags:j=!0}={}){let K=IA();if(K!==void 0)H7=K;let Y=j?H7:K;if(Y===0)return 0;if(j){if(Q6("color=16m")||Q6("color=full")||Q6("color=truecolor"))return 3;if(Q6("color=256"))return 2}if("TF_BUILD"in l8&&"AGENT_NAME"in l8)return 1;if(q&&!_&&Y===void 0)return 0;let f=Y||0;if(l8.TERM==="dumb")return f;if(d2.platform==="win32"){let P=mA.release().split(".");if(Number(P[0])>=10&&Number(P[2])>=10586)return Number(P[2])>=14931?3:2;return 1}if("CI"in l8){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((P)=>(P in l8)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((P)=>(P in l8))||l8.CI_NAME==="codeship")return 1;return f}if("TEAMCITY_VERSION"in l8)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(l8.TEAMCITY_VERSION)?1:0;if(l8.COLORTERM==="truecolor")return 3;if(l8.TERM==="xterm-kitty")return 3;if(l8.TERM==="xterm-ghostty")return 3;if(l8.TERM==="wezterm")return 3;if("TERM_PROGRAM"in l8){let P=Number.parseInt((l8.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(l8.TERM_PROGRAM){case"iTerm.app":return P>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(l8.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(l8.TERM))return 1;if("COLORTERM"in l8)return 1;return f}function TY(q,_={}){let j=yA(q,{streamIsTTY:q&&q.isTTY,..._});return gA(j)}var dA={stdout:TY({isTTY:HY.isatty(1)}),stderr:TY({isTTY:HY.isatty(2)})},ZY=dA;function kY(q,_,j){let K=q.indexOf(_);if(K===-1)return q;let Y=_.length,f=0,P="";do P+=q.slice(f,K)+_+j,f=K+Y,K=q.indexOf(_,f);while(K!==-1);return P+=q.slice(f),P}function XY(q,_,j,K){let Y=0,f="";do{let P=q[K-1]==="\r";f+=q.slice(Y,P?K-1:K)+_+(P?`\r
300
+ `),console.log("─".repeat(80));let K=0,f=0,Y=0;for(let P of j){if(K+=P.size,P.isDirectory)f++;else Y++;let $=P.isDirectory?"\uD83D\uDCC1":"\uD83D\uDCC4",O=P.trashedAt.toLocaleString(),w=L$(P.size);console.log(`${$} ${P.originalName}`),console.log(` Size: ${w} | Trashed: ${O}`),console.log(` ID: ${P.trashedName}`),console.log()}console.log("─".repeat(80)),console.log(`Total: ${f} folders, ${Y} files (${L$(K)})`),console.log(`
301
+ To restore files: claude-mem restore`),console.log("To empty trash: claude-mem trash empty")}catch(_){if(_.code==="ENOENT")_6.info("\uD83D\uDDD1️ Trash is empty");else _6.error("Failed to read trash directory"),console.error(_)}}var i$=Q8(()=>{Qq();L6()});var a$={};iq(a$,{emptyTrash:()=>cD});import{rmSync as LD,readdirSync as lD,existsSync as xD,statSync as nD}from"fs";import{join as o$}from"path";async function cD(q={}){let _=P8.getInstance().getTrashDirectory();if(!xD(_)){_6.info("\uD83D\uDDD1️ Trash is already empty");return}try{let j=lD(_);if(j.length===0){_6.info("\uD83D\uDDD1️ Trash is already empty");return}let K=0,f=0;for(let P of j){let $=o$(_,P);if(nD($).isDirectory())K++;else f++}if(!q.force){let P=await n6({message:`Permanently delete ${K} folders and ${f} files from trash?`,initialValue:!1});if(L8(P)||!P){_6.info("Cancelled - trash not emptied");return}}let Y=_q();Y.start("Emptying trash...");for(let P of j){let $=o$(_,P);LD($,{recursive:!0,force:!0})}Y.stop(`\uD83D\uDDD1️ Trash emptied - permanently deleted ${K} folders and ${f} files`)}catch(j){_6.error("Failed to empty trash"),console.error(j),process.exit(1)}}var B$=Q8(()=>{Qq();L6()});var t7={};iq(t7,{sessionStartHook:()=>iD,sessionEndHook:()=>oD,preCompactHook:()=>rD});import{basename as t$}from"path";async function rD(){try{let q="";process.stdin.setEncoding("utf8");for await(let j of process.stdin)q+=j;let _;if(q)try{_=JSON.parse(q).transcript_path}catch(j){_=q.trim()}if(!_)_=process.env.TRANSCRIPT_PATH||process.argv[2];if(!_){console.log("\uD83D\uDDDC️ Compressing session transcript..."),console.log("❌ No transcript path provided to pre-compact hook"),console.log("Hook data received:",q||"none"),console.log("Environment TRANSCRIPT_PATH:",process.env.TRANSCRIPT_PATH||"not set"),console.log("Command line args:",process.argv.slice(2));return}await HK(_,{dryRun:!1})}catch(q){console.error("Pre-compact hook failed:",q.message),process.exit(1)}}async function iD(){try{let q="";process.stdin.setEncoding("utf8");for await(let j of process.stdin)q+=j;let _;if(q)try{let j=JSON.parse(q);if(j.cwd)_=t$(j.cwd)}catch(j){console.error("Failed to parse session-start hook data:",j)}if(!_)_=t$(process.cwd());await b7({format:"session-start",count:"10",project:_})}catch(q){console.error("Session-start hook failed:",q.message),process.exit(1)}}async function oD(){try{let q="";process.stdin.setEncoding("utf8");for await(let _ of process.stdin)q+=_;if(q)try{let _=JSON.parse(q);if(_.reason==="clear"&&_.transcript_path)console.log("\uD83D\uDDDC️ Compressing current session before /clear..."),await HK(_.transcript_path,{dryRun:!1})}catch(_){console.error("Failed to parse hook data:",_)}console.log("Session ended successfully")}catch(q){console.error("Session-end hook failed:",q.message),process.exit(1)}}var e7=Q8(()=>{O7();C9()});var h5=e6(u5(),1),{program:OC,createCommand:vC,createArgument:zC,createOption:WC,CommanderError:JC,InvalidArgumentError:HC,InvalidOptionArgumentError:TC,Command:D5,Argument:ZC,Option:kC,Help:XC}=h5.default;import{readFileSync as OO,existsSync as vO}from"fs";import{join as zO,dirname as WO}from"path";import{fileURLToPath as JO}from"url";var C5="claude-mem",V5="3.5.9",M5="Memory compression system for Claude Code - persist context across sessions",N5=C5,b5=V5,S5=M5;try{let q=JO(import.meta.url),_=WO(q),j=zO(_,"..","..","package.json");if(vO(j)){let K=JSON.parse(OO(j,"utf-8"));N5=K.name||C5,b5=K.version||V5,S5=K.description||M5}}catch{}var oq=N5,E5=b5,R5=S5;O7();Qq();import{readFileSync as kK,writeFileSync as C_,existsSync as E8,chmodSync as FG,mkdirSync as AK,copyFileSync as D_,statSync as UG,readdirSync as sG}from"fs";import{join as C8,dirname as XK}from"path";import{homedir as Z9}from"os";import{execSync as h_}from"child_process";import{fileURLToPath as hY}from"url";var Zf=(q=0)=>(_)=>`\x1B[${_+q}m`,kf=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,Xf=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,l8={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},kM=Object.keys(l8.modifier),pA=Object.keys(l8.color),LA=Object.keys(l8.bgColor),XM=[...pA,...LA];function lA(){let q=new Map;for(let[_,j]of Object.entries(l8)){for(let[K,f]of Object.entries(j))l8[K]={open:`\x1B[${f[0]}m`,close:`\x1B[${f[1]}m`},j[K]=l8[K],q.set(f[0],f[1]);Object.defineProperty(l8,_,{value:j,enumerable:!1})}return Object.defineProperty(l8,"codes",{value:q,enumerable:!1}),l8.color.close="\x1B[39m",l8.bgColor.close="\x1B[49m",l8.color.ansi=Zf(),l8.color.ansi256=kf(),l8.color.ansi16m=Xf(),l8.bgColor.ansi=Zf(10),l8.bgColor.ansi256=kf(10),l8.bgColor.ansi16m=Xf(10),Object.defineProperties(l8,{rgbToAnsi256:{value(_,j,K){if(_===j&&j===K){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(j/255*5)+Math.round(K/255*5)},enumerable:!1},hexToRgb:{value(_){let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;if(K.length===3)K=[...K].map((Y)=>Y+Y).join("");let f=Number.parseInt(K,16);return[f>>16&255,f>>8&255,f&255]},enumerable:!1},hexToAnsi256:{value:(_)=>l8.rgbToAnsi256(...l8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value(_){if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,f;if(_>=232)j=((_-232)*10+8)/255,K=j,f=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,f=$%6/5}let Y=Math.max(j,K,f)*2;if(Y===0)return 30;let P=30+(Math.round(f)<<2|Math.round(K)<<1|Math.round(j));if(Y===2)P+=60;return P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>l8.ansi256ToAnsi(l8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>l8.ansi256ToAnsi(l8.hexToAnsi256(_)),enumerable:!1}}),l8}var xA=lA(),Tq=xA;import o2 from"node:process";import nA from"node:os";import Af from"node:tty";function Kq(q,_=globalThis.Deno?globalThis.Deno.args:o2.argv){let j=q.startsWith("-")?"":q.length===1?"-":"--",K=_.indexOf(j+q),f=_.indexOf("--");return K!==-1&&(f===-1||K<f)}var{env:x8}=o2,A7;if(Kq("no-color")||Kq("no-colors")||Kq("color=false")||Kq("color=never"))A7=0;else if(Kq("color")||Kq("colors")||Kq("color=true")||Kq("color=always"))A7=1;function cA(){if("FORCE_COLOR"in x8){if(x8.FORCE_COLOR==="true")return 1;if(x8.FORCE_COLOR==="false")return 0;return x8.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(x8.FORCE_COLOR,10),3)}}function rA(q){if(q===0)return!1;return{level:q,hasBasic:!0,has256:q>=2,has16m:q>=3}}function iA(q,{streamIsTTY:_,sniffFlags:j=!0}={}){let K=cA();if(K!==void 0)A7=K;let f=j?A7:K;if(f===0)return 0;if(j){if(Kq("color=16m")||Kq("color=full")||Kq("color=truecolor"))return 3;if(Kq("color=256"))return 2}if("TF_BUILD"in x8&&"AGENT_NAME"in x8)return 1;if(q&&!_&&f===void 0)return 0;let Y=f||0;if(x8.TERM==="dumb")return Y;if(o2.platform==="win32"){let P=nA.release().split(".");if(Number(P[0])>=10&&Number(P[2])>=10586)return Number(P[2])>=14931?3:2;return 1}if("CI"in x8){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((P)=>(P in x8)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((P)=>(P in x8))||x8.CI_NAME==="codeship")return 1;return Y}if("TEAMCITY_VERSION"in x8)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(x8.TEAMCITY_VERSION)?1:0;if(x8.COLORTERM==="truecolor")return 3;if(x8.TERM==="xterm-kitty")return 3;if(x8.TERM==="xterm-ghostty")return 3;if(x8.TERM==="wezterm")return 3;if("TERM_PROGRAM"in x8){let P=Number.parseInt((x8.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(x8.TERM_PROGRAM){case"iTerm.app":return P>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(x8.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(x8.TERM))return 1;if("COLORTERM"in x8)return 1;return Y}function Gf(q,_={}){let j=iA(q,{streamIsTTY:q&&q.isTTY,..._});return rA(j)}var oA={stdout:Gf({isTTY:Af.isatty(1)}),stderr:Gf({isTTY:Af.isatty(2)})},uf=oA;function hf(q,_,j){let K=q.indexOf(_);if(K===-1)return q;let f=_.length,Y=0,P="";do P+=q.slice(Y,K)+_+j,Y=K+f,K=q.indexOf(_,Y);while(K!==-1);return P+=q.slice(Y),P}function Df(q,_,j,K){let f=0,Y="";do{let P=q[K-1]==="\r";Y+=q.slice(f,P?K-1:K)+_+(P?`\r
298
302
  `:`
299
- `)+j,Y=K+1,K=q.indexOf(`
300
- `,Y)}while(K!==-1);return f+=q.slice(Y),f}var{stdout:AY,stderr:GY}=ZY,p2=Symbol("GENERATOR"),zK=Symbol("STYLER"),_3=Symbol("IS_EMPTY"),uY=["ansi","ansi","ansi256","ansi16m"],WK=Object.create(null),pA=(q,_={})=>{if(_.level&&!(Number.isInteger(_.level)&&_.level>=0&&_.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let j=AY?AY.level:0;q.level=_.level===void 0?j:_.level};var LA=(q)=>{let _=(...j)=>j.join(" ");return pA(_,q),Object.setPrototypeOf(_,K3.prototype),_};function K3(q){return LA(q)}Object.setPrototypeOf(K3.prototype,Function.prototype);for(let[q,_]of Object.entries(Hq))WK[q]={get(){let j=T7(this,l2(_.open,_.close,this[zK]),this[_3]);return Object.defineProperty(this,q,{value:j}),j}};WK.visible={get(){let q=T7(this,this[zK],!0);return Object.defineProperty(this,"visible",{value:q}),q}};var L2=(q,_,j,...K)=>{if(q==="rgb"){if(_==="ansi16m")return Hq[j].ansi16m(...K);if(_==="ansi256")return Hq[j].ansi256(Hq.rgbToAnsi256(...K));return Hq[j].ansi(Hq.rgbToAnsi(...K))}if(q==="hex")return L2("rgb",_,j,...Hq.hexToRgb(...K));return Hq[j][q](...K)},lA=["rgb","hex","ansi256"];for(let q of lA){WK[q]={get(){let{level:j}=this;return function(...K){let Y=l2(L2(q,uY[j],"color",...K),Hq.color.close,this[zK]);return T7(this,Y,this[_3])}}};let _="bg"+q[0].toUpperCase()+q.slice(1);WK[_]={get(){let{level:j}=this;return function(...K){let Y=l2(L2(q,uY[j],"bgColor",...K),Hq.bgColor.close,this[zK]);return T7(this,Y,this[_3])}}}}var xA=Object.defineProperties(()=>{},{...WK,level:{enumerable:!0,get(){return this[p2].level},set(q){this[p2].level=q}}}),l2=(q,_,j)=>{let K,Y;if(j===void 0)K=q,Y=_;else K=j.openAll+q,Y=_+j.closeAll;return{open:q,close:_,openAll:K,closeAll:Y,parent:j}},T7=(q,_,j)=>{let K=(...Y)=>nA(K,Y.length===1?""+Y[0]:Y.join(" "));return Object.setPrototypeOf(K,xA),K[p2]=q,K[zK]=_,K[_3]=j,K},nA=(q,_)=>{if(q.level<=0||!_)return q[_3]?"":_;let j=q[zK];if(j===void 0)return _;let{openAll:K,closeAll:Y}=j;if(_.includes("\x1B"))while(j!==void 0)_=kY(_,j.close,j.open),j=j.parent;let f=_.indexOf(`
301
- `);if(f!==-1)_=XY(_,Y,K,f);return K+_+Y};Object.defineProperties(K3.prototype,WK);var cA=K3(),kM=K3({level:GY?GY.level:0});var I=cA;var o2=B6(SY(),1),A6=(...q)=>{let _,j;if(q.length===0)throw new Error("Missing gradient colors");if(!Array.isArray(q[0])){if(q.length===1)throw new Error(`Expected an array of colors, received ${JSON.stringify(q[0])}`);_=o2.default(...q)}else _=o2.default(q[0]),j=a2(q[1]);let K=(Y,f)=>{return rA(Y?Y.toString():"",_,f??j)};return K.multiline=(Y,f)=>iA(Y?Y.toString():"",_,f??j),K},EY=(q,_,j)=>{return _.interpolation?.toLowerCase()==="hsv"?q.hsv(j,_.hsvSpin?.toLowerCase()||!1):q.rgb(j)};function rA(q,_,j){let K=a2(j),Y=Math.max(q.replace(/\s/g,"").length,_.stops.length),f=EY(_,K,Y),P="";for(let $ of q)P+=$.match(/\s/g)?$:I.hex(f.shift()?.toHex()||"#000")($);return P}function iA(q,_,j){let K=a2(j),Y=q.split(`
302
- `),f=Math.max(...Y.map((O)=>O.length),_.stops.length),P=EY(_,K,f),$=[];for(let O of Y){let w=P.slice(0),v="";for(let z of O)v+=I.hex(w.shift()?.toHex()||"#000")(z);$.push(v)}return $.join(`
303
- `)}function a2(q){let _={interpolation:"rgb",hsvSpin:"short",...q};if(q!==void 0&&typeof q!=="object")throw new TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof q}\``);if(typeof _.interpolation!=="string")throw new TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof _.interpolation}\``);if(_.interpolation.toLowerCase()==="hsv"&&typeof _.hsvSpin!=="string")throw new TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof _.hsvSpin}\``);return _}var x6={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"],options:{}},cristal:{colors:["#bdfff3","#4ac29a"],options:{}},teen:{colors:["#77a1d3","#79cbca","#e684ae"],options:{}},mind:{colors:["#473b7b","#3584a7","#30d2be"],options:{}},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"],options:{}},fruit:{colors:["#ff4e50","#f9d423"],options:{}},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"],options:{}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}},summer:{colors:["#fdbb2d","#22c1c3"],options:{}},rainbow:{colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}},pastel:{colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}}};function n6(q){let _=(j)=>A6(...q.colors)(j,q.options);return _.multiline=(j="")=>A6(...q.colors).multiline(j,q.options),_}var M6=A6,oA=n6(x6.atlas),aA=n6(x6.cristal),BA=n6(x6.teen),tA=n6(x6.mind),eA=n6(x6.morning),FA=n6(x6.vice),UA=n6(x6.passion),sA=n6(x6.fruit),QA=n6(x6.instagram),qG=n6(x6.retro),_G=n6(x6.summer),KG=n6(x6.rainbow),jG=n6(x6.pastel);A6.atlas=oA;A6.cristal=aA;A6.teen=BA;A6.mind=tA;A6.morning=eA;A6.vice=FA;A6.passion=UA;A6.fruit=sA;A6.instagram=QA;A6.retro=qG;A6.summer=_G;A6.rainbow=KG;A6.pastel=jG;import u7 from"node:process";function B2({onlyFirst:q=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",q?void 0:"g")}var PG=B2();function t2(q){if(typeof q!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(PG,"")}function RY(q){return q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109}function mY(q){return q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510}function IY(q){return q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9776&&q<=9783||q>=9800&&q<=9811||q===9855||q>=9866&&q<=9871||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12773||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101631&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q>=119552&&q<=119638||q>=119648&&q<=119670||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129673||q>=129679&&q<=129734||q>=129742&&q<=129756||q>=129759&&q<=129769||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141}function YG(q){if(!Number.isSafeInteger(q))throw new TypeError(`Expected a code point, got \`${typeof q}\`.`)}function gY(q,{ambiguousAsWide:_=!1}={}){if(YG(q),mY(q)||IY(q)||_&&RY(q))return 2;return 1}var pY=B6(dY(),1),fG=new Intl.Segmenter,$G=/^\p{Default_Ignorable_Code_Point}$/u;function N6(q,_={}){if(typeof q!=="string"||q.length===0)return 0;let{ambiguousIsNarrow:j=!0,countAnsiEscapeCodes:K=!1}=_;if(!K)q=t2(q);if(q.length===0)return 0;let Y=0,f={ambiguousAsWide:!j};for(let{segment:P}of fG.segment(q)){let $=P.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if($G.test(P))continue;if(pY.default().test(P)){Y+=2;continue}Y+=gY($,f)}return Y}function k7(q){let _=0;for(let j of q.split(`
304
- `))_=Math.max(_,N6(j));return _}var Jf=B6(F2(),1);var OG=/[\p{Lu}]/u,vG=/[\p{Ll}]/u,xY=/^[\p{Lu}](?![\p{Lu}])/gu,rY=/([\p{Alpha}\p{N}_]|$)/u,U2=/[_.\- ]+/,zG=new RegExp("^"+U2.source),nY=new RegExp(U2.source+rY.source,"gu"),cY=new RegExp("\\d+"+rY.source,"gu"),WG=(q,_,j,K)=>{let Y=!1,f=!1,P=!1,$=!1;for(let O=0;O<q.length;O++){let w=q[O];if($=O>2?q[O-3]==="-":!0,Y&&OG.test(w))q=q.slice(0,O)+"-"+q.slice(O),Y=!1,P=f,f=!0,O++;else if(f&&P&&vG.test(w)&&(!$||K))q=q.slice(0,O-1)+"-"+q.slice(O-1),P=f,f=!1,Y=!0;else Y=_(w)===w&&j(w)!==w,P=f,f=j(w)===w&&_(w)!==w}return q},JG=(q,_)=>{return xY.lastIndex=0,q.replaceAll(xY,(j)=>_(j))},HG=(q,_)=>{return nY.lastIndex=0,cY.lastIndex=0,q.replaceAll(cY,(j,K,Y)=>["_","-"].includes(q.charAt(Y+j.length))?j:_(j)).replaceAll(nY,(j,K)=>_(K))};function s2(q,_){if(!(typeof q==="string"||Array.isArray(q)))throw new TypeError("Expected the input to be `string | string[]`");if(_={pascalCase:!1,preserveConsecutiveUppercase:!1,..._},Array.isArray(q))q=q.map((f)=>f.trim()).filter((f)=>f.length).join("-");else q=q.trim();if(q.length===0)return"";let j=_.locale===!1?(f)=>f.toLowerCase():(f)=>f.toLocaleLowerCase(_.locale),K=_.locale===!1?(f)=>f.toUpperCase():(f)=>f.toLocaleUpperCase(_.locale);if(q.length===1){if(U2.test(q))return"";return _.pascalCase?K(q):j(q)}if(q!==j(q))q=WG(q,j,K,_.preserveConsecutiveUppercase);if(q=q.replace(zG,""),q=_.preserveConsecutiveUppercase?JG(q,j):j(q),_.pascalCase)q=K(q.charAt(0))+q.slice(1);return HG(q,K)}var Y9=B6(_f(),1);function _9({onlyFirst:q=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",q?void 0:"g")}var hG=_9();function K9(q){if(typeof q!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(hG,"")}var Kf=(q=0)=>(_)=>`\x1B[${_+q}m`,jf=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,Pf=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,x8={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},BM=Object.keys(x8.modifier),DG=Object.keys(x8.color),CG=Object.keys(x8.bgColor),tM=[...DG,...CG];function VG(){let q=new Map;for(let[_,j]of Object.entries(x8)){for(let[K,Y]of Object.entries(j))x8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=x8[K],q.set(Y[0],Y[1]);Object.defineProperty(x8,_,{value:j,enumerable:!1})}return Object.defineProperty(x8,"codes",{value:q,enumerable:!1}),x8.color.close="\x1B[39m",x8.bgColor.close="\x1B[49m",x8.color.ansi=Kf(),x8.color.ansi256=jf(),x8.color.ansi16m=Pf(),x8.bgColor.ansi=Kf(10),x8.bgColor.ansi256=jf(10),x8.bgColor.ansi16m=Pf(10),Object.defineProperties(x8,{rgbToAnsi256:{value:(_,j,K)=>{if(_===j&&j===K){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(j/255*5)+Math.round(K/255*5)},enumerable:!1},hexToRgb:{value:(_)=>{let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;if(K.length===3)K=[...K].map((f)=>f+f).join("");let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>x8.rgbToAnsi256(...x8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value:(_)=>{if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));if(f===2)P+=60;return P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>x8.ansi256ToAnsi(x8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>x8.ansi256ToAnsi(x8.hexToAnsi256(_)),enumerable:!1}}),x8}var MG=VG(),Yf=MG;var A7=new Set(["\x1B","›"]),NG=39,P9="\x07",wf="[",bG="]",Of="m",X7=`${bG}8;;`,ff=(q)=>`${A7.values().next().value}${wf}${q}${Of}`,$f=(q)=>`${A7.values().next().value}${X7}${q}${P9}`,SG=(q)=>q.split(" ").map((_)=>N6(_)),j9=(q,_,j)=>{let K=[..._],Y=!1,f=!1,P=N6(K9(q.at(-1)));for(let[$,O]of K.entries()){let w=N6(O);if(P+w<=j)q[q.length-1]+=O;else q.push(O),P=0;if(A7.has(O))Y=!0,f=K.slice($+1,$+1+X7.length).join("")===X7;if(Y){if(f){if(O===P9)Y=!1,f=!1}else if(O===Of)Y=!1;continue}if(P+=w,P===j&&$<K.length-1)q.push(""),P=0}if(!P&&q.at(-1).length>0&&q.length>1)q[q.length-2]+=q.pop()},EG=(q)=>{let _=q.split(" "),j=_.length;while(j>0){if(N6(_[j-1])>0)break;j--}if(j===_.length)return q;return _.slice(0,j).join(" ")+_.slice(j).join("")},RG=(q,_,j={})=>{if(j.trim!==!1&&q.trim()==="")return"";let K="",Y,f,P=SG(q),$=[""];for(let[z,W]of q.split(" ").entries()){if(j.trim!==!1)$[$.length-1]=$.at(-1).trimStart();let J=N6($.at(-1));if(z!==0){if(J>=_&&(j.wordWrap===!1||j.trim===!1))$.push(""),J=0;if(J>0||j.trim===!1)$[$.length-1]+=" ",J++}if(j.hard&&P[z]>_){let Z=_-J,H=1+Math.floor((P[z]-Z-1)/_);if(Math.floor((P[z]-1)/_)<H)$.push("");j9($,W,_);continue}if(J+P[z]>_&&J>0&&P[z]>0){if(j.wordWrap===!1&&J<_){j9($,W,_);continue}$.push("")}if(J+P[z]>_&&j.wordWrap===!1){j9($,W,_);continue}$[$.length-1]+=W}if(j.trim!==!1)$=$.map((z)=>EG(z));let O=$.join(`
305
- `),w=[...O],v=0;for(let[z,W]of w.entries()){if(K+=W,A7.has(W)){let{groups:Z}=new RegExp(`(?:\\${wf}(?<code>\\d+)m|\\${X7}(?<uri>.*)${P9})`).exec(O.slice(v))||{groups:{}};if(Z.code!==void 0){let H=Number.parseFloat(Z.code);Y=H===NG?void 0:H}else if(Z.uri!==void 0)f=Z.uri.length===0?void 0:Z.uri}let J=Yf.codes.get(Number(Y));if(w[z+1]===`
306
- `){if(f)K+=$f("");if(Y&&J)K+=ff(J)}else if(W===`
307
- `){if(Y&&J)K+=ff(Y);if(f)K+=$f(f)}v+=W.length}return K};function G7(q,_,j){return String(q).normalize().replaceAll(`\r
303
+ `)+j,f=K+1,K=q.indexOf(`
304
+ `,f)}while(K!==-1);return Y+=q.slice(f),Y}var{stdout:Cf,stderr:Vf}=uf,a2=Symbol("GENERATOR"),TK=Symbol("STYLER"),Y3=Symbol("IS_EMPTY"),Mf=["ansi","ansi","ansi256","ansi16m"],ZK=Object.create(null),aA=(q,_={})=>{if(_.level&&!(Number.isInteger(_.level)&&_.level>=0&&_.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let j=Cf?Cf.level:0;q.level=_.level===void 0?j:_.level};var BA=(q)=>{let _=(...j)=>j.join(" ");return aA(_,q),Object.setPrototypeOf(_,$3.prototype),_};function $3(q){return BA(q)}Object.setPrototypeOf($3.prototype,Function.prototype);for(let[q,_]of Object.entries(Tq))ZK[q]={get(){let j=G7(this,t2(_.open,_.close,this[TK]),this[Y3]);return Object.defineProperty(this,q,{value:j}),j}};ZK.visible={get(){let q=G7(this,this[TK],!0);return Object.defineProperty(this,"visible",{value:q}),q}};var B2=(q,_,j,...K)=>{if(q==="rgb"){if(_==="ansi16m")return Tq[j].ansi16m(...K);if(_==="ansi256")return Tq[j].ansi256(Tq.rgbToAnsi256(...K));return Tq[j].ansi(Tq.rgbToAnsi(...K))}if(q==="hex")return B2("rgb",_,j,...Tq.hexToRgb(...K));return Tq[j][q](...K)},tA=["rgb","hex","ansi256"];for(let q of tA){ZK[q]={get(){let{level:j}=this;return function(...K){let f=t2(B2(q,Mf[j],"color",...K),Tq.color.close,this[TK]);return G7(this,f,this[Y3])}}};let _="bg"+q[0].toUpperCase()+q.slice(1);ZK[_]={get(){let{level:j}=this;return function(...K){let f=t2(B2(q,Mf[j],"bgColor",...K),Tq.bgColor.close,this[TK]);return G7(this,f,this[Y3])}}}}var eA=Object.defineProperties(()=>{},{...ZK,level:{enumerable:!0,get(){return this[a2].level},set(q){this[a2].level=q}}}),t2=(q,_,j)=>{let K,f;if(j===void 0)K=q,f=_;else K=j.openAll+q,f=_+j.closeAll;return{open:q,close:_,openAll:K,closeAll:f,parent:j}},G7=(q,_,j)=>{let K=(...f)=>FA(K,f.length===1?""+f[0]:f.join(" "));return Object.setPrototypeOf(K,eA),K[a2]=q,K[TK]=_,K[Y3]=j,K},FA=(q,_)=>{if(q.level<=0||!_)return q[Y3]?"":_;let j=q[TK];if(j===void 0)return _;let{openAll:K,closeAll:f}=j;if(_.includes("\x1B"))while(j!==void 0)_=hf(_,j.close,j.open),j=j.parent;let Y=_.indexOf(`
305
+ `);if(Y!==-1)_=Df(_,f,K,Y);return K+_+f};Object.defineProperties($3.prototype,ZK);var UA=$3(),bM=$3({level:Vf?Vf.level:0});var g=UA;var q9=e6(gf(),1),G6=(...q)=>{let _,j;if(q.length===0)throw new Error("Missing gradient colors");if(!Array.isArray(q[0])){if(q.length===1)throw new Error(`Expected an array of colors, received ${JSON.stringify(q[0])}`);_=q9.default(...q)}else _=q9.default(q[0]),j=_9(q[1]);let K=(f,Y)=>{return sA(f?f.toString():"",_,Y??j)};return K.multiline=(f,Y)=>QA(f?f.toString():"",_,Y??j),K},yf=(q,_,j)=>{return _.interpolation?.toLowerCase()==="hsv"?q.hsv(j,_.hsvSpin?.toLowerCase()||!1):q.rgb(j)};function sA(q,_,j){let K=_9(j),f=Math.max(q.replace(/\s/g,"").length,_.stops.length),Y=yf(_,K,f),P="";for(let $ of q)P+=$.match(/\s/g)?$:g.hex(Y.shift()?.toHex()||"#000")($);return P}function QA(q,_,j){let K=_9(j),f=q.split(`
306
+ `),Y=Math.max(...f.map((O)=>O.length),_.stops.length),P=yf(_,K,Y),$=[];for(let O of f){let w=P.slice(0),v="";for(let z of O)v+=g.hex(w.shift()?.toHex()||"#000")(z);$.push(v)}return $.join(`
307
+ `)}function _9(q){let _={interpolation:"rgb",hsvSpin:"short",...q};if(q!==void 0&&typeof q!=="object")throw new TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof q}\``);if(typeof _.interpolation!=="string")throw new TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof _.interpolation}\``);if(_.interpolation.toLowerCase()==="hsv"&&typeof _.hsvSpin!=="string")throw new TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof _.hsvSpin}\``);return _}var c6={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"],options:{}},cristal:{colors:["#bdfff3","#4ac29a"],options:{}},teen:{colors:["#77a1d3","#79cbca","#e684ae"],options:{}},mind:{colors:["#473b7b","#3584a7","#30d2be"],options:{}},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"],options:{}},fruit:{colors:["#ff4e50","#f9d423"],options:{}},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"],options:{}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}},summer:{colors:["#fdbb2d","#22c1c3"],options:{}},rainbow:{colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}},pastel:{colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}}};function r6(q){let _=(j)=>G6(...q.colors)(j,q.options);return _.multiline=(j="")=>G6(...q.colors).multiline(j,q.options),_}var M6=G6,qG=r6(c6.atlas),_G=r6(c6.cristal),KG=r6(c6.teen),jG=r6(c6.mind),PG=r6(c6.morning),fG=r6(c6.vice),YG=r6(c6.passion),$G=r6(c6.fruit),wG=r6(c6.instagram),OG=r6(c6.retro),vG=r6(c6.summer),zG=r6(c6.rainbow),WG=r6(c6.pastel);G6.atlas=qG;G6.cristal=_G;G6.teen=KG;G6.mind=jG;G6.morning=PG;G6.vice=fG;G6.passion=YG;G6.fruit=$G;G6.instagram=wG;G6.retro=OG;G6.summer=vG;G6.rainbow=zG;G6.pastel=WG;import M7 from"node:process";function K9({onlyFirst:q=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",q?void 0:"g")}var JG=K9();function j9(q){if(typeof q!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(JG,"")}function df(q){return q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109}function pf(q){return q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510}function Lf(q){return q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9776&&q<=9783||q>=9800&&q<=9811||q===9855||q>=9866&&q<=9871||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12773||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101631&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q>=119552&&q<=119638||q>=119648&&q<=119670||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129673||q>=129679&&q<=129734||q>=129742&&q<=129756||q>=129759&&q<=129769||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141}function HG(q){if(!Number.isSafeInteger(q))throw new TypeError(`Expected a code point, got \`${typeof q}\`.`)}function lf(q,{ambiguousAsWide:_=!1}={}){if(HG(q),pf(q)||Lf(q)||_&&df(q))return 2;return 1}var cf=e6(nf(),1),TG=new Intl.Segmenter,ZG=/^\p{Default_Ignorable_Code_Point}$/u;function N6(q,_={}){if(typeof q!=="string"||q.length===0)return 0;let{ambiguousIsNarrow:j=!0,countAnsiEscapeCodes:K=!1}=_;if(!K)q=j9(q);if(q.length===0)return 0;let f=0,Y={ambiguousAsWide:!j};for(let{segment:P}of TG.segment(q)){let $=P.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if(ZG.test(P))continue;if(cf.default().test(P)){f+=2;continue}f+=lf($,Y)}return f}function h7(q){let _=0;for(let j of q.split(`
308
+ `))_=Math.max(_,N6(j));return _}var AY=e6(f9(),1);var XG=/[\p{Lu}]/u,AG=/[\p{Ll}]/u,af=/^[\p{Lu}](?![\p{Lu}])/gu,ef=/([\p{Alpha}\p{N}_]|$)/u,Y9=/[_.\- ]+/,GG=new RegExp("^"+Y9.source),Bf=new RegExp(Y9.source+ef.source,"gu"),tf=new RegExp("\\d+"+ef.source,"gu"),uG=(q,_,j,K)=>{let f=!1,Y=!1,P=!1,$=!1;for(let O=0;O<q.length;O++){let w=q[O];if($=O>2?q[O-3]==="-":!0,f&&XG.test(w))q=q.slice(0,O)+"-"+q.slice(O),f=!1,P=Y,Y=!0,O++;else if(Y&&P&&AG.test(w)&&(!$||K))q=q.slice(0,O-1)+"-"+q.slice(O-1),P=Y,Y=!1,f=!0;else f=_(w)===w&&j(w)!==w,P=Y,Y=j(w)===w&&_(w)!==w}return q},hG=(q,_)=>{return af.lastIndex=0,q.replaceAll(af,(j)=>_(j))},DG=(q,_)=>{return Bf.lastIndex=0,tf.lastIndex=0,q.replaceAll(tf,(j,K,f)=>["_","-"].includes(q.charAt(f+j.length))?j:_(j)).replaceAll(Bf,(j,K)=>_(K))};function $9(q,_){if(!(typeof q==="string"||Array.isArray(q)))throw new TypeError("Expected the input to be `string | string[]`");if(_={pascalCase:!1,preserveConsecutiveUppercase:!1,..._},Array.isArray(q))q=q.map((Y)=>Y.trim()).filter((Y)=>Y.length).join("-");else q=q.trim();if(q.length===0)return"";let j=_.locale===!1?(Y)=>Y.toLowerCase():(Y)=>Y.toLocaleLowerCase(_.locale),K=_.locale===!1?(Y)=>Y.toUpperCase():(Y)=>Y.toLocaleUpperCase(_.locale);if(q.length===1){if(Y9.test(q))return"";return _.pascalCase?K(q):j(q)}if(q!==j(q))q=uG(q,j,K,_.preserveConsecutiveUppercase);if(q=q.replace(GG,""),q=_.preserveConsecutiveUppercase?hG(q,j):j(q),_.pascalCase)q=K(q.charAt(0))+q.slice(1);return DG(q,K)}var H9=e6($Y(),1);function v9({onlyFirst:q=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",q?void 0:"g")}var RG=v9();function z9(q){if(typeof q!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(RG,"")}var wY=(q=0)=>(_)=>`\x1B[${_+q}m`,OY=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,vY=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,n8={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},P0=Object.keys(n8.modifier),mG=Object.keys(n8.color),IG=Object.keys(n8.bgColor),f0=[...mG,...IG];function gG(){let q=new Map;for(let[_,j]of Object.entries(n8)){for(let[K,f]of Object.entries(j))n8[K]={open:`\x1B[${f[0]}m`,close:`\x1B[${f[1]}m`},j[K]=n8[K],q.set(f[0],f[1]);Object.defineProperty(n8,_,{value:j,enumerable:!1})}return Object.defineProperty(n8,"codes",{value:q,enumerable:!1}),n8.color.close="\x1B[39m",n8.bgColor.close="\x1B[49m",n8.color.ansi=wY(),n8.color.ansi256=OY(),n8.color.ansi16m=vY(),n8.bgColor.ansi=wY(10),n8.bgColor.ansi256=OY(10),n8.bgColor.ansi16m=vY(10),Object.defineProperties(n8,{rgbToAnsi256:{value:(_,j,K)=>{if(_===j&&j===K){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(j/255*5)+Math.round(K/255*5)},enumerable:!1},hexToRgb:{value:(_)=>{let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;if(K.length===3)K=[...K].map((Y)=>Y+Y).join("");let f=Number.parseInt(K,16);return[f>>16&255,f>>8&255,f&255]},enumerable:!1},hexToAnsi256:{value:(_)=>n8.rgbToAnsi256(...n8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value:(_)=>{if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,f;if(_>=232)j=((_-232)*10+8)/255,K=j,f=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,f=$%6/5}let Y=Math.max(j,K,f)*2;if(Y===0)return 30;let P=30+(Math.round(f)<<2|Math.round(K)<<1|Math.round(j));if(Y===2)P+=60;return P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>n8.ansi256ToAnsi(n8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>n8.ansi256ToAnsi(n8.hexToAnsi256(_)),enumerable:!1}}),n8}var yG=gG(),zY=yG;var C7=new Set(["\x1B","›"]),dG=39,J9="\x07",HY="[",pG="]",TY="m",D7=`${pG}8;;`,WY=(q)=>`${C7.values().next().value}${HY}${q}${TY}`,JY=(q)=>`${C7.values().next().value}${D7}${q}${J9}`,LG=(q)=>q.split(" ").map((_)=>N6(_)),W9=(q,_,j)=>{let K=[..._],f=!1,Y=!1,P=N6(z9(q.at(-1)));for(let[$,O]of K.entries()){let w=N6(O);if(P+w<=j)q[q.length-1]+=O;else q.push(O),P=0;if(C7.has(O))f=!0,Y=K.slice($+1,$+1+D7.length).join("")===D7;if(f){if(Y){if(O===J9)f=!1,Y=!1}else if(O===TY)f=!1;continue}if(P+=w,P===j&&$<K.length-1)q.push(""),P=0}if(!P&&q.at(-1).length>0&&q.length>1)q[q.length-2]+=q.pop()},lG=(q)=>{let _=q.split(" "),j=_.length;while(j>0){if(N6(_[j-1])>0)break;j--}if(j===_.length)return q;return _.slice(0,j).join(" ")+_.slice(j).join("")},xG=(q,_,j={})=>{if(j.trim!==!1&&q.trim()==="")return"";let K="",f,Y,P=LG(q),$=[""];for(let[z,W]of q.split(" ").entries()){if(j.trim!==!1)$[$.length-1]=$.at(-1).trimStart();let H=N6($.at(-1));if(z!==0){if(H>=_&&(j.wordWrap===!1||j.trim===!1))$.push(""),H=0;if(H>0||j.trim===!1)$[$.length-1]+=" ",H++}if(j.hard&&P[z]>_){let Z=_-H,J=1+Math.floor((P[z]-Z-1)/_);if(Math.floor((P[z]-1)/_)<J)$.push("");W9($,W,_);continue}if(H+P[z]>_&&H>0&&P[z]>0){if(j.wordWrap===!1&&H<_){W9($,W,_);continue}$.push("")}if(H+P[z]>_&&j.wordWrap===!1){W9($,W,_);continue}$[$.length-1]+=W}if(j.trim!==!1)$=$.map((z)=>lG(z));let O=$.join(`
309
+ `),w=[...O],v=0;for(let[z,W]of w.entries()){if(K+=W,C7.has(W)){let{groups:Z}=new RegExp(`(?:\\${HY}(?<code>\\d+)m|\\${D7}(?<uri>.*)${J9})`).exec(O.slice(v))||{groups:{}};if(Z.code!==void 0){let J=Number.parseFloat(Z.code);f=J===dG?void 0:J}else if(Z.uri!==void 0)Y=Z.uri.length===0?void 0:Z.uri}let H=zY.codes.get(Number(f));if(w[z+1]===`
310
+ `){if(Y)K+=JY("");if(f&&H)K+=WY(H)}else if(W===`
311
+ `){if(f&&H)K+=WY(f);if(Y)K+=JY(Y)}v+=W.length}return K};function V7(q,_,j){return String(q).normalize().replaceAll(`\r
308
312
  `,`
309
313
  `).split(`
310
- `).map((K)=>RG(K,_,j)).join(`
311
- `)}var xG=B6(F2(),1),Qq=`
312
- `,c6=" ",P3="none",Hf=()=>{let{env:q,stdout:_,stderr:j}=u7;if(_?.columns)return _.columns;if(j?.columns)return j.columns;if(q.COLUMNS)return Number.parseInt(q.COLUMNS,10);return 80},vf=(q)=>typeof q==="number"?{top:q,right:q*3,bottom:q,left:q*3}:{top:0,right:0,bottom:0,left:0,...q},Y3=(q)=>q===P3?0:2,mG=(q)=>{let _=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"],j;if(q===P3){q={};for(let K of _)q[K]=""}if(typeof q==="string"){if(j=Jf.default[q],!j)throw new TypeError(`Invalid border style: ${q}`)}else{if(typeof q?.vertical==="string")q.left=q.vertical,q.right=q.vertical;if(typeof q?.horizontal==="string")q.top=q.horizontal,q.bottom=q.horizontal;for(let K of _)if(q[K]===null||typeof q[K]!=="string")throw new TypeError(`Invalid border style: ${K}`);j=q}return j},IG=(q,_,j)=>{let K="",Y=N6(q);switch(j){case"left":{K=q+_.slice(Y);break}case"right":{K=_.slice(Y)+q;break}default:{if(_=_.slice(Y),_.length%2===1)_=_.slice(Math.floor(_.length/2)),K=_.slice(1)+q+_;else _=_.slice(_.length/2),K=_+q+_;break}}return K},gG=(q,{padding:_,width:j,textAlignment:K,height:Y})=>{q=Y9.default(q,{align:K});let f=q.split(Qq),P=k7(q),$=j-_.left-_.right;if(P>$){let v=[];for(let z of f){let W=G7(z,$,{hard:!0}),Z=Y9.default(W,{align:K}).split(`
313
- `),H=Math.max(...Z.map((X)=>N6(X)));for(let X of Z){let A;switch(K){case"center":{A=c6.repeat(($-H)/2)+X;break}case"right":{A=c6.repeat($-H)+X;break}default:{A=X;break}}v.push(A)}}f=v}if(K==="center"&&P<$)f=f.map((v)=>c6.repeat(($-P)/2)+v);else if(K==="right"&&P<$)f=f.map((v)=>c6.repeat($-P)+v);let O=c6.repeat(_.left),w=c6.repeat(_.right);if(f=f.map((v)=>{let z=O+v+w;return z+c6.repeat(j-N6(z))}),_.top>0)f=[...Array.from({length:_.top}).fill(c6.repeat(j)),...f];if(_.bottom>0)f=[...f,...Array.from({length:_.bottom}).fill(c6.repeat(j))];if(Y&&f.length>Y)f=f.slice(0,Y);else if(Y&&f.length<Y)f=[...f,...Array.from({length:Y-f.length}).fill(c6.repeat(j))];return f.join(Qq)},yG=(q,_,j)=>{let K=(v)=>{let z=j.borderColor?LG(j.borderColor)(v):v;return j.dimBorder?I.dim(z):z},Y=(v)=>j.backgroundColor?lG(j.backgroundColor)(v):v,f=mG(j.borderStyle),P=Hf(),$=c6.repeat(j.margin.left);if(j.float==="center"){let v=Math.max((P-_-Y3(j.borderStyle))/2,0);$=c6.repeat(v)}else if(j.float==="right"){let v=Math.max(P-_-j.margin.right-Y3(j.borderStyle),0);$=c6.repeat(v)}let O="";if(j.margin.top)O+=Qq.repeat(j.margin.top);if(j.borderStyle!==P3||j.title)O+=K($+f.topLeft+(j.title?IG(j.title,f.top.repeat(_),j.titleAlignment):f.top.repeat(_))+f.topRight)+Qq;let w=q.split(Qq);if(O+=w.map((v)=>$+K(f.left)+Y(v)+K(f.right)).join(Qq),j.borderStyle!==P3)O+=Qq+K($+f.bottomLeft+f.bottom.repeat(_)+f.bottomRight);if(j.margin.bottom)O+=Qq.repeat(j.margin.bottom);return O},dG=(q)=>{if(q.fullscreen&&u7?.stdout){let _=[u7.stdout.columns,u7.stdout.rows];if(typeof q.fullscreen==="function")_=q.fullscreen(..._);q.width||=_[0],q.height||=_[1]}return q.width&&=Math.max(1,q.width-Y3(q.borderStyle)),q.height&&=Math.max(1,q.height-Y3(q.borderStyle)),q},zf=(q,_)=>_===P3?q:` ${q} `,pG=(q,_)=>{_=dG(_);let j=_.width!==void 0,K=Hf(),Y=Y3(_.borderStyle),f=K-_.margin.left-_.margin.right-Y,P=k7(G7(q,K-Y,{hard:!0,trim:!1}))+_.padding.left+_.padding.right;if(_.title&&j)_.title=_.title.slice(0,Math.max(0,_.width-2)),_.title&&=zf(_.title,_.borderStyle);else if(_.title){if(_.title=_.title.slice(0,Math.max(0,f-2)),_.title){if(_.title=zf(_.title,_.borderStyle),N6(_.title)>P)_.width=N6(_.title)}}if(_.width||=P,!j){if(_.margin.left&&_.margin.right&&_.width>f){let O=(K-_.width-Y)/(_.margin.left+_.margin.right);_.margin.left=Math.max(0,Math.floor(_.margin.left*O)),_.margin.right=Math.max(0,Math.floor(_.margin.right*O))}_.width=Math.min(_.width,K-Y-_.margin.left-_.margin.right)}if(_.width-(_.padding.left+_.padding.right)<=0)_.padding.left=0,_.padding.right=0;if(_.height&&_.height-(_.padding.top+_.padding.bottom)<=0)_.padding.top=0,_.padding.bottom=0;return _},f9=(q)=>q.match(/^#(?:[0-f]{3}){1,2}$/i),Wf=(q)=>typeof q==="string"&&(I[q]??f9(q)),LG=(q)=>f9(q)?I.hex(q):I[q],lG=(q)=>f9(q)?I.bgHex(q):I[s2(["bg",q])];function q_(q,_){if(_={padding:0,borderStyle:"single",dimBorder:!1,textAlignment:"left",float:"left",titleAlignment:"left",..._},_.align)_.textAlignment=_.align;if(_.borderColor&&!Wf(_.borderColor))throw new Error(`${_.borderColor} is not a valid borderColor`);if(_.backgroundColor&&!Wf(_.backgroundColor))throw new Error(`${_.backgroundColor} is not a valid backgroundColor`);return _.padding=vf(_.padding),_.margin=vf(_.margin),_=pG(q,_),q=gG(q,_),yG(q,_.width,_)}p6();function w9(q){let _,j=0,K=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];return{start(){_=setInterval(()=>{process.stdout.write(`\r${I.cyan(K[j%K.length])} ${q}`),j++},50)},stop(Y,f=!0){clearInterval(_);let P=f?I.green("✓"):I.red("✗");process.stdout.write(`\r${P} ${Y}
314
- `)}}}var J6=(q)=>new Promise((_)=>setTimeout(_,q)),f3=M6(["#ff0000","#ff4500","#ffa500","#ffff00","#00ff00","#00ffff","#0000ff","#8b00ff"]),h7=M6(["#ff006e","#fb5607","#ffbe0b","#8338ec","#3a86ff"]);async function iG(){let q=[{name:"Node.js version",check:async()=>{let j=process.versions.node,[K]=j.split(".").map(Number);return{success:K>=18,message:K>=18?"":`Node.js ${j} is below required version 18.0.0`}}},{name:"Claude Code CLI",check:async()=>{try{return G_("which claude",{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!1,message:"Claude Code CLI not found. Please install: https://docs.anthropic.com/claude/docs/claude-code"}}}},{name:"uv (Python package manager)",check:async()=>{try{return G_("which uv",{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!0,message:"",needsInstall:!0}}}},{name:"Write permissions",check:async()=>{let j=C8(P8.getDataDirectory(),"test-permissions");try{return TK(j,{recursive:!0}),h_(C8(j,"test"),"test"),G_(`rm -rf ${j}`,{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!1,message:"No write permissions to claude-mem data directory"}}}}],_=!1;for(let{name:j,check:K}of q){let Y=await K();if(!Y.success)return console.log(q_(I.red(`❌ ${j} check failed!
314
+ `).map((K)=>xG(K,_,j)).join(`
315
+ `)}var eG=e6(f9(),1),q_=`
316
+ `,i6=" ",O3="none",GY=()=>{let{env:q,stdout:_,stderr:j}=M7;if(_?.columns)return _.columns;if(j?.columns)return j.columns;if(q.COLUMNS)return Number.parseInt(q.COLUMNS,10);return 80},ZY=(q)=>typeof q==="number"?{top:q,right:q*3,bottom:q,left:q*3}:{top:0,right:0,bottom:0,left:0,...q},v3=(q)=>q===O3?0:2,nG=(q)=>{let _=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"],j;if(q===O3){q={};for(let K of _)q[K]=""}if(typeof q==="string"){if(j=AY.default[q],!j)throw new TypeError(`Invalid border style: ${q}`)}else{if(typeof q?.vertical==="string")q.left=q.vertical,q.right=q.vertical;if(typeof q?.horizontal==="string")q.top=q.horizontal,q.bottom=q.horizontal;for(let K of _)if(q[K]===null||typeof q[K]!=="string")throw new TypeError(`Invalid border style: ${K}`);j=q}return j},cG=(q,_,j)=>{let K="",f=N6(q);switch(j){case"left":{K=q+_.slice(f);break}case"right":{K=_.slice(f)+q;break}default:{if(_=_.slice(f),_.length%2===1)_=_.slice(Math.floor(_.length/2)),K=_.slice(1)+q+_;else _=_.slice(_.length/2),K=_+q+_;break}}return K},rG=(q,{padding:_,width:j,textAlignment:K,height:f})=>{q=H9.default(q,{align:K});let Y=q.split(q_),P=h7(q),$=j-_.left-_.right;if(P>$){let v=[];for(let z of Y){let W=V7(z,$,{hard:!0}),Z=H9.default(W,{align:K}).split(`
317
+ `),J=Math.max(...Z.map((X)=>N6(X)));for(let X of Z){let A;switch(K){case"center":{A=i6.repeat(($-J)/2)+X;break}case"right":{A=i6.repeat($-J)+X;break}default:{A=X;break}}v.push(A)}}Y=v}if(K==="center"&&P<$)Y=Y.map((v)=>i6.repeat(($-P)/2)+v);else if(K==="right"&&P<$)Y=Y.map((v)=>i6.repeat($-P)+v);let O=i6.repeat(_.left),w=i6.repeat(_.right);if(Y=Y.map((v)=>{let z=O+v+w;return z+i6.repeat(j-N6(z))}),_.top>0)Y=[...Array.from({length:_.top}).fill(i6.repeat(j)),...Y];if(_.bottom>0)Y=[...Y,...Array.from({length:_.bottom}).fill(i6.repeat(j))];if(f&&Y.length>f)Y=Y.slice(0,f);else if(f&&Y.length<f)Y=[...Y,...Array.from({length:f-Y.length}).fill(i6.repeat(j))];return Y.join(q_)},iG=(q,_,j)=>{let K=(v)=>{let z=j.borderColor?BG(j.borderColor)(v):v;return j.dimBorder?g.dim(z):z},f=(v)=>j.backgroundColor?tG(j.backgroundColor)(v):v,Y=nG(j.borderStyle),P=GY(),$=i6.repeat(j.margin.left);if(j.float==="center"){let v=Math.max((P-_-v3(j.borderStyle))/2,0);$=i6.repeat(v)}else if(j.float==="right"){let v=Math.max(P-_-j.margin.right-v3(j.borderStyle),0);$=i6.repeat(v)}let O="";if(j.margin.top)O+=q_.repeat(j.margin.top);if(j.borderStyle!==O3||j.title)O+=K($+Y.topLeft+(j.title?cG(j.title,Y.top.repeat(_),j.titleAlignment):Y.top.repeat(_))+Y.topRight)+q_;let w=q.split(q_);if(O+=w.map((v)=>$+K(Y.left)+f(v)+K(Y.right)).join(q_),j.borderStyle!==O3)O+=q_+K($+Y.bottomLeft+Y.bottom.repeat(_)+Y.bottomRight);if(j.margin.bottom)O+=q_.repeat(j.margin.bottom);return O},oG=(q)=>{if(q.fullscreen&&M7?.stdout){let _=[M7.stdout.columns,M7.stdout.rows];if(typeof q.fullscreen==="function")_=q.fullscreen(..._);q.width||=_[0],q.height||=_[1]}return q.width&&=Math.max(1,q.width-v3(q.borderStyle)),q.height&&=Math.max(1,q.height-v3(q.borderStyle)),q},kY=(q,_)=>_===O3?q:` ${q} `,aG=(q,_)=>{_=oG(_);let j=_.width!==void 0,K=GY(),f=v3(_.borderStyle),Y=K-_.margin.left-_.margin.right-f,P=h7(V7(q,K-f,{hard:!0,trim:!1}))+_.padding.left+_.padding.right;if(_.title&&j)_.title=_.title.slice(0,Math.max(0,_.width-2)),_.title&&=kY(_.title,_.borderStyle);else if(_.title){if(_.title=_.title.slice(0,Math.max(0,Y-2)),_.title){if(_.title=kY(_.title,_.borderStyle),N6(_.title)>P)_.width=N6(_.title)}}if(_.width||=P,!j){if(_.margin.left&&_.margin.right&&_.width>Y){let O=(K-_.width-f)/(_.margin.left+_.margin.right);_.margin.left=Math.max(0,Math.floor(_.margin.left*O)),_.margin.right=Math.max(0,Math.floor(_.margin.right*O))}_.width=Math.min(_.width,K-f-_.margin.left-_.margin.right)}if(_.width-(_.padding.left+_.padding.right)<=0)_.padding.left=0,_.padding.right=0;if(_.height&&_.height-(_.padding.top+_.padding.bottom)<=0)_.padding.top=0,_.padding.bottom=0;return _},T9=(q)=>q.match(/^#(?:[0-f]{3}){1,2}$/i),XY=(q)=>typeof q==="string"&&(g[q]??T9(q)),BG=(q)=>T9(q)?g.hex(q):g[q],tG=(q)=>T9(q)?g.bgHex(q):g[$9(["bg",q])];function __(q,_){if(_={padding:0,borderStyle:"single",dimBorder:!1,textAlignment:"left",float:"left",titleAlignment:"left",..._},_.align)_.textAlignment=_.align;if(_.borderColor&&!XY(_.borderColor))throw new Error(`${_.borderColor} is not a valid borderColor`);if(_.backgroundColor&&!XY(_.backgroundColor))throw new Error(`${_.backgroundColor} is not a valid backgroundColor`);return _.padding=ZY(_.padding),_.margin=ZY(_.margin),_=aG(q,_),q=rG(q,_),iG(q,_.width,_)}L6();function k9(q){let _,j=0,K=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];return{start(){_=setInterval(()=>{process.stdout.write(`\r${g.cyan(K[j%K.length])} ${q}`),j++},50)},stop(f,Y=!0){clearInterval(_);let P=Y?g.green("✓"):g.red("✗");process.stdout.write(`\r${P} ${f}
318
+ `)}}}var T6=(q)=>new Promise((_)=>setTimeout(_,q)),z3=M6(["#ff0000","#ff4500","#ffa500","#ffff00","#00ff00","#00ffff","#0000ff","#8b00ff"]),N7=M6(["#ff006e","#fb5607","#ffbe0b","#8338ec","#3a86ff"]);async function QG(){let q=[{name:"Node.js version",check:async()=>{let j=process.versions.node,[K]=j.split(".").map(Number);return{success:K>=18,message:K>=18?"":`Node.js ${j} is below required version 18.0.0`}}},{name:"Claude Code CLI",check:async()=>{try{return h_("which claude",{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!1,message:"Claude Code CLI not found. Please install: https://docs.anthropic.com/claude/docs/claude-code"}}}},{name:"uv (Python package manager)",check:async()=>{try{return h_("which uv",{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!0,message:"",needsInstall:!0}}}},{name:"Write permissions",check:async()=>{let j=C8(P8.getDataDirectory(),"test-permissions");try{return AK(j,{recursive:!0}),C_(C8(j,"test"),"test"),h_(`rm -rf ${j}`,{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!1,message:"No write permissions to claude-mem data directory"}}}}],_=!1;for(let{name:j,check:K}of q){let f=await K();if(!f.success)return console.log(__(g.red(`❌ ${j} check failed!
315
319
 
316
- ${Y.message}`),{padding:1,margin:1,borderStyle:"double",borderColor:"red"})),!1;if(Y.needsInstall&&j==="uv (Python package manager)")_=!0}if(_){let j=w9("Installing uv (Python package manager)...");j.start();try{G_("curl -LsSf https://astral.sh/uv/install.sh | sh",{stdio:"pipe",shell:"/bin/sh"}),process.env.PATH=`${$9()}/.cargo/bin:${process.env.PATH}`,j.stop("uv installed successfully",!0)}catch(K){return j.stop("Failed to install uv automatically",!1),console.log(q_(I.yellow(`⚠️ Please install uv manually:
320
+ ${f.message}`),{padding:1,margin:1,borderStyle:"double",borderColor:"red"})),!1;if(f.needsInstall&&j==="uv (Python package manager)")_=!0}if(_){let j=k9("Installing uv (Python package manager)...");j.start();try{h_("curl -LsSf https://astral.sh/uv/install.sh | sh",{stdio:"pipe",shell:"/bin/sh"}),process.env.PATH=`${Z9()}/.cargo/bin:${process.env.PATH}`,j.stop("uv installed successfully",!0)}catch(K){return j.stop("Failed to install uv automatically",!1),console.log(__(g.yellow(`⚠️ Please install uv manually:
317
321
 
318
- ${I.cyan("curl -LsSf https://astral.sh/uv/install.sh | sh")}
322
+ ${g.cyan("curl -LsSf https://astral.sh/uv/install.sh | sh")}
319
323
 
320
- Or visit: ${I.cyan("https://docs.astral.sh/uv/getting-started/installation/")}`),{padding:1,margin:1,borderStyle:"round",borderColor:"yellow"})),!1}}return!0}function Tf(){try{return G_("which claude",{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||null}catch{return null}}function oG(){let q={hasHooks:!1,hasChromaMcp:!1,hasSettings:!1,scope:void 0},_=P8.getHooksDirectory();q.hasHooks=E8(_)&&E8(C8(_,"pre-compact.js"))&&E8(C8(_,"session-start.js"));let j=P8.getInstance(),K=j.getMcpConfigPath(),Y=j.getProjectMcpConfigPath();if(E8(K))try{if(JSON.parse(JK(K,"utf8")).mcpServers?.["claude-mem"])q.hasChromaMcp=!0,q.scope="user"}catch{}if(E8(Y))try{if(JSON.parse(JK(Y,"utf8")).mcpServers?.["claude-mem"])q.hasChromaMcp=!0,q.scope="project"}catch{}let f=j.getUserSettingsPath();return q.hasSettings=E8(f),q}async function aG(q){let _={};if(q.hasHooks||q.hasChromaMcp){let f=await zq({message:`\uD83E\uDDE0 Existing claude-mem installation detected. Your memories and data are safe!
324
+ Or visit: ${g.cyan("https://docs.astral.sh/uv/getting-started/installation/")}`),{padding:1,margin:1,borderStyle:"round",borderColor:"yellow"})),!1}}return!0}function uY(){try{return h_("which claude",{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||null}catch{return null}}function qu(){let q={hasHooks:!1,hasChromaMcp:!1,hasSettings:!1,scope:void 0},_=P8.getHooksDirectory();q.hasHooks=E8(_)&&E8(C8(_,"pre-compact.js"))&&E8(C8(_,"session-start.js"));let j=P8.getInstance(),K=j.getMcpConfigPath(),f=j.getProjectMcpConfigPath();if(E8(K))try{if(JSON.parse(kK(K,"utf8")).mcpServers?.["claude-mem"])q.hasChromaMcp=!0,q.scope="user"}catch{}if(E8(f))try{if(JSON.parse(kK(f,"utf8")).mcpServers?.["claude-mem"])q.hasChromaMcp=!0,q.scope="project"}catch{}let Y=j.getUserSettingsPath();return q.hasSettings=E8(Y),q}async function _u(q){let _={};if(q.hasHooks||q.hasChromaMcp){let Y=await n6({message:`\uD83E\uDDE0 Existing claude-mem installation detected. Your memories and data are safe!
321
325
 
322
- Reinstall to update hooks and configuration?`,initialValue:!0});if(t8(f))return V6("Installation cancelled"),null;if(!f)return V6("Installation cancelled"),null;_.forceReinstall=!0}else _.forceReinstall=!1;let j=await X6({message:"Select installation scope",options:[{value:"user",label:"User (Recommended)",hint:"Install for current user (~/.claude)"},{value:"project",label:"Project",hint:"Install for current project only (./.mcp.json)"},{value:"local",label:"Local",hint:"Custom local installation"}],initialValue:q.scope||"user"});if(t8(j))return V6("Installation cancelled"),null;if(_.scope=j,j==="local"){let f=await X_({message:"Enter custom installation directory",placeholder:C8(process.cwd(),".claude-mem"),validate:(P)=>{if(!P)return"Path is required";if(!P.startsWith("/")&&!P.startsWith("~"))return"Please provide an absolute path"}});if(t8(f))return V6("Installation cancelled"),null;_.customPath=f}_.hookTimeout=180000;let K=await zq({message:'Enable Smart Trash? This creates an alias for "rm" that moves files to ~/.claude-mem/trash instead of permanently deleting them. You can restore files anytime by typing "claude-mem restore".',initialValue:!0});if(t8(K))return V6("Installation cancelled"),null;_.enableSmartTrash=K;let Y=await zq({message:`claude-mem is designed to save "memories" when you type /compact. The official compact summary + claude-mem produces the best ongoing results, but sometimes you may want to completely clear the context and still retain the "memories" from your last conversation.
326
+ Reinstall to update hooks and configuration?`,initialValue:!0});if(L8(Y))return $6("Installation cancelled"),null;if(!Y)return $6("Installation cancelled"),null;_.forceReinstall=!0}else _.forceReinstall=!1;let j=await H6({message:"Select installation scope",options:[{value:"user",label:"User (Recommended)",hint:"Install for current user (~/.claude)"},{value:"project",label:"Project",hint:"Install for current project only (./.mcp.json)"},{value:"local",label:"Local",hint:"Custom local installation"}],initialValue:q.scope||"user"});if(L8(j))return $6("Installation cancelled"),null;if(_.scope=j,j==="local"){let Y=await G_({message:"Enter custom installation directory",placeholder:C8(process.cwd(),".claude-mem"),validate:(P)=>{if(!P)return"Path is required";if(!P.startsWith("/")&&!P.startsWith("~"))return"Please provide an absolute path"}});if(L8(Y))return $6("Installation cancelled"),null;_.customPath=Y}_.hookTimeout=180000;let K=await n6({message:'Enable Smart Trash? This creates an alias for "rm" that moves files to ~/.claude-mem/trash instead of permanently deleting them. You can restore files anytime by typing "claude-mem restore".',initialValue:!0});if(L8(K))return $6("Installation cancelled"),null;_.enableSmartTrash=K;let f=await n6({message:`claude-mem is designed to save "memories" when you type /compact. The official compact summary + claude-mem produces the best ongoing results, but sometimes you may want to completely clear the context and still retain the "memories" from your last conversation.
323
327
 
324
- Would you like to save memories when you type "/clear" in Claude Code? When running /clear with this on, it takes about a minute to save memories before your new session starts.`,initialValue:!1});if(t8(Y))return V6("Installation cancelled"),null;return _.saveMemoriesOnClear=Y,_}async function BG(){let q=P8.getInstance(),_=C8(q.getBackupsDirectory(),new Date().toISOString().replace(/[:.]/g,"-"));try{TK(_,{recursive:!0});let j=q.getHooksDirectory();if(E8(j))O9(j,C8(_,"hooks"));let K=q.getUserSettingsPath();if(E8(K))u_(K,C8(_,"settings.json"));let Y=q.getClaudeSettingsPath();if(E8(Y))u_(Y,C8(_,"claude-settings.json"));return _}catch(j){return null}}function tG(){let q=P8.getInstance();q.ensureAllDataDirectories(),q.ensureAllClaudeDirectories();let _=C8(q.getDataDirectory(),"package.json");if(!E8(_))h_(_,JSON.stringify({name:"claude-mem-data",type:"module"},null,2))}function O9(q,_){if(cG(q).isDirectory()){if(!E8(_))TK(_,{recursive:!0});rG(q).forEach((Y)=>{O9(C8(q,Y),C8(_,Y))})}else u_(q,_)}function eG(q=180000){let _=P8.getInstance(),j=_.getHooksDirectory(),K=Zf(import.meta.url),f=HK(K),P=null;for(let W=0;W<10;W++){let J=C8(f,"hooks");if(E8(C8(J,"pre-compact.js"))){P=J;break}let Z=HK(f);if(Z===f)break;f=Z}if(!P)try{P=_.findPackageHooksDirectory()}catch(W){throw new Error("Cannot dynamically locate hooks directory. The package may be corrupted.")}let $=["pre-compact.js","session-start.js","session-end.js"];for(let W of $){let J=C8(P,W),Z=C8(j,W);if(E8(J))u_(J,Z),nG(Z,493)}let O=C8(P,"shared"),w=C8(j,"shared");if(E8(O))O9(O,w);let v=C8(j,"config.json");h_(v,JSON.stringify({packageName:iq,cliCommand:iq,backend:"chroma",timeout:q},null,2))}function FG(){let _=P8.getInstance().getClaudeMdPath(),j=HK(_);if(!E8(j))TK(j,{recursive:!0});let K=`
328
+ Would you like to save memories when you type "/clear" in Claude Code? When running /clear with this on, it takes about a minute to save memories before your new session starts.`,initialValue:!1});if(L8(f))return $6("Installation cancelled"),null;return _.saveMemoriesOnClear=f,_}async function Ku(){let q=P8.getInstance(),_=C8(q.getBackupsDirectory(),new Date().toISOString().replace(/[:.]/g,"-"));try{AK(_,{recursive:!0});let j=q.getHooksDirectory();if(E8(j))X9(j,C8(_,"hooks"));let K=q.getUserSettingsPath();if(E8(K))D_(K,C8(_,"settings.json"));let f=q.getClaudeSettingsPath();if(E8(f))D_(f,C8(_,"claude-settings.json"));return _}catch(j){return null}}function ju(){let q=P8.getInstance();q.ensureAllDataDirectories(),q.ensureAllClaudeDirectories();let _=C8(q.getDataDirectory(),"package.json");if(!E8(_))C_(_,JSON.stringify({name:"claude-mem-data",type:"module"},null,2))}function X9(q,_){if(UG(q).isDirectory()){if(!E8(_))AK(_,{recursive:!0});sG(q).forEach((f)=>{X9(C8(q,f),C8(_,f))})}else D_(q,_)}function Pu(q=180000){let _=P8.getInstance(),j=_.getHooksDirectory(),K=hY(import.meta.url),Y=XK(K),P=null;for(let W=0;W<10;W++){let H=C8(Y,"hooks");if(E8(C8(H,"pre-compact.js"))){P=H;break}let Z=XK(Y);if(Z===Y)break;Y=Z}if(!P)try{P=_.findPackageHooksDirectory()}catch(W){throw new Error("Cannot dynamically locate hooks directory. The package may be corrupted.")}let $=["pre-compact.js","session-start.js","session-end.js"];for(let W of $){let H=C8(P,W),Z=C8(j,W);if(E8(H))D_(H,Z),FG(Z,493)}let O=C8(P,"shared"),w=C8(j,"shared");if(E8(O))X9(O,w);let v=C8(j,"config.json");C_(v,JSON.stringify({packageName:oq,cliCommand:oq,backend:"chroma",timeout:q},null,2))}function fu(){let _=P8.getInstance().getClaudeMdPath(),j=XK(_);if(!E8(j))AK(j,{recursive:!0});let K=`
325
329
  <!-- CLAUDE-MEM INSTRUCTIONS -->
326
330
  - You have access to a persistent memory system via the Chroma MCP server (installed as "claude-mem")
327
331
  - The memory system automatically compresses and stores context from your sessions
@@ -368,88 +372,101 @@ Would you like to save memories when you type "/clear" in Claude Code? When runn
368
372
  - Generic tech terms alone - too broad, add context
369
373
  - Complex where clauses - only basic operators supported ($eq, $ne, $in)
370
374
  - **Best Practice:** Semantic search for discovery, metadata filtering for precision. Combine both when possible.
371
- <!-- /CLAUDE-MEM INSTRUCTIONS -->`,Y="";if(E8(_))if(Y=JK(_,"utf8"),Y.includes("<!-- CLAUDE-MEM INSTRUCTIONS -->")){let $=Y.indexOf("<!-- CLAUDE-MEM INSTRUCTIONS -->"),O=Y.indexOf("<!-- /CLAUDE-MEM INSTRUCTIONS -->")+33;if($!==-1&&O!==-1)Y=Y.substring(0,$)+K.trim()+Y.substring(O)}else Y=Y.trim()+`
372
- `+K;else Y=K.trim();h_(_,Y)}async function UG(){let q=w9("Installing Chroma MCP server...");q.start();try{await J6(400);try{G_("claude mcp remove claude-mem",{stdio:"pipe"}),await J6(200)}catch{}let _=`${$9()}/.cargo/bin`;if(E8(_)&&!process.env.PATH?.includes(_))process.env.PATH=`${_}:${process.env.PATH}`;let j=`claude mcp add claude-mem -- uvx chroma-mcp --client-type persistent --data-dir ${P8.getInstance().getChromaDirectory()}`;return G_(j,{stdio:"pipe",env:process.env}),await J6(300),q.stop(h7("Chroma MCP server installed successfully! \uD83D\uDE80"),!0),!0}catch(_){return q.stop("Chroma MCP server installation failed",!1),console.log(q_(I.yellow(`⚠️ Manual installation required:
375
+ <!-- /CLAUDE-MEM INSTRUCTIONS -->`,f="";if(E8(_))if(f=kK(_,"utf8"),f.includes("<!-- CLAUDE-MEM INSTRUCTIONS -->")){let $=f.indexOf("<!-- CLAUDE-MEM INSTRUCTIONS -->"),O=f.indexOf("<!-- /CLAUDE-MEM INSTRUCTIONS -->")+33;if($!==-1&&O!==-1)f=f.substring(0,$)+K.trim()+f.substring(O)}else f=f.trim()+`
376
+ `+K;else f=K.trim();C_(_,f)}async function Yu(){let q=k9("Installing Chroma MCP server...");q.start();try{await T6(400);try{h_("claude mcp remove claude-mem",{stdio:"pipe"}),await T6(200)}catch{}let _=`${Z9()}/.cargo/bin`;if(E8(_)&&!process.env.PATH?.includes(_))process.env.PATH=`${_}:${process.env.PATH}`;let j=`claude mcp add claude-mem -- uvx chroma-mcp --client-type persistent --data-dir ${P8.getInstance().getChromaDirectory()}`;return h_(j,{stdio:"pipe",env:process.env}),await T6(300),q.stop(N7("Chroma MCP server installed successfully! \uD83D\uDE80"),!0),!0}catch(_){return q.stop("Chroma MCP server installation failed",!1),console.log(__(g.yellow(`⚠️ Manual installation required:
373
377
 
374
- ${I.cyan(`claude mcp add claude-mem -- uvx chroma-mcp --client-type persistent --data-dir ${P8.getInstance().getChromaDirectory()}`)}
378
+ ${g.cyan(`claude mcp add claude-mem -- uvx chroma-mcp --client-type persistent --data-dir ${P8.getInstance().getChromaDirectory()}`)}
375
379
 
376
- Make sure uv is installed: ${I.cyan("https://docs.astral.sh/uv/getting-started/installation/")}`),{padding:1,margin:1,borderStyle:"round",borderColor:"yellow"})),!1}}async function sG(q,_){let K=P8.getInstance().getHooksDirectory(),Y=C8(K,"pre-compact.js"),f=C8(K,"session-start.js"),P=C8(K,"session-end.js"),$={};if(E8(q)){let w=JK(q,"utf8");$=JSON.parse(w)}let O=HK(q);if(!E8(O))TK(O,{recursive:!0});if(!$.hooks)$.hooks={};if($.hooks.PreCompact){if($.hooks.PreCompact=$.hooks.PreCompact.filter((w)=>!w.hooks?.some((v)=>v.command?.includes(iq)||v.command?.includes("pre-compact.js"))),!$.hooks.PreCompact.length)delete $.hooks.PreCompact}if($.hooks.SessionStart){if($.hooks.SessionStart=$.hooks.SessionStart.filter((w)=>!w.hooks?.some((v)=>v.command?.includes(iq)||v.command?.includes("session-start.js"))),!$.hooks.SessionStart.length)delete $.hooks.SessionStart}if($.hooks.SessionEnd){if($.hooks.SessionEnd=$.hooks.SessionEnd.filter((w)=>!w.hooks?.some((v)=>v.command?.includes(iq)||v.command?.includes("session-end.js"))),!$.hooks.SessionEnd.length)delete $.hooks.SessionEnd}if(!$.hooks.PreCompact)$.hooks.PreCompact=[];if($.hooks.PreCompact.push({hooks:[{type:"command",command:Y,timeout:180}]}),!$.hooks.SessionStart)$.hooks.SessionStart=[];if($.hooks.SessionStart.push({hooks:[{type:"command",command:f,timeout:180}]}),E8(P)){if(!$.hooks.SessionEnd)$.hooks.SessionEnd=[];$.hooks.SessionEnd.push({hooks:[{type:"command",command:P,timeout:180}]})}h_(q,JSON.stringify($,null,2))}async function QG(){let q=$9(),_=[C8(q,".bashrc"),C8(q,".zshrc"),C8(q,".bash_profile")],j='alias rm="claude-mem trash"',K="# claude-mem smart trash alias";for(let Y of _){if(!E8(Y))continue;try{let f=JK(Y,"utf8");if(f.includes('alias rm="claude-mem trash"'))continue;f+=`
380
+ Make sure uv is installed: ${g.cyan("https://docs.astral.sh/uv/getting-started/installation/")}`),{padding:1,margin:1,borderStyle:"round",borderColor:"yellow"})),!1}}async function $u(q,_){let K=P8.getInstance().getHooksDirectory(),f=C8(K,"pre-compact.js"),Y=C8(K,"session-start.js"),P=C8(K,"session-end.js"),$={};if(E8(q)){let w=kK(q,"utf8");$=JSON.parse(w)}let O=XK(q);if(!E8(O))AK(O,{recursive:!0});if(!$.hooks)$.hooks={};if($.hooks.PreCompact){if($.hooks.PreCompact=$.hooks.PreCompact.filter((w)=>!w.hooks?.some((v)=>v.command?.includes(oq)||v.command?.includes("pre-compact.js"))),!$.hooks.PreCompact.length)delete $.hooks.PreCompact}if($.hooks.SessionStart){if($.hooks.SessionStart=$.hooks.SessionStart.filter((w)=>!w.hooks?.some((v)=>v.command?.includes(oq)||v.command?.includes("session-start.js"))),!$.hooks.SessionStart.length)delete $.hooks.SessionStart}if($.hooks.SessionEnd){if($.hooks.SessionEnd=$.hooks.SessionEnd.filter((w)=>!w.hooks?.some((v)=>v.command?.includes(oq)||v.command?.includes("session-end.js"))),!$.hooks.SessionEnd.length)delete $.hooks.SessionEnd}if(!$.hooks.PreCompact)$.hooks.PreCompact=[];if($.hooks.PreCompact.push({hooks:[{type:"command",command:f,timeout:180}]}),!$.hooks.SessionStart)$.hooks.SessionStart=[];if($.hooks.SessionStart.push({hooks:[{type:"command",command:Y,timeout:180}]}),E8(P)){if(!$.hooks.SessionEnd)$.hooks.SessionEnd=[];$.hooks.SessionEnd.push({hooks:[{type:"command",command:P,timeout:180}]})}C_(q,JSON.stringify($,null,2))}async function wu(){let q=Z9(),_=[C8(q,".bashrc"),C8(q,".zshrc"),C8(q,".bash_profile")],j='alias rm="claude-mem trash"',K="# claude-mem smart trash alias";for(let f of _){if(!E8(f))continue;try{let Y=kK(f,"utf8");if(Y.includes('alias rm="claude-mem trash"'))continue;Y+=`
377
381
  # claude-mem smart trash alias
378
382
  alias rm="claude-mem trash"
379
- `,h_(Y,f)}catch(f){}}}function qu(q){let j=new Date().toISOString().replace(/T/,"-").replace(/:/g,"").replace(/\..+/,"").replace(/-/g,""),K=`${j.slice(0,8)}-${j.slice(8)}`;return`${q}.backup.${K}`}function _u(q=!1){let _=P8.getInstance(),j=_.getClaudeCommandsDirectory(),K=Zf(import.meta.url),f=HK(K),P=null;for(let z=0;z<10;z++){let W=C8(f,"commands");if(E8(C8(W,"save.md"))){P=W;break}let J=HK(f);if(J===f)break;f=J}if(!P)try{P=_.findPackageCommandsDirectory()}catch(z){throw new Error("Cannot dynamically locate commands directory. The package may be corrupted.")}if(!E8(j))TK(j,{recursive:!0});let $=["save.md","remember.md"],O=[],w=[],v=[];for(let z of $){let W=C8(P,z),J=C8(j,z);if(E8(W))if(E8(J))if(q){let Z=qu(J);u_(J,Z),u_(W,J),v.push(z)}else w.push(z);else u_(W,J),O.push(z)}if(O.length>0)console.log(` ${I.green("✓")} Copied commands: ${O.join(", ")}`);if(v.length>0)console.log(` ${I.blue("\uD83D\uDCE6")} Backed up and replaced commands: ${v.join(", ")}`);if(w.length>0)console.log(` ${I.yellow("→")} Skipped existing commands: ${w.join(", ")}`)}async function Ku(){let q=Jq();q.start("Verifying installation");let _=[],K=P8.getInstance().getHooksDirectory();if(!E8(C8(K,"pre-compact.js")))_.push("Pre-compact hook not found");if(!E8(C8(K,"session-start.js")))_.push("Session-start hook not found");if(_.length>0)q.stop("Installation verification completed with issues"),_6.warn("The following issues were detected:"),_.forEach((Y)=>_6.error(` - ${Y}`)),_6.info("The installation may not work correctly. Consider reinstalling with --force flag.");else q.stop("Installation verified successfully")}async function kf(q={}){console.log(f3(`
380
- ═══════════════════════════════════════`)),console.log(f3(" CLAUDE-MEM INSTALLER ")),console.log(f3("═══════════════════════════════════════")),console.log(q_(h7(`\uD83E\uDDE0 Persistent Memory System for Claude Code
383
+ `,C_(f,Y)}catch(Y){}}}function Ou(q){let j=new Date().toISOString().replace(/T/,"-").replace(/:/g,"").replace(/\..+/,"").replace(/-/g,""),K=`${j.slice(0,8)}-${j.slice(8)}`;return`${q}.backup.${K}`}function vu(q=!1){let _=P8.getInstance(),j=_.getClaudeCommandsDirectory(),K=hY(import.meta.url),Y=XK(K),P=null;for(let z=0;z<10;z++){let W=C8(Y,"commands");if(E8(C8(W,"save.md"))){P=W;break}let H=XK(Y);if(H===Y)break;Y=H}if(!P)try{P=_.findPackageCommandsDirectory()}catch(z){throw new Error("Cannot dynamically locate commands directory. The package may be corrupted.")}if(!E8(j))AK(j,{recursive:!0});let $=["save.md","remember.md"],O=[],w=[],v=[];for(let z of $){let W=C8(P,z),H=C8(j,z);if(E8(W))if(E8(H))if(q){let Z=Ou(H);D_(H,Z),D_(W,H),v.push(z)}else w.push(z);else D_(W,H),O.push(z)}if(O.length>0)console.log(` ${g.green("✓")} Copied commands: ${O.join(", ")}`);if(v.length>0)console.log(` ${g.blue("\uD83D\uDCE6")} Backed up and replaced commands: ${v.join(", ")}`);if(w.length>0)console.log(` ${g.yellow("→")} Skipped existing commands: ${w.join(", ")}`)}async function zu(){let q=_q();q.start("Verifying installation");let _=[],K=P8.getInstance().getHooksDirectory();if(!E8(C8(K,"pre-compact.js")))_.push("Pre-compact hook not found");if(!E8(C8(K,"session-start.js")))_.push("Session-start hook not found");if(_.length>0)q.stop("Installation verification completed with issues"),_6.warn("The following issues were detected:"),_.forEach((f)=>_6.error(` - ${f}`)),_6.info("The installation may not work correctly. Consider reinstalling with --force flag.");else q.stop("Installation verified successfully")}async function DY(q={}){console.log(z3(`
384
+ ═══════════════════════════════════════`)),console.log(z3(" CLAUDE-MEM INSTALLER ")),console.log(z3("═══════════════════════════════════════")),console.log(__(N7(`\uD83E\uDDE0 Persistent Memory System for Claude Code
381
385
 
382
386
  ✨ Transform your Claude experience with seamless context preservation
383
- \uD83D\uDE80 Never lose your conversation history again`),{padding:2,margin:1,borderStyle:"double",borderColor:"magenta",textAlignment:"center"})),await J6(500);let _=q.user||q.project||q.local||q.force,j;if(_)j={scope:q.local?"local":q.project?"project":"user",customPath:q.path,hookTimeout:q.timeout?parseInt(q.timeout):180,forceReinstall:!!q.force};else{if(!await iG())Wq("Please fix the prerequisites issues and try again"),process.exit(1);let z=oG(),W=await aG(z);if(!W)process.exit(0);j=W}if(j.forceReinstall){let v=await BG();if(v)_6.info(`Backup created at: ${v}`)}console.log(h7(`
387
+ \uD83D\uDE80 Never lose your conversation history again`),{padding:2,margin:1,borderStyle:"double",borderColor:"magenta",textAlignment:"center"})),await T6(500);let _=q.user||q.project||q.local||q.force,j;if(_)j={scope:q.local?"local":q.project?"project":"user",customPath:q.path,hookTimeout:q.timeout?parseInt(q.timeout):180,forceReinstall:!!q.force};else{if(!await QG())Hq("Please fix the prerequisites issues and try again"),process.exit(1);let z=qu(),W=await _u(z);if(!W)process.exit(0);j=W}if(j.forceReinstall){let v=await Ku();if(v)_6.info(`Backup created at: ${v}`)}console.log(N7(`
384
388
  \uD83D\uDE80 Beginning Installation Process
385
- `));let K=[{name:"Creating directory structure",action:async()=>{await J6(200),tG(),await J6(100)}},{name:"Installing Chroma MCP server",action:async()=>{if(!await UG())throw new Error("MCP installation failed")}},{name:"Adding CLAUDE.md instructions",action:async()=>{await J6(300),FG(),await J6(200)}},{name:"Installing Claude commands",action:async()=>{await J6(200),_u(j.forceReinstall),await J6(100)}},{name:"Installing memory hooks",action:async()=>{await J6(400),eG(j.hookTimeout),await J6(200)}},{name:"Configuring Claude settings",action:async()=>{await J6(300);let v;if(j.scope==="local"&&j.customPath)v=C8(j.customPath,"settings.local.json");else if(j.scope==="project")v=C8(process.cwd(),".claude","settings.json");else v=P8.getInstance().getClaudeSettingsPath();await sG(v,j);let W=P8.getInstance().getUserSettingsPath(),J={};if(E8(W))try{J=JSON.parse(JK(W,"utf8"))}catch{}J.backend="chroma",J.installed=!0,J.embedded=!0,J.saveMemoriesOnClear=j.saveMemoriesOnClear||!1;let Z=Tf();if(Z)J.claudePath=Z;else delete J.claudePath;h_(W,JSON.stringify(J,null,2)),await J6(200)}}];if(j.enableSmartTrash)K.push({name:"Configuring Smart Trash alias",action:async()=>{await J6(200),await QG(),await J6(100)}});for(let v=0;v<K.length;v++){let z=K[v],W=`[${v+1}/${K.length}]`,J=w9(`${I.gray(W)} ${z.name}...`);J.start();try{await z.action(),J.stop(`${I.gray(W)} ${z.name} ${h7("completed! ✨")}`)}catch(Z){J.stop(`${I.gray(W)} ${z.name} ${I.red("failed")}`,!1),console.log(q_(I.red(`❌ Installation failed at: ${z.name}
389
+ `));let K=[{name:"Creating directory structure",action:async()=>{await T6(200),ju(),await T6(100)}},{name:"Installing Chroma MCP server",action:async()=>{if(!await Yu())throw new Error("MCP installation failed")}},{name:"Adding CLAUDE.md instructions",action:async()=>{await T6(300),fu(),await T6(200)}},{name:"Installing Claude commands",action:async()=>{await T6(200),vu(j.forceReinstall),await T6(100)}},{name:"Installing memory hooks",action:async()=>{await T6(400),Pu(j.hookTimeout),await T6(200)}},{name:"Configuring Claude settings",action:async()=>{await T6(300);let v;if(j.scope==="local"&&j.customPath)v=C8(j.customPath,"settings.local.json");else if(j.scope==="project")v=C8(process.cwd(),".claude","settings.json");else v=P8.getInstance().getClaudeSettingsPath();await $u(v,j);let W=P8.getInstance().getUserSettingsPath(),H={};if(E8(W))try{H=JSON.parse(kK(W,"utf8"))}catch{}H.backend="chroma",H.installed=!0,H.embedded=!0,H.saveMemoriesOnClear=j.saveMemoriesOnClear||!1;let Z=uY();if(Z)H.claudePath=Z;else delete H.claudePath;C_(W,JSON.stringify(H,null,2)),await T6(200)}}];if(j.enableSmartTrash)K.push({name:"Configuring Smart Trash alias",action:async()=>{await T6(200),await wu(),await T6(100)}});for(let v=0;v<K.length;v++){let z=K[v],W=`[${v+1}/${K.length}]`,H=k9(`${g.gray(W)} ${z.name}...`);H.start();try{await z.action(),H.stop(`${g.gray(W)} ${z.name} ${N7("completed! ✨")}`)}catch(Z){H.stop(`${g.gray(W)} ${z.name} ${g.red("failed")}`,!1),console.log(__(g.red(`❌ Installation failed at: ${z.name}
386
390
 
387
- Error: ${Z}`),{padding:1,margin:1,borderStyle:"double",borderColor:"red"})),process.exit(1)}await J6(150)}console.log(I.gray(`
391
+ Error: ${Z}`),{padding:1,margin:1,borderStyle:"double",borderColor:"red"})),process.exit(1)}await T6(150)}console.log(g.gray(`
388
392
  \uD83D\uDD0D Verifying Installation
389
- `)),await Ku();let Y=f3("\uD83C\uDF89 INSTALLATION COMPLETE! \uD83C\uDF89"),f=`
390
- ${I.bold("How your new memory system works:")}
393
+ `)),await zu();let f=z3("\uD83C\uDF89 INSTALLATION COMPLETE! \uD83C\uDF89"),Y=`
394
+ ${g.bold("How your new memory system works:")}
391
395
 
392
- ${I.green("•")} When you start Claude Code, claude-mem loads your latest memories automatically
393
- ${I.green("•")} Save your work by typing ${I.cyan("/compact")} or ${I.cyan("/clear")} (takes ~30s to process)
394
- ${I.green("•")} Ask Claude to search your memories anytime with natural language
395
- ${I.green("•")} Instructions added to ${I.cyan("~/.claude/CLAUDE.md")} teach Claude how to use the system
396
+ ${g.green("•")} When you start Claude Code, claude-mem loads your latest memories automatically
397
+ ${g.green("•")} Save your work by typing ${g.cyan("/compact")} or ${g.cyan("/clear")} (takes ~30s to process)
398
+ ${g.green("•")} Ask Claude to search your memories anytime with natural language
399
+ ${g.green("•")} Instructions added to ${g.cyan("~/.claude/CLAUDE.md")} teach Claude how to use the system
396
400
 
397
- ${I.bold("Quick Start:")}
398
- ${I.yellow("1.")} Restart Claude Code to activate your memory system
399
- ${I.yellow("2.")} Start using Claude normally - memories save automatically
400
- ${I.yellow("3.")} Search memories by asking: ${I.italic('"Search my memories for X"')}`,P=Tf(),$=P?`
401
+ ${g.bold("Quick Start:")}
402
+ ${g.yellow("1.")} Restart Claude Code to activate your memory system
403
+ ${g.yellow("2.")} Start using Claude normally - memories save automatically
404
+ ${g.yellow("3.")} Search memories by asking: ${g.italic('"Search my memories for X"')}`,P=uY(),$=P?`
401
405
 
402
- ${I.green("✓")} Claude binary detected at: ${I.cyan(P)}`:`
406
+ ${g.green("✓")} Claude binary detected at: ${g.cyan(P)}`:`
403
407
 
404
- ${I.yellow("⚠️")} Claude binary not found in PATH. Features will still work with manual configuration.`,O=j.enableSmartTrash?`
408
+ ${g.yellow("⚠️")} Claude binary not found in PATH. Features will still work with manual configuration.`,O=j.enableSmartTrash?`
405
409
 
406
- ${I.blue("\uD83D\uDDD1️ Smart Trash Enabled:")}
407
- ${I.gray(" • rm commands now move files to ~/.claude-mem/trash")}
408
- ${I.gray(" • View trash:")} ${I.cyan("claude-mem trash view")}
409
- ${I.gray(" • Restore files:")} ${I.cyan("claude-mem restore")}
410
- ${I.gray(" • Empty trash:")} ${I.cyan("claude-mem trash empty")}
411
- ${I.yellow(" • Restart terminal for alias to activate")}`:"",w=j.saveMemoriesOnClear?`
410
+ ${g.blue("\uD83D\uDDD1️ Smart Trash Enabled:")}
411
+ ${g.gray(" • rm commands now move files to ~/.claude-mem/trash")}
412
+ ${g.gray(" • View trash:")} ${g.cyan("claude-mem trash view")}
413
+ ${g.gray(" • Restore files:")} ${g.cyan("claude-mem restore")}
414
+ ${g.gray(" • Empty trash:")} ${g.cyan("claude-mem trash empty")}
415
+ ${g.yellow(" • Restart terminal for alias to activate")}`:"",w=j.saveMemoriesOnClear?`
412
416
 
413
- ${I.magenta("\uD83D\uDCBE Save-on-clear enabled:")}
414
- ${I.gray(" • /clear now saves memories automatically (takes ~1 minute)")}`:"";console.log(q_(Y+f+$+O+w,{padding:2,margin:1,borderStyle:"double",borderColor:"green",backgroundColor:"#001122"})),console.log(f3(`
417
+ ${g.magenta("\uD83D\uDCBE Save-on-clear enabled:")}
418
+ ${g.gray(" • /clear now saves memories automatically (takes ~1 minute)")}`:"";console.log(__(f+Y+$+O+w,{padding:2,margin:1,borderStyle:"double",borderColor:"green",backgroundColor:"#001122"})),console.log(z3(`
415
419
  ✨ Welcome to the future of persistent AI conversations! ✨
416
- `))}p6();import{readFileSync as ju,writeFileSync as Xf,existsSync as Pu}from"fs";import{join as $3}from"path";async function Af(q={}){console.log("\uD83D\uDD04 Uninstalling Claude Memory System hooks...");let _=[];if(q.all)_.push({name:"User",path:P8.getInstance().getClaudeSettingsPath()}),_.push({name:"Project",path:$3(process.cwd(),".claude","settings.json")});else{let O=q.project,w=P8.getInstance();_.push({name:O?"Project":"User",path:O?$3(process.cwd(),".claude","settings.json"):w.getClaudeSettingsPath()})}let K=P8.getInstance().getHooksDirectory(),Y=$3(K,"pre-compact.js"),f=$3(K,"session-start.js"),P=$3(K,"session-end.js"),$=0;for(let O of _){if(!Pu(O.path)){console.log(`⏭️ No settings found at ${O.name} location`);continue}try{let w=ju(O.path,"utf8"),v=JSON.parse(w);if(!v.hooks){console.log(`⏭️ No hooks configured in ${O.name} settings`);continue}let z=!1;if(v.hooks.PreCompact){let W=v.hooks.PreCompact.filter((J)=>!J.hooks?.some((Z)=>Z.command===Y||Z.command?.includes("pre-compact.js")||Z.command?.includes("claude-mem")));if(W.length!==v.hooks.PreCompact.length)v.hooks.PreCompact=W.length?W:void 0,z=!0,console.log(`✅ Removed PreCompact hook from ${O.name} settings`)}if(v.hooks.SessionStart){let W=v.hooks.SessionStart.filter((J)=>!J.hooks?.some((Z)=>Z.command===f||Z.command?.includes("session-start.js")||Z.command?.includes("claude-mem")));if(W.length!==v.hooks.SessionStart.length)v.hooks.SessionStart=W.length?W:void 0,z=!0,console.log(`✅ Removed SessionStart hook from ${O.name} settings`)}if(v.hooks.SessionEnd){let W=v.hooks.SessionEnd.filter((J)=>!J.hooks?.some((Z)=>Z.command===P||Z.command?.includes("session-end.js")||Z.command?.includes("claude-mem")));if(W.length!==v.hooks.SessionEnd.length)v.hooks.SessionEnd=W.length?W:void 0,z=!0,console.log(`✅ Removed SessionEnd hook from ${O.name} settings`)}if(v.hooks.PreCompact===void 0)delete v.hooks.PreCompact;if(v.hooks.SessionStart===void 0)delete v.hooks.SessionStart;if(v.hooks.SessionEnd===void 0)delete v.hooks.SessionEnd;if(!Object.keys(v.hooks).length)delete v.hooks;if(z){let W=O.path+".backup."+Date.now();Xf(W,w),console.log(`\uD83D\uDCCB Created backup: ${W}`),Xf(O.path,JSON.stringify(v,null,2)),$++,console.log(`✅ Updated ${O.name} settings: ${O.path}`)}else console.log(`ℹ️ No Claude Memory System hooks found in ${O.name} settings`)}catch(w){console.log(`⚠️ Could not process ${O.name} settings: ${w.message}`)}}if(console.log(""),$>0)console.log("✨ Uninstallation complete!"),console.log("The Claude Memory System hooks have been removed from your settings."),console.log(""),console.log("Note: Your compressed transcripts and archives are preserved."),console.log("To reinstall: claude-mem install");else console.log("ℹ️ No Claude Memory System hooks were found to remove.")}W9();H9();T9();import{renameSync as _D,existsSync as X$,mkdirSync as KD,statSync as jD}from"fs";import{join as PD,basename as YD}from"path";var Z9=(q,_,j)=>{let K=q instanceof RegExp?Df(q,j):q,Y=_ instanceof RegExp?Df(_,j):_,f=K!==null&&Y!=null&&ku(K,Y,j);return f&&{start:f[0],end:f[1],pre:j.slice(0,f[0]),body:j.slice(f[0]+K.length,f[1]),post:j.slice(f[1]+Y.length)}},Df=(q,_)=>{let j=_.match(q);return j?j[0]:null},ku=(q,_,j)=>{let K,Y,f,P=void 0,$,O=j.indexOf(q),w=j.indexOf(_,O+1),v=O;if(O>=0&&w>0){if(q===_)return[O,w];K=[],f=j.length;while(v>=0&&!$){if(v===O)K.push(v),O=j.indexOf(q,v+1);else if(K.length===1){let z=K.pop();if(z!==void 0)$=[z,w]}else{if(Y=K.pop(),Y!==void 0&&Y<f)f=Y,P=w;w=j.indexOf(_,v+1)}v=O<w&&O>=0?O:w}if(K.length&&P!==void 0)$=[f,P]}return $};var Cf="\x00SLASH"+Math.random()+"\x00",Vf="\x00OPEN"+Math.random()+"\x00",X9="\x00CLOSE"+Math.random()+"\x00",Mf="\x00COMMA"+Math.random()+"\x00",Nf="\x00PERIOD"+Math.random()+"\x00",Xu=new RegExp(Cf,"g"),Au=new RegExp(Vf,"g"),Gu=new RegExp(X9,"g"),uu=new RegExp(Mf,"g"),hu=new RegExp(Nf,"g"),Du=/\\\\/g,Cu=/\\{/g,Vu=/\\}/g,Mu=/\\,/g,Nu=/\\./g;function k9(q){return!isNaN(q)?parseInt(q,10):q.charCodeAt(0)}function bu(q){return q.replace(Du,Cf).replace(Cu,Vf).replace(Vu,X9).replace(Mu,Mf).replace(Nu,Nf)}function Su(q){return q.replace(Xu,"\\").replace(Au,"{").replace(Gu,"}").replace(uu,",").replace(hu,".")}function bf(q){if(!q)return[""];let _=[],j=Z9("{","}",q);if(!j)return q.split(",");let{pre:K,body:Y,post:f}=j,P=K.split(",");P[P.length-1]+="{"+Y+"}";let $=bf(f);if(f.length)P[P.length-1]+=$.shift(),P.push.apply(P,$);return _.push.apply(_,P),_}function Sf(q){if(!q)return[];if(q.slice(0,2)==="{}")q="\\{\\}"+q.slice(2);return v3(bu(q),!0).map(Su)}function Eu(q){return"{"+q+"}"}function Ru(q){return/^-?0\d/.test(q)}function mu(q,_){return q<=_}function Iu(q,_){return q>=_}function v3(q,_){let j=[],K=Z9("{","}",q);if(!K)return[q];let Y=K.pre,f=K.post.length?v3(K.post,!1):[""];if(/\$$/.test(K.pre))for(let P=0;P<f.length;P++){let $=Y+"{"+K.body+"}"+f[P];j.push($)}else{let P=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(K.body),$=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(K.body),O=P||$,w=K.body.indexOf(",")>=0;if(!O&&!w){if(K.post.match(/,(?!,).*\}/))return q=K.pre+"{"+K.body+X9+K.post,v3(q);return[q]}let v;if(O)v=K.body.split(/\.\./);else if(v=bf(K.body),v.length===1&&v[0]!==void 0){if(v=v3(v[0],!1).map(Eu),v.length===1)return f.map((W)=>K.pre+v[0]+W)}let z;if(O&&v[0]!==void 0&&v[1]!==void 0){let W=k9(v[0]),J=k9(v[1]),Z=Math.max(v[0].length,v[1].length),H=v.length===3&&v[2]!==void 0?Math.abs(k9(v[2])):1,X=mu;if(J<W)H*=-1,X=Iu;let G=v.some(Ru);z=[];for(let D=W;X(D,J);D+=H){let M;if($){if(M=String.fromCharCode(D),M==="\\")M=""}else if(M=String(D),G){let g=Z-M.length;if(g>0){let S=new Array(g+1).join("0");if(D<0)M="-"+S+M.slice(1);else M=S+M}}z.push(M)}}else{z=[];for(let W=0;W<v.length;W++)z.push.apply(z,v3(v[W],!1))}for(let W=0;W<z.length;W++)for(let J=0;J<f.length;J++){let Z=Y+z[W]+f[J];if(!_||O||Z)j.push(Z)}}return j}var z3=(q)=>{if(typeof q!=="string")throw new TypeError("invalid pattern");if(q.length>65536)throw new TypeError("pattern is too long")};var gu={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},W3=(q)=>q.replace(/[[\]\\-]/g,"\\$&"),yu=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ef=(q)=>q.join(""),Rf=(q,_)=>{let j=_;if(q.charAt(j)!=="[")throw new Error("not in a brace expression");let K=[],Y=[],f=j+1,P=!1,$=!1,O=!1,w=!1,v=j,z="";q:while(f<q.length){let H=q.charAt(f);if((H==="!"||H==="^")&&f===j+1){w=!0,f++;continue}if(H==="]"&&P&&!O){v=f+1;break}if(P=!0,H==="\\"){if(!O){O=!0,f++;continue}}if(H==="["&&!O){for(let[X,[A,G,D]]of Object.entries(gu))if(q.startsWith(X,f)){if(z)return["$.",!1,q.length-j,!0];if(f+=X.length,D)Y.push(A);else K.push(A);$=$||G;continue q}}if(O=!1,z){if(H>z)K.push(W3(z)+"-"+W3(H));else if(H===z)K.push(W3(H));z="",f++;continue}if(q.startsWith("-]",f+1)){K.push(W3(H+"-")),f+=2;continue}if(q.startsWith("-",f+1)){z=H,f+=2;continue}K.push(W3(H)),f++}if(v<f)return["",!1,0,!1];if(!K.length&&!Y.length)return["$.",!1,q.length-j,!0];if(Y.length===0&&K.length===1&&/^\\?.$/.test(K[0])&&!w){let H=K[0].length===2?K[0].slice(-1):K[0];return[yu(H),!1,v-j,!1]}let W="["+(w?"^":"")+Ef(K)+"]",J="["+(w?"":"^")+Ef(Y)+"]";return[K.length&&Y.length?"("+W+"|"+J+")":K.length?W:J,$,v-j,!0]};var Tq=(q,{windowsPathsNoEscape:_=!1}={})=>{return _?q.replace(/\[([^\/\\])\]/g,"$1"):q.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")};var du=new Set(["!","?","+","*","@"]),mf=(q)=>du.has(q),pu="(?!(?:^|/)\\.\\.?(?:$|/))",C7="(?!\\.)",Lu=new Set(["[","."]),lu=new Set(["..","."]),xu=new Set("().*{}+?[]^$\\!"),nu=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),A9="[^/]",If=A9+"*?",gf=A9+"+?";class H6{type;#q;#_;#Y=!1;#P=[];#f;#G;#X;#v=!1;#$;#W;#z=!1;constructor(q,_,j={}){if(this.type=q,q)this.#_=!0;if(this.#f=_,this.#q=this.#f?this.#f.#q:this,this.#$=this.#q===this?j:this.#q.#$,this.#X=this.#q===this?[]:this.#q.#X,q==="!"&&!this.#q.#v)this.#X.push(this);this.#G=this.#f?this.#f.#P.length:0}get hasMagic(){if(this.#_!==void 0)return this.#_;for(let q of this.#P){if(typeof q==="string")continue;if(q.type||q.hasMagic)return this.#_=!0}return this.#_}toString(){if(this.#W!==void 0)return this.#W;if(!this.type)return this.#W=this.#P.map((q)=>String(q)).join("");else return this.#W=this.type+"("+this.#P.map((q)=>String(q)).join("|")+")"}#w(){if(this!==this.#q)throw new Error("should only call on root");if(this.#v)return this;this.toString(),this.#v=!0;let q;while(q=this.#X.pop()){if(q.type!=="!")continue;let _=q,j=_.#f;while(j){for(let K=_.#G+1;!j.type&&K<j.#P.length;K++)for(let Y of q.#P){if(typeof Y==="string")throw new Error("string part in extglob AST??");Y.copyIn(j.#P[K])}_=j,j=_.#f}}return this}push(...q){for(let _ of q){if(_==="")continue;if(typeof _!=="string"&&!(_ instanceof H6&&_.#f===this))throw new Error("invalid part: "+_);this.#P.push(_)}}toJSON(){let q=this.type===null?this.#P.slice().map((_)=>typeof _==="string"?_:_.toJSON()):[this.type,...this.#P.map((_)=>_.toJSON())];if(this.isStart()&&!this.type)q.unshift([]);if(this.isEnd()&&(this===this.#q||this.#q.#v&&this.#f?.type==="!"))q.push({});return q}isStart(){if(this.#q===this)return!0;if(!this.#f?.isStart())return!1;if(this.#G===0)return!0;let q=this.#f;for(let _=0;_<this.#G;_++){let j=q.#P[_];if(!(j instanceof H6&&j.type==="!"))return!1}return!0}isEnd(){if(this.#q===this)return!0;if(this.#f?.type==="!")return!0;if(!this.#f?.isEnd())return!1;if(!this.type)return this.#f?.isEnd();let q=this.#f?this.#f.#P.length:0;return this.#G===q-1}copyIn(q){if(typeof q==="string")this.push(q);else this.push(q.clone(this))}clone(q){let _=new H6(this.type,q);for(let j of this.#P)_.copyIn(j);return _}static#K(q,_,j,K){let Y=!1,f=!1,P=-1,$=!1;if(_.type===null){let W=j,J="";while(W<q.length){let Z=q.charAt(W++);if(Y||Z==="\\"){Y=!Y,J+=Z;continue}if(f){if(W===P+1){if(Z==="^"||Z==="!")$=!0}else if(Z==="]"&&!(W===P+2&&$))f=!1;J+=Z;continue}else if(Z==="["){f=!0,P=W,$=!1,J+=Z;continue}if(!K.noext&&mf(Z)&&q.charAt(W)==="("){_.push(J),J="";let H=new H6(Z,_);W=H6.#K(q,H,W,K),_.push(H);continue}J+=Z}return _.push(J),W}let O=j+1,w=new H6(null,_),v=[],z="";while(O<q.length){let W=q.charAt(O++);if(Y||W==="\\"){Y=!Y,z+=W;continue}if(f){if(O===P+1){if(W==="^"||W==="!")$=!0}else if(W==="]"&&!(O===P+2&&$))f=!1;z+=W;continue}else if(W==="["){f=!0,P=O,$=!1,z+=W;continue}if(mf(W)&&q.charAt(O)==="("){w.push(z),z="";let J=new H6(W,w);w.push(J),O=H6.#K(q,J,O,K);continue}if(W==="|"){w.push(z),z="",v.push(w),w=new H6(null,_);continue}if(W===")"){if(z===""&&_.#P.length===0)_.#z=!0;return w.push(z),z="",_.push(...v,w),O}z+=W}return _.type=null,_.#_=void 0,_.#P=[q.substring(j-1)],O}static fromGlob(q,_={}){let j=new H6(null,void 0,_);return H6.#K(q,j,0,_),j}toMMPattern(){if(this!==this.#q)return this.#q.toMMPattern();let q=this.toString(),[_,j,K,Y]=this.toRegExpSource();if(!(K||this.#_||this.#$.nocase&&!this.#$.nocaseMagicOnly&&q.toUpperCase()!==q.toLowerCase()))return j;let P=(this.#$.nocase?"i":"")+(Y?"u":"");return Object.assign(new RegExp(`^${_}$`,P),{_src:_,_glob:q})}get options(){return this.#$}toRegExpSource(q){let _=q??!!this.#$.dot;if(this.#q===this)this.#w();if(!this.type){let $=this.isStart()&&this.isEnd(),O=this.#P.map((W)=>{let[J,Z,H,X]=typeof W==="string"?H6.#u(W,this.#_,$):W.toRegExpSource(q);return this.#_=this.#_||H,this.#Y=this.#Y||X,J}).join(""),w="";if(this.isStart()){if(typeof this.#P[0]==="string"){if(!(this.#P.length===1&&lu.has(this.#P[0]))){let J=Lu,Z=_&&J.has(O.charAt(0))||O.startsWith("\\.")&&J.has(O.charAt(2))||O.startsWith("\\.\\.")&&J.has(O.charAt(4)),H=!_&&!q&&J.has(O.charAt(0));w=Z?pu:H?C7:""}}}let v="";if(this.isEnd()&&this.#q.#v&&this.#f?.type==="!")v="(?:$|\\/)";return[w+O+v,Tq(O),this.#_=!!this.#_,this.#Y]}let j=this.type==="*"||this.type==="+",K=this.type==="!"?"(?:(?!(?:":"(?:",Y=this.#H(_);if(this.isStart()&&this.isEnd()&&!Y&&this.type!=="!"){let $=this.toString();return this.#P=[$],this.type=null,this.#_=void 0,[$,Tq(this.toString()),!1,!1]}let f=!j||q||_||!C7?"":this.#H(!0);if(f===Y)f="";if(f)Y=`(?:${Y})(?:${f})*?`;let P="";if(this.type==="!"&&this.#z)P=(this.isStart()&&!_?C7:"")+gf;else{let $=this.type==="!"?"))"+(this.isStart()&&!_&&!q?C7:"")+If+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&f?")":this.type==="*"&&f?")?":`)${this.type}`;P=K+Y+$}return[P,Tq(Y),this.#_=!!this.#_,this.#Y]}#H(q){return this.#P.map((_)=>{if(typeof _==="string")throw new Error("string type in extglob ast??");let[j,K,Y,f]=_.toRegExpSource(q);return this.#Y=this.#Y||f,j}).filter((_)=>!(this.isStart()&&this.isEnd())||!!_).join("|")}static#u(q,_,j=!1){let K=!1,Y="",f=!1;for(let P=0;P<q.length;P++){let $=q.charAt(P);if(K){K=!1,Y+=(xu.has($)?"\\":"")+$;continue}if($==="\\"){if(P===q.length-1)Y+="\\\\";else K=!0;continue}if($==="["){let[O,w,v,z]=Rf(q,P);if(v){Y+=O,f=f||w,P+=v-1,_=_||z;continue}}if($==="*"){if(j&&q==="*")Y+=gf;else Y+=If;_=!0;continue}if($==="?"){Y+=A9,_=!0;continue}Y+=nu($)}return[Y,Tq(q),!!_,f]}}var ZK=(q,{windowsPathsNoEscape:_=!1}={})=>{return _?q.replace(/[?*()[\]]/g,"[$&]"):q.replace(/[?*()[\]\\]/g,"\\$&")};var b6=(q,_,j={})=>{if(z3(_),!j.nocomment&&_.charAt(0)==="#")return!1;return new _q(_,j).match(q)},cu=/^\*+([^+@!?\*\[\(]*)$/,ru=(q)=>(_)=>!_.startsWith(".")&&_.endsWith(q),iu=(q)=>(_)=>_.endsWith(q),ou=(q)=>{return q=q.toLowerCase(),(_)=>!_.startsWith(".")&&_.toLowerCase().endsWith(q)},au=(q)=>{return q=q.toLowerCase(),(_)=>_.toLowerCase().endsWith(q)},Bu=/^\*+\.\*+$/,tu=(q)=>!q.startsWith(".")&&q.includes("."),eu=(q)=>q!=="."&&q!==".."&&q.includes("."),Fu=/^\.\*+$/,Uu=(q)=>q!=="."&&q!==".."&&q.startsWith("."),su=/^\*+$/,Qu=(q)=>q.length!==0&&!q.startsWith("."),qh=(q)=>q.length!==0&&q!=="."&&q!=="..",_h=/^\?+([^+@!?\*\[\(]*)?$/,Kh=([q,_=""])=>{let j=pf([q]);if(!_)return j;return _=_.toLowerCase(),(K)=>j(K)&&K.toLowerCase().endsWith(_)},jh=([q,_=""])=>{let j=Lf([q]);if(!_)return j;return _=_.toLowerCase(),(K)=>j(K)&&K.toLowerCase().endsWith(_)},Ph=([q,_=""])=>{let j=Lf([q]);return!_?j:(K)=>j(K)&&K.endsWith(_)},Yh=([q,_=""])=>{let j=pf([q]);return!_?j:(K)=>j(K)&&K.endsWith(_)},pf=([q])=>{let _=q.length;return(j)=>j.length===_&&!j.startsWith(".")},Lf=([q])=>{let _=q.length;return(j)=>j.length===_&&j!=="."&&j!==".."},lf=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",yf={win32:{sep:"\\"},posix:{sep:"/"}},fh=lf==="win32"?yf.win32.sep:yf.posix.sep;b6.sep=fh;var T6=Symbol("globstar **");b6.GLOBSTAR=T6;var $h="[^/]",wh=$h+"*?",Oh="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",vh="(?:(?!(?:\\/|^)\\.).)*?",zh=(q,_={})=>(j)=>b6(j,q,_);b6.filter=zh;var qq=(q,_={})=>Object.assign({},q,_),Wh=(q)=>{if(!q||typeof q!=="object"||!Object.keys(q).length)return b6;let _=b6;return Object.assign((K,Y,f={})=>_(K,Y,qq(q,f)),{Minimatch:class K extends _.Minimatch{constructor(Y,f={}){super(Y,qq(q,f))}static defaults(Y){return _.defaults(qq(q,Y)).Minimatch}},AST:class K extends _.AST{constructor(Y,f,P={}){super(Y,f,qq(q,P))}static fromGlob(Y,f={}){return _.AST.fromGlob(Y,qq(q,f))}},unescape:(K,Y={})=>_.unescape(K,qq(q,Y)),escape:(K,Y={})=>_.escape(K,qq(q,Y)),filter:(K,Y={})=>_.filter(K,qq(q,Y)),defaults:(K)=>_.defaults(qq(q,K)),makeRe:(K,Y={})=>_.makeRe(K,qq(q,Y)),braceExpand:(K,Y={})=>_.braceExpand(K,qq(q,Y)),match:(K,Y,f={})=>_.match(K,Y,qq(q,f)),sep:_.sep,GLOBSTAR:T6})};b6.defaults=Wh;var xf=(q,_={})=>{if(z3(q),_.nobrace||!/\{(?:(?!\{).)*\}/.test(q))return[q];return Sf(q)};b6.braceExpand=xf;var Jh=(q,_={})=>new _q(q,_).makeRe();b6.makeRe=Jh;var Hh=(q,_,j={})=>{let K=new _q(_,j);if(q=q.filter((Y)=>K.match(Y)),K.options.nonull&&!q.length)q.push(_);return q};b6.match=Hh;var df=/[?*]|[+@!]\(.*?\)|\[|\]/,Th=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class _q{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(q,_={}){if(z3(q),_=_||{},this.options=_,this.pattern=q,this.platform=_.platform||lf,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!_.windowsPathsNoEscape||_.allowWindowsEscape===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!_.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!_.nonegate,this.comment=!1,this.empty=!1,this.partial=!!_.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=_.windowsNoMagicRoot!==void 0?_.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let q of this.set)for(let _ of q)if(typeof _!=="string")return!0;return!1}debug(...q){}make(){let q=this.pattern,_=this.options;if(!_.nocomment&&q.charAt(0)==="#"){this.comment=!0;return}if(!q){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],_.debug)this.debug=(...Y)=>console.error(...Y);this.debug(this.pattern,this.globSet);let j=this.globSet.map((Y)=>this.slashSplit(Y));this.globParts=this.preprocess(j),this.debug(this.pattern,this.globParts);let K=this.globParts.map((Y,f,P)=>{if(this.isWindows&&this.windowsNoMagicRoot){let $=Y[0]===""&&Y[1]===""&&(Y[2]==="?"||!df.test(Y[2]))&&!df.test(Y[3]),O=/^[a-z]:/i.test(Y[0]);if($)return[...Y.slice(0,4),...Y.slice(4).map((w)=>this.parse(w))];else if(O)return[Y[0],...Y.slice(1).map((w)=>this.parse(w))]}return Y.map(($)=>this.parse($))});if(this.debug(this.pattern,K),this.set=K.filter((Y)=>Y.indexOf(!1)===-1),this.isWindows)for(let Y=0;Y<this.set.length;Y++){let f=this.set[Y];if(f[0]===""&&f[1]===""&&this.globParts[Y][2]==="?"&&typeof f[3]==="string"&&/^[a-z]:$/i.test(f[3]))f[2]="?"}this.debug(this.pattern,this.set)}preprocess(q){if(this.options.noglobstar){for(let j=0;j<q.length;j++)for(let K=0;K<q[j].length;K++)if(q[j][K]==="**")q[j][K]="*"}let{optimizationLevel:_=1}=this.options;if(_>=2)q=this.firstPhasePreProcess(q),q=this.secondPhasePreProcess(q);else if(_>=1)q=this.levelOneOptimize(q);else q=this.adjascentGlobstarOptimize(q);return q}adjascentGlobstarOptimize(q){return q.map((_)=>{let j=-1;while((j=_.indexOf("**",j+1))!==-1){let K=j;while(_[K+1]==="**")K++;if(K!==j)_.splice(j,K-j)}return _})}levelOneOptimize(q){return q.map((_)=>{return _=_.reduce((j,K)=>{let Y=j[j.length-1];if(K==="**"&&Y==="**")return j;if(K===".."){if(Y&&Y!==".."&&Y!=="."&&Y!=="**")return j.pop(),j}return j.push(K),j},[]),_.length===0?[""]:_})}levelTwoFileOptimize(q){if(!Array.isArray(q))q=this.slashSplit(q);let _=!1;do{if(_=!1,!this.preserveMultipleSlashes){for(let K=1;K<q.length-1;K++){let Y=q[K];if(K===1&&Y===""&&q[0]==="")continue;if(Y==="."||Y==="")_=!0,q.splice(K,1),K--}if(q[0]==="."&&q.length===2&&(q[1]==="."||q[1]===""))_=!0,q.pop()}let j=0;while((j=q.indexOf("..",j+1))!==-1){let K=q[j-1];if(K&&K!=="."&&K!==".."&&K!=="**")_=!0,q.splice(j-1,2),j-=2}}while(_);return q.length===0?[""]:q}firstPhasePreProcess(q){let _=!1;do{_=!1;for(let j of q){let K=-1;while((K=j.indexOf("**",K+1))!==-1){let f=K;while(j[f+1]==="**")f++;if(f>K)j.splice(K+1,f-K);let P=j[K+1],$=j[K+2],O=j[K+3];if(P!=="..")continue;if(!$||$==="."||$===".."||!O||O==="."||O==="..")continue;_=!0,j.splice(K,1);let w=j.slice(0);w[K]="**",q.push(w),K--}if(!this.preserveMultipleSlashes){for(let f=1;f<j.length-1;f++){let P=j[f];if(f===1&&P===""&&j[0]==="")continue;if(P==="."||P==="")_=!0,j.splice(f,1),f--}if(j[0]==="."&&j.length===2&&(j[1]==="."||j[1]===""))_=!0,j.pop()}let Y=0;while((Y=j.indexOf("..",Y+1))!==-1){let f=j[Y-1];if(f&&f!=="."&&f!==".."&&f!=="**"){_=!0;let $=Y===1&&j[Y+1]==="**"?["."]:[];if(j.splice(Y-1,2,...$),j.length===0)j.push("");Y-=2}}}}while(_);return q}secondPhasePreProcess(q){for(let _=0;_<q.length-1;_++)for(let j=_+1;j<q.length;j++){let K=this.partsMatch(q[_],q[j],!this.preserveMultipleSlashes);if(K){q[_]=[],q[j]=K;break}}return q.filter((_)=>_.length)}partsMatch(q,_,j=!1){let K=0,Y=0,f=[],P="";while(K<q.length&&Y<_.length)if(q[K]===_[Y])f.push(P==="b"?_[Y]:q[K]),K++,Y++;else if(j&&q[K]==="**"&&_[Y]===q[K+1])f.push(q[K]),K++;else if(j&&_[Y]==="**"&&q[K]===_[Y+1])f.push(_[Y]),Y++;else if(q[K]==="*"&&_[Y]&&(this.options.dot||!_[Y].startsWith("."))&&_[Y]!=="**"){if(P==="b")return!1;P="a",f.push(q[K]),K++,Y++}else if(_[Y]==="*"&&q[K]&&(this.options.dot||!q[K].startsWith("."))&&q[K]!=="**"){if(P==="a")return!1;P="b",f.push(_[Y]),K++,Y++}else return!1;return q.length===_.length&&f}parseNegate(){if(this.nonegate)return;let q=this.pattern,_=!1,j=0;for(let K=0;K<q.length&&q.charAt(K)==="!";K++)_=!_,j++;if(j)this.pattern=q.slice(j);this.negate=_}matchOne(q,_,j=!1){let K=this.options;if(this.isWindows){let Z=typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0]),H=!Z&&q[0]===""&&q[1]===""&&q[2]==="?"&&/^[a-z]:$/i.test(q[3]),X=typeof _[0]==="string"&&/^[a-z]:$/i.test(_[0]),A=!X&&_[0]===""&&_[1]===""&&_[2]==="?"&&typeof _[3]==="string"&&/^[a-z]:$/i.test(_[3]),G=H?3:Z?0:void 0,D=A?3:X?0:void 0;if(typeof G==="number"&&typeof D==="number"){let[M,g]=[q[G],_[D]];if(M.toLowerCase()===g.toLowerCase()){if(_[D]=M,D>G)_=_.slice(D);else if(G>D)q=q.slice(G)}}}let{optimizationLevel:Y=1}=this.options;if(Y>=2)q=this.levelTwoFileOptimize(q);this.debug("matchOne",this,{file:q,pattern:_}),this.debug("matchOne",q.length,_.length);for(var f=0,P=0,$=q.length,O=_.length;f<$&&P<O;f++,P++){this.debug("matchOne loop");var w=_[P],v=q[f];if(this.debug(_,w,v),w===!1)return!1;if(w===T6){this.debug("GLOBSTAR",[_,w,v]);var z=f,W=P+1;if(W===O){this.debug("** at the end");for(;f<$;f++)if(q[f]==="."||q[f]===".."||!K.dot&&q[f].charAt(0)===".")return!1;return!0}while(z<$){var J=q[z];if(this.debug(`
417
- globstar while`,q,z,_,W,J),this.matchOne(q.slice(z),_.slice(W),j))return this.debug("globstar found match!",z,$,J),!0;else{if(J==="."||J===".."||!K.dot&&J.charAt(0)==="."){this.debug("dot detected!",q,z,_,W);break}this.debug("globstar swallow a segment, and continue"),z++}}if(j){if(this.debug(`
418
- >>> no match, partial?`,q,z,_,W),z===$)return!0}return!1}let Z;if(typeof w==="string")Z=v===w,this.debug("string match",w,v,Z);else Z=w.test(v),this.debug("pattern match",w,v,Z);if(!Z)return!1}if(f===$&&P===O)return!0;else if(f===$)return j;else if(P===O)return f===$-1&&q[f]==="";else throw new Error("wtf?")}braceExpand(){return xf(this.pattern,this.options)}parse(q){z3(q);let _=this.options;if(q==="**")return T6;if(q==="")return"";let j,K=null;if(j=q.match(su))K=_.dot?qh:Qu;else if(j=q.match(cu))K=(_.nocase?_.dot?au:ou:_.dot?iu:ru)(j[1]);else if(j=q.match(_h))K=(_.nocase?_.dot?jh:Kh:_.dot?Ph:Yh)(j);else if(j=q.match(Bu))K=_.dot?eu:tu;else if(j=q.match(Fu))K=Uu;let Y=H6.fromGlob(q,this.options).toMMPattern();if(K&&typeof Y==="object")Reflect.defineProperty(Y,"test",{value:K});return Y}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let q=this.set;if(!q.length)return this.regexp=!1,this.regexp;let _=this.options,j=_.noglobstar?wh:_.dot?Oh:vh,K=new Set(_.nocase?["i"]:[]),Y=q.map(($)=>{let O=$.map((w)=>{if(w instanceof RegExp)for(let v of w.flags.split(""))K.add(v);return typeof w==="string"?Th(w):w===T6?T6:w._src});return O.forEach((w,v)=>{let z=O[v+1],W=O[v-1];if(w!==T6||W===T6)return;if(W===void 0)if(z!==void 0&&z!==T6)O[v+1]="(?:\\/|"+j+"\\/)?"+z;else O[v]=j;else if(z===void 0)O[v-1]=W+"(?:\\/|"+j+")?";else if(z!==T6)O[v-1]=W+"(?:\\/|\\/"+j+"\\/)"+z,O[v+1]=T6}),O.filter((w)=>w!==T6).join("/")}).join("|"),[f,P]=q.length>1?["(?:",")"]:["",""];if(Y="^"+f+Y+P+"$",this.negate)Y="^(?!"+Y+").+$";try{this.regexp=new RegExp(Y,[...K].join(""))}catch($){this.regexp=!1}return this.regexp}slashSplit(q){if(this.preserveMultipleSlashes)return q.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(q))return["",...q.split(/\/+/)];else return q.split(/\/+/)}match(q,_=this.partial){if(this.debug("match",q,this.pattern),this.comment)return!1;if(this.empty)return q==="";if(q==="/"&&_)return!0;let j=this.options;if(this.isWindows)q=q.split("\\").join("/");let K=this.slashSplit(q);this.debug(this.pattern,"split",K);let Y=this.set;this.debug(this.pattern,"set",Y);let f=K[K.length-1];if(!f)for(let P=K.length-2;!f&&P>=0;P--)f=K[P];for(let P=0;P<Y.length;P++){let $=Y[P],O=K;if(j.matchBase&&$.length===1)O=[f];if(this.matchOne(O,$,_)){if(j.flipNegate)return!0;return!this.negate}}if(j.flipNegate)return!1;return this.negate}static defaults(q){return b6.defaults(q).Minimatch}}b6.AST=H6;b6.Minimatch=_q;b6.escape=ZK;b6.unescape=Tq;import{fileURLToPath as th}from"node:url";var Zh=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,cf=new Set,G9=typeof process==="object"&&!!process?process:{},rf=(q,_,j,K)=>{typeof G9.emitWarning==="function"?G9.emitWarning(q,_,j,K):console.error(`[${j}] ${_}: ${q}`)},V7=globalThis.AbortController,nf=globalThis.AbortSignal;if(typeof V7==="undefined"){nf=class j{onabort;_onabort=[];reason;aborted=!1;addEventListener(K,Y){this._onabort.push(Y)}},V7=class j{constructor(){_()}signal=new nf;abort(K){if(this.signal.aborted)return;this.signal.reason=K,this.signal.aborted=!0;for(let Y of this.signal._onabort)Y(K);this.signal.onabort?.(K)}};let q=G9.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",_=()=>{if(!q)return;q=!1,rf("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",_)}}var kh=(q)=>!cf.has(q),PN=Symbol("type"),__=(q)=>q&&q===Math.floor(q)&&q>0&&isFinite(q),of=(q)=>!__(q)?null:q<=Math.pow(2,8)?Uint8Array:q<=Math.pow(2,16)?Uint16Array:q<=Math.pow(2,32)?Uint32Array:q<=Number.MAX_SAFE_INTEGER?J3:null;class J3 extends Array{constructor(q){super(q);this.fill(0)}}class kK{heap;length;static#q=!1;static create(q){let _=of(q);if(!_)return[];kK.#q=!0;let j=new kK(q,_);return kK.#q=!1,j}constructor(q,_){if(!kK.#q)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new _(q),this.length=0}push(q){this.heap[this.length++]=q}pop(){return this.heap[--this.length]}}class H3{#q;#_;#Y;#P;#f;#G;#X;#v;get perf(){return this.#v}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#$;#W;#z;#w;#K;#H;#u;#A;#T;#b;#Z;#D;#M;#k;#h;#N;#J;#j;static unsafeExposeInternals(q){return{starts:q.#M,ttls:q.#k,sizes:q.#D,keyMap:q.#z,keyList:q.#w,valList:q.#K,next:q.#H,prev:q.#u,get head(){return q.#A},get tail(){return q.#T},free:q.#b,isBackgroundFetch:(_)=>q.#O(_),backgroundFetch:(_,j,K,Y)=>q.#r(_,j,K,Y),moveToTail:(_)=>q.#p(_),indexes:(_)=>q.#E(_),rindexes:(_)=>q.#m(_),isStale:(_)=>q.#V(_)}}get max(){return this.#q}get maxSize(){return this.#_}get calculatedSize(){return this.#W}get size(){return this.#$}get fetchMethod(){return this.#G}get memoMethod(){return this.#X}get dispose(){return this.#Y}get onInsert(){return this.#P}get disposeAfter(){return this.#f}constructor(q){let{max:_=0,ttl:j,ttlResolution:K=1,ttlAutopurge:Y,updateAgeOnGet:f,updateAgeOnHas:P,allowStale:$,dispose:O,onInsert:w,disposeAfter:v,noDisposeOnSet:z,noUpdateTTL:W,maxSize:J=0,maxEntrySize:Z=0,sizeCalculation:H,fetchMethod:X,memoMethod:A,noDeleteOnFetchRejection:G,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:g,ignoreFetchAbort:S,perf:b}=q;if(b!==void 0){if(typeof b?.now!=="function")throw new TypeError("perf option must have a now() method if specified")}if(this.#v=b??Zh,_!==0&&!__(_))throw new TypeError("max option must be a nonnegative integer");let d=_?of(_):Array;if(!d)throw new Error("invalid max value: "+_);if(this.#q=_,this.#_=J,this.maxEntrySize=Z||this.#_,this.sizeCalculation=H,this.sizeCalculation){if(!this.#_&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!=="function")throw new TypeError("memoMethod must be a function if defined");if(this.#X=A,X!==void 0&&typeof X!=="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#G=X,this.#N=!!X,this.#z=new Map,this.#w=new Array(_).fill(void 0),this.#K=new Array(_).fill(void 0),this.#H=new d(_),this.#u=new d(_),this.#A=0,this.#T=0,this.#b=kK.create(_),this.#$=0,this.#W=0,typeof O==="function")this.#Y=O;if(typeof w==="function")this.#P=w;if(typeof v==="function")this.#f=v,this.#Z=[];else this.#f=void 0,this.#Z=void 0;if(this.#h=!!this.#Y,this.#j=!!this.#P,this.#J=!!this.#f,this.noDisposeOnSet=!!z,this.noUpdateTTL=!!W,this.noDeleteOnFetchRejection=!!G,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!g,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(this.#_!==0){if(!__(this.#_))throw new TypeError("maxSize must be a positive integer if specified")}if(!__(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L()}if(this.allowStale=!!$,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!P,this.ttlResolution=__(K)||K===0?K:1,this.ttlAutopurge=!!Y,this.ttl=j||0,this.ttl){if(!__(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#q===0&&this.ttl===0&&this.#_===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#q&&!this.#_){if(kh("LRU_CACHE_UNBOUNDED"))cf.add("LRU_CACHE_UNBOUNDED"),rf("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",H3)}}getRemainingTTL(q){return this.#z.has(q)?1/0:0}#I(){let q=new J3(this.#q),_=new J3(this.#q);this.#k=q,this.#M=_,this.#n=(Y,f,P=this.#v.now())=>{if(_[Y]=f!==0?P:0,q[Y]=f,f!==0&&this.ttlAutopurge){let $=setTimeout(()=>{if(this.#V(Y))this.#R(this.#w[Y],"expire")},f+1);if($.unref)$.unref()}},this.#S=(Y)=>{_[Y]=q[Y]!==0?this.#v.now():0},this.#C=(Y,f)=>{if(q[f]){let P=q[f],$=_[f];if(!P||!$)return;Y.ttl=P,Y.start=$,Y.now=j||K();let O=Y.now-$;Y.remainingTTL=P-O}};let j=0,K=()=>{let Y=this.#v.now();if(this.ttlResolution>0){j=Y;let f=setTimeout(()=>j=0,this.ttlResolution);if(f.unref)f.unref()}return Y};this.getRemainingTTL=(Y)=>{let f=this.#z.get(Y);if(f===void 0)return 0;let P=q[f],$=_[f];if(!P||!$)return 1/0;let O=(j||K())-$;return P-O},this.#V=(Y)=>{let f=_[Y],P=q[Y];return!!P&&!!f&&(j||K())-f>P}}#S=()=>{};#C=()=>{};#n=()=>{};#V=()=>!1;#L(){let q=new J3(this.#q);this.#W=0,this.#D=q,this.#g=(_)=>{this.#W-=q[_],q[_]=0},this.#y=(_,j,K,Y)=>{if(this.#O(j))return 0;if(!__(K))if(Y){if(typeof Y!=="function")throw new TypeError("sizeCalculation must be a function");if(K=Y(j,_),!__(K))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return K},this.#l=(_,j,K)=>{if(q[_]=j,this.#_){let Y=this.#_-q[_];while(this.#W>Y)this.#d(!0)}if(this.#W+=q[_],K)K.entrySize=j,K.totalCalculatedSize=this.#W}}#g=(q)=>{};#l=(q,_,j)=>{};#y=(q,_,j,K)=>{if(j||K)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:q=this.allowStale}={}){if(this.#$)for(let _=this.#T;;){if(!this.#c(_))break;if(q||!this.#V(_))yield _;if(_===this.#A)break;else _=this.#u[_]}}*#m({allowStale:q=this.allowStale}={}){if(this.#$)for(let _=this.#A;;){if(!this.#c(_))break;if(q||!this.#V(_))yield _;if(_===this.#T)break;else _=this.#H[_]}}#c(q){return q!==void 0&&this.#z.get(this.#w[q])===q}*entries(){for(let q of this.#E())if(this.#K[q]!==void 0&&this.#w[q]!==void 0&&!this.#O(this.#K[q]))yield[this.#w[q],this.#K[q]]}*rentries(){for(let q of this.#m())if(this.#K[q]!==void 0&&this.#w[q]!==void 0&&!this.#O(this.#K[q]))yield[this.#w[q],this.#K[q]]}*keys(){for(let q of this.#E()){let _=this.#w[q];if(_!==void 0&&!this.#O(this.#K[q]))yield _}}*rkeys(){for(let q of this.#m()){let _=this.#w[q];if(_!==void 0&&!this.#O(this.#K[q]))yield _}}*values(){for(let q of this.#E())if(this.#K[q]!==void 0&&!this.#O(this.#K[q]))yield this.#K[q]}*rvalues(){for(let q of this.#m())if(this.#K[q]!==void 0&&!this.#O(this.#K[q]))yield this.#K[q]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(q,_={}){for(let j of this.#E()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;if(q(Y,this.#w[j],this))return this.get(this.#w[j],_)}}forEach(q,_=this){for(let j of this.#E()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;q.call(_,Y,this.#w[j],this)}}rforEach(q,_=this){for(let j of this.#m()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;q.call(_,Y,this.#w[j],this)}}purgeStale(){let q=!1;for(let _ of this.#m({allowStale:!0}))if(this.#V(_))this.#R(this.#w[_],"expire"),q=!0;return q}info(q){let _=this.#z.get(q);if(_===void 0)return;let j=this.#K[_],K=this.#O(j)?j.__staleWhileFetching:j;if(K===void 0)return;let Y={value:K};if(this.#k&&this.#M){let f=this.#k[_],P=this.#M[_];if(f&&P){let $=f-(this.#v.now()-P);Y.ttl=$,Y.start=Date.now()}}if(this.#D)Y.size=this.#D[_];return Y}dump(){let q=[];for(let _ of this.#E({allowStale:!0})){let j=this.#w[_],K=this.#K[_],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0||j===void 0)continue;let f={value:Y};if(this.#k&&this.#M){f.ttl=this.#k[_];let P=this.#v.now()-this.#M[_];f.start=Math.floor(Date.now()-P)}if(this.#D)f.size=this.#D[_];q.unshift([j,f])}return q}load(q){this.clear();for(let[_,j]of q){if(j.start){let K=Date.now()-j.start;j.start=this.#v.now()-K}this.set(_,j.value,j)}}set(q,_,j={}){if(_===void 0)return this.delete(q),this;let{ttl:K=this.ttl,start:Y,noDisposeOnSet:f=this.noDisposeOnSet,sizeCalculation:P=this.sizeCalculation,status:$}=j,{noUpdateTTL:O=this.noUpdateTTL}=j,w=this.#y(q,_,j.size||0,P);if(this.maxEntrySize&&w>this.maxEntrySize){if($)$.set="miss",$.maxEntrySizeExceeded=!0;return this.#R(q,"set"),this}let v=this.#$===0?void 0:this.#z.get(q);if(v===void 0){if(v=this.#$===0?this.#T:this.#b.length!==0?this.#b.pop():this.#$===this.#q?this.#d(!1):this.#$,this.#w[v]=q,this.#K[v]=_,this.#z.set(q,v),this.#H[this.#T]=v,this.#u[v]=this.#T,this.#T=v,this.#$++,this.#l(v,w,$),$)$.set="add";if(O=!1,this.#j)this.#P?.(_,q,"add")}else{this.#p(v);let z=this.#K[v];if(_!==z){if(this.#N&&this.#O(z)){z.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:W}=z;if(W!==void 0&&!f){if(this.#h)this.#Y?.(W,q,"set");if(this.#J)this.#Z?.push([W,q,"set"])}}else if(!f){if(this.#h)this.#Y?.(z,q,"set");if(this.#J)this.#Z?.push([z,q,"set"])}if(this.#g(v),this.#l(v,w,$),this.#K[v]=_,$){$.set="replace";let W=z&&this.#O(z)?z.__staleWhileFetching:z;if(W!==void 0)$.oldValue=W}}else if($)$.set="update";if(this.#j)this.onInsert?.(_,q,_===z?"update":"replace")}if(K!==0&&!this.#k)this.#I();if(this.#k){if(!O)this.#n(v,K,Y);if($)this.#C($,v)}if(!f&&this.#J&&this.#Z){let z=this.#Z,W;while(W=z?.shift())this.#f?.(...W)}return this}pop(){try{while(this.#$){let q=this.#K[this.#A];if(this.#d(!0),this.#O(q)){if(q.__staleWhileFetching)return q.__staleWhileFetching}else if(q!==void 0)return q}}finally{if(this.#J&&this.#Z){let q=this.#Z,_;while(_=q?.shift())this.#f?.(..._)}}}#d(q){let _=this.#A,j=this.#w[_],K=this.#K[_];if(this.#N&&this.#O(K))K.__abortController.abort(new Error("evicted"));else if(this.#h||this.#J){if(this.#h)this.#Y?.(K,j,"evict");if(this.#J)this.#Z?.push([K,j,"evict"])}if(this.#g(_),q)this.#w[_]=void 0,this.#K[_]=void 0,this.#b.push(_);if(this.#$===1)this.#A=this.#T=0,this.#b.length=0;else this.#A=this.#H[_];return this.#z.delete(j),this.#$--,_}has(q,_={}){let{updateAgeOnHas:j=this.updateAgeOnHas,status:K}=_,Y=this.#z.get(q);if(Y!==void 0){let f=this.#K[Y];if(this.#O(f)&&f.__staleWhileFetching===void 0)return!1;if(!this.#V(Y)){if(j)this.#S(Y);if(K)K.has="hit",this.#C(K,Y);return!0}else if(K)K.has="stale",this.#C(K,Y)}else if(K)K.has="miss";return!1}peek(q,_={}){let{allowStale:j=this.allowStale}=_,K=this.#z.get(q);if(K===void 0||!j&&this.#V(K))return;let Y=this.#K[K];return this.#O(Y)?Y.__staleWhileFetching:Y}#r(q,_,j,K){let Y=_===void 0?void 0:this.#K[_];if(this.#O(Y))return Y;let f=new V7,{signal:P}=j;P?.addEventListener("abort",()=>f.abort(P.reason),{signal:f.signal});let $={signal:f.signal,options:j,context:K},O=(Z,H=!1)=>{let{aborted:X}=f.signal,A=j.ignoreFetchAbort&&Z!==void 0;if(j.status)if(X&&!H){if(j.status.fetchAborted=!0,j.status.fetchError=f.signal.reason,A)j.status.fetchAbortIgnored=!0}else j.status.fetchResolved=!0;if(X&&!A&&!H)return v(f.signal.reason);let G=W;if(this.#K[_]===W)if(Z===void 0)if(G.__staleWhileFetching!==void 0)this.#K[_]=G.__staleWhileFetching;else this.#R(q,"fetch");else{if(j.status)j.status.fetchUpdated=!0;this.set(q,Z,$.options)}return Z},w=(Z)=>{if(j.status)j.status.fetchRejected=!0,j.status.fetchError=Z;return v(Z)},v=(Z)=>{let{aborted:H}=f.signal,X=H&&j.allowStaleOnFetchAbort,A=X||j.allowStaleOnFetchRejection,G=A||j.noDeleteOnFetchRejection,D=W;if(this.#K[_]===W){if(!G||D.__staleWhileFetching===void 0)this.#R(q,"fetch");else if(!X)this.#K[_]=D.__staleWhileFetching}if(A){if(j.status&&D.__staleWhileFetching!==void 0)j.status.returnedStale=!0;return D.__staleWhileFetching}else if(D.__returned===D)throw Z},z=(Z,H)=>{let X=this.#G?.(q,Y,$);if(X&&X instanceof Promise)X.then((A)=>Z(A===void 0?void 0:A),H);f.signal.addEventListener("abort",()=>{if(!j.ignoreFetchAbort||j.allowStaleOnFetchAbort){if(Z(void 0),j.allowStaleOnFetchAbort)Z=(A)=>O(A,!0)}})};if(j.status)j.status.fetchDispatched=!0;let W=new Promise(z).then(O,w),J=Object.assign(W,{__abortController:f,__staleWhileFetching:Y,__returned:void 0});if(_===void 0)this.set(q,J,{...$.options,status:void 0}),_=this.#z.get(q);else this.#K[_]=J;return J}#O(q){if(!this.#N)return!1;let _=q;return!!_&&_ instanceof Promise&&_.hasOwnProperty("__staleWhileFetching")&&_.__abortController instanceof V7}async fetch(q,_={}){let{allowStale:j=this.allowStale,updateAgeOnGet:K=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,ttl:f=this.ttl,noDisposeOnSet:P=this.noDisposeOnSet,size:$=0,sizeCalculation:O=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:z=this.allowStaleOnFetchRejection,ignoreFetchAbort:W=this.ignoreFetchAbort,allowStaleOnFetchAbort:J=this.allowStaleOnFetchAbort,context:Z,forceRefresh:H=!1,status:X,signal:A}=_;if(!this.#N){if(X)X.fetch="get";return this.get(q,{allowStale:j,updateAgeOnGet:K,noDeleteOnStaleGet:Y,status:X})}let G={allowStale:j,updateAgeOnGet:K,noDeleteOnStaleGet:Y,ttl:f,noDisposeOnSet:P,size:$,sizeCalculation:O,noUpdateTTL:w,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:z,allowStaleOnFetchAbort:J,ignoreFetchAbort:W,status:X,signal:A},D=this.#z.get(q);if(D===void 0){if(X)X.fetch="miss";let M=this.#r(q,D,G,Z);return M.__returned=M}else{let M=this.#K[D];if(this.#O(M)){let p=j&&M.__staleWhileFetching!==void 0;if(X){if(X.fetch="inflight",p)X.returnedStale=!0}return p?M.__staleWhileFetching:M.__returned=M}let g=this.#V(D);if(!H&&!g){if(X)X.fetch="hit";if(this.#p(D),K)this.#S(D);if(X)this.#C(X,D);return M}let S=this.#r(q,D,G,Z),d=S.__staleWhileFetching!==void 0&&j;if(X){if(X.fetch=g?"stale":"refresh",d&&g)X.returnedStale=!0}return d?S.__staleWhileFetching:S.__returned=S}}async forceFetch(q,_={}){let j=await this.fetch(q,_);if(j===void 0)throw new Error("fetch() returned undefined");return j}memo(q,_={}){let j=this.#X;if(!j)throw new Error("no memoMethod provided to constructor");let{context:K,forceRefresh:Y,...f}=_,P=this.get(q,f);if(!Y&&P!==void 0)return P;let $=j(q,P,{options:f,context:K});return this.set(q,$,f),$}get(q,_={}){let{allowStale:j=this.allowStale,updateAgeOnGet:K=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,status:f}=_,P=this.#z.get(q);if(P!==void 0){let $=this.#K[P],O=this.#O($);if(f)this.#C(f,P);if(this.#V(P)){if(f)f.get="stale";if(!O){if(!Y)this.#R(q,"expire");if(f&&j)f.returnedStale=!0;return j?$:void 0}else{if(f&&j&&$.__staleWhileFetching!==void 0)f.returnedStale=!0;return j?$.__staleWhileFetching:void 0}}else{if(f)f.get="hit";if(O)return $.__staleWhileFetching;if(this.#p(P),K)this.#S(P);return $}}else if(f)f.get="miss"}#i(q,_){this.#u[_]=q,this.#H[q]=_}#p(q){if(q!==this.#T){if(q===this.#A)this.#A=this.#H[q];else this.#i(this.#u[q],this.#H[q]);this.#i(this.#T,q),this.#T=q}}delete(q){return this.#R(q,"delete")}#R(q,_){let j=!1;if(this.#$!==0){let K=this.#z.get(q);if(K!==void 0)if(j=!0,this.#$===1)this.#x(_);else{this.#g(K);let Y=this.#K[K];if(this.#O(Y))Y.__abortController.abort(new Error("deleted"));else if(this.#h||this.#J){if(this.#h)this.#Y?.(Y,q,_);if(this.#J)this.#Z?.push([Y,q,_])}if(this.#z.delete(q),this.#w[K]=void 0,this.#K[K]=void 0,K===this.#T)this.#T=this.#u[K];else if(K===this.#A)this.#A=this.#H[K];else{let f=this.#u[K];this.#H[f]=this.#H[K];let P=this.#H[K];this.#u[P]=this.#u[K]}this.#$--,this.#b.push(K)}}if(this.#J&&this.#Z?.length){let K=this.#Z,Y;while(Y=K?.shift())this.#f?.(...Y)}return j}clear(){return this.#x("delete")}#x(q){for(let _ of this.#m({allowStale:!0})){let j=this.#K[_];if(this.#O(j))j.__abortController.abort(new Error("deleted"));else{let K=this.#w[_];if(this.#h)this.#Y?.(j,K,q);if(this.#J)this.#Z?.push([j,K,q])}}if(this.#z.clear(),this.#K.fill(void 0),this.#w.fill(void 0),this.#k&&this.#M)this.#k.fill(0),this.#M.fill(0);if(this.#D)this.#D.fill(0);if(this.#A=0,this.#T=0,this.#b.length=0,this.#W=0,this.#$=0,this.#J&&this.#Z){let _=this.#Z,j;while(j=_?.shift())this.#f?.(...j)}}}import{posix as bh,win32 as E9}from"node:path";import{fileURLToPath as Sh}from"node:url";import{lstatSync as Eh,readdir as Rh,readdirSync as mh,readlinkSync as Ih,realpathSync as gh}from"fs";import*as yh from"node:fs";import{lstat as ph,readdir as Lh,readlink as lh,realpath as xh}from"node:fs/promises";import{EventEmitter as M9}from"node:events";import Ff from"node:stream";import{StringDecoder as Xh}from"node:string_decoder";var af=typeof process==="object"&&process?process:{stdout:null,stderr:null},Ah=(q)=>!!q&&typeof q==="object"&&(q instanceof V_||q instanceof Ff||Gh(q)||uh(q)),Gh=(q)=>!!q&&typeof q==="object"&&q instanceof M9&&typeof q.pipe==="function"&&q.pipe!==Ff.Writable.prototype.pipe,uh=(q)=>!!q&&typeof q==="object"&&q instanceof M9&&typeof q.write==="function"&&typeof q.end==="function",lq=Symbol("EOF"),xq=Symbol("maybeEmitEnd"),K_=Symbol("emittedEnd"),M7=Symbol("emittingEnd"),T3=Symbol("emittedError"),N7=Symbol("closed"),Bf=Symbol("read"),b7=Symbol("flush"),tf=Symbol("flushChunk"),Zq=Symbol("encoding"),XK=Symbol("decoder"),$6=Symbol("flowing"),Z3=Symbol("paused"),AK=Symbol("resume"),w6=Symbol("buffer"),S6=Symbol("pipes"),O6=Symbol("bufferLength"),u9=Symbol("bufferPush"),S7=Symbol("bufferShift"),G6=Symbol("objectMode"),F8=Symbol("destroyed"),h9=Symbol("error"),D9=Symbol("emitData"),ef=Symbol("emitEnd"),C9=Symbol("emitEnd2"),Cq=Symbol("async"),V9=Symbol("abort"),E7=Symbol("aborted"),k3=Symbol("signal"),C_=Symbol("dataListeners"),r6=Symbol("discarded"),X3=(q)=>Promise.resolve().then(q),hh=(q)=>q(),Dh=(q)=>q==="end"||q==="finish"||q==="prefinish",Ch=(q)=>q instanceof ArrayBuffer||!!q&&typeof q==="object"&&q.constructor&&q.constructor.name==="ArrayBuffer"&&q.byteLength>=0,Vh=(q)=>!Buffer.isBuffer(q)&&ArrayBuffer.isView(q);class N9{src;dest;opts;ondrain;constructor(q,_,j){this.src=q,this.dest=_,this.opts=j,this.ondrain=()=>q[AK](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class Uf extends N9{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(q,_,j){super(q,_,j);this.proxyErrors=(K)=>_.emit("error",K),q.on("error",this.proxyErrors)}}var Mh=(q)=>!!q.objectMode,Nh=(q)=>!q.objectMode&&!!q.encoding&&q.encoding!=="buffer";class V_ extends M9{[$6]=!1;[Z3]=!1;[S6]=[];[w6]=[];[G6];[Zq];[Cq];[XK];[lq]=!1;[K_]=!1;[M7]=!1;[N7]=!1;[T3]=null;[O6]=0;[F8]=!1;[k3];[E7]=!1;[C_]=0;[r6]=!1;writable=!0;readable=!0;constructor(...q){let _=q[0]||{};super();if(_.objectMode&&typeof _.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(Mh(_))this[G6]=!0,this[Zq]=null;else if(Nh(_))this[Zq]=_.encoding,this[G6]=!1;else this[G6]=!1,this[Zq]=null;if(this[Cq]=!!_.async,this[XK]=this[Zq]?new Xh(this[Zq]):null,_&&_.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[w6]});if(_&&_.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[S6]});let{signal:j}=_;if(j)if(this[k3]=j,j.aborted)this[V9]();else j.addEventListener("abort",()=>this[V9]())}get bufferLength(){return this[O6]}get encoding(){return this[Zq]}set encoding(q){throw new Error("Encoding must be set at instantiation time")}setEncoding(q){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[G6]}set objectMode(q){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[Cq]}set["async"](q){this[Cq]=this[Cq]||!!q}[V9](){this[E7]=!0,this.emit("abort",this[k3]?.reason),this.destroy(this[k3]?.reason)}get aborted(){return this[E7]}set aborted(q){}write(q,_,j){if(this[E7])return!1;if(this[lq])throw new Error("write after end");if(this[F8])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof _==="function")j=_,_="utf8";if(!_)_="utf8";let K=this[Cq]?X3:hh;if(!this[G6]&&!Buffer.isBuffer(q)){if(Vh(q))q=Buffer.from(q.buffer,q.byteOffset,q.byteLength);else if(Ch(q))q=Buffer.from(q);else if(typeof q!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[G6]){if(this[$6]&&this[O6]!==0)this[b7](!0);if(this[$6])this.emit("data",q);else this[u9](q);if(this[O6]!==0)this.emit("readable");if(j)K(j);return this[$6]}if(!q.length){if(this[O6]!==0)this.emit("readable");if(j)K(j);return this[$6]}if(typeof q==="string"&&!(_===this[Zq]&&!this[XK]?.lastNeed))q=Buffer.from(q,_);if(Buffer.isBuffer(q)&&this[Zq])q=this[XK].write(q);if(this[$6]&&this[O6]!==0)this[b7](!0);if(this[$6])this.emit("data",q);else this[u9](q);if(this[O6]!==0)this.emit("readable");if(j)K(j);return this[$6]}read(q){if(this[F8])return null;if(this[r6]=!1,this[O6]===0||q===0||q&&q>this[O6])return this[xq](),null;if(this[G6])q=null;if(this[w6].length>1&&!this[G6])this[w6]=[this[Zq]?this[w6].join(""):Buffer.concat(this[w6],this[O6])];let _=this[Bf](q||null,this[w6][0]);return this[xq](),_}[Bf](q,_){if(this[G6])this[S7]();else{let j=_;if(q===j.length||q===null)this[S7]();else if(typeof j==="string")this[w6][0]=j.slice(q),_=j.slice(0,q),this[O6]-=q;else this[w6][0]=j.subarray(q),_=j.subarray(0,q),this[O6]-=q}if(this.emit("data",_),!this[w6].length&&!this[lq])this.emit("drain");return _}end(q,_,j){if(typeof q==="function")j=q,q=void 0;if(typeof _==="function")j=_,_="utf8";if(q!==void 0)this.write(q,_);if(j)this.once("end",j);if(this[lq]=!0,this.writable=!1,this[$6]||!this[Z3])this[xq]();return this}[AK](){if(this[F8])return;if(!this[C_]&&!this[S6].length)this[r6]=!0;if(this[Z3]=!1,this[$6]=!0,this.emit("resume"),this[w6].length)this[b7]();else if(this[lq])this[xq]();else this.emit("drain")}resume(){return this[AK]()}pause(){this[$6]=!1,this[Z3]=!0,this[r6]=!1}get destroyed(){return this[F8]}get flowing(){return this[$6]}get paused(){return this[Z3]}[u9](q){if(this[G6])this[O6]+=1;else this[O6]+=q.length;this[w6].push(q)}[S7](){if(this[G6])this[O6]-=1;else this[O6]-=this[w6][0].length;return this[w6].shift()}[b7](q=!1){do;while(this[tf](this[S7]())&&this[w6].length);if(!q&&!this[w6].length&&!this[lq])this.emit("drain")}[tf](q){return this.emit("data",q),this[$6]}pipe(q,_){if(this[F8])return q;this[r6]=!1;let j=this[K_];if(_=_||{},q===af.stdout||q===af.stderr)_.end=!1;else _.end=_.end!==!1;if(_.proxyErrors=!!_.proxyErrors,j){if(_.end)q.end()}else if(this[S6].push(!_.proxyErrors?new N9(this,q,_):new Uf(this,q,_)),this[Cq])X3(()=>this[AK]());else this[AK]();return q}unpipe(q){let _=this[S6].find((j)=>j.dest===q);if(_){if(this[S6].length===1){if(this[$6]&&this[C_]===0)this[$6]=!1;this[S6]=[]}else this[S6].splice(this[S6].indexOf(_),1);_.unpipe()}}addListener(q,_){return this.on(q,_)}on(q,_){let j=super.on(q,_);if(q==="data"){if(this[r6]=!1,this[C_]++,!this[S6].length&&!this[$6])this[AK]()}else if(q==="readable"&&this[O6]!==0)super.emit("readable");else if(Dh(q)&&this[K_])super.emit(q),this.removeAllListeners(q);else if(q==="error"&&this[T3]){let K=_;if(this[Cq])X3(()=>K.call(this,this[T3]));else K.call(this,this[T3])}return j}removeListener(q,_){return this.off(q,_)}off(q,_){let j=super.off(q,_);if(q==="data"){if(this[C_]=this.listeners("data").length,this[C_]===0&&!this[r6]&&!this[S6].length)this[$6]=!1}return j}removeAllListeners(q){let _=super.removeAllListeners(q);if(q==="data"||q===void 0){if(this[C_]=0,!this[r6]&&!this[S6].length)this[$6]=!1}return _}get emittedEnd(){return this[K_]}[xq](){if(!this[M7]&&!this[K_]&&!this[F8]&&this[w6].length===0&&this[lq]){if(this[M7]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[N7])this.emit("close");this[M7]=!1}}emit(q,..._){let j=_[0];if(q!=="error"&&q!=="close"&&q!==F8&&this[F8])return!1;else if(q==="data")return!this[G6]&&!j?!1:this[Cq]?(X3(()=>this[D9](j)),!0):this[D9](j);else if(q==="end")return this[ef]();else if(q==="close"){if(this[N7]=!0,!this[K_]&&!this[F8])return!1;let Y=super.emit("close");return this.removeAllListeners("close"),Y}else if(q==="error"){this[T3]=j,super.emit(h9,j);let Y=!this[k3]||this.listeners("error").length?super.emit("error",j):!1;return this[xq](),Y}else if(q==="resume"){let Y=super.emit("resume");return this[xq](),Y}else if(q==="finish"||q==="prefinish"){let Y=super.emit(q);return this.removeAllListeners(q),Y}let K=super.emit(q,..._);return this[xq](),K}[D9](q){for(let j of this[S6])if(j.dest.write(q)===!1)this.pause();let _=this[r6]?!1:super.emit("data",q);return this[xq](),_}[ef](){if(this[K_])return!1;return this[K_]=!0,this.readable=!1,this[Cq]?(X3(()=>this[C9]()),!0):this[C9]()}[C9](){if(this[XK]){let _=this[XK].end();if(_){for(let j of this[S6])j.dest.write(_);if(!this[r6])super.emit("data",_)}}for(let _ of this[S6])_.end();let q=super.emit("end");return this.removeAllListeners("end"),q}async collect(){let q=Object.assign([],{dataLength:0});if(!this[G6])q.dataLength=0;let _=this.promise();return this.on("data",(j)=>{if(q.push(j),!this[G6])q.dataLength+=j.length}),await _,q}async concat(){if(this[G6])throw new Error("cannot concat in objectMode");let q=await this.collect();return this[Zq]?q.join(""):Buffer.concat(q,q.dataLength)}async promise(){return new Promise((q,_)=>{this.on(F8,()=>_(new Error("stream destroyed"))),this.on("error",(j)=>_(j)),this.on("end",()=>q())})}[Symbol.asyncIterator](){this[r6]=!1;let q=!1,_=async()=>{return this.pause(),q=!0,{value:void 0,done:!0}};return{next:()=>{if(q)return _();let K=this.read();if(K!==null)return Promise.resolve({done:!1,value:K});if(this[lq])return _();let Y,f,P=(v)=>{this.off("data",$),this.off("end",O),this.off(F8,w),_(),f(v)},$=(v)=>{this.off("error",P),this.off("end",O),this.off(F8,w),this.pause(),Y({value:v,done:!!this[lq]})},O=()=>{this.off("error",P),this.off("data",$),this.off(F8,w),_(),Y({done:!0,value:void 0})},w=()=>P(new Error("stream destroyed"));return new Promise((v,z)=>{f=z,Y=v,this.once(F8,w),this.once("error",P),this.once("end",O),this.once("data",$)})},throw:_,return:_,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[r6]=!1;let q=!1,_=()=>{return this.pause(),this.off(h9,_),this.off(F8,_),this.off("end",_),q=!0,{done:!0,value:void 0}},j=()=>{if(q)return _();let K=this.read();return K===null?_():{done:!1,value:K}};return this.once("end",_),this.once(h9,_),this.once(F8,_),{next:j,throw:_,return:_,[Symbol.iterator](){return this}}}destroy(q){if(this[F8]){if(q)this.emit("error",q);else this.emit(F8);return this}this[F8]=!0,this[r6]=!0,this[w6].length=0,this[O6]=0;let _=this;if(typeof _.close==="function"&&!this[N7])_.close();if(q)this.emit("error",q);else this.emit(F8);return this}static get isStream(){return Ah}}var dh=gh.native,G3={lstatSync:Eh,readdir:Rh,readdirSync:mh,readlinkSync:Ih,realpathSync:dh,promises:{lstat:ph,readdir:Lh,readlink:lh,realpath:xh}},K$=(q)=>!q||q===G3||q===yh?G3:{...G3,...q,promises:{...G3.promises,...q.promises||{}}},j$=/^\\\\\?\\([a-z]:)\\?$/i,nh=(q)=>q.replace(/\//g,"\\").replace(j$,"$1\\"),ch=/[\\\/]/,jq=0,P$=1,Y$=2,Vq=4,f$=6,$$=8,M_=10,w$=12,Kq=15,A3=~Kq,b9=16,sf=32,u3=64,kq=128,R7=256,I7=512,Qf=u3|kq|I7,rh=1023,S9=(q)=>q.isFile()?$$:q.isDirectory()?Vq:q.isSymbolicLink()?M_:q.isCharacterDevice()?Y$:q.isBlockDevice()?f$:q.isSocket()?w$:q.isFIFO()?P$:jq,q$=new Map,h3=(q)=>{let _=q$.get(q);if(_)return _;let j=q.normalize("NFKD");return q$.set(q,j),j},_$=new Map,m7=(q)=>{let _=_$.get(q);if(_)return _;let j=h3(q.toLowerCase());return _$.set(q,j),j};class R9 extends H3{constructor(){super({max:256})}}class O$ extends H3{constructor(q=16384){super({maxSize:q,sizeCalculation:(_)=>_.length+1})}}var v$=Symbol("PathScurry setAsCwd");class E6{name;root;roots;parent;nocase;isCWD=!1;#q;#_;get dev(){return this.#_}#Y;get mode(){return this.#Y}#P;get nlink(){return this.#P}#f;get uid(){return this.#f}#G;get gid(){return this.#G}#X;get rdev(){return this.#X}#v;get blksize(){return this.#v}#$;get ino(){return this.#$}#W;get size(){return this.#W}#z;get blocks(){return this.#z}#w;get atimeMs(){return this.#w}#K;get mtimeMs(){return this.#K}#H;get ctimeMs(){return this.#H}#u;get birthtimeMs(){return this.#u}#A;get atime(){return this.#A}#T;get mtime(){return this.#T}#b;get ctime(){return this.#b}#Z;get birthtime(){return this.#Z}#D;#M;#k;#h;#N;#J;#j;#I;#S;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(q,_=jq,j,K,Y,f,P){if(this.name=q,this.#D=Y?m7(q):h3(q),this.#j=_&rh,this.nocase=Y,this.roots=K,this.root=j||this,this.#I=f,this.#k=P.fullpath,this.#N=P.relative,this.#J=P.relativePosix,this.parent=P.parent,this.parent)this.#q=this.parent.#q;else this.#q=K$(P.fs)}depth(){if(this.#M!==void 0)return this.#M;if(!this.parent)return this.#M=0;return this.#M=this.parent.depth()+1}childrenCache(){return this.#I}resolve(q){if(!q)return this;let _=this.getRootString(q),K=q.substring(_.length).split(this.splitSep);return _?this.getRoot(_).#n(K):this.#n(K)}#n(q){let _=this;for(let j of q)_=_.child(j);return _}children(){let q=this.#I.get(this);if(q)return q;let _=Object.assign([],{provisional:0});return this.#I.set(this,_),this.#j&=~b9,_}child(q,_){if(q===""||q===".")return this;if(q==="..")return this.parent||this;let j=this.children(),K=this.nocase?m7(q):h3(q);for(let $ of j)if($.#D===K)return $;let Y=this.parent?this.sep:"",f=this.#k?this.#k+Y+q:void 0,P=this.newChild(q,jq,{..._,parent:this,fullpath:f});if(!this.canReaddir())P.#j|=kq;return j.push(P),P}relative(){if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let q=this.name,_=this.parent;if(!_)return this.#N=this.name;let j=_.relative();return j+(!j||!_.parent?"":this.sep)+q}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#J!==void 0)return this.#J;let q=this.name,_=this.parent;if(!_)return this.#J=this.fullpathPosix();let j=_.relativePosix();return j+(!j||!_.parent?"":"/")+q}fullpath(){if(this.#k!==void 0)return this.#k;let q=this.name,_=this.parent;if(!_)return this.#k=this.name;let K=_.fullpath()+(!_.parent?"":this.sep)+q;return this.#k=K}fullpathPosix(){if(this.#h!==void 0)return this.#h;if(this.sep==="/")return this.#h=this.fullpath();if(!this.parent){let K=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(K))return this.#h=`//?/${K}`;else return this.#h=K}let q=this.parent,_=q.fullpathPosix(),j=_+(!_||!q.parent?"":"/")+this.name;return this.#h=j}isUnknown(){return(this.#j&Kq)===jq}isType(q){return this[`is${q}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#j&Kq)===$$}isDirectory(){return(this.#j&Kq)===Vq}isCharacterDevice(){return(this.#j&Kq)===Y$}isBlockDevice(){return(this.#j&Kq)===f$}isFIFO(){return(this.#j&Kq)===P$}isSocket(){return(this.#j&Kq)===w$}isSymbolicLink(){return(this.#j&M_)===M_}lstatCached(){return this.#j&sf?this:void 0}readlinkCached(){return this.#S}realpathCached(){return this.#C}readdirCached(){let q=this.children();return q.slice(0,q.provisional)}canReadlink(){if(this.#S)return!0;if(!this.parent)return!1;let q=this.#j&Kq;return!(q!==jq&&q!==M_||this.#j&R7||this.#j&kq)}calledReaddir(){return!!(this.#j&b9)}isENOENT(){return!!(this.#j&kq)}isNamed(q){return!this.nocase?this.#D===h3(q):this.#D===m7(q)}async readlink(){let q=this.#S;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let _=await this.#q.promises.readlink(this.fullpath()),j=(await this.parent.realpath())?.resolve(_);if(j)return this.#S=j}catch(_){this.#c(_.code);return}}readlinkSync(){let q=this.#S;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let _=this.#q.readlinkSync(this.fullpath()),j=this.parent.realpathSync()?.resolve(_);if(j)return this.#S=j}catch(_){this.#c(_.code);return}}#V(q){this.#j|=b9;for(let _=q.provisional;_<q.length;_++){let j=q[_];if(j)j.#L()}}#L(){if(this.#j&kq)return;this.#j=(this.#j|kq)&A3,this.#g()}#g(){let q=this.children();q.provisional=0;for(let _ of q)_.#L()}#l(){this.#j|=I7,this.#y()}#y(){if(this.#j&u3)return;let q=this.#j;if((q&Kq)===Vq)q&=A3;this.#j=q|u3,this.#g()}#E(q=""){if(q==="ENOTDIR"||q==="EPERM")this.#y();else if(q==="ENOENT")this.#L();else this.children().provisional=0}#m(q=""){if(q==="ENOTDIR")this.parent.#y();else if(q==="ENOENT")this.#L()}#c(q=""){let _=this.#j;if(_|=R7,q==="ENOENT")_|=kq;if(q==="EINVAL"||q==="UNKNOWN")_&=A3;if(this.#j=_,q==="ENOTDIR"&&this.parent)this.parent.#y()}#d(q,_){return this.#O(q,_)||this.#r(q,_)}#r(q,_){let j=S9(q),K=this.newChild(q.name,j,{parent:this}),Y=K.#j&Kq;if(Y!==Vq&&Y!==M_&&Y!==jq)K.#j|=u3;return _.unshift(K),_.provisional++,K}#O(q,_){for(let j=_.provisional;j<_.length;j++){let K=_[j];if((this.nocase?m7(q.name):h3(q.name))!==K.#D)continue;return this.#i(q,K,j,_)}}#i(q,_,j,K){let Y=_.name;if(_.#j=_.#j&A3|S9(q),Y!==q.name)_.name=q.name;if(j!==K.provisional){if(j===K.length-1)K.pop();else K.splice(j,1);K.unshift(_)}return K.provisional++,_}async lstat(){if((this.#j&kq)===0)try{return this.#p(await this.#q.promises.lstat(this.fullpath())),this}catch(q){this.#m(q.code)}}lstatSync(){if((this.#j&kq)===0)try{return this.#p(this.#q.lstatSync(this.fullpath())),this}catch(q){this.#m(q.code)}}#p(q){let{atime:_,atimeMs:j,birthtime:K,birthtimeMs:Y,blksize:f,blocks:P,ctime:$,ctimeMs:O,dev:w,gid:v,ino:z,mode:W,mtime:J,mtimeMs:Z,nlink:H,rdev:X,size:A,uid:G}=q;this.#A=_,this.#w=j,this.#Z=K,this.#u=Y,this.#v=f,this.#z=P,this.#b=$,this.#H=O,this.#_=w,this.#G=v,this.#$=z,this.#Y=W,this.#T=J,this.#K=Z,this.#P=H,this.#X=X,this.#W=A,this.#f=G;let D=S9(q);if(this.#j=this.#j&A3|D|sf,D!==jq&&D!==Vq&&D!==M_)this.#j|=u3}#R=[];#x=!1;#a(q){this.#x=!1;let _=this.#R.slice();this.#R.length=0,_.forEach((j)=>j(null,q))}readdirCB(q,_=!1){if(!this.canReaddir()){if(_)q(null,[]);else queueMicrotask(()=>q(null,[]));return}let j=this.children();if(this.calledReaddir()){let Y=j.slice(0,j.provisional);if(_)q(null,Y);else queueMicrotask(()=>q(null,Y));return}if(this.#R.push(q),this.#x)return;this.#x=!0;let K=this.fullpath();this.#q.readdir(K,{withFileTypes:!0},(Y,f)=>{if(Y)this.#E(Y.code),j.provisional=0;else{for(let P of f)this.#d(P,j);this.#V(j)}this.#a(j.slice(0,j.provisional));return})}#o;async readdir(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let _=this.fullpath();if(this.#o)await this.#o;else{let j=()=>{};this.#o=new Promise((K)=>j=K);try{for(let K of await this.#q.promises.readdir(_,{withFileTypes:!0}))this.#d(K,q);this.#V(q)}catch(K){this.#E(K.code),q.provisional=0}this.#o=void 0,j()}return q.slice(0,q.provisional)}readdirSync(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let _=this.fullpath();try{for(let j of this.#q.readdirSync(_,{withFileTypes:!0}))this.#d(j,q);this.#V(q)}catch(j){this.#E(j.code),q.provisional=0}return q.slice(0,q.provisional)}canReaddir(){if(this.#j&Qf)return!1;let q=Kq&this.#j;if(!(q===jq||q===Vq||q===M_))return!1;return!0}shouldWalk(q,_){return(this.#j&Vq)===Vq&&!(this.#j&Qf)&&!q.has(this)&&(!_||_(this))}async realpath(){if(this.#C)return this.#C;if((I7|R7|kq)&this.#j)return;try{let q=await this.#q.promises.realpath(this.fullpath());return this.#C=this.resolve(q)}catch(q){this.#l()}}realpathSync(){if(this.#C)return this.#C;if((I7|R7|kq)&this.#j)return;try{let q=this.#q.realpathSync(this.fullpath());return this.#C=this.resolve(q)}catch(q){this.#l()}}[v$](q){if(q===this)return;q.isCWD=!1,this.isCWD=!0;let _=new Set([]),j=[],K=this;while(K&&K.parent)_.add(K),K.#N=j.join(this.sep),K.#J=j.join("/"),K=K.parent,j.push("..");K=q;while(K&&K.parent&&!_.has(K))K.#N=void 0,K.#J=void 0,K=K.parent}}class g7 extends E6{sep="\\";splitSep=ch;constructor(q,_=jq,j,K,Y,f,P){super(q,_,j,K,Y,f,P)}newChild(q,_=jq,j={}){return new g7(q,_,this.root,this.roots,this.nocase,this.childrenCache(),j)}getRootString(q){return E9.parse(q).root}getRoot(q){if(q=nh(q.toUpperCase()),q===this.root.name)return this.root;for(let[_,j]of Object.entries(this.roots))if(this.sameRoot(q,_))return this.roots[q]=j;return this.roots[q]=new D3(q,this).root}sameRoot(q,_=this.root.name){return q=q.toUpperCase().replace(/\//g,"\\").replace(j$,"$1\\"),q===_}}class y7 extends E6{splitSep="/";sep="/";constructor(q,_=jq,j,K,Y,f,P){super(q,_,j,K,Y,f,P)}getRootString(q){return q.startsWith("/")?"/":""}getRoot(q){return this.root}newChild(q,_=jq,j={}){return new y7(q,_,this.root,this.roots,this.nocase,this.childrenCache(),j)}}class m9{root;rootPath;roots;cwd;#q;#_;#Y;nocase;#P;constructor(q=process.cwd(),_,j,{nocase:K,childrenCacheSize:Y=16384,fs:f=G3}={}){if(this.#P=K$(f),q instanceof URL||q.startsWith("file://"))q=Sh(q);let P=_.resolve(q);this.roots=Object.create(null),this.rootPath=this.parseRootPath(P),this.#q=new R9,this.#_=new R9,this.#Y=new O$(Y);let $=P.substring(this.rootPath.length).split(j);if($.length===1&&!$[0])$.pop();if(K===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=K,this.root=this.newRoot(this.#P),this.roots[this.rootPath]=this.root;let O=this.root,w=$.length-1,v=_.sep,z=this.rootPath,W=!1;for(let J of $){let Z=w--;O=O.child(J,{relative:new Array(Z).fill("..").join(v),relativePosix:new Array(Z).fill("..").join("/"),fullpath:z+=(W?"":v)+J}),W=!0}this.cwd=O}depth(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.depth()}childrenCache(){return this.#Y}resolve(...q){let _="";for(let Y=q.length-1;Y>=0;Y--){let f=q[Y];if(!f||f===".")continue;if(_=_?`${f}/${_}`:f,this.isAbsolute(f))break}let j=this.#q.get(_);if(j!==void 0)return j;let K=this.cwd.resolve(_).fullpath();return this.#q.set(_,K),K}resolvePosix(...q){let _="";for(let Y=q.length-1;Y>=0;Y--){let f=q[Y];if(!f||f===".")continue;if(_=_?`${f}/${_}`:f,this.isAbsolute(f))break}let j=this.#_.get(_);if(j!==void 0)return j;let K=this.cwd.resolve(_).fullpathPosix();return this.#_.set(_,K),K}relative(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relative()}relativePosix(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relativePosix()}basename(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.name}dirname(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return(q.parent||q).fullpath()}async readdir(q=this.cwd,_={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j}=_;if(!q.canReaddir())return[];else{let K=await q.readdir();return j?K:K.map((Y)=>Y.name)}}readdirSync(q=this.cwd,_={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0}=_;if(!q.canReaddir())return[];else if(j)return q.readdirSync();else return q.readdirSync().map((K)=>K.name)}async lstat(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstat()}lstatSync(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstatSync()}async readlink(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q.withFileTypes,q=this.cwd;let j=await q.readlink();return _?j:j?.fullpath()}readlinkSync(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q.withFileTypes,q=this.cwd;let j=q.readlinkSync();return _?j:j?.fullpath()}async realpath(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q.withFileTypes,q=this.cwd;let j=await q.realpath();return _?j:j?.fullpath()}realpathSync(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q.withFileTypes,q=this.cwd;let j=q.realpathSync();return _?j:j?.fullpath()}async walk(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=[];if(!Y||Y(q))P.push(j?q:q.fullpath());let $=new Set,O=(v,z)=>{$.add(v),v.readdirCB((W,J)=>{if(W)return z(W);let Z=J.length;if(!Z)return z();let H=()=>{if(--Z===0)z()};for(let X of J){if(!Y||Y(X))P.push(j?X:X.fullpath());if(K&&X.isSymbolicLink())X.realpath().then((A)=>A?.isUnknown()?A.lstat():A).then((A)=>A?.shouldWalk($,f)?O(A,H):H());else if(X.shouldWalk($,f))O(X,H);else H()}},!0)},w=q;return new Promise((v,z)=>{O(w,(W)=>{if(W)return z(W);v(P)})})}walkSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=[];if(!Y||Y(q))P.push(j?q:q.fullpath());let $=new Set([q]);for(let O of $){let w=O.readdirSync();for(let v of w){if(!Y||Y(v))P.push(j?v:v.fullpath());let z=v;if(v.isSymbolicLink()){if(!(K&&(z=v.realpathSync())))continue;if(z.isUnknown())z.lstatSync()}if(z.shouldWalk($,f))$.add(z)}}return P}[Symbol.asyncIterator](){return this.iterate()}iterate(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;return this.stream(q,_)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_;if(!Y||Y(q))yield j?q:q.fullpath();let P=new Set([q]);for(let $ of P){let O=$.readdirSync();for(let w of O){if(!Y||Y(w))yield j?w:w.fullpath();let v=w;if(w.isSymbolicLink()){if(!(K&&(v=w.realpathSync())))continue;if(v.isUnknown())v.lstatSync()}if(v.shouldWalk(P,f))P.add(v)}}}stream(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=new V_({objectMode:!0});if(!Y||Y(q))P.write(j?q:q.fullpath());let $=new Set,O=[q],w=0,v=()=>{let z=!1;while(!z){let W=O.shift();if(!W){if(w===0)P.end();return}w++,$.add(W);let J=(H,X,A=!1)=>{if(H)return P.emit("error",H);if(K&&!A){let G=[];for(let D of X)if(D.isSymbolicLink())G.push(D.realpath().then((M)=>M?.isUnknown()?M.lstat():M));if(G.length){Promise.all(G).then(()=>J(null,X,!0));return}}for(let G of X)if(G&&(!Y||Y(G))){if(!P.write(j?G:G.fullpath()))z=!0}w--;for(let G of X){let D=G.realpathCached()||G;if(D.shouldWalk($,f))O.push(D)}if(z&&!P.flowing)P.once("drain",v);else if(!Z)v()},Z=!0;W.readdirCB(J,!0),Z=!1}};return v(),P}streamSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=new V_({objectMode:!0}),$=new Set;if(!Y||Y(q))P.write(j?q:q.fullpath());let O=[q],w=0,v=()=>{let z=!1;while(!z){let W=O.shift();if(!W){if(w===0)P.end();return}w++,$.add(W);let J=W.readdirSync();for(let Z of J)if(!Y||Y(Z)){if(!P.write(j?Z:Z.fullpath()))z=!0}w--;for(let Z of J){let H=Z;if(Z.isSymbolicLink()){if(!(K&&(H=Z.realpathSync())))continue;if(H.isUnknown())H.lstatSync()}if(H.shouldWalk($,f))O.push(H)}}if(z&&!P.flowing)P.once("drain",v)};return v(),P}chdir(q=this.cwd){let _=this.cwd;this.cwd=typeof q==="string"?this.cwd.resolve(q):q,this.cwd[v$](_)}}class D3 extends m9{sep="\\";constructor(q=process.cwd(),_={}){let{nocase:j=!0}=_;super(q,E9,"\\",{..._,nocase:j});this.nocase=j;for(let K=this.cwd;K;K=K.parent)K.nocase=this.nocase}parseRootPath(q){return E9.parse(q).root.toUpperCase()}newRoot(q){return new g7(this.rootPath,Vq,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")||q.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(q)}}class C3 extends m9{sep="/";constructor(q=process.cwd(),_={}){let{nocase:j=!1}=_;super(q,bh,"/",{..._,nocase:j});this.nocase=j}parseRootPath(q){return"/"}newRoot(q){return new y7(this.rootPath,Vq,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")}}class d7 extends C3{constructor(q=process.cwd(),_={}){let{nocase:j=!0}=_;super(q,{..._,nocase:j})}}var ZN=process.platform==="win32"?g7:y7,z$=process.platform==="win32"?D3:process.platform==="darwin"?d7:C3;var ih=(q)=>q.length>=1,oh=(q)=>q.length>=1;class GK{#q;#_;#Y;length;#P;#f;#G;#X;#v;#$;#W=!0;constructor(q,_,j,K){if(!ih(q))throw new TypeError("empty pattern list");if(!oh(_))throw new TypeError("empty glob list");if(_.length!==q.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=q.length,j<0||j>=this.length)throw new TypeError("index out of range");if(this.#q=q,this.#_=_,this.#Y=j,this.#P=K,this.#Y===0){if(this.isUNC()){let[Y,f,P,$,...O]=this.#q,[w,v,z,W,...J]=this.#_;if(O[0]==="")O.shift(),J.shift();let Z=[Y,f,P,$,""].join("/"),H=[w,v,z,W,""].join("/");this.#q=[Z,...O],this.#_=[H,...J],this.length=this.#q.length}else if(this.isDrive()||this.isAbsolute()){let[Y,...f]=this.#q,[P,...$]=this.#_;if(f[0]==="")f.shift(),$.shift();let O=Y+"/",w=P+"/";this.#q=[O,...f],this.#_=[w,...$],this.length=this.#q.length}}}pattern(){return this.#q[this.#Y]}isString(){return typeof this.#q[this.#Y]==="string"}isGlobstar(){return this.#q[this.#Y]===T6}isRegExp(){return this.#q[this.#Y]instanceof RegExp}globString(){return this.#G=this.#G||(this.#Y===0?this.isAbsolute()?this.#_[0]+this.#_.slice(1).join("/"):this.#_.join("/"):this.#_.slice(this.#Y).join("/"))}hasMore(){return this.length>this.#Y+1}rest(){if(this.#f!==void 0)return this.#f;if(!this.hasMore())return this.#f=null;return this.#f=new GK(this.#q,this.#_,this.#Y+1,this.#P),this.#f.#$=this.#$,this.#f.#v=this.#v,this.#f.#X=this.#X,this.#f}isUNC(){let q=this.#q;return this.#v!==void 0?this.#v:this.#v=this.#P==="win32"&&this.#Y===0&&q[0]===""&&q[1]===""&&typeof q[2]==="string"&&!!q[2]&&typeof q[3]==="string"&&!!q[3]}isDrive(){let q=this.#q;return this.#X!==void 0?this.#X:this.#X=this.#P==="win32"&&this.#Y===0&&this.length>1&&typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0])}isAbsolute(){let q=this.#q;return this.#$!==void 0?this.#$:this.#$=q[0]===""&&q.length>1||this.isDrive()||this.isUNC()}root(){let q=this.#q[0];return typeof q==="string"&&this.isAbsolute()&&this.#Y===0?q:""}checkFollowGlobstar(){return!(this.#Y===0||!this.isGlobstar()||!this.#W)}markFollowGlobstar(){if(this.#Y===0||!this.isGlobstar()||!this.#W)return!1;return this.#W=!1,!0}}var ah=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class V3{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(q,{nobrace:_,nocase:j,noext:K,noglobstar:Y,platform:f=ah}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=f,this.mmopts={dot:!0,nobrace:_,nocase:j,noext:K,noglobstar:Y,optimizationLevel:2,platform:f,nocomment:!0,nonegate:!0};for(let P of q)this.add(P)}add(q){let _=new _q(q,this.mmopts);for(let j=0;j<_.set.length;j++){let K=_.set[j],Y=_.globParts[j];if(!K||!Y)throw new Error("invalid pattern object");while(K[0]==="."&&Y[0]===".")K.shift(),Y.shift();let f=new GK(K,Y,0,this.platform),P=new _q(f.globString(),this.mmopts),$=Y[Y.length-1]==="**",O=f.isAbsolute();if(O)this.absolute.push(P);else this.relative.push(P);if($)if(O)this.absoluteChildren.push(P);else this.relativeChildren.push(P)}}ignored(q){let _=q.fullpath(),j=`${_}/`,K=q.relative()||".",Y=`${K}/`;for(let f of this.relative)if(f.match(K)||f.match(Y))return!0;for(let f of this.absolute)if(f.match(_)||f.match(j))return!0;return!1}childrenIgnored(q){let _=q.fullpath()+"/",j=(q.relative()||".")+"/";for(let K of this.relativeChildren)if(K.match(j))return!0;for(let K of this.absoluteChildren)if(K.match(_))return!0;return!1}}class I9{store;constructor(q=new Map){this.store=q}copy(){return new I9(new Map(this.store))}hasWalked(q,_){return this.store.get(q.fullpath())?.has(_.globString())}storeWalked(q,_){let j=q.fullpath(),K=this.store.get(j);if(K)K.add(_.globString());else this.store.set(j,new Set([_.globString()]))}}class W${store=new Map;add(q,_,j){let K=(_?2:0)|(j?1:0),Y=this.store.get(q);this.store.set(q,Y===void 0?K:K&Y)}entries(){return[...this.store.entries()].map(([q,_])=>[q,!!(_&2),!!(_&1)])}}class J${store=new Map;add(q,_){if(!q.canReaddir())return;let j=this.store.get(q);if(j){if(!j.find((K)=>K.globString()===_.globString()))j.push(_)}else this.store.set(q,[_])}get(q){let _=this.store.get(q);if(!_)throw new Error("attempting to walk unknown path");return _}entries(){return this.keys().map((q)=>[q,this.store.get(q)])}keys(){return[...this.store.keys()].filter((q)=>q.canReaddir())}}class M3{hasWalkedCache;matches=new W$;subwalks=new J$;patterns;follow;dot;opts;constructor(q,_){this.opts=q,this.follow=!!q.follow,this.dot=!!q.dot,this.hasWalkedCache=_?_.copy():new I9}processPatterns(q,_){this.patterns=_;let j=_.map((K)=>[q,K]);for(let[K,Y]of j){this.hasWalkedCache.storeWalked(K,Y);let f=Y.root(),P=Y.isAbsolute()&&this.opts.absolute!==!1;if(f){K=K.resolve(f==="/"&&this.opts.root!==void 0?this.opts.root:f);let v=Y.rest();if(!v){this.matches.add(K,!0,!1);continue}else Y=v}if(K.isENOENT())continue;let $,O,w=!1;while(typeof($=Y.pattern())==="string"&&(O=Y.rest()))K=K.resolve($),Y=O,w=!0;if($=Y.pattern(),O=Y.rest(),w){if(this.hasWalkedCache.hasWalked(K,Y))continue;this.hasWalkedCache.storeWalked(K,Y)}if(typeof $==="string"){let v=$===".."||$===""||$===".";this.matches.add(K.resolve($),P,v);continue}else if($===T6){if(!K.isSymbolicLink()||this.follow||Y.checkFollowGlobstar())this.subwalks.add(K,Y);let v=O?.pattern(),z=O?.rest();if(!O||(v===""||v===".")&&!z)this.matches.add(K,P,v===""||v===".");else if(v===".."){let W=K.parent||K;if(!z)this.matches.add(W,P,!0);else if(!this.hasWalkedCache.hasWalked(W,z))this.subwalks.add(W,z)}}else if($ instanceof RegExp)this.subwalks.add(K,Y)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new M3(this.opts,this.hasWalkedCache)}filterEntries(q,_){let j=this.subwalks.get(q),K=this.child();for(let Y of _)for(let f of j){let P=f.isAbsolute(),$=f.pattern(),O=f.rest();if($===T6)K.testGlobstar(Y,f,O,P);else if($ instanceof RegExp)K.testRegExp(Y,$,O,P);else K.testString(Y,$,O,P)}return K}testGlobstar(q,_,j,K){if(this.dot||!q.name.startsWith(".")){if(!_.hasMore())this.matches.add(q,K,!1);if(q.canReaddir()){if(this.follow||!q.isSymbolicLink())this.subwalks.add(q,_);else if(q.isSymbolicLink()){if(j&&_.checkFollowGlobstar())this.subwalks.add(q,j);else if(_.markFollowGlobstar())this.subwalks.add(q,_)}}}if(j){let Y=j.pattern();if(typeof Y==="string"&&Y!==".."&&Y!==""&&Y!==".")this.testString(q,Y,j.rest(),K);else if(Y===".."){let f=q.parent||q;this.subwalks.add(f,j)}else if(Y instanceof RegExp)this.testRegExp(q,Y,j.rest(),K)}}testRegExp(q,_,j,K){if(!_.test(q.name))return;if(!j)this.matches.add(q,K,!1);else this.subwalks.add(q,j)}testString(q,_,j,K){if(!q.isNamed(_))return;if(!j)this.matches.add(q,K,!1);else this.subwalks.add(q,j)}}var Bh=(q,_)=>typeof q==="string"?new V3([q],_):Array.isArray(q)?new V3(q,_):q;class g9{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#q=[];#_;#Y;signal;maxDepth;includeChildMatches;constructor(q,_,j){if(this.patterns=q,this.path=_,this.opts=j,this.#Y=!j.posix&&j.platform==="win32"?"\\":"/",this.includeChildMatches=j.includeChildMatches!==!1,j.ignore||!this.includeChildMatches){if(this.#_=Bh(j.ignore??[],j),!this.includeChildMatches&&typeof this.#_.add!=="function")throw new Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=j.maxDepth||1/0,j.signal)this.signal=j.signal,this.signal.addEventListener("abort",()=>{this.#q.length=0})}#P(q){return this.seen.has(q)||!!this.#_?.ignored?.(q)}#f(q){return!!this.#_?.childrenIgnored?.(q)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let q=void 0;while(!this.paused&&(q=this.#q.shift()))q()}onResume(q){if(this.signal?.aborted)return;if(!this.paused)q();else this.#q.push(q)}async matchCheck(q,_){if(_&&this.opts.nodir)return;let j;if(this.opts.realpath){if(j=q.realpathCached()||await q.realpath(),!j)return;q=j}let Y=q.isUnknown()||this.opts.stat?await q.lstat():q;if(this.opts.follow&&this.opts.nodir&&Y?.isSymbolicLink()){let f=await Y.realpath();if(f&&(f.isUnknown()||this.opts.stat))await f.lstat()}return this.matchCheckTest(Y,_)}matchCheckTest(q,_){return q&&(this.maxDepth===1/0||q.depth()<=this.maxDepth)&&(!_||q.canReaddir())&&(!this.opts.nodir||!q.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!q.isSymbolicLink()||!q.realpathCached()?.isDirectory())&&!this.#P(q)?q:void 0}matchCheckSync(q,_){if(_&&this.opts.nodir)return;let j;if(this.opts.realpath){if(j=q.realpathCached()||q.realpathSync(),!j)return;q=j}let Y=q.isUnknown()||this.opts.stat?q.lstatSync():q;if(this.opts.follow&&this.opts.nodir&&Y?.isSymbolicLink()){let f=Y.realpathSync();if(f&&(f?.isUnknown()||this.opts.stat))f.lstatSync()}return this.matchCheckTest(Y,_)}matchFinish(q,_){if(this.#P(q))return;if(!this.includeChildMatches&&this.#_?.add){let Y=`${q.relativePosix()}/**`;this.#_.add(Y)}let j=this.opts.absolute===void 0?_:this.opts.absolute;this.seen.add(q);let K=this.opts.mark&&q.isDirectory()?this.#Y:"";if(this.opts.withFileTypes)this.matchEmit(q);else if(j){let Y=this.opts.posix?q.fullpathPosix():q.fullpath();this.matchEmit(Y+K)}else{let Y=this.opts.posix?q.relativePosix():q.relative(),f=this.opts.dotRelative&&!Y.startsWith(".."+this.#Y)?"."+this.#Y:"";this.matchEmit(!Y?"."+K:f+Y+K)}}async match(q,_,j){let K=await this.matchCheck(q,j);if(K)this.matchFinish(K,_)}matchSync(q,_,j){let K=this.matchCheckSync(q,j);if(K)this.matchFinish(K,_)}walkCB(q,_,j){if(this.signal?.aborted)j();this.walkCB2(q,_,new M3(this.opts),j)}walkCB2(q,_,j,K){if(this.#f(q))return K();if(this.signal?.aborted)K();if(this.paused){this.onResume(()=>this.walkCB2(q,_,j,K));return}j.processPatterns(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,O]of j.matches.entries()){if(this.#P(P))continue;Y++,this.match(P,$,O).then(()=>f())}for(let P of j.subwalkTargets()){if(this.maxDepth!==1/0&&P.depth()>=this.maxDepth)continue;Y++;let $=P.readdirCached();if(P.calledReaddir())this.walkCB3(P,$,j,f);else P.readdirCB((O,w)=>this.walkCB3(P,w,j,f),!0)}f()}walkCB3(q,_,j,K){j=j.filterEntries(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,O]of j.matches.entries()){if(this.#P(P))continue;Y++,this.match(P,$,O).then(()=>f())}for(let[P,$]of j.subwalks.entries())Y++,this.walkCB2(P,$,j.child(),f);f()}walkCBSync(q,_,j){if(this.signal?.aborted)j();this.walkCB2Sync(q,_,new M3(this.opts),j)}walkCB2Sync(q,_,j,K){if(this.#f(q))return K();if(this.signal?.aborted)K();if(this.paused){this.onResume(()=>this.walkCB2Sync(q,_,j,K));return}j.processPatterns(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,O]of j.matches.entries()){if(this.#P(P))continue;this.matchSync(P,$,O)}for(let P of j.subwalkTargets()){if(this.maxDepth!==1/0&&P.depth()>=this.maxDepth)continue;Y++;let $=P.readdirSync();this.walkCB3Sync(P,$,j,f)}f()}walkCB3Sync(q,_,j,K){j=j.filterEntries(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,O]of j.matches.entries()){if(this.#P(P))continue;this.matchSync(P,$,O)}for(let[P,$]of j.subwalks.entries())Y++,this.walkCB2Sync(P,$,j.child(),f);f()}}class p7 extends g9{matches=new Set;constructor(q,_,j){super(q,_,j)}matchEmit(q){this.matches.add(q)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((q,_)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)_(this.signal.reason);else q(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class L7 extends g9{results;constructor(q,_,j){super(q,_,j);this.results=new V_({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(q){if(this.results.write(q),!this.results.flowing)this.pause()}stream(){let q=this.path;if(q.isUnknown())q.lstat().then(()=>{this.walkCB(q,this.patterns,()=>this.results.end())});else this.walkCB(q,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var eh=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Mq{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(q,_){if(!_)throw new TypeError("glob options required");if(this.withFileTypes=!!_.withFileTypes,this.signal=_.signal,this.follow=!!_.follow,this.dot=!!_.dot,this.dotRelative=!!_.dotRelative,this.nodir=!!_.nodir,this.mark=!!_.mark,!_.cwd)this.cwd="";else if(_.cwd instanceof URL||_.cwd.startsWith("file://"))_.cwd=th(_.cwd);if(this.cwd=_.cwd||"",this.root=_.root,this.magicalBraces=!!_.magicalBraces,this.nobrace=!!_.nobrace,this.noext=!!_.noext,this.realpath=!!_.realpath,this.absolute=_.absolute,this.includeChildMatches=_.includeChildMatches!==!1,this.noglobstar=!!_.noglobstar,this.matchBase=!!_.matchBase,this.maxDepth=typeof _.maxDepth==="number"?_.maxDepth:1/0,this.stat=!!_.stat,this.ignore=_.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof q==="string")q=[q];if(this.windowsPathsNoEscape=!!_.windowsPathsNoEscape||_.allowWindowsEscape===!1,this.windowsPathsNoEscape)q=q.map(($)=>$.replace(/\\/g,"/"));if(this.matchBase){if(_.noglobstar)throw new TypeError("base matching requires globstar");q=q.map(($)=>$.includes("/")?$:`./**/${$}`)}if(this.pattern=q,this.platform=_.platform||eh,this.opts={..._,platform:this.platform},_.scurry){if(this.scurry=_.scurry,_.nocase!==void 0&&_.nocase!==_.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let $=_.platform==="win32"?D3:_.platform==="darwin"?d7:_.platform?C3:z$;this.scurry=new $(this.cwd,{nocase:_.nocase,fs:_.fs})}this.nocase=this.scurry.nocase;let j=this.platform==="darwin"||this.platform==="win32",K={..._,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:j,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},Y=this.pattern.map(($)=>new _q($,K)),[f,P]=Y.reduce(($,O)=>{return $[0].push(...O.set),$[1].push(...O.globParts),$},[[],[]]);this.patterns=f.map(($,O)=>{let w=P[O];if(!w)throw new Error("invalid pattern object");return new GK($,w,0,this.platform)})}async walk(){return[...await new p7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new p7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new L7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new L7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}var y9=(q,_={})=>{if(!Array.isArray(q))q=[q];for(let j of q)if(new _q(j,_).hasMagic())return!0;return!1};function x7(q,_={}){return new Mq(q,_).streamSync()}function T$(q,_={}){return new Mq(q,_).stream()}function Z$(q,_={}){return new Mq(q,_).walkSync()}async function H$(q,_={}){return new Mq(q,_).walk()}function n7(q,_={}){return new Mq(q,_).iterateSync()}function k$(q,_={}){return new Mq(q,_).iterate()}var Fh=x7,Uh=Object.assign(T$,{sync:x7}),sh=n7,Qh=Object.assign(k$,{sync:n7}),qD=Object.assign(Z$,{stream:x7,iterate:n7}),l7=Object.assign(H$,{glob:H$,globSync:Z$,sync:qD,globStream:T$,stream:Uh,globStreamSync:x7,streamSync:Fh,globIterate:k$,iterate:Qh,globIterateSync:n7,iterateSync:sh,Glob:Mq,hasMagic:y9,escape:ZK,unescape:Tq});l7.glob=l7;p6();async function A$(q,_={}){let j=P8.getInstance().getTrashDirectory();if(!X$(j))KD(j,{recursive:!0});let K=Array.isArray(q)?q:[q];for(let Y of K){let f=await l7(Y),P=f.length>0?f:[Y];for(let $ of P)try{if(!X$($)){if(!_.force){console.error(`trash: ${$}: No such file or directory`);continue}continue}if(jD($).isDirectory()&&!_.recursive){if(!_.force){console.error(`trash: ${$}: is a directory`);continue}}let w=YD($),v=Date.now(),z=PD(j,`${w}.${v}`);_D($,z),console.log(`Moved ${w} to trash`)}catch(O){if(!_.force){let w=O instanceof Error?O.message:String(O);console.error(`trash: ${$}: ${w}`)}}}}sq();p6();import{readdirSync as fD,renameSync as $D}from"fs";import{join as G$}from"path";async function u$(){let q=P8.getInstance().getTrashDirectory(),_=fD(q);if(_.length===0){console.log("Trash is empty");return}let j=await X6({message:"Select file to restore:",options:_.map((K)=>({value:K,label:K}))});if(t8(j))return;$D(G$(q,j),G$(process.cwd(),j)),console.log(`Restored ${j}`)}p6();import{appendFileSync as wD}from"fs";function OD(q){let j=q.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter((f)=>f.length>2).slice(0,4).join("-"),K=j.length>30?j.substring(0,27)+"...":j,Y=new Date().toISOString().substring(11,19).replace(/:/g,"");return`${K}-${Y}`}async function h$(q,_={}){if(!q||q.trim()==="")console.error("Error: Message is required"),process.exit(1);let j=P8.getInstance(),K=new Date().toISOString(),Y=P8.getCurrentProjectName(),f=OD(q),P=`${Y}_${f}_overview`,$=j.getIndexPath(),O={type:"overview",content:q,session_id:f,project:Y,timestamp:K};j.ensureDirectory(j.getDataDirectory()),wD($,JSON.stringify(O)+`
419
- `,"utf8"),console.log(JSON.stringify({success:!0,document_id:P,session_id:f,project:Y,timestamp:K,suppressOutput:!0}))}sq();var v6={red:"#FF073A",pink:"#FF1053",blue:"#0077FF",green:"#00FF88",yellow:"#FFD700",purple:"#9B59B6"},D$=["\uD83C\uDFB5","\uD83C\uDFB6","\uD83C\uDFBC","\uD83C\uDFA4","\uD83C\uDFA7","\uD83D\uDD0A"],uK=["\uD83D\uDC8E","\uD83C\uDF52","\uD83C\uDF4B","\uD83D\uDD14","⭐","7️⃣","\uD83C\uDFB0","\uD83D\uDCB0"];async function M$(){J7(M6(v6.pink,v6.blue)("\uD83C\uDFB0 WELCOME TO VEGAS CASINO MEMORY GAMBLING \uD83C\uDFB0")),console.log(I.yellow("✨ Where memory compression meets Las Vegas excitement! ✨")),console.log(I.gray(`What happens in ~/.claude-mem, stays in ~/.claude-mem!
420
- `));let q=await vD();zD();let _=!0;while(_){let j=await X6({message:`\uD83D\uDCB0 ${q.name}, you have ${q.chips} chips. Choose your game:`,options:[{value:"slots",label:"\uD83C\uDFB0 Compression Slots - Match 3 memory patterns to win!"},{value:"blackjack",label:"\uD83C\uDCCF Memory Blackjack - Get close to 2.1MB without going over!"},{value:"poker",label:"\uD83C\uDFAD Vector Poker - Best semantic hand wins!"},{value:"roulette",label:"\uD83C\uDFB2 Trash Roulette - Bet on which memories get deleted!"},{value:"vip",label:"\uD83D\uDC51 VIP High-Stakes Room"},{value:"stats",label:"\uD83D\uDCCA View Casino Stats"},{value:"exit",label:"\uD83D\uDEAA Cash Out and Leave"}]});if(j==="exit"){_=!1;continue}switch(j){case"slots":await WD(q);break;case"blackjack":await JD(q);break;case"poker":await HD(q);break;case"roulette":await TD(q);break;case"vip":await ZD(q);break;case"stats":await AD(q);break}if(q.chips<=0)console.log(I.red(`
421
- \uD83D\uDCB8 You're out of chips! Thanks for playing!`)),_=!1}Wq(M6(v6.yellow,v6.green)("\uD83C\uDF89 Thanks for gambling at the Memory Casino! \uD83C\uDF89"))}async function vD(){return{name:"High Roller",chips:1000,level:"Regular",wins:0,losses:0}}function zD(){console.log(I.magenta(`
422
- \uD83C\uDF1F ═══════════════════════════════════════════════════════════ \uD83C\uDF1F`)),console.log(M6(v6.red,v6.yellow)(" ██╗ ██╗███████╗ ██████╗ █████╗ ███████╗")),console.log(M6(v6.red,v6.yellow)(" ██║ ██║██╔════╝██╔════╝ ██╔══██╗██╔════╝")),console.log(M6(v6.red,v6.yellow)(" ██║ ██║█████╗ ██║ ███╗███████║███████╗")),console.log(M6(v6.red,v6.yellow)(" ╚██╗ ██╔╝██╔══╝ ██║ ██║██╔══██║╚════██║")),console.log(M6(v6.red,v6.yellow)(" ╚████╔╝ ███████╗╚██████╔╝██║ ██║███████║")),console.log(M6(v6.red,v6.yellow)(" ╚═══╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝")),console.log(I.cyan(" \uD83C\uDFB0 MEMORY CASINO \uD83C\uDFB0")),console.log(I.magenta("\uD83C\uDF1F ═══════════════════════════════════════════════════════════ \uD83C\uDF1F")),console.log(I.blue("\uD83C\uDF78 Complimentary memory refresher cocktails at the bar!")),console.log(I.green(`${D$[Math.floor(Math.random()*D$.length)]} Smooth jazz playing in the background...`)),console.log(I.yellow("\uD83D\uDCA8 Steam rising from hot compression algorithms!")),console.log(I.magenta(`✨ Neon function signs blinking everywhere!
423
- `))}async function WD(q){console.log(I.cyan(`
424
- \uD83C\uDFB0 Welcome to Compression Slots!`)),console.log(I.gray(`Match 3 symbols to compress your way to victory!
425
- `));let _=50;if(q.chips<_){console.log(I.red("\uD83D\uDCB8 Not enough chips to play slots!"));return}let j=Jq();j.start("\uD83C\uDFB0 Spinning the reels..."),await new Promise((P)=>setTimeout(P,2000));let K=uK[Math.floor(Math.random()*uK.length)],Y=uK[Math.floor(Math.random()*uK.length)],f=uK[Math.floor(Math.random()*uK.length)];if(j.stop(),console.log(I.yellow(`
426
- \uD83C\uDFB0 ${K} | ${Y} | ${f} \uD83C\uDFB0`)),K===Y&&Y===f){let P=_*10;q.chips+=P-_,q.wins++,console.log(I.green(`
427
- \uD83C\uDF89 JACKPOT! Three ${K}s! You win ${P} chips!`)),console.log(I.yellow("✨ Memory compression bonus activated! ✨"))}else if(K===Y||Y===f||K===f){let P=_*2;q.chips+=P-_,q.wins++,console.log(I.green(`
428
- \uD83C\uDF8A Two matching symbols! You win ${P} chips!`))}else q.chips-=_,q.losses++,console.log(I.red(`
429
- \uD83D\uDCB8 No match! You lose ${_} chips.`)),console.log(I.gray("Better luck next compression cycle!"))}async function JD(q){console.log(I.cyan(`
430
- \uD83C\uDCCF Welcome to Memory Blackjack!`)),console.log(I.gray(`Get as close to 2.1MB as possible without going over!
431
- `));let _=await N$(),j=2.1;console.log(I.yellow(`\uD83C\uDFAF Target: ${j}MB`)),console.log(I.blue(`\uD83D\uDCCA Current memory size: ${(_.totalSize/1024/1024).toFixed(2)}MB
432
- `));let K=100;if(q.chips<K){console.log(I.red("\uD83D\uDCB8 Not enough chips to play blackjack!"));return}let Y=Math.random()*3,f=Math.random()*3;console.log(I.green(`\uD83C\uDCCF Your memory size: ${Y.toFixed(2)}MB`));let P=!0;while(P&&Y<j)if(await X6({message:"Choose your action:",options:[{value:"hit",label:"\uD83D\uDCC8 Hit (add more memory)"},{value:"stay",label:"✋ Stay (keep current size)"}]})==="hit"){let O=Math.random()*0.8;if(Y+=O,console.log(I.blue(`\uD83D\uDCC8 +${O.toFixed(2)}MB | Total: ${Y.toFixed(2)}MB`)),Y>j){console.log(I.red("\uD83D\uDCA5 BUST! Over 2.1MB!")),q.chips-=K,q.losses++;return}}else P=!1;while(f<1.7)f+=Math.random()*0.5;if(console.log(I.yellow(`\uD83C\uDFAD Dealer total: ${f.toFixed(2)}MB`)),f>j||Y>f){let $=K*2;q.chips+=$-K,q.wins++,console.log(I.green(`\uD83C\uDF89 You win! Earned ${$} chips!`))}else if(Y===f)console.log(I.yellow("\uD83E\uDD1D Push! No chips lost."));else q.chips-=K,q.losses++,console.log(I.red(`\uD83D\uDCB8 Dealer wins! Lost ${K} chips.`))}async function HD(q){console.log(I.cyan(`
433
- \uD83C\uDFAD Welcome to Vector Poker!`)),console.log(I.gray(`Best semantic hand wins!
434
- `));let _=75;if(q.chips<_){console.log(I.red("\uD83D\uDCB8 Not enough chips to play poker!"));return}let j=C$(),K=C$();console.log(I.blue("\uD83C\uDCCF Your hand:")),j.forEach((P,$)=>{console.log(I.green(` ${$+1}. ${P}`))});let Y=V$(j),f=V$(K);if(console.log(I.yellow(`
435
- \uD83C\uDFAF Your semantic strength: ${Y}`)),console.log(I.blue(`
436
- \uD83C\uDFAD Dealer hand:`)),K.forEach((P,$)=>{console.log(I.red(` ${$+1}. ${P}`))}),console.log(I.yellow(`\uD83C\uDFAF Dealer semantic strength: ${f}`)),Y>f){let P=_*3;q.chips+=P-_,q.wins++,console.log(I.green(`\uD83C\uDF89 Your vectors win! Earned ${P} chips!`))}else if(Y===f)console.log(I.yellow("\uD83E\uDD1D Semantic tie! No chips lost."));else q.chips-=_,q.losses++,console.log(I.red(`\uD83D\uDCB8 Dealer's vectors win! Lost ${_} chips.`))}async function TD(q){console.log(I.cyan(`
437
- \uD83C\uDFB2 Welcome to Trash Roulette!`)),console.log(I.gray(`Bet on which memories get deleted!
438
- `));let _=60;if(q.chips<_){console.log(I.red("\uD83D\uDCB8 Not enough chips to play roulette!"));return}let j=await X6({message:"Place your bet:",options:[{value:"old",label:"\uD83D\uDDC2️ Old files (>30 days)"},{value:"large",label:"\uD83D\uDCCA Large files (>1MB)"},{value:"recent",label:"\uD83C\uDD95 Recent files (<7 days)"},{value:"compressed",label:"\uD83D\uDDDC️ Already compressed files"}]}),K=Jq();K.start("\uD83C\uDFB2 Spinning the deletion wheel..."),await new Promise((P)=>setTimeout(P,3000)),K.stop();let Y=["old","large","recent","compressed"],f=Y[Math.floor(Math.random()*Y.length)];if(console.log(I.yellow(`
439
- \uD83C\uDFB2 The wheel lands on: ${GD(f)}`)),f===j){let P=_*4;q.chips+=P-_,q.wins++,console.log(I.green(`\uD83C\uDF89 Correct prediction! You win ${P} chips!`)),console.log(I.yellow("\uD83D\uDDD1️ Memory cleanup bonus activated!"))}else q.chips-=_,q.losses++,console.log(I.red(`\uD83D\uDCB8 Wrong prediction! Lost ${_} chips.`)),console.log(I.gray("\uD83D\uDD04 The memory roulette wheel is unpredictable!"))}async function ZD(q){if(q.chips<500){console.log(I.red(`
440
- \uD83D\uDEAB VIP Room requires 500+ chips!`)),console.log(I.yellow("\uD83D\uDCB0 Keep gambling to reach VIP status!"));return}switch(console.log(I.magenta(`
441
- \uD83D\uDC51 Welcome to the VIP High-Stakes Room!`)),console.log(I.yellow(`✨ Where compression legends are made! ✨
442
- `)),await X6({message:"Choose your high-stakes game:",options:[{value:"jackpot",label:"\uD83D\uDC8E Memory Compression Jackpot (500 chips)"},{value:"tournament",label:"\uD83C\uDFC6 Vector Tournament (300 chips)"},{value:"leave",label:"\uD83D\uDEAA Return to main floor"}]})){case"jackpot":await kD(q);break;case"tournament":await XD(q);break}}async function kD(q){if(q.chips<500){console.log(I.red("\uD83D\uDCB8 Not enough chips for the jackpot!"));return}console.log(I.magenta(`
443
- \uD83D\uDC8E COMPRESSION JACKPOT ROUND!`));let j=Jq();j.start("\uD83D\uDC8E Compressing the ultimate memory sequence..."),await new Promise((Y)=>setTimeout(Y,4000)),j.stop();let K=Math.random();if(K<0.1)q.chips+=9500,q.wins++,console.log(M6(v6.red,v6.yellow)(`
444
- \uD83C\uDF86 MASSIVE JACKPOT! ${1e4} CHIPS! \uD83C\uDF86`)),console.log(I.yellow("\uD83C\uDFC6 You are now a Memory Compression Legend!")),q.level="Legend";else if(K<0.3)q.chips+=2000,q.wins++,console.log(I.green(`\uD83C\uDF89 Big win! ${2500} chips!`));else q.chips-=500,q.losses++,console.log(I.red(`\uD83D\uDCB8 No jackpot this time! Lost ${500} chips.`))}async function XD(q){console.log(I.cyan(`
445
- \uD83C\uDFC6 Vector Tournament - Battle of the Semantics!`));let _=300;if(q.chips<_){console.log(I.red("\uD83D\uDCB8 Not enough chips for the tournament!"));return}q.chips-=_;let j=Math.floor(Math.random()*8)+1;if(j===1){let K=_*6;q.chips+=K,q.wins++,console.log(I.yellow(`\uD83E\uDD47 FIRST PLACE! You win ${K} chips!`))}else if(j<=3){let K=_*2;q.chips+=K,q.wins++,console.log(I.gray(`\uD83E\uDD48 Top 3 finish! You win ${K} chips!`))}else q.losses++,console.log(I.red(`\uD83D\uDCCA Finished ${j}th place. Better luck next tournament!`))}async function AD(q){console.log(I.cyan(`
446
- \uD83D\uDCCA Casino Statistics`)),console.log(I.green(`\uD83D\uDCB0 Current chips: ${q.chips}`)),console.log(I.blue(`\uD83C\uDFC6 Wins: ${q.wins}`)),console.log(I.red(`\uD83D\uDCB8 Losses: ${q.losses}`)),console.log(I.yellow(`⭐ Level: ${q.level}`));let _=await N$();console.log(I.magenta(`
447
- \uD83D\uDCC1 Memory System Stats:`)),console.log(I.green(`\uD83D\uDCC4 Total files: ${_.totalFiles}`)),console.log(I.blue(`\uD83D\uDCBE Total size: ${(_.totalSize/1024/1024).toFixed(2)}MB`)),console.log(I.yellow(`\uD83D\uDDDC️ Compression ratio: ${_.compressionRatio.toFixed(2)}%`))}function C$(){let q=["vector_embedding","neural_pathway","context_window","token_limit","semantic_similarity","attention_head","transformer_layer","gradient_flow"];return Array.from({length:5},()=>q[Math.floor(Math.random()*q.length)])}function V$(q){return q.reduce((_,j)=>_+j.length+Math.random()*10,0)}function GD(q){return{old:"\uD83D\uDDC2️ Old files",large:"\uD83D\uDCCA Large files",recent:"\uD83C\uDD95 Recent files",compressed:"\uD83D\uDDDC️ Compressed files"}[q]||q}async function N$(){return{totalFiles:Math.floor(Math.random()*100)+50,totalSize:Math.floor(Math.random()*50*1024*1024),compressionRatio:Math.random()*30+70,oldestFile:new Date(Date.now()-Math.random()*30*24*60*60*1000),newestFile:new Date}}sq();import nq from"path";import cq from"fs";import S$ from"os";j7();function c7(q){if(q<1024)return`${q}B`;if(q<1048576)return`${(q/1024).toFixed(1)}KB`;return`${(q/1048576).toFixed(1)}MB`}function uD(q){let j=new Date().getTime()-q.getTime(),K=Math.floor(j/60000),Y=Math.floor(j/3600000),f=Math.floor(j/86400000);if(K<1)return"just now";if(K<60)return`${K}m ago`;if(Y<24)return`${Y}h ago`;if(f<7)return`${f}d ago`;if(f<30)return`${Math.floor(f/7)}w ago`;if(f<365)return`${Math.floor(f/30)}mo ago`;return`${Math.floor(f/365)}y ago`}function hD(q,_){try{let Y=new Date(q);if(!isNaN(Y.getTime()))return Y}catch{}let j=_.match(/(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})/);if(j){let[Y,f,P,$,O,w,v]=j;return new Date(parseInt(f),parseInt(P)-1,parseInt($),parseInt(O),parseInt(w),parseInt(v))}return cq.statSync(_).mtime}async function DD(){let q=new Set,_=nq.join(S$.homedir(),".claude-mem","claude-mem-index.jsonl");if(!cq.existsSync(_))return q;let K=cq.readFileSync(_,"utf-8").trim().split(`
448
- `).filter(Boolean);for(let Y of K)try{let f=JSON.parse(Y);if(f.session_id)q.add(f.session_id);else if(f.sessionId)q.add(f.sessionId)}catch{}return q}async function CD(){let q=nq.join(S$.homedir(),".claude","projects");if(!cq.existsSync(q))return{conversations:[],skippedCount:0};let _=cq.readdirSync(q).filter((f)=>cq.statSync(nq.join(q,f)).isDirectory()),j=[],K=await DD(),Y=0;for(let f of _){let P=nq.join(q,f),$=cq.readdirSync(P).filter((O)=>O.endsWith(".jsonl")).map((O)=>nq.join(P,O));for(let O of $)try{let v=cq.readFileSync(O,"utf-8").trim().split(`
449
- `).filter(Boolean),z=JSON.parse(v[0]),W=v.length,J=cq.statSync(O),Z=J.size,H={sessionId:z.sessionId||nq.basename(O,".jsonl"),timestamp:z.timestamp||J.mtime.toISOString(),messageCount:W,branch:z.branch,cwd:z.cwd||P,fileSize:Z};if(K.has(H.sessionId)){Y++;continue}let X=nq.basename(nq.dirname(O)),A=hD(H.timestamp,O),G=uD(A);j.push({filePath:O,...H,projectName:X,parsedDate:A,relativeDate:G})}catch{}}return{conversations:j,skippedCount:Y}}async function E$(q={}){console.clear(),J7(I.bgCyan.black(" CLAUDE-MEM IMPORT "));let _=Jq();_.start("Scanning conversation history");let{conversations:j,skippedCount:K}=await CD();if(j.length===0){_.stop("No new conversations found");let O=K>0?`All ${K} conversation${K===1?" is":"s are"} already imported.`:"No conversations found.";Wq(I.yellow(O));return}j.sort((O,w)=>w.parsedDate.getTime()-O.parsedDate.getTime());let Y=K>0?`Found ${j.length} new conversation${j.length===1?"":"s"} (${K} already imported)`:`Found ${j.length} new conversation${j.length===1?"":"s"}`;_.stop(Y);let f=j.reduce((O,w)=>{if(!O[w.projectName])O[w.projectName]=[];return O[w.projectName].push(w),O},{}),P=await X6({message:"How would you like to import?",options:[{value:"browse",label:"Browse by Project",hint:"Select project then conversations"},{value:"recent",label:"Recent Conversations",hint:"Import most recent across all projects"},{value:"all",label:"Import All",hint:`Import all ${j.length} conversations`},{value:"search",label:"Search",hint:"Search for specific conversations"}]});if(t8(P)){V6("Import cancelled");return}let $=[];if(P==="browse"){let O=Object.entries(f).sort((W,J)=>J[1][0].parsedDate.getTime()-W[1][0].parsedDate.getTime()).map(([W,J])=>({value:W,label:W,hint:`${J.length} conversation${J.length===1?"":"s"}, latest: ${J[0].relativeDate}`})),w=await X6({message:"Select a project",options:O});if(t8(w)){V6("Import cancelled");return}let v=f[w],z=v.map((W)=>({value:W.sessionId,label:`${W.relativeDate} • ${W.messageCount} messages • ${c7(W.fileSize)}`,hint:W.branch?`branch: ${W.branch}`:void 0}));if(q.multi){let W=await y2({message:`Select conversations from ${w} (Space to select, Enter to confirm)`,options:z,required:!1});if(t8(W)){V6("Import cancelled");return}let J=W;$=v.filter((Z)=>J.includes(Z.sessionId))}else{let W=!0,J=new Set;while(W&&v.length>J.size){let Z=v.filter((G)=>!J.has(G.sessionId));if(Z.length===0)break;let H=Z.map((G)=>({value:G.sessionId,label:`${G.relativeDate} • ${G.messageCount} messages • ${c7(G.fileSize)}`,hint:G.branch?`branch: ${G.branch}`:void 0})),X=await X6({message:`Select a conversation (${J.size}/${v.length} imported)`,options:[...H,{value:"done",label:"✅ Done importing",hint:"Exit import mode"}]});if(t8(X)||X==="done"){W=!1;break}let A=Z.find((G)=>G.sessionId===X);if(A)$=[A],await b$($,q.verbose),J.add(A.sessionId)}if(J.size>0)Wq(I.green(`✅ Imported ${J.size} conversation${J.size===1?"":"s"}`));else Wq(I.yellow("No conversations imported"));return}}else if(P==="recent"){let O=await X_({message:"How many recent conversations?",placeholder:"10",initialValue:"10",validate:(v)=>{let z=parseInt(v);if(isNaN(z)||z<1)return"Please enter a valid number";if(z>j.length)return`Only ${j.length} available`}});if(t8(O)){V6("Import cancelled");return}let w=parseInt(O);$=j.slice(0,w)}else if(P==="all"){let O=await zq({message:`Import all ${j.length} conversations?`});if(t8(O)||!O){V6("Import cancelled");return}$=j}else if(P==="search"){let O=await X_({message:"Search conversations (project name or session ID)",placeholder:"Enter search term"});if(t8(O)){V6("Import cancelled");return}let w=O.toLowerCase(),v=j.filter((Z)=>Z.projectName.toLowerCase().includes(w)||Z.sessionId.toLowerCase().includes(w)||Z.branch&&Z.branch.toLowerCase().includes(w));if(v.length===0){Wq(I.yellow("No matching conversations found"));return}let z=v.map((Z)=>({value:Z.sessionId,label:`${Z.projectName} • ${Z.relativeDate} • ${Z.messageCount} msgs`,hint:c7(Z.fileSize)})),W=await y2({message:`Found ${v.length} matches. Select to import:`,options:z,required:!1});if(t8(W)){V6("Import cancelled");return}let J=W;$=v.filter((Z)=>J.includes(Z.sessionId))}if($.length>0)await b$($,q.verbose),Wq(I.green(`✅ Successfully imported ${$.length} conversation${$.length===1?"":"s"}`));else Wq(I.yellow("No conversations selected for import"))}async function b$(q,_){let j=Jq();for(let K=0;K<q.length;K++){let Y=q[K],f=q.length>1?`[${K+1}/${q.length}] `:"";j.start(`${f}Importing ${Y.projectName} (${Y.relativeDate})`);try{let P=nq.basename(Y.cwd);if(await new OK().compress(Y.filePath,Y.sessionId,P),j.stop(`${f}Imported ${Y.projectName} (${Y.messageCount} messages)`),_)vY(`Session: ${Y.sessionId}
450
- Size: ${c7(Y.fileSize)}
451
- Branch: ${Y.branch||"main"}`,"Details")}catch(P){if(j.stop(`${f}Failed to import ${Y.projectName}`),_)console.error(I.red(`Error: ${P}`))}}}j7();class d9{options;applauseMeter=0;tomatoCount=0;constructor(q={}){this.options=q}displayCurtainRaise(){let q=`
452
- ${I.yellow("\uD83D\uDD6F️ \uD83D\uDD6F️ \uD83D\uDD6F️ GLOBE THEATRE \uD83D\uDD6F️ \uD83D\uDD6F️ \uD83D\uDD6F️")}
420
+ `))}L6();import{readFileSync as Wu,writeFileSync as CY,existsSync as Ju}from"fs";import{join as W3}from"path";async function VY(q={}){console.log("\uD83D\uDD04 Uninstalling Claude Memory System hooks...");let _=[];if(q.all)_.push({name:"User",path:P8.getInstance().getClaudeSettingsPath()}),_.push({name:"Project",path:W3(process.cwd(),".claude","settings.json")});else{let O=q.project,w=P8.getInstance();_.push({name:O?"Project":"User",path:O?W3(process.cwd(),".claude","settings.json"):w.getClaudeSettingsPath()})}let K=P8.getInstance().getHooksDirectory(),f=W3(K,"pre-compact.js"),Y=W3(K,"session-start.js"),P=W3(K,"session-end.js"),$=0;for(let O of _){if(!Ju(O.path)){console.log(`⏭️ No settings found at ${O.name} location`);continue}try{let w=Wu(O.path,"utf8"),v=JSON.parse(w);if(!v.hooks){console.log(`⏭️ No hooks configured in ${O.name} settings`);continue}let z=!1;if(v.hooks.PreCompact){let W=v.hooks.PreCompact.filter((H)=>!H.hooks?.some((Z)=>Z.command===f||Z.command?.includes("pre-compact.js")||Z.command?.includes("claude-mem")));if(W.length!==v.hooks.PreCompact.length)v.hooks.PreCompact=W.length?W:void 0,z=!0,console.log(`✅ Removed PreCompact hook from ${O.name} settings`)}if(v.hooks.SessionStart){let W=v.hooks.SessionStart.filter((H)=>!H.hooks?.some((Z)=>Z.command===Y||Z.command?.includes("session-start.js")||Z.command?.includes("claude-mem")));if(W.length!==v.hooks.SessionStart.length)v.hooks.SessionStart=W.length?W:void 0,z=!0,console.log(`✅ Removed SessionStart hook from ${O.name} settings`)}if(v.hooks.SessionEnd){let W=v.hooks.SessionEnd.filter((H)=>!H.hooks?.some((Z)=>Z.command===P||Z.command?.includes("session-end.js")||Z.command?.includes("claude-mem")));if(W.length!==v.hooks.SessionEnd.length)v.hooks.SessionEnd=W.length?W:void 0,z=!0,console.log(`✅ Removed SessionEnd hook from ${O.name} settings`)}if(v.hooks.PreCompact===void 0)delete v.hooks.PreCompact;if(v.hooks.SessionStart===void 0)delete v.hooks.SessionStart;if(v.hooks.SessionEnd===void 0)delete v.hooks.SessionEnd;if(!Object.keys(v.hooks).length)delete v.hooks;if(z){let W=O.path+".backup."+Date.now();CY(W,w),console.log(`\uD83D\uDCCB Created backup: ${W}`),CY(O.path,JSON.stringify(v,null,2)),$++,console.log(`✅ Updated ${O.name} settings: ${O.path}`)}else console.log(`ℹ️ No Claude Memory System hooks found in ${O.name} settings`)}catch(w){console.log(`⚠️ Could not process ${O.name} settings: ${w.message}`)}}if(console.log(""),$>0)console.log("✨ Uninstallation complete!"),console.log("The Claude Memory System hooks have been removed from your settings."),console.log(""),console.log("Note: Your compressed transcripts and archives are preserved."),console.log("To reinstall: claude-mem install");else console.log("ℹ️ No Claude Memory System hooks were found to remove.")}u9();D9();C9();import{renameSync as vD,existsSync as D$,mkdirSync as zD,statSync as WD}from"fs";import{join as JD,basename as HD}from"path";var V9=(q,_,j)=>{let K=q instanceof RegExp?SY(q,j):q,f=_ instanceof RegExp?SY(_,j):_,Y=K!==null&&f!=null&&Mu(K,f,j);return Y&&{start:Y[0],end:Y[1],pre:j.slice(0,Y[0]),body:j.slice(Y[0]+K.length,Y[1]),post:j.slice(Y[1]+f.length)}},SY=(q,_)=>{let j=_.match(q);return j?j[0]:null},Mu=(q,_,j)=>{let K,f,Y,P=void 0,$,O=j.indexOf(q),w=j.indexOf(_,O+1),v=O;if(O>=0&&w>0){if(q===_)return[O,w];K=[],Y=j.length;while(v>=0&&!$){if(v===O)K.push(v),O=j.indexOf(q,v+1);else if(K.length===1){let z=K.pop();if(z!==void 0)$=[z,w]}else{if(f=K.pop(),f!==void 0&&f<Y)Y=f,P=w;w=j.indexOf(_,v+1)}v=O<w&&O>=0?O:w}if(K.length&&P!==void 0)$=[Y,P]}return $};var EY="\x00SLASH"+Math.random()+"\x00",RY="\x00OPEN"+Math.random()+"\x00",N9="\x00CLOSE"+Math.random()+"\x00",mY="\x00COMMA"+Math.random()+"\x00",IY="\x00PERIOD"+Math.random()+"\x00",Nu=new RegExp(EY,"g"),bu=new RegExp(RY,"g"),Su=new RegExp(N9,"g"),Eu=new RegExp(mY,"g"),Ru=new RegExp(IY,"g"),mu=/\\\\/g,Iu=/\\{/g,gu=/\\}/g,yu=/\\,/g,du=/\\./g;function M9(q){return!isNaN(q)?parseInt(q,10):q.charCodeAt(0)}function pu(q){return q.replace(mu,EY).replace(Iu,RY).replace(gu,N9).replace(yu,mY).replace(du,IY)}function Lu(q){return q.replace(Nu,"\\").replace(bu,"{").replace(Su,"}").replace(Eu,",").replace(Ru,".")}function gY(q){if(!q)return[""];let _=[],j=V9("{","}",q);if(!j)return q.split(",");let{pre:K,body:f,post:Y}=j,P=K.split(",");P[P.length-1]+="{"+f+"}";let $=gY(Y);if(Y.length)P[P.length-1]+=$.shift(),P.push.apply(P,$);return _.push.apply(_,P),_}function yY(q){if(!q)return[];if(q.slice(0,2)==="{}")q="\\{\\}"+q.slice(2);return T3(pu(q),!0).map(Lu)}function lu(q){return"{"+q+"}"}function xu(q){return/^-?0\d/.test(q)}function nu(q,_){return q<=_}function cu(q,_){return q>=_}function T3(q,_){let j=[],K=V9("{","}",q);if(!K)return[q];let f=K.pre,Y=K.post.length?T3(K.post,!1):[""];if(/\$$/.test(K.pre))for(let P=0;P<Y.length;P++){let $=f+"{"+K.body+"}"+Y[P];j.push($)}else{let P=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(K.body),$=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(K.body),O=P||$,w=K.body.indexOf(",")>=0;if(!O&&!w){if(K.post.match(/,(?!,).*\}/))return q=K.pre+"{"+K.body+N9+K.post,T3(q);return[q]}let v;if(O)v=K.body.split(/\.\./);else if(v=gY(K.body),v.length===1&&v[0]!==void 0){if(v=T3(v[0],!1).map(lu),v.length===1)return Y.map((W)=>K.pre+v[0]+W)}let z;if(O&&v[0]!==void 0&&v[1]!==void 0){let W=M9(v[0]),H=M9(v[1]),Z=Math.max(v[0].length,v[1].length),J=v.length===3&&v[2]!==void 0?Math.abs(M9(v[2])):1,X=nu;if(H<W)J*=-1,X=cu;let G=v.some(xu);z=[];for(let D=W;X(D,H);D+=J){let V;if($){if(V=String.fromCharCode(D),V==="\\")V=""}else if(V=String(D),G){let m=Z-V.length;if(m>0){let S=new Array(m+1).join("0");if(D<0)V="-"+S+V.slice(1);else V=S+V}}z.push(V)}}else{z=[];for(let W=0;W<v.length;W++)z.push.apply(z,T3(v[W],!1))}for(let W=0;W<z.length;W++)for(let H=0;H<Y.length;H++){let Z=f+z[W]+Y[H];if(!_||O||Z)j.push(Z)}}return j}var Z3=(q)=>{if(typeof q!=="string")throw new TypeError("invalid pattern");if(q.length>65536)throw new TypeError("pattern is too long")};var ru={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},k3=(q)=>q.replace(/[[\]\\-]/g,"\\$&"),iu=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),dY=(q)=>q.join(""),pY=(q,_)=>{let j=_;if(q.charAt(j)!=="[")throw new Error("not in a brace expression");let K=[],f=[],Y=j+1,P=!1,$=!1,O=!1,w=!1,v=j,z="";q:while(Y<q.length){let J=q.charAt(Y);if((J==="!"||J==="^")&&Y===j+1){w=!0,Y++;continue}if(J==="]"&&P&&!O){v=Y+1;break}if(P=!0,J==="\\"){if(!O){O=!0,Y++;continue}}if(J==="["&&!O){for(let[X,[A,G,D]]of Object.entries(ru))if(q.startsWith(X,Y)){if(z)return["$.",!1,q.length-j,!0];if(Y+=X.length,D)f.push(A);else K.push(A);$=$||G;continue q}}if(O=!1,z){if(J>z)K.push(k3(z)+"-"+k3(J));else if(J===z)K.push(k3(J));z="",Y++;continue}if(q.startsWith("-]",Y+1)){K.push(k3(J+"-")),Y+=2;continue}if(q.startsWith("-",Y+1)){z=J,Y+=2;continue}K.push(k3(J)),Y++}if(v<Y)return["",!1,0,!1];if(!K.length&&!f.length)return["$.",!1,q.length-j,!0];if(f.length===0&&K.length===1&&/^\\?.$/.test(K[0])&&!w){let J=K[0].length===2?K[0].slice(-1):K[0];return[iu(J),!1,v-j,!1]}let W="["+(w?"^":"")+dY(K)+"]",H="["+(w?"":"^")+dY(f)+"]";return[K.length&&f.length?"("+W+"|"+H+")":K.length?W:H,$,v-j,!0]};var Zq=(q,{windowsPathsNoEscape:_=!1}={})=>{return _?q.replace(/\[([^\/\\])\]/g,"$1"):q.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")};var ou=new Set(["!","?","+","*","@"]),LY=(q)=>ou.has(q),au="(?!(?:^|/)\\.\\.?(?:$|/))",S7="(?!\\.)",Bu=new Set(["[","."]),tu=new Set(["..","."]),eu=new Set("().*{}+?[]^$\\!"),Fu=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),b9="[^/]",lY=b9+"*?",xY=b9+"+?";class Z6{type;#q;#_;#f=!1;#P=[];#Y;#G;#X;#v=!1;#$;#W;#z=!1;constructor(q,_,j={}){if(this.type=q,q)this.#_=!0;if(this.#Y=_,this.#q=this.#Y?this.#Y.#q:this,this.#$=this.#q===this?j:this.#q.#$,this.#X=this.#q===this?[]:this.#q.#X,q==="!"&&!this.#q.#v)this.#X.push(this);this.#G=this.#Y?this.#Y.#P.length:0}get hasMagic(){if(this.#_!==void 0)return this.#_;for(let q of this.#P){if(typeof q==="string")continue;if(q.type||q.hasMagic)return this.#_=!0}return this.#_}toString(){if(this.#W!==void 0)return this.#W;if(!this.type)return this.#W=this.#P.map((q)=>String(q)).join("");else return this.#W=this.type+"("+this.#P.map((q)=>String(q)).join("|")+")"}#w(){if(this!==this.#q)throw new Error("should only call on root");if(this.#v)return this;this.toString(),this.#v=!0;let q;while(q=this.#X.pop()){if(q.type!=="!")continue;let _=q,j=_.#Y;while(j){for(let K=_.#G+1;!j.type&&K<j.#P.length;K++)for(let f of q.#P){if(typeof f==="string")throw new Error("string part in extglob AST??");f.copyIn(j.#P[K])}_=j,j=_.#Y}}return this}push(...q){for(let _ of q){if(_==="")continue;if(typeof _!=="string"&&!(_ instanceof Z6&&_.#Y===this))throw new Error("invalid part: "+_);this.#P.push(_)}}toJSON(){let q=this.type===null?this.#P.slice().map((_)=>typeof _==="string"?_:_.toJSON()):[this.type,...this.#P.map((_)=>_.toJSON())];if(this.isStart()&&!this.type)q.unshift([]);if(this.isEnd()&&(this===this.#q||this.#q.#v&&this.#Y?.type==="!"))q.push({});return q}isStart(){if(this.#q===this)return!0;if(!this.#Y?.isStart())return!1;if(this.#G===0)return!0;let q=this.#Y;for(let _=0;_<this.#G;_++){let j=q.#P[_];if(!(j instanceof Z6&&j.type==="!"))return!1}return!0}isEnd(){if(this.#q===this)return!0;if(this.#Y?.type==="!")return!0;if(!this.#Y?.isEnd())return!1;if(!this.type)return this.#Y?.isEnd();let q=this.#Y?this.#Y.#P.length:0;return this.#G===q-1}copyIn(q){if(typeof q==="string")this.push(q);else this.push(q.clone(this))}clone(q){let _=new Z6(this.type,q);for(let j of this.#P)_.copyIn(j);return _}static#K(q,_,j,K){let f=!1,Y=!1,P=-1,$=!1;if(_.type===null){let W=j,H="";while(W<q.length){let Z=q.charAt(W++);if(f||Z==="\\"){f=!f,H+=Z;continue}if(Y){if(W===P+1){if(Z==="^"||Z==="!")$=!0}else if(Z==="]"&&!(W===P+2&&$))Y=!1;H+=Z;continue}else if(Z==="["){Y=!0,P=W,$=!1,H+=Z;continue}if(!K.noext&&LY(Z)&&q.charAt(W)==="("){_.push(H),H="";let J=new Z6(Z,_);W=Z6.#K(q,J,W,K),_.push(J);continue}H+=Z}return _.push(H),W}let O=j+1,w=new Z6(null,_),v=[],z="";while(O<q.length){let W=q.charAt(O++);if(f||W==="\\"){f=!f,z+=W;continue}if(Y){if(O===P+1){if(W==="^"||W==="!")$=!0}else if(W==="]"&&!(O===P+2&&$))Y=!1;z+=W;continue}else if(W==="["){Y=!0,P=O,$=!1,z+=W;continue}if(LY(W)&&q.charAt(O)==="("){w.push(z),z="";let H=new Z6(W,w);w.push(H),O=Z6.#K(q,H,O,K);continue}if(W==="|"){w.push(z),z="",v.push(w),w=new Z6(null,_);continue}if(W===")"){if(z===""&&_.#P.length===0)_.#z=!0;return w.push(z),z="",_.push(...v,w),O}z+=W}return _.type=null,_.#_=void 0,_.#P=[q.substring(j-1)],O}static fromGlob(q,_={}){let j=new Z6(null,void 0,_);return Z6.#K(q,j,0,_),j}toMMPattern(){if(this!==this.#q)return this.#q.toMMPattern();let q=this.toString(),[_,j,K,f]=this.toRegExpSource();if(!(K||this.#_||this.#$.nocase&&!this.#$.nocaseMagicOnly&&q.toUpperCase()!==q.toLowerCase()))return j;let P=(this.#$.nocase?"i":"")+(f?"u":"");return Object.assign(new RegExp(`^${_}$`,P),{_src:_,_glob:q})}get options(){return this.#$}toRegExpSource(q){let _=q??!!this.#$.dot;if(this.#q===this)this.#w();if(!this.type){let $=this.isStart()&&this.isEnd(),O=this.#P.map((W)=>{let[H,Z,J,X]=typeof W==="string"?Z6.#u(W,this.#_,$):W.toRegExpSource(q);return this.#_=this.#_||J,this.#f=this.#f||X,H}).join(""),w="";if(this.isStart()){if(typeof this.#P[0]==="string"){if(!(this.#P.length===1&&tu.has(this.#P[0]))){let H=Bu,Z=_&&H.has(O.charAt(0))||O.startsWith("\\.")&&H.has(O.charAt(2))||O.startsWith("\\.\\.")&&H.has(O.charAt(4)),J=!_&&!q&&H.has(O.charAt(0));w=Z?au:J?S7:""}}}let v="";if(this.isEnd()&&this.#q.#v&&this.#Y?.type==="!")v="(?:$|\\/)";return[w+O+v,Zq(O),this.#_=!!this.#_,this.#f]}let j=this.type==="*"||this.type==="+",K=this.type==="!"?"(?:(?!(?:":"(?:",f=this.#H(_);if(this.isStart()&&this.isEnd()&&!f&&this.type!=="!"){let $=this.toString();return this.#P=[$],this.type=null,this.#_=void 0,[$,Zq(this.toString()),!1,!1]}let Y=!j||q||_||!S7?"":this.#H(!0);if(Y===f)Y="";if(Y)f=`(?:${f})(?:${Y})*?`;let P="";if(this.type==="!"&&this.#z)P=(this.isStart()&&!_?S7:"")+xY;else{let $=this.type==="!"?"))"+(this.isStart()&&!_&&!q?S7:"")+lY+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&Y?")":this.type==="*"&&Y?")?":`)${this.type}`;P=K+f+$}return[P,Zq(f),this.#_=!!this.#_,this.#f]}#H(q){return this.#P.map((_)=>{if(typeof _==="string")throw new Error("string type in extglob ast??");let[j,K,f,Y]=_.toRegExpSource(q);return this.#f=this.#f||Y,j}).filter((_)=>!(this.isStart()&&this.isEnd())||!!_).join("|")}static#u(q,_,j=!1){let K=!1,f="",Y=!1;for(let P=0;P<q.length;P++){let $=q.charAt(P);if(K){K=!1,f+=(eu.has($)?"\\":"")+$;continue}if($==="\\"){if(P===q.length-1)f+="\\\\";else K=!0;continue}if($==="["){let[O,w,v,z]=pY(q,P);if(v){f+=O,Y=Y||w,P+=v-1,_=_||z;continue}}if($==="*"){if(j&&q==="*")f+=xY;else f+=lY;_=!0;continue}if($==="?"){f+=b9,_=!0;continue}f+=Fu($)}return[f,Zq(q),!!_,Y]}}var GK=(q,{windowsPathsNoEscape:_=!1}={})=>{return _?q.replace(/[?*()[\]]/g,"[$&]"):q.replace(/[?*()[\]\\]/g,"\\$&")};var b6=(q,_,j={})=>{if(Z3(_),!j.nocomment&&_.charAt(0)==="#")return!1;return new Pq(_,j).match(q)},Uu=/^\*+([^+@!?\*\[\(]*)$/,su=(q)=>(_)=>!_.startsWith(".")&&_.endsWith(q),Qu=(q)=>(_)=>_.endsWith(q),qh=(q)=>{return q=q.toLowerCase(),(_)=>!_.startsWith(".")&&_.toLowerCase().endsWith(q)},_h=(q)=>{return q=q.toLowerCase(),(_)=>_.toLowerCase().endsWith(q)},Kh=/^\*+\.\*+$/,jh=(q)=>!q.startsWith(".")&&q.includes("."),Ph=(q)=>q!=="."&&q!==".."&&q.includes("."),fh=/^\.\*+$/,Yh=(q)=>q!=="."&&q!==".."&&q.startsWith("."),$h=/^\*+$/,wh=(q)=>q.length!==0&&!q.startsWith("."),Oh=(q)=>q.length!==0&&q!=="."&&q!=="..",vh=/^\?+([^+@!?\*\[\(]*)?$/,zh=([q,_=""])=>{let j=rY([q]);if(!_)return j;return _=_.toLowerCase(),(K)=>j(K)&&K.toLowerCase().endsWith(_)},Wh=([q,_=""])=>{let j=iY([q]);if(!_)return j;return _=_.toLowerCase(),(K)=>j(K)&&K.toLowerCase().endsWith(_)},Jh=([q,_=""])=>{let j=iY([q]);return!_?j:(K)=>j(K)&&K.endsWith(_)},Hh=([q,_=""])=>{let j=rY([q]);return!_?j:(K)=>j(K)&&K.endsWith(_)},rY=([q])=>{let _=q.length;return(j)=>j.length===_&&!j.startsWith(".")},iY=([q])=>{let _=q.length;return(j)=>j.length===_&&j!=="."&&j!==".."},oY=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",nY={win32:{sep:"\\"},posix:{sep:"/"}},Th=oY==="win32"?nY.win32.sep:nY.posix.sep;b6.sep=Th;var k6=Symbol("globstar **");b6.GLOBSTAR=k6;var Zh="[^/]",kh=Zh+"*?",Xh="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Ah="(?:(?!(?:\\/|^)\\.).)*?",Gh=(q,_={})=>(j)=>b6(j,q,_);b6.filter=Gh;var jq=(q,_={})=>Object.assign({},q,_),uh=(q)=>{if(!q||typeof q!=="object"||!Object.keys(q).length)return b6;let _=b6;return Object.assign((K,f,Y={})=>_(K,f,jq(q,Y)),{Minimatch:class K extends _.Minimatch{constructor(f,Y={}){super(f,jq(q,Y))}static defaults(f){return _.defaults(jq(q,f)).Minimatch}},AST:class K extends _.AST{constructor(f,Y,P={}){super(f,Y,jq(q,P))}static fromGlob(f,Y={}){return _.AST.fromGlob(f,jq(q,Y))}},unescape:(K,f={})=>_.unescape(K,jq(q,f)),escape:(K,f={})=>_.escape(K,jq(q,f)),filter:(K,f={})=>_.filter(K,jq(q,f)),defaults:(K)=>_.defaults(jq(q,K)),makeRe:(K,f={})=>_.makeRe(K,jq(q,f)),braceExpand:(K,f={})=>_.braceExpand(K,jq(q,f)),match:(K,f,Y={})=>_.match(K,f,jq(q,Y)),sep:_.sep,GLOBSTAR:k6})};b6.defaults=uh;var aY=(q,_={})=>{if(Z3(q),_.nobrace||!/\{(?:(?!\{).)*\}/.test(q))return[q];return yY(q)};b6.braceExpand=aY;var hh=(q,_={})=>new Pq(q,_).makeRe();b6.makeRe=hh;var Dh=(q,_,j={})=>{let K=new Pq(_,j);if(q=q.filter((f)=>K.match(f)),K.options.nonull&&!q.length)q.push(_);return q};b6.match=Dh;var cY=/[?*]|[+@!]\(.*?\)|\[|\]/,Ch=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Pq{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(q,_={}){if(Z3(q),_=_||{},this.options=_,this.pattern=q,this.platform=_.platform||oY,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!_.windowsPathsNoEscape||_.allowWindowsEscape===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!_.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!_.nonegate,this.comment=!1,this.empty=!1,this.partial=!!_.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=_.windowsNoMagicRoot!==void 0?_.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let q of this.set)for(let _ of q)if(typeof _!=="string")return!0;return!1}debug(...q){}make(){let q=this.pattern,_=this.options;if(!_.nocomment&&q.charAt(0)==="#"){this.comment=!0;return}if(!q){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],_.debug)this.debug=(...f)=>console.error(...f);this.debug(this.pattern,this.globSet);let j=this.globSet.map((f)=>this.slashSplit(f));this.globParts=this.preprocess(j),this.debug(this.pattern,this.globParts);let K=this.globParts.map((f,Y,P)=>{if(this.isWindows&&this.windowsNoMagicRoot){let $=f[0]===""&&f[1]===""&&(f[2]==="?"||!cY.test(f[2]))&&!cY.test(f[3]),O=/^[a-z]:/i.test(f[0]);if($)return[...f.slice(0,4),...f.slice(4).map((w)=>this.parse(w))];else if(O)return[f[0],...f.slice(1).map((w)=>this.parse(w))]}return f.map(($)=>this.parse($))});if(this.debug(this.pattern,K),this.set=K.filter((f)=>f.indexOf(!1)===-1),this.isWindows)for(let f=0;f<this.set.length;f++){let Y=this.set[f];if(Y[0]===""&&Y[1]===""&&this.globParts[f][2]==="?"&&typeof Y[3]==="string"&&/^[a-z]:$/i.test(Y[3]))Y[2]="?"}this.debug(this.pattern,this.set)}preprocess(q){if(this.options.noglobstar){for(let j=0;j<q.length;j++)for(let K=0;K<q[j].length;K++)if(q[j][K]==="**")q[j][K]="*"}let{optimizationLevel:_=1}=this.options;if(_>=2)q=this.firstPhasePreProcess(q),q=this.secondPhasePreProcess(q);else if(_>=1)q=this.levelOneOptimize(q);else q=this.adjascentGlobstarOptimize(q);return q}adjascentGlobstarOptimize(q){return q.map((_)=>{let j=-1;while((j=_.indexOf("**",j+1))!==-1){let K=j;while(_[K+1]==="**")K++;if(K!==j)_.splice(j,K-j)}return _})}levelOneOptimize(q){return q.map((_)=>{return _=_.reduce((j,K)=>{let f=j[j.length-1];if(K==="**"&&f==="**")return j;if(K===".."){if(f&&f!==".."&&f!=="."&&f!=="**")return j.pop(),j}return j.push(K),j},[]),_.length===0?[""]:_})}levelTwoFileOptimize(q){if(!Array.isArray(q))q=this.slashSplit(q);let _=!1;do{if(_=!1,!this.preserveMultipleSlashes){for(let K=1;K<q.length-1;K++){let f=q[K];if(K===1&&f===""&&q[0]==="")continue;if(f==="."||f==="")_=!0,q.splice(K,1),K--}if(q[0]==="."&&q.length===2&&(q[1]==="."||q[1]===""))_=!0,q.pop()}let j=0;while((j=q.indexOf("..",j+1))!==-1){let K=q[j-1];if(K&&K!=="."&&K!==".."&&K!=="**")_=!0,q.splice(j-1,2),j-=2}}while(_);return q.length===0?[""]:q}firstPhasePreProcess(q){let _=!1;do{_=!1;for(let j of q){let K=-1;while((K=j.indexOf("**",K+1))!==-1){let Y=K;while(j[Y+1]==="**")Y++;if(Y>K)j.splice(K+1,Y-K);let P=j[K+1],$=j[K+2],O=j[K+3];if(P!=="..")continue;if(!$||$==="."||$===".."||!O||O==="."||O==="..")continue;_=!0,j.splice(K,1);let w=j.slice(0);w[K]="**",q.push(w),K--}if(!this.preserveMultipleSlashes){for(let Y=1;Y<j.length-1;Y++){let P=j[Y];if(Y===1&&P===""&&j[0]==="")continue;if(P==="."||P==="")_=!0,j.splice(Y,1),Y--}if(j[0]==="."&&j.length===2&&(j[1]==="."||j[1]===""))_=!0,j.pop()}let f=0;while((f=j.indexOf("..",f+1))!==-1){let Y=j[f-1];if(Y&&Y!=="."&&Y!==".."&&Y!=="**"){_=!0;let $=f===1&&j[f+1]==="**"?["."]:[];if(j.splice(f-1,2,...$),j.length===0)j.push("");f-=2}}}}while(_);return q}secondPhasePreProcess(q){for(let _=0;_<q.length-1;_++)for(let j=_+1;j<q.length;j++){let K=this.partsMatch(q[_],q[j],!this.preserveMultipleSlashes);if(K){q[_]=[],q[j]=K;break}}return q.filter((_)=>_.length)}partsMatch(q,_,j=!1){let K=0,f=0,Y=[],P="";while(K<q.length&&f<_.length)if(q[K]===_[f])Y.push(P==="b"?_[f]:q[K]),K++,f++;else if(j&&q[K]==="**"&&_[f]===q[K+1])Y.push(q[K]),K++;else if(j&&_[f]==="**"&&q[K]===_[f+1])Y.push(_[f]),f++;else if(q[K]==="*"&&_[f]&&(this.options.dot||!_[f].startsWith("."))&&_[f]!=="**"){if(P==="b")return!1;P="a",Y.push(q[K]),K++,f++}else if(_[f]==="*"&&q[K]&&(this.options.dot||!q[K].startsWith("."))&&q[K]!=="**"){if(P==="a")return!1;P="b",Y.push(_[f]),K++,f++}else return!1;return q.length===_.length&&Y}parseNegate(){if(this.nonegate)return;let q=this.pattern,_=!1,j=0;for(let K=0;K<q.length&&q.charAt(K)==="!";K++)_=!_,j++;if(j)this.pattern=q.slice(j);this.negate=_}matchOne(q,_,j=!1){let K=this.options;if(this.isWindows){let Z=typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0]),J=!Z&&q[0]===""&&q[1]===""&&q[2]==="?"&&/^[a-z]:$/i.test(q[3]),X=typeof _[0]==="string"&&/^[a-z]:$/i.test(_[0]),A=!X&&_[0]===""&&_[1]===""&&_[2]==="?"&&typeof _[3]==="string"&&/^[a-z]:$/i.test(_[3]),G=J?3:Z?0:void 0,D=A?3:X?0:void 0;if(typeof G==="number"&&typeof D==="number"){let[V,m]=[q[G],_[D]];if(V.toLowerCase()===m.toLowerCase()){if(_[D]=V,D>G)_=_.slice(D);else if(G>D)q=q.slice(G)}}}let{optimizationLevel:f=1}=this.options;if(f>=2)q=this.levelTwoFileOptimize(q);this.debug("matchOne",this,{file:q,pattern:_}),this.debug("matchOne",q.length,_.length);for(var Y=0,P=0,$=q.length,O=_.length;Y<$&&P<O;Y++,P++){this.debug("matchOne loop");var w=_[P],v=q[Y];if(this.debug(_,w,v),w===!1)return!1;if(w===k6){this.debug("GLOBSTAR",[_,w,v]);var z=Y,W=P+1;if(W===O){this.debug("** at the end");for(;Y<$;Y++)if(q[Y]==="."||q[Y]===".."||!K.dot&&q[Y].charAt(0)===".")return!1;return!0}while(z<$){var H=q[z];if(this.debug(`
421
+ globstar while`,q,z,_,W,H),this.matchOne(q.slice(z),_.slice(W),j))return this.debug("globstar found match!",z,$,H),!0;else{if(H==="."||H===".."||!K.dot&&H.charAt(0)==="."){this.debug("dot detected!",q,z,_,W);break}this.debug("globstar swallow a segment, and continue"),z++}}if(j){if(this.debug(`
422
+ >>> no match, partial?`,q,z,_,W),z===$)return!0}return!1}let Z;if(typeof w==="string")Z=v===w,this.debug("string match",w,v,Z);else Z=w.test(v),this.debug("pattern match",w,v,Z);if(!Z)return!1}if(Y===$&&P===O)return!0;else if(Y===$)return j;else if(P===O)return Y===$-1&&q[Y]==="";else throw new Error("wtf?")}braceExpand(){return aY(this.pattern,this.options)}parse(q){Z3(q);let _=this.options;if(q==="**")return k6;if(q==="")return"";let j,K=null;if(j=q.match($h))K=_.dot?Oh:wh;else if(j=q.match(Uu))K=(_.nocase?_.dot?_h:qh:_.dot?Qu:su)(j[1]);else if(j=q.match(vh))K=(_.nocase?_.dot?Wh:zh:_.dot?Jh:Hh)(j);else if(j=q.match(Kh))K=_.dot?Ph:jh;else if(j=q.match(fh))K=Yh;let f=Z6.fromGlob(q,this.options).toMMPattern();if(K&&typeof f==="object")Reflect.defineProperty(f,"test",{value:K});return f}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let q=this.set;if(!q.length)return this.regexp=!1,this.regexp;let _=this.options,j=_.noglobstar?kh:_.dot?Xh:Ah,K=new Set(_.nocase?["i"]:[]),f=q.map(($)=>{let O=$.map((w)=>{if(w instanceof RegExp)for(let v of w.flags.split(""))K.add(v);return typeof w==="string"?Ch(w):w===k6?k6:w._src});return O.forEach((w,v)=>{let z=O[v+1],W=O[v-1];if(w!==k6||W===k6)return;if(W===void 0)if(z!==void 0&&z!==k6)O[v+1]="(?:\\/|"+j+"\\/)?"+z;else O[v]=j;else if(z===void 0)O[v-1]=W+"(?:\\/|"+j+")?";else if(z!==k6)O[v-1]=W+"(?:\\/|\\/"+j+"\\/)"+z,O[v+1]=k6}),O.filter((w)=>w!==k6).join("/")}).join("|"),[Y,P]=q.length>1?["(?:",")"]:["",""];if(f="^"+Y+f+P+"$",this.negate)f="^(?!"+f+").+$";try{this.regexp=new RegExp(f,[...K].join(""))}catch($){this.regexp=!1}return this.regexp}slashSplit(q){if(this.preserveMultipleSlashes)return q.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(q))return["",...q.split(/\/+/)];else return q.split(/\/+/)}match(q,_=this.partial){if(this.debug("match",q,this.pattern),this.comment)return!1;if(this.empty)return q==="";if(q==="/"&&_)return!0;let j=this.options;if(this.isWindows)q=q.split("\\").join("/");let K=this.slashSplit(q);this.debug(this.pattern,"split",K);let f=this.set;this.debug(this.pattern,"set",f);let Y=K[K.length-1];if(!Y)for(let P=K.length-2;!Y&&P>=0;P--)Y=K[P];for(let P=0;P<f.length;P++){let $=f[P],O=K;if(j.matchBase&&$.length===1)O=[Y];if(this.matchOne(O,$,_)){if(j.flipNegate)return!0;return!this.negate}}if(j.flipNegate)return!1;return this.negate}static defaults(q){return b6.defaults(q).Minimatch}}b6.AST=Z6;b6.Minimatch=Pq;b6.escape=GK;b6.unescape=Zq;import{fileURLToPath as jD}from"node:url";var Vh=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,tY=new Set,S9=typeof process==="object"&&!!process?process:{},eY=(q,_,j,K)=>{typeof S9.emitWarning==="function"?S9.emitWarning(q,_,j,K):console.error(`[${j}] ${_}: ${q}`)},E7=globalThis.AbortController,BY=globalThis.AbortSignal;if(typeof E7==="undefined"){BY=class j{onabort;_onabort=[];reason;aborted=!1;addEventListener(K,f){this._onabort.push(f)}},E7=class j{constructor(){_()}signal=new BY;abort(K){if(this.signal.aborted)return;this.signal.reason=K,this.signal.aborted=!0;for(let f of this.signal._onabort)f(K);this.signal.onabort?.(K)}};let q=S9.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",_=()=>{if(!q)return;q=!1,eY("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",_)}}var Mh=(q)=>!tY.has(q),TN=Symbol("type"),K_=(q)=>q&&q===Math.floor(q)&&q>0&&isFinite(q),FY=(q)=>!K_(q)?null:q<=Math.pow(2,8)?Uint8Array:q<=Math.pow(2,16)?Uint16Array:q<=Math.pow(2,32)?Uint32Array:q<=Number.MAX_SAFE_INTEGER?X3:null;class X3 extends Array{constructor(q){super(q);this.fill(0)}}class uK{heap;length;static#q=!1;static create(q){let _=FY(q);if(!_)return[];uK.#q=!0;let j=new uK(q,_);return uK.#q=!1,j}constructor(q,_){if(!uK.#q)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new _(q),this.length=0}push(q){this.heap[this.length++]=q}pop(){return this.heap[--this.length]}}class A3{#q;#_;#f;#P;#Y;#G;#X;#v;get perf(){return this.#v}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#$;#W;#z;#w;#K;#H;#u;#A;#T;#b;#Z;#D;#M;#k;#h;#N;#J;#j;static unsafeExposeInternals(q){return{starts:q.#M,ttls:q.#k,sizes:q.#D,keyMap:q.#z,keyList:q.#w,valList:q.#K,next:q.#H,prev:q.#u,get head(){return q.#A},get tail(){return q.#T},free:q.#b,isBackgroundFetch:(_)=>q.#O(_),backgroundFetch:(_,j,K,f)=>q.#r(_,j,K,f),moveToTail:(_)=>q.#p(_),indexes:(_)=>q.#E(_),rindexes:(_)=>q.#m(_),isStale:(_)=>q.#V(_)}}get max(){return this.#q}get maxSize(){return this.#_}get calculatedSize(){return this.#W}get size(){return this.#$}get fetchMethod(){return this.#G}get memoMethod(){return this.#X}get dispose(){return this.#f}get onInsert(){return this.#P}get disposeAfter(){return this.#Y}constructor(q){let{max:_=0,ttl:j,ttlResolution:K=1,ttlAutopurge:f,updateAgeOnGet:Y,updateAgeOnHas:P,allowStale:$,dispose:O,onInsert:w,disposeAfter:v,noDisposeOnSet:z,noUpdateTTL:W,maxSize:H=0,maxEntrySize:Z=0,sizeCalculation:J,fetchMethod:X,memoMethod:A,noDeleteOnFetchRejection:G,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:V,allowStaleOnFetchAbort:m,ignoreFetchAbort:S,perf:b}=q;if(b!==void 0){if(typeof b?.now!=="function")throw new TypeError("perf option must have a now() method if specified")}if(this.#v=b??Vh,_!==0&&!K_(_))throw new TypeError("max option must be a nonnegative integer");let d=_?FY(_):Array;if(!d)throw new Error("invalid max value: "+_);if(this.#q=_,this.#_=H,this.maxEntrySize=Z||this.#_,this.sizeCalculation=J,this.sizeCalculation){if(!this.#_&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!=="function")throw new TypeError("memoMethod must be a function if defined");if(this.#X=A,X!==void 0&&typeof X!=="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#G=X,this.#N=!!X,this.#z=new Map,this.#w=new Array(_).fill(void 0),this.#K=new Array(_).fill(void 0),this.#H=new d(_),this.#u=new d(_),this.#A=0,this.#T=0,this.#b=uK.create(_),this.#$=0,this.#W=0,typeof O==="function")this.#f=O;if(typeof w==="function")this.#P=w;if(typeof v==="function")this.#Y=v,this.#Z=[];else this.#Y=void 0,this.#Z=void 0;if(this.#h=!!this.#f,this.#j=!!this.#P,this.#J=!!this.#Y,this.noDisposeOnSet=!!z,this.noUpdateTTL=!!W,this.noDeleteOnFetchRejection=!!G,this.allowStaleOnFetchRejection=!!V,this.allowStaleOnFetchAbort=!!m,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(this.#_!==0){if(!K_(this.#_))throw new TypeError("maxSize must be a positive integer if specified")}if(!K_(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L()}if(this.allowStale=!!$,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!Y,this.updateAgeOnHas=!!P,this.ttlResolution=K_(K)||K===0?K:1,this.ttlAutopurge=!!f,this.ttl=j||0,this.ttl){if(!K_(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#q===0&&this.ttl===0&&this.#_===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#q&&!this.#_){if(Mh("LRU_CACHE_UNBOUNDED"))tY.add("LRU_CACHE_UNBOUNDED"),eY("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",A3)}}getRemainingTTL(q){return this.#z.has(q)?1/0:0}#I(){let q=new X3(this.#q),_=new X3(this.#q);this.#k=q,this.#M=_,this.#n=(f,Y,P=this.#v.now())=>{if(_[f]=Y!==0?P:0,q[f]=Y,Y!==0&&this.ttlAutopurge){let $=setTimeout(()=>{if(this.#V(f))this.#R(this.#w[f],"expire")},Y+1);if($.unref)$.unref()}},this.#S=(f)=>{_[f]=q[f]!==0?this.#v.now():0},this.#C=(f,Y)=>{if(q[Y]){let P=q[Y],$=_[Y];if(!P||!$)return;f.ttl=P,f.start=$,f.now=j||K();let O=f.now-$;f.remainingTTL=P-O}};let j=0,K=()=>{let f=this.#v.now();if(this.ttlResolution>0){j=f;let Y=setTimeout(()=>j=0,this.ttlResolution);if(Y.unref)Y.unref()}return f};this.getRemainingTTL=(f)=>{let Y=this.#z.get(f);if(Y===void 0)return 0;let P=q[Y],$=_[Y];if(!P||!$)return 1/0;let O=(j||K())-$;return P-O},this.#V=(f)=>{let Y=_[f],P=q[f];return!!P&&!!Y&&(j||K())-Y>P}}#S=()=>{};#C=()=>{};#n=()=>{};#V=()=>!1;#L(){let q=new X3(this.#q);this.#W=0,this.#D=q,this.#g=(_)=>{this.#W-=q[_],q[_]=0},this.#y=(_,j,K,f)=>{if(this.#O(j))return 0;if(!K_(K))if(f){if(typeof f!=="function")throw new TypeError("sizeCalculation must be a function");if(K=f(j,_),!K_(K))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return K},this.#l=(_,j,K)=>{if(q[_]=j,this.#_){let f=this.#_-q[_];while(this.#W>f)this.#d(!0)}if(this.#W+=q[_],K)K.entrySize=j,K.totalCalculatedSize=this.#W}}#g=(q)=>{};#l=(q,_,j)=>{};#y=(q,_,j,K)=>{if(j||K)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:q=this.allowStale}={}){if(this.#$)for(let _=this.#T;;){if(!this.#c(_))break;if(q||!this.#V(_))yield _;if(_===this.#A)break;else _=this.#u[_]}}*#m({allowStale:q=this.allowStale}={}){if(this.#$)for(let _=this.#A;;){if(!this.#c(_))break;if(q||!this.#V(_))yield _;if(_===this.#T)break;else _=this.#H[_]}}#c(q){return q!==void 0&&this.#z.get(this.#w[q])===q}*entries(){for(let q of this.#E())if(this.#K[q]!==void 0&&this.#w[q]!==void 0&&!this.#O(this.#K[q]))yield[this.#w[q],this.#K[q]]}*rentries(){for(let q of this.#m())if(this.#K[q]!==void 0&&this.#w[q]!==void 0&&!this.#O(this.#K[q]))yield[this.#w[q],this.#K[q]]}*keys(){for(let q of this.#E()){let _=this.#w[q];if(_!==void 0&&!this.#O(this.#K[q]))yield _}}*rkeys(){for(let q of this.#m()){let _=this.#w[q];if(_!==void 0&&!this.#O(this.#K[q]))yield _}}*values(){for(let q of this.#E())if(this.#K[q]!==void 0&&!this.#O(this.#K[q]))yield this.#K[q]}*rvalues(){for(let q of this.#m())if(this.#K[q]!==void 0&&!this.#O(this.#K[q]))yield this.#K[q]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(q,_={}){for(let j of this.#E()){let K=this.#K[j],f=this.#O(K)?K.__staleWhileFetching:K;if(f===void 0)continue;if(q(f,this.#w[j],this))return this.get(this.#w[j],_)}}forEach(q,_=this){for(let j of this.#E()){let K=this.#K[j],f=this.#O(K)?K.__staleWhileFetching:K;if(f===void 0)continue;q.call(_,f,this.#w[j],this)}}rforEach(q,_=this){for(let j of this.#m()){let K=this.#K[j],f=this.#O(K)?K.__staleWhileFetching:K;if(f===void 0)continue;q.call(_,f,this.#w[j],this)}}purgeStale(){let q=!1;for(let _ of this.#m({allowStale:!0}))if(this.#V(_))this.#R(this.#w[_],"expire"),q=!0;return q}info(q){let _=this.#z.get(q);if(_===void 0)return;let j=this.#K[_],K=this.#O(j)?j.__staleWhileFetching:j;if(K===void 0)return;let f={value:K};if(this.#k&&this.#M){let Y=this.#k[_],P=this.#M[_];if(Y&&P){let $=Y-(this.#v.now()-P);f.ttl=$,f.start=Date.now()}}if(this.#D)f.size=this.#D[_];return f}dump(){let q=[];for(let _ of this.#E({allowStale:!0})){let j=this.#w[_],K=this.#K[_],f=this.#O(K)?K.__staleWhileFetching:K;if(f===void 0||j===void 0)continue;let Y={value:f};if(this.#k&&this.#M){Y.ttl=this.#k[_];let P=this.#v.now()-this.#M[_];Y.start=Math.floor(Date.now()-P)}if(this.#D)Y.size=this.#D[_];q.unshift([j,Y])}return q}load(q){this.clear();for(let[_,j]of q){if(j.start){let K=Date.now()-j.start;j.start=this.#v.now()-K}this.set(_,j.value,j)}}set(q,_,j={}){if(_===void 0)return this.delete(q),this;let{ttl:K=this.ttl,start:f,noDisposeOnSet:Y=this.noDisposeOnSet,sizeCalculation:P=this.sizeCalculation,status:$}=j,{noUpdateTTL:O=this.noUpdateTTL}=j,w=this.#y(q,_,j.size||0,P);if(this.maxEntrySize&&w>this.maxEntrySize){if($)$.set="miss",$.maxEntrySizeExceeded=!0;return this.#R(q,"set"),this}let v=this.#$===0?void 0:this.#z.get(q);if(v===void 0){if(v=this.#$===0?this.#T:this.#b.length!==0?this.#b.pop():this.#$===this.#q?this.#d(!1):this.#$,this.#w[v]=q,this.#K[v]=_,this.#z.set(q,v),this.#H[this.#T]=v,this.#u[v]=this.#T,this.#T=v,this.#$++,this.#l(v,w,$),$)$.set="add";if(O=!1,this.#j)this.#P?.(_,q,"add")}else{this.#p(v);let z=this.#K[v];if(_!==z){if(this.#N&&this.#O(z)){z.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:W}=z;if(W!==void 0&&!Y){if(this.#h)this.#f?.(W,q,"set");if(this.#J)this.#Z?.push([W,q,"set"])}}else if(!Y){if(this.#h)this.#f?.(z,q,"set");if(this.#J)this.#Z?.push([z,q,"set"])}if(this.#g(v),this.#l(v,w,$),this.#K[v]=_,$){$.set="replace";let W=z&&this.#O(z)?z.__staleWhileFetching:z;if(W!==void 0)$.oldValue=W}}else if($)$.set="update";if(this.#j)this.onInsert?.(_,q,_===z?"update":"replace")}if(K!==0&&!this.#k)this.#I();if(this.#k){if(!O)this.#n(v,K,f);if($)this.#C($,v)}if(!Y&&this.#J&&this.#Z){let z=this.#Z,W;while(W=z?.shift())this.#Y?.(...W)}return this}pop(){try{while(this.#$){let q=this.#K[this.#A];if(this.#d(!0),this.#O(q)){if(q.__staleWhileFetching)return q.__staleWhileFetching}else if(q!==void 0)return q}}finally{if(this.#J&&this.#Z){let q=this.#Z,_;while(_=q?.shift())this.#Y?.(..._)}}}#d(q){let _=this.#A,j=this.#w[_],K=this.#K[_];if(this.#N&&this.#O(K))K.__abortController.abort(new Error("evicted"));else if(this.#h||this.#J){if(this.#h)this.#f?.(K,j,"evict");if(this.#J)this.#Z?.push([K,j,"evict"])}if(this.#g(_),q)this.#w[_]=void 0,this.#K[_]=void 0,this.#b.push(_);if(this.#$===1)this.#A=this.#T=0,this.#b.length=0;else this.#A=this.#H[_];return this.#z.delete(j),this.#$--,_}has(q,_={}){let{updateAgeOnHas:j=this.updateAgeOnHas,status:K}=_,f=this.#z.get(q);if(f!==void 0){let Y=this.#K[f];if(this.#O(Y)&&Y.__staleWhileFetching===void 0)return!1;if(!this.#V(f)){if(j)this.#S(f);if(K)K.has="hit",this.#C(K,f);return!0}else if(K)K.has="stale",this.#C(K,f)}else if(K)K.has="miss";return!1}peek(q,_={}){let{allowStale:j=this.allowStale}=_,K=this.#z.get(q);if(K===void 0||!j&&this.#V(K))return;let f=this.#K[K];return this.#O(f)?f.__staleWhileFetching:f}#r(q,_,j,K){let f=_===void 0?void 0:this.#K[_];if(this.#O(f))return f;let Y=new E7,{signal:P}=j;P?.addEventListener("abort",()=>Y.abort(P.reason),{signal:Y.signal});let $={signal:Y.signal,options:j,context:K},O=(Z,J=!1)=>{let{aborted:X}=Y.signal,A=j.ignoreFetchAbort&&Z!==void 0;if(j.status)if(X&&!J){if(j.status.fetchAborted=!0,j.status.fetchError=Y.signal.reason,A)j.status.fetchAbortIgnored=!0}else j.status.fetchResolved=!0;if(X&&!A&&!J)return v(Y.signal.reason);let G=W;if(this.#K[_]===W)if(Z===void 0)if(G.__staleWhileFetching!==void 0)this.#K[_]=G.__staleWhileFetching;else this.#R(q,"fetch");else{if(j.status)j.status.fetchUpdated=!0;this.set(q,Z,$.options)}return Z},w=(Z)=>{if(j.status)j.status.fetchRejected=!0,j.status.fetchError=Z;return v(Z)},v=(Z)=>{let{aborted:J}=Y.signal,X=J&&j.allowStaleOnFetchAbort,A=X||j.allowStaleOnFetchRejection,G=A||j.noDeleteOnFetchRejection,D=W;if(this.#K[_]===W){if(!G||D.__staleWhileFetching===void 0)this.#R(q,"fetch");else if(!X)this.#K[_]=D.__staleWhileFetching}if(A){if(j.status&&D.__staleWhileFetching!==void 0)j.status.returnedStale=!0;return D.__staleWhileFetching}else if(D.__returned===D)throw Z},z=(Z,J)=>{let X=this.#G?.(q,f,$);if(X&&X instanceof Promise)X.then((A)=>Z(A===void 0?void 0:A),J);Y.signal.addEventListener("abort",()=>{if(!j.ignoreFetchAbort||j.allowStaleOnFetchAbort){if(Z(void 0),j.allowStaleOnFetchAbort)Z=(A)=>O(A,!0)}})};if(j.status)j.status.fetchDispatched=!0;let W=new Promise(z).then(O,w),H=Object.assign(W,{__abortController:Y,__staleWhileFetching:f,__returned:void 0});if(_===void 0)this.set(q,H,{...$.options,status:void 0}),_=this.#z.get(q);else this.#K[_]=H;return H}#O(q){if(!this.#N)return!1;let _=q;return!!_&&_ instanceof Promise&&_.hasOwnProperty("__staleWhileFetching")&&_.__abortController instanceof E7}async fetch(q,_={}){let{allowStale:j=this.allowStale,updateAgeOnGet:K=this.updateAgeOnGet,noDeleteOnStaleGet:f=this.noDeleteOnStaleGet,ttl:Y=this.ttl,noDisposeOnSet:P=this.noDisposeOnSet,size:$=0,sizeCalculation:O=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:z=this.allowStaleOnFetchRejection,ignoreFetchAbort:W=this.ignoreFetchAbort,allowStaleOnFetchAbort:H=this.allowStaleOnFetchAbort,context:Z,forceRefresh:J=!1,status:X,signal:A}=_;if(!this.#N){if(X)X.fetch="get";return this.get(q,{allowStale:j,updateAgeOnGet:K,noDeleteOnStaleGet:f,status:X})}let G={allowStale:j,updateAgeOnGet:K,noDeleteOnStaleGet:f,ttl:Y,noDisposeOnSet:P,size:$,sizeCalculation:O,noUpdateTTL:w,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:z,allowStaleOnFetchAbort:H,ignoreFetchAbort:W,status:X,signal:A},D=this.#z.get(q);if(D===void 0){if(X)X.fetch="miss";let V=this.#r(q,D,G,Z);return V.__returned=V}else{let V=this.#K[D];if(this.#O(V)){let p=j&&V.__staleWhileFetching!==void 0;if(X){if(X.fetch="inflight",p)X.returnedStale=!0}return p?V.__staleWhileFetching:V.__returned=V}let m=this.#V(D);if(!J&&!m){if(X)X.fetch="hit";if(this.#p(D),K)this.#S(D);if(X)this.#C(X,D);return V}let S=this.#r(q,D,G,Z),d=S.__staleWhileFetching!==void 0&&j;if(X){if(X.fetch=m?"stale":"refresh",d&&m)X.returnedStale=!0}return d?S.__staleWhileFetching:S.__returned=S}}async forceFetch(q,_={}){let j=await this.fetch(q,_);if(j===void 0)throw new Error("fetch() returned undefined");return j}memo(q,_={}){let j=this.#X;if(!j)throw new Error("no memoMethod provided to constructor");let{context:K,forceRefresh:f,...Y}=_,P=this.get(q,Y);if(!f&&P!==void 0)return P;let $=j(q,P,{options:Y,context:K});return this.set(q,$,Y),$}get(q,_={}){let{allowStale:j=this.allowStale,updateAgeOnGet:K=this.updateAgeOnGet,noDeleteOnStaleGet:f=this.noDeleteOnStaleGet,status:Y}=_,P=this.#z.get(q);if(P!==void 0){let $=this.#K[P],O=this.#O($);if(Y)this.#C(Y,P);if(this.#V(P)){if(Y)Y.get="stale";if(!O){if(!f)this.#R(q,"expire");if(Y&&j)Y.returnedStale=!0;return j?$:void 0}else{if(Y&&j&&$.__staleWhileFetching!==void 0)Y.returnedStale=!0;return j?$.__staleWhileFetching:void 0}}else{if(Y)Y.get="hit";if(O)return $.__staleWhileFetching;if(this.#p(P),K)this.#S(P);return $}}else if(Y)Y.get="miss"}#i(q,_){this.#u[_]=q,this.#H[q]=_}#p(q){if(q!==this.#T){if(q===this.#A)this.#A=this.#H[q];else this.#i(this.#u[q],this.#H[q]);this.#i(this.#T,q),this.#T=q}}delete(q){return this.#R(q,"delete")}#R(q,_){let j=!1;if(this.#$!==0){let K=this.#z.get(q);if(K!==void 0)if(j=!0,this.#$===1)this.#x(_);else{this.#g(K);let f=this.#K[K];if(this.#O(f))f.__abortController.abort(new Error("deleted"));else if(this.#h||this.#J){if(this.#h)this.#f?.(f,q,_);if(this.#J)this.#Z?.push([f,q,_])}if(this.#z.delete(q),this.#w[K]=void 0,this.#K[K]=void 0,K===this.#T)this.#T=this.#u[K];else if(K===this.#A)this.#A=this.#H[K];else{let Y=this.#u[K];this.#H[Y]=this.#H[K];let P=this.#H[K];this.#u[P]=this.#u[K]}this.#$--,this.#b.push(K)}}if(this.#J&&this.#Z?.length){let K=this.#Z,f;while(f=K?.shift())this.#Y?.(...f)}return j}clear(){return this.#x("delete")}#x(q){for(let _ of this.#m({allowStale:!0})){let j=this.#K[_];if(this.#O(j))j.__abortController.abort(new Error("deleted"));else{let K=this.#w[_];if(this.#h)this.#f?.(j,K,q);if(this.#J)this.#Z?.push([j,K,q])}}if(this.#z.clear(),this.#K.fill(void 0),this.#w.fill(void 0),this.#k&&this.#M)this.#k.fill(0),this.#M.fill(0);if(this.#D)this.#D.fill(0);if(this.#A=0,this.#T=0,this.#b.length=0,this.#W=0,this.#$=0,this.#J&&this.#Z){let _=this.#Z,j;while(j=_?.shift())this.#Y?.(...j)}}}import{posix as ph,win32 as l9}from"node:path";import{fileURLToPath as Lh}from"node:url";import{lstatSync as lh,readdir as xh,readdirSync as nh,readlinkSync as ch,realpathSync as rh}from"fs";import*as ih from"node:fs";import{lstat as ah,readdir as Bh,readlink as th,realpath as eh}from"node:fs/promises";import{EventEmitter as y9}from"node:events";import _$ from"node:stream";import{StringDecoder as Nh}from"node:string_decoder";var UY=typeof process==="object"&&process?process:{stdout:null,stderr:null},bh=(q)=>!!q&&typeof q==="object"&&(q instanceof N_||q instanceof _$||Sh(q)||Eh(q)),Sh=(q)=>!!q&&typeof q==="object"&&q instanceof y9&&typeof q.pipe==="function"&&q.pipe!==_$.Writable.prototype.pipe,Eh=(q)=>!!q&&typeof q==="object"&&q instanceof y9&&typeof q.write==="function"&&typeof q.end==="function",nq=Symbol("EOF"),cq=Symbol("maybeEmitEnd"),j_=Symbol("emittedEnd"),R7=Symbol("emittingEnd"),G3=Symbol("emittedError"),m7=Symbol("closed"),sY=Symbol("read"),I7=Symbol("flush"),QY=Symbol("flushChunk"),kq=Symbol("encoding"),hK=Symbol("decoder"),w6=Symbol("flowing"),u3=Symbol("paused"),DK=Symbol("resume"),O6=Symbol("buffer"),S6=Symbol("pipes"),v6=Symbol("bufferLength"),E9=Symbol("bufferPush"),g7=Symbol("bufferShift"),u6=Symbol("objectMode"),F8=Symbol("destroyed"),R9=Symbol("error"),m9=Symbol("emitData"),q$=Symbol("emitEnd"),I9=Symbol("emitEnd2"),Vq=Symbol("async"),g9=Symbol("abort"),y7=Symbol("aborted"),h3=Symbol("signal"),M_=Symbol("dataListeners"),o6=Symbol("discarded"),D3=(q)=>Promise.resolve().then(q),Rh=(q)=>q(),mh=(q)=>q==="end"||q==="finish"||q==="prefinish",Ih=(q)=>q instanceof ArrayBuffer||!!q&&typeof q==="object"&&q.constructor&&q.constructor.name==="ArrayBuffer"&&q.byteLength>=0,gh=(q)=>!Buffer.isBuffer(q)&&ArrayBuffer.isView(q);class d9{src;dest;opts;ondrain;constructor(q,_,j){this.src=q,this.dest=_,this.opts=j,this.ondrain=()=>q[DK](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class K$ extends d9{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(q,_,j){super(q,_,j);this.proxyErrors=(K)=>_.emit("error",K),q.on("error",this.proxyErrors)}}var yh=(q)=>!!q.objectMode,dh=(q)=>!q.objectMode&&!!q.encoding&&q.encoding!=="buffer";class N_ extends y9{[w6]=!1;[u3]=!1;[S6]=[];[O6]=[];[u6];[kq];[Vq];[hK];[nq]=!1;[j_]=!1;[R7]=!1;[m7]=!1;[G3]=null;[v6]=0;[F8]=!1;[h3];[y7]=!1;[M_]=0;[o6]=!1;writable=!0;readable=!0;constructor(...q){let _=q[0]||{};super();if(_.objectMode&&typeof _.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(yh(_))this[u6]=!0,this[kq]=null;else if(dh(_))this[kq]=_.encoding,this[u6]=!1;else this[u6]=!1,this[kq]=null;if(this[Vq]=!!_.async,this[hK]=this[kq]?new Nh(this[kq]):null,_&&_.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[O6]});if(_&&_.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[S6]});let{signal:j}=_;if(j)if(this[h3]=j,j.aborted)this[g9]();else j.addEventListener("abort",()=>this[g9]())}get bufferLength(){return this[v6]}get encoding(){return this[kq]}set encoding(q){throw new Error("Encoding must be set at instantiation time")}setEncoding(q){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[u6]}set objectMode(q){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[Vq]}set["async"](q){this[Vq]=this[Vq]||!!q}[g9](){this[y7]=!0,this.emit("abort",this[h3]?.reason),this.destroy(this[h3]?.reason)}get aborted(){return this[y7]}set aborted(q){}write(q,_,j){if(this[y7])return!1;if(this[nq])throw new Error("write after end");if(this[F8])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof _==="function")j=_,_="utf8";if(!_)_="utf8";let K=this[Vq]?D3:Rh;if(!this[u6]&&!Buffer.isBuffer(q)){if(gh(q))q=Buffer.from(q.buffer,q.byteOffset,q.byteLength);else if(Ih(q))q=Buffer.from(q);else if(typeof q!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[u6]){if(this[w6]&&this[v6]!==0)this[I7](!0);if(this[w6])this.emit("data",q);else this[E9](q);if(this[v6]!==0)this.emit("readable");if(j)K(j);return this[w6]}if(!q.length){if(this[v6]!==0)this.emit("readable");if(j)K(j);return this[w6]}if(typeof q==="string"&&!(_===this[kq]&&!this[hK]?.lastNeed))q=Buffer.from(q,_);if(Buffer.isBuffer(q)&&this[kq])q=this[hK].write(q);if(this[w6]&&this[v6]!==0)this[I7](!0);if(this[w6])this.emit("data",q);else this[E9](q);if(this[v6]!==0)this.emit("readable");if(j)K(j);return this[w6]}read(q){if(this[F8])return null;if(this[o6]=!1,this[v6]===0||q===0||q&&q>this[v6])return this[cq](),null;if(this[u6])q=null;if(this[O6].length>1&&!this[u6])this[O6]=[this[kq]?this[O6].join(""):Buffer.concat(this[O6],this[v6])];let _=this[sY](q||null,this[O6][0]);return this[cq](),_}[sY](q,_){if(this[u6])this[g7]();else{let j=_;if(q===j.length||q===null)this[g7]();else if(typeof j==="string")this[O6][0]=j.slice(q),_=j.slice(0,q),this[v6]-=q;else this[O6][0]=j.subarray(q),_=j.subarray(0,q),this[v6]-=q}if(this.emit("data",_),!this[O6].length&&!this[nq])this.emit("drain");return _}end(q,_,j){if(typeof q==="function")j=q,q=void 0;if(typeof _==="function")j=_,_="utf8";if(q!==void 0)this.write(q,_);if(j)this.once("end",j);if(this[nq]=!0,this.writable=!1,this[w6]||!this[u3])this[cq]();return this}[DK](){if(this[F8])return;if(!this[M_]&&!this[S6].length)this[o6]=!0;if(this[u3]=!1,this[w6]=!0,this.emit("resume"),this[O6].length)this[I7]();else if(this[nq])this[cq]();else this.emit("drain")}resume(){return this[DK]()}pause(){this[w6]=!1,this[u3]=!0,this[o6]=!1}get destroyed(){return this[F8]}get flowing(){return this[w6]}get paused(){return this[u3]}[E9](q){if(this[u6])this[v6]+=1;else this[v6]+=q.length;this[O6].push(q)}[g7](){if(this[u6])this[v6]-=1;else this[v6]-=this[O6][0].length;return this[O6].shift()}[I7](q=!1){do;while(this[QY](this[g7]())&&this[O6].length);if(!q&&!this[O6].length&&!this[nq])this.emit("drain")}[QY](q){return this.emit("data",q),this[w6]}pipe(q,_){if(this[F8])return q;this[o6]=!1;let j=this[j_];if(_=_||{},q===UY.stdout||q===UY.stderr)_.end=!1;else _.end=_.end!==!1;if(_.proxyErrors=!!_.proxyErrors,j){if(_.end)q.end()}else if(this[S6].push(!_.proxyErrors?new d9(this,q,_):new K$(this,q,_)),this[Vq])D3(()=>this[DK]());else this[DK]();return q}unpipe(q){let _=this[S6].find((j)=>j.dest===q);if(_){if(this[S6].length===1){if(this[w6]&&this[M_]===0)this[w6]=!1;this[S6]=[]}else this[S6].splice(this[S6].indexOf(_),1);_.unpipe()}}addListener(q,_){return this.on(q,_)}on(q,_){let j=super.on(q,_);if(q==="data"){if(this[o6]=!1,this[M_]++,!this[S6].length&&!this[w6])this[DK]()}else if(q==="readable"&&this[v6]!==0)super.emit("readable");else if(mh(q)&&this[j_])super.emit(q),this.removeAllListeners(q);else if(q==="error"&&this[G3]){let K=_;if(this[Vq])D3(()=>K.call(this,this[G3]));else K.call(this,this[G3])}return j}removeListener(q,_){return this.off(q,_)}off(q,_){let j=super.off(q,_);if(q==="data"){if(this[M_]=this.listeners("data").length,this[M_]===0&&!this[o6]&&!this[S6].length)this[w6]=!1}return j}removeAllListeners(q){let _=super.removeAllListeners(q);if(q==="data"||q===void 0){if(this[M_]=0,!this[o6]&&!this[S6].length)this[w6]=!1}return _}get emittedEnd(){return this[j_]}[cq](){if(!this[R7]&&!this[j_]&&!this[F8]&&this[O6].length===0&&this[nq]){if(this[R7]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[m7])this.emit("close");this[R7]=!1}}emit(q,..._){let j=_[0];if(q!=="error"&&q!=="close"&&q!==F8&&this[F8])return!1;else if(q==="data")return!this[u6]&&!j?!1:this[Vq]?(D3(()=>this[m9](j)),!0):this[m9](j);else if(q==="end")return this[q$]();else if(q==="close"){if(this[m7]=!0,!this[j_]&&!this[F8])return!1;let f=super.emit("close");return this.removeAllListeners("close"),f}else if(q==="error"){this[G3]=j,super.emit(R9,j);let f=!this[h3]||this.listeners("error").length?super.emit("error",j):!1;return this[cq](),f}else if(q==="resume"){let f=super.emit("resume");return this[cq](),f}else if(q==="finish"||q==="prefinish"){let f=super.emit(q);return this.removeAllListeners(q),f}let K=super.emit(q,..._);return this[cq](),K}[m9](q){for(let j of this[S6])if(j.dest.write(q)===!1)this.pause();let _=this[o6]?!1:super.emit("data",q);return this[cq](),_}[q$](){if(this[j_])return!1;return this[j_]=!0,this.readable=!1,this[Vq]?(D3(()=>this[I9]()),!0):this[I9]()}[I9](){if(this[hK]){let _=this[hK].end();if(_){for(let j of this[S6])j.dest.write(_);if(!this[o6])super.emit("data",_)}}for(let _ of this[S6])_.end();let q=super.emit("end");return this.removeAllListeners("end"),q}async collect(){let q=Object.assign([],{dataLength:0});if(!this[u6])q.dataLength=0;let _=this.promise();return this.on("data",(j)=>{if(q.push(j),!this[u6])q.dataLength+=j.length}),await _,q}async concat(){if(this[u6])throw new Error("cannot concat in objectMode");let q=await this.collect();return this[kq]?q.join(""):Buffer.concat(q,q.dataLength)}async promise(){return new Promise((q,_)=>{this.on(F8,()=>_(new Error("stream destroyed"))),this.on("error",(j)=>_(j)),this.on("end",()=>q())})}[Symbol.asyncIterator](){this[o6]=!1;let q=!1,_=async()=>{return this.pause(),q=!0,{value:void 0,done:!0}};return{next:()=>{if(q)return _();let K=this.read();if(K!==null)return Promise.resolve({done:!1,value:K});if(this[nq])return _();let f,Y,P=(v)=>{this.off("data",$),this.off("end",O),this.off(F8,w),_(),Y(v)},$=(v)=>{this.off("error",P),this.off("end",O),this.off(F8,w),this.pause(),f({value:v,done:!!this[nq]})},O=()=>{this.off("error",P),this.off("data",$),this.off(F8,w),_(),f({done:!0,value:void 0})},w=()=>P(new Error("stream destroyed"));return new Promise((v,z)=>{Y=z,f=v,this.once(F8,w),this.once("error",P),this.once("end",O),this.once("data",$)})},throw:_,return:_,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[o6]=!1;let q=!1,_=()=>{return this.pause(),this.off(R9,_),this.off(F8,_),this.off("end",_),q=!0,{done:!0,value:void 0}},j=()=>{if(q)return _();let K=this.read();return K===null?_():{done:!1,value:K}};return this.once("end",_),this.once(R9,_),this.once(F8,_),{next:j,throw:_,return:_,[Symbol.iterator](){return this}}}destroy(q){if(this[F8]){if(q)this.emit("error",q);else this.emit(F8);return this}this[F8]=!0,this[o6]=!0,this[O6].length=0,this[v6]=0;let _=this;if(typeof _.close==="function"&&!this[m7])_.close();if(q)this.emit("error",q);else this.emit(F8);return this}static get isStream(){return bh}}var oh=rh.native,V3={lstatSync:lh,readdir:xh,readdirSync:nh,readlinkSync:ch,realpathSync:oh,promises:{lstat:ah,readdir:Bh,readlink:th,realpath:eh}},$$=(q)=>!q||q===V3||q===ih?V3:{...V3,...q,promises:{...V3.promises,...q.promises||{}}},w$=/^\\\\\?\\([a-z]:)\\?$/i,Fh=(q)=>q.replace(/\//g,"\\").replace(w$,"$1\\"),Uh=/[\\\/]/,Yq=0,O$=1,v$=2,Mq=4,z$=6,W$=8,b_=10,J$=12,fq=15,C3=~fq,p9=16,j$=32,M3=64,Xq=128,d7=256,L7=512,P$=M3|Xq|L7,sh=1023,L9=(q)=>q.isFile()?W$:q.isDirectory()?Mq:q.isSymbolicLink()?b_:q.isCharacterDevice()?v$:q.isBlockDevice()?z$:q.isSocket()?J$:q.isFIFO()?O$:Yq,f$=new Map,N3=(q)=>{let _=f$.get(q);if(_)return _;let j=q.normalize("NFKD");return f$.set(q,j),j},Y$=new Map,p7=(q)=>{let _=Y$.get(q);if(_)return _;let j=N3(q.toLowerCase());return Y$.set(q,j),j};class x9 extends A3{constructor(){super({max:256})}}class H$ extends A3{constructor(q=16384){super({maxSize:q,sizeCalculation:(_)=>_.length+1})}}var T$=Symbol("PathScurry setAsCwd");class E6{name;root;roots;parent;nocase;isCWD=!1;#q;#_;get dev(){return this.#_}#f;get mode(){return this.#f}#P;get nlink(){return this.#P}#Y;get uid(){return this.#Y}#G;get gid(){return this.#G}#X;get rdev(){return this.#X}#v;get blksize(){return this.#v}#$;get ino(){return this.#$}#W;get size(){return this.#W}#z;get blocks(){return this.#z}#w;get atimeMs(){return this.#w}#K;get mtimeMs(){return this.#K}#H;get ctimeMs(){return this.#H}#u;get birthtimeMs(){return this.#u}#A;get atime(){return this.#A}#T;get mtime(){return this.#T}#b;get ctime(){return this.#b}#Z;get birthtime(){return this.#Z}#D;#M;#k;#h;#N;#J;#j;#I;#S;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(q,_=Yq,j,K,f,Y,P){if(this.name=q,this.#D=f?p7(q):N3(q),this.#j=_&sh,this.nocase=f,this.roots=K,this.root=j||this,this.#I=Y,this.#k=P.fullpath,this.#N=P.relative,this.#J=P.relativePosix,this.parent=P.parent,this.parent)this.#q=this.parent.#q;else this.#q=$$(P.fs)}depth(){if(this.#M!==void 0)return this.#M;if(!this.parent)return this.#M=0;return this.#M=this.parent.depth()+1}childrenCache(){return this.#I}resolve(q){if(!q)return this;let _=this.getRootString(q),K=q.substring(_.length).split(this.splitSep);return _?this.getRoot(_).#n(K):this.#n(K)}#n(q){let _=this;for(let j of q)_=_.child(j);return _}children(){let q=this.#I.get(this);if(q)return q;let _=Object.assign([],{provisional:0});return this.#I.set(this,_),this.#j&=~p9,_}child(q,_){if(q===""||q===".")return this;if(q==="..")return this.parent||this;let j=this.children(),K=this.nocase?p7(q):N3(q);for(let $ of j)if($.#D===K)return $;let f=this.parent?this.sep:"",Y=this.#k?this.#k+f+q:void 0,P=this.newChild(q,Yq,{..._,parent:this,fullpath:Y});if(!this.canReaddir())P.#j|=Xq;return j.push(P),P}relative(){if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let q=this.name,_=this.parent;if(!_)return this.#N=this.name;let j=_.relative();return j+(!j||!_.parent?"":this.sep)+q}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#J!==void 0)return this.#J;let q=this.name,_=this.parent;if(!_)return this.#J=this.fullpathPosix();let j=_.relativePosix();return j+(!j||!_.parent?"":"/")+q}fullpath(){if(this.#k!==void 0)return this.#k;let q=this.name,_=this.parent;if(!_)return this.#k=this.name;let K=_.fullpath()+(!_.parent?"":this.sep)+q;return this.#k=K}fullpathPosix(){if(this.#h!==void 0)return this.#h;if(this.sep==="/")return this.#h=this.fullpath();if(!this.parent){let K=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(K))return this.#h=`//?/${K}`;else return this.#h=K}let q=this.parent,_=q.fullpathPosix(),j=_+(!_||!q.parent?"":"/")+this.name;return this.#h=j}isUnknown(){return(this.#j&fq)===Yq}isType(q){return this[`is${q}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#j&fq)===W$}isDirectory(){return(this.#j&fq)===Mq}isCharacterDevice(){return(this.#j&fq)===v$}isBlockDevice(){return(this.#j&fq)===z$}isFIFO(){return(this.#j&fq)===O$}isSocket(){return(this.#j&fq)===J$}isSymbolicLink(){return(this.#j&b_)===b_}lstatCached(){return this.#j&j$?this:void 0}readlinkCached(){return this.#S}realpathCached(){return this.#C}readdirCached(){let q=this.children();return q.slice(0,q.provisional)}canReadlink(){if(this.#S)return!0;if(!this.parent)return!1;let q=this.#j&fq;return!(q!==Yq&&q!==b_||this.#j&d7||this.#j&Xq)}calledReaddir(){return!!(this.#j&p9)}isENOENT(){return!!(this.#j&Xq)}isNamed(q){return!this.nocase?this.#D===N3(q):this.#D===p7(q)}async readlink(){let q=this.#S;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let _=await this.#q.promises.readlink(this.fullpath()),j=(await this.parent.realpath())?.resolve(_);if(j)return this.#S=j}catch(_){this.#c(_.code);return}}readlinkSync(){let q=this.#S;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let _=this.#q.readlinkSync(this.fullpath()),j=this.parent.realpathSync()?.resolve(_);if(j)return this.#S=j}catch(_){this.#c(_.code);return}}#V(q){this.#j|=p9;for(let _=q.provisional;_<q.length;_++){let j=q[_];if(j)j.#L()}}#L(){if(this.#j&Xq)return;this.#j=(this.#j|Xq)&C3,this.#g()}#g(){let q=this.children();q.provisional=0;for(let _ of q)_.#L()}#l(){this.#j|=L7,this.#y()}#y(){if(this.#j&M3)return;let q=this.#j;if((q&fq)===Mq)q&=C3;this.#j=q|M3,this.#g()}#E(q=""){if(q==="ENOTDIR"||q==="EPERM")this.#y();else if(q==="ENOENT")this.#L();else this.children().provisional=0}#m(q=""){if(q==="ENOTDIR")this.parent.#y();else if(q==="ENOENT")this.#L()}#c(q=""){let _=this.#j;if(_|=d7,q==="ENOENT")_|=Xq;if(q==="EINVAL"||q==="UNKNOWN")_&=C3;if(this.#j=_,q==="ENOTDIR"&&this.parent)this.parent.#y()}#d(q,_){return this.#O(q,_)||this.#r(q,_)}#r(q,_){let j=L9(q),K=this.newChild(q.name,j,{parent:this}),f=K.#j&fq;if(f!==Mq&&f!==b_&&f!==Yq)K.#j|=M3;return _.unshift(K),_.provisional++,K}#O(q,_){for(let j=_.provisional;j<_.length;j++){let K=_[j];if((this.nocase?p7(q.name):N3(q.name))!==K.#D)continue;return this.#i(q,K,j,_)}}#i(q,_,j,K){let f=_.name;if(_.#j=_.#j&C3|L9(q),f!==q.name)_.name=q.name;if(j!==K.provisional){if(j===K.length-1)K.pop();else K.splice(j,1);K.unshift(_)}return K.provisional++,_}async lstat(){if((this.#j&Xq)===0)try{return this.#p(await this.#q.promises.lstat(this.fullpath())),this}catch(q){this.#m(q.code)}}lstatSync(){if((this.#j&Xq)===0)try{return this.#p(this.#q.lstatSync(this.fullpath())),this}catch(q){this.#m(q.code)}}#p(q){let{atime:_,atimeMs:j,birthtime:K,birthtimeMs:f,blksize:Y,blocks:P,ctime:$,ctimeMs:O,dev:w,gid:v,ino:z,mode:W,mtime:H,mtimeMs:Z,nlink:J,rdev:X,size:A,uid:G}=q;this.#A=_,this.#w=j,this.#Z=K,this.#u=f,this.#v=Y,this.#z=P,this.#b=$,this.#H=O,this.#_=w,this.#G=v,this.#$=z,this.#f=W,this.#T=H,this.#K=Z,this.#P=J,this.#X=X,this.#W=A,this.#Y=G;let D=L9(q);if(this.#j=this.#j&C3|D|j$,D!==Yq&&D!==Mq&&D!==b_)this.#j|=M3}#R=[];#x=!1;#a(q){this.#x=!1;let _=this.#R.slice();this.#R.length=0,_.forEach((j)=>j(null,q))}readdirCB(q,_=!1){if(!this.canReaddir()){if(_)q(null,[]);else queueMicrotask(()=>q(null,[]));return}let j=this.children();if(this.calledReaddir()){let f=j.slice(0,j.provisional);if(_)q(null,f);else queueMicrotask(()=>q(null,f));return}if(this.#R.push(q),this.#x)return;this.#x=!0;let K=this.fullpath();this.#q.readdir(K,{withFileTypes:!0},(f,Y)=>{if(f)this.#E(f.code),j.provisional=0;else{for(let P of Y)this.#d(P,j);this.#V(j)}this.#a(j.slice(0,j.provisional));return})}#o;async readdir(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let _=this.fullpath();if(this.#o)await this.#o;else{let j=()=>{};this.#o=new Promise((K)=>j=K);try{for(let K of await this.#q.promises.readdir(_,{withFileTypes:!0}))this.#d(K,q);this.#V(q)}catch(K){this.#E(K.code),q.provisional=0}this.#o=void 0,j()}return q.slice(0,q.provisional)}readdirSync(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let _=this.fullpath();try{for(let j of this.#q.readdirSync(_,{withFileTypes:!0}))this.#d(j,q);this.#V(q)}catch(j){this.#E(j.code),q.provisional=0}return q.slice(0,q.provisional)}canReaddir(){if(this.#j&P$)return!1;let q=fq&this.#j;if(!(q===Yq||q===Mq||q===b_))return!1;return!0}shouldWalk(q,_){return(this.#j&Mq)===Mq&&!(this.#j&P$)&&!q.has(this)&&(!_||_(this))}async realpath(){if(this.#C)return this.#C;if((L7|d7|Xq)&this.#j)return;try{let q=await this.#q.promises.realpath(this.fullpath());return this.#C=this.resolve(q)}catch(q){this.#l()}}realpathSync(){if(this.#C)return this.#C;if((L7|d7|Xq)&this.#j)return;try{let q=this.#q.realpathSync(this.fullpath());return this.#C=this.resolve(q)}catch(q){this.#l()}}[T$](q){if(q===this)return;q.isCWD=!1,this.isCWD=!0;let _=new Set([]),j=[],K=this;while(K&&K.parent)_.add(K),K.#N=j.join(this.sep),K.#J=j.join("/"),K=K.parent,j.push("..");K=q;while(K&&K.parent&&!_.has(K))K.#N=void 0,K.#J=void 0,K=K.parent}}class l7 extends E6{sep="\\";splitSep=Uh;constructor(q,_=Yq,j,K,f,Y,P){super(q,_,j,K,f,Y,P)}newChild(q,_=Yq,j={}){return new l7(q,_,this.root,this.roots,this.nocase,this.childrenCache(),j)}getRootString(q){return l9.parse(q).root}getRoot(q){if(q=Fh(q.toUpperCase()),q===this.root.name)return this.root;for(let[_,j]of Object.entries(this.roots))if(this.sameRoot(q,_))return this.roots[q]=j;return this.roots[q]=new b3(q,this).root}sameRoot(q,_=this.root.name){return q=q.toUpperCase().replace(/\//g,"\\").replace(w$,"$1\\"),q===_}}class x7 extends E6{splitSep="/";sep="/";constructor(q,_=Yq,j,K,f,Y,P){super(q,_,j,K,f,Y,P)}getRootString(q){return q.startsWith("/")?"/":""}getRoot(q){return this.root}newChild(q,_=Yq,j={}){return new x7(q,_,this.root,this.roots,this.nocase,this.childrenCache(),j)}}class n9{root;rootPath;roots;cwd;#q;#_;#f;nocase;#P;constructor(q=process.cwd(),_,j,{nocase:K,childrenCacheSize:f=16384,fs:Y=V3}={}){if(this.#P=$$(Y),q instanceof URL||q.startsWith("file://"))q=Lh(q);let P=_.resolve(q);this.roots=Object.create(null),this.rootPath=this.parseRootPath(P),this.#q=new x9,this.#_=new x9,this.#f=new H$(f);let $=P.substring(this.rootPath.length).split(j);if($.length===1&&!$[0])$.pop();if(K===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=K,this.root=this.newRoot(this.#P),this.roots[this.rootPath]=this.root;let O=this.root,w=$.length-1,v=_.sep,z=this.rootPath,W=!1;for(let H of $){let Z=w--;O=O.child(H,{relative:new Array(Z).fill("..").join(v),relativePosix:new Array(Z).fill("..").join("/"),fullpath:z+=(W?"":v)+H}),W=!0}this.cwd=O}depth(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.depth()}childrenCache(){return this.#f}resolve(...q){let _="";for(let f=q.length-1;f>=0;f--){let Y=q[f];if(!Y||Y===".")continue;if(_=_?`${Y}/${_}`:Y,this.isAbsolute(Y))break}let j=this.#q.get(_);if(j!==void 0)return j;let K=this.cwd.resolve(_).fullpath();return this.#q.set(_,K),K}resolvePosix(...q){let _="";for(let f=q.length-1;f>=0;f--){let Y=q[f];if(!Y||Y===".")continue;if(_=_?`${Y}/${_}`:Y,this.isAbsolute(Y))break}let j=this.#_.get(_);if(j!==void 0)return j;let K=this.cwd.resolve(_).fullpathPosix();return this.#_.set(_,K),K}relative(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relative()}relativePosix(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relativePosix()}basename(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.name}dirname(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return(q.parent||q).fullpath()}async readdir(q=this.cwd,_={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j}=_;if(!q.canReaddir())return[];else{let K=await q.readdir();return j?K:K.map((f)=>f.name)}}readdirSync(q=this.cwd,_={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0}=_;if(!q.canReaddir())return[];else if(j)return q.readdirSync();else return q.readdirSync().map((K)=>K.name)}async lstat(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstat()}lstatSync(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstatSync()}async readlink(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q.withFileTypes,q=this.cwd;let j=await q.readlink();return _?j:j?.fullpath()}readlinkSync(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q.withFileTypes,q=this.cwd;let j=q.readlinkSync();return _?j:j?.fullpath()}async realpath(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q.withFileTypes,q=this.cwd;let j=await q.realpath();return _?j:j?.fullpath()}realpathSync(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q.withFileTypes,q=this.cwd;let j=q.realpathSync();return _?j:j?.fullpath()}async walk(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:f,walkFilter:Y}=_,P=[];if(!f||f(q))P.push(j?q:q.fullpath());let $=new Set,O=(v,z)=>{$.add(v),v.readdirCB((W,H)=>{if(W)return z(W);let Z=H.length;if(!Z)return z();let J=()=>{if(--Z===0)z()};for(let X of H){if(!f||f(X))P.push(j?X:X.fullpath());if(K&&X.isSymbolicLink())X.realpath().then((A)=>A?.isUnknown()?A.lstat():A).then((A)=>A?.shouldWalk($,Y)?O(A,J):J());else if(X.shouldWalk($,Y))O(X,J);else J()}},!0)},w=q;return new Promise((v,z)=>{O(w,(W)=>{if(W)return z(W);v(P)})})}walkSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:f,walkFilter:Y}=_,P=[];if(!f||f(q))P.push(j?q:q.fullpath());let $=new Set([q]);for(let O of $){let w=O.readdirSync();for(let v of w){if(!f||f(v))P.push(j?v:v.fullpath());let z=v;if(v.isSymbolicLink()){if(!(K&&(z=v.realpathSync())))continue;if(z.isUnknown())z.lstatSync()}if(z.shouldWalk($,Y))$.add(z)}}return P}[Symbol.asyncIterator](){return this.iterate()}iterate(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;return this.stream(q,_)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:f,walkFilter:Y}=_;if(!f||f(q))yield j?q:q.fullpath();let P=new Set([q]);for(let $ of P){let O=$.readdirSync();for(let w of O){if(!f||f(w))yield j?w:w.fullpath();let v=w;if(w.isSymbolicLink()){if(!(K&&(v=w.realpathSync())))continue;if(v.isUnknown())v.lstatSync()}if(v.shouldWalk(P,Y))P.add(v)}}}stream(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:f,walkFilter:Y}=_,P=new N_({objectMode:!0});if(!f||f(q))P.write(j?q:q.fullpath());let $=new Set,O=[q],w=0,v=()=>{let z=!1;while(!z){let W=O.shift();if(!W){if(w===0)P.end();return}w++,$.add(W);let H=(J,X,A=!1)=>{if(J)return P.emit("error",J);if(K&&!A){let G=[];for(let D of X)if(D.isSymbolicLink())G.push(D.realpath().then((V)=>V?.isUnknown()?V.lstat():V));if(G.length){Promise.all(G).then(()=>H(null,X,!0));return}}for(let G of X)if(G&&(!f||f(G))){if(!P.write(j?G:G.fullpath()))z=!0}w--;for(let G of X){let D=G.realpathCached()||G;if(D.shouldWalk($,Y))O.push(D)}if(z&&!P.flowing)P.once("drain",v);else if(!Z)v()},Z=!0;W.readdirCB(H,!0),Z=!1}};return v(),P}streamSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof E6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:f,walkFilter:Y}=_,P=new N_({objectMode:!0}),$=new Set;if(!f||f(q))P.write(j?q:q.fullpath());let O=[q],w=0,v=()=>{let z=!1;while(!z){let W=O.shift();if(!W){if(w===0)P.end();return}w++,$.add(W);let H=W.readdirSync();for(let Z of H)if(!f||f(Z)){if(!P.write(j?Z:Z.fullpath()))z=!0}w--;for(let Z of H){let J=Z;if(Z.isSymbolicLink()){if(!(K&&(J=Z.realpathSync())))continue;if(J.isUnknown())J.lstatSync()}if(J.shouldWalk($,Y))O.push(J)}}if(z&&!P.flowing)P.once("drain",v)};return v(),P}chdir(q=this.cwd){let _=this.cwd;this.cwd=typeof q==="string"?this.cwd.resolve(q):q,this.cwd[T$](_)}}class b3 extends n9{sep="\\";constructor(q=process.cwd(),_={}){let{nocase:j=!0}=_;super(q,l9,"\\",{..._,nocase:j});this.nocase=j;for(let K=this.cwd;K;K=K.parent)K.nocase=this.nocase}parseRootPath(q){return l9.parse(q).root.toUpperCase()}newRoot(q){return new l7(this.rootPath,Mq,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")||q.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(q)}}class S3 extends n9{sep="/";constructor(q=process.cwd(),_={}){let{nocase:j=!1}=_;super(q,ph,"/",{..._,nocase:j});this.nocase=j}parseRootPath(q){return"/"}newRoot(q){return new x7(this.rootPath,Mq,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")}}class n7 extends S3{constructor(q=process.cwd(),_={}){let{nocase:j=!0}=_;super(q,{..._,nocase:j})}}var NN=process.platform==="win32"?l7:x7,Z$=process.platform==="win32"?b3:process.platform==="darwin"?n7:S3;var Qh=(q)=>q.length>=1,qD=(q)=>q.length>=1;class CK{#q;#_;#f;length;#P;#Y;#G;#X;#v;#$;#W=!0;constructor(q,_,j,K){if(!Qh(q))throw new TypeError("empty pattern list");if(!qD(_))throw new TypeError("empty glob list");if(_.length!==q.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=q.length,j<0||j>=this.length)throw new TypeError("index out of range");if(this.#q=q,this.#_=_,this.#f=j,this.#P=K,this.#f===0){if(this.isUNC()){let[f,Y,P,$,...O]=this.#q,[w,v,z,W,...H]=this.#_;if(O[0]==="")O.shift(),H.shift();let Z=[f,Y,P,$,""].join("/"),J=[w,v,z,W,""].join("/");this.#q=[Z,...O],this.#_=[J,...H],this.length=this.#q.length}else if(this.isDrive()||this.isAbsolute()){let[f,...Y]=this.#q,[P,...$]=this.#_;if(Y[0]==="")Y.shift(),$.shift();let O=f+"/",w=P+"/";this.#q=[O,...Y],this.#_=[w,...$],this.length=this.#q.length}}}pattern(){return this.#q[this.#f]}isString(){return typeof this.#q[this.#f]==="string"}isGlobstar(){return this.#q[this.#f]===k6}isRegExp(){return this.#q[this.#f]instanceof RegExp}globString(){return this.#G=this.#G||(this.#f===0?this.isAbsolute()?this.#_[0]+this.#_.slice(1).join("/"):this.#_.join("/"):this.#_.slice(this.#f).join("/"))}hasMore(){return this.length>this.#f+1}rest(){if(this.#Y!==void 0)return this.#Y;if(!this.hasMore())return this.#Y=null;return this.#Y=new CK(this.#q,this.#_,this.#f+1,this.#P),this.#Y.#$=this.#$,this.#Y.#v=this.#v,this.#Y.#X=this.#X,this.#Y}isUNC(){let q=this.#q;return this.#v!==void 0?this.#v:this.#v=this.#P==="win32"&&this.#f===0&&q[0]===""&&q[1]===""&&typeof q[2]==="string"&&!!q[2]&&typeof q[3]==="string"&&!!q[3]}isDrive(){let q=this.#q;return this.#X!==void 0?this.#X:this.#X=this.#P==="win32"&&this.#f===0&&this.length>1&&typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0])}isAbsolute(){let q=this.#q;return this.#$!==void 0?this.#$:this.#$=q[0]===""&&q.length>1||this.isDrive()||this.isUNC()}root(){let q=this.#q[0];return typeof q==="string"&&this.isAbsolute()&&this.#f===0?q:""}checkFollowGlobstar(){return!(this.#f===0||!this.isGlobstar()||!this.#W)}markFollowGlobstar(){if(this.#f===0||!this.isGlobstar()||!this.#W)return!1;return this.#W=!1,!0}}var _D=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class E3{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(q,{nobrace:_,nocase:j,noext:K,noglobstar:f,platform:Y=_D}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=Y,this.mmopts={dot:!0,nobrace:_,nocase:j,noext:K,noglobstar:f,optimizationLevel:2,platform:Y,nocomment:!0,nonegate:!0};for(let P of q)this.add(P)}add(q){let _=new Pq(q,this.mmopts);for(let j=0;j<_.set.length;j++){let K=_.set[j],f=_.globParts[j];if(!K||!f)throw new Error("invalid pattern object");while(K[0]==="."&&f[0]===".")K.shift(),f.shift();let Y=new CK(K,f,0,this.platform),P=new Pq(Y.globString(),this.mmopts),$=f[f.length-1]==="**",O=Y.isAbsolute();if(O)this.absolute.push(P);else this.relative.push(P);if($)if(O)this.absoluteChildren.push(P);else this.relativeChildren.push(P)}}ignored(q){let _=q.fullpath(),j=`${_}/`,K=q.relative()||".",f=`${K}/`;for(let Y of this.relative)if(Y.match(K)||Y.match(f))return!0;for(let Y of this.absolute)if(Y.match(_)||Y.match(j))return!0;return!1}childrenIgnored(q){let _=q.fullpath()+"/",j=(q.relative()||".")+"/";for(let K of this.relativeChildren)if(K.match(j))return!0;for(let K of this.absoluteChildren)if(K.match(_))return!0;return!1}}class c9{store;constructor(q=new Map){this.store=q}copy(){return new c9(new Map(this.store))}hasWalked(q,_){return this.store.get(q.fullpath())?.has(_.globString())}storeWalked(q,_){let j=q.fullpath(),K=this.store.get(j);if(K)K.add(_.globString());else this.store.set(j,new Set([_.globString()]))}}class k${store=new Map;add(q,_,j){let K=(_?2:0)|(j?1:0),f=this.store.get(q);this.store.set(q,f===void 0?K:K&f)}entries(){return[...this.store.entries()].map(([q,_])=>[q,!!(_&2),!!(_&1)])}}class X${store=new Map;add(q,_){if(!q.canReaddir())return;let j=this.store.get(q);if(j){if(!j.find((K)=>K.globString()===_.globString()))j.push(_)}else this.store.set(q,[_])}get(q){let _=this.store.get(q);if(!_)throw new Error("attempting to walk unknown path");return _}entries(){return this.keys().map((q)=>[q,this.store.get(q)])}keys(){return[...this.store.keys()].filter((q)=>q.canReaddir())}}class R3{hasWalkedCache;matches=new k$;subwalks=new X$;patterns;follow;dot;opts;constructor(q,_){this.opts=q,this.follow=!!q.follow,this.dot=!!q.dot,this.hasWalkedCache=_?_.copy():new c9}processPatterns(q,_){this.patterns=_;let j=_.map((K)=>[q,K]);for(let[K,f]of j){this.hasWalkedCache.storeWalked(K,f);let Y=f.root(),P=f.isAbsolute()&&this.opts.absolute!==!1;if(Y){K=K.resolve(Y==="/"&&this.opts.root!==void 0?this.opts.root:Y);let v=f.rest();if(!v){this.matches.add(K,!0,!1);continue}else f=v}if(K.isENOENT())continue;let $,O,w=!1;while(typeof($=f.pattern())==="string"&&(O=f.rest()))K=K.resolve($),f=O,w=!0;if($=f.pattern(),O=f.rest(),w){if(this.hasWalkedCache.hasWalked(K,f))continue;this.hasWalkedCache.storeWalked(K,f)}if(typeof $==="string"){let v=$===".."||$===""||$===".";this.matches.add(K.resolve($),P,v);continue}else if($===k6){if(!K.isSymbolicLink()||this.follow||f.checkFollowGlobstar())this.subwalks.add(K,f);let v=O?.pattern(),z=O?.rest();if(!O||(v===""||v===".")&&!z)this.matches.add(K,P,v===""||v===".");else if(v===".."){let W=K.parent||K;if(!z)this.matches.add(W,P,!0);else if(!this.hasWalkedCache.hasWalked(W,z))this.subwalks.add(W,z)}}else if($ instanceof RegExp)this.subwalks.add(K,f)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new R3(this.opts,this.hasWalkedCache)}filterEntries(q,_){let j=this.subwalks.get(q),K=this.child();for(let f of _)for(let Y of j){let P=Y.isAbsolute(),$=Y.pattern(),O=Y.rest();if($===k6)K.testGlobstar(f,Y,O,P);else if($ instanceof RegExp)K.testRegExp(f,$,O,P);else K.testString(f,$,O,P)}return K}testGlobstar(q,_,j,K){if(this.dot||!q.name.startsWith(".")){if(!_.hasMore())this.matches.add(q,K,!1);if(q.canReaddir()){if(this.follow||!q.isSymbolicLink())this.subwalks.add(q,_);else if(q.isSymbolicLink()){if(j&&_.checkFollowGlobstar())this.subwalks.add(q,j);else if(_.markFollowGlobstar())this.subwalks.add(q,_)}}}if(j){let f=j.pattern();if(typeof f==="string"&&f!==".."&&f!==""&&f!==".")this.testString(q,f,j.rest(),K);else if(f===".."){let Y=q.parent||q;this.subwalks.add(Y,j)}else if(f instanceof RegExp)this.testRegExp(q,f,j.rest(),K)}}testRegExp(q,_,j,K){if(!_.test(q.name))return;if(!j)this.matches.add(q,K,!1);else this.subwalks.add(q,j)}testString(q,_,j,K){if(!q.isNamed(_))return;if(!j)this.matches.add(q,K,!1);else this.subwalks.add(q,j)}}var KD=(q,_)=>typeof q==="string"?new E3([q],_):Array.isArray(q)?new E3(q,_):q;class r9{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#q=[];#_;#f;signal;maxDepth;includeChildMatches;constructor(q,_,j){if(this.patterns=q,this.path=_,this.opts=j,this.#f=!j.posix&&j.platform==="win32"?"\\":"/",this.includeChildMatches=j.includeChildMatches!==!1,j.ignore||!this.includeChildMatches){if(this.#_=KD(j.ignore??[],j),!this.includeChildMatches&&typeof this.#_.add!=="function")throw new Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=j.maxDepth||1/0,j.signal)this.signal=j.signal,this.signal.addEventListener("abort",()=>{this.#q.length=0})}#P(q){return this.seen.has(q)||!!this.#_?.ignored?.(q)}#Y(q){return!!this.#_?.childrenIgnored?.(q)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let q=void 0;while(!this.paused&&(q=this.#q.shift()))q()}onResume(q){if(this.signal?.aborted)return;if(!this.paused)q();else this.#q.push(q)}async matchCheck(q,_){if(_&&this.opts.nodir)return;let j;if(this.opts.realpath){if(j=q.realpathCached()||await q.realpath(),!j)return;q=j}let f=q.isUnknown()||this.opts.stat?await q.lstat():q;if(this.opts.follow&&this.opts.nodir&&f?.isSymbolicLink()){let Y=await f.realpath();if(Y&&(Y.isUnknown()||this.opts.stat))await Y.lstat()}return this.matchCheckTest(f,_)}matchCheckTest(q,_){return q&&(this.maxDepth===1/0||q.depth()<=this.maxDepth)&&(!_||q.canReaddir())&&(!this.opts.nodir||!q.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!q.isSymbolicLink()||!q.realpathCached()?.isDirectory())&&!this.#P(q)?q:void 0}matchCheckSync(q,_){if(_&&this.opts.nodir)return;let j;if(this.opts.realpath){if(j=q.realpathCached()||q.realpathSync(),!j)return;q=j}let f=q.isUnknown()||this.opts.stat?q.lstatSync():q;if(this.opts.follow&&this.opts.nodir&&f?.isSymbolicLink()){let Y=f.realpathSync();if(Y&&(Y?.isUnknown()||this.opts.stat))Y.lstatSync()}return this.matchCheckTest(f,_)}matchFinish(q,_){if(this.#P(q))return;if(!this.includeChildMatches&&this.#_?.add){let f=`${q.relativePosix()}/**`;this.#_.add(f)}let j=this.opts.absolute===void 0?_:this.opts.absolute;this.seen.add(q);let K=this.opts.mark&&q.isDirectory()?this.#f:"";if(this.opts.withFileTypes)this.matchEmit(q);else if(j){let f=this.opts.posix?q.fullpathPosix():q.fullpath();this.matchEmit(f+K)}else{let f=this.opts.posix?q.relativePosix():q.relative(),Y=this.opts.dotRelative&&!f.startsWith(".."+this.#f)?"."+this.#f:"";this.matchEmit(!f?"."+K:Y+f+K)}}async match(q,_,j){let K=await this.matchCheck(q,j);if(K)this.matchFinish(K,_)}matchSync(q,_,j){let K=this.matchCheckSync(q,j);if(K)this.matchFinish(K,_)}walkCB(q,_,j){if(this.signal?.aborted)j();this.walkCB2(q,_,new R3(this.opts),j)}walkCB2(q,_,j,K){if(this.#Y(q))return K();if(this.signal?.aborted)K();if(this.paused){this.onResume(()=>this.walkCB2(q,_,j,K));return}j.processPatterns(q,_);let f=1,Y=()=>{if(--f===0)K()};for(let[P,$,O]of j.matches.entries()){if(this.#P(P))continue;f++,this.match(P,$,O).then(()=>Y())}for(let P of j.subwalkTargets()){if(this.maxDepth!==1/0&&P.depth()>=this.maxDepth)continue;f++;let $=P.readdirCached();if(P.calledReaddir())this.walkCB3(P,$,j,Y);else P.readdirCB((O,w)=>this.walkCB3(P,w,j,Y),!0)}Y()}walkCB3(q,_,j,K){j=j.filterEntries(q,_);let f=1,Y=()=>{if(--f===0)K()};for(let[P,$,O]of j.matches.entries()){if(this.#P(P))continue;f++,this.match(P,$,O).then(()=>Y())}for(let[P,$]of j.subwalks.entries())f++,this.walkCB2(P,$,j.child(),Y);Y()}walkCBSync(q,_,j){if(this.signal?.aborted)j();this.walkCB2Sync(q,_,new R3(this.opts),j)}walkCB2Sync(q,_,j,K){if(this.#Y(q))return K();if(this.signal?.aborted)K();if(this.paused){this.onResume(()=>this.walkCB2Sync(q,_,j,K));return}j.processPatterns(q,_);let f=1,Y=()=>{if(--f===0)K()};for(let[P,$,O]of j.matches.entries()){if(this.#P(P))continue;this.matchSync(P,$,O)}for(let P of j.subwalkTargets()){if(this.maxDepth!==1/0&&P.depth()>=this.maxDepth)continue;f++;let $=P.readdirSync();this.walkCB3Sync(P,$,j,Y)}Y()}walkCB3Sync(q,_,j,K){j=j.filterEntries(q,_);let f=1,Y=()=>{if(--f===0)K()};for(let[P,$,O]of j.matches.entries()){if(this.#P(P))continue;this.matchSync(P,$,O)}for(let[P,$]of j.subwalks.entries())f++,this.walkCB2Sync(P,$,j.child(),Y);Y()}}class c7 extends r9{matches=new Set;constructor(q,_,j){super(q,_,j)}matchEmit(q){this.matches.add(q)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((q,_)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)_(this.signal.reason);else q(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class r7 extends r9{results;constructor(q,_,j){super(q,_,j);this.results=new N_({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(q){if(this.results.write(q),!this.results.flowing)this.pause()}stream(){let q=this.path;if(q.isUnknown())q.lstat().then(()=>{this.walkCB(q,this.patterns,()=>this.results.end())});else this.walkCB(q,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var PD=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Nq{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(q,_){if(!_)throw new TypeError("glob options required");if(this.withFileTypes=!!_.withFileTypes,this.signal=_.signal,this.follow=!!_.follow,this.dot=!!_.dot,this.dotRelative=!!_.dotRelative,this.nodir=!!_.nodir,this.mark=!!_.mark,!_.cwd)this.cwd="";else if(_.cwd instanceof URL||_.cwd.startsWith("file://"))_.cwd=jD(_.cwd);if(this.cwd=_.cwd||"",this.root=_.root,this.magicalBraces=!!_.magicalBraces,this.nobrace=!!_.nobrace,this.noext=!!_.noext,this.realpath=!!_.realpath,this.absolute=_.absolute,this.includeChildMatches=_.includeChildMatches!==!1,this.noglobstar=!!_.noglobstar,this.matchBase=!!_.matchBase,this.maxDepth=typeof _.maxDepth==="number"?_.maxDepth:1/0,this.stat=!!_.stat,this.ignore=_.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof q==="string")q=[q];if(this.windowsPathsNoEscape=!!_.windowsPathsNoEscape||_.allowWindowsEscape===!1,this.windowsPathsNoEscape)q=q.map(($)=>$.replace(/\\/g,"/"));if(this.matchBase){if(_.noglobstar)throw new TypeError("base matching requires globstar");q=q.map(($)=>$.includes("/")?$:`./**/${$}`)}if(this.pattern=q,this.platform=_.platform||PD,this.opts={..._,platform:this.platform},_.scurry){if(this.scurry=_.scurry,_.nocase!==void 0&&_.nocase!==_.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let $=_.platform==="win32"?b3:_.platform==="darwin"?n7:_.platform?S3:Z$;this.scurry=new $(this.cwd,{nocase:_.nocase,fs:_.fs})}this.nocase=this.scurry.nocase;let j=this.platform==="darwin"||this.platform==="win32",K={..._,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:j,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},f=this.pattern.map(($)=>new Pq($,K)),[Y,P]=f.reduce(($,O)=>{return $[0].push(...O.set),$[1].push(...O.globParts),$},[[],[]]);this.patterns=Y.map(($,O)=>{let w=P[O];if(!w)throw new Error("invalid pattern object");return new CK($,w,0,this.platform)})}async walk(){return[...await new c7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new c7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new r7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new r7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}var i9=(q,_={})=>{if(!Array.isArray(q))q=[q];for(let j of q)if(new Pq(j,_).hasMagic())return!0;return!1};function o7(q,_={}){return new Nq(q,_).streamSync()}function G$(q,_={}){return new Nq(q,_).stream()}function u$(q,_={}){return new Nq(q,_).walkSync()}async function A$(q,_={}){return new Nq(q,_).walk()}function a7(q,_={}){return new Nq(q,_).iterateSync()}function h$(q,_={}){return new Nq(q,_).iterate()}var fD=o7,YD=Object.assign(G$,{sync:o7}),$D=a7,wD=Object.assign(h$,{sync:a7}),OD=Object.assign(u$,{stream:o7,iterate:a7}),i7=Object.assign(A$,{glob:A$,globSync:u$,sync:OD,globStream:G$,stream:YD,globStreamSync:o7,streamSync:fD,globIterate:h$,iterate:wD,globIterateSync:a7,iterateSync:$D,Glob:Nq,hasMagic:i9,escape:GK,unescape:Zq});i7.glob=i7;L6();async function C$(q,_={}){let j=P8.getInstance().getTrashDirectory();if(!D$(j))zD(j,{recursive:!0});let K=Array.isArray(q)?q:[q];for(let f of K){let Y=await i7(f),P=Y.length>0?Y:[f];for(let $ of P)try{if(!D$($)){if(!_.force){console.error(`trash: ${$}: No such file or directory`);continue}continue}if(WD($).isDirectory()&&!_.recursive){if(!_.force){console.error(`trash: ${$}: is a directory`);continue}}let w=HD($),v=Date.now(),z=JD(j,`${w}.${v}`);vD($,z),console.log(`Moved ${w} to trash`)}catch(O){if(!_.force){let w=O instanceof Error?O.message:String(O);console.error(`trash: ${$}: ${w}`)}}}}Qq();L6();import{readdirSync as TD,renameSync as ZD}from"fs";import{join as V$}from"path";async function M$(){let q=P8.getInstance().getTrashDirectory(),_=TD(q);if(_.length===0){console.log("Trash is empty");return}let j=await H6({message:"Select file to restore:",options:_.map((K)=>({value:K,label:K}))});if(L8(j))return;ZD(V$(q,j),V$(process.cwd(),j)),console.log(`Restored ${j}`)}L6();import{appendFileSync as kD}from"fs";function XD(q){let j=q.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter((Y)=>Y.length>2).slice(0,4).join("-"),K=j.length>30?j.substring(0,27)+"...":j,f=new Date().toISOString().substring(11,19).replace(/:/g,"");return`${K}-${f}`}async function N$(q,_={}){if(!q||q.trim()==="")console.error("Error: Message is required"),process.exit(1);let j=P8.getInstance(),K=new Date().toISOString(),f=P8.getCurrentProjectName(),Y=XD(q),P=`${f}_${Y}_overview`,$=j.getIndexPath(),O={type:"overview",content:q,session_id:Y,project:f,timestamp:K};j.ensureDirectory(j.getDataDirectory()),kD($,JSON.stringify(O)+`
423
+ `,"utf8"),console.log(JSON.stringify({success:!0,document_id:P,session_id:Y,project:f,timestamp:K,suppressOutput:!0}))}Qq();var z6={red:"#FF073A",pink:"#FF1053",blue:"#0077FF",green:"#00FF88",yellow:"#FFD700",purple:"#9B59B6"},b$=["\uD83C\uDFB5","\uD83C\uDFB6","\uD83C\uDFBC","\uD83C\uDFA4","\uD83C\uDFA7","\uD83D\uDD0A"],VK=["\uD83D\uDC8E","\uD83C\uDF52","\uD83C\uDF4B","\uD83D\uDD14","⭐","7️⃣","\uD83C\uDFB0","\uD83D\uDCB0"];async function R$(){X7(M6(z6.pink,z6.blue)("\uD83C\uDFB0 WELCOME TO VEGAS CASINO MEMORY GAMBLING \uD83C\uDFB0")),console.log(g.yellow("✨ Where memory compression meets Las Vegas excitement! ✨")),console.log(g.gray(`What happens in ~/.claude-mem, stays in ~/.claude-mem!
424
+ `));let q=await AD();GD();let _=!0;while(_){let j=await H6({message:`\uD83D\uDCB0 ${q.name}, you have ${q.chips} chips. Choose your game:`,options:[{value:"slots",label:"\uD83C\uDFB0 Compression Slots - Match 3 memory patterns to win!"},{value:"blackjack",label:"\uD83C\uDCCF Memory Blackjack - Get close to 2.1MB without going over!"},{value:"poker",label:"\uD83C\uDFAD Vector Poker - Best semantic hand wins!"},{value:"roulette",label:"\uD83C\uDFB2 Trash Roulette - Bet on which memories get deleted!"},{value:"vip",label:"\uD83D\uDC51 VIP High-Stakes Room"},{value:"stats",label:"\uD83D\uDCCA View Casino Stats"},{value:"exit",label:"\uD83D\uDEAA Cash Out and Leave"}]});if(j==="exit"){_=!1;continue}switch(j){case"slots":await uD(q);break;case"blackjack":await hD(q);break;case"poker":await DD(q);break;case"roulette":await CD(q);break;case"vip":await VD(q);break;case"stats":await bD(q);break}if(q.chips<=0)console.log(g.red(`
425
+ \uD83D\uDCB8 You're out of chips! Thanks for playing!`)),_=!1}Hq(M6(z6.yellow,z6.green)("\uD83C\uDF89 Thanks for gambling at the Memory Casino! \uD83C\uDF89"))}async function AD(){return{name:"High Roller",chips:1000,level:"Regular",wins:0,losses:0}}function GD(){console.log(g.magenta(`
426
+ \uD83C\uDF1F ═══════════════════════════════════════════════════════════ \uD83C\uDF1F`)),console.log(M6(z6.red,z6.yellow)(" ██╗ ██╗███████╗ ██████╗ █████╗ ███████╗")),console.log(M6(z6.red,z6.yellow)(" ██║ ██║██╔════╝██╔════╝ ██╔══██╗██╔════╝")),console.log(M6(z6.red,z6.yellow)(" ██║ ██║█████╗ ██║ ███╗███████║███████╗")),console.log(M6(z6.red,z6.yellow)(" ╚██╗ ██╔╝██╔══╝ ██║ ██║██╔══██║╚════██║")),console.log(M6(z6.red,z6.yellow)(" ╚████╔╝ ███████╗╚██████╔╝██║ ██║███████║")),console.log(M6(z6.red,z6.yellow)(" ╚═══╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝")),console.log(g.cyan(" \uD83C\uDFB0 MEMORY CASINO \uD83C\uDFB0")),console.log(g.magenta("\uD83C\uDF1F ═══════════════════════════════════════════════════════════ \uD83C\uDF1F")),console.log(g.blue("\uD83C\uDF78 Complimentary memory refresher cocktails at the bar!")),console.log(g.green(`${b$[Math.floor(Math.random()*b$.length)]} Smooth jazz playing in the background...`)),console.log(g.yellow("\uD83D\uDCA8 Steam rising from hot compression algorithms!")),console.log(g.magenta(`✨ Neon function signs blinking everywhere!
427
+ `))}async function uD(q){console.log(g.cyan(`
428
+ \uD83C\uDFB0 Welcome to Compression Slots!`)),console.log(g.gray(`Match 3 symbols to compress your way to victory!
429
+ `));let _=50;if(q.chips<_){console.log(g.red("\uD83D\uDCB8 Not enough chips to play slots!"));return}let j=_q();j.start("\uD83C\uDFB0 Spinning the reels..."),await new Promise((P)=>setTimeout(P,2000));let K=VK[Math.floor(Math.random()*VK.length)],f=VK[Math.floor(Math.random()*VK.length)],Y=VK[Math.floor(Math.random()*VK.length)];if(j.stop(),console.log(g.yellow(`
430
+ \uD83C\uDFB0 ${K} | ${f} | ${Y} \uD83C\uDFB0`)),K===f&&f===Y){let P=_*10;q.chips+=P-_,q.wins++,console.log(g.green(`
431
+ \uD83C\uDF89 JACKPOT! Three ${K}s! You win ${P} chips!`)),console.log(g.yellow("✨ Memory compression bonus activated! ✨"))}else if(K===f||f===Y||K===Y){let P=_*2;q.chips+=P-_,q.wins++,console.log(g.green(`
432
+ \uD83C\uDF8A Two matching symbols! You win ${P} chips!`))}else q.chips-=_,q.losses++,console.log(g.red(`
433
+ \uD83D\uDCB8 No match! You lose ${_} chips.`)),console.log(g.gray("Better luck next compression cycle!"))}async function hD(q){console.log(g.cyan(`
434
+ \uD83C\uDCCF Welcome to Memory Blackjack!`)),console.log(g.gray(`Get as close to 2.1MB as possible without going over!
435
+ `));let _=await m$(),j=2.1;console.log(g.yellow(`\uD83C\uDFAF Target: ${j}MB`)),console.log(g.blue(`\uD83D\uDCCA Current memory size: ${(_.totalSize/1024/1024).toFixed(2)}MB
436
+ `));let K=100;if(q.chips<K){console.log(g.red("\uD83D\uDCB8 Not enough chips to play blackjack!"));return}let f=Math.random()*3,Y=Math.random()*3;console.log(g.green(`\uD83C\uDCCF Your memory size: ${f.toFixed(2)}MB`));let P=!0;while(P&&f<j)if(await H6({message:"Choose your action:",options:[{value:"hit",label:"\uD83D\uDCC8 Hit (add more memory)"},{value:"stay",label:"✋ Stay (keep current size)"}]})==="hit"){let O=Math.random()*0.8;if(f+=O,console.log(g.blue(`\uD83D\uDCC8 +${O.toFixed(2)}MB | Total: ${f.toFixed(2)}MB`)),f>j){console.log(g.red("\uD83D\uDCA5 BUST! Over 2.1MB!")),q.chips-=K,q.losses++;return}}else P=!1;while(Y<1.7)Y+=Math.random()*0.5;if(console.log(g.yellow(`\uD83C\uDFAD Dealer total: ${Y.toFixed(2)}MB`)),Y>j||f>Y){let $=K*2;q.chips+=$-K,q.wins++,console.log(g.green(`\uD83C\uDF89 You win! Earned ${$} chips!`))}else if(f===Y)console.log(g.yellow("\uD83E\uDD1D Push! No chips lost."));else q.chips-=K,q.losses++,console.log(g.red(`\uD83D\uDCB8 Dealer wins! Lost ${K} chips.`))}async function DD(q){console.log(g.cyan(`
437
+ \uD83C\uDFAD Welcome to Vector Poker!`)),console.log(g.gray(`Best semantic hand wins!
438
+ `));let _=75;if(q.chips<_){console.log(g.red("\uD83D\uDCB8 Not enough chips to play poker!"));return}let j=S$(),K=S$();console.log(g.blue("\uD83C\uDCCF Your hand:")),j.forEach((P,$)=>{console.log(g.green(` ${$+1}. ${P}`))});let f=E$(j),Y=E$(K);if(console.log(g.yellow(`
439
+ \uD83C\uDFAF Your semantic strength: ${f}`)),console.log(g.blue(`
440
+ \uD83C\uDFAD Dealer hand:`)),K.forEach((P,$)=>{console.log(g.red(` ${$+1}. ${P}`))}),console.log(g.yellow(`\uD83C\uDFAF Dealer semantic strength: ${Y}`)),f>Y){let P=_*3;q.chips+=P-_,q.wins++,console.log(g.green(`\uD83C\uDF89 Your vectors win! Earned ${P} chips!`))}else if(f===Y)console.log(g.yellow("\uD83E\uDD1D Semantic tie! No chips lost."));else q.chips-=_,q.losses++,console.log(g.red(`\uD83D\uDCB8 Dealer's vectors win! Lost ${_} chips.`))}async function CD(q){console.log(g.cyan(`
441
+ \uD83C\uDFB2 Welcome to Trash Roulette!`)),console.log(g.gray(`Bet on which memories get deleted!
442
+ `));let _=60;if(q.chips<_){console.log(g.red("\uD83D\uDCB8 Not enough chips to play roulette!"));return}let j=await H6({message:"Place your bet:",options:[{value:"old",label:"\uD83D\uDDC2️ Old files (>30 days)"},{value:"large",label:"\uD83D\uDCCA Large files (>1MB)"},{value:"recent",label:"\uD83C\uDD95 Recent files (<7 days)"},{value:"compressed",label:"\uD83D\uDDDC️ Already compressed files"}]}),K=_q();K.start("\uD83C\uDFB2 Spinning the deletion wheel..."),await new Promise((P)=>setTimeout(P,3000)),K.stop();let f=["old","large","recent","compressed"],Y=f[Math.floor(Math.random()*f.length)];if(console.log(g.yellow(`
443
+ \uD83C\uDFB2 The wheel lands on: ${SD(Y)}`)),Y===j){let P=_*4;q.chips+=P-_,q.wins++,console.log(g.green(`\uD83C\uDF89 Correct prediction! You win ${P} chips!`)),console.log(g.yellow("\uD83D\uDDD1️ Memory cleanup bonus activated!"))}else q.chips-=_,q.losses++,console.log(g.red(`\uD83D\uDCB8 Wrong prediction! Lost ${_} chips.`)),console.log(g.gray("\uD83D\uDD04 The memory roulette wheel is unpredictable!"))}async function VD(q){if(q.chips<500){console.log(g.red(`
444
+ \uD83D\uDEAB VIP Room requires 500+ chips!`)),console.log(g.yellow("\uD83D\uDCB0 Keep gambling to reach VIP status!"));return}switch(console.log(g.magenta(`
445
+ \uD83D\uDC51 Welcome to the VIP High-Stakes Room!`)),console.log(g.yellow(`✨ Where compression legends are made! ✨
446
+ `)),await H6({message:"Choose your high-stakes game:",options:[{value:"jackpot",label:"\uD83D\uDC8E Memory Compression Jackpot (500 chips)"},{value:"tournament",label:"\uD83C\uDFC6 Vector Tournament (300 chips)"},{value:"leave",label:"\uD83D\uDEAA Return to main floor"}]})){case"jackpot":await MD(q);break;case"tournament":await ND(q);break}}async function MD(q){if(q.chips<500){console.log(g.red("\uD83D\uDCB8 Not enough chips for the jackpot!"));return}console.log(g.magenta(`
447
+ \uD83D\uDC8E COMPRESSION JACKPOT ROUND!`));let j=_q();j.start("\uD83D\uDC8E Compressing the ultimate memory sequence..."),await new Promise((f)=>setTimeout(f,4000)),j.stop();let K=Math.random();if(K<0.1)q.chips+=9500,q.wins++,console.log(M6(z6.red,z6.yellow)(`
448
+ \uD83C\uDF86 MASSIVE JACKPOT! ${1e4} CHIPS! \uD83C\uDF86`)),console.log(g.yellow("\uD83C\uDFC6 You are now a Memory Compression Legend!")),q.level="Legend";else if(K<0.3)q.chips+=2000,q.wins++,console.log(g.green(`\uD83C\uDF89 Big win! ${2500} chips!`));else q.chips-=500,q.losses++,console.log(g.red(`\uD83D\uDCB8 No jackpot this time! Lost ${500} chips.`))}async function ND(q){console.log(g.cyan(`
449
+ \uD83C\uDFC6 Vector Tournament - Battle of the Semantics!`));let _=300;if(q.chips<_){console.log(g.red("\uD83D\uDCB8 Not enough chips for the tournament!"));return}q.chips-=_;let j=Math.floor(Math.random()*8)+1;if(j===1){let K=_*6;q.chips+=K,q.wins++,console.log(g.yellow(`\uD83E\uDD47 FIRST PLACE! You win ${K} chips!`))}else if(j<=3){let K=_*2;q.chips+=K,q.wins++,console.log(g.gray(`\uD83E\uDD48 Top 3 finish! You win ${K} chips!`))}else q.losses++,console.log(g.red(`\uD83D\uDCCA Finished ${j}th place. Better luck next tournament!`))}async function bD(q){console.log(g.cyan(`
450
+ \uD83D\uDCCA Casino Statistics`)),console.log(g.green(`\uD83D\uDCB0 Current chips: ${q.chips}`)),console.log(g.blue(`\uD83C\uDFC6 Wins: ${q.wins}`)),console.log(g.red(`\uD83D\uDCB8 Losses: ${q.losses}`)),console.log(g.yellow(`⭐ Level: ${q.level}`));let _=await m$();console.log(g.magenta(`
451
+ \uD83D\uDCC1 Memory System Stats:`)),console.log(g.green(`\uD83D\uDCC4 Total files: ${_.totalFiles}`)),console.log(g.blue(`\uD83D\uDCBE Total size: ${(_.totalSize/1024/1024).toFixed(2)}MB`)),console.log(g.yellow(`\uD83D\uDDDC️ Compression ratio: ${_.compressionRatio.toFixed(2)}%`))}function S$(){let q=["vector_embedding","neural_pathway","context_window","token_limit","semantic_similarity","attention_head","transformer_layer","gradient_flow"];return Array.from({length:5},()=>q[Math.floor(Math.random()*q.length)])}function E$(q){return q.reduce((_,j)=>_+j.length+Math.random()*10,0)}function SD(q){return{old:"\uD83D\uDDC2️ Old files",large:"\uD83D\uDCCA Large files",recent:"\uD83C\uDD95 Recent files",compressed:"\uD83D\uDDDC️ Compressed files"}[q]||q}async function m$(){return{totalFiles:Math.floor(Math.random()*100)+50,totalSize:Math.floor(Math.random()*50*1024*1024),compressionRatio:Math.random()*30+70,oldestFile:new Date(Date.now()-Math.random()*30*24*60*60*1000),newestFile:new Date}}Qq();import rq from"path";import bq from"fs";import d$ from"os";w7();X2();h2();import S_ from"fs";import I$ from"path";import ED from"os";class MK{titlesIndexPath;constructor(){this.titlesIndexPath=I$.join(ED.homedir(),".claude-mem","conversation-titles.jsonl"),this.ensureTitlesIndex()}ensureTitlesIndex(){let q=I$.dirname(this.titlesIndexPath);if(!S_.existsSync(q))S_.mkdirSync(q,{recursive:!0});if(!S_.existsSync(this.titlesIndexPath))S_.writeFileSync(this.titlesIndexPath,"","utf-8")}async generateTitle(q){let _=`Generate a 3-7 word descriptive title for this conversation based on the first message.
452
+
453
+ The title should:
454
+ - Capture the main topic or intent
455
+ - Be concise and descriptive
456
+ - Use proper capitalization
457
+ - Not include "Help with" or "Question about" prefixes
458
+
459
+ First message: "${q.substring(0,500)}"
460
+
461
+ Respond with just the title, nothing else.`,j=await _3({prompt:_,options:{model:"claude-3-5-haiku-20241022",pathToClaudeCodeExecutable:X_()}}),K="";if(j&&typeof j==="object"&&Symbol.asyncIterator in j)for await(let f of j){if(f?.content)K+=f.content;if(f?.text)K+=f.text}else if(typeof j==="string")K=j;return K.trim().replace(/^["']|["']$/g,"")}async batchGenerateTitles(q){let _=[];for(let j of q)try{let K=await this.generateTitle(j.firstMessage),f={session_id:j.sessionId,generated_title:K,timestamp:new Date().toISOString(),project_name:j.projectName};_.push(f),this.storeTitleInIndex(f)}catch(K){console.error(`Failed to generate title for ${j.sessionId}:`,K)}return _}storeTitleInIndex(q){let _=JSON.stringify(q)+`
462
+ `;S_.appendFileSync(this.titlesIndexPath,_,"utf-8")}getExistingTitles(){let q=new Map;if(!S_.existsSync(this.titlesIndexPath))return q;let j=S_.readFileSync(this.titlesIndexPath,"utf-8").trim().split(`
463
+ `).filter(Boolean);for(let K of j)try{let f=JSON.parse(K);q.set(f.session_id,f)}catch(f){}return q}getTitleForSession(q){let j=this.getExistingTitles().get(q);return j?j.generated_title:null}}function B7(q){if(q<1024)return`${q}B`;if(q<1048576)return`${(q/1024).toFixed(1)}KB`;return`${(q/1048576).toFixed(1)}MB`}function RD(q){let j=new Date().getTime()-q.getTime(),K=Math.floor(j/60000),f=Math.floor(j/3600000),Y=Math.floor(j/86400000);if(K<1)return"just now";if(K<60)return`${K}m ago`;if(f<24)return`${f}h ago`;if(Y<7)return`${Y}d ago`;if(Y<30)return`${Math.floor(Y/7)}w ago`;if(Y<365)return`${Math.floor(Y/30)}mo ago`;return`${Math.floor(Y/365)}y ago`}function mD(q,_){try{let f=new Date(q);if(!isNaN(f.getTime()))return f}catch{}let j=_.match(/(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})/);if(j){let[f,Y,P,$,O,w,v]=j;return new Date(parseInt(Y),parseInt(P)-1,parseInt($),parseInt(O),parseInt(w),parseInt(v))}return bq.statSync(_).mtime}function ID(q){try{let j=bq.readFileSync(q,"utf-8").trim().split(`
464
+ `).filter(Boolean);for(let K of j)try{let f=JSON.parse(K);if(f.type==="user"&&f.message?.content){let Y=f.message.content;if(Array.isArray(Y)){let P=Y.filter(($)=>$.type==="text").map(($)=>$.text).join(" ");if(P.trim())return P.trim()}else if(typeof Y==="string")return Y.trim()}}catch{}return"Conversation"}catch{return"Conversation"}}async function gD(){let q=new Set,_=rq.join(d$.homedir(),".claude-mem","claude-mem-index.jsonl");if(!bq.existsSync(_))return q;let K=bq.readFileSync(_,"utf-8").trim().split(`
465
+ `).filter(Boolean);for(let f of K)try{let Y=JSON.parse(f);if(Y.session_id)q.add(Y.session_id);else if(Y.sessionId)q.add(Y.sessionId)}catch{}return q}async function yD(){let q=rq.join(d$.homedir(),".claude","projects");if(!bq.existsSync(q))return{conversations:[],skippedCount:0};let _=bq.readdirSync(q).filter((Y)=>bq.statSync(rq.join(q,Y)).isDirectory()),j=[],K=await gD(),f=0;for(let Y of _){let P=rq.join(q,Y),$=bq.readdirSync(P).filter((O)=>O.endsWith(".jsonl")).map((O)=>rq.join(P,O));for(let O of $)try{let v=bq.readFileSync(O,"utf-8").trim().split(`
466
+ `).filter(Boolean),z=JSON.parse(v[0]),W=v.length,H=bq.statSync(O),Z=H.size,J={sessionId:z.sessionId||rq.basename(O,".jsonl"),timestamp:z.timestamp||H.mtime.toISOString(),messageCount:W,branch:z.branch,cwd:z.cwd||P,fileSize:Z};if(K.has(J.sessionId)){f++;continue}let X=rq.basename(rq.dirname(O)),A=mD(J.timestamp,O),G=RD(A);j.push({filePath:O,...J,projectName:X,parsedDate:A,relativeDate:G})}catch{}}return{conversations:j,skippedCount:f}}async function p$(q={}){console.clear(),X7(g.bgCyan.black(" CLAUDE-MEM IMPORT "));let _=_q();_.start("Scanning conversation history");let{conversations:j,skippedCount:K}=await yD();if(j.length===0){_.stop("No new conversations found");let O=K>0?`All ${K} conversation${K===1?" is":"s are"} already imported.`:"No conversations found.";Hq(g.yellow(O));return}j.sort((O,w)=>w.parsedDate.getTime()-O.parsedDate.getTime());let f=K>0?`Found ${j.length} new conversation${j.length===1?"":"s"} (${K} already imported)`:`Found ${j.length} new conversation${j.length===1?"":"s"}`;_.stop(f);let Y=j.reduce((O,w)=>{if(!O[w.projectName])O[w.projectName]=[];return O[w.projectName].push(w),O},{}),P=await H6({message:"How would you like to import?",options:[{value:"browse",label:"Browse by Project",hint:"Select project then conversations"},{value:"project",label:"Import Entire Project",hint:"Select project and import all conversations"},{value:"recent",label:"Recent Conversations",hint:"Import most recent across all projects"},{value:"search",label:"Search",hint:"Search for specific conversations"}]});if(L8(P)){$6("Import cancelled");return}let $=[];if(P==="browse"){let O=Object.entries(Y).sort((Z,J)=>J[1][0].parsedDate.getTime()-Z[1][0].parsedDate.getTime()).map(([Z,J])=>({value:Z,label:Z,hint:`${J.length} conversation${J.length===1?"":"s"}, latest: ${J[0].relativeDate}`})),w=await H6({message:"Select a project",options:O});if(L8(w)){$6("Import cancelled");return}let v=Y[w],z=await n6({message:"Would you like to generate titles for easier browsing?",initialValue:!1});if(L8(z)){$6("Import cancelled");return}if(z)await g$(v,w);let W=new MK,H=v.map((Z)=>{let J=W.getTitleForSession(Z.sessionId),X=J?`"${J}" • `:"";return{value:Z.sessionId,label:`${X}${Z.relativeDate} • ${Z.messageCount} messages • ${B7(Z.fileSize)}`,hint:Z.branch?`branch: ${Z.branch}`:void 0}});if(q.multi){let Z=await r2({message:`Select conversations from ${w} (Space to select, Enter to confirm)`,options:H,required:!1});if(L8(Z)){$6("Import cancelled");return}let J=Z;$=v.filter((X)=>J.includes(X.sessionId))}else{let Z=!0,J=new Set;while(Z&&v.length>J.size){let X=v.filter((m)=>!J.has(m.sessionId));if(X.length===0)break;let A=new MK,G=X.map((m)=>{let S=A.getTitleForSession(m.sessionId),b=S?`"${S}" • `:"";return{value:m.sessionId,label:`${b}${m.relativeDate} • ${m.messageCount} messages • ${B7(m.fileSize)}`,hint:m.branch?`branch: ${m.branch}`:void 0}}),D=await H6({message:`Select a conversation (${J.size}/${v.length} imported)`,options:[...G,{value:"done",label:"✅ Done importing",hint:"Exit import mode"}]});if(L8(D)||D==="done"){Z=!1;break}let V=X.find((m)=>m.sessionId===D);if(V)$=[V],await y$($,q.verbose),J.add(V.sessionId)}if(J.size>0)Hq(g.green(`✅ Imported ${J.size} conversation${J.size===1?"":"s"}`));else Hq(g.yellow("No conversations imported"));return}}else if(P==="project"){let O=Object.entries(Y).sort((H,Z)=>Z[1][0].parsedDate.getTime()-H[1][0].parsedDate.getTime()).map(([H,Z])=>({value:H,label:H,hint:`${Z.length} conversation${Z.length===1?"":"s"}, latest: ${Z[0].relativeDate}`})),w=await H6({message:"Select a project to import all conversations",options:O});if(L8(w)){$6("Import cancelled");return}let v=Y[w],z=await n6({message:"Would you like to generate titles for easier browsing?",initialValue:!1});if(L8(z)){$6("Import cancelled");return}if(z)await g$(v,w);let W=await n6({message:`Import all ${v.length} conversation${v.length===1?"":"s"} from ${w}?`});if(L8(W)||!W){$6("Import cancelled");return}$=v}else if(P==="recent"){let O=await G_({message:"How many recent conversations?",placeholder:"10",initialValue:"10",validate:(v)=>{let z=parseInt(v);if(isNaN(z)||z<1)return"Please enter a valid number";if(z>j.length)return`Only ${j.length} available`}});if(L8(O)){$6("Import cancelled");return}let w=parseInt(O);$=j.slice(0,w)}else if(P==="search"){let O=await G_({message:"Search conversations (project name or session ID)",placeholder:"Enter search term"});if(L8(O)){$6("Import cancelled");return}let w=O.toLowerCase(),v=j.filter((J)=>J.projectName.toLowerCase().includes(w)||J.sessionId.toLowerCase().includes(w)||J.branch&&J.branch.toLowerCase().includes(w));if(v.length===0){Hq(g.yellow("No matching conversations found"));return}let z=new MK,W=v.map((J)=>{let X=z.getTitleForSession(J.sessionId),A=X?`"${X}" • `:"";return{value:J.sessionId,label:`${A}${J.projectName} • ${J.relativeDate} • ${J.messageCount} msgs`,hint:B7(J.fileSize)}}),H=await r2({message:`Found ${v.length} matches. Select to import:`,options:W,required:!1});if(L8(H)){$6("Import cancelled");return}let Z=H;$=v.filter((J)=>Z.includes(J.sessionId))}if($.length>0)await y$($,q.verbose),Hq(g.green(`✅ Successfully imported ${$.length} conversation${$.length===1?"":"s"}`));else Hq(g.yellow("No conversations selected for import"))}async function g$(q,_){let j=new MK,K=j.getExistingTitles(),f=q.filter(($)=>!K.has($.sessionId));if(f.length===0){i2("All conversations already have titles!","Title Generation");return}let Y=_q();Y.start(`Generating titles for ${f.length} conversations...`);let P=f.map(($)=>({sessionId:$.sessionId,projectName:_,firstMessage:ID($.filePath)}));try{await j.batchGenerateTitles(P),Y.stop(`✅ Generated ${f.length} titles`)}catch($){Y.stop("❌ Failed to generate titles"),console.error(g.red(`Error: ${$}`))}}async function y$(q,_){let j=_q();for(let K=0;K<q.length;K++){let f=q[K],Y=q.length>1?`[${K+1}/${q.length}] `:"";j.start(`${Y}Importing ${f.projectName} (${f.relativeDate})`);try{let P=rq.basename(f.cwd);if(await new JK().compress(f.filePath,f.sessionId,P),j.stop(`${Y}Imported ${f.projectName} (${f.messageCount} messages)`),_)i2(`Session: ${f.sessionId}
467
+ Size: ${B7(f.fileSize)}
468
+ Branch: ${f.branch||"main"}`,"Details")}catch(P){if(j.stop(`${Y}Failed to import ${f.projectName}`),_)console.error(g.red(`Error: ${P}`))}}}w7();class o9{options;applauseMeter=0;tomatoCount=0;constructor(q={}){this.options=q}displayCurtainRaise(){let q=`
469
+ ${g.yellow("\uD83D\uDD6F️ \uD83D\uDD6F️ \uD83D\uDD6F️ GLOBE THEATRE \uD83D\uDD6F️ \uD83D\uDD6F️ \uD83D\uDD6F️")}
453
470
 
454
471
  ${M6.morning(`
455
472
  ╭─────────────────────────────────────╮
@@ -459,30 +476,30 @@ ${M6.morning(`
459
476
  ╰─────────────────────────────────────╯
460
477
  `)}
461
478
 
462
- ${I.dim("\uD83C\uDFBA *trumpet fanfare* \uD83C\uDFBA")}
479
+ ${g.dim("\uD83C\uDFBA *trumpet fanfare* \uD83C\uDFBA")}
463
480
  `;console.log(q)}displayActHeader(q,_,j){if(console.log(`
464
- `+"═".repeat(60)),console.log(I.bold.magenta(`\uD83C\uDFAD ACT ${q}: ${_.toUpperCase()}`)),j)console.log(I.italic.cyan(` "${j}"`));console.log("═".repeat(60)+`
465
- `)}soliloquy(q,_){console.log(I.bold.yellow(`
466
- ${q.toUpperCase()}:`)),_.forEach((j,K)=>{setTimeout(()=>{console.log(I.italic(` ${j}`))},K*500)})}async presentDialogue(q,_,j){if(console.log(I.bold.blue(`
467
- ${q.toUpperCase()}:`)),console.log(I.italic(` "${_}"`)),j&&j.length>0)return console.log(I.dim(`
468
- Choose thy response:`)),j.forEach((K,Y)=>{console.log(I.yellow(` ${Y+1}. ${K}`))}),j[0];return""}throwTomato(q){this.tomatoCount++,console.log(I.red(`\uD83C\uDF45 *SPLAT* - Tomato thrown! Reason: ${q}`)),console.log(I.dim(` Tomato count: ${this.tomatoCount}`))}addApplause(q=1){this.applauseMeter+=q;let _=this.getApplauseLevel();console.log(I.green(`\uD83D\uDC4F ${_} (${this.applauseMeter}/10)`))}getApplauseLevel(){if(this.applauseMeter>=10)return"STANDING OVATION! \uD83C\uDF89";if(this.applauseMeter>=7)return"Thunderous applause!";if(this.applauseMeter>=5)return"Hearty applause";if(this.applauseMeter>=3)return"Polite clapping";return"Scattered applause"}trumpetFanfare(){if(this.options.soundEffects)console.log(I.yellow("\uD83C\uDFBA *TA-DA-DA-DAAAA* \uD83C\uDFBA"))}dramaticError(q,_,j){if(console.log(I.red.bold(`
469
- \uD83D\uDC80 TRAGEDY STRIKES! \uD83D\uDC80`)),console.log(I.red(`
470
- Alas! A most grievous error in "${q}"`)),console.log(I.italic.red(` "${_}"`)),j)console.log(I.yellow(`
471
- But fear not! The wise fool suggests:`)),console.log(I.italic.yellow(` "${j}"`));console.log(I.dim(`
472
- *The crowd murmurs in concern*`))}displayCurtainFall(){console.log(I.yellow(`
481
+ `+"═".repeat(60)),console.log(g.bold.magenta(`\uD83C\uDFAD ACT ${q}: ${_.toUpperCase()}`)),j)console.log(g.italic.cyan(` "${j}"`));console.log("═".repeat(60)+`
482
+ `)}soliloquy(q,_){console.log(g.bold.yellow(`
483
+ ${q.toUpperCase()}:`)),_.forEach((j,K)=>{setTimeout(()=>{console.log(g.italic(` ${j}`))},K*500)})}async presentDialogue(q,_,j){if(console.log(g.bold.blue(`
484
+ ${q.toUpperCase()}:`)),console.log(g.italic(` "${_}"`)),j&&j.length>0)return console.log(g.dim(`
485
+ Choose thy response:`)),j.forEach((K,f)=>{console.log(g.yellow(` ${f+1}. ${K}`))}),j[0];return""}throwTomato(q){this.tomatoCount++,console.log(g.red(`\uD83C\uDF45 *SPLAT* - Tomato thrown! Reason: ${q}`)),console.log(g.dim(` Tomato count: ${this.tomatoCount}`))}addApplause(q=1){this.applauseMeter+=q;let _=this.getApplauseLevel();console.log(g.green(`\uD83D\uDC4F ${_} (${this.applauseMeter}/10)`))}getApplauseLevel(){if(this.applauseMeter>=10)return"STANDING OVATION! \uD83C\uDF89";if(this.applauseMeter>=7)return"Thunderous applause!";if(this.applauseMeter>=5)return"Hearty applause";if(this.applauseMeter>=3)return"Polite clapping";return"Scattered applause"}trumpetFanfare(){if(this.options.soundEffects)console.log(g.yellow("\uD83C\uDFBA *TA-DA-DA-DAAAA* \uD83C\uDFBA"))}dramaticError(q,_,j){if(console.log(g.red.bold(`
486
+ \uD83D\uDC80 TRAGEDY STRIKES! \uD83D\uDC80`)),console.log(g.red(`
487
+ Alas! A most grievous error in "${q}"`)),console.log(g.italic.red(` "${_}"`)),j)console.log(g.yellow(`
488
+ But fear not! The wise fool suggests:`)),console.log(g.italic.yellow(` "${j}"`));console.log(g.dim(`
489
+ *The crowd murmurs in concern*`))}displayCurtainFall(){console.log(g.yellow(`
473
490
  \uD83C\uDFAD Thus ends our performance! \uD83C\uDFAD
474
491
  "Exeunt, pursued by better memory"
475
492
 
476
- ${I.dim("*The Globe Theatre dims its candles*")}
493
+ ${g.dim("*The Globe Theatre dims its candles*")}
477
494
  \uD83D\uDD6F️ \uD83D\uDD6F️
478
- `))}}class p9{static memoryMetaphors=["remembrance","reverie","recollection","reminiscence","memoir","chronicle","annals","archive"];static dramaticAdjectives=["noble","fair","gentle","worthy","beauteous","sweet","gracious","wondrous","most excellent"];static nameMemoryOperation(q){let _=this.dramaticAdjectives[Math.floor(Math.random()*this.dramaticAdjectives.length)],j=this.memoryMetaphors[Math.floor(Math.random()*this.memoryMetaphors.length)];return`${_} ${j} of ${q}`}static formatMemorySize(q){let _=q/1024;if(_<1024)return`${_.toFixed(1)} fair kilobytes`;return`${(_/1024).toFixed(1)} noble megabytes`}}sq();class N_{static instance;static getInstance(){if(!N_.instance)N_.instance=new N_;return N_.instance}async presentDialogueChoice(q,_,j){return console.log(I.bold.blue(`
479
- ${q.toUpperCase()}:`)),console.log(I.italic(` "${_}"`)),await X6({message:"Choose thy response:",options:j.map((Y)=>({value:Y.value,label:Y.label,hint:Y.hint}))})}async tomatoThrowingGame(q){if(console.log(I.red(`
480
- \uD83C\uDF45 TOMATO THROWING TIME! \uD83C\uDF45`)),console.log(I.yellow(`Target: ${q}`)),await zq({message:"Dost thou wish to throw a tomato at this offensive code?"}))return console.log(I.red("\uD83C\uDF45 *SPLAT!* Direct hit!")),console.log(I.dim("*The audience cheers*")),!0;else return console.log(I.green("Thou art merciful this day.")),!1}async standingOvationMeter(q){console.log(I.yellow(`
481
- \uD83D\uDC4F Rate the performance: ${q}`));let _=await X6({message:"How dost thou rate this performance?",options:[{value:"1",label:"\uD83D\uDE34 Boring as a sermon",hint:"1/10 - Tomatoes incoming"},{value:"3",label:"\uD83D\uDE10 Adequate for a provincial theatre",hint:"3/10 - Polite golf claps"},{value:"5",label:"\uD83D\uDE0A Most entertaining!",hint:"5/10 - Hearty applause"},{value:"7",label:"\uD83D\uDE0D Brilliant performance!",hint:"7/10 - Thunderous applause"},{value:"10",label:"\uD83E\uDD29 STANDING OVATION!",hint:"10/10 - Encore! Encore!"}]});return parseInt(_)}async generateSoliloquy(q,_){console.log(I.bold.magenta(`
482
- \uD83C\uDFAD SOLILOQUY GENERATOR \uD83C\uDFAD`)),console.log(I.yellow(`${q} shall speak about: ${_}`));let j=await zq({message:"Wouldst thou contribute lines to this soliloquy?"}),K=[];if(j){console.log(I.cyan("Enter lines for the soliloquy (press Enter with empty line to finish):"));let Y=1;while(!0){let f=await X_({message:`Line ${Y}:`,placeholder:"Enter thy poetic line..."});if(!f||f.trim()==="")break;K.push(f),Y++}}else K.push(...this.getDefaultSoliloquyLines(_));return K}getDefaultSoliloquyLines(q){let _={memory:["What is memory but the echo of thoughts past?","In circuits deep, where data dreams reside,","Each byte a whisper of sessions gone by,","Compressed yet whole, like love in verse confined."],compression:["To compress, perchance to save - ay, there's the rub!","For in that compression, what data may come","When we have shuffled off this mortal coil","Of uncompressed transcripts?"],debugging:["Errors, errors everywhere, and not a fix in sight!","Each bug a riddle wrapped in mystery,","Hidden in the forest of our code,","Where fairies dance and exceptions play."],default:["All the world's a stage, and memory merely players,","They have their exits and their entrances,","And one codebase in its time plays many parts."]};return _[q]||_.default}async theatreTutorial(){console.log(I.bold.yellow(`
483
- \uD83C\uDFAD WELCOME TO SHAKESPEARE'S MEMORY THEATRE! \uD83C\uDFAD`)),console.log(I.cyan("Let me show thee the wonders of our theatrical system...")),await this.presentDialogueChoice("GUIDE","Welcome, noble user, to our grand theatre! How shall we begin?",[{value:"explore",label:"Show me the Acts!",hint:"Learn about the five acts"},{value:"interactive",label:"Teach me interactions!",hint:"Learn interactive features"},{value:"skip",label:"Skip tutorial",hint:"Jump to the main performance"}]),console.log(I.red(`
484
- \uD83C\uDF45 Tomato Throwing Demo:`)),await this.tomatoThrowingGame("if (x == null) return null; // Defensive programming"),await this.standingOvationMeter("Tutorial Introduction"),console.log(I.green(`
485
- ✨ Tutorial complete! Thou art ready for the grand performance!`))}async generateShakespeareanInsult(){let q=["artless","bawdy","beslubbering","bootless","churlish","cockered","clouted","craven","currish","dankish","dissembling","droning","errant","fawning","fobbing","froward","frothy","gleeking","goatish","gorbellied","impertinent","infectious","jarring","loggerheaded","lumpish","mammering","mangled","mewling","paunchy","pribbling","puking","puny","qualling","rank","reeky","roguish","ruttish","saucy","spleeny","spongy","surly","tottering","unmuzzled","vain","venomed","villainous","warped","wayward","weedy","yeasty"],_=["base-court","bat-fowling","beef-witted","beetle-headed","boil-brained","clapper-clawed","clay-brained","common-kissing","crook-pated","dismal-dreaming","dizzy-eyed","doghearted","dread-bolted","earth-vexing","elf-skinned","fat-kidneyed","fen-sucked","flap-mouthed","fly-bitten","folly-fallen","fool-born","full-gorged","guts-griping","half-faced","hasty-witted","hedge-born","hell-hated","idle-headed","ill-breeding","ill-nurtured","knotty-pated","milk-livered","motley-minded","onion-eyed","plume-plucked","pottle-deep","pox-marked","reeling-ripe","rough-hewn","rude-growing","rump-fed","shard-borne","sheep-biting","spur-galled","swag-bellied","tardy-gaited","tickle-brained","toad-spotted","unchin-snouted","weather-bitten"],j=["apple-john","baggage","barnacle","bladder","boar-pig","bugbear","bum-bailey","canker-blossom","clack-dish","clotpole","coxcomb","codpiece","death-token","dewberry","flap-dragon","flax-wench","flirt-gill","foot-licker","fustilarian","giglet","gudgeon","haggard","harpy","hedge-pig","horn-beast","hugger-mugger","joithead","lewdster","lout","maggot-pie","malt-worm","mammet","measle","minnow","miscreant","moldwarp","mumble-news","nut-hook","pigeon-egg","pignut","puttock","pumpion","ratsbane","scut","skainsmate","strumpet","varlot","vassal","whey-face","wagtail"],K=`${q[Math.floor(Math.random()*q.length)]} ${_[Math.floor(Math.random()*_.length)]} ${j[Math.floor(Math.random()*j.length)]}`;return console.log(I.red.bold(`
486
- "Thou ${K}!"`)),console.log(I.dim("- Generated by the Bard's Insult Engine")),K}}class N3{theatre;interactive;constructor(q={}){this.theatre=new d9(q),this.interactive=N_.getInstance()}async performActI(q,_={}){if(this.theatre.displayCurtainRaise(),this.theatre.displayActHeader("I","Tragedy of Defensive Validation","To validate or not to validate"),_.interactive){if(await this.interactive.presentDialogueChoice("HAMLET_VALIDATOR","To validate, or not to validate, that is the question! What say you, noble user?",[{value:"validate",label:"Validation is essential!",hint:"The safe but verbose path"},{value:"skip",label:"Away with defensive code!",hint:"Make it work first!"},{value:"wise",label:"Validate only what fails",hint:"The wise middle path"}])==="skip")console.log('\uD83C\uDFAD Ah! A follower of the "Make It Work First" manifesto!'),this.theatre.addApplause(2)}if(await this.theatre.soliloquy("COMPRESSOR",["To compress, or not to compress, that is the question:","Whether 'tis nobler in the mind to suffer","The slings and arrows of outrageous memory bloat,","Or to take arms against this sea of data troubles,","And by compressing, end them?"]),!q){if(this.theatre.dramaticError("Missing Manuscript","Alas! No transcript provided for our noble compression!","Pray tell, provide a path to thy transcript file"),_.interactive)await this.interactive.tomatoThrowingGame("Missing required parameters");else this.theatre.throwTomato("No transcript provided");return}try{let{compress:j}=await Promise.resolve().then(() => (P7(),pP));console.log(`
487
- \uD83C\uDFAD Beginning the compression ritual...`);let K=p9.nameMemoryOperation("compression");if(console.log(`\uD83D\uDCDC Performing: ${K}`),await j(q,_),this.theatre.addApplause(3),this.theatre.trumpetFanfare(),_.interactive){let Y=await this.interactive.standingOvationMeter("Compression Performance");this.theatre.addApplause(Math.floor(Y/2))}await this.theatre.presentDialogue("CHORUS","Behold! The transcript hath been compressed most excellently!",["Verily, 'tis a wonder!","What sorcery is this?","Most impressive, good sir!"])}catch(j){if(this.theatre.dramaticError("Compression Catastrophe",`A most grievous error: ${j}`,"Perchance restart thy magical contraption?"),_.interactive)await this.interactive.tomatoThrowingGame(`Compression error: ${j}`);else this.theatre.throwTomato("Compression failed")}}async performActII(q={}){if(this.theatre.displayActHeader("II","Romeo and Chroma_Add","What light through yonder vector breaks?"),await this.theatre.soliloquy("ROMEO_VECTOR",["But soft! What light through yonder vector breaks?","It is the memory, and the data is the sun!","Arise, fair data, and store the envious session","Who is already sick and pale with grief"]),q.interactive){if(await this.interactive.presentDialogueChoice("JULIET_CHROMA","Romeo, Romeo, wherefore art thou Romeo? Deny thy memory leaks and refuse thy overflow!",[{value:"compress",label:"Sweet Juliet, I shall compress thee gently",hint:"The romantic approach"},{value:"vectors",label:"My lady, thy vectors shine brighter than stars",hint:"The poetic approach"},{value:"join",label:"Fair maiden, let us join our data streams",hint:"The technical approach"}])==="join")console.log("\uD83D\uDC9D And thus began the greatest love story in vector space..."),this.theatre.addApplause(3)}else await this.theatre.presentDialogue("JULIET_CHROMA","Romeo, Romeo, wherefore art thou Romeo? Deny thy memory leaks and refuse thy overflow!",["Sweet Juliet, I shall compress thee gently","My lady, thy vectors shine brighter than stars","Fair maiden, let us join our data streams"]);this.theatre.addApplause(2),console.log("\uD83D\uDC9D Memory and Data live happily ever after in the vector space...")}async performActIII(q={}){this.theatre.displayActHeader("III","Tempest of Memory Leaks","We are such stuff as sessions are made on"),await this.theatre.soliloquy("PROSPERO_MEMORY",["Our revels now are ended. These our actors,","As I foretold you, were all spirits and","Are melted into air, into thin air:","And, like the baseless fabric of this vision,","The memory-soaked towers, the gorgeous palaces,","The solemn temples, the great globe itself,","Yea, all which it inherit, shall dissolve","And, like this insubstantial pageant faded,","Leave not a rack behind. We are such stuff","As sessions are made on, and our little life","Is rounded with a sleep... and garbage collection."]);try{let{status:_}=await Promise.resolve().then(() => (W9(),Gf));console.log(`
488
- \uD83C\uDF0A Calming the tempest of memory...`),await _(),this.theatre.addApplause(2)}catch(_){this.theatre.dramaticError("Memory Storm",`${_}`,"Call upon Ariel to debug thy system")}}async performActIV(q={}){this.theatre.displayActHeader("IV","Much Ado About Compression","A comedy of errors and algorithms"),await this.theatre.presentDialogue("BENEDICK_COMPRESSOR","I had rather hear my dog bark at a crow than hear a man swear he can compress better than me!",["Challenge accepted, good sir!","Thy algorithms are weak!","Let us duel with our compression ratios!"]),await this.theatre.presentDialogue("BEATRICE_OPTIMIZER","I wonder that you will still be talking, Benedick. Nobody marks thy compression times!",["But my lady, observe these metrics!","Thy optimization is but a jest!","Together we shall compress the world!"]),console.log("\uD83D\uDE04 *Much witty banter about algorithms ensues*"),this.theatre.addApplause(3)}async performActV(q={}){this.theatre.displayActHeader("V","Midsummer Night's Debug","Through the mystical forest of troubleshooting"),await this.theatre.presentDialogue("PUCK_DEBUGGER","Lord, what fools these mortals be! Their code is tangled like the fairy paths!",["Help us, mischievous sprite!","Cast thy debugging spells!","Show us the path through this error forest!"]),await this.theatre.soliloquy("OBERON_ADMIN",["I know a bank where the wild thyme grows,","Where oxlips and the nodding violet grows,","And there the logs shall show us all errors","That mortal programmers in their folly write."]);try{let{logs:_}=await Promise.resolve().then(() => (H9(),hf));console.log("\uD83E\uDDDA‍♂️ *Puck sprinkles magical debugging dust*"),await _(),this.theatre.addApplause(2)}catch(_){this.theatre.dramaticError("Forest of Confusion",`${_}`,"Follow the fairy lights to resolution")}}async performCompletePlay(q,..._){switch(this.theatre.displayCurtainRaise(),q){case"compress":await this.performActI(_[0],_[1]);break;case"status":await this.performActIII(_[0]);break;case"logs":await this.performActV(_[0]);break;default:await this.performActI(),await this.performActII(),await this.performActIII(),await this.performActIV(),await this.performActV()}this.theatre.displayCurtainFall()}}var K6=new H5;K6.name(iq).description(h5).version(u5);K6.command("compress [transcript]").description("Compress a Claude Code transcript into memory").option("--output <path>","Output directory for compressed files").option("--dry-run","Show what would be compressed without doing it").option("-v, --verbose","Show detailed output").action(vK);K6.command("install").description("Install Claude Code hooks for automatic compression").option("--user","Install for current user (default)").option("--project","Install for current project only").option("--local","Install to custom local directory").option("--path <path>","Custom installation path (with --local)").option("--timeout <ms>","Hook execution timeout in milliseconds","180000").option("--skip-mcp","Skip Chroma MCP server installation").option("--force","Force installation even if already installed").action(kf);K6.command("uninstall").description("Remove Claude Code hooks").option("--user","Remove from user settings (default)").option("--project","Remove from project settings").option("--all","Remove from both user and project settings").action(Af);K6.command("status").description("Check installation status of Claude Memory System").action(z9);K6.command("logs").description("View claude-mem operation logs").option("--debug","Show debug logs only").option("--error","Show error logs only").option("--tail [n]","Show last n lines","50").option("--follow","Follow log output").action(J9);K6.command("load-context").description("Load compressed memories for current session").option("--project <name>","Filter by project name").option("--count <n>","Number of memories to load","10").option("--raw","Output raw JSON instead of formatted text").option("--format <type>","Output format: json, session-start, or default").action(D7);var L9=K6.command("trash").description("Manage trash bin for safe file deletion").argument("[files...]","Files to move to trash").option("-r, --recursive","Remove directories recursively").option("-R","Remove directories recursively (same as -r)").option("-f, --force","Suppress errors for nonexistent files").action(async(q,_)=>{if(!q||q.length===0){L9.outputHelp();return}if(_.R)_.recursive=!0;await A$(q,{force:_.force,recursive:_.recursive})});L9.command("view").description("View contents of trash bin").action(async()=>{let{viewTrash:q}=await Promise.resolve().then(() => (p$(),d$));await q()});L9.command("empty").description("Permanently delete all files in trash").option("-f, --force","Skip confirmation prompt").action(async(q)=>{let{emptyTrash:_}=await Promise.resolve().then(() => (x$(),l$));await _(q)});K6.command("restore").description("Restore files from trash interactively").action(u$);K6.command("save <message>").description("Save a message to the memory system").action(h$);K6.command("casino").description("\uD83C\uDFB0 Enter the Vegas Casino for memory compression gambling!").action(M$);K6.command("import-history").description("Import historical Claude Code conversations into memory").option("-v, --verbose","Show detailed output").option("-m, --multi","Enable multi-select mode (default is single-select)").action(E$);K6.command("theatre").description("\uD83C\uDFAD Enter Shakespeare's Memory Theatre - All the world's a stage!").option("--act <number>","Perform specific act (I, II, III, IV, V)").option("--interactive","Enable interactive dialogue system").option("--sound-effects","Enable trumpet fanfares and sound effects").option("-v, --verbose","Verbose theatrical narration").action(async(q)=>{let _=new N3({verbose:q.verbose,interactive:q.interactive,soundEffects:q.soundEffects});if(q.act)switch(q.act.toUpperCase()){case"I":await _.performActI();break;case"II":await _.performActII();break;case"III":await _.performActIII();break;case"IV":await _.performActIV();break;case"V":await _.performActV();break;default:console.log("\uD83C\uDFAD Available acts: I, II, III, IV, V")}else await _.performCompletePlay("theatre")});K6.command("compress-theatrical [transcript]").description('\uD83C\uDFAD Compress with Shakespearean flair - "To compress or not to compress"').option("--output <path>","Output directory for compressed files").option("--dry-run","Show what would be compressed without doing it").option("-v, --verbose","Show detailed theatrical output").option("--interactive","Enable dialogue options").action(async(q,_)=>{await new N3({verbose:_.verbose,interactive:_.interactive}).performActI(q,_)});K6.command("status-theatrical").description('\uD83C\uDFAD Check system status with dramatic flair - "Tempest of Memory Leaks"').option("-v, --verbose","Verbose theatrical narration").option("--interactive","Enable dialogue options").action(async(q)=>{await new N3({verbose:q.verbose,interactive:q.interactive}).performActIII(q)});K6.command("hook:pre-compact",{hidden:!0}).description("Internal pre-compact hook handler").action(async()=>{let{preCompactHook:q}=await Promise.resolve().then(() => (i7(),r7));await q()});K6.command("hook:session-start",{hidden:!0}).description("Internal session-start hook handler").action(async()=>{let{sessionStartHook:q}=await Promise.resolve().then(() => (i7(),r7));await q()});K6.command("hook:session-end",{hidden:!0}).description("Internal session-end hook handler").action(async()=>{let{sessionEndHook:q}=await Promise.resolve().then(() => (i7(),r7));await q()});K6.command("debug-filter").description("Show filtered transcript output (first 5 messages)").argument("<transcript-path>","Path to transcript file").action((q)=>{new OK().showFilteredOutput(q)});K6.parse();
495
+ `))}}class a9{static memoryMetaphors=["remembrance","reverie","recollection","reminiscence","memoir","chronicle","annals","archive"];static dramaticAdjectives=["noble","fair","gentle","worthy","beauteous","sweet","gracious","wondrous","most excellent"];static nameMemoryOperation(q){let _=this.dramaticAdjectives[Math.floor(Math.random()*this.dramaticAdjectives.length)],j=this.memoryMetaphors[Math.floor(Math.random()*this.memoryMetaphors.length)];return`${_} ${j} of ${q}`}static formatMemorySize(q){let _=q/1024;if(_<1024)return`${_.toFixed(1)} fair kilobytes`;return`${(_/1024).toFixed(1)} noble megabytes`}}Qq();class E_{static instance;static getInstance(){if(!E_.instance)E_.instance=new E_;return E_.instance}async presentDialogueChoice(q,_,j){return console.log(g.bold.blue(`
496
+ ${q.toUpperCase()}:`)),console.log(g.italic(` "${_}"`)),await H6({message:"Choose thy response:",options:j.map((f)=>({value:f.value,label:f.label,hint:f.hint}))})}async tomatoThrowingGame(q){if(console.log(g.red(`
497
+ \uD83C\uDF45 TOMATO THROWING TIME! \uD83C\uDF45`)),console.log(g.yellow(`Target: ${q}`)),await n6({message:"Dost thou wish to throw a tomato at this offensive code?"}))return console.log(g.red("\uD83C\uDF45 *SPLAT!* Direct hit!")),console.log(g.dim("*The audience cheers*")),!0;else return console.log(g.green("Thou art merciful this day.")),!1}async standingOvationMeter(q){console.log(g.yellow(`
498
+ \uD83D\uDC4F Rate the performance: ${q}`));let _=await H6({message:"How dost thou rate this performance?",options:[{value:"1",label:"\uD83D\uDE34 Boring as a sermon",hint:"1/10 - Tomatoes incoming"},{value:"3",label:"\uD83D\uDE10 Adequate for a provincial theatre",hint:"3/10 - Polite golf claps"},{value:"5",label:"\uD83D\uDE0A Most entertaining!",hint:"5/10 - Hearty applause"},{value:"7",label:"\uD83D\uDE0D Brilliant performance!",hint:"7/10 - Thunderous applause"},{value:"10",label:"\uD83E\uDD29 STANDING OVATION!",hint:"10/10 - Encore! Encore!"}]});return parseInt(_)}async generateSoliloquy(q,_){console.log(g.bold.magenta(`
499
+ \uD83C\uDFAD SOLILOQUY GENERATOR \uD83C\uDFAD`)),console.log(g.yellow(`${q} shall speak about: ${_}`));let j=await n6({message:"Wouldst thou contribute lines to this soliloquy?"}),K=[];if(j){console.log(g.cyan("Enter lines for the soliloquy (press Enter with empty line to finish):"));let f=1;while(!0){let Y=await G_({message:`Line ${f}:`,placeholder:"Enter thy poetic line..."});if(!Y||Y.trim()==="")break;K.push(Y),f++}}else K.push(...this.getDefaultSoliloquyLines(_));return K}getDefaultSoliloquyLines(q){let _={memory:["What is memory but the echo of thoughts past?","In circuits deep, where data dreams reside,","Each byte a whisper of sessions gone by,","Compressed yet whole, like love in verse confined."],compression:["To compress, perchance to save - ay, there's the rub!","For in that compression, what data may come","When we have shuffled off this mortal coil","Of uncompressed transcripts?"],debugging:["Errors, errors everywhere, and not a fix in sight!","Each bug a riddle wrapped in mystery,","Hidden in the forest of our code,","Where fairies dance and exceptions play."],default:["All the world's a stage, and memory merely players,","They have their exits and their entrances,","And one codebase in its time plays many parts."]};return _[q]||_.default}async theatreTutorial(){console.log(g.bold.yellow(`
500
+ \uD83C\uDFAD WELCOME TO SHAKESPEARE'S MEMORY THEATRE! \uD83C\uDFAD`)),console.log(g.cyan("Let me show thee the wonders of our theatrical system...")),await this.presentDialogueChoice("GUIDE","Welcome, noble user, to our grand theatre! How shall we begin?",[{value:"explore",label:"Show me the Acts!",hint:"Learn about the five acts"},{value:"interactive",label:"Teach me interactions!",hint:"Learn interactive features"},{value:"skip",label:"Skip tutorial",hint:"Jump to the main performance"}]),console.log(g.red(`
501
+ \uD83C\uDF45 Tomato Throwing Demo:`)),await this.tomatoThrowingGame("if (x == null) return null; // Defensive programming"),await this.standingOvationMeter("Tutorial Introduction"),console.log(g.green(`
502
+ ✨ Tutorial complete! Thou art ready for the grand performance!`))}async generateShakespeareanInsult(){let q=["artless","bawdy","beslubbering","bootless","churlish","cockered","clouted","craven","currish","dankish","dissembling","droning","errant","fawning","fobbing","froward","frothy","gleeking","goatish","gorbellied","impertinent","infectious","jarring","loggerheaded","lumpish","mammering","mangled","mewling","paunchy","pribbling","puking","puny","qualling","rank","reeky","roguish","ruttish","saucy","spleeny","spongy","surly","tottering","unmuzzled","vain","venomed","villainous","warped","wayward","weedy","yeasty"],_=["base-court","bat-fowling","beef-witted","beetle-headed","boil-brained","clapper-clawed","clay-brained","common-kissing","crook-pated","dismal-dreaming","dizzy-eyed","doghearted","dread-bolted","earth-vexing","elf-skinned","fat-kidneyed","fen-sucked","flap-mouthed","fly-bitten","folly-fallen","fool-born","full-gorged","guts-griping","half-faced","hasty-witted","hedge-born","hell-hated","idle-headed","ill-breeding","ill-nurtured","knotty-pated","milk-livered","motley-minded","onion-eyed","plume-plucked","pottle-deep","pox-marked","reeling-ripe","rough-hewn","rude-growing","rump-fed","shard-borne","sheep-biting","spur-galled","swag-bellied","tardy-gaited","tickle-brained","toad-spotted","unchin-snouted","weather-bitten"],j=["apple-john","baggage","barnacle","bladder","boar-pig","bugbear","bum-bailey","canker-blossom","clack-dish","clotpole","coxcomb","codpiece","death-token","dewberry","flap-dragon","flax-wench","flirt-gill","foot-licker","fustilarian","giglet","gudgeon","haggard","harpy","hedge-pig","horn-beast","hugger-mugger","joithead","lewdster","lout","maggot-pie","malt-worm","mammet","measle","minnow","miscreant","moldwarp","mumble-news","nut-hook","pigeon-egg","pignut","puttock","pumpion","ratsbane","scut","skainsmate","strumpet","varlot","vassal","whey-face","wagtail"],K=`${q[Math.floor(Math.random()*q.length)]} ${_[Math.floor(Math.random()*_.length)]} ${j[Math.floor(Math.random()*j.length)]}`;return console.log(g.red.bold(`
503
+ "Thou ${K}!"`)),console.log(g.dim("- Generated by the Bard's Insult Engine")),K}}class m3{theatre;interactive;constructor(q={}){this.theatre=new o9(q),this.interactive=E_.getInstance()}async performActI(q,_={}){if(this.theatre.displayCurtainRaise(),this.theatre.displayActHeader("I","Tragedy of Defensive Validation","To validate or not to validate"),_.interactive){if(await this.interactive.presentDialogueChoice("HAMLET_VALIDATOR","To validate, or not to validate, that is the question! What say you, noble user?",[{value:"validate",label:"Validation is essential!",hint:"The safe but verbose path"},{value:"skip",label:"Away with defensive code!",hint:"Make it work first!"},{value:"wise",label:"Validate only what fails",hint:"The wise middle path"}])==="skip")console.log('\uD83C\uDFAD Ah! A follower of the "Make It Work First" manifesto!'),this.theatre.addApplause(2)}if(await this.theatre.soliloquy("COMPRESSOR",["To compress, or not to compress, that is the question:","Whether 'tis nobler in the mind to suffer","The slings and arrows of outrageous memory bloat,","Or to take arms against this sea of data troubles,","And by compressing, end them?"]),!q){if(this.theatre.dramaticError("Missing Manuscript","Alas! No transcript provided for our noble compression!","Pray tell, provide a path to thy transcript file"),_.interactive)await this.interactive.tomatoThrowingGame("Missing required parameters");else this.theatre.throwTomato("No transcript provided");return}try{let{compress:j}=await Promise.resolve().then(() => (O7(),rP));console.log(`
504
+ \uD83C\uDFAD Beginning the compression ritual...`);let K=a9.nameMemoryOperation("compression");if(console.log(`\uD83D\uDCDC Performing: ${K}`),await j(q,_),this.theatre.addApplause(3),this.theatre.trumpetFanfare(),_.interactive){let f=await this.interactive.standingOvationMeter("Compression Performance");this.theatre.addApplause(Math.floor(f/2))}await this.theatre.presentDialogue("CHORUS","Behold! The transcript hath been compressed most excellently!",["Verily, 'tis a wonder!","What sorcery is this?","Most impressive, good sir!"])}catch(j){if(this.theatre.dramaticError("Compression Catastrophe",`A most grievous error: ${j}`,"Perchance restart thy magical contraption?"),_.interactive)await this.interactive.tomatoThrowingGame(`Compression error: ${j}`);else this.theatre.throwTomato("Compression failed")}}async performActII(q={}){if(this.theatre.displayActHeader("II","Romeo and Chroma_Add","What light through yonder vector breaks?"),await this.theatre.soliloquy("ROMEO_VECTOR",["But soft! What light through yonder vector breaks?","It is the memory, and the data is the sun!","Arise, fair data, and store the envious session","Who is already sick and pale with grief"]),q.interactive){if(await this.interactive.presentDialogueChoice("JULIET_CHROMA","Romeo, Romeo, wherefore art thou Romeo? Deny thy memory leaks and refuse thy overflow!",[{value:"compress",label:"Sweet Juliet, I shall compress thee gently",hint:"The romantic approach"},{value:"vectors",label:"My lady, thy vectors shine brighter than stars",hint:"The poetic approach"},{value:"join",label:"Fair maiden, let us join our data streams",hint:"The technical approach"}])==="join")console.log("\uD83D\uDC9D And thus began the greatest love story in vector space..."),this.theatre.addApplause(3)}else await this.theatre.presentDialogue("JULIET_CHROMA","Romeo, Romeo, wherefore art thou Romeo? Deny thy memory leaks and refuse thy overflow!",["Sweet Juliet, I shall compress thee gently","My lady, thy vectors shine brighter than stars","Fair maiden, let us join our data streams"]);this.theatre.addApplause(2),console.log("\uD83D\uDC9D Memory and Data live happily ever after in the vector space...")}async performActIII(q={}){this.theatre.displayActHeader("III","Tempest of Memory Leaks","We are such stuff as sessions are made on"),await this.theatre.soliloquy("PROSPERO_MEMORY",["Our revels now are ended. These our actors,","As I foretold you, were all spirits and","Are melted into air, into thin air:","And, like the baseless fabric of this vision,","The memory-soaked towers, the gorgeous palaces,","The solemn temples, the great globe itself,","Yea, all which it inherit, shall dissolve","And, like this insubstantial pageant faded,","Leave not a rack behind. We are such stuff","As sessions are made on, and our little life","Is rounded with a sleep... and garbage collection."]);try{let{status:_}=await Promise.resolve().then(() => (u9(),MY));console.log(`
505
+ \uD83C\uDF0A Calming the tempest of memory...`),await _(),this.theatre.addApplause(2)}catch(_){this.theatre.dramaticError("Memory Storm",`${_}`,"Call upon Ariel to debug thy system")}}async performActIV(q={}){this.theatre.displayActHeader("IV","Much Ado About Compression","A comedy of errors and algorithms"),await this.theatre.presentDialogue("BENEDICK_COMPRESSOR","I had rather hear my dog bark at a crow than hear a man swear he can compress better than me!",["Challenge accepted, good sir!","Thy algorithms are weak!","Let us duel with our compression ratios!"]),await this.theatre.presentDialogue("BEATRICE_OPTIMIZER","I wonder that you will still be talking, Benedick. Nobody marks thy compression times!",["But my lady, observe these metrics!","Thy optimization is but a jest!","Together we shall compress the world!"]),console.log("\uD83D\uDE04 *Much witty banter about algorithms ensues*"),this.theatre.addApplause(3)}async performActV(q={}){this.theatre.displayActHeader("V","Midsummer Night's Debug","Through the mystical forest of troubleshooting"),await this.theatre.presentDialogue("PUCK_DEBUGGER","Lord, what fools these mortals be! Their code is tangled like the fairy paths!",["Help us, mischievous sprite!","Cast thy debugging spells!","Show us the path through this error forest!"]),await this.theatre.soliloquy("OBERON_ADMIN",["I know a bank where the wild thyme grows,","Where oxlips and the nodding violet grows,","And there the logs shall show us all errors","That mortal programmers in their folly write."]);try{let{logs:_}=await Promise.resolve().then(() => (D9(),bY));console.log("\uD83E\uDDDA‍♂️ *Puck sprinkles magical debugging dust*"),await _(),this.theatre.addApplause(2)}catch(_){this.theatre.dramaticError("Forest of Confusion",`${_}`,"Follow the fairy lights to resolution")}}async performCompletePlay(q,..._){switch(this.theatre.displayCurtainRaise(),q){case"compress":await this.performActI(_[0],_[1]);break;case"status":await this.performActIII(_[0]);break;case"logs":await this.performActV(_[0]);break;default:await this.performActI(),await this.performActII(),await this.performActIII(),await this.performActIV(),await this.performActV()}this.theatre.displayCurtainFall()}}var K6=new D5;K6.name(oq).description(R5).version(E5);K6.command("compress [transcript]").description("Compress a Claude Code transcript into memory").option("--output <path>","Output directory for compressed files").option("--dry-run","Show what would be compressed without doing it").option("-v, --verbose","Show detailed output").action(HK);K6.command("install").description("Install Claude Code hooks for automatic compression").option("--user","Install for current user (default)").option("--project","Install for current project only").option("--local","Install to custom local directory").option("--path <path>","Custom installation path (with --local)").option("--timeout <ms>","Hook execution timeout in milliseconds","180000").option("--skip-mcp","Skip Chroma MCP server installation").option("--force","Force installation even if already installed").action(DY);K6.command("uninstall").description("Remove Claude Code hooks").option("--user","Remove from user settings (default)").option("--project","Remove from project settings").option("--all","Remove from both user and project settings").action(VY);K6.command("status").description("Check installation status of Claude Memory System").action(G9);K6.command("logs").description("View claude-mem operation logs").option("--debug","Show debug logs only").option("--error","Show error logs only").option("--tail [n]","Show last n lines","50").option("--follow","Follow log output").action(h9);K6.command("load-context").description("Load compressed memories for current session").option("--project <name>","Filter by project name").option("--count <n>","Number of memories to load","10").option("--raw","Output raw JSON instead of formatted text").option("--format <type>","Output format: json, session-start, or default").action(b7);var B9=K6.command("trash").description("Manage trash bin for safe file deletion").argument("[files...]","Files to move to trash").option("-r, --recursive","Remove directories recursively").option("-R","Remove directories recursively (same as -r)").option("-f, --force","Suppress errors for nonexistent files").action(async(q,_)=>{if(!q||q.length===0){B9.outputHelp();return}if(_.R)_.recursive=!0;await C$(q,{force:_.force,recursive:_.recursive})});B9.command("view").description("View contents of trash bin").action(async()=>{let{viewTrash:q}=await Promise.resolve().then(() => (i$(),r$));await q()});B9.command("empty").description("Permanently delete all files in trash").option("-f, --force","Skip confirmation prompt").action(async(q)=>{let{emptyTrash:_}=await Promise.resolve().then(() => (B$(),a$));await _(q)});K6.command("restore").description("Restore files from trash interactively").action(M$);K6.command("save <message>").description("Save a message to the memory system").action(N$);K6.command("casino").description("\uD83C\uDFB0 Enter the Vegas Casino for memory compression gambling!").action(R$);K6.command("import-history").description("Import historical Claude Code conversations into memory").option("-v, --verbose","Show detailed output").option("-m, --multi","Enable multi-select mode (default is single-select)").action(p$);K6.command("theatre").description("\uD83C\uDFAD Enter Shakespeare's Memory Theatre - All the world's a stage!").option("--act <number>","Perform specific act (I, II, III, IV, V)").option("--interactive","Enable interactive dialogue system").option("--sound-effects","Enable trumpet fanfares and sound effects").option("-v, --verbose","Verbose theatrical narration").action(async(q)=>{let _=new m3({verbose:q.verbose,interactive:q.interactive,soundEffects:q.soundEffects});if(q.act)switch(q.act.toUpperCase()){case"I":await _.performActI();break;case"II":await _.performActII();break;case"III":await _.performActIII();break;case"IV":await _.performActIV();break;case"V":await _.performActV();break;default:console.log("\uD83C\uDFAD Available acts: I, II, III, IV, V")}else await _.performCompletePlay("theatre")});K6.command("compress-theatrical [transcript]").description('\uD83C\uDFAD Compress with Shakespearean flair - "To compress or not to compress"').option("--output <path>","Output directory for compressed files").option("--dry-run","Show what would be compressed without doing it").option("-v, --verbose","Show detailed theatrical output").option("--interactive","Enable dialogue options").action(async(q,_)=>{await new m3({verbose:_.verbose,interactive:_.interactive}).performActI(q,_)});K6.command("status-theatrical").description('\uD83C\uDFAD Check system status with dramatic flair - "Tempest of Memory Leaks"').option("-v, --verbose","Verbose theatrical narration").option("--interactive","Enable dialogue options").action(async(q)=>{await new m3({verbose:q.verbose,interactive:q.interactive}).performActIII(q)});K6.command("hook:pre-compact",{hidden:!0}).description("Internal pre-compact hook handler").action(async()=>{let{preCompactHook:q}=await Promise.resolve().then(() => (e7(),t7));await q()});K6.command("hook:session-start",{hidden:!0}).description("Internal session-start hook handler").action(async()=>{let{sessionStartHook:q}=await Promise.resolve().then(() => (e7(),t7));await q()});K6.command("hook:session-end",{hidden:!0}).description("Internal session-end hook handler").action(async()=>{let{sessionEndHook:q}=await Promise.resolve().then(() => (e7(),t7));await q()});K6.command("debug-filter").description("Show filtered transcript output (first 5 messages)").argument("<transcript-path>","Path to transcript file").action((q)=>{new JK().showFilteredOutput(q)});K6.parse();