@trail-cli/sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +31 -0
- package/dist/index.global.js +232 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +932 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";var TrailSDK=(()=>{var Nl=Object.create;var Et=Object.defineProperty;var Cl=Object.getOwnPropertyDescriptor;var Ol=Object.getOwnPropertyNames;var Ll=Object.getPrototypeOf,Il=Object.prototype.hasOwnProperty;var ql=(s,e,t)=>e in s?Et(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var ls=(s=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(s,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):s)(function(s){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var v=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),or=(s,e)=>{for(var t in e)Et(s,t,{get:e[t],enumerable:!0})},lr=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ol(e))!Il.call(s,i)&&i!==t&&Et(s,i,{get:()=>e[i],enumerable:!(n=Cl(e,i))||n.enumerable});return s};var Ml=(s,e,t)=>(t=s!=null?Nl(Ll(s)):{},lr(e||!s||!s.__esModule?Et(t,"default",{value:s,enumerable:!0}):t,s)),Pl=s=>lr(Et({},"__esModule",{value:!0}),s);var R=(s,e,t)=>ql(s,typeof e!="symbol"?e+"":e,t);var P=v(U=>{"use strict";var kn=Symbol.for("yaml.alias"),wr=Symbol.for("yaml.document"),ps=Symbol.for("yaml.map"),Sr=Symbol.for("yaml.pair"),_n=Symbol.for("yaml.scalar"),ms=Symbol.for("yaml.seq"),be=Symbol.for("yaml.node.type"),Hc=s=>!!s&&typeof s=="object"&&s[be]===kn,Yc=s=>!!s&&typeof s=="object"&&s[be]===wr,Jc=s=>!!s&&typeof s=="object"&&s[be]===ps,Zc=s=>!!s&&typeof s=="object"&&s[be]===Sr,kr=s=>!!s&&typeof s=="object"&&s[be]===_n,zc=s=>!!s&&typeof s=="object"&&s[be]===ms;function _r(s){if(s&&typeof s=="object")switch(s[be]){case ps:case ms:return!0}return!1}function Wc(s){if(s&&typeof s=="object")switch(s[be]){case kn:case ps:case _n:case ms:return!0}return!1}var Qc=s=>(kr(s)||_r(s))&&!!s.anchor;U.ALIAS=kn;U.DOC=wr;U.MAP=ps;U.NODE_TYPE=be;U.PAIR=Sr;U.SCALAR=_n;U.SEQ=ms;U.hasAnchor=Qc;U.isAlias=Hc;U.isCollection=_r;U.isDocument=Yc;U.isMap=Jc;U.isNode=Wc;U.isPair=Zc;U.isScalar=kr;U.isSeq=zc});var Ot=v(Tn=>{"use strict";var K=P(),z=Symbol("break visit"),Tr=Symbol("skip children"),fe=Symbol("remove node");function gs(s,e){let t=xr(e);K.isDocument(s)?ut(null,s.contents,t,Object.freeze([s]))===fe&&(s.contents=null):ut(null,s,t,Object.freeze([]))}gs.BREAK=z;gs.SKIP=Tr;gs.REMOVE=fe;function ut(s,e,t,n){let i=Er(s,e,t,n);if(K.isNode(i)||K.isPair(i))return Ar(s,n,i),ut(s,i,t,n);if(typeof i!="symbol"){if(K.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let a=ut(r,e.items[r],t,n);if(typeof a=="number")r=a-1;else{if(a===z)return z;a===fe&&(e.items.splice(r,1),r-=1)}}}else if(K.isPair(e)){n=Object.freeze(n.concat(e));let r=ut("key",e.key,t,n);if(r===z)return z;r===fe&&(e.key=null);let a=ut("value",e.value,t,n);if(a===z)return z;a===fe&&(e.value=null)}}return i}async function ys(s,e){let t=xr(e);K.isDocument(s)?await ft(null,s.contents,t,Object.freeze([s]))===fe&&(s.contents=null):await ft(null,s,t,Object.freeze([]))}ys.BREAK=z;ys.SKIP=Tr;ys.REMOVE=fe;async function ft(s,e,t,n){let i=await Er(s,e,t,n);if(K.isNode(i)||K.isPair(i))return Ar(s,n,i),ft(s,i,t,n);if(typeof i!="symbol"){if(K.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let a=await ft(r,e.items[r],t,n);if(typeof a=="number")r=a-1;else{if(a===z)return z;a===fe&&(e.items.splice(r,1),r-=1)}}}else if(K.isPair(e)){n=Object.freeze(n.concat(e));let r=await ft("key",e.key,t,n);if(r===z)return z;r===fe&&(e.key=null);let a=await ft("value",e.value,t,n);if(a===z)return z;a===fe&&(e.value=null)}}return i}function xr(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function Er(s,e,t,n){var i,r,a,o,l;if(typeof t=="function")return t(s,e,n);if(K.isMap(e))return(i=t.Map)==null?void 0:i.call(t,s,e,n);if(K.isSeq(e))return(r=t.Seq)==null?void 0:r.call(t,s,e,n);if(K.isPair(e))return(a=t.Pair)==null?void 0:a.call(t,s,e,n);if(K.isScalar(e))return(o=t.Scalar)==null?void 0:o.call(t,s,e,n);if(K.isAlias(e))return(l=t.Alias)==null?void 0:l.call(t,s,e,n)}function Ar(s,e,t){let n=e[e.length-1];if(K.isCollection(n))n.items[s]=t;else if(K.isPair(n))s==="key"?n.key=t:n.value=t;else if(K.isDocument(n))n.contents=t;else{let i=K.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}Tn.visit=gs;Tn.visitAsync=ys});var xn=v(Cr=>{"use strict";var Nr=P(),Xc=Ot(),eu={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},tu=s=>s.replace(/[!,[\]{}]/g,e=>eu[e]),Lt=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,a]=n;return this.tags[r]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let a=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,a),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(a){return t(String(a)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+tu(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&Nr.isNode(e.contents)){let r={};Xc.visit(e.contents,(a,o)=>{Nr.isNode(o)&&o.tag&&(r[o.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,a]of n)r==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(o=>o.startsWith(a)))&&t.push(`%TAG ${r} ${a}`);return t.join(`
|
|
2
|
+
`)}};Lt.defaultYaml={explicit:!1,version:"1.2"};Lt.defaultTags={"!!":"tag:yaml.org,2002:"};Cr.Directives=Lt});var bs=v(It=>{"use strict";var Or=P(),su=Ot();function nu(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Lr(s){let e=new Set;return su.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Ir(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function iu(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i!=null||(i=Lr(s));let a=Ir(e,i);return i.add(a),a},setAnchors:()=>{for(let r of t){let a=n.get(r);if(typeof a=="object"&&a.anchor&&(Or.isScalar(a.node)||Or.isCollection(a.node)))a.node.anchor=a.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=r,o}}},sourceObjects:n}}It.anchorIsValid=nu;It.anchorNames=Lr;It.createNodeAnchors=iu;It.findNewAnchor=Ir});var En=v(qr=>{"use strict";function qt(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let a=n[i],o=qt(s,n,String(i),a);o===void 0?delete n[i]:o!==a&&(n[i]=o)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),a=qt(s,n,i,r);a===void 0?n.delete(i):a!==r&&n.set(i,a)}else if(n instanceof Set)for(let i of Array.from(n)){let r=qt(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let a=qt(s,n,i,r);a===void 0?delete n[i]:a!==r&&(n[i]=a)}return s.call(e,t,n)}qr.applyReviver=qt});var Te=v(Pr=>{"use strict";var ru=P();function Mr(s,e,t){if(Array.isArray(s))return s.map((n,i)=>Mr(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!ru.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!(t!=null&&t.keep)?Number(s):s}Pr.toJS=Mr});var vs=v(Rr=>{"use strict";var au=En(),$r=P(),ou=Te(),An=class{constructor(e){Object.defineProperty(this,$r.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!$r.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},o=ou.toJS(this,"",a);if(typeof i=="function")for(let{count:l,res:c}of a.anchors.values())i(c,l);return typeof r=="function"?au.applyReviver(r,{"":o},"",o):o}};Rr.NodeBase=An});var Mt=v(Dr=>{"use strict";var lu=bs(),cu=Ot(),dt=P(),uu=vs(),fu=Te(),Nn=class extends uu.NodeBase{constructor(e){super(dt.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if((t==null?void 0:t.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let n;t!=null&&t.aliasResolveCache?n=t.aliasResolveCache:(n=[],cu.visit(e,{Node:(r,a)=>{(dt.isAlias(a)||dt.hasAnchor(a))&&n.push(a)}}),t&&(t.aliasResolveCache=n));let i;for(let r of n){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=t,a=this.resolve(i,t);if(!a){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=n.get(a);if(o||(fu.toJS(a,null,t),o=n.get(a)),(o==null?void 0:o.res)===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=ws(i,a,n)),o.count*o.aliasCount>r)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(lu.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function ws(s,e,t){if(dt.isAlias(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(dt.isCollection(e)){let n=0;for(let i of e.items){let r=ws(s,i,t);r>n&&(n=r)}return n}else if(dt.isPair(e)){let n=ws(s,e.key,t),i=ws(s,e.value,t);return Math.max(n,i)}return 1}Dr.Alias=Nn});var F=v(Cn=>{"use strict";var du=P(),hu=vs(),pu=Te(),mu=s=>!s||typeof s!="function"&&typeof s!="object",xe=class extends hu.NodeBase{constructor(e){super(du.SCALAR),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:pu.toJS(this.value,e,t)}toString(){return String(this.value)}};xe.BLOCK_FOLDED="BLOCK_FOLDED";xe.BLOCK_LITERAL="BLOCK_LITERAL";xe.PLAIN="PLAIN";xe.QUOTE_DOUBLE="QUOTE_DOUBLE";xe.QUOTE_SINGLE="QUOTE_SINGLE";Cn.Scalar=xe;Cn.isScalarValue=mu});var Pt=v(Br=>{"use strict";var gu=Mt(),ze=P(),jr=F(),yu="tag:yaml.org,2002:";function bu(s,e,t){var n;if(e){let i=t.filter(a=>a.tag===e),r=(n=i.find(a=>!a.format))!=null?n:i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,s))&&!i.format})}function vu(s,e,t){var f,h,p,y;if(ze.isDocument(s)&&(s=s.contents),ze.isNode(s))return s;if(ze.isPair(s)){let d=(h=(f=t.schema[ze.MAP]).createNode)==null?void 0:h.call(f,t.schema,null,t);return d.items.push(s),d}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt!="undefined"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:a,sourceObjects:o}=t,l;if(n&&s&&typeof s=="object"){if(l=o.get(s),l)return(p=l.anchor)!=null||(l.anchor=i(s)),new gu.Alias(l.anchor);l={anchor:null,node:null},o.set(s,l)}e!=null&&e.startsWith("!!")&&(e=yu+e.slice(2));let c=bu(s,e,a.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let d=new jr.Scalar(s);return l&&(l.node=d),d}c=s instanceof Map?a[ze.MAP]:Symbol.iterator in Object(s)?a[ze.SEQ]:a[ze.MAP]}r&&(r(c),delete t.onTagObj);let u=c!=null&&c.createNode?c.createNode(t.schema,s,t):typeof((y=c==null?void 0:c.nodeClass)==null?void 0:y.from)=="function"?c.nodeClass.from(t.schema,s,t):new jr.Scalar(s);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}Br.createNode=vu});var ks=v(Ss=>{"use strict";var wu=Pt(),de=P(),Su=vs();function On(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let a=[];a[r]=n,n=a}else n=new Map([[r,n]])}return wu.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Fr=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,Ln=class extends Su.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>de.isNode(n)||de.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Fr(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(de.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,On(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(de.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&de.isScalar(r)?r.value:r:de.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!de.isPair(t))return!1;let n=t.value;return n==null||e&&de.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return de.isCollection(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(de.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,On(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Ss.Collection=Ln;Ss.collectionFromPath=On;Ss.isEmptyPath=Fr});var $t=v(_s=>{"use strict";var ku=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function In(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var _u=(s,e,t)=>s.endsWith(`
|
|
3
|
+
`)?In(t,e):t.includes(`
|
|
4
|
+
`)?`
|
|
5
|
+
`+In(t,e):(s.endsWith(" ")?"":" ")+t;_s.indentComment=In;_s.lineComment=_u;_s.stringifyComment=ku});var Vr=v(Rt=>{"use strict";var Tu="flow",qn="block",Ts="quoted";function xu(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:a,onOverflow:o}={}){if(!i||i<0)return s;i<r&&(r=0);let l=Math.max(1+r,1+i-e.length);if(s.length<=l)return s;let c=[],u={},f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let h,p,y=!1,d=-1,m=-1,S=-1;t===qn&&(d=Kr(s,d,e.length),d!==-1&&(f=d+l));for(let A;A=s[d+=1];){if(t===Ts&&A==="\\"){switch(m=d,s[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}S=d}if(A===`
|
|
6
|
+
`)t===qn&&(d=Kr(s,d,e.length)),f=d+e.length+l,h=void 0;else{if(A===" "&&p&&p!==" "&&p!==`
|
|
7
|
+
`&&p!==" "){let O=s[d+1];O&&O!==" "&&O!==`
|
|
8
|
+
`&&O!==" "&&(h=d)}if(d>=f)if(h)c.push(h),f=h+l,h=void 0;else if(t===Ts){for(;p===" "||p===" ";)p=A,A=s[d+=1],y=!0;let O=d>S+1?d-2:m-1;if(u[O])return s;c.push(O),u[O]=!0,f=O+l,h=void 0}else y=!0}p=A}if(y&&o&&o(),c.length===0)return s;a&&a();let T=s.slice(0,c[0]);for(let A=0;A<c.length;++A){let O=c[A],C=c[A+1]||s.length;O===0?T=`
|
|
9
|
+
${e}${s.slice(0,C)}`:(t===Ts&&u[O]&&(T+=`${s[O]}\\`),T+=`
|
|
10
|
+
${e}${s.slice(O+1,C)}`)}return T}function Kr(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
|
|
11
|
+
`);n=e,i=e+1,r=s[i]}return n}Rt.FOLD_BLOCK=qn;Rt.FOLD_FLOW=Tu;Rt.FOLD_QUOTED=Ts;Rt.foldFlowLines=xu});var jt=v(Ur=>{"use strict";var ae=F(),Ee=Vr(),Es=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),As=s=>/^(%|---|\.\.\.)/m.test(s);function Eu(s,e,t){if(!e||e<0)return!1;let n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,a=0;r<i;++r)if(s[r]===`
|
|
12
|
+
`){if(r-a>n)return!0;if(a=r+1,i-a<=n)return!1}return!0}function Dt(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(As(s)?" ":""),a="",o=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(a+=t.slice(o,l)+"\\ ",l+=1,o=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{a+=t.slice(o,l);let u=t.substr(l+2,4);switch(u){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:u.substr(0,2)==="00"?a+="\\x"+u.substr(2):a+=t.substr(l,6)}l+=5,o=l+1}break;case"n":if(n||t[l+2]==='"'||t.length<i)l+=1;else{for(a+=t.slice(o,l)+`
|
|
13
|
+
|
|
14
|
+
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)a+=`
|
|
15
|
+
`,l+=2;a+=r,t[l+2]===" "&&(a+="\\"),l+=1,o=l+1}break;default:l+=1}return a=o?a+t.slice(o):t,n?a:Ee.foldFlowLines(a,r,Ee.FOLD_QUOTED,Es(e,!1))}function Mn(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return Dt(s,e);let t=e.indent||(As(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${t}`)+"'";return e.implicitKey?n:Ee.foldFlowLines(n,t,Ee.FOLD_FLOW,Es(e,!1))}function ht(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=Dt;else{let i=s.includes('"'),r=s.includes("'");i&&!r?n=Mn:r&&!i?n=Dt:n=t?Mn:Dt}return n(s,e)}var Pn;try{Pn=new RegExp(`(^|(?<!
|
|
18
|
+
))
|
|
19
|
+
+(?!
|
|
20
|
+
|$)`,"g")}catch{Pn=/\n+(?!\n|$)/g}function xs({comment:s,type:e,value:t},n,i,r){let{blockQuote:a,commentString:o,lineWidth:l}=n.options;if(!a||/\n[\t ]+$/.test(t))return ht(t,n);let c=n.indent||(n.forceBlockIndent||As(t)?" ":""),u=a==="literal"?!0:a==="folded"||e===ae.Scalar.BLOCK_FOLDED?!1:e===ae.Scalar.BLOCK_LITERAL?!0:!Eu(t,l,c.length);if(!t)return u?`|
|
|
21
|
+
`:`>
|
|
22
|
+
`;let f,h;for(h=t.length;h>0;--h){let C=t[h-1];if(C!==`
|
|
23
|
+
`&&C!==" "&&C!==" ")break}let p=t.substring(h),y=p.indexOf(`
|
|
24
|
+
`);y===-1?f="-":t===p||y!==p.length-1?(f="+",r&&r()):f="",p&&(t=t.slice(0,-p.length),p[p.length-1]===`
|
|
25
|
+
`&&(p=p.slice(0,-1)),p=p.replace(Pn,`$&${c}`));let d=!1,m,S=-1;for(m=0;m<t.length;++m){let C=t[m];if(C===" ")d=!0;else if(C===`
|
|
26
|
+
`)S=m;else break}let T=t.substring(0,S<m?S+1:m);T&&(t=t.substring(T.length),T=T.replace(/\n+/g,`$&${c}`));let O=(d?c?"2":"1":"")+f;if(s&&(O+=" "+o(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let C=t.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),$=!1,j=Es(n,!0);a!=="folded"&&e!==ae.Scalar.BLOCK_FOLDED&&(j.onOverflow=()=>{$=!0});let E=Ee.foldFlowLines(`${T}${C}${p}`,c,Ee.FOLD_BLOCK,j);if(!$)return`>${O}
|
|
28
|
+
${c}${E}`}return t=t.replace(/\n+/g,`$&${c}`),`|${O}
|
|
29
|
+
${c}${T}${t}${p}`}function Au(s,e,t,n){let{type:i,value:r}=s,{actualString:a,implicitKey:o,indent:l,indentStep:c,inFlow:u}=e;if(o&&r.includes(`
|
|
30
|
+
`)||u&&/[[\]{},]/.test(r))return ht(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return o||u||!r.includes(`
|
|
31
|
+
`)?ht(r,e):xs(s,e,t,n);if(!o&&!u&&i!==ae.Scalar.PLAIN&&r.includes(`
|
|
32
|
+
`))return xs(s,e,t,n);if(As(r)){if(l==="")return e.forceBlockIndent=!0,xs(s,e,t,n);if(o&&l===c)return ht(r,e)}let f=r.replace(/\n+/g,`$&
|
|
33
|
+
${l}`);if(a){let h=d=>{var m;return d.default&&d.tag!=="tag:yaml.org,2002:str"&&((m=d.test)==null?void 0:m.test(f))},{compat:p,tags:y}=e.doc.schema;if(y.some(h)||p!=null&&p.some(h))return ht(r,e)}return o?f:Ee.foldFlowLines(f,l,Ee.FOLD_FLOW,Es(e,!1))}function Nu(s,e,t,n){let{implicitKey:i,inFlow:r}=e,a=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:o}=s;o!==ae.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=ae.Scalar.QUOTE_DOUBLE);let l=u=>{switch(u){case ae.Scalar.BLOCK_FOLDED:case ae.Scalar.BLOCK_LITERAL:return i||r?ht(a.value,e):xs(a,e,t,n);case ae.Scalar.QUOTE_DOUBLE:return Dt(a.value,e);case ae.Scalar.QUOTE_SINGLE:return Mn(a.value,e);case ae.Scalar.PLAIN:return Au(a,e,t,n);default:return null}},c=l(o);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,h=i&&u||f;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}Ur.stringifyString=Nu});var Bt=v($n=>{"use strict";var Cu=bs(),Ae=P(),Ou=$t(),Lu=jt();function Iu(s,e){let t=Object.assign({blockQuote:!0,commentString:Ou.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function qu(s,e){var i,r,a,o;if(e.tag){let l=s.filter(c=>c.tag===e.tag);if(l.length>0)return(i=l.find(c=>c.format===e.format))!=null?i:l[0]}let t,n;if(Ae.isScalar(e)){n=e.value;let l=s.filter(c=>{var u;return(u=c.identify)==null?void 0:u.call(c,n)});if(l.length>1){let c=l.filter(u=>u.test);c.length>0&&(l=c)}t=(r=l.find(c=>c.format===e.format))!=null?r:l.find(c=>!c.format)}else n=e,t=s.find(l=>l.nodeClass&&n instanceof l.nodeClass);if(!t){let l=(o=(a=n==null?void 0:n.constructor)==null?void 0:a.name)!=null?o:n===null?"null":typeof n;throw new Error(`Tag not resolved for ${l} value`)}return t}function Mu(s,e,{anchors:t,doc:n}){var o;if(!n.directives)return"";let i=[],r=(Ae.isScalar(s)||Ae.isCollection(s))&&s.anchor;r&&Cu.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let a=(o=s.tag)!=null?o:e.default?null:e.tag;return a&&i.push(n.directives.tagString(a)),i.join(" ")}function Pu(s,e,t,n){var l,c;if(Ae.isPair(s))return s.toString(e,t,n);if(Ae.isAlias(s)){if(e.doc.directives)return s.toString(e);if((l=e.resolvedAliases)!=null&&l.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i,r=Ae.isNode(s)?s:e.doc.createNode(s,{onTagObj:u=>i=u});i!=null||(i=qu(e.doc.schema.tags,r));let a=Mu(r,i,e);a.length>0&&(e.indentAtStart=((c=e.indentAtStart)!=null?c:0)+a.length+1);let o=typeof i.stringify=="function"?i.stringify(r,e,t,n):Ae.isScalar(r)?Lu.stringifyString(r,e,t,n):r.toString(e,t,n);return a?Ae.isScalar(r)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a}
|
|
34
|
+
${e.indent}${o}`:o}$n.createStringifyContext=Iu;$n.stringify=Pu});var Jr=v(Yr=>{"use strict";var ve=P(),Gr=F(),Hr=Bt(),Ft=$t();function $u({key:s,value:e},t,n,i){var j,E;let{allNullValues:r,doc:a,indent:o,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=t,h=ve.isNode(s)&&s.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(ve.isCollection(s)||!ve.isNode(s)&&typeof s=="object"){let q="With simple keys, collection cannot be used as a key value";throw new Error(q)}}let p=!f&&(!s||h&&e==null&&!t.inFlow||ve.isCollection(s)||(ve.isScalar(s)?s.type===Gr.Scalar.BLOCK_FOLDED||s.type===Gr.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(f||!r),indent:o+l});let y=!1,d=!1,m=Hr.stringify(s,t,()=>y=!0,()=>d=!0);if(!p&&!t.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(r||e==null)return y&&n&&n(),m===""?"?":p?`? ${m}`:m}else if(r&&!f||e==null&&p)return m=`? ${m}`,h&&!y?m+=Ft.lineComment(m,t.indent,c(h)):d&&i&&i(),m;y&&(h=null),p?(h&&(m+=Ft.lineComment(m,t.indent,c(h))),m=`? ${m}
|
|
35
|
+
${o}:`):(m=`${m}:`,h&&(m+=Ft.lineComment(m,t.indent,c(h))));let S,T,A;ve.isNode(e)?(S=!!e.spaceBefore,T=e.commentBefore,A=e.comment):(S=!1,T=null,A=null,e&&typeof e=="object"&&(e=a.createNode(e))),t.implicitKey=!1,!p&&!h&&ve.isScalar(e)&&(t.indentAtStart=m.length+1),d=!1,!u&&l.length>=2&&!t.inFlow&&!p&&ve.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let O=!1,C=Hr.stringify(e,t,()=>O=!0,()=>d=!0),$=" ";if(h||S||T){if($=S?`
|
|
36
|
+
`:"",T){let q=c(T);$+=`
|
|
37
|
+
${Ft.indentComment(q,t.indent)}`}C===""&&!t.inFlow?$===`
|
|
38
|
+
`&&A&&($=`
|
|
39
|
+
|
|
40
|
+
`):$+=`
|
|
41
|
+
${t.indent}`}else if(!p&&ve.isCollection(e)){let q=C[0],G=C.indexOf(`
|
|
42
|
+
`),B=G!==-1,Y=(E=(j=t.inFlow)!=null?j:e.flow)!=null?E:e.items.length===0;if(B||!Y){let se=!1;if(B&&(q==="&"||q==="!")){let ne=C.indexOf(" ");q==="&"&&ne!==-1&&ne<G&&C[ne+1]==="!"&&(ne=C.indexOf(" ",ne+1)),(ne===-1||G<ne)&&(se=!0)}se||($=`
|
|
43
|
+
${t.indent}`)}}else(C===""||C[0]===`
|
|
44
|
+
`)&&($="");return m+=$+C,t.inFlow?O&&n&&n():A&&!O?m+=Ft.lineComment(m,t.indent,c(A)):d&&i&&i(),m}Yr.stringifyPair=$u});var Dn=v(Rn=>{"use strict";var Zr=ls("process");function Ru(s,...e){s==="debug"&&console.log(...e)}function Du(s,e){(s==="debug"||s==="warn")&&(typeof Zr.emitWarning=="function"?Zr.emitWarning(e):console.warn(e))}Rn.debug=Ru;Rn.warn=Du});var Is=v(Ls=>{"use strict";var Os=P(),zr=F(),Ns="<<",Cs={identify:s=>s===Ns||typeof s=="symbol"&&s.description===Ns,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new zr.Scalar(Symbol(Ns)),{addToJSMap:Wr}),stringify:()=>Ns},ju=(s,e)=>(Cs.identify(e)||Os.isScalar(e)&&(!e.type||e.type===zr.Scalar.PLAIN)&&Cs.identify(e.value))&&(s==null?void 0:s.doc.schema.tags.some(t=>t.tag===Cs.tag&&t.default));function Wr(s,e,t){let n=Qr(s,t);if(Os.isSeq(n))for(let i of n.items)jn(s,e,i);else if(Array.isArray(n))for(let i of n)jn(s,e,i);else jn(s,e,n)}function jn(s,e,t){let n=Qr(s,t);if(!Os.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,s,Map);for(let[r,a]of i)e instanceof Map?e.has(r)||e.set(r,a):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function Qr(s,e){return s&&Os.isAlias(e)?e.resolve(s.doc,s):e}Ls.addMergeToJSMap=Wr;Ls.isMergeKey=ju;Ls.merge=Cs});var Fn=v(ta=>{"use strict";var Bu=Dn(),Xr=Is(),Fu=Bt(),ea=P(),Bn=Te();function Ku(s,e,{key:t,value:n}){if(ea.isNode(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(Xr.isMergeKey(s,t))Xr.addMergeToJSMap(s,e,n);else{let i=Bn.toJS(t,"",s);if(e instanceof Map)e.set(i,Bn.toJS(n,i,s));else if(e instanceof Set)e.add(i);else{let r=Vu(t,i,s),a=Bn.toJS(n,r,s);r in e?Object.defineProperty(e,r,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[r]=a}}return e}function Vu(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(ea.isNode(s)&&(t!=null&&t.doc)){let n=Fu.createStringifyContext(t.doc,{});n.anchors=new Set;for(let r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Bu.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}ta.addPairToJSMap=Ku});var Ne=v(Kn=>{"use strict";var sa=Pt(),Uu=Jr(),Gu=Fn(),qs=P();function Hu(s,e,t){let n=sa.createNode(s,void 0,t),i=sa.createNode(e,void 0,t);return new Ms(n,i)}var Ms=class s{constructor(e,t=null){Object.defineProperty(this,qs.NODE_TYPE,{value:qs.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return qs.isNode(t)&&(t=t.clone(e)),qs.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t!=null&&t.mapAsMap?new Map:{};return Gu.addPairToJSMap(t,n,this)}toString(e,t,n){return e!=null&&e.doc?Uu.stringifyPair(this,e,t,n):JSON.stringify(this)}};Kn.Pair=Ms;Kn.createPair=Hu});var Vn=v(ia=>{"use strict";var We=P(),na=Bt(),Ps=$t();function Yu(s,e,t){var r;return(((r=e.inFlow)!=null?r:s.flow)?Zu:Ju)(s,e,t)}function Ju({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:a,onComment:o}){let{indent:l,options:{commentString:c}}=t,u=Object.assign({},t,{indent:r,type:null}),f=!1,h=[];for(let y=0;y<e.length;++y){let d=e[y],m=null;if(We.isNode(d))!f&&d.spaceBefore&&h.push(""),$s(t,h,d.commentBefore,f),d.comment&&(m=d.comment);else if(We.isPair(d)){let T=We.isNode(d.key)?d.key:null;T&&(!f&&T.spaceBefore&&h.push(""),$s(t,h,T.commentBefore,f))}f=!1;let S=na.stringify(d,u,()=>m=null,()=>f=!0);m&&(S+=Ps.lineComment(S,r,c(m))),f&&m&&(f=!1),h.push(n+S)}let p;if(h.length===0)p=i.start+i.end;else{p=h[0];for(let y=1;y<h.length;++y){let d=h[y];p+=d?`
|
|
45
|
+
${l}${d}`:`
|
|
46
|
+
`}}return s?(p+=`
|
|
47
|
+
`+Ps.indentComment(c(s),l),o&&o()):f&&a&&a(),p}function Zu({items:s},e,{flowChars:t,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:a,options:{commentString:o}}=e;n+=r;let l=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let y=0;y<s.length;++y){let d=s[y],m=null;if(We.isNode(d))d.spaceBefore&&f.push(""),$s(e,f,d.commentBefore,!1),d.comment&&(m=d.comment);else if(We.isPair(d)){let T=We.isNode(d.key)?d.key:null;T&&(T.spaceBefore&&f.push(""),$s(e,f,T.commentBefore,!1),T.comment&&(c=!0));let A=We.isNode(d.value)?d.value:null;A?(A.comment&&(m=A.comment),A.commentBefore&&(c=!0)):d.value==null&&(T!=null&&T.comment)&&(m=T.comment)}m&&(c=!0);let S=na.stringify(d,l,()=>m=null);c||(c=f.length>u||S.includes(`
|
|
48
|
+
`)),y<s.length-1?S+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((T,A)=>T+A.length+2,2)+(S.length+2)>e.options.lineWidth)),c&&(S+=",")),m&&(S+=Ps.lineComment(S,n,o(m))),f.push(S),u=f.length}let{start:h,end:p}=t;if(f.length===0)return h+p;if(!c){let y=f.reduce((d,m)=>d+m.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=h;for(let d of f)y+=d?`
|
|
49
|
+
${r}${i}${d}`:`
|
|
50
|
+
`;return`${y}
|
|
51
|
+
${i}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function $s({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let r=Ps.indentComment(e(n),s);t.push(r.trimStart())}}ia.stringifyCollection=Yu});var Oe=v(Gn=>{"use strict";var zu=Vn(),Wu=Fn(),Qu=ks(),Ce=P(),Rs=Ne(),Xu=F();function Kt(s,e){let t=Ce.isScalar(e)?e.value:e;for(let n of s)if(Ce.isPair(n)&&(n.key===e||n.key===t||Ce.isScalar(n.key)&&n.key.value===t))return n}var Un=class extends Qu.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ce.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:i,replacer:r}=n,a=new this(e),o=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&a.items.push(Rs.createPair(l,c,n))};if(t instanceof Map)for(let[l,c]of t)o(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))o(l,t[l]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,t){var a;let n;Ce.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Rs.Pair(e,e==null?void 0:e.value):n=new Rs.Pair(e.key,e.value);let i=Kt(this.items,n.key),r=(a=this.schema)==null?void 0:a.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);Ce.isScalar(i.value)&&Xu.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(r){let o=this.items.findIndex(l=>r(n,l)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=Kt(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){var r;let n=Kt(this.items,e),i=n==null?void 0:n.value;return(r=!t&&Ce.isScalar(i)?i.value:i)!=null?r:void 0}has(e){return!!Kt(this.items,e)}set(e,t){this.add(new Rs.Pair(e,t),!0)}toJSON(e,t,n){let i=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(i);for(let r of this.items)Wu.addPairToJSMap(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Ce.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),zu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};Gn.YAMLMap=Un;Gn.findPair=Kt});var pt=v(aa=>{"use strict";var ef=P(),ra=Oe(),tf={collection:"map",default:!0,nodeClass:ra.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return ef.isMap(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>ra.YAMLMap.from(s,e,t)};aa.map=tf});var Le=v(oa=>{"use strict";var sf=Pt(),nf=Vn(),rf=ks(),js=P(),af=F(),of=Te(),Hn=class extends rf.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(js.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Ds(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=Ds(e);if(typeof n!="number")return;let i=this.items[n];return!t&&js.isScalar(i)?i.value:i}has(e){let t=Ds(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=Ds(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];js.isScalar(i)&&af.isScalarValue(t)?i.value=t:this.items[n]=t}toJSON(e,t){let n=[];t!=null&&t.onCreate&&t.onCreate(n);let i=0;for(let r of this.items)n.push(of.toJS(r,String(i++),t));return n}toString(e,t,n){return e?nf.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let a=0;for(let o of t){if(typeof i=="function"){let l=t instanceof Set?o:String(a++);o=i.call(t,l,o)}r.items.push(sf.createNode(o,void 0,n))}}return r}};function Ds(s){let e=js.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}oa.YAMLSeq=Hn});var mt=v(ca=>{"use strict";var lf=P(),la=Le(),cf={collection:"seq",default:!0,nodeClass:la.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return lf.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>la.YAMLSeq.from(s,e,t)};ca.seq=cf});var Vt=v(ua=>{"use strict";var uf=jt(),ff={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),uf.stringifyString(s,e,t,n)}};ua.string=ff});var Bs=v(ha=>{"use strict";var fa=F(),da={identify:s=>s==null,createNode:()=>new fa.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new fa.Scalar(null),stringify:({source:s},e)=>typeof s=="string"&&da.test.test(s)?s:e.options.nullStr};ha.nullTag=da});var Yn=v(ma=>{"use strict";var df=F(),pa={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new df.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&pa.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};ma.boolTag=pa});var gt=v(ga=>{"use strict";function hf({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let a=r.indexOf(".");a<0&&(a=r.length,r+=".");let o=e-(r.length-a-1);for(;o-- >0;)r+="0"}return r}ga.stringifyNumber=hf});var Zn=v(Fs=>{"use strict";var pf=F(),Jn=gt(),mf={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Jn.stringifyNumber},gf={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Jn.stringifyNumber(s)}},yf={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let e=new pf.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:Jn.stringifyNumber};Fs.float=yf;Fs.floatExp=gf;Fs.floatNaN=mf});var Wn=v(Vs=>{"use strict";var ya=gt(),Ks=s=>typeof s=="bigint"||Number.isInteger(s),zn=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function ba(s,e,t){let{value:n}=s;return Ks(n)&&n>=0?t+n.toString(e):ya.stringifyNumber(s)}var bf={identify:s=>Ks(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>zn(s,2,8,t),stringify:s=>ba(s,8,"0o")},vf={identify:Ks,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>zn(s,0,10,t),stringify:ya.stringifyNumber},wf={identify:s=>Ks(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>zn(s,2,16,t),stringify:s=>ba(s,16,"0x")};Vs.int=vf;Vs.intHex=wf;Vs.intOct=bf});var wa=v(va=>{"use strict";var Sf=pt(),kf=Bs(),_f=mt(),Tf=Vt(),xf=Yn(),Qn=Zn(),Xn=Wn(),Ef=[Sf.map,_f.seq,Tf.string,kf.nullTag,xf.boolTag,Xn.intOct,Xn.int,Xn.intHex,Qn.floatNaN,Qn.floatExp,Qn.float];va.schema=Ef});var _a=v(ka=>{"use strict";var Af=F(),Nf=pt(),Cf=mt();function Sa(s){return typeof s=="bigint"||Number.isInteger(s)}var Us=({value:s})=>JSON.stringify(s),Of=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Us},{identify:s=>s==null,createNode:()=>new Af.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Us},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:Us},{identify:Sa,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>Sa(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:Us}],Lf={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},If=[Nf.map,Cf.seq].concat(Of,Lf);ka.schema=If});var ti=v(Ta=>{"use strict";var Ut=ls("buffer"),ei=F(),qf=jt(),Mf={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Ut.Buffer=="function")return Ut.Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){if(!t)return"";let a=t,o;if(typeof Ut.Buffer=="function")o=a instanceof Ut.Buffer?a.toString("base64"):Ut.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<a.length;++c)l+=String.fromCharCode(a[c]);o=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e!=null||(e=ei.Scalar.BLOCK_LITERAL),e!==ei.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(o.length/l),u=new Array(c);for(let f=0,h=0;f<c;++f,h+=l)u[f]=o.substr(h,l);o=u.join(e===ei.Scalar.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return qf.stringifyString({comment:s,type:e,value:o},n,i,r)}};Ta.binary=Mf});var Ys=v(Hs=>{"use strict";var Gs=P(),si=Ne(),Pf=F(),$f=Le();function xa(s,e){var t;if(Gs.isSeq(s))for(let n=0;n<s.items.length;++n){let i=s.items[n];if(!Gs.isPair(i)){if(Gs.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new si.Pair(new Pf.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
53
|
+
${r.key.commentBefore}`:i.commentBefore),i.comment){let a=(t=r.value)!=null?t:r.key;a.comment=a.comment?`${i.comment}
|
|
54
|
+
${a.comment}`:i.comment}i=r}s.items[n]=Gs.isPair(i)?i:new si.Pair(i)}}else e("Expected a sequence for this tag");return s}function Ea(s,e,t){let{replacer:n}=t,i=new $f.YAMLSeq(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(r++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let c=Object.keys(a);if(c.length===1)o=c[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else o=a;i.items.push(si.createPair(o,l,t))}return i}var Rf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:xa,createNode:Ea};Hs.createPairs=Ea;Hs.pairs=Rf;Hs.resolvePairs=xa});var ri=v(ii=>{"use strict";var Aa=P(),ni=Te(),Gt=Oe(),Df=Le(),Na=Ys(),Qe=class s extends Df.YAMLSeq{constructor(){super(),this.add=Gt.YAMLMap.prototype.add.bind(this),this.delete=Gt.YAMLMap.prototype.delete.bind(this),this.get=Gt.YAMLMap.prototype.get.bind(this),this.has=Gt.YAMLMap.prototype.has.bind(this),this.set=Gt.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(let i of this.items){let r,a;if(Aa.isPair(i)?(r=ni.toJS(i.key,"",t),a=ni.toJS(i.value,r,t)):r=ni.toJS(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,a)}return n}static from(e,t,n){let i=Na.createPairs(e,t,n),r=new this;return r.items=i.items,r}};Qe.tag="tag:yaml.org,2002:omap";var jf={collection:"seq",identify:s=>s instanceof Map,nodeClass:Qe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=Na.resolvePairs(s,e),n=[];for(let{key:i}of t.items)Aa.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Qe,t)},createNode:(s,e,t)=>Qe.from(s,e,t)};ii.YAMLOMap=Qe;ii.omap=jf});var qa=v(ai=>{"use strict";var Ca=F();function Oa({value:s,source:e},t){return e&&(s?La:Ia).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var La={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ca.Scalar(!0),stringify:Oa},Ia={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ca.Scalar(!1),stringify:Oa};ai.falseTag=Ia;ai.trueTag=La});var Ma=v(Js=>{"use strict";var Bf=F(),oi=gt(),Ff={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:oi.stringifyNumber},Kf={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():oi.stringifyNumber(s)}},Vf={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new Bf.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:oi.stringifyNumber};Js.float=Vf;Js.floatExp=Kf;Js.floatNaN=Ff});var $a=v(Yt=>{"use strict";var Pa=gt(),Ht=s=>typeof s=="bigint"||Number.isInteger(s);function Zs(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let a=BigInt(s);return i==="-"?BigInt(-1)*a:a}let r=parseInt(s,t);return i==="-"?-1*r:r}function li(s,e,t){let{value:n}=s;if(Ht(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return Pa.stringifyNumber(s)}var Uf={identify:Ht,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Zs(s,2,2,t),stringify:s=>li(s,2,"0b")},Gf={identify:Ht,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Zs(s,1,8,t),stringify:s=>li(s,8,"0")},Hf={identify:Ht,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Zs(s,0,10,t),stringify:Pa.stringifyNumber},Yf={identify:Ht,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Zs(s,2,16,t),stringify:s=>li(s,16,"0x")};Yt.int=Hf;Yt.intBin=Uf;Yt.intHex=Yf;Yt.intOct=Gf});var ui=v(ci=>{"use strict";var Qs=P(),zs=Ne(),Ws=Oe(),Xe=class s extends Ws.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;Qs.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new zs.Pair(e.key,null):t=new zs.Pair(e,null),Ws.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Ws.findPair(this.items,e);return!t&&Qs.isPair(n)?Qs.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Ws.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new zs.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof i=="function"&&(a=i.call(t,a,a)),r.items.push(zs.createPair(a,null,n));return r}};Xe.tag="tag:yaml.org,2002:set";var Jf={collection:"map",identify:s=>s instanceof Set,nodeClass:Xe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>Xe.from(s,e,t),resolve(s,e){if(Qs.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new Xe,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};ci.YAMLSet=Xe;ci.set=Jf});var di=v(Xs=>{"use strict";var Zf=gt();function fi(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=a=>e?BigInt(a):Number(a),r=n.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return t==="-"?i(-1)*r:r}function Ra(s){let{value:e}=s,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return Zf.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var zf={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>fi(s,t),stringify:Ra},Wf={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>fi(s,!1),stringify:Ra},Da={identify:s=>s instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(s){let e=s.match(Da.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,a,o]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,r||0,a||0,o||0,l),u=e[8];if(u&&u!=="Z"){let f=fi(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>{var e;return(e=s==null?void 0:s.toISOString().replace(/(T00:00:00)?\.000Z$/,""))!=null?e:""}};Xs.floatTime=Wf;Xs.intTime=zf;Xs.timestamp=Da});var Fa=v(Ba=>{"use strict";var Qf=pt(),Xf=Bs(),ed=mt(),td=Vt(),sd=ti(),ja=qa(),hi=Ma(),en=$a(),nd=Is(),id=ri(),rd=Ys(),ad=ui(),pi=di(),od=[Qf.map,ed.seq,td.string,Xf.nullTag,ja.trueTag,ja.falseTag,en.intBin,en.intOct,en.int,en.intHex,hi.floatNaN,hi.floatExp,hi.float,sd.binary,nd.merge,id.omap,rd.pairs,ad.set,pi.intTime,pi.floatTime,pi.timestamp];Ba.schema=od});var Wa=v(yi=>{"use strict";var Ga=pt(),ld=Bs(),Ha=mt(),cd=Vt(),ud=Yn(),mi=Zn(),gi=Wn(),fd=wa(),dd=_a(),Ya=ti(),Jt=Is(),Ja=ri(),Za=Ys(),Ka=Fa(),za=ui(),tn=di(),Va=new Map([["core",fd.schema],["failsafe",[Ga.map,Ha.seq,cd.string]],["json",dd.schema],["yaml11",Ka.schema],["yaml-1.1",Ka.schema]]),Ua={binary:Ya.binary,bool:ud.boolTag,float:mi.float,floatExp:mi.floatExp,floatNaN:mi.floatNaN,floatTime:tn.floatTime,int:gi.int,intHex:gi.intHex,intOct:gi.intOct,intTime:tn.intTime,map:Ga.map,merge:Jt.merge,null:ld.nullTag,omap:Ja.omap,pairs:Za.pairs,seq:Ha.seq,set:za.set,timestamp:tn.timestamp},hd={"tag:yaml.org,2002:binary":Ya.binary,"tag:yaml.org,2002:merge":Jt.merge,"tag:yaml.org,2002:omap":Ja.omap,"tag:yaml.org,2002:pairs":Za.pairs,"tag:yaml.org,2002:set":za.set,"tag:yaml.org,2002:timestamp":tn.timestamp};function pd(s,e,t){let n=Va.get(e);if(n&&!s)return t&&!n.includes(Jt.merge)?n.concat(Jt.merge):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{let r=Array.from(Va.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(s))for(let r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(Jt.merge)),i.reduce((r,a)=>{let o=typeof a=="string"?Ua[a]:a;if(!o){let l=JSON.stringify(a),c=Object.keys(Ua).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(o)||r.push(o),r},[])}yi.coreKnownTags=hd;yi.getTags=pd});var wi=v(Qa=>{"use strict";var bi=P(),md=pt(),gd=mt(),yd=Vt(),sn=Wa(),bd=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,vi=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?sn.getTags(e,"compat"):e?sn.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?sn.coreKnownTags:{},this.tags=sn.getTags(t,this.name,n),this.toStringOptions=o!=null?o:null,Object.defineProperty(this,bi.MAP,{value:md.map}),Object.defineProperty(this,bi.SCALAR,{value:yd.string}),Object.defineProperty(this,bi.SEQ,{value:gd.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?bd:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Qa.Schema=vi});var eo=v(Xa=>{"use strict";var vd=P(),Si=Bt(),Zt=$t();function wd(s,e){var l;let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let c=s.directives.toString(s);c?(t.push(c),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=Si.createStringifyContext(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let c=r(s.commentBefore);t.unshift(Zt.indentComment(c,""))}let a=!1,o=null;if(s.contents){if(vd.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let f=r(s.contents.commentBefore);t.push(Zt.indentComment(f,""))}i.forceBlockIndent=!!s.comment,o=s.contents.comment}let c=o?void 0:()=>a=!0,u=Si.stringify(s.contents,i,()=>o=null,c);o&&(u+=Zt.lineComment(u,"",r(o))),(u[0]==="|"||u[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${u}`:t.push(u)}else t.push(Si.stringify(s.contents,i));if((l=s.directives)!=null&&l.docEnd)if(s.comment){let c=r(s.comment);c.includes(`
|
|
55
|
+
`)?(t.push("..."),t.push(Zt.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=s.comment;c&&a&&(c=c.replace(/^\n+/,"")),c&&((!a||o)&&t[t.length-1]!==""&&t.push(""),t.push(Zt.indentComment(r(c),"")))}return t.join(`
|
|
56
|
+
`)+`
|
|
57
|
+
`}Xa.stringifyDocument=wd});var zt=v(to=>{"use strict";var Sd=Mt(),yt=ks(),te=P(),kd=Ne(),_d=Te(),Td=wi(),xd=eo(),ki=bs(),Ed=En(),Ad=Pt(),_i=xn(),Ti=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,te.NODE_TYPE,{value:te.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:a}=r;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new _i.Directives({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(s.prototype,{[te.NODE_TYPE]:{value:te.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=te.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){bt(this.contents)&&this.contents.add(e)}addIn(e,t){bt(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=ki.anchorNames(this);e.anchor=!t||n.has(t)?ki.findNewAnchor(t||"a",n):t}return new Sd.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let m=T=>typeof T=="number"||T instanceof String||T instanceof Number,S=t.filter(m).map(String);S.length>0&&(t=t.concat(S)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:a,flow:o,keepUndefined:l,onTagObj:c,tag:u}=n!=null?n:{},{onAnchor:f,setAnchors:h,sourceObjects:p}=ki.createNodeAnchors(this,a||"a"),y={aliasDuplicateObjects:r!=null?r:!0,keepUndefined:l!=null?l:!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:p},d=Ad.createNode(e,u,y);return o&&te.isCollection(d)&&(d.flow=!0),h(),d}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new kd.Pair(i,r)}delete(e){return bt(this.contents)?this.contents.delete(e):!1}deleteIn(e){return yt.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):bt(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return te.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return yt.isEmptyPath(e)?!t&&te.isScalar(this.contents)?this.contents.value:this.contents:te.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return te.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return yt.isEmptyPath(e)?this.contents!==void 0:te.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=yt.collectionFromPath(this.schema,[e],t):bt(this.contents)&&this.contents.set(e,t)}setIn(e,t){yt.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=yt.collectionFromPath(this.schema,Array.from(e),t):bt(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new _i.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new _i.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Td.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=_d.toJS(this.contents,t!=null?t:"",o);if(typeof r=="function")for(let{count:c,res:u}of o.anchors.values())r(u,c);return typeof a=="function"?Ed.applyReviver(a,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return xd.stringifyDocument(this,e)}};function bt(s){if(te.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}to.Document=Ti});var Xt=v(Qt=>{"use strict";var Wt=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},xi=class extends Wt{constructor(e,t,n){super("YAMLParseError",e,t,n)}},Ei=class extends Wt{constructor(e,t,n){super("YAMLWarning",e,t,n)}},Nd=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(o=>e.linePos(o));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,a=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&a.length>80){let o=Math.min(r-39,a.length-79);a="\u2026"+a.substring(o),r-=o-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(a.substring(0,r))){let o=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);o.length>80&&(o=o.substring(0,79)+`\u2026
|
|
58
|
+
`),a=o+a}if(/[^ ]/.test(a)){let o=1,l=t.linePos[1];(l==null?void 0:l.line)===n&&l.col>i&&(o=Math.max(1,Math.min(l.col-i,80-r)));let c=" ".repeat(r)+"^".repeat(o);t.message+=`:
|
|
59
|
+
|
|
60
|
+
${a}
|
|
61
|
+
${c}
|
|
62
|
+
`}};Qt.YAMLError=Wt;Qt.YAMLParseError=xi;Qt.YAMLWarning=Ei;Qt.prettifyError=Nd});var es=v(so=>{"use strict";function Cd(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:a,startOnNewline:o}){let l=!1,c=o,u=o,f="",h="",p=!1,y=!1,d=null,m=null,S=null,T=null,A=null,O=null,C=null;for(let E of s)switch(y&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&r(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),d&&(c&&E.type!=="comment"&&E.type!=="newline"&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),E.type){case"space":!e&&(t!=="doc-start"||(n==null?void 0:n.type)!=="flow-collection")&&E.source.includes(" ")&&(d=E),u=!0;break;case"comment":{u||r(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let q=E.source.substring(1)||" ";f?f+=h+q:f=q,h="",c=!1;break}case"newline":c?f?f+=E.source:(!O||t!=="seq-item-ind")&&(l=!0):h+=E.source,c=!0,p=!0,(m||S)&&(T=E),u=!0;break;case"anchor":m&&r(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&r(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=E,C!=null||(C=E.offset),c=!1,u=!1,y=!0;break;case"tag":{S&&r(E,"MULTIPLE_TAGS","A node can have at most one tag"),S=E,C!=null||(C=E.offset),c=!1,u=!1,y=!0;break}case t:(m||S)&&r(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),O&&r(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${e!=null?e:"collection"}`),O=E,c=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){A&&r(E,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),A=E,c=!1,u=!1;break}default:r(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),c=!1,u=!1}let $=s[s.length-1],j=$?$.offset+$.source.length:i;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(c&&d.indent<=a||(n==null?void 0:n.type)==="block-map"||(n==null?void 0:n.type)==="block-seq")&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:A,found:O,spaceBefore:l,comment:f,hasNewline:p,anchor:m,tag:S,newlineAfterProp:T,end:j,start:C!=null?C:j}}so.resolveProps=Cd});var nn=v(no=>{"use strict";function Ai(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
|
|
63
|
+
`))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Ai(e.key)||Ai(e.value))return!0}return!1;default:return!0}}no.containsNewline=Ai});var Ni=v(io=>{"use strict";var Od=nn();function Ld(s,e,t){if((e==null?void 0:e.type)==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Od.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}io.flowIndentCheck=Ld});var Ci=v(ao=>{"use strict";var ro=P();function Id(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let i=typeof n=="function"?n:(r,a)=>r===a||ro.isScalar(r)&&ro.isScalar(a)&&r.value===a.value;return e.some(r=>i(r.key,t))}ao.mapIncludes=Id});var ho=v(fo=>{"use strict";var oo=Ne(),qd=Oe(),lo=es(),Md=nn(),co=Ni(),Pd=Ci(),uo="All mapping items must start at the same column";function $d({composeNode:s,composeEmptyNode:e},t,n,i,r){var u,f;let a=(u=r==null?void 0:r.nodeClass)!=null?u:qd.YAMLMap,o=new a(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let h of n.items){let{start:p,key:y,sep:d,value:m}=h,S=lo.resolveProps(p,{indicator:"explicit-key-ind",next:y!=null?y:d==null?void 0:d[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),T=!S.found;if(T){if(y&&(y.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==n.indent&&i(l,"BAD_INDENT",uo)),!S.anchor&&!S.tag&&!d){c=S.end,S.comment&&(o.comment?o.comment+=`
|
|
64
|
+
`+S.comment:o.comment=S.comment);continue}(S.newlineAfterProp||Md.containsNewline(y))&&i(y!=null?y:p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((f=S.found)==null?void 0:f.indent)!==n.indent&&i(l,"BAD_INDENT",uo);t.atKey=!0;let A=S.end,O=y?s(t,y,S,i):e(t,A,p,null,S,i);t.schema.compat&&co.flowIndentCheck(n.indent,y,i),t.atKey=!1,Pd.mapIncludes(t,o.items,O)&&i(A,"DUPLICATE_KEY","Map keys must be unique");let C=lo.resolveProps(d!=null?d:[],{indicator:"map-value-ind",next:m,offset:O.range[2],onError:i,parentIndent:n.indent,startOnNewline:!y||y.type==="block-scalar"});if(l=C.end,C.found){T&&((m==null?void 0:m.type)==="block-map"&&!C.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&S.start<C.found.offset-1024&&i(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let $=m?s(t,m,C,i):e(t,l,d,null,C,i);t.schema.compat&&co.flowIndentCheck(n.indent,m,i),l=$.range[2];let j=new oo.Pair(O,$);t.options.keepSourceTokens&&(j.srcToken=h),o.items.push(j)}else{T&&i(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(O.comment?O.comment+=`
|
|
65
|
+
`+C.comment:O.comment=C.comment);let $=new oo.Pair(O);t.options.keepSourceTokens&&($.srcToken=h),o.items.push($)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),o.range=[n.offset,l,c!=null?c:l],o}fo.resolveBlockMap=$d});var mo=v(po=>{"use strict";var Rd=Le(),Dd=es(),jd=Ni();function Bd({composeNode:s,composeEmptyNode:e},t,n,i,r){var u;let a=(u=r==null?void 0:r.nodeClass)!=null?u:Rd.YAMLSeq,o=new a(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=n.offset,c=null;for(let{start:f,value:h}of n.items){let p=Dd.resolveProps(f,{indicator:"seq-item-ind",next:h,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||h)(h==null?void 0:h.type)==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=p.end,p.comment&&(o.comment=p.comment);continue}let y=h?s(t,h,p,i):e(t,p.end,f,null,p,i);t.schema.compat&&jd.flowIndentCheck(n.indent,h,i),l=y.range[2],o.items.push(y)}return o.range=[n.offset,l,c!=null?c:l],o}po.resolveBlockSeq=Bd});var vt=v(go=>{"use strict";function Fd(s,e,t,n){let i="";if(s){let r=!1,a="";for(let o of s){let{source:l,type:c}=o;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";i?i+=a+u:i=u,a="";break}case"newline":i&&(a+=l),r=!0;break;default:n(o,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}go.resolveEnd=Fd});var wo=v(vo=>{"use strict";var Kd=P(),Vd=Ne(),yo=Oe(),Ud=Le(),Gd=vt(),bo=es(),Hd=nn(),Yd=Ci(),Oi="Block collections are not allowed within flow collections",Li=s=>s&&(s.type==="block-map"||s.type==="block-seq");function Jd({composeNode:s,composeEmptyNode:e},t,n,i,r){var m,S,T;let a=n.start.source==="{",o=a?"flow map":"flow sequence",l=(m=r==null?void 0:r.nodeClass)!=null?m:a?yo.YAMLMap:Ud.YAMLSeq,c=new l(t.schema);c.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=n.offset+n.start.source.length;for(let A=0;A<n.items.length;++A){let O=n.items[A],{start:C,key:$,sep:j,value:E}=O,q=bo.resolveProps(C,{flow:o,indicator:"explicit-key-ind",next:$!=null?$:j==null?void 0:j[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!q.found){if(!q.anchor&&!q.tag&&!j&&!E){A===0&&q.comma?i(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):A<n.items.length-1&&i(q.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),q.comment&&(c.comment?c.comment+=`
|
|
66
|
+
`+q.comment:c.comment=q.comment),f=q.end;continue}!a&&t.options.strict&&Hd.containsNewline($)&&i($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(A===0)q.comma&&i(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(q.comma||i(q.start,"MISSING_CHAR",`Missing , between ${o} items`),q.comment){let G="";e:for(let B of C)switch(B.type){case"comma":case"space":break;case"comment":G=B.source.substring(1);break e;default:break e}if(G){let B=c.items[c.items.length-1];Kd.isPair(B)&&(B=(S=B.value)!=null?S:B.key),B.comment?B.comment+=`
|
|
67
|
+
`+G:B.comment=G,q.comment=q.comment.substring(G.length+1)}}if(!a&&!j&&!q.found){let G=E?s(t,E,q,i):e(t,q.end,j,null,q,i);c.items.push(G),f=G.range[2],Li(E)&&i(G.range,"BLOCK_IN_FLOW",Oi)}else{t.atKey=!0;let G=q.end,B=$?s(t,$,q,i):e(t,G,C,null,q,i);Li($)&&i(B.range,"BLOCK_IN_FLOW",Oi),t.atKey=!1;let Y=bo.resolveProps(j!=null?j:[],{flow:o,indicator:"map-value-ind",next:E,offset:B.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(Y.found){if(!a&&!q.found&&t.options.strict){if(j)for(let ie of j){if(ie===Y.found)break;if(ie.type==="newline"){i(ie,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}q.start<Y.found.offset-1024&&i(Y.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&((T=E.source)==null?void 0:T[0])===":"?i(E,"MISSING_CHAR",`Missing space after : in ${o}`):i(Y.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let se=E?s(t,E,Y,i):Y.found?e(t,Y.end,j,null,Y,i):null;se?Li(E)&&i(se.range,"BLOCK_IN_FLOW",Oi):Y.comment&&(B.comment?B.comment+=`
|
|
68
|
+
`+Y.comment:B.comment=Y.comment);let ne=new Vd.Pair(B,se);if(t.options.keepSourceTokens&&(ne.srcToken=O),a){let ie=c;Yd.mapIncludes(t,ie.items,B)&&i(G,"DUPLICATE_KEY","Map keys must be unique"),ie.items.push(ne)}else{let ie=new yo.YAMLMap(t.schema);ie.flow=!0,ie.items.push(ne);let ar=(se!=null?se:B).range;ie.range=[B.range[0],ar[1],ar[2]],c.items.push(ie)}f=se?se.range[2]:Y.end}}let h=a?"}":"]",[p,...y]=n.end,d=f;if((p==null?void 0:p.source)===h)d=p.offset+p.source.length;else{let A=o[0].toUpperCase()+o.substring(1),O=u?`${A} must end with a ${h}`:`${A} in block collection must be sufficiently indented and end with a ${h}`;i(f,u?"MISSING_CHAR":"BAD_INDENT",O),p&&p.source.length!==1&&y.unshift(p)}if(y.length>0){let A=Gd.resolveEnd(y,d,t.options.strict,i);A.comment&&(c.comment?c.comment+=`
|
|
69
|
+
`+A.comment:c.comment=A.comment),c.range=[n.offset,d,A.offset]}else c.range=[n.offset,d,d];return c}vo.resolveFlowCollection=Jd});var ko=v(So=>{"use strict";var Zd=P(),zd=F(),Wd=Oe(),Qd=Le(),Xd=ho(),eh=mo(),th=wo();function Ii(s,e,t,n,i,r){let a=t.type==="block-map"?Xd.resolveBlockMap(s,e,t,n,r):t.type==="block-seq"?eh.resolveBlockSeq(s,e,t,n,r):th.resolveFlowCollection(s,e,t,n,r),o=a.constructor;return i==="!"||i===o.tagName?(a.tag=o.tagName,a):(i&&(a.tag=i),a)}function sh(s,e,t,n,i){var h,p,y;let r=n.tag,a=r?e.directives.tagName(r.source,d=>i(r,"TAG_RESOLVE_FAILED",d)):null;if(t.type==="block-seq"){let{anchor:d,newlineAfterProp:m}=n,S=d&&r?d.offset>r.offset?d:r:d!=null?d:r;S&&(!m||m.offset<S.offset)&&i(S,"MISSING_CHAR","Missing newline after block sequence props")}let o=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!a||a==="!"||a===Wd.YAMLMap.tagName&&o==="map"||a===Qd.YAMLSeq.tagName&&o==="seq")return Ii(s,e,t,i,a);let l=e.schema.tags.find(d=>d.tag===a&&d.collection===o);if(!l){let d=e.schema.knownTags[a];if((d==null?void 0:d.collection)===o)e.schema.tags.push(Object.assign({},d,{default:!1})),l=d;else return d?i(r,"BAD_COLLECTION_TYPE",`${d.tag} used for ${o} collection, but expects ${(h=d.collection)!=null?h:"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Ii(s,e,t,i,a)}let c=Ii(s,e,t,i,a,l),u=(y=(p=l.resolve)==null?void 0:p.call(l,c,d=>i(r,"TAG_RESOLVE_FAILED",d),e.options))!=null?y:c,f=Zd.isNode(u)?u:new zd.Scalar(u);return f.range=c.range,f.tag=a,l!=null&&l.format&&(f.format=l.format),f}So.composeCollection=sh});var Mi=v(_o=>{"use strict";var qi=F();function nh(s,e,t){let n=e.offset,i=ih(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?qi.Scalar.BLOCK_FOLDED:qi.Scalar.BLOCK_LITERAL,a=e.source?rh(e.source):[],o=a.length;for(let d=a.length-1;d>=0;--d){let m=a[d][1];if(m===""||m==="\r")o=d;else break}if(o===0){let d=i.chomp==="+"&&a.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,a.length-1)):"",m=n+i.length;return e.source&&(m+=e.source.length),{value:d,type:r,comment:i.comment,range:[n,m,m]}}let l=e.indent+i.indent,c=e.offset+i.length,u=0;for(let d=0;d<o;++d){let[m,S]=a[d];if(S===""||S==="\r")i.indent===0&&m.length>l&&(l=m.length);else{m.length<l&&t(c+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=m.length),u=d,l===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=m.length+S.length+1}for(let d=a.length-1;d>=o;--d)a[d][0].length>l&&(o=d+1);let f="",h="",p=!1;for(let d=0;d<u;++d)f+=a[d][0].slice(l)+`
|
|
71
|
+
`;for(let d=u;d<o;++d){let[m,S]=a[d];c+=m.length+S.length+1;let T=S[S.length-1]==="\r";if(T&&(S=S.slice(0,-1)),S&&m.length<l){let O=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-S.length-(T?2:1),"BAD_INDENT",O),m=""}r===qi.Scalar.BLOCK_LITERAL?(f+=h+m.slice(l)+S,h=`
|
|
72
|
+
`):m.length>l||S[0]===" "?(h===" "?h=`
|
|
73
|
+
`:!p&&h===`
|
|
74
|
+
`&&(h=`
|
|
75
|
+
|
|
76
|
+
`),f+=h+m.slice(l)+S,h=`
|
|
77
|
+
`,p=!0):S===""?h===`
|
|
78
|
+
`?f+=`
|
|
79
|
+
`:h=`
|
|
80
|
+
`:(f+=h+S,h=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let d=o;d<a.length;++d)f+=`
|
|
81
|
+
`+a[d][0].slice(l);f[f.length-1]!==`
|
|
82
|
+
`&&(f+=`
|
|
83
|
+
`);break;default:f+=`
|
|
84
|
+
`}let y=n+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[n,y,y]}}function ih({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],a=0,o="",l=-1;for(let h=1;h<i.length;++h){let p=i[h];if(!o&&(p==="-"||p==="+"))o=p;else{let y=Number(p);!a&&y?a=y:l===-1&&(l=s+h)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,u="",f=i.length;for(let h=1;h<e.length;++h){let p=e[h];switch(p.type){case"space":c=!0;case"newline":f+=p.source.length;break;case"comment":t&&!c&&n(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,u=p.source.substring(1);break;case"error":n(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{let y=`Unexpected token in block scalar header: ${p.type}`;n(p,"UNEXPECTED_TOKEN",y);let d=p.source;d&&typeof d=="string"&&(f+=d.length)}}}return{mode:r,indent:a,chomp:o,comment:u,length:f}}function rh(s){let e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n!=null&&n[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let a=1;a<e.length;a+=2)r.push([e[a],e[a+1]]);return r}_o.resolveBlockScalar=nh});var $i=v(xo=>{"use strict";var Pi=F(),ah=vt();function oh(s,e,t){let{offset:n,type:i,source:r,end:a}=s,o,l,c=(h,p,y)=>t(n+h,p,y);switch(i){case"scalar":o=Pi.Scalar.PLAIN,l=lh(r,c);break;case"single-quoted-scalar":o=Pi.Scalar.QUOTE_SINGLE,l=ch(r,c);break;case"double-quoted-scalar":o=Pi.Scalar.QUOTE_DOUBLE,l=uh(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let u=n+r.length,f=ah.resolveEnd(a,u,e,t);return{value:l,type:o,comment:f.comment,range:[n,u,f.offset]}}function lh(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),To(s)}function ch(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),To(s.slice(1,-1)).replace(/''/g,"'")}function To(s){var l;let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
|
+
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let i=n[1],r=" ",a=e.lastIndex;for(t.lastIndex=a;n=t.exec(s);)n[1]===""?r===`
|
|
87
|
+
`?i+=r:r=`
|
|
88
|
+
`:(i+=r+n[1],r=" "),a=t.lastIndex;let o=/[ \t]*(.*)/sy;return o.lastIndex=a,n=o.exec(s),i+r+((l=n==null?void 0:n[1])!=null?l:"")}function uh(s,e){let t="";for(let n=1;n<s.length-1;++n){let i=s[n];if(!(i==="\r"&&s[n+1]===`
|
|
89
|
+
`))if(i===`
|
|
90
|
+
`){let{fold:r,offset:a}=fh(s,n);t+=r,n=a}else if(i==="\\"){let r=s[++n],a=dh[r];if(a)t+=a;else if(r===`
|
|
91
|
+
`)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
|
|
92
|
+
`)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){let o=r==="x"?2:r==="u"?4:8;t+=hh(s,n+1,o,e),n+=o}else{let o=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),t+=o}}else if(i===" "||i===" "){let r=n,a=s[n+1];for(;a===" "||a===" ";)a=s[++n+1];a!==`
|
|
93
|
+
`&&!(a==="\r"&&s[n+2]===`
|
|
94
|
+
`)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function fh(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
|
|
95
|
+
`||n==="\r")&&!(n==="\r"&&s[e+2]!==`
|
|
96
|
+
`);)n===`
|
|
97
|
+
`&&(t+=`
|
|
98
|
+
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var dh={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function hh(s,e,t,n){let i=s.substr(e,t),a=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let o=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}xo.resolveFlowScalar=oh});var No=v(Ao=>{"use strict";var et=P(),Eo=F(),ph=Mi(),mh=$i();function gh(s,e,t,n){let{value:i,type:r,comment:a,range:o}=e.type==="block-scalar"?ph.resolveBlockScalar(s,e,n):mh.resolveFlowScalar(e,s.options.strict,n),l=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null,c;s.options.stringKeys&&s.atKey?c=s.schema[et.SCALAR]:l?c=yh(s.schema,i,l,t,n):e.type==="scalar"?c=bh(s,i,e,n):c=s.schema[et.SCALAR];let u;try{let f=c.resolve(i,h=>n(t!=null?t:e,"TAG_RESOLVE_FAILED",h),s.options);u=et.isScalar(f)?f:new Eo.Scalar(f)}catch(f){let h=f instanceof Error?f.message:String(f);n(t!=null?t:e,"TAG_RESOLVE_FAILED",h),u=new Eo.Scalar(i)}return u.range=o,u.source=i,r&&(u.type=r),l&&(u.tag=l),c.format&&(u.format=c.format),a&&(u.comment=a),u}function yh(s,e,t,n,i){var o;if(t==="!")return s[et.SCALAR];let r=[];for(let l of s.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)r.push(l);else return l;for(let l of r)if((o=l.test)!=null&&o.test(e))return l;let a=s.knownTags[t];return a&&!a.collection?(s.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[et.SCALAR])}function bh({atKey:s,directives:e,schema:t},n,i,r){var o;let a=t.tags.find(l=>{var c;return(l.default===!0||s&&l.default==="key")&&((c=l.test)==null?void 0:c.test(n))})||t[et.SCALAR];if(t.compat){let l=(o=t.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(n))}))!=null?o:t[et.SCALAR];if(a.tag!==l.tag){let c=e.tagString(a.tag),u=e.tagString(l.tag),f=`Value may be parsed as either ${c} or ${u}`;r(i,"TAG_RESOLVE_FAILED",f,!0)}}return a}Ao.composeScalar=gh});var Oo=v(Co=>{"use strict";function vh(s,e,t){if(e){t!=null||(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];(i==null?void 0:i.type)==="space";)s+=i.source.length,i=e[++n];break}}return s}Co.emptyScalarPosition=vh});var qo=v(Di=>{"use strict";var wh=Mt(),Sh=P(),kh=ko(),Lo=No(),_h=vt(),Th=Oo(),xh={composeNode:Io,composeEmptyNode:Ri};function Io(s,e,t,n){let i=s.atKey,{spaceBefore:r,comment:a,anchor:o,tag:l}=t,c,u=!0;switch(e.type){case"alias":c=Eh(s,e,n),(o||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Lo.composeScalar(s,e,l,n),o&&(c.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=kh.composeCollection(xh,s,e,t,n),o&&(c.anchor=o.source.substring(1))}catch(f){let h=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",h)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),u=!1}}return c!=null||(c=Ri(s,e.offset,void 0,null,t,n)),o&&c.anchor===""&&n(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!Sh.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l!=null?l:e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?c.comment=a:c.commentBefore=a),s.options.keepSourceTokens&&u&&(c.srcToken=e),c}function Ri(s,e,t,n,{spaceBefore:i,comment:r,anchor:a,tag:o,end:l},c){let u={type:"scalar",offset:Th.emptyScalarPosition(e,t,n),indent:-1,source:""},f=Lo.composeScalar(s,u,o,c);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function Eh({options:s},{offset:e,source:t,end:n},i){let r=new wh.Alias(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+t.length,o=_h.resolveEnd(n,a,s.strict,i);return r.range=[e,a,o.offset],o.comment&&(r.comment=o.comment),r}Di.composeEmptyNode=Ri;Di.composeNode=Io});var $o=v(Po=>{"use strict";var Ah=zt(),Mo=qo(),Nh=vt(),Ch=es();function Oh(s,e,{offset:t,start:n,value:i,end:r},a){let o=Object.assign({_directives:e},s),l=new Ah.Document(void 0,o),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=Ch.resolveProps(n,{indicator:"doc-start",next:i!=null?i:r==null?void 0:r[0],offset:t,onError:a,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&a(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Mo.composeNode(c,i,u,a):Mo.composeEmptyNode(c,u.end,n,null,u,a);let f=l.contents.range[2],h=Nh.resolveEnd(r,f,!1,a);return h.comment&&(l.comment=h.comment),l.range=[t,f,h.offset],l}Po.composeDoc=Oh});var Bi=v(jo=>{"use strict";var Lh=ls("process"),Ih=xn(),qh=zt(),ts=Xt(),Ro=P(),Mh=$o(),Ph=vt();function ss(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function Do(s){var i;let e="",t=!1,n=!1;for(let r=0;r<s.length;++r){let a=s[r];switch(a[0]){case"#":e+=(e===""?"":n?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(a.substring(1)||" "),t=!0,n=!1;break;case"%":((i=s[r+1])==null?void 0:i[0])!=="#"&&(r+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var ji=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{let a=ss(t);r?this.warnings.push(new ts.YAMLWarning(a,n,i)):this.errors.push(new ts.YAMLParseError(a,n,i))},this.directives=new Ih.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=Do(this.prelude);if(n){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(Ro.isCollection(r)&&!r.flow&&r.items.length>0){let a=r.items[0];Ro.isPair(a)&&(a=a.key);let o=a.commentBefore;a.commentBefore=o?`${n}
|
|
104
|
+
${o}`:n}else{let a=r.commentBefore;r.commentBefore=a?`${n}
|
|
105
|
+
${a}`:n}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Do(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(Lh.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let r=ss(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Mh.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new ts.YAMLParseError(ss(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new ts.YAMLParseError(ss(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=Ph.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new ts.YAMLParseError(ss(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new qh.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};jo.Composer=ji});var Ko=v(rn=>{"use strict";var $h=Mi(),Rh=$i(),Dh=Xt(),Bo=jt();function jh(s,e=!0,t){if(s){let n=(i,r,a)=>{let o=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(o,r,a);else throw new Dh.YAMLParseError([o,o+1],r,a)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Rh.resolveFlowScalar(s,e,n);case"block-scalar":return $h.resolveBlockScalar({options:{strict:e}},s,n)}}return null}function Bh(s,e){var c;let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:a="PLAIN"}=e,o=Bo.stringifyString({type:a,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=(c=e.end)!=null?c:[{type:"newline",offset:-1,indent:n,source:`
|
|
107
|
+
`}];switch(o[0]){case"|":case">":{let u=o.indexOf(`
|
|
108
|
+
`),f=o.substring(0,u),h=o.substring(u+1)+`
|
|
109
|
+
`,p=[{type:"block-scalar-header",offset:r,indent:n,source:f}];return Fo(p,l)||p.push({type:"newline",offset:-1,indent:n,source:`
|
|
110
|
+
`}),{type:"block-scalar",offset:r,indent:n,props:p,source:h}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:o,end:l};default:return{type:"scalar",offset:r,indent:n,source:o,end:l}}}function Fh(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:a}=t,o="indent"in s?s.indent:null;if(n&&typeof o=="number"&&(o+=2),!a)switch(s.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let l=Bo.stringifyString({type:a,value:e},{implicitKey:i||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Kh(s,l);break;case'"':Fi(s,l,"double-quoted-scalar");break;case"'":Fi(s,l,"single-quoted-scalar");break;default:Fi(s,l,"scalar")}}function Kh(s,e){let t=e.indexOf(`
|
|
111
|
+
`),n=e.substring(0,t),i=e.substring(t+1)+`
|
|
112
|
+
`;if(s.type==="block-scalar"){let r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{let{offset:r}=s,a="indent"in s?s.indent:-1,o=[{type:"block-scalar-header",offset:r,indent:a,source:n}];Fo(o,"end"in s?s.end:void 0)||o.push({type:"newline",offset:-1,indent:a,source:`
|
|
113
|
+
`});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:a,props:o,source:i})}}function Fo(s,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function Fi(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{let n=s.props.slice(1),i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(let r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
|
|
114
|
+
`};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{let n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}rn.createScalarToken=Bh;rn.resolveAsScalar=jh;rn.setScalarValue=Fh});var Uo=v(Vo=>{"use strict";var Vh=s=>"type"in s?on(s):an(s);function on(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=on(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=an(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=an(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=an(s);if(s.end)for(let t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(let t of s.end)e+=t.source;return e}}}function an({start:s,key:e,sep:t,value:n}){let i="";for(let r of s)i+=r.source;if(e&&(i+=on(e)),t)for(let r of t)i+=r.source;return n&&(i+=on(n)),i}Vo.stringify=Vh});var Jo=v(Yo=>{"use strict";var Ki=Symbol("break visit"),Uh=Symbol("skip children"),Go=Symbol("remove item");function tt(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),Ho(Object.freeze([]),s,e)}tt.BREAK=Ki;tt.SKIP=Uh;tt.REMOVE=Go;tt.itemAtPath=(s,e)=>{let t=s;for(let[n,i]of e){let r=t==null?void 0:t[n];if(r&&"items"in r)t=r.items[i];else return}return t};tt.parentCollection=(s,e)=>{let t=tt.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t==null?void 0:t[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Ho(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let a=0;a<r.items.length;++a){let o=Ho(Object.freeze(s.concat([[i,a]])),r.items[a],t);if(typeof o=="number")a=o-1;else{if(o===Ki)return Ki;o===Go&&(r.items.splice(a,1),a-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}Yo.visit=tt});var ln=v(W=>{"use strict";var Vi=Ko(),Gh=Uo(),Hh=Jo(),Ui="\uFEFF",Gi="",Hi="",Yi="",Yh=s=>!!s&&"items"in s,Jh=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function Zh(s){switch(s){case Ui:return"<BOM>";case Gi:return"<DOC>";case Hi:return"<FLOW_END>";case Yi:return"<SCALAR>";default:return JSON.stringify(s)}}function zh(s){switch(s){case Ui:return"byte-order-mark";case Gi:return"doc-mode";case Hi:return"flow-error-end";case Yi:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
115
|
+
`:case`\r
|
|
116
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(s[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}W.createScalarToken=Vi.createScalarToken;W.resolveAsScalar=Vi.resolveAsScalar;W.setScalarValue=Vi.setScalarValue;W.stringify=Gh.stringify;W.visit=Hh.visit;W.BOM=Ui;W.DOCUMENT=Gi;W.FLOW_END=Hi;W.SCALAR=Yi;W.isCollection=Yh;W.isScalar=Jh;W.prettyToken=Zh;W.tokenType=zh});var zi=v(zo=>{"use strict";var ns=ln();function oe(s){switch(s){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case" ":return!0;default:return!1}}var Zo=new Set("0123456789ABCDEFabcdef"),Wh=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),cn=new Set(",[]{}"),Qh=new Set(` ,[]{}
|
|
118
|
+
\r `),Ji=s=>!s||Qh.has(s),Zi=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){var i;if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=(i=this.next)!=null?i:"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
119
|
+
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
120
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
121
|
+
`||!i&&!this.atEnd)return e+n+1}return t===`
|
|
122
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&oe(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
123
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ns.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield ns.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&oe(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!oe(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&oe(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Ji),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&oe(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield ns.FLOW_END,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Ji),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||oe(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),i=n.indexOf(`
|
|
124
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
|
|
125
|
+
`,r)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>oe(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case`
|
|
126
|
+
`:e=r,t=0;break;case"\r":{let a=this.buffer[r+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
127
|
+
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
|
|
128
|
+
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
129
|
+
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,a=this.buffer[r];a==="\r"&&(a=this.buffer[--r]);let o=r;for(;a===" ";)a=this.buffer[--r];if(a===`
|
|
130
|
+
`&&r>=this.pos&&r+1+t>o)e=r;else break}while(!0);return yield ns.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let r=this.buffer[n+1];if(oe(r)||e&&cn.has(r))break;t=n}else if(oe(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
|
|
131
|
+
`?(n+=1,i=`
|
|
132
|
+
`,r=this.buffer[n+1]):t=n),r==="#"||e&&cn.has(r))break;if(i===`
|
|
133
|
+
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&cn.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield ns.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Ji),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(oe(n)||t&&cn.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!oe(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Wh.has(t))t=this.buffer[++e];else if(t==="%"&&Zo.has(this.buffer[e+1])&&Zo.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
134
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
135
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};zo.Lexer=Zi});var Qi=v(Wo=>{"use strict";var Wi=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};Wo.LineCounter=Wi});var er=v(sl=>{"use strict";var Xh=ls("process"),Qo=ln(),ep=zi();function Ie(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function Xo(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function tl(s){switch(s==null?void 0:s.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function un(s){var e;switch(s.type){case"document":return s.start;case"block-map":{let t=s.items[s.items.length-1];return(e=t.sep)!=null?e:t.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function wt(s){var t;if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=s[++e])==null?void 0:t.type)==="space";);return s.splice(e,s.length)}function fn(s,e){if(e.length<1e5)Array.prototype.push.apply(s,e);else for(let t=0;t<e.length;++t)s.push(e[t])}function el(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!Ie(e.start,"explicit-key-ind")&&!Ie(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,tl(e.value)?e.value.end?fn(e.value.end,e.sep):e.value.end=e.sep:fn(e.start,e.sep),delete e.sep)}var Xi=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new ep.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,Xh.env.LOG_TOKENS&&console.log("|",Qo.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Qo.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(e==null?void 0:e.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e!=null?e:this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&el(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Xo(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Xo(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=un(this.peek(2)),n=wt(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
136
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
137
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var n;let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){fn(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",a=[];if(r&&t.sep&&!t.value){let o=[];for(let l=0;l<t.sep.length;++l){let c=t.sep[l];switch(c.type){case"newline":o.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(a.push(this.sourceToken),e.items.push({start:a}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(a.push(this.sourceToken),e.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ie(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(tl(t.key)&&!Ie(t.sep,"newline")){let o=wt(t.start),l=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:c}]})}else a.length>0?t.sep=t.sep.concat(a,this.sourceToken):t.sep.push(this.sourceToken);else if(Ie(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=wt(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:a,key:null,sep:[this.sourceToken]}):Ie(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||t.value?(e.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!Ie(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var n;let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){fn(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||Ie(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while((n==null?void 0:n.type)==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=un(n),r=wt(i);el(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
138
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
139
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=un(e),n=wt(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=un(e),n=wt(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};sl.Parser=Xi});var ol=v(rs=>{"use strict";var nl=Bi(),tp=zt(),is=Xt(),sp=Dn(),np=P(),ip=Qi(),il=er();function rl(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new ip.LineCounter||null,prettyErrors:e}}function rp(s,e={}){let{lineCounter:t,prettyErrors:n}=rl(e),i=new il.Parser(t==null?void 0:t.addNewLine),r=new nl.Composer(e),a=Array.from(r.compose(i.parse(s)));if(n&&t)for(let o of a)o.errors.forEach(is.prettifyError(s,t)),o.warnings.forEach(is.prettifyError(s,t));return a.length>0?a:Object.assign([],{empty:!0},r.streamInfo())}function al(s,e={}){let{lineCounter:t,prettyErrors:n}=rl(e),i=new il.Parser(t==null?void 0:t.addNewLine),r=new nl.Composer(e),a=null;for(let o of r.compose(i.parse(s),!0,s.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new is.YAMLParseError(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(a.errors.forEach(is.prettifyError(s,t)),a.warnings.forEach(is.prettifyError(s,t))),a}function ap(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=al(s,t);if(!i)return null;if(i.warnings.forEach(r=>sp.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function op(s,e,t){var i;let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(s===void 0){let{keepUndefined:r}=(i=t!=null?t:e)!=null?i:{};if(!r)return}return np.isDocument(s)&&!n?s.toString(t):new tp.Document(s,n,t).toString(t)}rs.parse=ap;rs.parseAllDocuments=rp;rs.parseDocument=al;rs.stringify=op});var cl=v(D=>{"use strict";var lp=Bi(),cp=zt(),up=wi(),tr=Xt(),fp=Mt(),qe=P(),dp=Ne(),hp=F(),pp=Oe(),mp=Le(),gp=ln(),yp=zi(),bp=Qi(),vp=er(),dn=ol(),ll=Ot();D.Composer=lp.Composer;D.Document=cp.Document;D.Schema=up.Schema;D.YAMLError=tr.YAMLError;D.YAMLParseError=tr.YAMLParseError;D.YAMLWarning=tr.YAMLWarning;D.Alias=fp.Alias;D.isAlias=qe.isAlias;D.isCollection=qe.isCollection;D.isDocument=qe.isDocument;D.isMap=qe.isMap;D.isNode=qe.isNode;D.isPair=qe.isPair;D.isScalar=qe.isScalar;D.isSeq=qe.isSeq;D.Pair=dp.Pair;D.Scalar=hp.Scalar;D.YAMLMap=pp.YAMLMap;D.YAMLSeq=mp.YAMLSeq;D.CST=gp;D.Lexer=yp.Lexer;D.LineCounter=bp.LineCounter;D.Parser=vp.Parser;D.parse=dn.parse;D.parseAllDocuments=dn.parseAllDocuments;D.parseDocument=dn.parseDocument;D.stringify=dn.stringify;D.visit=ll.visit;D.visitAsync=ll.visitAsync});var Fp={};or(Fp,{Trail:()=>Bp,resolveGuideRequest:()=>Al});var _={};or(_,{BRAND:()=>oc,DIRTY:()=>Me,EMPTY_PATH:()=>jl,INVALID:()=>x,NEVER:()=>Gc,OK:()=>H,ParseStatus:()=>V,Schema:()=>I,ZodAny:()=>ke,ZodArray:()=>ye,ZodBigInt:()=>$e,ZodBoolean:()=>Re,ZodBranded:()=>Nt,ZodCatch:()=>Je,ZodDate:()=>De,ZodDefault:()=>Ye,ZodDiscriminatedUnion:()=>fs,ZodEffects:()=>ee,ZodEnum:()=>Ge,ZodError:()=>J,ZodFirstPartyTypeKind:()=>N,ZodFunction:()=>hs,ZodIntersection:()=>Ke,ZodIssueCode:()=>g,ZodLazy:()=>Ve,ZodLiteral:()=>Ue,ZodMap:()=>ot,ZodNaN:()=>ct,ZodNativeEnum:()=>He,ZodNever:()=>re,ZodNull:()=>Be,ZodNullable:()=>ue,ZodNumber:()=>Pe,ZodObject:()=>Z,ZodOptional:()=>Q,ZodParsedType:()=>w,ZodPipeline:()=>Ct,ZodPromise:()=>_e,ZodReadonly:()=>Ze,ZodRecord:()=>ds,ZodSchema:()=>I,ZodSet:()=>lt,ZodString:()=>Se,ZodSymbol:()=>rt,ZodTransformer:()=>ee,ZodTuple:()=>ce,ZodType:()=>I,ZodUndefined:()=>je,ZodUnion:()=>Fe,ZodUnknown:()=>ge,ZodVoid:()=>at,addIssueToContext:()=>b,any:()=>gc,array:()=>wc,bigint:()=>fc,boolean:()=>vr,coerce:()=>Uc,custom:()=>gr,date:()=>dc,datetimeRegex:()=>pr,defaultErrorMap:()=>pe,discriminatedUnion:()=>Tc,effect:()=>$c,enum:()=>qc,function:()=>Oc,getErrorMap:()=>st,getParsedType:()=>le,instanceof:()=>cc,intersection:()=>xc,isAborted:()=>cs,isAsync:()=>nt,isDirty:()=>us,isValid:()=>we,late:()=>lc,lazy:()=>Lc,literal:()=>Ic,makeIssue:()=>At,map:()=>Nc,nan:()=>uc,nativeEnum:()=>Mc,never:()=>bc,null:()=>mc,nullable:()=>Dc,number:()=>br,object:()=>Sc,objectUtil:()=>vn,oboolean:()=>Vc,onumber:()=>Kc,optional:()=>Rc,ostring:()=>Fc,pipeline:()=>Bc,preprocess:()=>jc,promise:()=>Pc,quotelessJson:()=>$l,record:()=>Ac,set:()=>Cc,setErrorMap:()=>Dl,strictObject:()=>kc,string:()=>yr,symbol:()=>hc,transformer:()=>$c,tuple:()=>Ec,undefined:()=>pc,union:()=>_c,unknown:()=>yc,util:()=>M,void:()=>vc});var M;(function(s){s.assertEqual=i=>{};function e(i){}s.assertIs=e;function t(i){throw new Error}s.assertNever=t,s.arrayToEnum=i=>{let r={};for(let a of i)r[a]=a;return r},s.getValidEnumValues=i=>{let r=s.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(let o of r)a[o]=i[o];return s.objectValues(a)},s.objectValues=i=>s.objectKeys(i).map(function(r){return i[r]}),s.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let r=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&r.push(a);return r},s.find=(i,r)=>{for(let a of i)if(r(a))return a},s.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,r=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(r)}s.joinValues=n,s.jsonStringifyReplacer=(i,r)=>typeof r=="bigint"?r.toString():r})(M||(M={}));var vn;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(vn||(vn={}));var w=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),le=s=>{switch(typeof s){case"undefined":return w.undefined;case"string":return w.string;case"number":return Number.isNaN(s)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(s)?w.array:s===null?w.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?w.promise:typeof Map!="undefined"&&s instanceof Map?w.map:typeof Set!="undefined"&&s instanceof Set?w.set:typeof Date!="undefined"&&s instanceof Date?w.date:w.object;default:return w.unknown}};var g=M.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"]),$l=s=>JSON.stringify(s,null,2).replace(/"([^"]+)":/g,"$1:"),J=class s extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(r){return r.message},n={_errors:[]},i=r=>{for(let a of r.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(t(a));else{let o=n,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(a))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return i(this),n}static assert(e){if(!(e instanceof s))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let i of this.issues)if(i.path.length>0){let r=i.path[0];t[r]=t[r]||[],t[r].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};J.create=s=>new J(s);var Rl=(s,e)=>{let t;switch(s.code){case g.invalid_type:s.received===w.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case g.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,M.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:t=`Unrecognized key(s) in object: ${M.joinValues(s.keys,", ")}`;break;case g.invalid_union:t="Invalid input";break;case g.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${M.joinValues(s.options)}`;break;case g.invalid_enum_value:t=`Invalid enum value. Expected ${M.joinValues(s.options)}, received '${s.received}'`;break;case g.invalid_arguments:t="Invalid function arguments";break;case g.invalid_return_type:t="Invalid function return type";break;case g.invalid_date:t="Invalid date";break;case g.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:M.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case g.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case g.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case g.custom:t="Invalid input";break;case g.invalid_intersection_types:t="Intersection results could not be merged";break;case g.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case g.not_finite:t="Number must be finite";break;default:t=e.defaultError,M.assertNever(s)}return{message:t}},pe=Rl;var cr=pe;function Dl(s){cr=s}function st(){return cr}var At=s=>{let{data:e,path:t,errorMaps:n,issueData:i}=s,r=[...t,...i.path||[]],a={...i,path:r};if(i.message!==void 0)return{...i,path:r,message:i.message};let o="",l=n.filter(c=>!!c).slice().reverse();for(let c of l)o=c(a,{data:e,defaultError:o}).message;return{...i,path:r,message:o}},jl=[];function b(s,e){let t=st(),n=At({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===pe?void 0:pe].filter(i=>!!i)});s.common.issues.push(n)}var V=class s{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let i of t){if(i.status==="aborted")return x;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let i of t){let r=await i.key,a=await i.value;n.push({key:r,value:a})}return s.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:r,value:a}=i;if(r.status==="aborted"||a.status==="aborted")return x;r.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof a.value!="undefined"||i.alwaysSet)&&(n[r.value]=a.value)}return{status:e.value,value:n}}},x=Object.freeze({status:"aborted"}),Me=s=>({status:"dirty",value:s}),H=s=>({status:"valid",value:s}),cs=s=>s.status==="aborted",us=s=>s.status==="dirty",we=s=>s.status==="valid",nt=s=>typeof Promise!="undefined"&&s instanceof Promise;var k;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(k||(k={}));var X=class{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ur=(s,e)=>{if(we(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new J(s.common.issues);return this._error=t,this._error}}};function L(s){if(!s)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:i}=s;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>{var c,u;let{message:l}=s;return a.code==="invalid_enum_value"?{message:l!=null?l:o.defaultError}:typeof o.data=="undefined"?{message:(c=l!=null?l:n)!=null?c:o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:(u=l!=null?l:t)!=null?u:o.defaultError}},description:i}}var I=class{get description(){return this._def.description}_getType(e){return le(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new V,ctx:{common:e.parent.common,data:e.data,parsedType:le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(nt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var r;let n={common:{issues:[],async:(r=t==null?void 0:t.async)!=null?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:le(e)},i=this._parseSync({data:e,path:n.path,parent:n});return ur(n,i)}"~validate"(e){var n,i;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:le(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return we(r)?{value:r.value}:{issues:t.common.issues}}catch(r){(i=(n=r==null?void 0:r.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(r=>we(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:le(e)},i=this._parse({data:e,path:n.path,parent:n}),r=await(nt(i)?i:Promise.resolve(i));return ur(n,r)}refine(e,t){let n=i=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,r)=>{let a=e(i),o=()=>r.addIssue({code:g.custom,...n(i)});return typeof Promise!="undefined"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new ee({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:t=>this["~validate"](t)}}optional(){return Q.create(this,this._def)}nullable(){return ue.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ye.create(this)}promise(){return _e.create(this,this._def)}or(e){return Fe.create([this,e],this._def)}and(e){return Ke.create(this,e,this._def)}transform(e){return new ee({...L(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Ye({...L(this._def),innerType:this,defaultValue:t,typeName:N.ZodDefault})}brand(){return new Nt({typeName:N.ZodBranded,type:this,...L(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Je({...L(this._def),innerType:this,catchValue:t,typeName:N.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ct.create(this,e)}readonly(){return Ze.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Bl=/^c[^\s-]{8,}$/i,Fl=/^[0-9a-z]+$/,Kl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vl=/^[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,Ul=/^[a-z0-9_-]{21}$/i,Gl=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Hl=/^[-+]?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)?)??$/,Yl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Jl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",wn,Zl=/^(?:(?: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])$/,zl=/^(?:(?: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])$/,Wl=/^(([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]))$/,Ql=/^(([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])$/,Xl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ec=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dr="((\\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])))",tc=new RegExp(`^${dr}$`);function hr(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);let t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function sc(s){return new RegExp(`^${hr(s)}$`)}function pr(s){let e=`${dr}T${hr(s)}`,t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function nc(s,e){return!!((e==="v4"||!e)&&Zl.test(s)||(e==="v6"||!e)&&Wl.test(s))}function ic(s,e){if(!Gl.test(s))return!1;try{let[t]=s.split(".");if(!t)return!1;let n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function rc(s,e){return!!((e==="v4"||!e)&&zl.test(s)||(e==="v6"||!e)&&Ql.test(s))}var Se=class s extends I{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){let r=this._getOrReturnCtx(e);return b(r,{code:g.invalid_type,expected:w.string,received:r.parsedType}),x}let n=new V,i;for(let r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="max")e.data.length>r.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){let a=e.data.length>r.value,o=e.data.length<r.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?b(i,{code:g.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):o&&b(i,{code:g.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if(r.kind==="email")Yl.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"email",code:g.invalid_string,message:r.message}),n.dirty());else if(r.kind==="emoji")wn||(wn=new RegExp(Jl,"u")),wn.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"emoji",code:g.invalid_string,message:r.message}),n.dirty());else if(r.kind==="uuid")Vl.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"uuid",code:g.invalid_string,message:r.message}),n.dirty());else if(r.kind==="nanoid")Ul.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"nanoid",code:g.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid")Bl.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"cuid",code:g.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid2")Fl.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"cuid2",code:g.invalid_string,message:r.message}),n.dirty());else if(r.kind==="ulid")Kl.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"ulid",code:g.invalid_string,message:r.message}),n.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),b(i,{validation:"url",code:g.invalid_string,message:r.message}),n.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"regex",code:g.invalid_string,message:r.message}),n.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty()):r.kind==="datetime"?pr(r).test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:"datetime",message:r.message}),n.dirty()):r.kind==="date"?tc.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:"date",message:r.message}),n.dirty()):r.kind==="time"?sc(r).test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{code:g.invalid_string,validation:"time",message:r.message}),n.dirty()):r.kind==="duration"?Hl.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"duration",code:g.invalid_string,message:r.message}),n.dirty()):r.kind==="ip"?nc(e.data,r.version)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"ip",code:g.invalid_string,message:r.message}),n.dirty()):r.kind==="jwt"?ic(e.data,r.alg)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"jwt",code:g.invalid_string,message:r.message}),n.dirty()):r.kind==="cidr"?rc(e.data,r.version)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"cidr",code:g.invalid_string,message:r.message}),n.dirty()):r.kind==="base64"?Xl.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"base64",code:g.invalid_string,message:r.message}),n.dirty()):r.kind==="base64url"?ec.test(e.data)||(i=this._getOrReturnCtx(e,i),b(i,{validation:"base64url",code:g.invalid_string,message:r.message}),n.dirty()):M.assertNever(r);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),{validation:t,code:g.invalid_string,...k.errToObj(n)})}_addCheck(e){return new s({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...k.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...k.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...k.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null?t:!1,local:(n=e==null?void 0:e.local)!=null?n:!1,...k.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,...k.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...k.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...k.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...k.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...k.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...k.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...k.errToObj(t)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new s({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new s({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new s({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Se.create=s=>{var e;return new Se({checks:[],typeName:N.ZodString,coerce:(e=s==null?void 0:s.coerce)!=null?e:!1,...L(s)})};function ac(s,e){let t=(s.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,r=Number.parseInt(s.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return r%a/10**i}var Pe=class s extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==w.number){let r=this._getOrReturnCtx(e);return b(r,{code:g.invalid_type,expected:w.number,received:r.parsedType}),x}let n,i=new V;for(let r of this._def.checks)r.kind==="int"?M.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:g.invalid_type,expected:"integer",received:"float",message:r.message}),i.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="multipleOf"?ac(e.data,r.value)!==0&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_finite,message:r.message}),i.dirty()):M.assertNever(r);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,n,i){return new s({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:k.toString(i)}]})}_addCheck(e){return new s({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&M.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Pe.create=s=>new Pe({checks:[],typeName:N.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...L(s)});var $e=class s extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==w.bigint)return this._getInvalidInput(e);let n,i=new V;for(let r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):M.assertNever(r);return{status:i.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return b(t,{code:g.invalid_type,expected:w.bigint,received:t.parsedType}),x}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,n,i){return new s({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:k.toString(i)}]})}_addCheck(e){return new s({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};$e.create=s=>{var e;return new $e({checks:[],typeName:N.ZodBigInt,coerce:(e=s==null?void 0:s.coerce)!=null?e:!1,...L(s)})};var Re=class extends I{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.boolean,received:n.parsedType}),x}return H(e.data)}};Re.create=s=>new Re({typeName:N.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...L(s)});var De=class s extends I{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){let r=this._getOrReturnCtx(e);return b(r,{code:g.invalid_type,expected:w.date,received:r.parsedType}),x}if(Number.isNaN(e.data.getTime())){let r=this._getOrReturnCtx(e);return b(r,{code:g.invalid_date}),x}let n=new V,i;for(let r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(i=this._getOrReturnCtx(e,i),b(i,{code:g.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):M.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new s({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:k.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};De.create=s=>new De({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:N.ZodDate,...L(s)});var rt=class extends I{_parse(e){if(this._getType(e)!==w.symbol){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.symbol,received:n.parsedType}),x}return H(e.data)}};rt.create=s=>new rt({typeName:N.ZodSymbol,...L(s)});var je=class extends I{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.undefined,received:n.parsedType}),x}return H(e.data)}};je.create=s=>new je({typeName:N.ZodUndefined,...L(s)});var Be=class extends I{_parse(e){if(this._getType(e)!==w.null){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.null,received:n.parsedType}),x}return H(e.data)}};Be.create=s=>new Be({typeName:N.ZodNull,...L(s)});var ke=class extends I{constructor(){super(...arguments),this._any=!0}_parse(e){return H(e.data)}};ke.create=s=>new ke({typeName:N.ZodAny,...L(s)});var ge=class extends I{constructor(){super(...arguments),this._unknown=!0}_parse(e){return H(e.data)}};ge.create=s=>new ge({typeName:N.ZodUnknown,...L(s)});var re=class extends I{_parse(e){let t=this._getOrReturnCtx(e);return b(t,{code:g.invalid_type,expected:w.never,received:t.parsedType}),x}};re.create=s=>new re({typeName:N.ZodNever,...L(s)});var at=class extends I{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.void,received:n.parsedType}),x}return H(e.data)}};at.create=s=>new at({typeName:N.ZodVoid,...L(s)});var ye=class s extends I{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==w.array)return b(t,{code:g.invalid_type,expected:w.array,received:t.parsedType}),x;if(i.exactLength!==null){let a=t.data.length>i.exactLength.value,o=t.data.length<i.exactLength.value;(a||o)&&(b(t,{code:a?g.too_big:g.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(b(t,{code:g.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(b(t,{code:g.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((a,o)=>i.type._parseAsync(new X(t,a,t.path,o)))).then(a=>V.mergeArray(n,a));let r=[...t.data].map((a,o)=>i.type._parseSync(new X(t,a,t.path,o)));return V.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new s({...this._def,minLength:{value:e,message:k.toString(t)}})}max(e,t){return new s({...this._def,maxLength:{value:e,message:k.toString(t)}})}length(e,t){return new s({...this._def,exactLength:{value:e,message:k.toString(t)}})}nonempty(e){return this.min(1,e)}};ye.create=(s,e)=>new ye({type:s,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...L(e)});function it(s){if(s instanceof Z){let e={};for(let t in s.shape){let n=s.shape[t];e[t]=Q.create(it(n))}return new Z({...s._def,shape:()=>e})}else return s instanceof ye?new ye({...s._def,type:it(s.element)}):s instanceof Q?Q.create(it(s.unwrap())):s instanceof ue?ue.create(it(s.unwrap())):s instanceof ce?ce.create(s.items.map(e=>it(e))):s}var Z=class s extends I{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=M.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==w.object){let c=this._getOrReturnCtx(e);return b(c,{code:g.invalid_type,expected:w.object,received:c.parsedType}),x}let{status:n,ctx:i}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof re&&this._def.unknownKeys==="strip"))for(let c in i.data)a.includes(c)||o.push(c);let l=[];for(let c of a){let u=r[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new X(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof re){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")o.length>0&&(b(i,{code:g.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of o){let f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new X(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let f=await u.key,h=await u.value;c.push({key:f,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>V.mergeObjectSync(n,c)):V.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new s({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var r,a,o,l;let i=(o=(a=(r=this._def).errorMap)==null?void 0:a.call(r,t,n).message)!=null?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(l=k.errToObj(e).message)!=null?l:i}:{message:i}}}:{}})}strip(){return new s({...this._def,unknownKeys:"strip"})}passthrough(){return new s({...this._def,unknownKeys:"passthrough"})}extend(e){return new s({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new s({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new s({...this._def,catchall:e})}pick(e){let t={};for(let n of M.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new s({...this._def,shape:()=>t})}omit(e){let t={};for(let n of M.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new s({...this._def,shape:()=>t})}deepPartial(){return it(this)}partial(e){let t={};for(let n of M.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}return new s({...this._def,shape:()=>t})}required(e){let t={};for(let n of M.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let r=this.shape[n];for(;r instanceof Q;)r=r._def.innerType;t[n]=r}return new s({...this._def,shape:()=>t})}keyof(){return mr(M.objectKeys(this.shape))}};Z.create=(s,e)=>new Z({shape:()=>s,unknownKeys:"strip",catchall:re.create(),typeName:N.ZodObject,...L(e)});Z.strictCreate=(s,e)=>new Z({shape:()=>s,unknownKeys:"strict",catchall:re.create(),typeName:N.ZodObject,...L(e)});Z.lazycreate=(s,e)=>new Z({shape:s,unknownKeys:"strip",catchall:re.create(),typeName:N.ZodObject,...L(e)});var Fe=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(r){for(let o of r)if(o.result.status==="valid")return o.result;for(let o of r)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let a=r.map(o=>new J(o.ctx.common.issues));return b(t,{code:g.invalid_union,unionErrors:a}),x}if(t.common.async)return Promise.all(n.map(async r=>{let a={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(i);{let r,a=[];for(let l of n){let c={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!r&&(r={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;let o=a.map(l=>new J(l));return b(t,{code:g.invalid_union,unionErrors:o}),x}}get options(){return this._def.options}};Fe.create=(s,e)=>new Fe({options:s,typeName:N.ZodUnion,...L(e)});var me=s=>s instanceof Ve?me(s.schema):s instanceof ee?me(s.innerType()):s instanceof Ue?[s.value]:s instanceof Ge?s.options:s instanceof He?M.objectValues(s.enum):s instanceof Ye?me(s._def.innerType):s instanceof je?[void 0]:s instanceof Be?[null]:s instanceof Q?[void 0,...me(s.unwrap())]:s instanceof ue?[null,...me(s.unwrap())]:s instanceof Nt||s instanceof Ze?me(s.unwrap()):s instanceof Je?me(s._def.innerType):[],fs=class s extends I{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.object)return b(t,{code:g.invalid_type,expected:w.object,received:t.parsedType}),x;let n=this.discriminator,i=t.data[n],r=this.optionsMap.get(i);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(b(t,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let i=new Map;for(let r of t){let a=me(r.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of a){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,r)}}return new s({typeName:N.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...L(n)})}};function Sn(s,e){let t=le(s),n=le(e);if(s===e)return{valid:!0,data:s};if(t===w.object&&n===w.object){let i=M.objectKeys(e),r=M.objectKeys(s).filter(o=>i.indexOf(o)!==-1),a={...s,...e};for(let o of r){let l=Sn(s[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(t===w.array&&n===w.array){if(s.length!==e.length)return{valid:!1};let i=[];for(let r=0;r<s.length;r++){let a=s[r],o=e[r],l=Sn(a,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return t===w.date&&n===w.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}var Ke=class extends I{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=(r,a)=>{if(cs(r)||cs(a))return x;let o=Sn(r.value,a.value);return o.valid?((us(r)||us(a))&&t.dirty(),{status:t.value,value:o.data}):(b(n,{code:g.invalid_intersection_types}),x)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,a])=>i(r,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ke.create=(s,e,t)=>new Ke({left:s,right:e,typeName:N.ZodIntersection,...L(t)});var ce=class s extends I{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.array)return b(n,{code:g.invalid_type,expected:w.array,received:n.parsedType}),x;if(n.data.length<this._def.items.length)return b(n,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&n.data.length>this._def.items.length&&(b(n,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let r=[...n.data].map((a,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new X(n,a,n.path,o)):null}).filter(a=>!!a);return n.common.async?Promise.all(r).then(a=>V.mergeArray(t,a)):V.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new s({...this._def,rest:e})}};ce.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ce({items:s,typeName:N.ZodTuple,rest:null,...L(e)})};var ds=class s extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.object)return b(n,{code:g.invalid_type,expected:w.object,received:n.parsedType}),x;let i=[],r=this._def.keyType,a=this._def.valueType;for(let o in n.data)i.push({key:r._parse(new X(n,o,n.path,o)),value:a._parse(new X(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?V.mergeObjectAsync(t,i):V.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof I?new s({keyType:e,valueType:t,typeName:N.ZodRecord,...L(n)}):new s({keyType:Se.create(),valueType:e,typeName:N.ZodRecord,...L(t)})}},ot=class extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.map)return b(n,{code:g.invalid_type,expected:w.map,received:n.parsedType}),x;let i=this._def.keyType,r=this._def.valueType,a=[...n.data.entries()].map(([o,l],c)=>({key:i._parse(new X(n,o,n.path,[c,"key"])),value:r._parse(new X(n,l,n.path,[c,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return x;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(c.value,u.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let l of a){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return x;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(c.value,u.value)}return{status:t.value,value:o}}}};ot.create=(s,e,t)=>new ot({valueType:e,keyType:s,typeName:N.ZodMap,...L(t)});var lt=class s extends I{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.set)return b(n,{code:g.invalid_type,expected:w.set,received:n.parsedType}),x;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(b(n,{code:g.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(b(n,{code:g.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let r=this._def.valueType;function a(l){let c=new Set;for(let u of l){if(u.status==="aborted")return x;u.status==="dirty"&&t.dirty(),c.add(u.value)}return{status:t.value,value:c}}let o=[...n.data.values()].map((l,c)=>r._parse(new X(n,l,n.path,c)));return n.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,t){return new s({...this._def,minSize:{value:e,message:k.toString(t)}})}max(e,t){return new s({...this._def,maxSize:{value:e,message:k.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};lt.create=(s,e)=>new lt({valueType:s,minSize:null,maxSize:null,typeName:N.ZodSet,...L(e)});var hs=class s extends I{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.function)return b(t,{code:g.invalid_type,expected:w.function,received:t.parsedType}),x;function n(o,l){return At({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,st(),pe].filter(c=>!!c),issueData:{code:g.invalid_arguments,argumentsError:l}})}function i(o,l){return At({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,st(),pe].filter(c=>!!c),issueData:{code:g.invalid_return_type,returnTypeError:l}})}let r={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof _e){let o=this;return H(async function(...l){let c=new J([]),u=await o._def.args.parseAsync(l,r).catch(p=>{throw c.addIssue(n(l,p)),c}),f=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(f,r).catch(p=>{throw c.addIssue(i(f,p)),c})})}else{let o=this;return H(function(...l){let c=o._def.args.safeParse(l,r);if(!c.success)throw new J([n(l,c.error)]);let u=Reflect.apply(a,this,c.data),f=o._def.returns.safeParse(u,r);if(!f.success)throw new J([i(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new s({...this._def,args:ce.create(e).rest(ge.create())})}returns(e){return new s({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new s({args:e||ce.create([]).rest(ge.create()),returns:t||ge.create(),typeName:N.ZodFunction,...L(n)})}},Ve=class extends I{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ve.create=(s,e)=>new Ve({getter:s,typeName:N.ZodLazy,...L(e)});var Ue=class extends I{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return b(t,{received:t.data,code:g.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ue.create=(s,e)=>new Ue({value:s,typeName:N.ZodLiteral,...L(e)});function mr(s,e){return new Ge({values:s,typeName:N.ZodEnum,...L(e)})}var Ge=class s extends I{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return b(t,{expected:M.joinValues(n),received:t.parsedType,code:g.invalid_type}),x}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return b(t,{received:t.data,code:g.invalid_enum_value,options:n}),x}return H(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return s.create(e,{...this._def,...t})}exclude(e,t=this._def){return s.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};Ge.create=mr;var He=class extends I{_parse(e){let t=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==w.string&&n.parsedType!==w.number){let i=M.objectValues(t);return b(n,{expected:M.joinValues(i),received:n.parsedType,code:g.invalid_type}),x}if(this._cache||(this._cache=new Set(M.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=M.objectValues(t);return b(n,{received:n.data,code:g.invalid_enum_value,options:i}),x}return H(e.data)}get enum(){return this._def.values}};He.create=(s,e)=>new He({values:s,typeName:N.ZodNativeEnum,...L(e)});var _e=class extends I{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.promise&&t.common.async===!1)return b(t,{code:g.invalid_type,expected:w.promise,received:t.parsedType}),x;let n=t.parsedType===w.promise?t.data:Promise.resolve(t.data);return H(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};_e.create=(s,e)=>new _e({type:s,typeName:N.ZodPromise,...L(e)});var ee=class extends I{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,r={addIssue:a=>{b(n,a),a.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),i.type==="preprocess"){let a=i.transform(n.data,r);if(n.common.async)return Promise.resolve(a).then(async o=>{if(t.value==="aborted")return x;let l=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return l.status==="aborted"?x:l.status==="dirty"?Me(l.value):t.value==="dirty"?Me(l.value):l});{if(t.value==="aborted")return x;let o=this._def.schema._parseSync({data:a,path:n.path,parent:n});return o.status==="aborted"?x:o.status==="dirty"?Me(o.value):t.value==="dirty"?Me(o.value):o}}if(i.type==="refinement"){let a=o=>{let l=i.refinement(o,r);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?x:(o.status==="dirty"&&t.dirty(),a(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?x:(o.status==="dirty"&&t.dirty(),a(o.value).then(()=>({status:t.value,value:o.value}))))}if(i.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!we(a))return x;let o=i.transform(a.value,r);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>we(a)?Promise.resolve(i.transform(a.value,r)).then(o=>({status:t.value,value:o})):x);M.assertNever(i)}};ee.create=(s,e,t)=>new ee({schema:s,typeName:N.ZodEffects,effect:e,...L(t)});ee.createWithPreprocess=(s,e,t)=>new ee({schema:e,effect:{type:"preprocess",transform:s},typeName:N.ZodEffects,...L(t)});var Q=class extends I{_parse(e){return this._getType(e)===w.undefined?H(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Q.create=(s,e)=>new Q({innerType:s,typeName:N.ZodOptional,...L(e)});var ue=class extends I{_parse(e){return this._getType(e)===w.null?H(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ue.create=(s,e)=>new ue({innerType:s,typeName:N.ZodNullable,...L(e)});var Ye=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===w.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Ye.create=(s,e)=>new Ye({innerType:s,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});var Je=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return nt(i)?i.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new J(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new J(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Je.create=(s,e)=>new Je({innerType:s,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});var ct=class extends I{_parse(e){if(this._getType(e)!==w.nan){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.nan,received:n.parsedType}),x}return{status:"valid",value:e.data}}};ct.create=s=>new ct({typeName:N.ZodNaN,...L(s)});var oc=Symbol("zod_brand"),Nt=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Ct=class s extends I{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?x:r.status==="dirty"?(t.dirty(),Me(r.value)):this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?x:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new s({in:e,out:t,typeName:N.ZodPipeline})}},Ze=class extends I{_parse(e){let t=this._def.innerType._parse(e),n=i=>(we(i)&&(i.value=Object.freeze(i.value)),i);return nt(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}};Ze.create=(s,e)=>new Ze({innerType:s,typeName:N.ZodReadonly,...L(e)});function fr(s,e){let t=typeof s=="function"?s(e):typeof s=="string"?{message:s}:s;return typeof t=="string"?{message:t}:t}function gr(s,e={},t){return s?ke.create().superRefine((n,i)=>{var a,o;let r=s(n);if(r instanceof Promise)return r.then(l=>{var c,u;if(!l){let f=fr(e,n),h=(u=(c=f.fatal)!=null?c:t)!=null?u:!0;i.addIssue({code:"custom",...f,fatal:h})}});if(!r){let l=fr(e,n),c=(o=(a=l.fatal)!=null?a:t)!=null?o:!0;i.addIssue({code:"custom",...l,fatal:c})}}):ke.create()}var lc={object:Z.lazycreate},N;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(N||(N={}));var cc=(s,e={message:`Input not instance of ${s.name}`})=>gr(t=>t instanceof s,e),yr=Se.create,br=Pe.create,uc=ct.create,fc=$e.create,vr=Re.create,dc=De.create,hc=rt.create,pc=je.create,mc=Be.create,gc=ke.create,yc=ge.create,bc=re.create,vc=at.create,wc=ye.create,Sc=Z.create,kc=Z.strictCreate,_c=Fe.create,Tc=fs.create,xc=Ke.create,Ec=ce.create,Ac=ds.create,Nc=ot.create,Cc=lt.create,Oc=hs.create,Lc=Ve.create,Ic=Ue.create,qc=Ge.create,Mc=He.create,Pc=_e.create,$c=ee.create,Rc=Q.create,Dc=ue.create,jc=ee.createWithPreprocess,Bc=Ct.create,Fc=()=>yr().optional(),Kc=()=>br().optional(),Vc=()=>vr().optional(),Uc={string:(s=>Se.create({...s,coerce:!0})),number:(s=>Pe.create({...s,coerce:!0})),boolean:(s=>Re.create({...s,coerce:!0})),bigint:(s=>$e.create({...s,coerce:!0})),date:(s=>De.create({...s,coerce:!0}))};var Gc=x;var _p=Ml(cl(),1),ul=["testId","role","label","text","selector"],as=_.object({testId:_.string().min(1).optional(),role:_.string().min(1).optional(),name:_.string().min(1).optional(),label:_.string().min(1).optional(),text:_.string().min(1).optional(),selector:_.string().min(1).optional()}).strict().superRefine((s,e)=>{s.testId||s.role&&s.name||s.label||s.text||s.selector||e.addIssue({code:_.ZodIssueCode.custom,message:"Target must specify at least one of testId, role+name, label, text, or selector."}),s.role&&!s.name&&e.addIssue({code:_.ZodIssueCode.custom,path:["name"],message:"A role target also requires a name."}),s.name&&!s.role&&e.addIssue({code:_.ZodIssueCode.custom,path:["role"],message:"A name target also requires a role."})}),kt=_.string().min(1),_t=_.string().min(1),sr=_.boolean().optional(),fl=_.object({id:kt,action:_.literal("click"),target:as,instruction:_t,autoAdvance:sr}).strict(),dl=_.object({id:kt,action:_.literal("input"),target:as,value:_.string(),instruction:_t,autoAdvance:sr}).strict(),hl=_.object({id:kt,action:_.literal("select"),target:as,value:_.string(),instruction:_t,autoAdvance:sr}).strict(),pl=_.object({id:kt,action:_.literal("verify"),target:as,instruction:_t}).strict(),ml=_.object({id:kt,action:_.literal("navigate"),url:_.string().min(1),instruction:_t}).strict(),gl=_.object({id:kt,action:_.literal("wait"),target:as.optional(),timeoutMs:_.number().int().positive().optional(),instruction:_t}).strict(),wp=_.discriminatedUnion("action",[fl,dl,hl,pl,ml,gl]),St={before:_.string().min(1).optional(),after:_.string().min(1).optional()},Sp=_.discriminatedUnion("action",[fl.extend(St),dl.extend(St),hl.extend(St),pl.extend(St),ml.extend(St),gl.extend(St)]),kp=_.object({id:_.string().min(1),title:_.string().min(1),application:_.string().min(1),release:_.string().min(1),start:_.object({url:_.string().min(1)}).strict(),steps:_.array(wp).min(1,"A guide must contain at least one step.")}).passthrough(),$g=_.object({id:_.string().min(1),title:_.string().min(1),application:_.string().min(1),release:_.string().min(1),start:_.object({url:_.string().min(1)}).strict(),extends:_.string().min(1).optional(),steps:_.array(Sp).min(1,"A guide must contain at least one step.")}).passthrough().superRefine((s,e)=>{s.steps.forEach((t,n)=>{let i=t.before!==void 0,r=t.after!==void 0;i&&r&&e.addIssue({code:_.ZodIssueCode.custom,path:["steps",n],message:"An extension step must use either before or after, not both."}),s.extends&&!i&&!r&&e.addIssue({code:_.ZodIssueCode.custom,path:["steps",n],message:"An extension step must specify before or after."}),!s.extends&&(i||r)&&e.addIssue({code:_.ZodIssueCode.custom,path:["steps",n],message:"before and after are only valid on a guide with extends."})})});function Tp(s){if(s.length===0)return"(root)";let e="";for(let t of s)typeof t=="number"?e+=`[${t}]`:e+=e?`.${t}`:t;return e}function xp(s){return s.issues.map(e=>{let t=Tp(e.path);return e.path[e.path.length-1]==="target"&&e.code==="invalid_type"?{path:t,message:"Target is required."}:{path:t,message:e.message}})}function Ep(s){let e=kp.safeParse(s);return e.success?{success:!0,guide:e.data}:{success:!1,issues:xp(e.error)}}function yl(s){let e;try{e=JSON.parse(s)}catch(t){return{success:!1,issues:[{path:"(json)",message:t instanceof Error?t.message:"Invalid JSON."}]}}return Ep(e)}async function bl(s){let e;try{e=await fetch(s,{credentials:"same-origin"})}catch{return{success:!1,kind:"network-error"}}if(!e.ok)return{success:!1,kind:e.status===404?"not-found":"server-error"};let t=await e.text(),n=yl(t);return n.success?{success:!0,guide:n.guide}:{success:!1,kind:"invalid",issues:n.issues}}var hn="trail:checkpoint";function nr(){try{return window.sessionStorage}catch{return null}}function ir(s){let e=nr();if(e)try{e.setItem(hn,JSON.stringify(s))}catch{}}function vl(s,e){let t=nr();if(!t)return null;try{let n=t.getItem(hn);if(!n)return null;let i=JSON.parse(n);return i.release===s&&i.guideId===e&&typeof i.stepIndex=="number"&&Number.isInteger(i.stepIndex)&&typeof i.stepId=="string"?{release:s,guideId:e,stepIndex:i.stepIndex,stepId:i.stepId}:(t.removeItem(hn),null)}catch{return Tt(),null}}function Tt(){let s=nr();if(s)try{s.removeItem(hn)}catch{}}function wl(s,e){if(!e)return 0;let t=s.steps.findIndex(n=>n.id===e.stepId);return t>=0?t:null}var pn=class{constructor(e,t=0){R(this,"guide");R(this,"index");this.guide=e,this.index=Math.min(Math.max(t,0),e.steps.length-1)}get currentIndex(){return this.index}get currentStep(){return this.guide.steps[this.index]}get total(){return this.guide.steps.length}get isFirst(){return this.index===0}get isLast(){return this.index===this.guide.steps.length-1}next(){return this.isLast?!1:(this.index+=1,!0)}back(){return this.isFirst?!1:(this.index-=1,!0)}reset(){this.index=0}};var mn=class{constructor(e){R(this,"box");R(this,"blockers");R(this,"target",null);R(this,"resizeObserver",null);R(this,"rafHandle",null);R(this,"scheduleReposition",()=>{this.rafHandle===null&&(this.rafHandle=requestAnimationFrame(()=>{this.rafHandle=null,this.reposition()}))});this.box=document.createElement("div"),this.box.className="tg-spotlight",this.blockers=Array.from({length:4},()=>{let t=document.createElement("div");return t.className="tg-blocker",e.appendChild(t),t}),e.appendChild(this.box),window.addEventListener("resize",this.scheduleReposition),window.addEventListener("scroll",this.scheduleReposition,!0)}attachTo(e){this.detachObserver(),this.target=e,this.resizeObserver=new ResizeObserver(this.scheduleReposition),this.resizeObserver.observe(e),this.box.style.display="block",this.blockers.forEach(t=>t.style.display="block"),this.reposition()}hide(){this.target=null,this.detachObserver(),this.box.style.display="none",this.blockers.forEach(e=>e.style.display="none")}destroy(){this.hide(),window.removeEventListener("resize",this.scheduleReposition),window.removeEventListener("scroll",this.scheduleReposition,!0),this.blockers.forEach(e=>e.remove()),this.box.remove()}detachObserver(){var e;(e=this.resizeObserver)==null||e.disconnect(),this.resizeObserver=null}reposition(){if(!this.target)return;let e=this.target.getBoundingClientRect();this.box.style.top=`${e.top-6}px`,this.box.style.left=`${e.left-6}px`,this.box.style.width=`${e.width+12}px`,this.box.style.height=`${e.height+12}px`;let t=Math.max(0,e.top-6),n=Math.max(0,e.left-6),i=Math.min(window.innerWidth,e.right+6),r=Math.min(window.innerHeight,e.bottom+6),a=[[0,0,window.innerWidth,t],[0,t,n,r-t],[i,t,window.innerWidth-i,r-t],[0,r,window.innerWidth,window.innerHeight-r]];this.blockers.forEach((o,l)=>{let[c,u,f,h]=a[l];Object.assign(o.style,{left:`${c}px`,top:`${u}px`,width:`${f}px`,height:`${h}px`})})}};var Sl="trail-sdk-styles",Ap=`
|
|
140
|
+
.tg-root { position: fixed; inset: 0; z-index: 2147483647; pointer-events: none; }
|
|
141
|
+
.tg-spotlight {
|
|
142
|
+
position: fixed;
|
|
143
|
+
display: none;
|
|
144
|
+
border: 2px solid #4f7cff;
|
|
145
|
+
border-radius: 6px;
|
|
146
|
+
box-shadow: 0 0 0 9999px rgba(15, 17, 26, 0.55);
|
|
147
|
+
pointer-events: none;
|
|
148
|
+
transition: top 120ms ease, left 120ms ease, width 120ms ease, height 120ms ease;
|
|
149
|
+
}
|
|
150
|
+
.tg-blocker { position: fixed; z-index: 0; pointer-events: auto; }
|
|
151
|
+
.tg-panel {
|
|
152
|
+
position: fixed;
|
|
153
|
+
right: 20px;
|
|
154
|
+
bottom: 20px;
|
|
155
|
+
z-index: 2;
|
|
156
|
+
width: 320px;
|
|
157
|
+
max-width: calc(100vw - 40px);
|
|
158
|
+
background: #12131a;
|
|
159
|
+
color: #f4f5f7;
|
|
160
|
+
border-radius: 12px;
|
|
161
|
+
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
|
|
162
|
+
padding: 16px 18px;
|
|
163
|
+
font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
164
|
+
pointer-events: auto;
|
|
165
|
+
}
|
|
166
|
+
.tg-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
|
|
167
|
+
.tg-progress-text { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #9aa1b5; }
|
|
168
|
+
.tg-exit-btn {
|
|
169
|
+
background: transparent; border: none; color: #9aa1b5; font-size: 18px; line-height: 1; cursor: pointer;
|
|
170
|
+
padding: 4px; border-radius: 6px;
|
|
171
|
+
}
|
|
172
|
+
.tg-exit-btn:hover, .tg-exit-btn:focus-visible { color: #f4f5f7; background: rgba(255,255,255,0.08); }
|
|
173
|
+
.tg-progress-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.12); overflow: hidden; margin-bottom: 12px; }
|
|
174
|
+
.tg-progress-fill { height: 100%; background: #4f7cff; transition: width 160ms ease; }
|
|
175
|
+
.tg-title { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
|
|
176
|
+
.tg-instruction { margin: 0 0 16px; color: #d4d7e2; white-space: pre-line; }
|
|
177
|
+
.tg-panel-footer { display: flex; justify-content: space-between; gap: 8px; }
|
|
178
|
+
.tg-btn {
|
|
179
|
+
appearance: none; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.06);
|
|
180
|
+
color: #f4f5f7; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
|
|
181
|
+
}
|
|
182
|
+
.tg-btn:hover { background: rgba(255,255,255,0.14); }
|
|
183
|
+
.tg-btn:focus-visible { outline: 2px solid #4f7cff; outline-offset: 2px; }
|
|
184
|
+
.tg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
185
|
+
.tg-btn-primary { background: #4f7cff; border-color: #4f7cff; }
|
|
186
|
+
.tg-btn-primary:hover { background: #3f6ce0; }
|
|
187
|
+
.tg-error .tg-title { color: #ff6b6b; }
|
|
188
|
+
.tg-error-detail { font-size: 12px; color: #9aa1b5; margin: -8px 0 16px; }
|
|
189
|
+
`;function Np(){if(document.getElementById(Sl))return;let s=document.createElement("style");s.id=Sl,s.textContent=Ap,document.head.appendChild(s)}var kl='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',xt=class{constructor(e){R(this,"root");R(this,"panel");R(this,"spotlight");R(this,"callbacks");R(this,"keydownHandler",null);R(this,"previousBodyOverflow");R(this,"previouslyFocusedElement");R(this,"focusTarget",null);Np(),this.callbacks=e,this.previouslyFocusedElement=document.activeElement instanceof HTMLElement?document.activeElement:null,this.root=document.createElement("div"),this.root.className="tg-root",this.panel=document.createElement("div"),this.panel.className="tg-panel",this.panel.setAttribute("role","dialog"),this.panel.setAttribute("aria-label","Trail guide"),this.panel.setAttribute("aria-live","polite"),this.panel.tabIndex=-1,this.root.appendChild(this.panel),this.spotlight=new mn(this.root),document.body.appendChild(this.root),this.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this.keydownHandler=t=>{if(t.key==="Escape"){t.preventDefault(),this.callbacks.onExit();return}t.key==="Tab"&&this.trapTabFocus(t)},document.addEventListener("keydown",this.keydownHandler,!0)}trapTabFocus(e){var l;let t=Array.from(this.panel.querySelectorAll(kl)).filter(c=>c.offsetParent!==null||c===document.activeElement),n=this.focusTarget&&this.focusTarget.isConnected&&this.focusTarget.matches(kl)&&(this.focusTarget.offsetParent!==null||this.focusTarget===document.activeElement)?this.focusTarget:null,i=n?[n,...t]:t;if(i.length===0){e.preventDefault(),this.focusPanel();return}let r=i[0],a=i[i.length-1],o=document.activeElement;if(o===this.panel||!i.includes(o)){e.preventDefault(),(e.shiftKey?a:r).focus();return}if(n&&o===n){e.preventDefault(),(e.shiftKey?a:(l=t[0])!=null?l:n).focus();return}if(e.shiftKey&&n&&o===t[0]){e.preventDefault(),n.focus();return}e.shiftKey&&o===r?(e.preventDefault(),a.focus()):!e.shiftKey&&o===a&&(e.preventDefault(),r.focus())}renderStep(e){let t=Math.round(e.stepNumber/e.totalSteps*100);this.panel.className="tg-panel",this.panel.innerHTML=`
|
|
190
|
+
<div class="tg-panel-header">
|
|
191
|
+
<span class="tg-progress-text">Step ${e.stepNumber} of ${e.totalSteps}</span>
|
|
192
|
+
<button type="button" class="tg-exit-btn" aria-label="Exit Trail guide">×</button>
|
|
193
|
+
</div>
|
|
194
|
+
<div class="tg-progress-bar"><div class="tg-progress-fill" style="width:${t}%"></div></div>
|
|
195
|
+
<h2 class="tg-title"></h2>
|
|
196
|
+
<p class="tg-instruction"></p>
|
|
197
|
+
<div class="tg-panel-footer">
|
|
198
|
+
<button type="button" class="tg-btn tg-back-btn">Back</button>
|
|
199
|
+
<button type="button" class="tg-btn tg-btn-primary tg-next-btn"></button>
|
|
200
|
+
</div>
|
|
201
|
+
`,this.panel.querySelector(".tg-title").textContent=e.title,this.panel.querySelector(".tg-instruction").textContent=e.instruction;let n=this.panel.querySelector(".tg-back-btn");n.disabled=!e.canGoBack,n.addEventListener("click",()=>this.callbacks.onBack());let i=this.panel.querySelector(".tg-next-btn");i.disabled=!e.canGoNext,i.textContent=e.nextLabel,i.addEventListener("click",()=>this.callbacks.onNext()),this.panel.querySelector(".tg-exit-btn").addEventListener("click",()=>this.callbacks.onExit()),this.focusPanel()}setFocusTarget(e){this.focusTarget=e}scrollToTarget(e){document.body.style.overflow=this.previousBodyOverflow,e.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"}),document.body.style.overflow="hidden"}setNextEnabled(e){let t=this.panel.querySelector(".tg-next-btn");t&&(t.disabled=!e)}renderLocating(e){this.spotlight.hide(),this.panel.className="tg-panel",this.panel.innerHTML=`
|
|
202
|
+
<div class="tg-panel-header">
|
|
203
|
+
<span class="tg-progress-text">Step ${e.stepNumber} of ${e.totalSteps}</span>
|
|
204
|
+
<button type="button" class="tg-exit-btn" aria-label="Exit Trail guide">×</button>
|
|
205
|
+
</div>
|
|
206
|
+
<h2 class="tg-title"></h2>
|
|
207
|
+
<p class="tg-instruction"></p>
|
|
208
|
+
<p class="tg-error-detail">Locating element on the page…</p>
|
|
209
|
+
`,this.panel.querySelector(".tg-title").textContent=e.title,this.panel.querySelector(".tg-instruction").textContent=e.instruction,this.panel.querySelector(".tg-exit-btn").addEventListener("click",()=>this.callbacks.onExit()),this.focusPanel()}renderError(e){var t;this.spotlight.hide(),this.panel.className="tg-panel tg-error",this.panel.innerHTML=`
|
|
210
|
+
<div class="tg-panel-header">
|
|
211
|
+
<span class="tg-progress-text">Trail</span>
|
|
212
|
+
<button type="button" class="tg-exit-btn" aria-label="Exit Trail guide">×</button>
|
|
213
|
+
</div>
|
|
214
|
+
<h2 class="tg-title"></h2>
|
|
215
|
+
<p class="tg-instruction"></p>
|
|
216
|
+
${e.detail?'<p class="tg-error-detail"></p>':""}
|
|
217
|
+
<div class="tg-panel-footer">
|
|
218
|
+
${e.showRetry?'<button type="button" class="tg-btn tg-retry-btn">Retry</button>':"<span></span>"}
|
|
219
|
+
<button type="button" class="tg-btn tg-btn-primary tg-exit-btn2">Exit</button>
|
|
220
|
+
</div>
|
|
221
|
+
`,this.panel.querySelector(".tg-title").textContent=e.title,this.panel.querySelector(".tg-instruction").textContent=e.message,e.detail&&(this.panel.querySelector(".tg-error-detail").textContent=e.detail),this.panel.querySelector(".tg-exit-btn").addEventListener("click",()=>this.callbacks.onExit()),this.panel.querySelector(".tg-exit-btn2").addEventListener("click",()=>this.callbacks.onExit()),(t=this.panel.querySelector(".tg-retry-btn"))==null||t.addEventListener("click",()=>this.callbacks.onRetry()),this.focusPanel()}renderComplete(e,t,n){this.spotlight.hide(),this.panel.className="tg-panel",this.panel.innerHTML=`
|
|
222
|
+
<h2 class="tg-title">Trail Guide Complete</h2>
|
|
223
|
+
<p class="tg-instruction"></p>
|
|
224
|
+
<div class="tg-panel-footer">
|
|
225
|
+
<button type="button" class="tg-btn tg-restart-btn">Restart</button>
|
|
226
|
+
<button type="button" class="tg-btn tg-btn-primary tg-exit-btn">Exit</button>
|
|
227
|
+
</div>
|
|
228
|
+
`,this.panel.querySelector(".tg-instruction").textContent=`${e} \u2014 ${t} of ${t} steps completed.`,this.panel.querySelector(".tg-restart-btn").addEventListener("click",n),this.panel.querySelector(".tg-exit-btn").addEventListener("click",()=>this.callbacks.onExit()),this.focusPanel()}focusPanel(){this.panel.focus({preventScroll:!0})}destroy(){var e;this.spotlight.destroy(),this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler,!0),document.body.style.overflow=this.previousBodyOverflow,this.root.remove(),(e=this.previouslyFocusedElement)!=null&&e.isConnected&&this.previouslyFocusedElement.focus({preventScroll:!0})}};var Cp={button:'button, input[type="button"], input[type="submit"], input[type="reset"], [role="button"]',link:'a[href], [role="link"]',textbox:'input:not([type]), input[type="text"], input[type="email"], input[type="search"], input[type="tel"], input[type="url"], input[type="password"], textarea, [role="textbox"]',checkbox:'input[type="checkbox"], [role="checkbox"]',radio:'input[type="radio"], [role="radio"]',combobox:'select, [role="combobox"]',option:'option, [role="option"]',heading:'h1, h2, h3, h4, h5, h6, [role="heading"]',tab:'[role="tab"]'};function he(s){return(s!=null?s:"").trim().replace(/\s+/g," ").toLowerCase()}function gn(s){if(!(s instanceof HTMLElement)||s.hidden)return!1;let e=window.getComputedStyle(s);return e.display!=="none"&&e.visibility!=="hidden"&&e.opacity!=="0"}function Op(s){return typeof CSS!="undefined"&&typeof CSS.escape=="function"?CSS.escape(s):s.replace(/([^\w-])/g,"\\$1")}function Lp(s){let e=s.getAttribute("aria-label");if(e)return he(e);let t=s.getAttribute("aria-labelledby");if(t){let n=t.split(/\s+/).map(i=>{var r,a;return(a=(r=document.getElementById(i))==null?void 0:r.textContent)!=null?a:""}).join(" ");if(n.trim())return he(n)}if(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement){if(s.value)return he(s.value);if(s.placeholder)return he(s.placeholder)}return he(s.textContent)}function Ip(s){let e=document.querySelector(`[data-testid="${Op(s)}"]`);return{strategy:"testId",detail:`[data-testid="${s}"]`,found:!!e,element:e}}function qp(s,e){var a,o;let t=(a=Cp[s])!=null?a:`[role="${s}"]`,n=Array.from(document.querySelectorAll(t)).filter(gn),i=he(e),r=(o=n.find(l=>Lp(l)===i))!=null?o:null;return{strategy:"role",detail:`role="${s}" name="${e}"`,found:!!r,element:r}}function Mp(s){let e=he(s),t=Array.from(document.querySelectorAll("label"));for(let n of t){if(he(n.textContent)!==e)continue;let i=n.getAttribute("for");if(i){let a=document.getElementById(i);if(a instanceof HTMLElement&&gn(a))return{strategy:"label",detail:`label="${s}"`,found:!0,element:a}}let r=n.querySelector("input, select, textarea");if(r&&gn(r))return{strategy:"label",detail:`label="${s}"`,found:!0,element:r}}return{strategy:"label",detail:`label="${s}"`,found:!1,element:null}}var Pp='button, a, [role="button"], [role="link"], input[type="submit"], input[type="button"], *';function $p(s){let e=he(s),t=null,n=1/0;for(let i of document.querySelectorAll(Pp)){if(!gn(i))continue;let r=he(i.textContent);if(!r||!r.includes(e))continue;let a=i.children.length+r.length;a<n&&(t=i,n=a)}return{strategy:"text",detail:`text="${s}"`,found:!!t,element:t}}function Rp(s){let e=null;try{e=document.querySelector(s)}catch{}return{strategy:"selector",detail:s,found:!!e,element:e}}function rr(s){let e=[];for(let t of ul){let n;if(t==="testId"&&s.testId)n=Ip(s.testId);else if(t==="role"&&s.role&&s.name)n=qp(s.role,s.name);else if(t==="label"&&s.label)n=Mp(s.label);else if(t==="text"&&s.text)n=$p(s.text);else if(t==="selector"&&s.selector)n=Rp(s.selector);else continue;if(e.push({strategy:n.strategy,detail:n.detail,found:n.found}),n.element)return{element:n.element,attempts:e}}return{element:null,attempts:e}}function _l(s,e={}){var y,d;let t=(y=e.timeoutMs)!=null?y:1e4,n=(d=e.root)!=null?d:document.body,i=!1,r=null,a=null,o=null,l=()=>{r==null||r.disconnect(),r=null,a!==null&&clearTimeout(a),o!==null&&cancelAnimationFrame(o)},c,u=new Promise(m=>{c=m}),f=m=>{i||(i=!0,l(),c(m))},h=()=>{if(i)return;let m=s();m&&f({element:m,timedOut:!1})},p=()=>{o===null&&(o=requestAnimationFrame(()=>{o=null,h()}))};return h(),i||(r=new MutationObserver(p),r.observe(n,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),a=setTimeout(()=>f({element:null,timedOut:!0}),t)),{promise:u,cancel:()=>f({element:null,timedOut:!1})}}var os="trail:locationchange",Tl=!1;function Dp(){if(Tl)return;Tl=!0;let s=history.pushState.bind(history),e=history.replaceState.bind(history);history.pushState=function(...n){let i=s(...n);return window.dispatchEvent(new Event(os)),i},history.replaceState=function(...n){let i=e(...n);return window.dispatchEvent(new Event(os)),i},window.addEventListener("popstate",()=>{window.dispatchEvent(new Event(os))})}function xl(s){return Dp(),window.addEventListener(os,s),()=>window.removeEventListener(os,s)}var El=1e4,yn=class{constructor(e){R(this,"guide");R(this,"release");R(this,"state");R(this,"overlay");R(this,"unsubscribeLocation");R(this,"onExitCallback");R(this,"cancelWait",null);R(this,"cancelStepCompletion",null);R(this,"currentStepComplete",!1);R(this,"destroyed",!1);this.guide=e.guide,this.release=e.release,this.state=new pn(e.guide,e.startIndex),this.onExitCallback=e.onExit,this.overlay=new xt({onNext:()=>this.next(),onBack:()=>this.back(),onExit:()=>this.exit(),onRetry:()=>this.activateCurrentStep()}),this.unsubscribeLocation=xl(()=>{this.currentStepComplete||this.activateCurrentStep()}),this.activateCurrentStep()}next(){var e;if(!(this.destroyed||!this.currentStepComplete)){if((e=this.cancelWait)==null||e.call(this),this.state.isLast){this.complete();return}this.state.next(),this.activateCurrentStep()}}back(){var e;this.destroyed||((e=this.cancelWait)==null||e.call(this),this.state.back(),this.activateCurrentStep())}exit(){var e;this.destroyed||(Tt(),this.destroy(),(e=this.onExitCallback)==null||e.call(this))}destroy(){var e,t;this.destroyed||(this.destroyed=!0,(e=this.cancelWait)==null||e.call(this),(t=this.cancelStepCompletion)==null||t.call(this),this.unsubscribeLocation(),this.overlay.destroy())}persist(){ir({release:this.release,guideId:this.guide.id,stepIndex:this.state.currentIndex,stepId:this.state.currentStep.id})}activateCurrentStep(){var a,o,l;if(this.destroyed)return;(a=this.cancelWait)==null||a.call(this),(o=this.cancelStepCompletion)==null||o.call(this),this.cancelStepCompletion=null,this.currentStepComplete=!1,this.overlay.setFocusTarget(null),this.persist();let e=this.state.currentStep;if(e.action==="navigate"){this.handleNavigateStep(e);return}let t="target"in e?e.target:void 0;if(!t){this.renderReady(null,e);return}this.overlay.renderLocating({stepNumber:this.state.currentIndex+1,totalSteps:this.state.total,title:this.guide.title,instruction:e.instruction});let n=e.action==="wait"&&(l=e.timeoutMs)!=null?l:El,{promise:i,cancel:r}=_l(()=>rr(t).element,{timeoutMs:n});this.cancelWait=r,i.then(c=>{if(!this.destroyed){if(c.timedOut||!c.element){this.renderMissingTarget(e,t);return}this.overlay.scrollToTarget(c.element),this.renderReady(c.element,e)}})}handleNavigateStep(e){let t=new URL(e.url,window.location.origin);if(window.location.pathname===t.pathname){this.renderReady(null,e);return}ir({release:this.release,guideId:this.guide.id,stepIndex:Math.min(this.state.currentIndex+1,this.state.total-1),stepId:this.guide.steps[Math.min(this.state.currentIndex+1,this.state.total-1)].id}),t.searchParams.set("trail",this.guide.id),t.searchParams.set("release",this.release),window.location.assign(t.toString())}renderReady(e,t){this.overlay.setFocusTarget(e),e?this.overlay.spotlight.attachTo(e):this.overlay.spotlight.hide(),this.overlay.renderStep({stepNumber:this.state.currentIndex+1,totalSteps:this.state.total,title:this.guide.title,instruction:t.instruction,canGoBack:!this.state.isFirst,canGoNext:this.watchStepCompletion(e,t),nextLabel:this.state.isLast?"Finish":"Next"})}watchStepCompletion(e,t){if(!e||t.action==="verify"||t.action==="wait"||t.action==="navigate")return this.currentStepComplete=!0,!0;let n=new AbortController;this.cancelStepCompletion=()=>n.abort();let i=()=>{this.currentStepComplete=!0,this.overlay.setNextEnabled(!0),t.autoAdvance&&this.next()};if(t.action==="input"||t.action==="select"){let r=()=>(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement)&&e.value===t.value,a=()=>{if(r()){i();return}this.currentStepComplete=!1,this.overlay.setNextEnabled(!1)};e.addEventListener("input",a,{signal:n.signal}),e.addEventListener("change",a,{signal:n.signal});let o=r();return this.currentStepComplete=o,o&&t.autoAdvance&&queueMicrotask(()=>{!n.signal.aborted&&!this.destroyed&&i()}),o}return e.addEventListener("click",i,{once:!0,signal:n.signal}),!1}renderMissingTarget(e,t){let{attempts:n}=rr(t),i=n.map(r=>`${r.strategy}: ${r.detail} \u2014 ${r.found?"found":"not found"}`).join(" | ");this.overlay.renderError({title:"Target Not Found",message:`${e.instruction}
|
|
229
|
+
|
|
230
|
+
The application element could not be located. Possible causes: wrong page, application still loading, UI changed, or the guide is outdated.`,detail:i,showRetry:!0})}complete(){var e;(e=this.cancelWait)==null||e.call(this),this.overlay.setFocusTarget(null),Tt(),this.overlay.renderComplete(this.guide.title,this.state.total,()=>this.restart())}restart(){let e=new URL(this.guide.start.url,window.location.origin);if(e.searchParams.set("trail",this.guide.id),e.searchParams.set("release",this.release),window.location.href===e.toString()){this.state.reset(),this.activateCurrentStep();return}window.location.assign(e.toString())}};function Al(s){var r,a,o;if(s.guideUrl){let l=new URLSearchParams(new URL(s.guideUrl,window.location.href).search);return{url:s.guideUrl,guideId:(r=l.get("trail"))!=null?r:"unknown",release:(a=l.get("release"))!=null?a:"unknown"}}let e=new URLSearchParams(window.location.search),t=e.get("trail"),n=e.get("release");return!t||!n?null:{url:`${((o=s.guideBaseUrl)!=null?o:"/guides").replace(/\/$/,"")}/releases/${n}/${t}.json`,guideId:t,release:n}}function bn(s,e,t){let n=new xt({onNext:()=>{},onBack:()=>{},onRetry:()=>n.destroy(),onExit:()=>n.destroy()});n.renderError({title:s,message:e,detail:t,showRetry:!1})}async function jp(s={}){var a;let e=Al(s);if(!e)return null;let t=await bl(e.url);if(!t.success&&t.kind==="not-found")return bn("Trail Guide Not Found",`${e.guideId}
|
|
231
|
+
Release ${e.release}`),null;if(!t.success&&t.kind==="network-error")return bn("Unable to Load Trail Guide","Check your network connection and try again."),null;if(!t.success&&t.kind==="server-error")return bn("Unable to Load Trail Guide","The guide server returned an error. Try again later."),null;if(!t.success){let o=(a=t.issues)==null?void 0:a.map(l=>`${l.path}: ${l.message}`).join(" | ");return bn("Invalid Trail Guide",`${e.guideId} failed validation.`,o),null}let n=vl(e.release,t.guide.id),i=wl(t.guide,n);n&&i===null&&Tt();let r=i!=null?i:0;return new yn({guide:t.guide,release:e.release,startIndex:r})}var Bp={init:jp};return Pl(Fp);})();
|
|
232
|
+
//# sourceMappingURL=index.global.js.map
|