@lensmap/language-server 0.1.0 → 0.2.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/README.md +1 -1
- package/dist/preview/assets/playground-BCY9v6Ap.js +215 -0
- package/dist/preview/assets/preview-BRCvwAxB.js +1 -0
- package/dist/preview/assets/{preview-fhnbHE6T.css → preview-DDOSTiJj.css} +1 -1
- package/dist/preview/assets/styles-9bHR-mQh.css +1 -0
- package/dist/preview/assets/styles-Bnie2-Dn.js +190 -0
- package/dist/preview/index.html +3 -3
- package/dist/preview/preview.html +4 -4
- package/dist/server.js +60 -3
- package/package.json +10 -9
- package/LICENSE +0 -21
- package/dist/preview/assets/playground-BtGyjknt.js +0 -383
- package/dist/preview/assets/preview-B84it-Jd.js +0 -1
- package/dist/preview/assets/styles-D4WWbpX1.css +0 -1
- package/dist/preview/assets/styles-HT2Xrmtw.js +0 -22
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./styles-HT2Xrmtw.js";var s=a(),c=r(),l=Symbol.for(`yaml.alias`),u=Symbol.for(`yaml.document`),d=Symbol.for(`yaml.map`),f=Symbol.for(`yaml.pair`),p=Symbol.for(`yaml.scalar`),m=Symbol.for(`yaml.seq`),h=Symbol.for(`yaml.node.type`),g=e=>!!e&&typeof e==`object`&&e[h]===l,_=e=>!!e&&typeof e==`object`&&e[h]===u,v=e=>!!e&&typeof e==`object`&&e[h]===d,y=e=>!!e&&typeof e==`object`&&e[h]===f,b=e=>!!e&&typeof e==`object`&&e[h]===p,x=e=>!!e&&typeof e==`object`&&e[h]===m;function S(e){if(e&&typeof e==`object`)switch(e[h]){case d:case m:return!0}return!1}function C(e){if(e&&typeof e==`object`)switch(e[h]){case l:case d:case p:case m:return!0}return!1}var ee=e=>(b(e)||S(e))&&!!e.anchor,w=Symbol(`break visit`),T=Symbol(`skip children`),te=Symbol(`remove node`);function ne(e,t){let n=ie(t);_(e)?re(null,e.contents,n,Object.freeze([e]))===te&&(e.contents=null):re(null,e,n,Object.freeze([]))}ne.BREAK=w,ne.SKIP=T,ne.REMOVE=te;function re(e,t,n,r){let i=ae(e,t,n,r);if(C(i)||y(i))return oe(e,r,i),re(e,i,n,r);if(typeof i!=`symbol`){if(S(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=re(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===w)return w;else i===te&&(t.items.splice(e,1),--e)}}else if(y(t)){r=Object.freeze(r.concat(t));let e=re(`key`,t.key,n,r);if(e===w)return w;e===te&&(t.key=null);let i=re(`value`,t.value,n,r);if(i===w)return w;i===te&&(t.value=null)}}return i}function ie(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function ae(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(v(t))return n.Map?.(e,t,r);if(x(t))return n.Seq?.(e,t,r);if(y(t))return n.Pair?.(e,t,r);if(b(t))return n.Scalar?.(e,t,r);if(g(t))return n.Alias?.(e,t,r)}function oe(e,t,n){let r=t[t.length-1];if(S(r))r.items[e]=n;else if(y(r))e===`key`?r.key=n:r.value=n;else if(_(r))r.contents=n;else{let e=g(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var se={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},ce=e=>e.replace(/[!,[\]{}]/g,e=>se[e]),le=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(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 n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),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+ce(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),r;if(e&&n.length>0&&C(e.contents)){let t={};ne(e.contents,(e,n)=>{C(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||e&&!r.some(e=>e.startsWith(a))||t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
2
|
-
`)}};le.defaultYaml={explicit:!1,version:`1.2`},le.defaultTags={"!!":`tag:yaml.org,2002:`};function ue(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function de(e){let t=new Set;return ne(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function fe(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function pe(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=de(e);let a=fe(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(b(t.node)||S(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function me(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=me(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=me(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=me(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=me(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function E(e,t,n){if(Array.isArray(e))return e.map((e,t)=>E(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!ee(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var he=class{constructor(e){Object.defineProperty(this,h,{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:r,reviver:i}={}){if(!_(e))throw 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=E(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?me(i,{"":o},``,o):o}},ge=class extends he{constructor(e){super(l),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],ne(e,{Node:(e,t)=>{(g(t)||ee(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(E(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=_e(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(ue(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function _e(e,t,n){if(g(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(S(t)){let r=0;for(let i of t.items){let t=_e(e,i,n);t>r&&(r=t)}return r}if(y(t)){let r=_e(e,t.key,n),i=_e(e,t.value,n);return Math.max(r,i)}return 1}var ve=e=>!e||typeof e!=`function`&&typeof e!=`object`,D=class extends he{constructor(e){super(p),this.value=e}toJSON(e,t){return t?.keep?this.value:E(this.value,e,t)}toString(){return String(this.value)}};D.BLOCK_FOLDED=`BLOCK_FOLDED`,D.BLOCK_LITERAL=`BLOCK_LITERAL`,D.PLAIN=`PLAIN`,D.QUOTE_DOUBLE=`QUOTE_DOUBLE`,D.QUOTE_SINGLE=`QUOTE_SINGLE`;var ye=`tag:yaml.org,2002:`;function be(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function xe(e,t,n){if(_(e)&&(e=e.contents),C(e))return e;if(y(e)){let t=n.schema[d].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new ge(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=ye+t.slice(2));let l=be(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new D(e);return c&&(c.node=t),t}l=e instanceof Map?o[d]:Symbol.iterator in Object(e)?o[m]:o[d]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new D(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Se(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return xe(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Ce=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,we=class extends he{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(t=>C(t)||y(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ce(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(S(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Se(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(S(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&b(i)?i.value:i:S(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!y(t))return!1;let n=t.value;return n==null||e&&b(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 r=this.get(t,!0);return S(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(S(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Se(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Te=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function O(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Ee=(e,t,n)=>e.endsWith(`
|
|
3
|
-
`)?O(n,t):n.includes(`
|
|
4
|
-
`)?`
|
|
5
|
-
`+O(n,t):(e.endsWith(` `)?``:` `)+n,De=`flow`,Oe=`block`,ke=`quoted`;function Ae(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=je(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
6
|
-
`)n===`block`&&(h=je(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
7
|
-
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
8
|
-
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function je(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
9
|
-
`);r=t,i=t+1,a=e[i]}return r}var Me=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Ne=e=>/^(%|---|\.\.\.)/m.test(e);function Pe(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
10
|
-
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function Fe(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Ne(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
|
11
|
-
|
|
12
|
-
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
13
|
-
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:Ae(o,a,ke,Me(t,!1))}function Ie(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
14
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return Fe(e,t);let n=t.indent||(Ne(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:Ae(r,n,De,Me(t,!1))}function Le(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Fe;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?Ie:i&&!t?Fe:n?Ie:Fe}return r(e,t)}var Re;try{Re=RegExp(`(^|(?<!
|
|
15
|
-
))
|
|
16
|
-
+(?!
|
|
17
|
-
|$)`,`g`)}catch{Re=/\n+(?!\n|$)/g}function ze({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return Le(n,r);let l=r.indent||(r.forceBlockIndent||Ne(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===D.BLOCK_FOLDED?!1:t===D.BLOCK_LITERAL||!Pe(n,c,l.length);if(!n)return u?`|
|
|
18
|
-
`:`>
|
|
19
|
-
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
20
|
-
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
21
|
-
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
22
|
-
`&&(p=p.slice(0,-1)),p.replace(Re,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
23
|
-
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
|
24
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=Me(r,!0);o!==`folded`&&t!==D.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=Ae(`${v}${e}${p}`,l,Oe,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function Be(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
25
|
-
`)||u&&/[[\]{},]/.test(a))return Le(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
26
|
-
`)?Le(a,t):ze(e,t,n,r);if(!s&&!u&&i!==D.PLAIN&&a.includes(`
|
|
27
|
-
`))return ze(e,t,n,r);if(Ne(a)){if(c===``)return t.forceBlockIndent=!0,ze(e,t,n,r);if(s&&c===l)return Le(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return Le(a,t)}return s?d:Ae(d,c,De,Me(t,!1))}function Ve(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==D.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=D.QUOTE_DOUBLE);let c=e=>{switch(e){case D.BLOCK_FOLDED:case D.BLOCK_LITERAL:return i||a?Le(o.value,t):ze(o,t,n,r);case D.QUOTE_DOUBLE:return Fe(o.value,t);case D.QUOTE_SINGLE:return Ie(o.value,t);case D.PLAIN:return Be(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function He(e,t){let n=Object.assign({blockQuote:!0,commentString:Te,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},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Ue(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(b(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function We(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(b(e)||S(e))&&e.anchor;a&&ue(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function Ge(e,t,n,r){if(y(e))return e.toString(t,n,r);if(g(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=C(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=Ue(t.doc.schema.tags,a);let o=We(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):b(a)?Ve(a,t,n,r):a.toString(t,n,r);return o?b(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Ke({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=C(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(S(e)||!C(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||S(e)||(b(e)?e.type===D.BLOCK_FOLDED||e.type===D.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=Ge(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=Ee(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=Ee(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=Ee(g,n.indent,l(f))));let _,v,y;C(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&b(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&x(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let ee=!1,w=Ge(t,n,()=>ee=!0,()=>h=!0),T=` `;if(f||_||v){if(T=_?`
|
|
28
|
-
`:``,v){let e=l(v);T+=`\n${O(e,n.indent)}`}w===``&&!n.inFlow?T===`
|
|
29
|
-
`&&y&&(T=`
|
|
30
|
-
|
|
31
|
-
`):T+=`\n${n.indent}`}else if(!p&&S(t)){let e=w[0],r=w.indexOf(`
|
|
32
|
-
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=w.indexOf(` `);e===`&`&&n!==-1&&n<r&&w[n+1]===`!`&&(n=w.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(T=`\n${n.indent}`)}}else(w===``||w[0]===`
|
|
33
|
-
`)&&(T=``);return g+=T+w,n.inFlow?ee&&r&&r():y&&!ee?g+=Ee(g,n.indent,l(y)):h&&i&&i(),g}function qe(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var Je=`<<`,k={identify:e=>e===Je||typeof e==`symbol`&&e.description===Je,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new D(Symbol(Je)),{addToJSMap:Xe}),stringify:()=>Je},Ye=(e,t)=>(k.identify(t)||b(t)&&(!t.type||t.type===D.PLAIN)&&k.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===k.tag&&e.default);function Xe(e,t,n){let r=Qe(e,n);if(x(r))for(let n of r.items)Ze(e,t,n);else if(Array.isArray(r))for(let n of r)Ze(e,t,n);else Ze(e,t,r)}function Ze(e,t,n){let r=Qe(e,n);if(!v(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Qe(e,t){return e&&g(t)?t.resolve(e.doc,e):t}function $e(e,t,{key:n,value:r}){if(C(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Ye(e,n))Xe(e,t,r);else{let i=E(n,``,e);if(t instanceof Map)t.set(i,E(r,i,e));else if(t instanceof Set)t.add(i);else{let a=et(n,i,e),o=E(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function et(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(C(e)&&n?.doc){let t=He(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),qe(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function tt(e,t,n){return new A(xe(e,void 0,n),xe(t,void 0,n))}var A=class e{constructor(e,t=null){Object.defineProperty(this,h,{value:f}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return C(n)&&(n=n.clone(t)),C(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return $e(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Ke(this,e,t,n):JSON.stringify(this)}};function nt(e,t,n){return(t.inFlow??e.flow?it:rt)(e,t,n)}function rt({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(C(i))!d&&i.spaceBefore&&f.push(``),at(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(y(i)){let e=C(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),at(n,f,e.commentBefore,d))}d=!1;let s=Ge(i,u,()=>o=null,()=>d=!0);o&&(s+=Ee(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
|
34
|
-
`}}return e?(p+=`
|
|
35
|
-
`+O(l(e),c),s&&s()):d&&o&&o(),p}function it({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(C(i))i.spaceBefore&&d.push(``),at(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(y(i)){let e=C(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),at(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=C(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=Ge(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
36
|
-
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=Ee(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
|
37
|
-
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function at({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=O(t(r),e);n.push(i.trimStart())}}function ot(e,t){let n=b(t)?t.value:t;for(let r of e)if(y(r)&&(r.key===t||r.key===n||b(r.key)&&r.key.value===n))return r}var j=class extends we{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(d,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(tt(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=y(e)?e:!e||typeof e!=`object`||!(`key`in e)?new A(e,e?.value):new A(e.key,e.value);let r=ot(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);b(r.value)&&ve(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=ot(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=ot(this.items,e)?.value;return(!t&&b(n)?n.value:n)??void 0}has(e){return!!ot(this.items,e)}set(e,t){this.add(new A(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)$e(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!y(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),nt(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},st={collection:`map`,default:!0,nodeClass:j,tag:`tag:yaml.org,2002:map`,resolve(e,t){return v(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>j.from(e,t,n)},ct=class extends we{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(m,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=lt(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=lt(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&b(r)?r.value:r}has(e){let t=lt(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=lt(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];b(r)&&ve(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(E(e,String(r++),t));return n}toString(e,t,n){return e?nt(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(xe(a,void 0,n))}}return i}};function lt(e){let t=b(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var ut={collection:`seq`,default:!0,nodeClass:ct,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return x(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>ct.from(e,t,n)},dt={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Ve(e,t,n,r)}},ft={identify:e=>e==null,createNode:()=>new D(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new D(null),stringify:({source:e},t)=>typeof e==`string`&&ft.test.test(e)?e:t.options.nullStr},pt={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new D(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&pt.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function M({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var mt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:M},ht={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():M(e)}},gt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new D(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:M},_t=e=>typeof e==`bigint`||Number.isInteger(e),vt=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function yt(e,t,n){let{value:r}=e;return _t(r)&&r>=0?n+r.toString(t):M(e)}var bt={identify:e=>_t(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>vt(e,2,8,n),stringify:e=>yt(e,8,`0o`)},xt={identify:_t,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>vt(e,0,10,n),stringify:M},St={identify:e=>_t(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>vt(e,2,16,n),stringify:e=>yt(e,16,`0x`)},Ct=[st,ut,dt,ft,pt,bt,xt,St,mt,ht,gt];function wt(e){return typeof e==`bigint`||Number.isInteger(e)}var Tt=({value:e})=>JSON.stringify(e),Et=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:Tt},{identify:e=>e==null,createNode:()=>new D(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:Tt},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:Tt},{identify:wt,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>wt(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Tt}],Dt=[st,ut].concat(Et,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),Ot={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=D.BLOCK_LITERAL,t!==D.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===D.BLOCK_LITERAL?`
|
|
38
|
-
`:` `)}return Ve({comment:e,type:t,value:s},r,i,a)}};function kt(e,t){if(x(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!y(r)){if(v(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new A(new D(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=y(r)?r:new A(r)}}else t(`Expected a sequence for this tag`);return e}function At(e,t,n){let{replacer:r}=n,i=new ct(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(tt(o,s,n))}return i}var jt={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:kt,createNode:At},Mt=class e extends ct{constructor(){super(),this.add=j.prototype.add.bind(this),this.delete=j.prototype.delete.bind(this),this.get=j.prototype.get.bind(this),this.has=j.prototype.has.bind(this),this.set=j.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(y(e)?(r=E(e.key,``,t),i=E(e.value,r,t)):r=E(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=At(e,t,n),i=new this;return i.items=r.items,i}};Mt.tag=`tag:yaml.org,2002:omap`;var Nt={collection:`seq`,identify:e=>e instanceof Map,nodeClass:Mt,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=kt(e,t),r=[];for(let{key:e}of n.items)b(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new Mt,n)},createNode:(e,t,n)=>Mt.from(e,t,n)};function Pt({value:e,source:t},n){return t&&(e?Ft:It).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Ft={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new D(!0),stringify:Pt},It={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new D(!1),stringify:Pt},Lt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:M},Rt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():M(e)}},zt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new D(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:M},Bt=e=>typeof e==`bigint`||Number.isInteger(e);function Vt(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function Ht(e,t,n){let{value:r}=e;if(Bt(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return M(e)}var Ut={identify:Bt,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Vt(e,2,2,n),stringify:e=>Ht(e,2,`0b`)},Wt={identify:Bt,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Vt(e,1,8,n),stringify:e=>Ht(e,8,`0`)},Gt={identify:Bt,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Vt(e,0,10,n),stringify:M},Kt={identify:Bt,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Vt(e,2,16,n),stringify:e=>Ht(e,16,`0x`)},qt=class e extends j{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=y(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new A(e.key,null):new A(e,null),ot(this.items,t.key)||this.items.push(t)}get(e,t){let n=ot(this.items,e);return!t&&y(n)?b(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=ot(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new A(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 Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(tt(e,null,n));return i}};qt.tag=`tag:yaml.org,2002:set`;var Jt={collection:`map`,identify:e=>e instanceof Set,nodeClass:qt,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>qt.from(e,t,n),resolve(e,t){if(v(e)){if(e.hasAllNullValues(!0))return Object.assign(new qt,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function Yt(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function Xt(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return M(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var Zt={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Yt(e,n),stringify:Xt},Qt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Yt(e,!1),stringify:Xt},$t={identify:e=>e 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(e){let t=e.match($t.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=Yt(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},en=[st,ut,dt,ft,Ft,It,Ut,Wt,Gt,Kt,Lt,Rt,zt,Ot,k,Nt,jt,Jt,Zt,Qt,$t],tn=new Map([[`core`,Ct],[`failsafe`,[st,ut,dt]],[`json`,Dt],[`yaml11`,en],[`yaml-1.1`,en]]),nn={binary:Ot,bool:pt,float:gt,floatExp:ht,floatNaN:mt,floatTime:Qt,int:xt,intHex:St,intOct:bt,intTime:Zt,map:st,merge:k,null:ft,omap:Nt,pairs:jt,seq:ut,set:Jt,timestamp:$t},rn={"tag:yaml.org,2002:binary":Ot,"tag:yaml.org,2002:merge":k,"tag:yaml.org,2002:omap":Nt,"tag:yaml.org,2002:pairs":jt,"tag:yaml.org,2002:set":Jt,"tag:yaml.org,2002:timestamp":$t};function an(e,t,n){let r=tn.get(t);if(r&&!e)return n&&!r.includes(k)?r.concat(k):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(tn.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(k)),i.reduce((e,t)=>{let n=typeof t==`string`?nn[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(nn).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var on=(e,t)=>e.key<t.key?-1:+(e.key>t.key),sn=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?an(e,`compat`):e?an(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?rn:{},this.tags=an(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,d,{value:st}),Object.defineProperty(this,p,{value:dt}),Object.defineProperty(this,m,{value:ut}),this.sortMapEntries=typeof a==`function`?a:a===!0?on:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function cn(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=He(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(O(t,``))}let o=!1,s=null;if(e.contents){if(C(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(O(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=Ge(e.contents,i,()=>s=null,t);s&&(c+=Ee(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Ge(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(`
|
|
39
|
-
`)?(n.push(`...`),n.push(O(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(O(a(t),``)))}return n.join(`
|
|
40
|
-
`)+`
|
|
41
|
-
`}var ln=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,h,{value:u});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new le({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[h]:{value:u}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=C(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){un(this.contents)&&this.contents.add(e)}addIn(e,t){un(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=de(this);e.anchor=!t||n.has(t)?fe(t||`a`,n):t}return new ge(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=pe(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=xe(e,l,p);return o&&S(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new A(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return un(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ce(e)?this.contents!=null&&(this.contents=null,!0):un(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return S(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ce(e)?!t&&b(this.contents)?this.contents.value:this.contents:S(this.contents)?this.contents.getIn(e,t):void 0}has(e){return S(this.contents)?this.contents.has(e):!1}hasIn(e){return Ce(e)?this.contents!==void 0:S(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Se(this.schema,[e],t):un(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ce(e)?this.contents=t:this.contents==null?this.contents=Se(this.schema,Array.from(e),t):un(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 le({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 le({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new sn(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=E(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?me(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw 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 Error(`"indent" option must be a positive integer, not ${t}`)}return cn(this,e)}};function un(e){if(S(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var dn=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},fn=class extends dn{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},pn=class extends dn{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},mn=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
|
42
|
-
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function hn(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:b&&n===`seq-item-ind`||(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function gn(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
|
43
|
-
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(gn(t.key)||gn(t.value))return!0}return!1;default:return!0}}function _n(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&gn(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function vn(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||b(e)&&b(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var yn=`All mapping items must start at the same column`;function bn({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??j)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=hn(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,yn)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
|
44
|
-
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||gn(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,yn);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&_n(r.indent,u,i),n.atKey=!1,vn(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=hn(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&_n(r.indent,f,i),s=c.range[2];let l=new A(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
|
|
45
|
-
`+_.comment:g.comment=_.comment);let e=new A(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function xn({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??ct)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=hn(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&_n(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function Sn(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var Cn=`Block collections are not allowed within flow collections`,wn=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function Tn({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?j:ct))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=hn(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
|
|
46
|
-
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&gn(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];y(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
|
47
|
-
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],wn(m)&&i(r.range,`BLOCK_IN_FLOW`,Cn)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);wn(f)&&i(g.range,`BLOCK_IN_FLOW`,Cn),n.atKey=!1;let _=hn(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?wn(m)&&i(v.range,`BLOCK_IN_FLOW`,Cn):_.comment&&(g.comment?g.comment+=`
|
|
48
|
-
`+_.comment:g.comment=_.comment);let y=new A(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;vn(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new j(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=Sn(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
|
49
|
-
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function En(e,t,n,r,i,a){let o=n.type===`block-map`?bn(e,t,n,r,a):n.type===`block-seq`?xn(e,t,n,r,a):Tn(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function Dn(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===j.tagName&&s===`map`||o===ct.tagName&&s===`seq`)return En(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),En(e,t,n,i,o)}let l=En(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=C(u)?u:new D(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function On(e,t,n){let r=t.offset,i=kn(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?D.BLOCK_FOLDED:D.BLOCK_LITERAL,o=t.source?An(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
|
50
|
-
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
|
|
51
|
-
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===D.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
|
52
|
-
`):t.length>c||r[0]===` `?(f===` `?f=`
|
|
53
|
-
`:!p&&f===`
|
|
54
|
-
`&&(f=`
|
|
55
|
-
|
|
56
|
-
`),d+=f+t.slice(c)+r,f=`
|
|
57
|
-
`,p=!0):r===``?f===`
|
|
58
|
-
`?d+=`
|
|
59
|
-
`:f=`
|
|
60
|
-
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
|
|
61
|
-
`+o[e][0].slice(c);d[d.length-1]!==`
|
|
62
|
-
`&&(d+=`
|
|
63
|
-
`);break;default:d+=`
|
|
64
|
-
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function kn({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function An(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function jn(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=D.PLAIN,c=Mn(a,l);break;case`single-quoted-scalar`:s=D.QUOTE_SINGLE,c=Nn(a,l);break;case`double-quoted-scalar`:s=D.QUOTE_DOUBLE,c=Fn(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=Sn(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function Mn(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),Pn(e)}function Nn(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),Pn(e.slice(1,-1)).replace(/''/g,`'`)}function Pn(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
|
|
65
|
-
`?a+=o:o=`
|
|
66
|
-
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function Fn(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
|
|
67
|
-
`){if(i===`
|
|
68
|
-
`){let{fold:t,offset:i}=In(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=Ln[i];if(a)n+=a;else if(i===`
|
|
69
|
-
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
|
|
70
|
-
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=Rn(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
|
|
71
|
-
`&&(a!==`\r`||e[r+2]!==`
|
|
72
|
-
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function In(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
|
73
|
-
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
|
|
74
|
-
`);)r===`
|
|
75
|
-
`&&(n+=`
|
|
76
|
-
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var Ln={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
|
77
|
-
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Rn(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function zn(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?On(e,t,r):jn(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[p]:c?Bn(e.schema,i,c,n,r):t.type===`scalar`?Vn(e,i,t,r):e.schema[p];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=b(a)?a:new D(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new D(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function Bn(e,t,n,r,i){if(n===`!`)return e[p];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[p])}function Vn({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[p];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[p];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function Hn(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var Un={composeNode:Wn,composeEmptyNode:Gn};function Wn(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=Kn(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=zn(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=Dn(Un,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=Gn(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!b(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Gn(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=zn(e,{type:`scalar`,offset:Hn(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Kn({options:e},{offset:t,source:n,end:r},i){let a=new ge(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=Sn(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function qn(e,t,{offset:n,start:r,value:i,end:a},o){let s=new ln(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=hn(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?Wn(c,i,l,o):Gn(c,l.end,r,null,l,o);let u=s.contents.range[2],d=Sn(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function Jn(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function Yn(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
|
78
|
-
|
|
79
|
-
`:`
|
|
80
|
-
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Xn=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Jn(e);r?this.warnings.push(new pn(i,t,n)):this.errors.push(new fn(i,t,n))},this.directives=new le({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=Yn(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(S(i)&&!i.flow&&i.items.length>0){let e=i.items[0];y(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Yn(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=Jn(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=qn(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 fn(Jn(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new fn(Jn(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=Sn(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new fn(Jn(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 e=new ln(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},Zn=Symbol(`break visit`),Qn=Symbol(`skip children`),$n=Symbol(`remove item`);function er(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),tr(Object.freeze([]),e,t)}er.BREAK=Zn,er.SKIP=Qn,er.REMOVE=$n,er.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},er.parentCollection=(e,t)=>{let n=er.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function tr(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=tr(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Zn)return Zn;else r===$n&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function nr(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
|
81
|
-
`:case`\r
|
|
82
|
-
`: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(e[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}function N(e){switch(e){case void 0:case` `:case`
|
|
83
|
-
`:case`\r`:case` `:return!0;default:return!1}}var rr=new Set(`0123456789ABCDEFabcdef`),ir=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),ar=new Set(`,[]{}`),or=new Set(` ,[]{}
|
|
84
|
-
\r `),sr=e=>!e||or.has(e),cr=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){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=this.next??`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===`
|
|
85
|
-
`||t===`\r`&&this.buffer[e+1]===`
|
|
86
|
-
`}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 t=this.buffer[n+e+1];if(t===`
|
|
87
|
-
`||!t&&!this.atEnd)return e+n+1}return t===`
|
|
88
|
-
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&N(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(`
|
|
89
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,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]===``&&(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}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),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``,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 e=this.peek(3);if((e===`---`||e===`...`)&&N(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!N(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===`:`)&&N(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`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(sr),`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 r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&N(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`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,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(sr),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||N(e)||e===`,`)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 e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
|
90
|
-
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
|
|
91
|
-
`,e)}r!==-1&&(t=r-(n[r-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(e=>N(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
|
|
92
|
-
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
|
|
93
|
-
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
|
|
94
|
-
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
|
|
95
|
-
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
|
|
96
|
-
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(N(r)||e&&ar.has(r))break;t=n}else if(N(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
|
97
|
-
`?(n+=1,r=`
|
|
98
|
-
`,i=this.buffer[n+1]):t=n),i===`#`||e&&ar.has(i))break;if(r===`
|
|
99
|
-
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&ar.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,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;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(sr),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(N(n)||t&&ar.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!N(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(ir.has(t))t=this.buffer[++e];else if(t===`%`&&rr.has(this.buffer[e+1])&&rr.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===`
|
|
100
|
-
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
|
101
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},lr=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 r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function P(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function ur(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function dr(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function fr(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function pr(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function mr(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function hr(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!P(t.start,`explicit-key-ind`)&&!P(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,dr(t.value)?t.value.end?mr(t.value.end,t.sep):t.value.end=t.sep:mr(t.start,t.sep),delete t.sep)}var gr=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 cr,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,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=nr(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else 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}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{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??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 e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&hr(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&ur(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.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`:ur(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());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=pr(fr(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};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 e=this.source.indexOf(`
|
|
102
|
-
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
103
|
-
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else 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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){mr(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),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?(i.push(this.sourceToken),e.items.push({start:i,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(P(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=pr(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(P(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(dr(t.key)&&!P(t.sep,`newline`)){let e=pr(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):P(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 n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!P(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 n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else 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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){mr(n,t.start),n.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||P(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.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 n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,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 t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=pr(fr(t));hr(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
104
|
-
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
105
|
-
`,e)+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=pr(fr(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=pr(fr(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.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())}}};function _r(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new lr||null,prettyErrors:t}}function vr(e,t={}){let{lineCounter:n,prettyErrors:r}=_r(t),i=new gr(n?.addNewLine),a=new Xn(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new fn(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(mn(e,n)),o.warnings.forEach(mn(e,n))),o}function yr(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function br(e,t=`|`){return e.map(e=>Wr(e)).join(t)}function xr(e,t){return typeof t==`bigint`?t.toString():t}var Sr=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Cr(e){return new Sr(e)}function wr(e){return e==null}function Tr(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Er(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Dr=Symbol(`evaluating`);function Or(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Dr)return r===void 0&&(r=Dr,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function kr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ar(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function F(e){return Ar(e._zod.def)??e._zod.def.shape}function jr(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return kr(this,t,e),e},enumerable:!0,configurable:!0})}function Mr(e,t,n){t in e?kr(e,t,n):e[t]=n}function Nr(e,t,n,r){let i=F(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?jr(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):Mr(e,a,r?r(n.value,a):n.value))}}function Pr(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?jr(e,n,()=>t[n]):Mr(e,n,r.value))}}function I(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Fr(e){return JSON.stringify(e)}function Ir(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Lr=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Rr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var zr=Cr(()=>{if(U.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Br(e){if(Rr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Rr(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Vr(e){return Br(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Hr=new Set([`string`,`number`,`symbol`]);function Ur(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function L(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function R(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Wr(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Gr(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Kr={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},qr={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Jr(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Nr(i,e,Yr(e,t)),L(e,I(n,{shape:i,checks:[]}))}function Yr(e,t){let n=F(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Xr(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Yr(e,t)),a={};return Nr(a,e,Reflect.ownKeys(F(e)).filter(e=>!i.has(e))),L(e,I(n,{shape:a,checks:[]}))}function Zr(e,t){if(!Br(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=F(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return L(e,I(e._zod.def,{shape:Qr(e,t)}))}function Qr(e,t){let n={};return Nr(n,e,Reflect.ownKeys(F(e))),Pr(n,t),n}function $r(e,t){if(!Br(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return L(e,I(e._zod.def,{shape:Qr(e,t)}))}function ei(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Nr(n,e,Reflect.ownKeys(F(e))),Nr(n,t,Reflect.ownKeys(F(t))),L(e,I(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ti(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Yr(t,n)):void 0,o={};return Nr(o,t,Reflect.ownKeys(F(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),L(t,I(t._zod.def,{shape:o,checks:[]}))}function ni(e,t,n){let r=n?new Set(Yr(t,n)):void 0,i={};return Nr(i,t,Reflect.ownKeys(F(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),L(t,I(t._zod.def,{shape:i}))}function z(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ri(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ii(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ai(e){return typeof e==`string`?e:e?.message}function oi(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function si(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function ci(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:ai(e.inst?._zod.def?.error?.(e))??ai(a?.(e))??ai(t?.error?.(e))??ai(n.customError?.(e))??ai(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var li=/[\uD800-\uDBFF]/;function ui(e){let t=e.length;if(!li.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function di(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function fi(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function pi(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function mi(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):_i(e,n,r.value)}}function B(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function hi(e,t,n){return B(e,t,n,!1)}function gi(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return B(this,n,r(this))},set(e){B(this,n,e)}})}return t}function _i(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:B(this,t,n.bind(this))},set(e){B(this,t,e)}})}function vi(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var yi,bi=!1,xi={configurable:!0,get(){bi=!0}};function V(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&yi!==e._zod?yi=void 0:(yi=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,xi);let e=bi;bi=!1;try{let r=n(this);return bi?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),bi||=e,r}catch(n){throw delete this[t],bi||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Si(e,t,n,r){let i=vi(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Ci=`~constantCatch`;function wi(e){let t=()=>e;return t[Ci]=!0,t}var Ti,Ei={value:void 0,enumerable:!1},Di=`captureStackTrace`in Error?Error:null;function Oi(e){let t=Di;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Di=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function H(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Ei.value=new a(r);try{Object.defineProperty(n,"_zod",Ei)}finally{Ei.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),mi(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Oi(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ki=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ai=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Ti=globalThis).__zod_globalConfig??(Ti.__zod_globalConfig={});var U=globalThis.__zod_globalConfig;function ji(e){return e&&Object.assign(U,e),U}function Mi(){let e=this._zod;return e.message??=JSON.stringify(e.def,xr,2),e.message}function Ni(e){this._zod.message=e}var Pi={get:Mi,set:Ni,enumerable:!0,configurable:!0},Fi={value:void 0,enumerable:!1},Ii=new WeakSet([Object.prototype,Error.prototype]),Li=H(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Fi.value=t,Object.defineProperty(e,"issues",Fi),Fi.value=void 0,Object.defineProperty(e,"message",Pi);let n=Object.getPrototypeOf(e);Ii.has(n)||(Ii.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function Ri(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function zi(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Ri(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Bi(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Vi(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function Hi(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Vi(e.path)}`);return t.join(`
|
|
106
|
-
`)}function Ui(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Wi=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ki;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ci(e,o,ji())));throw Lr(n,a?.callee??t),n}return s.value};return t},Gi=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ci(e,o,ji())));throw Lr(n,a?.callee??t),n}return s.value};return t},Ki=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ki;return a.issues.length?qi(e,a.issues,i):{success:!0,data:a.value}};function qi(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>ci(e,n,ji()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Ji=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?qi(e,a.issues,i):{success:!0,data:a.value}},Yi=Symbol.for(`zod.compile.invalid`),Xi=Symbol.for(`zod.compile.fallback`),Zi=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Yi)return!0;if(r.definite===!0&&n===void 0)return!1}return Qi(e,t,n)});function Qi(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Xi]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new ki;return a.issues.length===0}var $i=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ea=e=>{let t=Wi(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ui(n,a))};return n},ta=e=>{let t=Wi(e),n=(e,r,i,a)=>t(e,r,i,Ui(n,a));return n},na=e=>{let t=Gi(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ui(n,a))};return n},ra=e=>{let t=Gi(e),n=async(e,r,i,a)=>await t(e,r,i,Ui(n,a));return n},ia=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ki(e)(t,n,i)},aa=e=>(t,n,r)=>Ki(e)(t,n,r),oa=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ji(e)(t,n,i)},sa=e=>async(t,n,r)=>Ji(e)(t,n,r),ca=/^[cC][0-9a-z]{6,}$/,la=/^[0-9a-z]+$/,ua=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,da=/^[0-9a-vA-V]{20}$/,fa=/^[A-Za-z0-9]{27}$/,pa=/^[a-zA-Z0-9_-]{21}$/;function ma(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ha=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ga=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,_a=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,va=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ya=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function ba(){return new RegExp(ya,`u`)}var xa=/^(?:(?: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])$/,Sa=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,Ca=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,wa=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ta=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ea=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Da=/^https?$/,Oa=/^\+[1-9]\d{6,14}$/,ka=`(?:(?:\\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])))`;function Aa(e){return RegExp(`^${e}$`)}var ja=Aa(ka);function Ma(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Na(e){return RegExp(`^${Ma(e)}$`)}function Pa(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ma({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ma({precision:e.precision})}`:n;return RegExp(`^${ka}T(?:${r})$`)}var Fa=/^[\s\S]{0,}$/,Ia=/^-?\d+(?:\.\d+)?$/,La=/^[^A-Z]*$/,Ra=/^[^a-z]*$/,W=H(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),za=e=>{let t=e.value;return!wr(t)&&t.length!==void 0},Ba={number:`number`,bigint:`bigint`,object:`date`},Va=H(`$ZodCheckLessThan`,(e,t)=>{W.init(e,t);let n=Ba[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Ba[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ha=H(`$ZodCheckGreaterThan`,(e,t)=>{W.init(e,t);let n=Ba[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Ba[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ua=H(`$ZodCheckMultipleOf`,(e,t)=>{W.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Er(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Wa=H(`$ZodCheckNumberFormat`,(e,t)=>{W.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Kr[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Ga=H(`$ZodCheckMaxLength`,(e,t)=>{var n;W.init(e,t),(n=e._zod.def).when??(n.when=za),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?ui(r):i)<=t.maximum)return;let a=di(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ka=H(`$ZodCheckMinLength`,(e,t)=>{var n;W.init(e,t),(n=e._zod.def).when??(n.when=za),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?ui(r):i)>=t.minimum)return;let a=di(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),qa=H(`$ZodCheckLengthEquals`,(e,t)=>{var n;W.init(e,t),(n=e._zod.def).when??(n.when=za),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?ui(r):i;if(a===t.length)return;let o=di(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ja=H(`$ZodCheckStringFormat`,(e,t)=>{var n,r;W.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ya=H(`$ZodCheckRegex`,(e,t)=>{Ja.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Xa=H(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=La,Ja.init(e,t)}),Za=H(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ra,Ja.init(e,t)}),Qa=H(`$ZodCheckIncludes`,(e,t)=>{W.init(e,t);let n=Ur(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),$a=H(`$ZodCheckStartsWith`,(e,t)=>{W.init(e,t);let n=RegExp(`^${Ur(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),eo=H(`$ZodCheckEndsWith`,(e,t)=>{W.init(e,t);let n=RegExp(`.*${Ur(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),to=H(`$ZodCheckOverwrite`,(e,t)=>{W.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),no=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
107
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
108
|
-
`)}\n};`)(...Object.values(this.closed))}},ro={major:4,minor:6,patch:7},G=H(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ro;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=z(t),a;for(let o of n){if(o._zod.def.when){if(ri(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new ki;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(si(t.issues,n,e),i||=z(t,n))});else{if(t.issues.length===n)continue;si(t.issues,n,e),i||=z(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(z(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new ki;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new ki;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return hi(this,`~standard`,oo(this))},set"~standard"(e){B(this,`~standard`,e)}}),io=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ci(e,t,ji()))}:{value:e.value};async function ao(e,t){let n={async:!0};return io(await e._zod.run({value:t,issues:[]},n),n)}function oo(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return io(r,n)}catch{}return ao(e,t)},vendor:`zod`,version:1}}var so=H(`$ZodString`,(e,t)=>{G.init(e,t),e._zod.pattern=t.pattern??Fa,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),K=H(`$ZodStringFormat`,(e,t)=>{Ja.init(e,t),so.init(e,t)}),co=H(`$ZodGUID`,(e,t)=>{t.pattern??=ga,K.init(e,t)}),lo=H(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=_a(e)}else t.pattern??=_a();K.init(e,t)}),uo=H(`$ZodEmail`,(e,t)=>{t.pattern??=va,K.init(e,t)});function fo(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function po(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?fo(e)||2:mo(e,t)}function mo(e,t){if(!t.normalize&&t.protocol?.source===Da.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var ho=/[\t\n\r]/g;function go(e){return e.replace(ho,``)}function _o(e,t){return t.lastIndex=0,t.test(e.hostname)}function vo(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var yo=H(`$ZodURL`,(e,t)=>{K.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=po(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=go(r);return}t.hostname&&!_o(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!vo(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:go(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),bo=H(`$ZodEmoji`,(e,t)=>{t.pattern??=ba(),K.init(e,t)}),xo=H(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?pa:ma(t.length),K.init(e,t)}),So=H(`$ZodCUID`,(e,t)=>{t.pattern??=ca,K.init(e,t)}),Co=H(`$ZodCUID2`,(e,t)=>{t.pattern??=la,K.init(e,t)}),wo=H(`$ZodULID`,(e,t)=>{t.pattern??=ua,K.init(e,t)}),To=H(`$ZodXID`,(e,t)=>{t.pattern??=da,K.init(e,t)}),Eo=H(`$ZodKSUID`,(e,t)=>{t.pattern??=fa,K.init(e,t)}),Do=H(`$ZodISODateTime`,(e,t)=>{t.pattern??=Pa(t),K.init(e,t)}),Oo=H(`$ZodISODate`,(e,t)=>{t.pattern??=ja,K.init(e,t)}),ko=H(`$ZodISOTime`,(e,t)=>{t.pattern??=Na(t),K.init(e,t)}),Ao=H(`$ZodISODuration`,(e,t)=>{t.pattern??=ha,K.init(e,t)}),jo=H(`$ZodIPv4`,(e,t)=>{t.pattern??=xa,K.init(e,t)}),Mo=/^[0-9a-fA-F:.]+$/;function No(e){return Mo.test(e)?fo(`http://[${e}]`):!1}var Po=H(`$ZodIPv6`,(e,t)=>{t.pattern??=Sa,K.init(e,t),e._zod.check=n=>{No(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Fo=H(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ca,K.init(e,t)});function Io(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:No(n)}var Lo=H(`$ZodCIDRv6`,(e,t)=>{t.pattern??=wa,K.init(e,t),e._zod.check=n=>{Io(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Ro(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var zo=/^[0-9a-zA-Z+/]*={0,2}$/,Bo=H(`$ZodBase64`,(e,t)=>{t.pattern??=zo,K.init(e,t),e._zod.check=n=>{Ro(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Vo=/^[A-Za-z0-9_-]*$/;function Ho(e){if(!Vo.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Ro(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Uo=H(`$ZodBase64URL`,(e,t)=>{t.pattern??=Vo,K.init(e,t),e._zod.check=n=>{Ho(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Wo=H(`$ZodE164`,(e,t)=>{t.pattern??=Oa,K.init(e,t)});function Go(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Ko=H(`$ZodJWT`,(e,t)=>{K.init(e,t),e._zod.check=n=>{Go(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),qo=H(`$ZodNumber`,(e,t)=>{G.init(e,t),e._zod.pattern=Ia,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Jo=H(`$ZodNumberFormat`,(e,t)=>{Wa.init(e,t),qo.init(e,t)}),Yo=H(`$ZodUnknown`,(e,t)=>{G.init(e,t),e._zod.parse=e=>e}),Xo=H(`$ZodNever`,(e,t)=>{G.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Zo(e,t){let n=oi(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of oi(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,si(n.issues,t,e),n}}return i(n,a)}}var Qo=e=>Array.isArray(e)?e.length:-1;function $o(e,t,n){e.issues.length&&t.issues.push(...ii(n,e.issues)),t.value[n]=e.value}var es=H(`$ZodArray`,(e,t)=>{G.init(e,t);let n=U.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>$o(t,r,e)));else if($o(c,r,e),s&&c.issues.length!==0&&z(c))break}return o.length?Promise.all(o).then(()=>r):r},Zo(e,Qo)});function ts(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...ii(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var ns=[];function rs(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:ns,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Gr(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function is(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(z(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ts(e,n,i,t,d,f))):ts(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var as=H(`$ZodObject`,(e,t)=>{G.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Cr(()=>rs(t));V(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||kr(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Rr,o=t.catchall,s,c=U.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(z(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>ts(n,t,e,r,a,o))):ts(s,t,e,r,a,o)}return o?is(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),os=H(`$ZodObjectJIT`,(e,t)=>{as.init(e,t);let n=e._zod.parse,r=Cr(()=>rs(t)),i=U.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new no([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
109
|
-
let ${e}_ab = false;
|
|
110
|
-
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
111
|
-
const iss = ${e}.issues[i];
|
|
112
|
-
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
113
|
-
payload.issues.push(iss);
|
|
114
|
-
if (iss.continue !== true) ${e}_ab = true;
|
|
115
|
-
}
|
|
116
|
-
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
117
|
-
payload.value = newResult;
|
|
118
|
-
return payload;
|
|
119
|
-
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Fr(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
120
|
-
const ${n}_present = ${i};
|
|
121
|
-
if (!${n}.issues.length || ${n}_present) {
|
|
122
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (${e}) {
|
|
126
|
-
newResult[${r}] = ${n}.value;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
`)}else f?(o.write(`
|
|
131
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
132
|
-
}
|
|
133
|
-
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
134
|
-
if (${n}.value !== undefined || ${i}) {
|
|
135
|
-
newResult[${r}] = ${n}.value;
|
|
136
|
-
}
|
|
137
|
-
`)):o.write(`
|
|
138
|
-
const ${n}_present = ${i};
|
|
139
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
140
|
-
}
|
|
141
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
142
|
-
payload.issues.push({
|
|
143
|
-
code: "invalid_type",
|
|
144
|
-
expected: "nonoptional",
|
|
145
|
-
input: undefined,
|
|
146
|
-
path: [${r}]
|
|
147
|
-
});
|
|
148
|
-
if (ctx && ctx.abortEarly) {
|
|
149
|
-
payload.value = newResult;
|
|
150
|
-
return payload;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (${n}_present) {
|
|
155
|
-
newResult[${r}] = ${n}.value;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Rr,c=!U.jitless,l=c&&zr.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?is([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function ss(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!z(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ci(e,r,ji())))}),t)}var cs=H(`$ZodUnion`,(e,t)=>{G.init(e,t),V(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),V(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),V(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),V(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Tr(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ss(t,r,e,i)):ss(o,r,e,i)}}),ls=H(`$ZodIntersection`,(e,t)=>{G.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>ds(e,t,n)):ds(e,i,a)}});function us(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Br(e)&&Br(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=us(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=us(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ds(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=us(t.value,n.value);if(!c.valid){if(z(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var fs=H(`$ZodEnum`,(e,t)=>{G.init(e,t);let n=yr(t.entries),r=new Set(n);e._zod.values=r,V(e,`pattern`,e=>{let t=yr(e.def.entries).filter(e=>Hr.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Ur(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ps=H(`$ZodLiteral`,(e,t)=>{G.init(e,t);let n=new Set(t.values);e._zod.values=n,V(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Ur(e):e?Ur(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ms=H(`$ZodTransform`,(e,t)=>{G.init(e,t),e._zod.optin=`optional`,U.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ai(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new ki;return n.value=i,n}});function hs(e,t){return e.value=t.issues.length?void 0:t.value,e}var gs=H(`$ZodOptional`,(e,t)=>{G.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,V(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),V(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Tr(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>hs(e,t)):hs(e,r)}return t.innerType._zod.run(e,n)}}),_s=H(`$ZodExactOptional`,(e,t)=>{gs.init(e,t),V(e,`values`,e=>e.def.innerType._zod.values),V(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),vs=H(`$ZodNullable`,(e,t)=>{G.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin),V(e,`optout`,e=>e.def.innerType._zod.optout),V(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Tr(t.source)}|null)$`):void 0}),V(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),ys=H(`$ZodDefault`,(e,t)=>{G.init(e,t),e._zod.optin=`defaulted`,V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>bs(e,t)):bs(r,t)}});function bs(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var xs=H(`$ZodPrefault`,(e,t)=>{G.init(e,t),e._zod.optin=`defaulted`,V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ss=H(`$ZodNonOptional`,(e,t)=>{G.init(e,t),V(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Cs(t,e)):Cs(i,e)}});function Cs(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function ws(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ci(e,r,ji()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Ts=H(`$ZodCatch`,(e,t)=>{G.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),V(e,`optout`,e=>e.def.innerType._zod.optout),V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>ws(e,r,t,n)):ws(e,r,t,n)}}),Es=H(`$ZodPipe`,(e,t)=>{G.init(e,t),V(e,`values`,e=>e.def.in._zod.values),V(e,`optin`,e=>e.def.in._zod.optin),V(e,`optout`,e=>e.def.out._zod.optout),V(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ds(e,t.in,n)):Ds(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ds(e,t.out,n)):Ds(r,t.out,n)}});function Ds(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Os=H(`$ZodReadonly`,(e,t)=>{G.init(e,t),V(e,`propValues`,e=>e.def.innerType._zod.propValues),V(e,`values`,e=>e.def.innerType._zod.values),V(e,`optin`,e=>e.def.innerType?._zod?.optin),V(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ks):ks(r)}});function ks(e){return e.memo||(e.value=Object.freeze(e.value)),e}var As=H(`$ZodLazy`,(e,t)=>{G.init(e,t),Or(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),V(e,`pattern`,e=>e.innerType?._zod?.pattern),V(e,`propValues`,e=>e.innerType?._zod?.propValues),V(e,`optin`,e=>e.innerType?._zod?.optin??void 0),V(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),js=H(`$ZodCustom`,(e,t)=>{W.init(e,t),G.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ms(t,n,r,e));Ms(i,n,r,e)}});function Ms(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(pi(e))}}var Ns=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Ps=`~memo`,Fs=[];function Is(e){return typeof e==`object`&&!!e}function Ls(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Rs=new WeakMap,zs=0,Bs=1,Vs=2;function Hs(e,t,n){let r=Rs.get(e);if(r!==void 0)return r?Vs:zs;if(t.has(e))return Vs;t.add(e);let i=zs,a=e=>{if(i!==Vs&&e?._zod){let r=Hs(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=zs;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Bs:o.value?._zod?Hs(o.value,t,n):zs;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Ar(c);s(e?o(e,!0):Bs),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Hs(r,t,!1):Bs);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Us(e,i)}function Us(e,t){return t!==Bs&&Rs.set(e,t===Vs),t}function Ws(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Gs,Ks=[],qs={alloc(e,t,n){let r=Gs;if(!r)return n;Gs=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ks.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Ys(n,e.value))throw new Ns;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Hs(e,new Set,!1);if(i===zs)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Vs||r?n=!0:r=!0}let l=s.value;if(!Is(l))return t(s,c);let u=c[Ps];u||(u={buckets:new WeakMap,backEdges:void 0},c[Ps]=u);let d;i===c?d=a:(d=Ws(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Ls(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Gs=d;let p=Ks.length,m=t(s,c);Gs=void 0;let h=Ks.length>p?Ks.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Ls(e.issues):Fs),e)):(h&&(h.issues=m.issues.length?Ls(m.issues):Fs),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Js(){return qs}function Ys(e,t){let n=e[Ps]?.backEdges;return n!==void 0&&Is(t)&&n.has(t)}var Xs=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(fi(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Wr(e.values[0])}`:`Invalid option: expected one of ${br(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${br(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Zs(){return{localeError:Xs()}}var Qs,$s=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ec(){return new $s}(Qs=globalThis).__zod_globalRegistry??(Qs.__zod_globalRegistry=ec());var tc=globalThis.__zod_globalRegistry;function nc(e){return e.checks&&=[...e.checks],e}function rc(e,t){return new e(nc({type:`string`,...R(t)}))}function ic(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...R(t)})}function ac(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...R(t)})}function oc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...R(t)})}function sc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...R(t)})}function cc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...R(t)})}function lc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...R(t)})}function uc(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...R(t)})}function dc(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...R(t)})}function fc(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...R(t)})}function pc(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...R(t)})}function mc(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...R(t)})}function hc(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...R(t)})}function gc(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...R(t)})}function _c(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...R(t)})}function vc(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...R(t)})}function yc(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...R(t)})}function bc(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...R(t)})}function xc(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...R(t)})}function Sc(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...R(t)})}function Cc(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...R(t)})}function wc(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...R(t)})}function Tc(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...R(t)})}function Ec(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...R(t)})}function Dc(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...R(t)})}function Oc(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...R(t)})}function kc(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...R(t)})}function Ac(e,t){return new e(nc({type:`number`,checks:[],...R(t)}))}function jc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...R(t)})}function Mc(e){return new e({type:`unknown`})}function Nc(e,t){return new e({type:`never`,...R(t)})}function Pc(e,t){return new Va({check:`less_than`,...R(t),value:e,inclusive:!1})}function Fc(e,t){return new Va({check:`less_than`,...R(t),value:e,inclusive:!0})}function Ic(e,t){return new Ha({check:`greater_than`,...R(t),value:e,inclusive:!1})}function Lc(e,t){return new Ha({check:`greater_than`,...R(t),value:e,inclusive:!0})}function Rc(e,t){return new Ua({check:`multiple_of`,...R(t),value:e})}function zc(e,t){return new Ga({check:`max_length`,...R(t),maximum:e})}function Bc(e,t){return new Ka({check:`min_length`,...R(t),minimum:e})}function Vc(e,t){return new qa({check:`length_equals`,...R(t),length:e})}function Hc(e,t){return new Ya({check:`string_format`,format:`regex`,...R(t),pattern:e})}function Uc(e){return new Xa({check:`string_format`,format:`lowercase`,...R(e)})}function Wc(e){return new Za({check:`string_format`,format:`uppercase`,...R(e)})}function Gc(e,t){return new Qa({check:`string_format`,format:`includes`,...R(t),includes:e})}function Kc(e,t){return new $a({check:`string_format`,format:`starts_with`,...R(t),prefix:e})}function qc(e,t){return new eo({check:`string_format`,format:`ends_with`,...R(t),suffix:e})}function Jc(e){return new to({check:`overwrite`,tx:e})}function Yc(e){return Jc(t=>t.normalize(e))}function Xc(){return Jc(e=>e.trim())}function Zc(){return Jc(e=>e.toLowerCase())}function Qc(){return Jc(e=>e.toUpperCase())}function $c(){return Jc(e=>Ir(e))}function el(e,t,n){return new e({type:`array`,element:t,...R(n)})}function tl(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...R(n)})}function nl(e,t){let n=rl(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(pi(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(pi(r))}},e(t.value,t)),t);return n}function rl(e,t){let n=new W({check:`custom`,...R(t)});return n._zod.check=e,n}function il(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&kr(e,t,n[t]);return e}function al(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??tc,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function ol(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function q(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,q(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&il(o.schema,c),t.io===`input`&&J(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function sl(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function cl(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${sl(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+sl(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
159
|
-
|
|
160
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function ll(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;ll(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var ul=new Set([`type`,`properties`,`required`,`additionalProperties`]),dl=[`oneOf`,`anyOf`];function fl(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function pl(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!ul.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??fl(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}kr(n,r,e.length===1?e[0]:pl(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=fl(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function ml(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of ul)if(t in e)return;let n=t.filter(e=>dl.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=pl(t);else{let e=n[0],i=dl.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>pl([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,il(e,r))}function hl(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):il(i,s),il(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())ll(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])ml(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}il(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,kr(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:_l(t,`input`,e.processors),output:_l(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function J(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return J(r.element,n);if(r.type===`set`)return J(r.valueType,n);if(r.type===`lazy`)return J(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return J(r.innerType,n);if(r.type===`intersection`)return J(r.left,n)||J(r.right,n);if(r.type===`record`||r.type===`map`)return J(r.keyType,n)||J(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:J(r.in,n)||J(r.out,n);if(r.type===`object`){for(let e in r.shape)if(J(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(J(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(J(e,n))return!0;return!!(r.rest&&J(r.rest,n))}return!1}var gl=(e,t={})=>n=>{let r=al({...n,processors:t});return q(e,r),cl(r,e),hl(r,e)},_l=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=al({...i??{},target:a,io:t,processors:n});return q(e,o),cl(o,e),hl(o,e)},vl=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},yl=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},bl=(e,t)=>{vl(e,`minimum`,t),yl(e,`maximum`,t)},xl=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Sl=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Cl=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},wl=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Tl=(e,t)=>vl(e,`minimum`,t.minimum),El=(e,t)=>yl(e,`maximum`,t.maximum),Dl=e=>(t,n)=>{wl(t,n.format);let[r,i]=e[n.format];vl(t,`minimum`,r),yl(t,`maximum`,i)},Ol={greater_than:(e,t)=>vl(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>yl(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>xl(e,t.value),number_format:Dl(Kr),bigint_format:Dl(qr),min_length:Tl,max_length:El,length_equals:(e,t)=>bl(e,t.length),min_size:Tl,max_size:El,size_equals:(e,t)=>bl(e,t.size),string_format:(e,t)=>{wl(e,t.format),t.pattern&&Sl(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Cl(e,t.mime)};function Y(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Ol[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&vl(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&vl(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&yl(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&yl(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&xl(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Cl(t,i.mime);for(let e of i.patterns??[])Sl(t,e);return t}var kl={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Al=new Map([[zo,Ta],[Vo,Ea]]),jl=e=>Al.get(e)??e,Ml=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Y(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=kl[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(jl);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Nl=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Y(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):ol(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Pl=(e,t,n,r)=>{n.not={}},Fl=(e,t,n,r)=>{let i=e._zod.def,a=yr(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Il=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(ol(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(ol(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ll=(e,t,n,r)=>{ol(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Rl=(e,t,n,r)=>{ol(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},zl=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Y(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=q(a.element,t,{...r,path:[...r.path,`items`]})};function Bl(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Bl(t.out):t.type===`catch`?Bl(t.innerType):e._zod.optin}var Vl=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&ol(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)kr(i.properties,e,q(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Bl(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=q(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Hl=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>q(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ul=(e,t,n,r)=>{let i=e._zod.def,a=q(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=q(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Wl=(e,t,n,r)=>{let i=e._zod.def,a=q(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Gl=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Kl=Symbol();function ql(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(ol(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Kl):JSON.parse(o)}var Jl=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=ql(i.defaultValue,e,t,n,r);o!==Kl&&(n.default=o)},Yl=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=ql(i.defaultValue,e,t,n,r);o!==Kl&&(n._prefault=o)},Xl=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{ol(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Zl=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;q(o,t,r);let s=t.seen.get(e);s.ref=o},Ql=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},$l=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},eu=(e,t,n,r)=>{let i=e._zod.innerType;q(i,t,r);let a=t.seen.get(e);a.ref=i},tu=new WeakSet([Object.prototype,Error.prototype]);function nu(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var X=H(`ZodError`,(e,t)=>{Li.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);tu.has(n)||(tu.add(n),nu(n,`format`,e=>t=>Bi(e,t)),nu(n,`flatten`,e=>t=>zi(e,t)),nu(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,xr,2)}),nu(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,xr,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ru=Wi(X),iu=Gi(X),au=Ki(X),ou=Ji(X),su=ea(X),cu=ta(X),lu=na(X),uu=ra(X),du=ia(X),fu=aa(X),pu=oa(X),mu=sa(X);function hu(){U.localeError||ji(Zs())}function gu(){U.memoizer||ji({memoizer:Js()})}var Z=H(`ZodType`,(e,t)=>(hu(),G.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(I(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return L(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Md(e,t))},superRefine(e,t){return this.check(Nd(e,t))},overwrite(e){return this.check(Jc(e))},optional(){return fd(this)},exactOptional(){return md(this)},nullable(){return gd(this)},nullish(){return fd(gd(this))},nonoptional(e){return Sd(this,e)},array(){return Qu(this)},or(e){return nd([this,e])},and(e){return id(this,e)},transform(e){return Ed(this,ud(e))},default(e){return vd(this,e)},prefault(e){return bd(this,e)},catch(e){return wd(this,e)},pipe(e){return Ed(this,e)},readonly(){return Od(this)},describe(e){let t=this.clone();return tc.add(t,{description:e}),t},meta(...e){if(e.length===0)return tc.get(this);let t=this.clone();return tc.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return hi(this,`~standard`,{...oo(this),jsonSchema:{input:_l(this,`input`),output:_l(this,`output`)}})},set"~standard"(e){B(this,`~standard`,e)},parse:function e(t,n){return ru(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await iu(this,t,n,{callee:e})},safeParse(e,t){return au(this,e,t)},async safeParseAsync(e,t){return ou(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){B(this,`spa`,e)},validate(e,t){return Zi(this,e,t)},validateAsync(e,t){return $i(this,e,t)},encode:function e(t,n){return su(this,t,n,{callee:e})},decode:function e(t,n){return cu(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await lu(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await uu(this,t,n,{callee:e})},safeEncode(e,t){return du(this,e,t)},safeDecode(e,t){return fu(this,e,t)},async safeEncodeAsync(e,t){return pu(this,e,t)},async safeDecodeAsync(e,t){return mu(this,e,t)},toJSONSchema(e){return gl(this,{})(e)},get description(){return tc.get(this)?.description},get _def(){return this._zod.def}}),_u=H(`_ZodString`,(e,t)=>{so.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ml(e,t,n,r)},gi({format:e=>Y(e).format??null,minLength:e=>Y(e).minimum??null,maxLength:e=>Y(e).maximum??null},{regex(...e){return this.check(Hc(...e))},includes(...e){return this.check(Gc(...e))},startsWith(...e){return this.check(Kc(...e))},endsWith(...e){return this.check(qc(...e))},min(...e){return this.check(Bc(...e))},max(...e){return this.check(zc(...e))},length(...e){return this.check(Vc(...e))},nonempty(...e){return this.check(Bc(1,...e))},lowercase(e){return this.check(Uc(e))},uppercase(e){return this.check(Wc(e))},trim(){return this.check(Xc())},normalize(...e){return this.check(Yc(...e))},toLowerCase(){return this.check(Zc())},toUpperCase(){return this.check(Qc())},slugify(){return this.check($c())}})),vu=H(`ZodString`,(e,t)=>{so.init(e,t),_u.init(e,t)},{email(e){return this.check(ic(wu,e))},url(e){return this.check(uc(Du,e))},jwt(e){return this.check(Tc(Hu,e))},emoji(e){return this.check(dc(Ou,e))},guid(e){return this.check(ac(Tu,e))},uuid(e){return this.check(oc(Eu,e))},uuidv4(e){return this.check(sc(Eu,e))},uuidv6(e){return this.check(cc(Eu,e))},uuidv7(e){return this.check(lc(Eu,e))},nanoid(e){return this.check(fc(ku,e))},cuid(e){return this.check(pc(Au,e))},cuid2(e){return this.check(mc(ju,e))},ulid(e){return this.check(hc(Mu,e))},base64(e){return this.check(Sc(zu,e))},base64url(e){return this.check(Cc(Bu,e))},xid(e){return this.check(gc(Nu,e))},ksuid(e){return this.check(_c(Pu,e))},ipv4(e){return this.check(vc(Fu,e))},ipv6(e){return this.check(yc(Iu,e))},cidrv4(e){return this.check(bc(Lu,e))},cidrv6(e){return this.check(xc(Ru,e))},e164(e){return this.check(wc(Vu,e))},datetime(e){return this.check(Ec(bu,e))},date(e){return this.check(Dc(xu,e))},time(e){return this.check(Oc(Su,e))},duration(e){return this.check(kc(Cu,e))}});function yu(e){return rc(vu,e)}var Q=H(`ZodStringFormat`,(e,t)=>{K.init(e,t),_u.init(e,t)}),bu=H(`ZodISODateTime`,(e,t)=>{Do.init(e,t),Q.init(e,t)}),xu=H(`ZodISODate`,(e,t)=>{Oo.init(e,t),Q.init(e,t)}),Su=H(`ZodISOTime`,(e,t)=>{ko.init(e,t),Q.init(e,t)}),Cu=H(`ZodISODuration`,(e,t)=>{Ao.init(e,t),Q.init(e,t)}),wu=H(`ZodEmail`,(e,t)=>{uo.init(e,t),Q.init(e,t)}),Tu=H(`ZodGUID`,(e,t)=>{co.init(e,t),Q.init(e,t)}),Eu=H(`ZodUUID`,(e,t)=>{lo.init(e,t),Q.init(e,t)}),Du=H(`ZodURL`,(e,t)=>{yo.init(e,t),Q.init(e,t)}),Ou=H(`ZodEmoji`,(e,t)=>{bo.init(e,t),Q.init(e,t)}),ku=H(`ZodNanoID`,(e,t)=>{xo.init(e,t),Q.init(e,t)}),Au=H(`ZodCUID`,(e,t)=>{So.init(e,t),Q.init(e,t)}),ju=H(`ZodCUID2`,(e,t)=>{Co.init(e,t),Q.init(e,t)}),Mu=H(`ZodULID`,(e,t)=>{wo.init(e,t),Q.init(e,t)}),Nu=H(`ZodXID`,(e,t)=>{To.init(e,t),Q.init(e,t)}),Pu=H(`ZodKSUID`,(e,t)=>{Eo.init(e,t),Q.init(e,t)}),Fu=H(`ZodIPv4`,(e,t)=>{jo.init(e,t),Q.init(e,t)}),Iu=H(`ZodIPv6`,(e,t)=>{Po.init(e,t),Q.init(e,t)}),Lu=H(`ZodCIDRv4`,(e,t)=>{Fo.init(e,t),Q.init(e,t)}),Ru=H(`ZodCIDRv6`,(e,t)=>{Lo.init(e,t),Q.init(e,t)}),zu=H(`ZodBase64`,(e,t)=>{Bo.init(e,t),Q.init(e,t)}),Bu=H(`ZodBase64URL`,(e,t)=>{Uo.init(e,t),Q.init(e,t)}),Vu=H(`ZodE164`,(e,t)=>{Wo.init(e,t),Q.init(e,t)}),Hu=H(`ZodJWT`,(e,t)=>{Ko.init(e,t),Q.init(e,t)}),Uu=H(`ZodNumber`,(e,t)=>{qo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nl(e,t,n,r),e.isFinite=!0},gi({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Y(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Y(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Y(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Y(e).format??null},{gt(e,t){return this.check(Ic(e,t))},gte(e,t){return this.check(Lc(e,t))},min(e,t){return this.check(Lc(e,t))},lt(e,t){return this.check(Pc(e,t))},lte(e,t){return this.check(Fc(e,t))},max(e,t){return this.check(Fc(e,t))},int(e){return this.check(Ku(e))},safe(e){return this.check(Ku(e))},positive(e){return this.check(Ic(0,e))},nonnegative(e){return this.check(Lc(0,e))},negative(e){return this.check(Pc(0,e))},nonpositive(e){return this.check(Fc(0,e))},multipleOf(e,t){return this.check(Rc(e,t))},step(e,t){return this.check(Rc(e,t))},finite(){return this}}));function Wu(e){return Ac(Uu,e)}var Gu=H(`ZodNumberFormat`,(e,t)=>{Jo.init(e,t),Uu.init(e,t)});function Ku(e){return jc(Gu,e)}var qu=H(`ZodUnknown`,(e,t)=>{Yo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ju(){return Mc(qu)}var Yu=H(`ZodNever`,(e,t)=>{Xo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pl(e,t,n,r)});function Xu(e){return Nc(Yu,e)}var Zu=H(`ZodArray`,(e,t)=>{gu(),es.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zl(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Bc(e,t))},nonempty(e){return this.check(Bc(1,e))},max(e,t){return this.check(zc(e,t))},length(e,t){return this.check(Vc(e,t))},unwrap(){return this.element}});function Qu(e,t){return el(Zu,e,t)}var $u=H(`ZodObject`,(e,t)=>{gu(),os.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vl(e,t,n,r),Si(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return od(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(I(this._zod.def,{catchall:e}))},passthrough(){return this.clone(I(this._zod.def,{catchall:Ju()}))},loose(){return this.clone(I(this._zod.def,{catchall:Ju()}))},strict(){return this.clone(I(this._zod.def,{catchall:Xu()}))},strip(){return this.clone(I(this._zod.def,{catchall:void 0}))},extend(e){return Zr(this,e)},safeExtend(e){return $r(this,e)},merge(e){return ei(this,e)},pick(e){return Jr(this,e)},omit(e){return Xr(this,e)},partial(...e){return ti(dd,this,e[0])},exactPartial(...e){return ti(pd,this,e[0],`exactPartial`)},required(...e){return ni(xd,this,e[0])}});function ed(e,t){return new $u({type:`object`,shape:e,catchall:Xu(),...R(t)})}var td=H(`ZodUnion`,(e,t)=>{cs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hl(e,t,n,r),e.options=t.options});function nd(e,t){return new td({type:`union`,options:e,...R(t)})}var rd=H(`ZodIntersection`,(e,t)=>{ls.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ul(e,t,n,r)});function id(e,t){return new rd({type:`intersection`,left:e,right:t})}var ad=H(`ZodEnum`,(e,t)=>{fs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fl(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ad({...t,checks:[],...R(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ad({...t,checks:[],...R(r),entries:i})}});function od(e,t){return new ad({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...R(t)})}var sd=H(`ZodLiteral`,(e,t)=>{ps.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Il(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function cd(e,t){return new sd({type:`literal`,values:Array.isArray(e)?e:[e],...R(t)})}var ld=H(`ZodTransform`,(e,t)=>{gu(),ms.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rl(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ai(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(pi(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(pi(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function ud(e){return new ld({type:`transform`,transform:e})}var dd=H(`ZodOptional`,(e,t)=>{gs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$l(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fd(e){return new dd({type:`optional`,innerType:e})}var pd=H(`ZodExactOptional`,(e,t)=>{_s.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$l(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function md(e){return new pd({type:`optional`,innerType:e})}var hd=H(`ZodNullable`,(e,t)=>{vs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gd(e){return new hd({type:`nullable`,innerType:e})}var _d=H(`ZodDefault`,(e,t)=>{ys.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function vd(e,t){return new _d({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Vr(t)}})}var yd=H(`ZodPrefault`,(e,t)=>{xs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bd(e,t){return new yd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Vr(t)}})}var xd=H(`ZodNonOptional`,(e,t)=>{Ss.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sd(e,t){return new xd({type:`nonoptional`,innerType:e,...R(t)})}var Cd=H(`ZodCatch`,(e,t)=>{Ts.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wd(e,t){return new Cd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:wi(t)})}var Td=H(`ZodPipe`,(e,t)=>{Es.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zl(e,t,n,r),e.in=t.in,e.out=t.out});function Ed(e,t){return new Td({type:`pipe`,in:e,out:t})}var Dd=H(`ZodReadonly`,(e,t)=>{Os.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ql(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Od(e){return new Dd({type:`readonly`,innerType:e})}var kd=H(`ZodLazy`,(e,t)=>{As.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eu(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Ad(e){return new kd({type:`lazy`,getter:e})}var jd=H(`ZodCustom`,(e,t)=>{js.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ll(e,t,n,r)});function Md(e,t={}){return tl(jd,e,t)}function Nd(e,t){return nl(e,t)}var Pd=ed({x:Wu().finite(),y:Wu().finite()}),Fd=yu().regex(/\S/,`An ID must not be empty.`),Id=ed({node_id:Fd}),Ld=ed({id:Fd.optional(),summary:yu().nullable().optional(),full_text:yu().nullable().optional(),position:Pd.optional()}),Rd=Ad(()=>nd([Ld.extend({summary:yu().nullable(),connections:Qu(zd).optional()}),Ld.extend({full_text:yu().nullable(),connections:Qu(zd).optional()})])),zd=Ad(()=>nd([yu(),Id,Rd,Qu(zd)])),Bd=nd([yu(),Rd]),Vd=ed({version:cd(`v1`),nodes:Qu(Bd)}),Hd=class extends Error{code;constructor(e,t){super(t),this.code=e,this.name=`ContentEditError`}};function Ud(e,t){let n=0;for(let r=0;r<Math.max(0,t.line);r++){let t=e.indexOf(`
|
|
161
|
-
`,n);if(t<0)return e.length;n=t+1}let r=e.indexOf(`
|
|
162
|
-
`,n),i=r<0?e.length:r;return i>n&&e[i-1]===`\r`&&i--,Math.min(i,n+Math.max(0,t.character))}function Wd(e,t){t=Math.max(0,Math.min(e.length,t));let n=e.slice(0,t);return{line:n.split(`
|
|
163
|
-
`).length-1,character:t-(n.lastIndexOf(`
|
|
164
|
-
`)+1)}}function Gd(e,t=new Set){if(e&&typeof e==`object`){if(t.has(e))throw Error(`YAML alias cycles are not supported; use node_id for graph cycles.`);t.add(e);for(let n of Object.values(e))Gd(n,t);t.delete(e)}}var Kd=class e{uri;text;version;state;records=[];validSource=``;serial=0;constructor(e,t=``,n=0){this.uri=e,this.text=t,this.version=n,this.state={uri:e,revision:n,analyzedRevision:null,graphRevision:null,valid:!1,pending:!0,graph:null,diagnostics:[],bindings:[]},this.analyze()}get source(){return this.text}get revision(){return this.version}receive(e,t){return this.text=e,this.version=t,this.state={...this.state,revision:t,valid:!1,pending:!0,bindings:[],diagnostics:[]},this.snapshot()}update(e,t){return this.receive(e,t),this.analyze()}snapshot(){return structuredClone(this.state)}range(e){return{start:Wd(this.text,e.start),end:Wd(this.text,e.end)}}analyze(){try{let e=vr(this.text,{uniqueKeys:!0}),t=[...e.errors,...e.warnings][0];if(t)throw Object.assign(Error(`YAML: ${t.message}`),{offset:t.pos[0]});let n=e.toJS();Gd(n);let r=Vd.safeParse(n);if(!r.success)throw Error(Hi(r.error));let i=[],a=[],o=[],s=[],c=new Map,l=0;for(;l<this.validSource.length&&l<this.text.length&&this.validSource[l]===this.text[l];)l++;let u=0;for(;u<this.validSource.length-l&&u<this.text.length-l&&this.validSource.at(-u-1)===this.text.at(-u-1);)u++;let d=e=>e<=l?e:e>=this.validSource.length-u?e+this.text.length-this.validSource.length:-1,f=(t,n,r)=>{let l=n.join(`.`),u=e.getIn(n,!0);if(!u)for(let t=n.length-1;t>0;t--){let r=e.getIn(n.slice(0,t),!0);if(g(r)){u=r;break}}let d={start:u?.range?.[0]??0,end:u?.range?.[1]??0};if(typeof t==`object`&&t&&!Array.isArray(t)&&`node_id`in t){r&&s.push({from:r,id:t.node_id,path:l,span:d});return}let p=typeof t==`string`?{full_text:t}:Array.isArray(t)?{full_text:null,connections:t}:t,m=p.full_text??p.summary??``,h=p.summary===void 0?(p.full_text??``).split(/\r?\n/,1)[0]:p.summary??``,_=`thought:${++this.serial}`,v={key:_,id:p.id,title:h,markdown:m,unresolved:h.trim()===``,position:p.position,path:l};if(i.push({thought:v,span:d,ast:u}),o.push({key:_,kind:`definition`,span:d}),p.id!==void 0){if(c.has(p.id))throw Error(`${l}.id: duplicate id "${p.id}".`);c.set(p.id,_)}r&&a.push({key:`edge:${_}`,from:r,to:_,kind:`branch`,path:l}),p.connections?.forEach((e,r)=>{f(e,Array.isArray(t)?[...n,r]:[...n,`connections`,r],_)})};r.data.nodes.forEach((e,t)=>{f(e,[`nodes`,t])});let p=new Map,m=new Set(i),h=new Set(this.records),_=(e,t)=>{p.set(t.thought.key,e.thought.key),m.delete(t),h.delete(e)};for(let e of this.records){let t=[...m].filter(t=>v(e.ast)===v(t.ast)&&b(e.ast)===b(t.ast)&&d(e.span.end)===t.span.end);t.length===1&&_(e,t[0])}for(let e of[...h]){let t=[...m].filter(t=>e.thought.id===void 0?t.thought.title===e.thought.title&&t.thought.markdown===e.thought.markdown:t.thought.id===e.thought.id),n=[...h].filter(t=>e.thought.id===void 0?t.thought.title===e.thought.title&&t.thought.markdown===e.thought.markdown:t.thought.id===e.thought.id);t.length===1&&n.length===1&&_(e,t[0])}for(let e of[...h]){let t=[...m].filter(t=>v(e.ast)===v(t.ast)&&b(e.ast)===b(t.ast)&&d(e.span.start)===t.span.start);t.length===1&&_(e,t[0])}let y=e=>p.get(e)??e;for(let e of i)e.thought.key=y(e.thought.key);for(let e of o)e.key=y(e.key);for(let e of a)e.from=y(e.from),e.to=y(e.to),e.key=`edge:${e.to}`;for(let[e,t]of c)c.set(e,y(t));for(let e of s)e.from=y(e.from);let x=new Map;for(let e of s){let t=c.get(e.id);if(!t)throw Error(`${e.path}.node_id: no node has id "${e.id}".`);let n=`${e.from}:${t}`,r=x.get(n)??0;x.set(n,r+1),a.push({key:`cross:${n}:${r}`,from:e.from,to:t,kind:`cross`,path:e.path}),o.push({key:t,kind:`reference`,span:e.span,ownerKey:e.from})}this.records=i,this.validSource=this.text,this.state={uri:this.uri,revision:this.version,analyzedRevision:this.version,graphRevision:this.version,valid:!0,pending:!1,graph:{nodes:i.map(e=>e.thought),edges:a},diagnostics:[],bindings:o}}catch(e){let t=typeof e==`object`&&e&&`offset`in e?Number(e.offset):0;this.state={...this.state,analyzedRevision:this.version,valid:!1,pending:!1,bindings:[],diagnostics:[{message:e instanceof Error?e.message:String(e),range:this.range({start:t,end:t})}]}}return this.snapshot()}locate(e){if(!this.state.valid||this.state.pending)return;let t=Ud(this.text,e);return this.state.bindings.filter(e=>e.span.start<=t&&t<e.span.end).sort((e,t)=>e.span.end-e.span.start-(t.span.end-t.span.start))[0]?.key}definition(e){if(!this.state.valid||this.state.pending)return;let t=this.state.bindings.find(t=>t.key===e&&t.kind===`definition`);return t?this.range(t.span):void 0}highlights(e){let t=this.locate(e);return t?this.state.bindings.filter(e=>e.key===t).map(e=>this.range(e.span)):[]}prepareContentEdit(t,n){if(!this.state.valid||this.state.pending)throw new Hd(`stale-analysis`,`Current valid analysis is required.`);let r=this.records.find(e=>e.thought.key===t);if(!r)throw new Hd(`unknown-key`,`Unknown thought key.`);let i=r.ast,a=[],o=()=>new Hd(`unsupported`,`This source form cannot be edited safely.`);if(g(i))throw o();let s=(e,t,n)=>{let r=this.text.slice(e,t),i=/^[|>][0-9+-]*[ \t]*(#[^\r\n]*)/.exec(r)?.[1];return n+(i?` ${i}`:``)+(r.endsWith(`\r
|
|
165
|
-
`)?`\r
|
|
166
|
-
`:r.endsWith(`
|
|
167
|
-
`)?`
|
|
168
|
-
`:``)},c=[`summary`,`full_text`].filter(e=>n[e]!==void 0);if(b(i)){if(c.includes(`summary`))throw o();if(c.includes(`full_text`)){if(n.full_text===null)throw o();a.push({...r.span,newText:s(r.span.start,r.span.end,JSON.stringify(n.full_text))})}}else if(v(i))for(let e of c){let t=i.get(e,!0),r=JSON.stringify(n[e]);if(t&&b(t)&&t.range)a.push({start:t.range[0],end:t.range[1],newText:s(t.range[0],t.range[1],r)});else if(t!==void 0)throw o();else{if(i.flow)throw o();let t=i.items[0]?.key;if(!b(t)||!t.range)throw o();let n=t.range[0],s=this.text.lastIndexOf(`
|
|
169
|
-
`,n-1)+1,c=` `.repeat(n-s);a.push({start:n,end:n,newText:`${e}: ${r}\n${c}`})}}else if(c.length)throw o();let l=this.text;for(let e of[...a].sort((e,t)=>t.start-e.start))l=l.slice(0,e.start)+e.newText+l.slice(e.end);if(!new e(this.uri,l,this.version).snapshot().valid)throw new Hd(`invalid-edit`,`Proposed content does not form a valid document.`);return{source:l,edits:a.map(e=>({range:this.range(e),newText:e.newText}))}}};function qd(t){try{let n=new Kd(`playground`,t).snapshot();return!n.valid||!n.graph?{ok:!1,error:n.diagnostics.map(e=>e.message).join(`
|
|
170
|
-
`)}:{ok:!0,graph:e(n.graph)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:`The document could not be parsed.`}}}var $=t();function Jd({graph:e,active:t,onFocus:r,onFragment:a,source:o,applied:s,error:c,status:l,onSourceChange:u,onApply:d,onLoadSample:f}){let p=e.edges.filter(e=>e.from===t?.key);return(0,$.jsxs)(`aside`,{className:`notes`,id:`lensmap-sidebar`,"aria-label":`Sidebar`,children:[(0,$.jsxs)(`div`,{className:`note-eyebrow`,children:[(0,$.jsx)(`span`,{children:`THOUGHTS & SOURCE`}),(0,$.jsx)(`span`,{children:`v1 / incomplete`})]}),(0,$.jsxs)(`details`,{className:`sidebar-section`,open:!0,children:[(0,$.jsx)(`summary`,{children:`Selected thought`}),(0,$.jsx)(`div`,{className:`note-content`,children:t?(0,$.jsx)(i,{components:{h1:({children:e})=>(0,$.jsx)(`h2`,{children:e}),a:({href:e,children:t})=>(0,$.jsx)(`a`,{href:e,onClick:t=>{e?.startsWith(`#`)&&(t.preventDefault(),a(e.slice(1)))},children:t})},children:t.markdown||(t.unresolved?`# Unresolved thought
|
|
171
|
-
|
|
172
|
-
This thought has not been named yet.`:t.title)}):(0,$.jsx)(`p`,{children:`No thought selected.`})})]}),(0,$.jsxs)(`details`,{className:`sidebar-section outgoing`,open:!0,children:[(0,$.jsx)(`summary`,{children:`Explicit connections`}),p.map(t=>{let i=e.nodes.find(e=>e.key===t.to);return i&&(0,$.jsxs)(`button`,{type:`button`,onClick:()=>r(t.to),children:[(0,$.jsxs)(`span`,{children:[t.kind===`cross`?`┄➤`:`↳`,` `,n(i)]}),(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`↗`})]},t.key)}),!p.length&&(0,$.jsx)(`p`,{children:`No outgoing connections yet.`})]}),(0,$.jsxs)(`details`,{className:`sidebar-section playground`,children:[(0,$.jsx)(`summary`,{children:`YAML playground`}),(0,$.jsxs)(`p`,{className:`editor-help`,id:`source-help`,children:[`Experimental `,(0,$.jsx)(`code`,{children:`version: v1`}),`. This is an incomplete schema, not a frozen format. Write thoughts first; positions and IDs are optional.`]}),(0,$.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),d()},children:[(0,$.jsx)(`label`,{className:`source-label`,htmlFor:`yaml-source`,children:`YAML source`}),(0,$.jsx)(`textarea`,{id:`yaml-source`,"aria-describedby":`source-help source-lifetime`,spellCheck:!1,value:o,onChange:e=>u(e.target.value)}),(0,$.jsxs)(`div`,{className:`editor-actions`,children:[(0,$.jsx)(`button`,{type:`submit`,children:`Apply YAML`}),(0,$.jsx)(`button`,{type:`button`,onClick:f,children:`Load sample`})]}),(0,$.jsx)(`p`,{className:`editor-state`,children:o===s?`Draft matches the map.`:`Unapplied changes — the map still shows the last valid document.`}),c&&(0,$.jsx)(`pre`,{className:`source-error`,role:`alert`,children:c}),(0,$.jsx)(`p`,{className:`editor-state`,role:`status`,children:l})]}),(0,$.jsx)(`p`,{className:`editor-help`,id:`source-lifetime`,children:`Drafts stay here while you navigate or collapse sections. Reloading the page discards them; saving and editor language tooling are not implemented yet.`})]})]})}var Yd=`# Lensmap v1 is incomplete and experimental. This sample is editable.
|
|
173
|
-
version: v1
|
|
174
|
-
nodes:
|
|
175
|
-
- id: ferry
|
|
176
|
-
full_text: |
|
|
177
|
-
# Night ferry
|
|
178
|
-
|
|
179
|
-
What would make a little night ferry worth taking? Start with the journey, not the timetable.
|
|
180
|
-
|
|
181
|
-
The [tide window](#tides) is a prose reference: following it does **not** add a line to the map.
|
|
182
|
-
|
|
183
|
-
- A dependable crossing
|
|
184
|
-
- A warm place to wait
|
|
185
|
-
- Room for unexpected stories
|
|
186
|
-
|
|
187
|
-
connections:
|
|
188
|
-
- full_text: |
|
|
189
|
-
# Weather
|
|
190
|
-
|
|
191
|
-
Rain changes the crossing, but it also changes how people wait. A roof can matter as much as a faster boat.
|
|
192
|
-
|
|
193
|
-
connections:
|
|
194
|
-
- id: tides
|
|
195
|
-
full_text: |
|
|
196
|
-
# Tide window
|
|
197
|
-
|
|
198
|
-
A timetable is a promise made to a moving shoreline.
|
|
199
|
-
|
|
200
|
-
**Question:** can the last departure move without leaving someone behind?
|
|
201
|
-
|
|
202
|
-
Return to the [night ferry](#ferry).
|
|
203
|
-
|
|
204
|
-
connections:
|
|
205
|
-
- full_text: |
|
|
206
|
-
# Tide tables
|
|
207
|
-
|
|
208
|
-
Compare the published prediction with the water at the actual landing.
|
|
209
|
-
|
|
210
|
-
- full_text: |
|
|
211
|
-
# Sandbar markers
|
|
212
|
-
|
|
213
|
-
A route that was clear last month may have moved after the storms.
|
|
214
|
-
|
|
215
|
-
- full_text: |
|
|
216
|
-
# Spring tides
|
|
217
|
-
|
|
218
|
-
The largest tidal range changes both the channel and the boarding ramp.
|
|
219
|
-
|
|
220
|
-
- full_text: |
|
|
221
|
-
# Distant tide gauge
|
|
222
|
-
|
|
223
|
-
An outer-harbor observation may explain a delay that is invisible at the pier.
|
|
224
|
-
|
|
225
|
-
- full_text: |
|
|
226
|
-
# A small forecast
|
|
227
|
-
|
|
228
|
-
A plain-language board at the pier. No need to make a traveller interpret a marine chart.
|
|
229
|
-
|
|
230
|
-
connections:
|
|
231
|
-
- node_id: harbor
|
|
232
|
-
- full_text: |
|
|
233
|
-
# Wind flags
|
|
234
|
-
|
|
235
|
-
A small visual signal can communicate more quickly than a paragraph of forecasts.
|
|
236
|
-
|
|
237
|
-
- full_text: |
|
|
238
|
-
# A squall line
|
|
239
|
-
|
|
240
|
-
The approaching weather matters more than the rain already overhead.
|
|
241
|
-
|
|
242
|
-
- full_text: |
|
|
243
|
-
# Offshore reports
|
|
244
|
-
|
|
245
|
-
Ask the boats beyond the headland what the sheltered pier cannot show.
|
|
246
|
-
|
|
247
|
-
- full_text: |
|
|
248
|
-
# Beyond the headland
|
|
249
|
-
|
|
250
|
-
The farthest observation belongs to the same crossing, even when it sits at the edge of attention.
|
|
251
|
-
|
|
252
|
-
- full_text: |
|
|
253
|
-
# Who crosses?
|
|
254
|
-
|
|
255
|
-
The cook going home. The early market seller. Someone who just wants to see the lights from the water.
|
|
256
|
-
|
|
257
|
-
connections:
|
|
258
|
-
- full_text: |
|
|
259
|
-
# A step-free pier
|
|
260
|
-
|
|
261
|
-
Access is part of the route, not something added after the boat is chosen.
|
|
262
|
-
|
|
263
|
-
connections:
|
|
264
|
-
- node_id: harbor
|
|
265
|
-
- full_text: |
|
|
266
|
-
# Ramp gradient
|
|
267
|
-
|
|
268
|
-
Check the boarding angle at low water, not only at a convenient midday tide.
|
|
269
|
-
|
|
270
|
-
- full_text: |
|
|
271
|
-
# Tactile wayfinding
|
|
272
|
-
|
|
273
|
-
The path should still make sense when a sign is difficult to see.
|
|
274
|
-
|
|
275
|
-
- full_text: |
|
|
276
|
-
# Late bus connection
|
|
277
|
-
|
|
278
|
-
A step-free boat is not enough if the last accessible bus leaves before it docks.
|
|
279
|
-
|
|
280
|
-
- full_text: |
|
|
281
|
-
# The last mile home
|
|
282
|
-
|
|
283
|
-
Follow the journey all the way from the landing to a traveller's own door.
|
|
284
|
-
|
|
285
|
-
- full_text: |
|
|
286
|
-
# Stories aboard
|
|
287
|
-
|
|
288
|
-
What do regular passengers notice that a route planner would miss?
|
|
289
|
-
|
|
290
|
-
> The crossing begins before you board.
|
|
291
|
-
|
|
292
|
-
connections:
|
|
293
|
-
- node_id: archive
|
|
294
|
-
- full_text: |
|
|
295
|
-
# Market mornings
|
|
296
|
-
|
|
297
|
-
The early crossing carries baskets, unfinished conversations, and a different rhythm.
|
|
298
|
-
|
|
299
|
-
- full_text: |
|
|
300
|
-
# Familiar faces
|
|
301
|
-
|
|
302
|
-
A regular passenger may notice an absence before anyone notices a missed ticket.
|
|
303
|
-
|
|
304
|
-
- full_text: |
|
|
305
|
-
# Songs at the pier
|
|
306
|
-
|
|
307
|
-
Keep a little room in the notes for things that are not operational requirements.
|
|
308
|
-
|
|
309
|
-
- full_text: |
|
|
310
|
-
# A crossing remembered
|
|
311
|
-
|
|
312
|
-
Someone who moved away still remembers which side of the boat caught the evening light.
|
|
313
|
-
|
|
314
|
-
- id: harbor
|
|
315
|
-
full_text: |
|
|
316
|
-
# Harbor lights
|
|
317
|
-
|
|
318
|
-
Wayfinding, shelter, and a recognisable place to arrive. This branch converges with accessibility and weather.
|
|
319
|
-
|
|
320
|
-
connections:
|
|
321
|
-
- full_text: |
|
|
322
|
-
# Keep it running
|
|
323
|
-
|
|
324
|
-
Maintenance is a recurring connection back to the crossing itself, not a dead-end checklist.
|
|
325
|
-
|
|
326
|
-
connections:
|
|
327
|
-
- node_id: ferry
|
|
328
|
-
- full_text: |
|
|
329
|
-
# Spare lamps
|
|
330
|
-
|
|
331
|
-
An ordinary replacement can keep a small failure from becoming a cancelled crossing.
|
|
332
|
-
|
|
333
|
-
- full_text: |
|
|
334
|
-
# Workshop rota
|
|
335
|
-
|
|
336
|
-
Leave enough time between shifts for repairs that need care rather than speed.
|
|
337
|
-
|
|
338
|
-
- full_text: |
|
|
339
|
-
# Winter overhaul
|
|
340
|
-
|
|
341
|
-
The work outside the busy season determines what can be promised during it.
|
|
342
|
-
|
|
343
|
-
- full_text: |
|
|
344
|
-
# A distant boatyard
|
|
345
|
-
|
|
346
|
-
Some repairs connect the little ferry to skills and suppliers far beyond its own harbor.
|
|
347
|
-
|
|
348
|
-
- id: archive
|
|
349
|
-
full_text: |
|
|
350
|
-
# Remember the route
|
|
351
|
-
|
|
352
|
-
Old tickets, passenger sketches, changing names for the same stretch of water.
|
|
353
|
-
|
|
354
|
-
connections:
|
|
355
|
-
- summary: null
|
|
356
|
-
|
|
357
|
-
connections:
|
|
358
|
-
- full_text: |
|
|
359
|
-
# A little ritual
|
|
360
|
-
|
|
361
|
-
Perhaps tea before departure. Perhaps something we have not thought of yet.
|
|
362
|
-
|
|
363
|
-
connections:
|
|
364
|
-
- full_text: |
|
|
365
|
-
# Tea before departure
|
|
366
|
-
|
|
367
|
-
A cup can mark the beginning of a journey without making a ceremony of it.
|
|
368
|
-
|
|
369
|
-
- full_text: |
|
|
370
|
-
# A passenger sketchbook
|
|
371
|
-
|
|
372
|
-
Let the route accumulate drawings as well as timetables.
|
|
373
|
-
|
|
374
|
-
- full_text: |
|
|
375
|
-
# Returning each year
|
|
376
|
-
|
|
377
|
-
The same crossing can become a quiet measure of what has changed.
|
|
378
|
-
|
|
379
|
-
- full_text: |
|
|
380
|
-
# A future tradition
|
|
381
|
-
|
|
382
|
-
Leave this idea far out on the map: it may only become clear after many crossings.
|
|
383
|
-
`,Xd=qd(Yd);if(!Xd.ok)throw Error(`The Lensmap sample is invalid: ${Xd.error}`);var Zd=Xd.graph;function Qd(){let[e,t]=(0,s.useState)(Zd),[n,r]=(0,s.useState)(Yd),[i,a]=(0,s.useState)(Yd),[c,l]=(0,s.useState)(``),[u,d]=(0,s.useState)(``);return(0,$.jsx)(o,{graph:e,updateMode:`replace`,renderSidebar:e=>(0,$.jsx)(Jd,{...e,source:n,applied:i,error:c,status:u,onSourceChange:r,onApply:()=>{let e=qd(n);e.ok?(t(e.graph),a(n),l(``),d(`Applied ${e.graph.nodes.length} thoughts and ${e.graph.edges.length} connections.`)):(l(e.error),d(``))},onLoadSample:()=>{r(Yd),l(``),d(`Sample loaded into the draft. Apply YAML to change the map.`)}})})}var $d=document.getElementById(`root`);if(!$d)throw Error(`Lensmap could not find its root element.`);(0,c.createRoot)($d).render((0,$.jsx)(s.StrictMode,{children:(0,$.jsx)(Qd,{})}));
|