@sisense/sdk-ui 2.4.1 → 2.6.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.
Files changed (54) hide show
  1. package/dist/ai.cjs +1 -1
  2. package/dist/ai.js +4 -4
  3. package/dist/analytics-composer.cjs +82 -82
  4. package/dist/analytics-composer.js +1911 -1911
  5. package/dist/{derive-chart-family-woVAnbRi.js → derive-chart-family-BPYK8evJ.js} +11015 -10951
  6. package/dist/{derive-chart-family-Cqw-HJq1.cjs → derive-chart-family-yUBZXP4x.cjs} +146 -146
  7. package/dist/dimensions-BgPl9ZS9.cjs +1 -0
  8. package/dist/dimensions-DuHaCozA.js +203 -0
  9. package/dist/index.cjs +17 -17
  10. package/dist/index.js +7207 -6831
  11. package/dist/index.umd.js +296 -296
  12. package/dist/packages/sdk-ui/src/analytics-composer/common/utils.d.ts +18 -0
  13. package/dist/packages/sdk-ui/src/api/types/dashboard-dto.d.ts +4 -0
  14. package/dist/packages/sdk-ui/src/app/client-application.d.ts +27 -8
  15. package/dist/packages/sdk-ui/src/chart/advanced-chart.d.ts +1 -1
  16. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/highcharts-based-chart-renderer.d.ts +4 -0
  17. package/dist/packages/sdk-ui/src/chart-data-options/types.d.ts +8 -0
  18. package/dist/packages/sdk-ui/src/chart-data-options/utils.d.ts +8 -1
  19. package/dist/packages/sdk-ui/src/common/components/modal/index.d.ts +1 -1
  20. package/dist/packages/sdk-ui/src/common/components/modal/modal-context.d.ts +0 -6
  21. package/dist/packages/sdk-ui/src/common/hooks/use-modal.d.ts +14 -0
  22. package/dist/packages/sdk-ui/src/common/icons/jtd-jumpable-icon.d.ts +1 -0
  23. package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/resizable-columns.d.ts +7 -3
  24. package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/const.d.ts +2 -2
  25. package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/helpers.d.ts +6 -0
  26. package/dist/packages/sdk-ui/src/dashboard/components/jtd-dashboard.d.ts +3 -2
  27. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/index.d.ts +5 -0
  28. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-filters.d.ts +129 -0
  29. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-handlers.d.ts +46 -0
  30. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-menu.d.ts +47 -0
  31. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-types.d.ts +93 -0
  32. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-widget-transforms.d.ts +48 -0
  33. package/dist/packages/sdk-ui/src/dashboard/hooks/use-jtd.d.ts +1 -92
  34. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +26 -19
  35. package/dist/packages/sdk-ui/src/dynamic-size-container/dynamic-size-container.d.ts +2 -1
  36. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/utils.d.ts +8 -0
  37. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +1 -0
  38. package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +18 -2
  39. package/dist/packages/sdk-ui/src/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +2 -2
  40. package/dist/packages/sdk-ui/src/props.d.ts +10 -0
  41. package/dist/packages/sdk-ui/src/sisense-chart/sisense-chart.d.ts +1 -1
  42. package/dist/packages/sdk-ui/src/sisense-chart/types.d.ts +4 -0
  43. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +1 -0
  44. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +2 -0
  45. package/dist/packages/sdk-ui/src/utils/parseISOWithTimezoneCheck.d.ts +9 -0
  46. package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +9 -9
  47. package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +26 -0
  48. package/dist/{use-common-filters-Br-CoziA.js → use-common-filters-B1RKY2KD.js} +4512 -4440
  49. package/dist/{use-common-filters-CCXbao1t.cjs → use-common-filters-CRgYdKcV.cjs} +78 -78
  50. package/dist/{widget-composer-DheWJukc.cjs → widget-composer-B2r2a9Oh.cjs} +7 -7
  51. package/dist/{widget-composer-BCNu5BzM.js → widget-composer-I9gUFBZt.js} +121 -102
  52. package/package.json +7 -7
  53. package/dist/dimensions-BHdLQaOB.js +0 -200
  54. package/dist/dimensions-oGJ_aWd5.cjs +0 -1
@@ -1,73 +1,73 @@
1
- "use strict";var Fn=Object.defineProperty,Kn=Object.defineProperties;var jn=Object.getOwnPropertyDescriptors;var Qe=Object.getOwnPropertySymbols;var as=Object.prototype.hasOwnProperty,ls=Object.prototype.propertyIsEnumerable;var kt=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var os=(e,t,s)=>t in e?Fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,K=(e,t)=>{for(var s in t||(t={}))as.call(t,s)&&os(e,s,t[s]);if(Qe)for(var s of Qe(t))ls.call(t,s)&&os(e,s,t[s]);return e},J=(e,t)=>Kn(e,jn(t));var cs=(e,t)=>{var s={};for(var n in e)as.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(e!=null&&Qe)for(var n of Qe(e))t.indexOf(n)<0&&ls.call(e,n)&&(s[n]=e[n]);return s};var Ot=(e,t,s)=>new Promise((n,i)=>{var r=l=>{try{a(s.next(l))}catch(c){i(c)}},o=l=>{try{a(s.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,o);a((s=s.apply(e,t)).next())}),qn=function(e,t){this[0]=e,this[1]=t};var d=e=>{var t=e[kt("asyncIterator")],s=!1,n,i={};return t==null?(t=e[kt("iterator")](),n=r=>i[r]=o=>t[r](o)):(t=t.call(e),n=r=>i[r]=o=>{if(s){if(s=!1,r==="throw")throw o;return o}return s=!0,{done:!1,value:new qn(new Promise(a=>{var l=t[r](o);if(!(l instanceof Object))throw TypeError("Object expected");a(l)}),1)}}),i[kt("iterator")]=()=>i,n("next"),"throw"in t?n("throw"):i.throw=r=>{throw r},"return"in t&&n("return"),i};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./widget-composer-DheWJukc.cjs"),T=require("./derive-chart-family-Cqw-HJq1.cjs"),rt=require("./dimensions-oGJ_aWd5.cjs"),zt=Symbol.for("yaml.alias"),Mt=Symbol.for("yaml.document"),ee=Symbol.for("yaml.map"),Is=Symbol.for("yaml.pair"),Z=Symbol.for("yaml.scalar"),Ne=Symbol.for("yaml.seq"),Y=Symbol.for("yaml.node.type"),fe=e=>!!e&&typeof e=="object"&&e[Y]===zt,Te=e=>!!e&&typeof e=="object"&&e[Y]===Mt,Ie=e=>!!e&&typeof e=="object"&&e[Y]===ee,_=e=>!!e&&typeof e=="object"&&e[Y]===Is,L=e=>!!e&&typeof e=="object"&&e[Y]===Z,Ce=e=>!!e&&typeof e=="object"&&e[Y]===Ne;function D(e){if(e&&typeof e=="object")switch(e[Y]){case ee:case Ne:return!0}return!1}function B(e){if(e&&typeof e=="object")switch(e[Y]){case zt:case ee:case Z:case Ne:return!0}return!1}const zn=e=>(L(e)||D(e))&&!!e.anchor,U=Symbol("break visit"),Cs=Symbol("skip children"),H=Symbol("remove node");function te(e,t){const s=Ls(t);Te(e)?me(null,e.contents,s,Object.freeze([e]))===H&&(e.contents=null):me(null,e,s,Object.freeze([]))}te.BREAK=U;te.SKIP=Cs;te.REMOVE=H;function me(e,t,s,n){const i=_s(e,t,s,n);if(B(i)||_(i))return Ms(e,n,i),me(e,i,s,n);if(typeof i!="symbol"){if(D(t)){n=Object.freeze(n.concat(t));for(let r=0;r<t.items.length;++r){const o=me(r,t.items[r],s,n);if(typeof o=="number")r=o-1;else{if(o===U)return U;o===H&&(t.items.splice(r,1),r-=1)}}}else if(_(t)){n=Object.freeze(n.concat(t));const r=me("key",t.key,s,n);if(r===U)return U;r===H&&(t.key=null);const o=me("value",t.value,s,n);if(o===U)return U;o===H&&(t.value=null)}}return i}function ot(e,t){return Ot(this,null,function*(){const s=Ls(t);Te(e)?(yield ye(null,e.contents,s,Object.freeze([e])))===H&&(e.contents=null):yield ye(null,e,s,Object.freeze([]))})}ot.BREAK=U;ot.SKIP=Cs;ot.REMOVE=H;function ye(e,t,s,n){return Ot(this,null,function*(){const i=yield _s(e,t,s,n);if(B(i)||_(i))return Ms(e,n,i),ye(e,i,s,n);if(typeof i!="symbol"){if(D(t)){n=Object.freeze(n.concat(t));for(let r=0;r<t.items.length;++r){const o=yield ye(r,t.items[r],s,n);if(typeof o=="number")r=o-1;else{if(o===U)return U;o===H&&(t.items.splice(r,1),r-=1)}}}else if(_(t)){n=Object.freeze(n.concat(t));const r=yield ye("key",t.key,s,n);if(r===U)return U;r===H&&(t.key=null);const o=yield ye("value",t.value,s,n);if(o===U)return U;o===H&&(t.value=null)}}return i})}function Ls(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 _s(e,t,s,n){var i,r,o,a,l;if(typeof s=="function")return s(e,t,n);if(Ie(t))return(i=s.Map)==null?void 0:i.call(s,e,t,n);if(Ce(t))return(r=s.Seq)==null?void 0:r.call(s,e,t,n);if(_(t))return(o=s.Pair)==null?void 0:o.call(s,e,t,n);if(L(t))return(a=s.Scalar)==null?void 0:a.call(s,e,t,n);if(fe(t))return(l=s.Alias)==null?void 0:l.call(s,e,t,n)}function Ms(e,t,s){const n=t[t.length-1];if(D(n))n.items[e]=s;else if(_(n))e==="key"?n.key=s:n.value=s;else if(Te(n))n.contents=s;else{const i=fe(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Un={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},vn=e=>e.replace(/[!,[\]{}]/g,t=>Un[t]);class z{constructor(t,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},z.defaultYaml,t),this.tags=Object.assign({},z.defaultTags,s)}clone(){const t=new z(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new z(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:z.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},z.defaultTags);break}return t}add(t,s){this.atNextDocument&&(this.yaml={explicit:z.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},z.defaultTags),this.atNextDocument=!1);const n=t.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return s(6,`Unsupported YAML version ${r}`,o),!1}}default:return s(0,`Unknown directive ${i}`,!0),!1}}tagName(t,s){if(t==="!")return"!";if(t[0]!=="!")return s(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(s(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&s("Verbatim tags must end with a >"),o)}const[,n,i]=t.match(new RegExp("^(.*!)([^!]*)$","s"));i||s(`The ${t} tag has no suffix`);const r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return s(String(o)),null}return n==="!"?t:(s(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[s,n]of Object.entries(this.tags))if(t.startsWith(n))return s+vn(t.substring(n.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let i;if(t&&n.length>0&&B(t.contents)){const r={};te(t.contents,(o,a)=>{B(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(a=>a.startsWith(o)))&&s.push(`%TAG ${r} ${o}`);return s.join(`
2
- `)}}z.defaultYaml={explicit:!1,version:"1.2"};z.defaultTags={"!!":"tag:yaml.org,2002:"};function Ds(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(s)}return!0}function $s(e){const t=new Set;return te(e,{Value(s,n){n.anchor&&t.add(n.anchor)}}),t}function Ps(e,t){for(let s=1;;++s){const n=`${e}${s}`;if(!t.has(n))return n}}function Vn(e,t){const s=[],n=new Map;let i=null;return{onAnchor:r=>{s.push(r),i||(i=$s(e));const o=Ps(t,i);return i.add(o),o},setAnchors:()=>{for(const r of s){const o=n.get(r);if(typeof o=="object"&&o.anchor&&(L(o.node)||D(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}function ge(e,t,s,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){const o=n[i],a=ge(e,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(const i of Array.from(n.keys())){const r=n.get(i),o=ge(e,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(const i of Array.from(n)){const r=ge(e,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(const[i,r]of Object.entries(n)){const o=ge(e,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return e.call(t,s,n)}function Q(e,t,s){if(Array.isArray(e))return e.map((n,i)=>Q(n,String(i),s));if(e&&typeof e.toJSON=="function"){if(!s||!zn(e))return e.toJSON(t,s);const n={aliasCount:0,count:1,res:void 0};s.anchors.set(e,n),s.onCreate=r=>{n.res=r,delete s.onCreate};const i=e.toJSON(t,s);return s.onCreate&&s.onCreate(i),i}return typeof e=="bigint"&&!(s!=null&&s.keep)?Number(e):e}class Ut{constructor(t){Object.defineProperty(this,Y,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:s,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!Te(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=Q(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?ge(r,{"":a},"",a):a}}class at extends Ut{constructor(t){super(zt),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let s;return te(t,{Node:(n,i)=>{if(i===this)return te.BREAK;i.anchor===this.source&&(s=i)}}),s}toJSON(t,s){if(!s)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:r}=s,o=this.resolve(i);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=n.get(o);if(a||(Q(o,null,s),a=n.get(o)),!a||a.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ge(i,o,n)),a.count*a.aliasCount>r)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,s,n){const i=`*${this.source}`;if(t){if(Ds(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(t.implicitKey)return`${i} `}return i}}function Ge(e,t,s){if(fe(t)){const n=t.resolve(e),i=s&&n&&s.get(n);return i?i.count*i.aliasCount:0}else if(D(t)){let n=0;for(const i of t.items){const r=Ge(e,i,s);r>n&&(n=r)}return n}else if(_(t)){const n=Ge(e,t.key,s),i=Ge(e,t.value,s);return Math.max(n,i)}return 1}const Bs=e=>!e||typeof e!="function"&&typeof e!="object";class A extends Ut{constructor(t){super(Z),this.value=t}toJSON(t,s){return s!=null&&s.keep?this.value:Q(this.value,t,s)}toString(){return String(this.value)}}A.BLOCK_FOLDED="BLOCK_FOLDED";A.BLOCK_LITERAL="BLOCK_LITERAL";A.PLAIN="PLAIN";A.QUOTE_DOUBLE="QUOTE_DOUBLE";A.QUOTE_SINGLE="QUOTE_SINGLE";const Qn="tag:yaml.org,2002:";function Yn(e,t,s){var n;if(t){const i=s.filter(o=>o.tag===t),r=(n=i.find(o=>!o.format))!=null?n:i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return s.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,e))&&!i.format})}function Re(e,t,s){var u,p,y;if(Te(e)&&(e=e.contents),B(e))return e;if(_(e)){const m=(p=(u=s.schema[ee]).createNode)==null?void 0:p.call(u,s.schema,null,s);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt!="undefined"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=s;let l;if(n&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor||(l.anchor=i(e)),new at(l.anchor);l={anchor:null,node:null},a.set(e,l)}t!=null&&t.startsWith("!!")&&(t=Qn+t.slice(2));let c=Yn(e,t,o.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new A(e);return l&&(l.node=m),m}c=e instanceof Map?o[ee]:Symbol.iterator in Object(e)?o[Ne]:o[ee]}r&&(r(c),delete s.onTagObj);const h=c!=null&&c.createNode?c.createNode(s.schema,e,s):typeof((y=c==null?void 0:c.nodeClass)==null?void 0:y.from)=="function"?c.nodeClass.from(s.schema,e,s):new A(e);return t?h.tag=t:c.default||(h.tag=c.tag),l&&(l.node=h),h}function tt(e,t,s){let n=s;for(let i=t.length-1;i>=0;--i){const r=t[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Re(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const $e=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Rs extends Ut{constructor(t,s){super(t),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(t){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(s.schema=t),s.items=s.items.map(n=>B(n)||_(n)?n.clone(t):n),this.range&&(s.range=this.range.slice()),s}addIn(t,s){if($e(t))this.add(s);else{const[n,...i]=t,r=this.get(n,!0);if(D(r))r.addIn(i,s);else if(r===void 0&&this.schema)this.set(n,tt(this.schema,i,s));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(t){const[s,...n]=t;if(n.length===0)return this.delete(s);const i=this.get(s,!0);if(D(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}getIn(t,s){const[n,...i]=t,r=this.get(n,!0);return i.length===0?!s&&L(r)?r.value:r:D(r)?r.getIn(i,s):void 0}hasAllNullValues(t){return this.items.every(s=>{if(!_(s))return!1;const n=s.value;return n==null||t&&L(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(t){const[s,...n]=t;if(n.length===0)return this.has(s);const i=this.get(s,!0);return D(i)?i.hasIn(n):!1}setIn(t,s){const[n,...i]=t;if(i.length===0)this.set(n,s);else{const r=this.get(n,!0);if(D(r))r.setIn(i,s);else if(r===void 0&&this.schema)this.set(n,tt(this.schema,i,s));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}}const Jn=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function X(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const oe=(e,t,s)=>e.endsWith(`
3
- `)?X(s,t):s.includes(`
1
+ "use strict";var Fn=Object.defineProperty,Kn=Object.defineProperties;var jn=Object.getOwnPropertyDescriptors;var Qe=Object.getOwnPropertySymbols;var as=Object.prototype.hasOwnProperty,ls=Object.prototype.propertyIsEnumerable;var kt=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var os=(t,e,s)=>e in t?Fn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,K=(t,e)=>{for(var s in e||(e={}))as.call(e,s)&&os(t,s,e[s]);if(Qe)for(var s of Qe(e))ls.call(e,s)&&os(t,s,e[s]);return t},J=(t,e)=>Kn(t,jn(e));var cs=(t,e)=>{var s={};for(var n in t)as.call(t,n)&&e.indexOf(n)<0&&(s[n]=t[n]);if(t!=null&&Qe)for(var n of Qe(t))e.indexOf(n)<0&&ls.call(t,n)&&(s[n]=t[n]);return s};var Ot=(t,e,s)=>new Promise((n,i)=>{var r=l=>{try{a(s.next(l))}catch(c){i(c)}},o=l=>{try{a(s.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,o);a((s=s.apply(t,e)).next())}),qn=function(t,e){this[0]=t,this[1]=e};var d=t=>{var e=t[kt("asyncIterator")],s=!1,n,i={};return e==null?(e=t[kt("iterator")](),n=r=>i[r]=o=>e[r](o)):(e=e.call(t),n=r=>i[r]=o=>{if(s){if(s=!1,r==="throw")throw o;return o}return s=!0,{done:!1,value:new qn(new Promise(a=>{var l=e[r](o);if(!(l instanceof Object))throw TypeError("Object expected");a(l)}),1)}}),i[kt("iterator")]=()=>i,n("next"),"throw"in e?n("throw"):i.throw=r=>{throw r},"return"in e&&n("return"),i};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./widget-composer-B2r2a9Oh.cjs"),T=require("./derive-chart-family-yUBZXP4x.cjs"),rt=require("./dimensions-BgPl9ZS9.cjs"),zt=Symbol.for("yaml.alias"),Mt=Symbol.for("yaml.document"),ee=Symbol.for("yaml.map"),Is=Symbol.for("yaml.pair"),Z=Symbol.for("yaml.scalar"),Ne=Symbol.for("yaml.seq"),Y=Symbol.for("yaml.node.type"),fe=t=>!!t&&typeof t=="object"&&t[Y]===zt,Te=t=>!!t&&typeof t=="object"&&t[Y]===Mt,Ie=t=>!!t&&typeof t=="object"&&t[Y]===ee,_=t=>!!t&&typeof t=="object"&&t[Y]===Is,L=t=>!!t&&typeof t=="object"&&t[Y]===Z,Ce=t=>!!t&&typeof t=="object"&&t[Y]===Ne;function D(t){if(t&&typeof t=="object")switch(t[Y]){case ee:case Ne:return!0}return!1}function B(t){if(t&&typeof t=="object")switch(t[Y]){case zt:case ee:case Z:case Ne:return!0}return!1}const zn=t=>(L(t)||D(t))&&!!t.anchor,U=Symbol("break visit"),Cs=Symbol("skip children"),H=Symbol("remove node");function te(t,e){const s=Ls(e);Te(t)?me(null,t.contents,s,Object.freeze([t]))===H&&(t.contents=null):me(null,t,s,Object.freeze([]))}te.BREAK=U;te.SKIP=Cs;te.REMOVE=H;function me(t,e,s,n){const i=_s(t,e,s,n);if(B(i)||_(i))return Ms(t,n,i),me(t,i,s,n);if(typeof i!="symbol"){if(D(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const o=me(r,e.items[r],s,n);if(typeof o=="number")r=o-1;else{if(o===U)return U;o===H&&(e.items.splice(r,1),r-=1)}}}else if(_(e)){n=Object.freeze(n.concat(e));const r=me("key",e.key,s,n);if(r===U)return U;r===H&&(e.key=null);const o=me("value",e.value,s,n);if(o===U)return U;o===H&&(e.value=null)}}return i}function ot(t,e){return Ot(this,null,function*(){const s=Ls(e);Te(t)?(yield ye(null,t.contents,s,Object.freeze([t])))===H&&(t.contents=null):yield ye(null,t,s,Object.freeze([]))})}ot.BREAK=U;ot.SKIP=Cs;ot.REMOVE=H;function ye(t,e,s,n){return Ot(this,null,function*(){const i=yield _s(t,e,s,n);if(B(i)||_(i))return Ms(t,n,i),ye(t,i,s,n);if(typeof i!="symbol"){if(D(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const o=yield ye(r,e.items[r],s,n);if(typeof o=="number")r=o-1;else{if(o===U)return U;o===H&&(e.items.splice(r,1),r-=1)}}}else if(_(e)){n=Object.freeze(n.concat(e));const r=yield ye("key",e.key,s,n);if(r===U)return U;r===H&&(e.key=null);const o=yield ye("value",e.value,s,n);if(o===U)return U;o===H&&(e.value=null)}}return i})}function Ls(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function _s(t,e,s,n){var i,r,o,a,l;if(typeof s=="function")return s(t,e,n);if(Ie(e))return(i=s.Map)==null?void 0:i.call(s,t,e,n);if(Ce(e))return(r=s.Seq)==null?void 0:r.call(s,t,e,n);if(_(e))return(o=s.Pair)==null?void 0:o.call(s,t,e,n);if(L(e))return(a=s.Scalar)==null?void 0:a.call(s,t,e,n);if(fe(e))return(l=s.Alias)==null?void 0:l.call(s,t,e,n)}function Ms(t,e,s){const n=e[e.length-1];if(D(n))n.items[t]=s;else if(_(n))t==="key"?n.key=s:n.value=s;else if(Te(n))n.contents=s;else{const i=fe(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Un={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},vn=t=>t.replace(/[!,[\]{}]/g,e=>Un[e]);class z{constructor(e,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},z.defaultYaml,e),this.tags=Object.assign({},z.defaultTags,s)}clone(){const e=new z(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new z(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:z.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},z.defaultTags);break}return e}add(e,s){this.atNextDocument&&(this.yaml={explicit:z.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},z.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return s(6,`Unsupported YAML version ${r}`,o),!1}}default:return s(0,`Unknown directive ${i}`,!0),!1}}tagName(e,s){if(e==="!")return"!";if(e[0]!=="!")return s(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(s(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&s("Verbatim tags must end with a >"),o)}const[,n,i]=e.match(new RegExp("^(.*!)([^!]*)$","s"));i||s(`The ${e} tag has no suffix`);const r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return s(String(o)),null}return n==="!"?e:(s(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[s,n]of Object.entries(this.tags))if(e.startsWith(n))return s+vn(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let i;if(e&&n.length>0&&B(e.contents)){const r={};te(e.contents,(o,a)=>{B(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&s.push(`%TAG ${r} ${o}`);return s.join(`
2
+ `)}}z.defaultYaml={explicit:!1,version:"1.2"};z.defaultTags={"!!":"tag:yaml.org,2002:"};function Ds(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(s)}return!0}function $s(t){const e=new Set;return te(t,{Value(s,n){n.anchor&&e.add(n.anchor)}}),e}function Ps(t,e){for(let s=1;;++s){const n=`${t}${s}`;if(!e.has(n))return n}}function Vn(t,e){const s=[],n=new Map;let i=null;return{onAnchor:r=>{s.push(r),i||(i=$s(t));const o=Ps(e,i);return i.add(o),o},setAnchors:()=>{for(const r of s){const o=n.get(r);if(typeof o=="object"&&o.anchor&&(L(o.node)||D(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}function ge(t,e,s,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){const o=n[i],a=ge(t,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(const i of Array.from(n.keys())){const r=n.get(i),o=ge(t,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(const i of Array.from(n)){const r=ge(t,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(const[i,r]of Object.entries(n)){const o=ge(t,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return t.call(e,s,n)}function Q(t,e,s){if(Array.isArray(t))return t.map((n,i)=>Q(n,String(i),s));if(t&&typeof t.toJSON=="function"){if(!s||!zn(t))return t.toJSON(e,s);const n={aliasCount:0,count:1,res:void 0};s.anchors.set(t,n),s.onCreate=r=>{n.res=r,delete s.onCreate};const i=t.toJSON(e,s);return s.onCreate&&s.onCreate(i),i}return typeof t=="bigint"&&!(s!=null&&s.keep)?Number(t):t}class Ut{constructor(e){Object.defineProperty(this,Y,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:s,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!Te(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=Q(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?ge(r,{"":a},"",a):a}}class at extends Ut{constructor(e){super(zt),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let s;return te(e,{Node:(n,i)=>{if(i===this)return te.BREAK;i.anchor===this.source&&(s=i)}}),s}toJSON(e,s){if(!s)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:r}=s,o=this.resolve(i);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=n.get(o);if(a||(Q(o,null,s),a=n.get(o)),!a||a.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ge(i,o,n)),a.count*a.aliasCount>r)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,s,n){const i=`*${this.source}`;if(e){if(Ds(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function Ge(t,e,s){if(fe(e)){const n=e.resolve(t),i=s&&n&&s.get(n);return i?i.count*i.aliasCount:0}else if(D(e)){let n=0;for(const i of e.items){const r=Ge(t,i,s);r>n&&(n=r)}return n}else if(_(e)){const n=Ge(t,e.key,s),i=Ge(t,e.value,s);return Math.max(n,i)}return 1}const Bs=t=>!t||typeof t!="function"&&typeof t!="object";class A extends Ut{constructor(e){super(Z),this.value=e}toJSON(e,s){return s!=null&&s.keep?this.value:Q(this.value,e,s)}toString(){return String(this.value)}}A.BLOCK_FOLDED="BLOCK_FOLDED";A.BLOCK_LITERAL="BLOCK_LITERAL";A.PLAIN="PLAIN";A.QUOTE_DOUBLE="QUOTE_DOUBLE";A.QUOTE_SINGLE="QUOTE_SINGLE";const Qn="tag:yaml.org,2002:";function Yn(t,e,s){var n;if(e){const i=s.filter(o=>o.tag===e),r=(n=i.find(o=>!o.format))!=null?n:i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return s.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,t))&&!i.format})}function Re(t,e,s){var u,p,y;if(Te(t)&&(t=t.contents),B(t))return t;if(_(t)){const m=(p=(u=s.schema[ee]).createNode)==null?void 0:p.call(u,s.schema,null,s);return m.items.push(t),m}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt!="undefined"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=s;let l;if(n&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor||(l.anchor=i(t)),new at(l.anchor);l={anchor:null,node:null},a.set(t,l)}e!=null&&e.startsWith("!!")&&(e=Qn+e.slice(2));let c=Yn(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const m=new A(t);return l&&(l.node=m),m}c=t instanceof Map?o[ee]:Symbol.iterator in Object(t)?o[Ne]:o[ee]}r&&(r(c),delete s.onTagObj);const h=c!=null&&c.createNode?c.createNode(s.schema,t,s):typeof((y=c==null?void 0:c.nodeClass)==null?void 0:y.from)=="function"?c.nodeClass.from(s.schema,t,s):new A(t);return e?h.tag=e:c.default||(h.tag=c.tag),l&&(l.node=h),h}function tt(t,e,s){let n=s;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Re(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const $e=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class Rs extends Ut{constructor(e,s){super(e),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(e){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(s.schema=e),s.items=s.items.map(n=>B(n)||_(n)?n.clone(e):n),this.range&&(s.range=this.range.slice()),s}addIn(e,s){if($e(e))this.add(s);else{const[n,...i]=e,r=this.get(n,!0);if(D(r))r.addIn(i,s);else if(r===void 0&&this.schema)this.set(n,tt(this.schema,i,s));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){const[s,...n]=e;if(n.length===0)return this.delete(s);const i=this.get(s,!0);if(D(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}getIn(e,s){const[n,...i]=e,r=this.get(n,!0);return i.length===0?!s&&L(r)?r.value:r:D(r)?r.getIn(i,s):void 0}hasAllNullValues(e){return this.items.every(s=>{if(!_(s))return!1;const n=s.value;return n==null||e&&L(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[s,...n]=e;if(n.length===0)return this.has(s);const i=this.get(s,!0);return D(i)?i.hasIn(n):!1}setIn(e,s){const[n,...i]=e;if(i.length===0)this.set(n,s);else{const r=this.get(n,!0);if(D(r))r.setIn(i,s);else if(r===void 0&&this.schema)this.set(n,tt(this.schema,i,s));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}}const Jn=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function X(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const oe=(t,e,s)=>t.endsWith(`
3
+ `)?X(s,e):s.includes(`
4
4
  `)?`
5
- `+X(s,t):(e.endsWith(" ")?"":" ")+s,Fs="flow",Dt="block",He="quoted";function lt(e,t,s="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return e;i<r&&(r=0);const l=Math.max(1+r,1+i-t.length);if(e.length<=l)return e;const c=[],h={};let u=i-t.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):u=i-n);let p,y,m=!1,f=-1,g=-1,b=-1;s===Dt&&(f=fs(e,f,t.length),f!==-1&&(u=f+l));for(let C;C=e[f+=1];){if(s===He&&C==="\\"){switch(g=f,e[f+1]){case"x":f+=3;break;case"u":f+=5;break;case"U":f+=9;break;default:f+=1}b=f}if(C===`
6
- `)s===Dt&&(f=fs(e,f,t.length)),u=f+t.length+l,p=void 0;else{if(C===" "&&y&&y!==" "&&y!==`
7
- `&&y!==" "){const E=e[f+1];E&&E!==" "&&E!==`
8
- `&&E!==" "&&(p=f)}if(f>=u)if(p)c.push(p),u=p+l,p=void 0;else if(s===He){for(;y===" "||y===" ";)y=C,C=e[f+=1],m=!0;const E=f>b+1?f-2:g-1;if(h[E])return e;c.push(E),h[E]=!0,u=E+l,p=void 0}else m=!0}y=C}if(m&&a&&a(),c.length===0)return e;o&&o();let w=e.slice(0,c[0]);for(let C=0;C<c.length;++C){const E=c[C],N=c[C+1]||e.length;E===0?w=`
9
- ${t}${e.slice(0,N)}`:(s===He&&h[E]&&(w+=`${e[E]}\\`),w+=`
10
- ${t}${e.slice(E+1,N)}`)}return w}function fs(e,t,s){let n=t,i=t+1,r=e[i];for(;r===" "||r===" ";)if(t<i+s)r=e[++t];else{do r=e[++t];while(r&&r!==`
11
- `);n=t,i=t+1,r=e[i]}return n}const ct=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ft=e=>/^(%|---|\.\.\.)/m.test(e);function Wn(e,t,s){if(!t||t<0)return!1;const n=t-s,i=e.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(e[r]===`
12
- `){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Pe(e,t){const s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;const{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(ft(e)?" ":"");let o="",a=0;for(let l=0,c=s[l];c;c=s[++l])if(c===" "&&s[l+1]==="\\"&&s[l+2]==="n"&&(o+=s.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(s[l+1]){case"u":{o+=s.slice(a,l);const h=s.substr(l+2,4);switch(h){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:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=s.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||s[l+2]==='"'||s.length<i)l+=1;else{for(o+=s.slice(a,l)+`
5
+ `+X(s,e):(t.endsWith(" ")?"":" ")+s,Fs="flow",Dt="block",He="quoted";function lt(t,e,s="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;i<r&&(r=0);const l=Math.max(1+r,1+i-e.length);if(t.length<=l)return t;const c=[],h={};let u=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):u=i-n);let p,y,m=!1,f=-1,g=-1,b=-1;s===Dt&&(f=fs(t,f,e.length),f!==-1&&(u=f+l));for(let C;C=t[f+=1];){if(s===He&&C==="\\"){switch(g=f,t[f+1]){case"x":f+=3;break;case"u":f+=5;break;case"U":f+=9;break;default:f+=1}b=f}if(C===`
6
+ `)s===Dt&&(f=fs(t,f,e.length)),u=f+e.length+l,p=void 0;else{if(C===" "&&y&&y!==" "&&y!==`
7
+ `&&y!==" "){const E=t[f+1];E&&E!==" "&&E!==`
8
+ `&&E!==" "&&(p=f)}if(f>=u)if(p)c.push(p),u=p+l,p=void 0;else if(s===He){for(;y===" "||y===" ";)y=C,C=t[f+=1],m=!0;const E=f>b+1?f-2:g-1;if(h[E])return t;c.push(E),h[E]=!0,u=E+l,p=void 0}else m=!0}y=C}if(m&&a&&a(),c.length===0)return t;o&&o();let w=t.slice(0,c[0]);for(let C=0;C<c.length;++C){const E=c[C],N=c[C+1]||t.length;E===0?w=`
9
+ ${e}${t.slice(0,N)}`:(s===He&&h[E]&&(w+=`${t[E]}\\`),w+=`
10
+ ${e}${t.slice(E+1,N)}`)}return w}function fs(t,e,s){let n=e,i=e+1,r=t[i];for(;r===" "||r===" ";)if(e<i+s)r=t[++e];else{do r=t[++e];while(r&&r!==`
11
+ `);n=e,i=e+1,r=t[i]}return n}const ct=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),ft=t=>/^(%|---|\.\.\.)/m.test(t);function Wn(t,e,s){if(!e||e<0)return!1;const n=e-s,i=t.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(t[r]===`
12
+ `){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Pe(t,e){const s=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return s;const{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(ft(t)?" ":"");let o="",a=0;for(let l=0,c=s[l];c;c=s[++l])if(c===" "&&s[l+1]==="\\"&&s[l+2]==="n"&&(o+=s.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(s[l+1]){case"u":{o+=s.slice(a,l);const h=s.substr(l+2,4);switch(h){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:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=s.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||s[l+2]==='"'||s.length<i)l+=1;else{for(o+=s.slice(a,l)+`
13
13
 
14
14
  `;s[l+2]==="\\"&&s[l+3]==="n"&&s[l+4]!=='"';)o+=`
15
- `,l+=2;o+=r,s[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+s.slice(a):s,n?o:lt(o,r,He,ct(t,!1))}function $t(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
16
- `)||/[ \t]\n|\n[ \t]/.test(e))return Pe(e,t);const s=t.indent||(ft(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
17
- ${s}`)+"'";return t.implicitKey?n:lt(n,s,Fs,ct(t,!1))}function be(e,t){const{singleQuote:s}=t.options;let n;if(s===!1)n=Pe;else{const i=e.includes('"'),r=e.includes("'");i&&!r?n=$t:r&&!i?n=Pe:n=s?$t:Pe}return n(e,t)}let Pt;try{Pt=new RegExp(`(^|(?<!
15
+ `,l+=2;o+=r,s[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+s.slice(a):s,n?o:lt(o,r,He,ct(e,!1))}function $t(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test(t))return Pe(t,e);const s=e.indent||(ft(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${s}`)+"'";return e.implicitKey?n:lt(n,s,Fs,ct(e,!1))}function be(t,e){const{singleQuote:s}=e.options;let n;if(s===!1)n=Pe;else{const i=t.includes('"'),r=t.includes("'");i&&!r?n=$t:r&&!i?n=Pe:n=s?$t:Pe}return n(t,e)}let Pt;try{Pt=new RegExp(`(^|(?<!
18
18
  ))
19
19
  +(?!
20
- |$)`,"g")}catch(e){Pt=/\n+(?!\n|$)/g}function Xe({comment:e,type:t,value:s},n,i,r){const{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(s)||/^\s*$/.test(s))return be(s,n);const c=n.indent||(n.forceBlockIndent||ft(s)?" ":""),h=o==="literal"?!0:o==="folded"||t===A.BLOCK_FOLDED?!1:t===A.BLOCK_LITERAL?!0:!Wn(s,l,c.length);if(!s)return h?`|
20
+ |$)`,"g")}catch(t){Pt=/\n+(?!\n|$)/g}function Xe({comment:t,type:e,value:s},n,i,r){const{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(s)||/^\s*$/.test(s))return be(s,n);const c=n.indent||(n.forceBlockIndent||ft(s)?" ":""),h=o==="literal"?!0:o==="folded"||e===A.BLOCK_FOLDED?!1:e===A.BLOCK_LITERAL?!0:!Wn(s,l,c.length);if(!s)return h?`|
21
21
  `:`>
22
22
  `;let u,p;for(p=s.length;p>0;--p){const I=s[p-1];if(I!==`
23
23
  `&&I!==" "&&I!==" ")break}let y=s.substring(p);const m=y.indexOf(`
24
24
  `);m===-1?u="-":s===y||m!==y.length-1?(u="+",r&&r()):u="",y&&(s=s.slice(0,-y.length),y[y.length-1]===`
25
25
  `&&(y=y.slice(0,-1)),y=y.replace(Pt,`$&${c}`));let f=!1,g,b=-1;for(g=0;g<s.length;++g){const I=s[g];if(I===" ")f=!0;else if(I===`
26
- `)b=g;else break}let w=s.substring(0,b<g?b+1:g);w&&(s=s.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let E=(h?"|":">")+(f?c?"2":"1":"")+u;if(e&&(E+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i&&i()),h)return s=s.replace(/\n+/g,`$&${c}`),`${E}
26
+ `)b=g;else break}let w=s.substring(0,b<g?b+1:g);w&&(s=s.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let E=(h?"|":">")+(f?c?"2":"1":"")+u;if(t&&(E+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),h)return s=s.replace(/\n+/g,`$&${c}`),`${E}
27
27
  ${c}${w}${s}${y}`;s=s.replace(/\n+/g,`
28
28
  $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);const N=lt(`${w}${s}${y}`,c,Dt,ct(n,!0));return`${E}
29
- ${c}${N}`}function xn(e,t,s,n){const{type:i,value:r}=e,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:h}=t;if(a&&r.includes(`
30
- `)||h&&/[[\]{},]/.test(r))return be(r,t);if(!r||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||h||!r.includes(`
31
- `)?be(r,t):Xe(e,t,s,n);if(!a&&!h&&i!==A.PLAIN&&r.includes(`
32
- `))return Xe(e,t,s,n);if(ft(r)){if(l==="")return t.forceBlockIndent=!0,Xe(e,t,s,n);if(a&&l===c)return be(r,t)}const u=r.replace(/\n+/g,`$&
33
- ${l}`);if(o){const p=f=>{var g;return f.default&&f.tag!=="tag:yaml.org,2002:str"&&((g=f.test)==null?void 0:g.test(u))},{compat:y,tags:m}=t.doc.schema;if(m.some(p)||y!=null&&y.some(p))return be(r,t)}return a?u:lt(u,l,Fs,ct(t,!1))}function Ue(e,t,s,n){const{implicitKey:i,inFlow:r}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==A.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=A.QUOTE_DOUBLE);const l=h=>{switch(h){case A.BLOCK_FOLDED:case A.BLOCK_LITERAL:return i||r?be(o.value,t):Xe(o,t,s,n);case A.QUOTE_DOUBLE:return Pe(o.value,t);case A.QUOTE_SINGLE:return $t(o.value,t);case A.PLAIN:return xn(o,t,s,n);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:h,defaultStringType:u}=t.options,p=i&&h||u;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function Ks(e,t){const s=Object.assign({blockQuote:!0,commentString:Jn,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let n;switch(s.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:n,options:s}}function Gn(e,t){var i,r,o,a;if(t.tag){const l=e.filter(c=>c.tag===t.tag);if(l.length>0)return(i=l.find(c=>c.format===t.format))!=null?i:l[0]}let s,n;if(L(t)){n=t.value;const l=e.filter(c=>{var h;return(h=c.identify)==null?void 0:h.call(c,n)});s=(r=l.find(c=>c.format===t.format))!=null?r:l.find(c=>!c.format)}else n=t,s=e.find(l=>l.nodeClass&&n instanceof l.nodeClass);if(!s){const l=(a=(o=n==null?void 0:n.constructor)==null?void 0:o.name)!=null?a:typeof n;throw new Error(`Tag not resolved for ${l} value`)}return s}function Hn(e,t,{anchors:s,doc:n}){if(!n.directives)return"";const i=[],r=(L(e)||D(e))&&e.anchor;r&&Ds(r)&&(s.add(r),i.push(`&${r}`));const o=e.tag?e.tag:t.default?null:t.tag;return o&&i.push(n.directives.tagString(o)),i.join(" ")}function Oe(e,t,s,n){var l,c;if(_(e))return e.toString(t,s,n);if(fe(e)){if(t.doc.directives)return e.toString(t);if((l=t.resolvedAliases)!=null&&l.has(e))throw new 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;const r=B(e)?e:t.doc.createNode(e,{onTagObj:h=>i=h});i||(i=Gn(t.doc.schema.tags,r));const o=Hn(r,i,t);o.length>0&&(t.indentAtStart=((c=t.indentAtStart)!=null?c:0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,t,s,n):L(r)?Ue(r,t,s,n):r.toString(t,s,n);return o?L(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
34
- ${t.indent}${a}`:a}function Xn({key:e,value:t},s,n,i){var $,S;const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:h,simpleKeys:u}}=s;let p=B(e)&&e.comment||null;if(u){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(D(e)||!B(e)&&typeof e=="object"){const M="With simple keys, collection cannot be used as a key value";throw new Error(M)}}let y=!u&&(!e||p&&t==null&&!s.inFlow||D(e)||(L(e)?e.type===A.BLOCK_FOLDED||e.type===A.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!y&&(u||!r),indent:a+l});let m=!1,f=!1,g=Oe(e,s,()=>m=!0,()=>f=!0);if(!y&&!s.inFlow&&g.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(s.inFlow){if(r||t==null)return m&&n&&n(),g===""?"?":y?`? ${g}`:g}else if(r&&!u||t==null&&y)return g=`? ${g}`,p&&!m?g+=oe(g,s.indent,c(p)):f&&i&&i(),g;m&&(p=null),y?(p&&(g+=oe(g,s.indent,c(p))),g=`? ${g}
35
- ${a}:`):(g=`${g}:`,p&&(g+=oe(g,s.indent,c(p))));let b,w,C;B(t)?(b=!!t.spaceBefore,w=t.commentBefore,C=t.comment):(b=!1,w=null,C=null,t&&typeof t=="object"&&(t=o.createNode(t))),s.implicitKey=!1,!y&&!p&&L(t)&&(s.indentAtStart=g.length+1),f=!1,!h&&l.length>=2&&!s.inFlow&&!y&&Ce(t)&&!t.flow&&!t.tag&&!t.anchor&&(s.indent=s.indent.substring(2));let E=!1;const N=Oe(t,s,()=>E=!0,()=>f=!0);let I=" ";if(p||b||w){if(I=b?`
29
+ ${c}${N}`}function xn(t,e,s,n){const{type:i,value:r}=t,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:h}=e;if(a&&r.includes(`
30
+ `)||h&&/[[\]{},]/.test(r))return be(r,e);if(!r||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||h||!r.includes(`
31
+ `)?be(r,e):Xe(t,e,s,n);if(!a&&!h&&i!==A.PLAIN&&r.includes(`
32
+ `))return Xe(t,e,s,n);if(ft(r)){if(l==="")return e.forceBlockIndent=!0,Xe(t,e,s,n);if(a&&l===c)return be(r,e)}const u=r.replace(/\n+/g,`$&
33
+ ${l}`);if(o){const p=f=>{var g;return f.default&&f.tag!=="tag:yaml.org,2002:str"&&((g=f.test)==null?void 0:g.test(u))},{compat:y,tags:m}=e.doc.schema;if(m.some(p)||y!=null&&y.some(p))return be(r,e)}return a?u:lt(u,l,Fs,ct(e,!1))}function Ue(t,e,s,n){const{implicitKey:i,inFlow:r}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:a}=t;a!==A.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=A.QUOTE_DOUBLE);const l=h=>{switch(h){case A.BLOCK_FOLDED:case A.BLOCK_LITERAL:return i||r?be(o.value,e):Xe(o,e,s,n);case A.QUOTE_DOUBLE:return Pe(o.value,e);case A.QUOTE_SINGLE:return $t(o.value,e);case A.PLAIN:return xn(o,e,s,n);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:h,defaultStringType:u}=e.options,p=i&&h||u;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function Ks(t,e){const s=Object.assign({blockQuote:!0,commentString:Jn,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let n;switch(s.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:n,options:s}}function Gn(t,e){var i,r,o,a;if(e.tag){const l=t.filter(c=>c.tag===e.tag);if(l.length>0)return(i=l.find(c=>c.format===e.format))!=null?i:l[0]}let s,n;if(L(e)){n=e.value;const l=t.filter(c=>{var h;return(h=c.identify)==null?void 0:h.call(c,n)});s=(r=l.find(c=>c.format===e.format))!=null?r:l.find(c=>!c.format)}else n=e,s=t.find(l=>l.nodeClass&&n instanceof l.nodeClass);if(!s){const l=(a=(o=n==null?void 0:n.constructor)==null?void 0:o.name)!=null?a:typeof n;throw new Error(`Tag not resolved for ${l} value`)}return s}function Hn(t,e,{anchors:s,doc:n}){if(!n.directives)return"";const i=[],r=(L(t)||D(t))&&t.anchor;r&&Ds(r)&&(s.add(r),i.push(`&${r}`));const o=t.tag?t.tag:e.default?null:e.tag;return o&&i.push(n.directives.tagString(o)),i.join(" ")}function Oe(t,e,s,n){var l,c;if(_(t))return t.toString(e,s,n);if(fe(t)){if(e.doc.directives)return t.toString(e);if((l=e.resolvedAliases)!=null&&l.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const r=B(t)?t:e.doc.createNode(t,{onTagObj:h=>i=h});i||(i=Gn(e.doc.schema.tags,r));const o=Hn(r,i,e);o.length>0&&(e.indentAtStart=((c=e.indentAtStart)!=null?c:0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,e,s,n):L(r)?Ue(r,e,s,n):r.toString(e,s,n);return o?L(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
34
+ ${e.indent}${a}`:a}function Xn({key:t,value:e},s,n,i){var $,S;const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:h,simpleKeys:u}}=s;let p=B(t)&&t.comment||null;if(u){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(D(t)||!B(t)&&typeof t=="object"){const M="With simple keys, collection cannot be used as a key value";throw new Error(M)}}let y=!u&&(!t||p&&e==null&&!s.inFlow||D(t)||(L(t)?t.type===A.BLOCK_FOLDED||t.type===A.BLOCK_LITERAL:typeof t=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!y&&(u||!r),indent:a+l});let m=!1,f=!1,g=Oe(t,s,()=>m=!0,()=>f=!0);if(!y&&!s.inFlow&&g.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(s.inFlow){if(r||e==null)return m&&n&&n(),g===""?"?":y?`? ${g}`:g}else if(r&&!u||e==null&&y)return g=`? ${g}`,p&&!m?g+=oe(g,s.indent,c(p)):f&&i&&i(),g;m&&(p=null),y?(p&&(g+=oe(g,s.indent,c(p))),g=`? ${g}
35
+ ${a}:`):(g=`${g}:`,p&&(g+=oe(g,s.indent,c(p))));let b,w,C;B(e)?(b=!!e.spaceBefore,w=e.commentBefore,C=e.comment):(b=!1,w=null,C=null,e&&typeof e=="object"&&(e=o.createNode(e))),s.implicitKey=!1,!y&&!p&&L(e)&&(s.indentAtStart=g.length+1),f=!1,!h&&l.length>=2&&!s.inFlow&&!y&&Ce(e)&&!e.flow&&!e.tag&&!e.anchor&&(s.indent=s.indent.substring(2));let E=!1;const N=Oe(e,s,()=>E=!0,()=>f=!0);let I=" ";if(p||b||w){if(I=b?`
36
36
  `:"",w){const M=c(w);I+=`
37
37
  ${X(M,s.indent)}`}N===""&&!s.inFlow?I===`
38
38
  `&&(I=`
39
39
 
40
40
  `):I+=`
41
- ${s.indent}`}else if(!y&&D(t)){const M=N[0],P=N.indexOf(`
42
- `),F=P!==-1,ie=(S=($=s.inFlow)!=null?$:t.flow)!=null?S:t.items.length===0;if(F||!ie){let he=!1;if(F&&(M==="&"||M==="!")){let R=N.indexOf(" ");M==="&"&&R!==-1&&R<P&&N[R+1]==="!"&&(R=N.indexOf(" ",R+1)),(R===-1||P<R)&&(he=!0)}he||(I=`
41
+ ${s.indent}`}else if(!y&&D(e)){const M=N[0],P=N.indexOf(`
42
+ `),F=P!==-1,ie=(S=($=s.inFlow)!=null?$:e.flow)!=null?S:e.items.length===0;if(F||!ie){let he=!1;if(F&&(M==="&"||M==="!")){let R=N.indexOf(" ");M==="&"&&R!==-1&&R<P&&N[R+1]==="!"&&(R=N.indexOf(" ",R+1)),(R===-1||P<R)&&(he=!0)}he||(I=`
43
43
  ${s.indent}`)}}else(N===""||N[0]===`
44
- `)&&(I="");return g+=I+N,s.inFlow?E&&n&&n():C&&!E?g+=oe(g,s.indent,c(C)):f&&i&&i(),g}function js(e,t){(e==="debug"||e==="warn")&&(typeof process!="undefined"&&process.emitWarning?process.emitWarning(t):console.warn(t))}const us="<<";function qs(e,t,{key:s,value:n}){if(e!=null&&e.doc.schema.merge&&Zn(s))if(n=fe(n)?n.resolve(e.doc):n,Ce(n))for(const i of n.items)Et(e,t,i);else if(Array.isArray(n))for(const i of n)Et(e,t,i);else Et(e,t,n);else{const i=Q(s,"",e);if(t instanceof Map)t.set(i,Q(n,i,e));else if(t instanceof Set)t.add(i);else{const r=ei(s,i,e),o=Q(n,r,e);r in t?Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[r]=o}}return t}const Zn=e=>e===us||L(e)&&e.value===us&&(!e.type||e.type===A.PLAIN);function Et(e,t,s){const n=e&&fe(s)?s.resolve(e.doc):s;if(!Ie(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,e,Map);for(const[r,o]of i)t instanceof Map?t.has(r)||t.set(r,o):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function ei(e,t,s){if(t===null)return"";if(typeof t!="object")return String(t);if(B(e)&&(s!=null&&s.doc)){const n=Ks(s.doc,{});n.anchors=new Set;for(const r of s.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=e.toString(n);if(!s.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),js(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return i}return JSON.stringify(t)}function vt(e,t,s){const n=Re(e,void 0,s),i=Re(t,void 0,s);return new q(n,i)}class q{constructor(t,s=null){Object.defineProperty(this,Y,{value:Is}),this.key=t,this.value=s}clone(t){let{key:s,value:n}=this;return B(s)&&(s=s.clone(t)),B(n)&&(n=n.clone(t)),new q(s,n)}toJSON(t,s){const n=s!=null&&s.mapAsMap?new Map:{};return qs(s,n,this)}toString(t,s,n){return t!=null&&t.doc?Xn(this,t,s,n):JSON.stringify(this)}}function zs(e,t,s){var r;return(((r=t.inFlow)!=null?r:e.flow)?si:ti)(e,t,s)}function ti({comment:e,items:t},s,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=s,h=Object.assign({},s,{indent:r,type:null});let u=!1;const p=[];for(let m=0;m<t.length;++m){const f=t[m];let g=null;if(B(f))!u&&f.spaceBefore&&p.push(""),st(s,p,f.commentBefore,u),f.comment&&(g=f.comment);else if(_(f)){const w=B(f.key)?f.key:null;w&&(!u&&w.spaceBefore&&p.push(""),st(s,p,w.commentBefore,u))}u=!1;let b=Oe(f,h,()=>g=null,()=>u=!0);g&&(b+=oe(b,r,c(g))),u&&g&&(u=!1),p.push(n+b)}let y;if(p.length===0)y=i.start+i.end;else{y=p[0];for(let m=1;m<p.length;++m){const f=p[m];y+=f?`
44
+ `)&&(I="");return g+=I+N,s.inFlow?E&&n&&n():C&&!E?g+=oe(g,s.indent,c(C)):f&&i&&i(),g}function js(t,e){(t==="debug"||t==="warn")&&(typeof process!="undefined"&&process.emitWarning?process.emitWarning(e):console.warn(e))}const us="<<";function qs(t,e,{key:s,value:n}){if(t!=null&&t.doc.schema.merge&&Zn(s))if(n=fe(n)?n.resolve(t.doc):n,Ce(n))for(const i of n.items)Et(t,e,i);else if(Array.isArray(n))for(const i of n)Et(t,e,i);else Et(t,e,n);else{const i=Q(s,"",t);if(e instanceof Map)e.set(i,Q(n,i,t));else if(e instanceof Set)e.add(i);else{const r=ei(s,i,t),o=Q(n,r,t);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}const Zn=t=>t===us||L(t)&&t.value===us&&(!t.type||t.type===A.PLAIN);function Et(t,e,s){const n=t&&fe(s)?s.resolve(t.doc):s;if(!Ie(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,t,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function ei(t,e,s){if(e===null)return"";if(typeof e!="object")return String(e);if(B(t)&&(s!=null&&s.doc)){const n=Ks(s.doc,{});n.anchors=new Set;for(const r of s.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=t.toString(n);if(!s.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),js(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return i}return JSON.stringify(e)}function vt(t,e,s){const n=Re(t,void 0,s),i=Re(e,void 0,s);return new q(n,i)}class q{constructor(e,s=null){Object.defineProperty(this,Y,{value:Is}),this.key=e,this.value=s}clone(e){let{key:s,value:n}=this;return B(s)&&(s=s.clone(e)),B(n)&&(n=n.clone(e)),new q(s,n)}toJSON(e,s){const n=s!=null&&s.mapAsMap?new Map:{};return qs(s,n,this)}toString(e,s,n){return e!=null&&e.doc?Xn(this,e,s,n):JSON.stringify(this)}}function zs(t,e,s){var r;return(((r=e.inFlow)!=null?r:t.flow)?si:ti)(t,e,s)}function ti({comment:t,items:e},s,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=s,h=Object.assign({},s,{indent:r,type:null});let u=!1;const p=[];for(let m=0;m<e.length;++m){const f=e[m];let g=null;if(B(f))!u&&f.spaceBefore&&p.push(""),st(s,p,f.commentBefore,u),f.comment&&(g=f.comment);else if(_(f)){const w=B(f.key)?f.key:null;w&&(!u&&w.spaceBefore&&p.push(""),st(s,p,w.commentBefore,u))}u=!1;let b=Oe(f,h,()=>g=null,()=>u=!0);g&&(b+=oe(b,r,c(g))),u&&g&&(u=!1),p.push(n+b)}let y;if(p.length===0)y=i.start+i.end;else{y=p[0];for(let m=1;m<p.length;++m){const f=p[m];y+=f?`
45
45
  ${l}${f}`:`
46
- `}}return e?(y+=`
47
- `+X(c(e),l),a&&a()):u&&o&&o(),y}function si({items:e},t,{flowChars:s,itemIndent:n}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=t;n+=r;const l=Object.assign({},t,{indent:n,inFlow:!0,type:null});let c=!1,h=0;const u=[];for(let m=0;m<e.length;++m){const f=e[m];let g=null;if(B(f))f.spaceBefore&&u.push(""),st(t,u,f.commentBefore,!1),f.comment&&(g=f.comment);else if(_(f)){const w=B(f.key)?f.key:null;w&&(w.spaceBefore&&u.push(""),st(t,u,w.commentBefore,!1),w.comment&&(c=!0));const C=B(f.value)?f.value:null;C?(C.comment&&(g=C.comment),C.commentBefore&&(c=!0)):f.value==null&&(w!=null&&w.comment)&&(g=w.comment)}g&&(c=!0);let b=Oe(f,l,()=>g=null);m<e.length-1&&(b+=","),g&&(b+=oe(b,n,a(g))),!c&&(u.length>h||b.includes(`
48
- `))&&(c=!0),u.push(b),h=u.length}const{start:p,end:y}=s;if(u.length===0)return p+y;if(!c){const m=u.reduce((f,g)=>f+g.length+2,2);c=t.options.lineWidth>0&&m>t.options.lineWidth}if(c){let m=p;for(const f of u)m+=f?`
46
+ `}}return t?(y+=`
47
+ `+X(c(t),l),a&&a()):u&&o&&o(),y}function si({items:t},e,{flowChars:s,itemIndent:n}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;n+=r;const l=Object.assign({},e,{indent:n,inFlow:!0,type:null});let c=!1,h=0;const u=[];for(let m=0;m<t.length;++m){const f=t[m];let g=null;if(B(f))f.spaceBefore&&u.push(""),st(e,u,f.commentBefore,!1),f.comment&&(g=f.comment);else if(_(f)){const w=B(f.key)?f.key:null;w&&(w.spaceBefore&&u.push(""),st(e,u,w.commentBefore,!1),w.comment&&(c=!0));const C=B(f.value)?f.value:null;C?(C.comment&&(g=C.comment),C.commentBefore&&(c=!0)):f.value==null&&(w!=null&&w.comment)&&(g=w.comment)}g&&(c=!0);let b=Oe(f,l,()=>g=null);m<t.length-1&&(b+=","),g&&(b+=oe(b,n,a(g))),!c&&(u.length>h||b.includes(`
48
+ `))&&(c=!0),u.push(b),h=u.length}const{start:p,end:y}=s;if(u.length===0)return p+y;if(!c){const m=u.reduce((f,g)=>f+g.length+2,2);c=e.options.lineWidth>0&&m>e.options.lineWidth}if(c){let m=p;for(const f of u)m+=f?`
49
49
  ${r}${i}${f}`:`
50
50
  `;return`${m}
51
- ${i}${y}`}else return`${p}${o}${u.join(" ")}${o}${y}`}function st({indent:e,options:{commentString:t}},s,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const r=X(t(n),e);s.push(r.trimStart())}}function ae(e,t){const s=L(t)?t.value:t;for(const n of e)if(_(n)&&(n.key===t||n.key===s||L(n.key)&&n.key.value===s))return n}class v extends Rs{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(ee,t),this.items=[]}static from(t,s,n){const{keepUndefined:i,replacer:r}=n,o=new this(t),a=(l,c)=>{if(typeof r=="function")c=r.call(s,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(vt(l,c,n))};if(s instanceof Map)for(const[l,c]of s)a(l,c);else if(s&&typeof s=="object")for(const l of Object.keys(s))a(l,s[l]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,s){var o;let n;_(t)?n=t:!t||typeof t!="object"||!("key"in t)?n=new q(t,t==null?void 0:t.value):n=new q(t.key,t.value);const i=ae(this.items,n.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!s)throw new Error(`Key ${n.key} already set`);L(i.value)&&Bs(n.value)?i.value.value=n.value:i.value=n.value}else if(r){const a=this.items.findIndex(l=>r(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(t){const s=ae(this.items,t);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(t,s){var r;const n=ae(this.items,t),i=n==null?void 0:n.value;return(r=!s&&L(i)?i.value:i)!=null?r:void 0}has(t){return!!ae(this.items,t)}set(t,s){this.add(new q(t,s),!0)}toJSON(t,s,n){const i=n?new n:s!=null&&s.mapAsMap?new Map:{};s!=null&&s.onCreate&&s.onCreate(i);for(const r of this.items)qs(s,i,r);return i}toString(t,s,n){if(!t)return JSON.stringify(this);for(const i of this.items)if(!_(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),zs(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:s})}}const Le={collection:"map",default:!0,nodeClass:v,tag:"tag:yaml.org,2002:map",resolve(e,t){return Ie(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,s)=>v.from(e,t,s)};class se extends Rs{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ne,t),this.items=[]}add(t){this.items.push(t)}delete(t){const s=Ye(t);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(t,s){const n=Ye(t);if(typeof n!="number")return;const i=this.items[n];return!s&&L(i)?i.value:i}has(t){const s=Ye(t);return typeof s=="number"&&s<this.items.length}set(t,s){const n=Ye(t);if(typeof n!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[n];L(i)&&Bs(s)?i.value=s:this.items[n]=s}toJSON(t,s){const n=[];s!=null&&s.onCreate&&s.onCreate(n);let i=0;for(const r of this.items)n.push(Q(r,String(i++),s));return n}toString(t,s,n){return t?zs(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:n,onComment:s}):JSON.stringify(this)}static from(t,s,n){const{replacer:i}=n,r=new this(t);if(s&&Symbol.iterator in Object(s)){let o=0;for(let a of s){if(typeof i=="function"){const l=s instanceof Set?a:String(o++);a=i.call(s,l,a)}r.items.push(Re(a,void 0,n))}}return r}}function Ye(e){let t=L(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const _e={collection:"seq",default:!0,nodeClass:se,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Ce(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,s)=>se.from(e,t,s)},ut={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,s,n){return t=Object.assign({actualString:!0},t),Ue(e,t,s,n)}},ht={identify:e=>e==null,createNode:()=>new A(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new A(null),stringify:({source:e},t)=>typeof e=="string"&&ht.test.test(e)?e:t.options.nullStr},Vt={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new A(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&Vt.test.test(e)){const n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?s.options.trueStr:s.options.falseStr}};function x({format:e,minFractionDigits:t,tag:s,value:n}){if(typeof n=="bigint")return String(n);const i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=JSON.stringify(n);if(!e&&t&&(!s||s==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=t-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const Us={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]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:x},vs={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){const t=Number(e.value);return isFinite(t)?t.toExponential():x(e)}},Vs={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new A(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-s-1),t},stringify:x},dt=e=>typeof e=="bigint"||Number.isInteger(e),Qt=(e,t,s,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),s);function Qs(e,t,s){const{value:n}=e;return dt(n)&&n>=0?s+n.toString(t):x(e)}const Ys={identify:e=>dt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Qt(e,2,8,s),stringify:e=>Qs(e,8,"0o")},Js={identify:dt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Qt(e,0,10,s),stringify:x},Ws={identify:e=>dt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Qt(e,2,16,s),stringify:e=>Qs(e,16,"0x")},ni=[Le,_e,ut,ht,Vt,Ys,Js,Ws,Us,vs,Vs];function hs(e){return typeof e=="bigint"||Number.isInteger(e)}const Je=({value:e})=>JSON.stringify(e),ii=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Je},{identify:e=>e==null,createNode:()=>new A(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Je},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>e==="true",stringify:Je},{identify:hs,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>hs(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:Je}],ri={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},oi=[Le,_e].concat(ii,ri),Yt={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Buffer=="function")return Buffer.from(e,"base64");if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(s.length);for(let i=0;i<s.length;++i)n[i]=s.charCodeAt(i);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},n,i,r){const o=s;let a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t||(t=A.BLOCK_LITERAL),t!==A.QUOTE_DOUBLE){const l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),h=new Array(c);for(let u=0,p=0;u<c;++u,p+=l)h[u]=a.substr(p,l);a=h.join(t===A.BLOCK_LITERAL?`
52
- `:" ")}return Ue({comment:e,type:t,value:a},n,i,r)}};function xs(e,t){var s;if(Ce(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!_(i)){if(Ie(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");const r=i.items[0]||new q(new A(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
51
+ ${i}${y}`}else return`${p}${o}${u.join(" ")}${o}${y}`}function st({indent:t,options:{commentString:e}},s,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const r=X(e(n),t);s.push(r.trimStart())}}function ae(t,e){const s=L(e)?e.value:e;for(const n of t)if(_(n)&&(n.key===e||n.key===s||L(n.key)&&n.key.value===s))return n}class v extends Rs{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ee,e),this.items=[]}static from(e,s,n){const{keepUndefined:i,replacer:r}=n,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(s,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(vt(l,c,n))};if(s instanceof Map)for(const[l,c]of s)a(l,c);else if(s&&typeof s=="object")for(const l of Object.keys(s))a(l,s[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,s){var o;let n;_(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new q(e,e==null?void 0:e.value):n=new q(e.key,e.value);const i=ae(this.items,n.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!s)throw new Error(`Key ${n.key} already set`);L(i.value)&&Bs(n.value)?i.value.value=n.value:i.value=n.value}else if(r){const a=this.items.findIndex(l=>r(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){const s=ae(this.items,e);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(e,s){var r;const n=ae(this.items,e),i=n==null?void 0:n.value;return(r=!s&&L(i)?i.value:i)!=null?r:void 0}has(e){return!!ae(this.items,e)}set(e,s){this.add(new q(e,s),!0)}toJSON(e,s,n){const i=n?new n:s!=null&&s.mapAsMap?new Map:{};s!=null&&s.onCreate&&s.onCreate(i);for(const r of this.items)qs(s,i,r);return i}toString(e,s,n){if(!e)return JSON.stringify(this);for(const i of this.items)if(!_(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),zs(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:s})}}const Le={collection:"map",default:!0,nodeClass:v,tag:"tag:yaml.org,2002:map",resolve(t,e){return Ie(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,s)=>v.from(t,e,s)};class se extends Rs{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ne,e),this.items=[]}add(e){this.items.push(e)}delete(e){const s=Ye(e);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(e,s){const n=Ye(e);if(typeof n!="number")return;const i=this.items[n];return!s&&L(i)?i.value:i}has(e){const s=Ye(e);return typeof s=="number"&&s<this.items.length}set(e,s){const n=Ye(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];L(i)&&Bs(s)?i.value=s:this.items[n]=s}toJSON(e,s){const n=[];s!=null&&s.onCreate&&s.onCreate(n);let i=0;for(const r of this.items)n.push(Q(r,String(i++),s));return n}toString(e,s,n){return e?zs(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:s}):JSON.stringify(this)}static from(e,s,n){const{replacer:i}=n,r=new this(e);if(s&&Symbol.iterator in Object(s)){let o=0;for(let a of s){if(typeof i=="function"){const l=s instanceof Set?a:String(o++);a=i.call(s,l,a)}r.items.push(Re(a,void 0,n))}}return r}}function Ye(t){let e=L(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const _e={collection:"seq",default:!0,nodeClass:se,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Ce(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,s)=>se.from(t,e,s)},ut={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,s,n){return e=Object.assign({actualString:!0},e),Ue(t,e,s,n)}},ht={identify:t=>t==null,createNode:()=>new A(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new A(null),stringify:({source:t},e)=>typeof t=="string"&&ht.test.test(t)?t:e.options.nullStr},Vt={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new A(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},s){if(t&&Vt.test.test(t)){const n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?s.options.trueStr:s.options.falseStr}};function x({format:t,minFractionDigits:e,tag:s,value:n}){if(typeof n=="bigint")return String(n);const i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=JSON.stringify(n);if(!t&&e&&(!s||s==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const Us={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:x},vs={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():x(t)}},Vs={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new A(parseFloat(t)),s=t.indexOf(".");return s!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-s-1),e},stringify:x},dt=t=>typeof t=="bigint"||Number.isInteger(t),Qt=(t,e,s,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),s);function Qs(t,e,s){const{value:n}=t;return dt(n)&&n>=0?s+n.toString(e):x(t)}const Ys={identify:t=>dt(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,s)=>Qt(t,2,8,s),stringify:t=>Qs(t,8,"0o")},Js={identify:dt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,s)=>Qt(t,0,10,s),stringify:x},Ws={identify:t=>dt(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,s)=>Qt(t,2,16,s),stringify:t=>Qs(t,16,"0x")},ni=[Le,_e,ut,ht,Vt,Ys,Js,Ws,Us,vs,Vs];function hs(t){return typeof t=="bigint"||Number.isInteger(t)}const Je=({value:t})=>JSON.stringify(t),ii=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Je},{identify:t=>t==null,createNode:()=>new A(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Je},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:Je},{identify:hs,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:s})=>s?BigInt(t):parseInt(t,10),stringify:({value:t})=>hs(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Je}],ri={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},oi=[Le,_e].concat(ii,ri),Yt={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Buffer=="function")return Buffer.from(t,"base64");if(typeof atob=="function"){const s=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(s.length);for(let i=0;i<s.length;++i)n[i]=s.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:s},n,i,r){const o=s;let a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=A.BLOCK_LITERAL),e!==A.QUOTE_DOUBLE){const l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),h=new Array(c);for(let u=0,p=0;u<c;++u,p+=l)h[u]=a.substr(p,l);a=h.join(e===A.BLOCK_LITERAL?`
52
+ `:" ")}return Ue({comment:t,type:e,value:a},n,i,r)}};function xs(t,e){var s;if(Ce(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!_(i)){if(Ie(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");const r=i.items[0]||new q(new A(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
53
53
  ${r.key.commentBefore}`:i.commentBefore),i.comment){const o=(s=r.value)!=null?s:r.key;o.comment=o.comment?`${i.comment}
54
- ${o.comment}`:i.comment}i=r}e.items[n]=_(i)?i:new q(i)}}else t("Expected a sequence for this tag");return e}function Gs(e,t,s){const{replacer:n}=s,i=new se(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof n=="function"&&(o=n.call(t,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(vt(a,l,s))}return i}const Jt={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:xs,createNode:Gs};class Se extends se{constructor(){super(),this.add=v.prototype.add.bind(this),this.delete=v.prototype.delete.bind(this),this.get=v.prototype.get.bind(this),this.has=v.prototype.has.bind(this),this.set=v.prototype.set.bind(this),this.tag=Se.tag}toJSON(t,s){if(!s)return super.toJSON(t);const n=new Map;s!=null&&s.onCreate&&s.onCreate(n);for(const i of this.items){let r,o;if(_(i)?(r=Q(i.key,"",s),o=Q(i.value,r,s)):r=Q(i,"",s),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(t,s,n){const i=Gs(t,s,n),r=new this;return r.items=i.items,r}}Se.tag="tag:yaml.org,2002:omap";const Wt={collection:"seq",identify:e=>e instanceof Map,nodeClass:Se,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=xs(e,t),n=[];for(const{key:i}of s.items)L(i)&&(n.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Se,s)},createNode:(e,t,s)=>Se.from(e,t,s)};function Hs({value:e,source:t},s){return t&&(e?Xs:Zs).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const Xs={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 A(!0),stringify:Hs},Zs={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 A(!1),stringify:Hs},ai={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]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:x},li={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){const t=Number(e.value);return isFinite(t)?t.toExponential():x(e)}},ci={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new A(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){const n=e.substring(s+1).replace(/_/g,"");n[n.length-1]==="0"&&(t.minFractionDigits=n.length)}return t},stringify:x},ve=e=>typeof e=="bigint"||Number.isInteger(e);function pt(e,t,s,{intAsBigInt:n}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),n){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const r=parseInt(e,s);return i==="-"?-1*r:r}function xt(e,t,s){const{value:n}=e;if(ve(n)){const i=n.toString(t);return n<0?"-"+s+i.substr(1):s+i}return x(e)}const fi={identify:ve,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>pt(e,2,2,s),stringify:e=>xt(e,2,"0b")},ui={identify:ve,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>pt(e,1,8,s),stringify:e=>xt(e,8,"0")},hi={identify:ve,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>pt(e,0,10,s),stringify:x},di={identify:ve,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>pt(e,2,16,s),stringify:e=>xt(e,16,"0x")};class ke extends v{constructor(t){super(t),this.tag=ke.tag}add(t){let s;_(t)?s=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?s=new q(t.key,null):s=new q(t,null),ae(this.items,s.key)||this.items.push(s)}get(t,s){const n=ae(this.items,t);return!s&&_(n)?L(n.key)?n.key.value:n.key:n}set(t,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const n=ae(this.items,t);n&&!s?this.items.splice(this.items.indexOf(n),1):!n&&s&&this.items.push(new q(t))}toJSON(t,s){return super.toJSON(t,s,Set)}toString(t,s,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),s,n);throw new Error("Set items must all have null values")}static from(t,s,n){const{replacer:i}=n,r=new this(t);if(s&&Symbol.iterator in Object(s))for(let o of s)typeof i=="function"&&(o=i.call(s,o,o)),r.items.push(vt(o,null,n));return r}}ke.tag="tag:yaml.org,2002:set";const Gt={collection:"map",identify:e=>e instanceof Set,nodeClass:ke,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>ke.from(e,t,s),resolve(e,t){if(Ie(e)){if(e.hasAllNullValues(!0))return Object.assign(new ke,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Ht(e,t){const s=e[0],n=s==="-"||s==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return s==="-"?i(-1)*r:r}function en(e){let{value:t}=e,s=o=>o;if(typeof t=="bigint")s=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return x(e);let n="";t<0&&(n="-",t*=s(-1));const i=s(60),r=[t%i];return t<60?r.unshift(0):(t=(t-r[0])/i,r.unshift(t%i),t>=60&&(t=(t-r[0])/i,r.unshift(t))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const tn={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:s})=>Ht(e,s),stringify:en},sn={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=>Ht(e,!1),stringify:en},mt={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){const t=e.match(mt.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,n,i,r,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(s,n-1,i,r||0,o||0,a||0,l);const h=t[8];if(h&&h!=="Z"){let u=Ht(h,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},ds=[Le,_e,ut,ht,Xs,Zs,fi,ui,hi,di,ai,li,ci,Yt,Wt,Jt,Gt,tn,sn,mt],ps=new Map([["core",ni],["failsafe",[Le,_e,ut]],["json",oi],["yaml11",ds],["yaml-1.1",ds]]),ms={binary:Yt,bool:Vt,float:Vs,floatExp:vs,floatNaN:Us,floatTime:sn,int:Js,intHex:Ws,intOct:Ys,intTime:tn,map:Le,null:ht,omap:Wt,pairs:Jt,seq:_e,set:Gt,timestamp:mt},pi={"tag:yaml.org,2002:binary":Yt,"tag:yaml.org,2002:omap":Wt,"tag:yaml.org,2002:pairs":Jt,"tag:yaml.org,2002:set":Gt,"tag:yaml.org,2002:timestamp":mt};function At(e,t){let s=ps.get(t);if(!s)if(Array.isArray(e))s=[];else{const n=Array.from(ps.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${n} or define customTags array`)}if(Array.isArray(e))for(const n of e)s=s.concat(n);else typeof e=="function"&&(s=e(s.slice()));return s.map(n=>{if(typeof n!="string")return n;const i=ms[n];if(i)return i;const r=Object.keys(ms).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${r}`)})}const mi=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class yt{constructor({compat:t,customTags:s,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?At(t,"compat"):t?At(null,t):null,this.merge=!!n,this.name=typeof r=="string"&&r||"core",this.knownTags=i?pi:{},this.tags=At(s,this.name),this.toStringOptions=a!=null?a:null,Object.defineProperty(this,ee,{value:Le}),Object.defineProperty(this,Z,{value:ut}),Object.defineProperty(this,Ne,{value:_e}),this.sortMapEntries=typeof o=="function"?o:o===!0?mi:null}clone(){const t=Object.create(yt.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function yi(e,t){var l;const s=[];let n=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(s.push(c),n=!0):e.directives.docStart&&(n=!0)}n&&s.push("---");const i=Ks(e,t),{commentString:r}=i.options;if(e.commentBefore){s.length!==1&&s.unshift("");const c=r(e.commentBefore);s.unshift(X(c,""))}let o=!1,a=null;if(e.contents){if(B(e.contents)){if(e.contents.spaceBefore&&n&&s.push(""),e.contents.commentBefore){const u=r(e.contents.commentBefore);s.push(X(u,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}const c=a?void 0:()=>o=!0;let h=Oe(e.contents,i,()=>a=null,c);a&&(h+=oe(h,"",r(a))),(h[0]==="|"||h[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${h}`:s.push(h)}else s.push(Oe(e.contents,i));if((l=e.directives)!=null&&l.docEnd)if(e.comment){const c=r(e.comment);c.includes(`
55
- `)?(s.push("..."),s.push(X(c,""))):s.push(`... ${c}`)}else s.push("...");else{let c=e.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&s[s.length-1]!==""&&s.push(""),s.push(X(r(c),"")))}return s.join(`
54
+ ${o.comment}`:i.comment}i=r}t.items[n]=_(i)?i:new q(i)}}else e("Expected a sequence for this tag");return t}function Gs(t,e,s){const{replacer:n}=s,i=new se(t);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(vt(a,l,s))}return i}const Jt={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:xs,createNode:Gs};class Se extends se{constructor(){super(),this.add=v.prototype.add.bind(this),this.delete=v.prototype.delete.bind(this),this.get=v.prototype.get.bind(this),this.has=v.prototype.has.bind(this),this.set=v.prototype.set.bind(this),this.tag=Se.tag}toJSON(e,s){if(!s)return super.toJSON(e);const n=new Map;s!=null&&s.onCreate&&s.onCreate(n);for(const i of this.items){let r,o;if(_(i)?(r=Q(i.key,"",s),o=Q(i.value,r,s)):r=Q(i,"",s),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,s,n){const i=Gs(e,s,n),r=new this;return r.items=i.items,r}}Se.tag="tag:yaml.org,2002:omap";const Wt={collection:"seq",identify:t=>t instanceof Map,nodeClass:Se,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const s=xs(t,e),n=[];for(const{key:i}of s.items)L(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Se,s)},createNode:(t,e,s)=>Se.from(t,e,s)};function Hs({value:t,source:e},s){return e&&(t?Xs:Zs).test.test(e)?e:t?s.options.trueStr:s.options.falseStr}const Xs={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new A(!0),stringify:Hs},Zs={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new A(!1),stringify:Hs},ai={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:x},li={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():x(t)}},ci={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new A(parseFloat(t.replace(/_/g,""))),s=t.indexOf(".");if(s!==-1){const n=t.substring(s+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:x},ve=t=>typeof t=="bigint"||Number.isInteger(t);function pt(t,e,s,{intAsBigInt:n}){const i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(s){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const o=BigInt(t);return i==="-"?BigInt(-1)*o:o}const r=parseInt(t,s);return i==="-"?-1*r:r}function xt(t,e,s){const{value:n}=t;if(ve(n)){const i=n.toString(e);return n<0?"-"+s+i.substr(1):s+i}return x(t)}const fi={identify:ve,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,s)=>pt(t,2,2,s),stringify:t=>xt(t,2,"0b")},ui={identify:ve,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,s)=>pt(t,1,8,s),stringify:t=>xt(t,8,"0")},hi={identify:ve,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,s)=>pt(t,0,10,s),stringify:x},di={identify:ve,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,s)=>pt(t,2,16,s),stringify:t=>xt(t,16,"0x")};class ke extends v{constructor(e){super(e),this.tag=ke.tag}add(e){let s;_(e)?s=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?s=new q(e.key,null):s=new q(e,null),ae(this.items,s.key)||this.items.push(s)}get(e,s){const n=ae(this.items,e);return!s&&_(n)?L(n.key)?n.key.value:n.key:n}set(e,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const n=ae(this.items,e);n&&!s?this.items.splice(this.items.indexOf(n),1):!n&&s&&this.items.push(new q(e))}toJSON(e,s){return super.toJSON(e,s,Set)}toString(e,s,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),s,n);throw new Error("Set items must all have null values")}static from(e,s,n){const{replacer:i}=n,r=new this(e);if(s&&Symbol.iterator in Object(s))for(let o of s)typeof i=="function"&&(o=i.call(s,o,o)),r.items.push(vt(o,null,n));return r}}ke.tag="tag:yaml.org,2002:set";const Gt={collection:"map",identify:t=>t instanceof Set,nodeClass:ke,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,s)=>ke.from(t,e,s),resolve(t,e){if(Ie(t)){if(t.hasAllNullValues(!0))return Object.assign(new ke,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function Ht(t,e){const s=t[0],n=s==="-"||s==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return s==="-"?i(-1)*r:r}function en(t){let{value:e}=t,s=o=>o;if(typeof e=="bigint")s=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return x(t);let n="";e<0&&(n="-",e*=s(-1));const i=s(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const tn={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:s})=>Ht(t,s),stringify:en},sn={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Ht(t,!1),stringify:en},mt={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(mt.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(s,n-1,i,r||0,o||0,a||0,l);const h=e[8];if(h&&h!=="Z"){let u=Ht(h,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},ds=[Le,_e,ut,ht,Xs,Zs,fi,ui,hi,di,ai,li,ci,Yt,Wt,Jt,Gt,tn,sn,mt],ps=new Map([["core",ni],["failsafe",[Le,_e,ut]],["json",oi],["yaml11",ds],["yaml-1.1",ds]]),ms={binary:Yt,bool:Vt,float:Vs,floatExp:vs,floatNaN:Us,floatTime:sn,int:Js,intHex:Ws,intOct:Ys,intTime:tn,map:Le,null:ht,omap:Wt,pairs:Jt,seq:_e,set:Gt,timestamp:mt},pi={"tag:yaml.org,2002:binary":Yt,"tag:yaml.org,2002:omap":Wt,"tag:yaml.org,2002:pairs":Jt,"tag:yaml.org,2002:set":Gt,"tag:yaml.org,2002:timestamp":mt};function At(t,e){let s=ps.get(e);if(!s)if(Array.isArray(t))s=[];else{const n=Array.from(ps.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${n} or define customTags array`)}if(Array.isArray(t))for(const n of t)s=s.concat(n);else typeof t=="function"&&(s=t(s.slice()));return s.map(n=>{if(typeof n!="string")return n;const i=ms[n];if(i)return i;const r=Object.keys(ms).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${r}`)})}const mi=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0;class yt{constructor({compat:e,customTags:s,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?At(e,"compat"):e?At(null,e):null,this.merge=!!n,this.name=typeof r=="string"&&r||"core",this.knownTags=i?pi:{},this.tags=At(s,this.name),this.toStringOptions=a!=null?a:null,Object.defineProperty(this,ee,{value:Le}),Object.defineProperty(this,Z,{value:ut}),Object.defineProperty(this,Ne,{value:_e}),this.sortMapEntries=typeof o=="function"?o:o===!0?mi:null}clone(){const e=Object.create(yt.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function yi(t,e){var l;const s=[];let n=e.directives===!0;if(e.directives!==!1&&t.directives){const c=t.directives.toString(t);c?(s.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&s.push("---");const i=Ks(t,e),{commentString:r}=i.options;if(t.commentBefore){s.length!==1&&s.unshift("");const c=r(t.commentBefore);s.unshift(X(c,""))}let o=!1,a=null;if(t.contents){if(B(t.contents)){if(t.contents.spaceBefore&&n&&s.push(""),t.contents.commentBefore){const u=r(t.contents.commentBefore);s.push(X(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}const c=a?void 0:()=>o=!0;let h=Oe(t.contents,i,()=>a=null,c);a&&(h+=oe(h,"",r(a))),(h[0]==="|"||h[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${h}`:s.push(h)}else s.push(Oe(t.contents,i));if((l=t.directives)!=null&&l.docEnd)if(t.comment){const c=r(t.comment);c.includes(`
55
+ `)?(s.push("..."),s.push(X(c,""))):s.push(`... ${c}`)}else s.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&s[s.length-1]!==""&&s.push(""),s.push(X(r(c),"")))}return s.join(`
56
56
  `)+`
57
- `}class Me{constructor(t,s,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Y,{value:Mt});let i=null;typeof s=="function"||Array.isArray(s)?i=s:n===void 0&&s&&(n=s,s=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new z({version:o}),this.setSchema(o,n),this.contents=t===void 0?null:this.createNode(t,i,n)}clone(){const t=Object.create(Me.prototype,{[Y]:{value:Mt}});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=B(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){de(this.contents)&&this.contents.add(t)}addIn(t,s){de(this.contents)&&this.contents.addIn(t,s)}createAlias(t,s){if(!t.anchor){const n=$s(this);t.anchor=!s||n.has(s)?Ps(s||"a",n):s}return new at(t.anchor)}createNode(t,s,n){let i;if(typeof s=="function")t=s.call({"":t},"",t),i=s;else if(Array.isArray(s)){const g=w=>typeof w=="number"||w instanceof String||w instanceof Number,b=s.filter(g).map(String);b.length>0&&(s=s.concat(b)),i=s}else n===void 0&&s&&(n=s,s=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:h}=n!=null?n:{},{onAnchor:u,setAnchors:p,sourceObjects:y}=Vn(this,o||"a"),m={aliasDuplicateObjects:r!=null?r:!0,keepUndefined:l!=null?l:!1,onAnchor:u,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:y},f=Re(t,h,m);return a&&D(f)&&(f.flow=!0),p(),f}createPair(t,s,n={}){const i=this.createNode(t,null,n),r=this.createNode(s,null,n);return new q(i,r)}delete(t){return de(this.contents)?this.contents.delete(t):!1}deleteIn(t){return $e(t)?this.contents==null?!1:(this.contents=null,!0):de(this.contents)?this.contents.deleteIn(t):!1}get(t,s){return D(this.contents)?this.contents.get(t,s):void 0}getIn(t,s){return $e(t)?!s&&L(this.contents)?this.contents.value:this.contents:D(this.contents)?this.contents.getIn(t,s):void 0}has(t){return D(this.contents)?this.contents.has(t):!1}hasIn(t){return $e(t)?this.contents!==void 0:D(this.contents)?this.contents.hasIn(t):!1}set(t,s){this.contents==null?this.contents=tt(this.schema,[t],s):de(this.contents)&&this.contents.set(t,s)}setIn(t,s){$e(t)?this.contents=s:this.contents==null?this.contents=tt(this.schema,Array.from(t),s):de(this.contents)&&this.contents.setIn(t,s)}setSchema(t,s={}){typeof t=="number"&&(t=String(t));let n;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new z({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new z({version:t}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(n)this.schema=new yt(Object.assign(n,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:s,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Q(this.contents,s!=null?s:"",a);if(typeof r=="function")for(const{count:c,res:h}of a.anchors.values())r(h,c);return typeof o=="function"?ge(o,{"":l},"",l):l}toJSON(t,s){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:s})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const s=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return yi(this,t)}}function de(e){if(D(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Xt extends Error{constructor(t,s,n,i){super(),this.name=t,this.code=n,this.message=i,this.pos=s}}class le extends Xt{constructor(t,s,n){super("YAMLParseError",t,s,n)}}class nn extends Xt{constructor(t,s,n){super("YAMLWarning",t,s,n)}}const nt=(e,t)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(a=>t.linePos(a));const{line:n,col:i}=s.linePos[0];s.message+=` at line ${n}, column ${i}`;let r=i-1,o=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,r))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
57
+ `}class Me{constructor(e,s,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Y,{value:Mt});let i=null;typeof s=="function"||Array.isArray(s)?i=s:n===void 0&&s&&(n=s,s=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new z({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){const e=Object.create(Me.prototype,{[Y]:{value:Mt}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=B(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){de(this.contents)&&this.contents.add(e)}addIn(e,s){de(this.contents)&&this.contents.addIn(e,s)}createAlias(e,s){if(!e.anchor){const n=$s(this);e.anchor=!s||n.has(s)?Ps(s||"a",n):s}return new at(e.anchor)}createNode(e,s,n){let i;if(typeof s=="function")e=s.call({"":e},"",e),i=s;else if(Array.isArray(s)){const g=w=>typeof w=="number"||w instanceof String||w instanceof Number,b=s.filter(g).map(String);b.length>0&&(s=s.concat(b)),i=s}else n===void 0&&s&&(n=s,s=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:h}=n!=null?n:{},{onAnchor:u,setAnchors:p,sourceObjects:y}=Vn(this,o||"a"),m={aliasDuplicateObjects:r!=null?r:!0,keepUndefined:l!=null?l:!1,onAnchor:u,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:y},f=Re(e,h,m);return a&&D(f)&&(f.flow=!0),p(),f}createPair(e,s,n={}){const i=this.createNode(e,null,n),r=this.createNode(s,null,n);return new q(i,r)}delete(e){return de(this.contents)?this.contents.delete(e):!1}deleteIn(e){return $e(e)?this.contents==null?!1:(this.contents=null,!0):de(this.contents)?this.contents.deleteIn(e):!1}get(e,s){return D(this.contents)?this.contents.get(e,s):void 0}getIn(e,s){return $e(e)?!s&&L(this.contents)?this.contents.value:this.contents:D(this.contents)?this.contents.getIn(e,s):void 0}has(e){return D(this.contents)?this.contents.has(e):!1}hasIn(e){return $e(e)?this.contents!==void 0:D(this.contents)?this.contents.hasIn(e):!1}set(e,s){this.contents==null?this.contents=tt(this.schema,[e],s):de(this.contents)&&this.contents.set(e,s)}setIn(e,s){$e(e)?this.contents=s:this.contents==null?this.contents=tt(this.schema,Array.from(e),s):de(this.contents)&&this.contents.setIn(e,s)}setSchema(e,s={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new z({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new z({version:e}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(n)this.schema=new yt(Object.assign(n,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:s,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Q(this.contents,s!=null?s:"",a);if(typeof r=="function")for(const{count:c,res:h}of a.anchors.values())r(h,c);return typeof o=="function"?ge(o,{"":l},"",l):l}toJSON(e,s){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:s})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const s=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return yi(this,e)}}function de(t){if(D(t))return!0;throw new Error("Expected a YAML collection as document contents")}class Xt extends Error{constructor(e,s,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=s}}class le extends Xt{constructor(e,s,n){super("YAMLParseError",e,s,n)}}class nn extends Xt{constructor(e,s,n){super("YAMLWarning",e,s,n)}}const nt=(t,e)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(a=>e.linePos(a));const{line:n,col:i}=s.linePos[0];s.message+=` at line ${n}, column ${i}`;let r=i-1,o=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,r))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
58
58
  `),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=s.linePos[1];l&&l.line===n&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(a);s.message+=`:
59
59
 
60
60
  ${o}
61
61
  ${c}
62
- `}};function Ee(e,{flow:t,indicator:s,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,h=a,u="",p="",y=!1,m=!1,f=null,g=null,b=null,w=null,C=null,E=null,N=null;for(const S of e)switch(m&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&r(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),f&&(c&&S.type!=="comment"&&S.type!=="newline"&&r(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),f=null),S.type){case"space":!t&&(s!=="doc-start"||(n==null?void 0:n.type)!=="flow-collection")&&S.source.includes(" ")&&(f=S),h=!0;break;case"comment":{h||r(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const M=S.source.substring(1)||" ";u?u+=p+M:u=M,p="",c=!1;break}case"newline":c?u?u+=S.source:l=!0:p+=S.source,c=!0,y=!0,(g||b)&&(w=S),h=!0;break;case"anchor":g&&r(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&r(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=S,N===null&&(N=S.offset),c=!1,h=!1,m=!0;break;case"tag":{b&&r(S,"MULTIPLE_TAGS","A node can have at most one tag"),b=S,N===null&&(N=S.offset),c=!1,h=!1,m=!0;break}case s:(g||b)&&r(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),E&&r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${t!=null?t:"collection"}`),E=S,c=s==="seq-item-ind"||s==="explicit-key-ind",h=!1;break;case"comma":if(t){C&&r(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),C=S,c=!1,h=!1;break}default:r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),c=!1,h=!1}const I=e[e.length-1],$=I?I.offset+I.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f&&(c&&f.indent<=o||(n==null?void 0:n.type)==="block-map"||(n==null?void 0:n.type)==="block-seq")&&r(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:C,found:E,spaceBefore:l,comment:u,hasNewline:y,anchor:g,tag:b,newlineAfterProp:w,end:$,start:N!=null?N:$}}function Fe(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
63
- `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const s of t.start)if(s.type==="newline")return!0;if(t.sep){for(const s of t.sep)if(s.type==="newline")return!0}if(Fe(t.key)||Fe(t.value))return!0}return!1;default:return!0}}function Bt(e,t,s){if((t==null?void 0:t.type)==="flow-collection"){const n=t.end[0];n.indent===e&&(n.source==="]"||n.source==="}")&&Fe(t)&&s(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function rn(e,t,s){const{uniqueKeys:n}=e.options;if(n===!1)return!1;const i=typeof n=="function"?n:(r,o)=>r===o||L(r)&&L(o)&&r.value===o.value&&!(r.value==="<<"&&e.schema.merge);return t.some(r=>i(r.key,s))}const ys="All mapping items must start at the same column";function gi({composeNode:e,composeEmptyNode:t},s,n,i,r){var h,u;const o=(h=r==null?void 0:r.nodeClass)!=null?h:v,a=new o(s.schema);s.atRoot&&(s.atRoot=!1);let l=n.offset,c=null;for(const p of n.items){const{start:y,key:m,sep:f,value:g}=p,b=Ee(y,{indicator:"explicit-key-ind",next:m!=null?m:f==null?void 0:f[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),w=!b.found;if(w){if(m&&(m.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==n.indent&&i(l,"BAD_INDENT",ys)),!b.anchor&&!b.tag&&!f){c=b.end,b.comment&&(a.comment?a.comment+=`
64
- `+b.comment:a.comment=b.comment);continue}(b.newlineAfterProp||Fe(m))&&i(m!=null?m:y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((u=b.found)==null?void 0:u.indent)!==n.indent&&i(l,"BAD_INDENT",ys);const C=b.end,E=m?e(s,m,b,i):t(s,C,y,null,b,i);s.schema.compat&&Bt(n.indent,m,i),rn(s,a.items,E)&&i(C,"DUPLICATE_KEY","Map keys must be unique");const N=Ee(f!=null?f:[],{indicator:"map-value-ind",next:g,offset:E.range[2],onError:i,parentIndent:n.indent,startOnNewline:!m||m.type==="block-scalar"});if(l=N.end,N.found){w&&((g==null?void 0:g.type)==="block-map"&&!N.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&b.start<N.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const I=g?e(s,g,N,i):t(s,l,f,null,N,i);s.schema.compat&&Bt(n.indent,g,i),l=I.range[2];const $=new q(E,I);s.options.keepSourceTokens&&($.srcToken=p),a.items.push($)}else{w&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),N.comment&&(E.comment?E.comment+=`
65
- `+N.comment:E.comment=N.comment);const I=new q(E);s.options.keepSourceTokens&&(I.srcToken=p),a.items.push(I)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c!=null?c:l],a}function bi({composeNode:e,composeEmptyNode:t},s,n,i,r){var h;const o=(h=r==null?void 0:r.nodeClass)!=null?h:se,a=new o(s.schema);s.atRoot&&(s.atRoot=!1);let l=n.offset,c=null;for(const{start:u,value:p}of n.items){const y=Ee(u,{indicator:"seq-item-ind",next:p,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||p)p&&p.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=y.end,y.comment&&(a.comment=y.comment);continue}const m=p?e(s,p,y,i):t(s,y.end,u,null,y,i);s.schema.compat&&Bt(n.indent,p,i),l=m.range[2],a.items.push(m)}return a.range=[n.offset,l,c!=null?c:l],a}function Ve(e,t,s,n){let i="";if(e){let r=!1,o="";for(const a of e){const{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{s&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const h=l.substring(1)||" ";i?i+=o+h:i=h,o="";break}case"newline":i&&(o+=l),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:i,offset:t}}const Nt="Block collections are not allowed within flow collections",Tt=e=>e&&(e.type==="block-map"||e.type==="block-seq");function wi({composeNode:e,composeEmptyNode:t},s,n,i,r){var g,b;const o=n.start.source==="{",a=o?"flow map":"flow sequence",l=(g=r==null?void 0:r.nodeClass)!=null?g:o?v:se,c=new l(s.schema);c.flow=!0;const h=s.atRoot;h&&(s.atRoot=!1);let u=n.offset+n.start.source.length;for(let w=0;w<n.items.length;++w){const C=n.items[w],{start:E,key:N,sep:I,value:$}=C,S=Ee(E,{flow:a,indicator:"explicit-key-ind",next:N!=null?N:I==null?void 0:I[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!I&&!$){w===0&&S.comma?i(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):w<n.items.length-1&&i(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),S.comment&&(c.comment?c.comment+=`
62
+ `}};function Ee(t,{flow:e,indicator:s,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,h=a,u="",p="",y=!1,m=!1,f=null,g=null,b=null,w=null,C=null,E=null,N=null;for(const S of t)switch(m&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&r(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),f&&(c&&S.type!=="comment"&&S.type!=="newline"&&r(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),f=null),S.type){case"space":!e&&(s!=="doc-start"||(n==null?void 0:n.type)!=="flow-collection")&&S.source.includes(" ")&&(f=S),h=!0;break;case"comment":{h||r(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const M=S.source.substring(1)||" ";u?u+=p+M:u=M,p="",c=!1;break}case"newline":c?u?u+=S.source:l=!0:p+=S.source,c=!0,y=!0,(g||b)&&(w=S),h=!0;break;case"anchor":g&&r(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&r(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=S,N===null&&(N=S.offset),c=!1,h=!1,m=!0;break;case"tag":{b&&r(S,"MULTIPLE_TAGS","A node can have at most one tag"),b=S,N===null&&(N=S.offset),c=!1,h=!1,m=!0;break}case s:(g||b)&&r(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),E&&r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${e!=null?e:"collection"}`),E=S,c=s==="seq-item-ind"||s==="explicit-key-ind",h=!1;break;case"comma":if(e){C&&r(S,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),C=S,c=!1,h=!1;break}default:r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),c=!1,h=!1}const I=t[t.length-1],$=I?I.offset+I.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f&&(c&&f.indent<=o||(n==null?void 0:n.type)==="block-map"||(n==null?void 0:n.type)==="block-seq")&&r(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:C,found:E,spaceBefore:l,comment:u,hasNewline:y,anchor:g,tag:b,newlineAfterProp:w,end:$,start:N!=null?N:$}}function Fe(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
63
+ `))return!0;if(t.end){for(const e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of t.items){for(const s of e.start)if(s.type==="newline")return!0;if(e.sep){for(const s of e.sep)if(s.type==="newline")return!0}if(Fe(e.key)||Fe(e.value))return!0}return!1;default:return!0}}function Bt(t,e,s){if((e==null?void 0:e.type)==="flow-collection"){const n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Fe(e)&&s(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function rn(t,e,s){const{uniqueKeys:n}=t.options;if(n===!1)return!1;const i=typeof n=="function"?n:(r,o)=>r===o||L(r)&&L(o)&&r.value===o.value&&!(r.value==="<<"&&t.schema.merge);return e.some(r=>i(r.key,s))}const ys="All mapping items must start at the same column";function gi({composeNode:t,composeEmptyNode:e},s,n,i,r){var h,u;const o=(h=r==null?void 0:r.nodeClass)!=null?h:v,a=new o(s.schema);s.atRoot&&(s.atRoot=!1);let l=n.offset,c=null;for(const p of n.items){const{start:y,key:m,sep:f,value:g}=p,b=Ee(y,{indicator:"explicit-key-ind",next:m!=null?m:f==null?void 0:f[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),w=!b.found;if(w){if(m&&(m.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==n.indent&&i(l,"BAD_INDENT",ys)),!b.anchor&&!b.tag&&!f){c=b.end,b.comment&&(a.comment?a.comment+=`
64
+ `+b.comment:a.comment=b.comment);continue}(b.newlineAfterProp||Fe(m))&&i(m!=null?m:y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((u=b.found)==null?void 0:u.indent)!==n.indent&&i(l,"BAD_INDENT",ys);const C=b.end,E=m?t(s,m,b,i):e(s,C,y,null,b,i);s.schema.compat&&Bt(n.indent,m,i),rn(s,a.items,E)&&i(C,"DUPLICATE_KEY","Map keys must be unique");const N=Ee(f!=null?f:[],{indicator:"map-value-ind",next:g,offset:E.range[2],onError:i,parentIndent:n.indent,startOnNewline:!m||m.type==="block-scalar"});if(l=N.end,N.found){w&&((g==null?void 0:g.type)==="block-map"&&!N.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&b.start<N.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const I=g?t(s,g,N,i):e(s,l,f,null,N,i);s.schema.compat&&Bt(n.indent,g,i),l=I.range[2];const $=new q(E,I);s.options.keepSourceTokens&&($.srcToken=p),a.items.push($)}else{w&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),N.comment&&(E.comment?E.comment+=`
65
+ `+N.comment:E.comment=N.comment);const I=new q(E);s.options.keepSourceTokens&&(I.srcToken=p),a.items.push(I)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c!=null?c:l],a}function bi({composeNode:t,composeEmptyNode:e},s,n,i,r){var h;const o=(h=r==null?void 0:r.nodeClass)!=null?h:se,a=new o(s.schema);s.atRoot&&(s.atRoot=!1);let l=n.offset,c=null;for(const{start:u,value:p}of n.items){const y=Ee(u,{indicator:"seq-item-ind",next:p,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||p)p&&p.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=y.end,y.comment&&(a.comment=y.comment);continue}const m=p?t(s,p,y,i):e(s,y.end,u,null,y,i);s.schema.compat&&Bt(n.indent,p,i),l=m.range[2],a.items.push(m)}return a.range=[n.offset,l,c!=null?c:l],a}function Ve(t,e,s,n){let i="";if(t){let r=!1,o="";for(const a of t){const{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{s&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const h=l.substring(1)||" ";i?i+=o+h:i=h,o="";break}case"newline":i&&(o+=l),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}const Nt="Block collections are not allowed within flow collections",Tt=t=>t&&(t.type==="block-map"||t.type==="block-seq");function wi({composeNode:t,composeEmptyNode:e},s,n,i,r){var g,b;const o=n.start.source==="{",a=o?"flow map":"flow sequence",l=(g=r==null?void 0:r.nodeClass)!=null?g:o?v:se,c=new l(s.schema);c.flow=!0;const h=s.atRoot;h&&(s.atRoot=!1);let u=n.offset+n.start.source.length;for(let w=0;w<n.items.length;++w){const C=n.items[w],{start:E,key:N,sep:I,value:$}=C,S=Ee(E,{flow:a,indicator:"explicit-key-ind",next:N!=null?N:I==null?void 0:I[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!I&&!$){w===0&&S.comma?i(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):w<n.items.length-1&&i(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),S.comment&&(c.comment?c.comment+=`
66
66
  `+S.comment:c.comment=S.comment),u=S.end;continue}!o&&s.options.strict&&Fe(N)&&i(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(w===0)S.comma&&i(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(S.comma||i(S.start,"MISSING_CHAR",`Missing , between ${a} items`),S.comment){let M="";e:for(const P of E)switch(P.type){case"comma":case"space":break;case"comment":M=P.source.substring(1);break e;default:break e}if(M){let P=c.items[c.items.length-1];_(P)&&(P=(b=P.value)!=null?b:P.key),P.comment?P.comment+=`
67
- `+M:P.comment=M,S.comment=S.comment.substring(M.length+1)}}if(!o&&!I&&!S.found){const M=$?e(s,$,S,i):t(s,S.end,I,null,S,i);c.items.push(M),u=M.range[2],Tt($)&&i(M.range,"BLOCK_IN_FLOW",Nt)}else{const M=S.end,P=N?e(s,N,S,i):t(s,M,E,null,S,i);Tt(N)&&i(P.range,"BLOCK_IN_FLOW",Nt);const F=Ee(I!=null?I:[],{flow:a,indicator:"map-value-ind",next:$,offset:P.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(F.found){if(!o&&!S.found&&s.options.strict){if(I)for(const R of I){if(R===F.found)break;if(R.type==="newline"){i(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<F.found.offset-1024&&i(F.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else $&&("source"in $&&$.source&&$.source[0]===":"?i($,"MISSING_CHAR",`Missing space after : in ${a}`):i(F.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const ie=$?e(s,$,F,i):F.found?t(s,F.end,I,null,F,i):null;ie?Tt($)&&i(ie.range,"BLOCK_IN_FLOW",Nt):F.comment&&(P.comment?P.comment+=`
67
+ `+M:P.comment=M,S.comment=S.comment.substring(M.length+1)}}if(!o&&!I&&!S.found){const M=$?t(s,$,S,i):e(s,S.end,I,null,S,i);c.items.push(M),u=M.range[2],Tt($)&&i(M.range,"BLOCK_IN_FLOW",Nt)}else{const M=S.end,P=N?t(s,N,S,i):e(s,M,E,null,S,i);Tt(N)&&i(P.range,"BLOCK_IN_FLOW",Nt);const F=Ee(I!=null?I:[],{flow:a,indicator:"map-value-ind",next:$,offset:P.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(F.found){if(!o&&!S.found&&s.options.strict){if(I)for(const R of I){if(R===F.found)break;if(R.type==="newline"){i(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<F.found.offset-1024&&i(F.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else $&&("source"in $&&$.source&&$.source[0]===":"?i($,"MISSING_CHAR",`Missing space after : in ${a}`):i(F.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const ie=$?t(s,$,F,i):F.found?e(s,F.end,I,null,F,i):null;ie?Tt($)&&i(ie.range,"BLOCK_IN_FLOW",Nt):F.comment&&(P.comment?P.comment+=`
68
68
  `+F.comment:P.comment=F.comment);const he=new q(P,ie);if(s.options.keepSourceTokens&&(he.srcToken=C),o){const R=c;rn(s,R.items,P)&&i(M,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(he)}else{const R=new v(s.schema);R.flow=!0,R.items.push(he),c.items.push(R)}u=ie?ie.range[2]:F.end}}const p=o?"}":"]",[y,...m]=n.end;let f=u;if(y&&y.source===p)f=y.offset+y.source.length;else{const w=a[0].toUpperCase()+a.substring(1),C=h?`${w} must end with a ${p}`:`${w} in block collection must be sufficiently indented and end with a ${p}`;i(u,h?"MISSING_CHAR":"BAD_INDENT",C),y&&y.source.length!==1&&m.unshift(y)}if(m.length>0){const w=Ve(m,f,s.options.strict,i);w.comment&&(c.comment?c.comment+=`
69
- `+w.comment:c.comment=w.comment),c.range=[n.offset,f,w.offset]}else c.range=[n.offset,f,f];return c}function It(e,t,s,n,i,r){const o=s.type==="block-map"?gi(e,t,s,n,r):s.type==="block-seq"?bi(e,t,s,n,r):wi(e,t,s,n,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function Si(e,t,s,n,i){var p,y;const r=n.tag,o=r?t.directives.tagName(r.source,m=>i(r,"TAG_RESOLVE_FAILED",m)):null;if(s.type==="block-seq"){const{anchor:m,newlineAfterProp:f}=n,g=m&&r?m.offset>r.offset?m:r:m!=null?m:r;g&&(!f||f.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}const a=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===v.tagName&&a==="map"||o===se.tagName&&a==="seq")return It(e,t,s,i,o);let l=t.schema.tags.find(m=>m.tag===o&&m.collection===a);if(!l){const m=t.schema.knownTags[o];if(m&&m.collection===a)t.schema.tags.push(Object.assign({},m,{default:!1})),l=m;else return m!=null&&m.collection?i(r,"BAD_COLLECTION_TYPE",`${m.tag} used for ${a} collection, but expects ${m.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),It(e,t,s,i,o)}const c=It(e,t,s,i,o,l),h=(y=(p=l.resolve)==null?void 0:p.call(l,c,m=>i(r,"TAG_RESOLVE_FAILED",m),t.options))!=null?y:c,u=B(h)?h:new A(h);return u.range=c.range,u.tag=o,l!=null&&l.format&&(u.format=l.format),u}function on(e,t,s){const n=t.offset,i=ki(t,e.options.strict,s);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};const r=i.mode===">"?A.BLOCK_FOLDED:A.BLOCK_LITERAL,o=t.source?Oi(t.source):[];let a=o.length;for(let f=o.length-1;f>=0;--f){const g=o[f][1];if(g===""||g==="\r")a=f;else break}if(a===0){const f=i.chomp==="+"&&o.length>0?`
70
- `.repeat(Math.max(1,o.length-1)):"";let g=n+i.length;return t.source&&(g+=t.source.length),{value:f,type:r,comment:i.comment,range:[n,g,g]}}let l=t.indent+i.indent,c=t.offset+i.length,h=0;for(let f=0;f<a;++f){const[g,b]=o[f];if(b===""||b==="\r")i.indent===0&&g.length>l&&(l=g.length);else{g.length<l&&s(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=g.length),h=f,l===0&&!e.atRoot&&s(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+b.length+1}for(let f=o.length-1;f>=a;--f)o[f][0].length>l&&(a=f+1);let u="",p="",y=!1;for(let f=0;f<h;++f)u+=o[f][0].slice(l)+`
69
+ `+w.comment:c.comment=w.comment),c.range=[n.offset,f,w.offset]}else c.range=[n.offset,f,f];return c}function It(t,e,s,n,i,r){const o=s.type==="block-map"?gi(t,e,s,n,r):s.type==="block-seq"?bi(t,e,s,n,r):wi(t,e,s,n,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function Si(t,e,s,n,i){var p,y;const r=n.tag,o=r?e.directives.tagName(r.source,m=>i(r,"TAG_RESOLVE_FAILED",m)):null;if(s.type==="block-seq"){const{anchor:m,newlineAfterProp:f}=n,g=m&&r?m.offset>r.offset?m:r:m!=null?m:r;g&&(!f||f.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}const a=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===v.tagName&&a==="map"||o===se.tagName&&a==="seq")return It(t,e,s,i,o);let l=e.schema.tags.find(m=>m.tag===o&&m.collection===a);if(!l){const m=e.schema.knownTags[o];if(m&&m.collection===a)e.schema.tags.push(Object.assign({},m,{default:!1})),l=m;else return m!=null&&m.collection?i(r,"BAD_COLLECTION_TYPE",`${m.tag} used for ${a} collection, but expects ${m.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),It(t,e,s,i,o)}const c=It(t,e,s,i,o,l),h=(y=(p=l.resolve)==null?void 0:p.call(l,c,m=>i(r,"TAG_RESOLVE_FAILED",m),e.options))!=null?y:c,u=B(h)?h:new A(h);return u.range=c.range,u.tag=o,l!=null&&l.format&&(u.format=l.format),u}function on(t,e,s){const n=e.offset,i=ki(e,t.options.strict,s);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};const r=i.mode===">"?A.BLOCK_FOLDED:A.BLOCK_LITERAL,o=e.source?Oi(e.source):[];let a=o.length;for(let f=o.length-1;f>=0;--f){const g=o[f][1];if(g===""||g==="\r")a=f;else break}if(a===0){const f=i.chomp==="+"&&o.length>0?`
70
+ `.repeat(Math.max(1,o.length-1)):"";let g=n+i.length;return e.source&&(g+=e.source.length),{value:f,type:r,comment:i.comment,range:[n,g,g]}}let l=e.indent+i.indent,c=e.offset+i.length,h=0;for(let f=0;f<a;++f){const[g,b]=o[f];if(b===""||b==="\r")i.indent===0&&g.length>l&&(l=g.length);else{g.length<l&&s(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=g.length),h=f,l===0&&!t.atRoot&&s(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+b.length+1}for(let f=o.length-1;f>=a;--f)o[f][0].length>l&&(a=f+1);let u="",p="",y=!1;for(let f=0;f<h;++f)u+=o[f][0].slice(l)+`
71
71
  `;for(let f=h;f<a;++f){let[g,b]=o[f];c+=g.length+b.length+1;const w=b[b.length-1]==="\r";if(w&&(b=b.slice(0,-1)),b&&g.length<l){const E=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;s(c-b.length-(w?2:1),"BAD_INDENT",E),g=""}r===A.BLOCK_LITERAL?(u+=p+g.slice(l)+b,p=`
72
72
  `):g.length>l||b[0]===" "?(p===" "?p=`
73
73
  `:!y&&p===`
@@ -81,62 +81,62 @@ ${c}
81
81
  `+o[f][0].slice(l);u[u.length-1]!==`
82
82
  `&&(u+=`
83
83
  `);break;default:u+=`
84
- `}const m=n+i.length+t.source.length;return{value:u,type:r,comment:i.comment,range:[n,m,m]}}function ki({offset:e,props:t},s,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],r=i[0];let o=0,a="",l=-1;for(let p=1;p<i.length;++p){const y=i[p];if(!a&&(y==="-"||y==="+"))a=y;else{const m=Number(y);!o&&m?o=m:l===-1&&(l=e+p)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,h="",u=i.length;for(let p=1;p<t.length;++p){const y=t[p];switch(y.type){case"space":c=!0;case"newline":u+=y.source.length;break;case"comment":s&&!c&&n(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=y.source.length,h=y.source.substring(1);break;case"error":n(y,"UNEXPECTED_TOKEN",y.message),u+=y.source.length;break;default:{const m=`Unexpected token in block scalar header: ${y.type}`;n(y,"UNEXPECTED_TOKEN",m);const f=y.source;f&&typeof f=="string"&&(u+=f.length)}}}return{mode:r,indent:o,chomp:a,comment:h,length:u}}function Oi(e){const t=e.split(/\n( *)/),s=t[0],n=s.match(/^( *)/),r=[n!=null&&n[1]?[n[1],s.slice(n[1].length)]:["",s]];for(let o=1;o<t.length;o+=2)r.push([t[o],t[o+1]]);return r}function an(e,t,s){const{offset:n,type:i,source:r,end:o}=e;let a,l;const c=(p,y,m)=>s(n+p,y,m);switch(i){case"scalar":a=A.PLAIN,l=Ei(r,c);break;case"single-quoted-scalar":a=A.QUOTE_SINGLE,l=Ai(r,c);break;case"double-quoted-scalar":a=A.QUOTE_DOUBLE,l=Ni(r,c);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}const h=n+r.length,u=Ve(o,h,t,s);return{value:l,type:a,comment:u.comment,range:[n,h,u.offset]}}function Ei(e,t){let s="";switch(e[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${e[0]}`;break}case"@":case"`":{s=`reserved character ${e[0]}`;break}}return s&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),ln(e)}function Ai(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),ln(e.slice(1,-1)).replace(/''/g,"'")}function ln(e){var l;let t,s;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
84
+ `}const m=n+i.length+e.source.length;return{value:u,type:r,comment:i.comment,range:[n,m,m]}}function ki({offset:t,props:e},s,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],r=i[0];let o=0,a="",l=-1;for(let p=1;p<i.length;++p){const y=i[p];if(!a&&(y==="-"||y==="+"))a=y;else{const m=Number(y);!o&&m?o=m:l===-1&&(l=t+p)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,h="",u=i.length;for(let p=1;p<e.length;++p){const y=e[p];switch(y.type){case"space":c=!0;case"newline":u+=y.source.length;break;case"comment":s&&!c&&n(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=y.source.length,h=y.source.substring(1);break;case"error":n(y,"UNEXPECTED_TOKEN",y.message),u+=y.source.length;break;default:{const m=`Unexpected token in block scalar header: ${y.type}`;n(y,"UNEXPECTED_TOKEN",m);const f=y.source;f&&typeof f=="string"&&(u+=f.length)}}}return{mode:r,indent:o,chomp:a,comment:h,length:u}}function Oi(t){const e=t.split(/\n( *)/),s=e[0],n=s.match(/^( *)/),r=[n!=null&&n[1]?[n[1],s.slice(n[1].length)]:["",s]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}function an(t,e,s){const{offset:n,type:i,source:r,end:o}=t;let a,l;const c=(p,y,m)=>s(n+p,y,m);switch(i){case"scalar":a=A.PLAIN,l=Ei(r,c);break;case"single-quoted-scalar":a=A.QUOTE_SINGLE,l=Ai(r,c);break;case"double-quoted-scalar":a=A.QUOTE_DOUBLE,l=Ni(r,c);break;default:return s(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}const h=n+r.length,u=Ve(o,h,e,s);return{value:l,type:a,comment:u.comment,range:[n,h,u.offset]}}function Ei(t,e){let s="";switch(t[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${t[0]}`;break}case"@":case"`":{s=`reserved character ${t[0]}`;break}}return s&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),ln(t)}function Ai(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),ln(t.slice(1,-1)).replace(/''/g,"'")}function ln(t){var l;let e,s;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
85
85
  `,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
86
- `,"sy")}catch(c){t=new RegExp("(.*?)[ \\t]*\\r?\\n","sy"),s=new RegExp("[ \\t]*(.*?)[ \\t]*\\r?\\n","sy")}let n=t.exec(e);if(!n)return e;let i=n[1],r=" ",o=t.lastIndex;for(s.lastIndex=o;n=s.exec(e);)n[1]===""?r===`
86
+ `,"sy")}catch(c){e=new RegExp("(.*?)[ \\t]*\\r?\\n","sy"),s=new RegExp("[ \\t]*(.*?)[ \\t]*\\r?\\n","sy")}let n=e.exec(t);if(!n)return t;let i=n[1],r=" ",o=e.lastIndex;for(s.lastIndex=o;n=s.exec(t);)n[1]===""?r===`
87
87
  `?i+=r:r=`
88
- `:(i+=r+n[1],r=" "),o=s.lastIndex;const a=new RegExp("[ \\t]*(.*)","sy");return a.lastIndex=o,n=a.exec(e),i+r+((l=n==null?void 0:n[1])!=null?l:"")}function Ni(e,t){let s="";for(let n=1;n<e.length-1;++n){const i=e[n];if(!(i==="\r"&&e[n+1]===`
88
+ `:(i+=r+n[1],r=" "),o=s.lastIndex;const a=new RegExp("[ \\t]*(.*)","sy");return a.lastIndex=o,n=a.exec(t),i+r+((l=n==null?void 0:n[1])!=null?l:"")}function Ni(t,e){let s="";for(let n=1;n<t.length-1;++n){const i=t[n];if(!(i==="\r"&&t[n+1]===`
89
89
  `))if(i===`
90
- `){const{fold:r,offset:o}=Ti(e,n);s+=r,n=o}else if(i==="\\"){let r=e[++n];const o=Ii[r];if(o)s+=o;else if(r===`
91
- `)for(r=e[n+1];r===" "||r===" ";)r=e[++n+1];else if(r==="\r"&&e[n+1]===`
92
- `)for(r=e[++n+1];r===" "||r===" ";)r=e[++n+1];else if(r==="x"||r==="u"||r==="U"){const a={x:2,u:4,U:8}[r];s+=Ci(e,n+1,a,t),n+=a}else{const a=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),s+=a}}else if(i===" "||i===" "){const r=n;let o=e[n+1];for(;o===" "||o===" ";)o=e[++n+1];o!==`
93
- `&&!(o==="\r"&&e[n+2]===`
94
- `)&&(s+=n>r?e.slice(r,n+1):i)}else s+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function Ti(e,t){let s="",n=e[t+1];for(;(n===" "||n===" "||n===`
95
- `||n==="\r")&&!(n==="\r"&&e[t+2]!==`
90
+ `){const{fold:r,offset:o}=Ti(t,n);s+=r,n=o}else if(i==="\\"){let r=t[++n];const o=Ii[r];if(o)s+=o;else if(r===`
91
+ `)for(r=t[n+1];r===" "||r===" ";)r=t[++n+1];else if(r==="\r"&&t[n+1]===`
92
+ `)for(r=t[++n+1];r===" "||r===" ";)r=t[++n+1];else if(r==="x"||r==="u"||r==="U"){const a={x:2,u:4,U:8}[r];s+=Ci(t,n+1,a,e),n+=a}else{const a=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),s+=a}}else if(i===" "||i===" "){const r=n;let o=t[n+1];for(;o===" "||o===" ";)o=t[++n+1];o!==`
93
+ `&&!(o==="\r"&&t[n+2]===`
94
+ `)&&(s+=n>r?t.slice(r,n+1):i)}else s+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),s}function Ti(t,e){let s="",n=t[e+1];for(;(n===" "||n===" "||n===`
95
+ `||n==="\r")&&!(n==="\r"&&t[e+2]!==`
96
96
  `);)n===`
97
97
  `&&(s+=`
98
- `),t+=1,n=e[t+1];return s||(s=" "),{fold:s,offset:t}}const Ii={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Ci(e,t,s,n){const i=e.substr(t,s),o=i.length===s&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const a=e.substr(t-2,s+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function cn(e,t,s,n){const{value:i,type:r,comment:o,range:a}=t.type==="block-scalar"?on(e,t,n):an(t,e.options.strict,n),l=s?e.directives.tagName(s.source,u=>n(s,"TAG_RESOLVE_FAILED",u)):null,c=s&&l?Li(e.schema,i,l,s,n):t.type==="scalar"?_i(e,i,t,n):e.schema[Z];let h;try{const u=c.resolve(i,p=>n(s!=null?s:t,"TAG_RESOLVE_FAILED",p),e.options);h=L(u)?u:new A(u)}catch(u){const p=u instanceof Error?u.message:String(u);n(s!=null?s:t,"TAG_RESOLVE_FAILED",p),h=new A(i)}return h.range=a,h.source=i,r&&(h.type=r),l&&(h.tag=l),c.format&&(h.format=c.format),o&&(h.comment=o),h}function Li(e,t,s,n,i){var a;if(s==="!")return e[Z];const r=[];for(const l of e.tags)if(!l.collection&&l.tag===s)if(l.default&&l.test)r.push(l);else return l;for(const l of r)if((a=l.test)!=null&&a.test(t))return l;const o=e.knownTags[s];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[Z])}function _i({directives:e,schema:t},s,n,i){var o;const r=t.tags.find(a=>{var l;return a.default&&((l=a.test)==null?void 0:l.test(s))})||t[Z];if(t.compat){const a=(o=t.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(s))}))!=null?o:t[Z];if(r.tag!==a.tag){const l=e.tagString(r.tag),c=e.tagString(a.tag),h=`Value may be parsed as either ${l} or ${c}`;i(n,"TAG_RESOLVE_FAILED",h,!0)}}return r}function Mi(e,t,s){if(t){s===null&&(s=t.length);for(let n=s-1;n>=0;--n){let i=t[n];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++n];(i==null?void 0:i.type)==="space";)e+=i.source.length,i=t[++n];break}}return e}const Di={composeNode:fn,composeEmptyNode:Zt};function fn(e,t,s,n){const{spaceBefore:i,comment:r,anchor:o,tag:a}=s;let l,c=!0;switch(t.type){case"alias":l=$i(e,t,n),(o||a)&&n(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=cn(e,t,a,n),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=Si(Di,e,t,s,n),o&&(l.anchor=o.source.substring(1));break;default:{const h=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",h),l=Zt(e,t.offset,void 0,null,s,n),c=!1}}return o&&l.anchor===""&&n(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(l.spaceBefore=!0),r&&(t.type==="scalar"&&t.source===""?l.comment=r:l.commentBefore=r),e.options.keepSourceTokens&&c&&(l.srcToken=t),l}function Zt(e,t,s,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){const h={type:"scalar",offset:Mi(t,s,n),indent:-1,source:""},u=cn(e,h,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=l),u}function $i({options:e},{offset:t,source:s,end:n},i){const r=new at(s.substring(1));r.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+s.length,a=Ve(n,o,e.strict,i);return r.range=[t,o,a.offset],a.comment&&(r.comment=a.comment),r}function Pi(e,t,{offset:s,start:n,value:i,end:r},o){const a=Object.assign({_directives:t},e),l=new Me(void 0,a),c={atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},h=Ee(n,{indicator:"doc-start",next:i!=null?i:r==null?void 0:r[0],offset:s,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?fn(c,i,h,o):Zt(c,h.end,n,null,h,o);const u=l.contents.range[2],p=Ve(r,u,!1,o);return p.comment&&(l.comment=p.comment),l.range=[s,u,p.offset],l}function De(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:s}=e;return[t,t+(typeof s=="string"?s.length:1)]}function gs(e){var i;let t="",s=!1,n=!1;for(let r=0;r<e.length;++r){const o=e[r];switch(o[0]){case"#":t+=(t===""?"":n?`
98
+ `),e+=1,n=t[e+1];return s||(s=" "),{fold:s,offset:e}}const Ii={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Ci(t,e,s,n){const i=t.substr(e,s),o=i.length===s&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const a=t.substr(e-2,s+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function cn(t,e,s,n){const{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?on(t,e,n):an(e,t.options.strict,n),l=s?t.directives.tagName(s.source,u=>n(s,"TAG_RESOLVE_FAILED",u)):null,c=s&&l?Li(t.schema,i,l,s,n):e.type==="scalar"?_i(t,i,e,n):t.schema[Z];let h;try{const u=c.resolve(i,p=>n(s!=null?s:e,"TAG_RESOLVE_FAILED",p),t.options);h=L(u)?u:new A(u)}catch(u){const p=u instanceof Error?u.message:String(u);n(s!=null?s:e,"TAG_RESOLVE_FAILED",p),h=new A(i)}return h.range=a,h.source=i,r&&(h.type=r),l&&(h.tag=l),c.format&&(h.format=c.format),o&&(h.comment=o),h}function Li(t,e,s,n,i){var a;if(s==="!")return t[Z];const r=[];for(const l of t.tags)if(!l.collection&&l.tag===s)if(l.default&&l.test)r.push(l);else return l;for(const l of r)if((a=l.test)!=null&&a.test(e))return l;const o=t.knownTags[s];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),t[Z])}function _i({directives:t,schema:e},s,n,i){var o;const r=e.tags.find(a=>{var l;return a.default&&((l=a.test)==null?void 0:l.test(s))})||e[Z];if(e.compat){const a=(o=e.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(s))}))!=null?o:e[Z];if(r.tag!==a.tag){const l=t.tagString(r.tag),c=t.tagString(a.tag),h=`Value may be parsed as either ${l} or ${c}`;i(n,"TAG_RESOLVE_FAILED",h,!0)}}return r}function Mi(t,e,s){if(e){s===null&&(s=e.length);for(let n=s-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];(i==null?void 0:i.type)==="space";)t+=i.source.length,i=e[++n];break}}return t}const Di={composeNode:fn,composeEmptyNode:Zt};function fn(t,e,s,n){const{spaceBefore:i,comment:r,anchor:o,tag:a}=s;let l,c=!0;switch(e.type){case"alias":l=$i(t,e,n),(o||a)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=cn(t,e,a,n),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=Si(Di,t,e,s,n),o&&(l.anchor=o.source.substring(1));break;default:{const h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),l=Zt(t,e.offset,void 0,null,s,n),c=!1}}return o&&l.anchor===""&&n(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(l.spaceBefore=!0),r&&(e.type==="scalar"&&e.source===""?l.comment=r:l.commentBefore=r),t.options.keepSourceTokens&&c&&(l.srcToken=e),l}function Zt(t,e,s,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){const h={type:"scalar",offset:Mi(e,s,n),indent:-1,source:""},u=cn(t,h,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=l),u}function $i({options:t},{offset:e,source:s,end:n},i){const r=new at(s.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+s.length,a=Ve(n,o,t.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function Pi(t,e,{offset:s,start:n,value:i,end:r},o){const a=Object.assign({_directives:e},t),l=new Me(void 0,a),c={atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},h=Ee(n,{indicator:"doc-start",next:i!=null?i:r==null?void 0:r[0],offset:s,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?fn(c,i,h,o):Zt(c,h.end,n,null,h,o);const u=l.contents.range[2],p=Ve(r,u,!1,o);return p.comment&&(l.comment=p.comment),l.range=[s,u,p.offset],l}function De(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:s}=t;return[e,e+(typeof s=="string"?s.length:1)]}function gs(t){var i;let e="",s=!1,n=!1;for(let r=0;r<t.length;++r){const o=t[r];switch(o[0]){case"#":e+=(e===""?"":n?`
100
100
 
101
101
  `:`
102
- `)+(o.substring(1)||" "),s=!0,n=!1;break;case"%":((i=e[r+1])==null?void 0:i[0])!=="#"&&(r+=1),s=!1;break;default:s||(n=!0),s=!1}}return{comment:t,afterEmptyLine:n}}class es{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,n,i,r)=>{const o=De(s);r?this.warnings.push(new nn(o,n,i)):this.errors.push(new le(o,n,i))},this.directives=new z({version:t.version||"1.2"}),this.options=t}decorate(t,s){const{comment:n,afterEmptyLine:i}=gs(this.prelude);if(n){const r=t.contents;if(s)t.comment=t.comment?`${t.comment}
103
- ${n}`:n;else if(i||t.directives.docStart||!r)t.commentBefore=n;else if(D(r)&&!r.flow&&r.items.length>0){let o=r.items[0];_(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${n}
102
+ `)+(o.substring(1)||" "),s=!0,n=!1;break;case"%":((i=t[r+1])==null?void 0:i[0])!=="#"&&(r+=1),s=!1;break;default:s||(n=!0),s=!1}}return{comment:e,afterEmptyLine:n}}class es{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,n,i,r)=>{const o=De(s);r?this.warnings.push(new nn(o,n,i)):this.errors.push(new le(o,n,i))},this.directives=new z({version:e.version||"1.2"}),this.options=e}decorate(e,s){const{comment:n,afterEmptyLine:i}=gs(this.prelude);if(n){const r=e.contents;if(s)e.comment=e.comment?`${e.comment}
103
+ ${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(D(r)&&!r.flow&&r.items.length>0){let o=r.items[0];_(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${n}
104
104
  ${a}`:n}else{const o=r.commentBefore;r.commentBefore=o?`${n}
105
- ${o}`:n}}s?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:gs(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,s=!1,n=-1){for(const i of t)yield*d(this.next(i));yield*d(this.end(s,n))}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(s,n,i)=>{const r=De(t);r[0]+=s,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const s=Pi(this.options,this.directives,t,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(s,!1),this.doc&&(yield this.doc),this.doc=s,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const s=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new le(De(t),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new le(De(t),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const s=Ve(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
106
- ${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new le(De(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const n=Object.assign({_directives:this.directives},this.options),i=new Me(void 0,n);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,s,s],this.decorate(i,!1),yield i}}}function Bi(e,t=!0,s){if(e){const n=(i,r,o)=>{const a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(s)s(a,r,o);else throw new le([a,a+1],r,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return an(e,t,n);case"block-scalar":return on({options:{strict:t}},e,n)}}return null}function Ri(e,t){var c;const{implicitKey:s=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=t,a=Ue({type:o,value:e},{implicitKey:s,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=(c=t.end)!=null?c:[{type:"newline",offset:-1,indent:n,source:`
105
+ ${o}`:n}}s?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:gs(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,s=!1,n=-1){for(const i of e)yield*d(this.next(i));yield*d(this.end(s,n))}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(s,n,i)=>{const r=De(e);r[0]+=s,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const s=Pi(this.options,this.directives,e,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(s,!1),this.doc&&(yield this.doc),this.doc=s,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const s=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new le(De(e),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new le(De(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const s=Ve(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
106
+ ${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new le(De(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const n=Object.assign({_directives:this.directives},this.options),i=new Me(void 0,n);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,s,s],this.decorate(i,!1),yield i}}}function Bi(t,e=!0,s){if(t){const n=(i,r,o)=>{const a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(s)s(a,r,o);else throw new le([a,a+1],r,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return an(t,e,n);case"block-scalar":return on({options:{strict:e}},t,n)}}return null}function Ri(t,e){var c;const{implicitKey:s=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Ue({type:o,value:t},{implicitKey:s,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=(c=e.end)!=null?c:[{type:"newline",offset:-1,indent:n,source:`
107
107
  `}];switch(a[0]){case"|":case">":{const h=a.indexOf(`
108
108
  `),u=a.substring(0,h),p=a.substring(h+1)+`
109
109
  `,y=[{type:"block-scalar-header",offset:r,indent:n,source:u}];return un(y,l)||y.push({type:"newline",offset:-1,indent:n,source:`
110
- `}),{type:"block-scalar",offset:r,indent:n,props:y,source:p}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function Fi(e,t,s={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=s,a="indent"in e?e.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const c=e.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=Ue({type:o,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Ki(e,l);break;case'"':Ct(e,l,"double-quoted-scalar");break;case"'":Ct(e,l,"single-quoted-scalar");break;default:Ct(e,l,"scalar")}}function Ki(e,t){const s=t.indexOf(`
111
- `),n=t.substring(0,s),i=t.substring(s+1)+`
112
- `;if(e.type==="block-scalar"){const r=e.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,e.source=i}else{const{offset:r}=e,o="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];un(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
113
- `});for(const l of Object.keys(e))l!=="type"&&l!=="offset"&&delete e[l];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:i})}}function un(e,t){if(t)for(const s of t)switch(s.type){case"space":case"comment":e.push(s);break;case"newline":return e.push(s),!0}return!1}function Ct(e,t,s){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=s,e.source=t;break;case"block-scalar":{const n=e.props.slice(1);let i=t.length;e.props[0].type==="block-scalar-header"&&(i-=e.props[0].source.length);for(const r of n)r.offset+=i;delete e.props,Object.assign(e,{type:s,source:t,end:n});break}case"block-map":case"block-seq":{const i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
114
- `};delete e.items,Object.assign(e,{type:s,source:t,end:[i]});break}default:{const n="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(const r of Object.keys(e))r!=="type"&&r!=="offset"&&delete e[r];Object.assign(e,{type:s,indent:n,source:t,end:i})}}}const ji=e=>"type"in e?it(e):Ze(e);function it(e){switch(e.type){case"block-scalar":{let t="";for(const s of e.props)t+=it(s);return t+e.source}case"block-map":case"block-seq":{let t="";for(const s of e.items)t+=Ze(s);return t}case"flow-collection":{let t=e.start.source;for(const s of e.items)t+=Ze(s);for(const s of e.end)t+=s.source;return t}case"document":{let t=Ze(e);if(e.end)for(const s of e.end)t+=s.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const s of e.end)t+=s.source;return t}}}function Ze({start:e,key:t,sep:s,value:n}){let i="";for(const r of e)i+=r.source;if(t&&(i+=it(t)),s)for(const r of s)i+=r.source;return n&&(i+=it(n)),i}const Rt=Symbol("break visit"),qi=Symbol("skip children"),hn=Symbol("remove item");function ce(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),dn(Object.freeze([]),e,t)}ce.BREAK=Rt;ce.SKIP=qi;ce.REMOVE=hn;ce.itemAtPath=(e,t)=>{let s=e;for(const[n,i]of t){const r=s==null?void 0:s[n];if(r&&"items"in r)s=r.items[i];else return}return s};ce.parentCollection=(e,t)=>{const s=ce.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=s==null?void 0:s[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function dn(e,t,s){let n=s(t,e);if(typeof n=="symbol")return n;for(const i of["key","value"]){const r=t[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){const a=dn(Object.freeze(e.concat([[i,o]])),r.items[o],s);if(typeof a=="number")o=a-1;else{if(a===Rt)return Rt;a===hn&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(t,e))}}return typeof n=="function"?n(t,e):n}const gt="\uFEFF",bt="",wt="",Ke="",zi=e=>!!e&&"items"in e,Ui=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function vi(e){switch(e){case gt:return"<BOM>";case bt:return"<DOC>";case wt:return"<FLOW_END>";case Ke:return"<SCALAR>";default:return JSON.stringify(e)}}function pn(e){switch(e){case gt:return"byte-order-mark";case bt:return"doc-mode";case wt:return"flow-error-end";case Ke:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
110
+ `}),{type:"block-scalar",offset:r,indent:n,props:y,source:p}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function Fi(t,e,s={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=s,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=Ue({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Ki(t,l);break;case'"':Ct(t,l,"double-quoted-scalar");break;case"'":Ct(t,l,"single-quoted-scalar");break;default:Ct(t,l,"scalar")}}function Ki(t,e){const s=e.indexOf(`
111
+ `),n=e.substring(0,s),i=e.substring(s+1)+`
112
+ `;if(t.type==="block-scalar"){const r=t.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,t.source=i}else{const{offset:r}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];un(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
113
+ `});for(const l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:i})}}function un(t,e){if(e)for(const s of e)switch(s.type){case"space":case"comment":t.push(s);break;case"newline":return t.push(s),!0}return!1}function Ct(t,e,s){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=s,t.source=e;break;case"block-scalar":{const n=t.props.slice(1);let i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(const r of n)r.offset+=i;delete t.props,Object.assign(t,{type:s,source:e,end:n});break}case"block-map":case"block-seq":{const i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
114
+ `};delete t.items,Object.assign(t,{type:s,source:e,end:[i]});break}default:{const n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(const r of Object.keys(t))r!=="type"&&r!=="offset"&&delete t[r];Object.assign(t,{type:s,indent:n,source:e,end:i})}}}const ji=t=>"type"in t?it(t):Ze(t);function it(t){switch(t.type){case"block-scalar":{let e="";for(const s of t.props)e+=it(s);return e+t.source}case"block-map":case"block-seq":{let e="";for(const s of t.items)e+=Ze(s);return e}case"flow-collection":{let e=t.start.source;for(const s of t.items)e+=Ze(s);for(const s of t.end)e+=s.source;return e}case"document":{let e=Ze(t);if(t.end)for(const s of t.end)e+=s.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(const s of t.end)e+=s.source;return e}}}function Ze({start:t,key:e,sep:s,value:n}){let i="";for(const r of t)i+=r.source;if(e&&(i+=it(e)),s)for(const r of s)i+=r.source;return n&&(i+=it(n)),i}const Rt=Symbol("break visit"),qi=Symbol("skip children"),hn=Symbol("remove item");function ce(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),dn(Object.freeze([]),t,e)}ce.BREAK=Rt;ce.SKIP=qi;ce.REMOVE=hn;ce.itemAtPath=(t,e)=>{let s=t;for(const[n,i]of e){const r=s==null?void 0:s[n];if(r&&"items"in r)s=r.items[i];else return}return s};ce.parentCollection=(t,e)=>{const s=ce.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=s==null?void 0:s[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function dn(t,e,s){let n=s(e,t);if(typeof n=="symbol")return n;for(const i of["key","value"]){const r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){const a=dn(Object.freeze(t.concat([[i,o]])),r.items[o],s);if(typeof a=="number")o=a-1;else{if(a===Rt)return Rt;a===hn&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}const gt="\uFEFF",bt="",wt="",Ke="",zi=t=>!!t&&"items"in t,Ui=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function vi(t){switch(t){case gt:return"<BOM>";case bt:return"<DOC>";case wt:return"<FLOW_END>";case Ke:return"<SCALAR>";default:return JSON.stringify(t)}}function pn(t){switch(t){case gt:return"byte-order-mark";case bt:return"doc-mode";case wt:return"flow-error-end";case Ke:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
115
115
  `:case`\r
116
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(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}const Vi=Object.freeze(Object.defineProperty({__proto__:null,BOM:gt,DOCUMENT:bt,FLOW_END:wt,SCALAR:Ke,createScalarToken:Ri,isCollection:zi,isScalar:Ui,prettyToken:vi,resolveAsScalar:Bi,setScalarValue:Fi,stringify:ji,tokenType:pn,visit:ce},Symbol.toStringTag,{value:"Module"}));function W(e){switch(e){case void 0:case" ":case`
116
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const Vi=Object.freeze(Object.defineProperty({__proto__:null,BOM:gt,DOCUMENT:bt,FLOW_END:wt,SCALAR:Ke,createScalarToken:Ri,isCollection:zi,isScalar:Ui,prettyToken:vi,resolveAsScalar:Bi,setScalarValue:Fi,stringify:ji,tokenType:pn,visit:ce},Symbol.toStringTag,{value:"Module"}));function W(t){switch(t){case void 0:case" ":case`
117
117
  `:case"\r":case" ":return!0;default:return!1}}const bs=new Set("0123456789ABCDEFabcdef"),Qi=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),We=new Set(",[]{}"),Yi=new Set(` ,[]{}
118
- \r `),Lt=e=>!e||Yi.has(e);class mn{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(t,s=!1){var i;if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!s;let n=(i=this.next)!=null?i:"stream";for(;n&&(s||this.hasChars(1));)n=yield*d(this.parseNext(n))}atLineEnd(){let t=this.pos,s=this.buffer[t];for(;s===" "||s===" ";)s=this.buffer[++t];return!s||s==="#"||s===`
119
- `?!0:s==="\r"?this.buffer[t+1]===`
120
- `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let s=this.buffer[t];if(this.indentNext>0){let n=0;for(;s===" ";)s=this.buffer[++n+t];if(s==="\r"){const i=this.buffer[n+t+1];if(i===`
121
- `||!i&&!this.atEnd)return t+n+1}return s===`
122
- `||n>=this.indentNext||!s&&!this.atEnd?t+n:-1}if(s==="-"||s==="."){const n=this.buffer.substr(t,3);if((n==="---"||n==="...")&&W(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
123
- `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*d(this.parseStream());case"line-start":return yield*d(this.parseLineStart());case"block-start":return yield*d(this.parseBlockStart());case"doc":return yield*d(this.parseDocument());case"flow":return yield*d(this.parseFlowCollection());case"quoted-scalar":return yield*d(this.parseQuotedScalar());case"block-scalar":return yield*d(this.parseBlockScalar());case"plain-scalar":return yield*d(this.parsePlainScalar())}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===gt&&(yield*d(this.pushCount(1)),t=t.substring(1)),t[0]==="%"){let s=t.length,n=t.indexOf("#");for(;n!==-1;){const r=t[n-1];if(r===" "||r===" "){s=n-1;break}else n=t.indexOf("#",n+1)}for(;;){const r=t[s-1];if(r===" "||r===" ")s-=1;else break}const i=(yield*d(this.pushCount(s)))+(yield*d(this.pushSpaces(!0)));return yield*d(this.pushCount(t.length-i)),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*d(this.pushSpaces(!0));return yield*d(this.pushCount(t.length-s)),yield*d(this.pushNewline()),"stream"}return yield bt,yield*d(this.parseLineStart())}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const s=this.peek(3);if((s==="---"||s==="...")&&W(this.charAt(3)))return yield*d(this.pushCount(3)),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*d(this.pushSpaces(!1)),this.indentNext>this.indentValue&&!W(this.charAt(1))&&(this.indentNext=this.indentValue),yield*d(this.parseBlockStart())}*parseBlockStart(){const[t,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&W(s)){const n=(yield*d(this.pushCount(1)))+(yield*d(this.pushSpaces(!0)));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*d(this.parseBlockStart())}return"doc"}*parseDocument(){yield*d(this.pushSpaces(!0));const t=this.getLine();if(t===null)return this.setNext("doc");let s=yield*d(this.pushIndicators());switch(t[s]){case"#":yield*d(this.pushCount(t.length-s));case void 0:return yield*d(this.pushNewline()),yield*d(this.parseLineStart());case"{":case"[":return yield*d(this.pushCount(1)),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*d(this.pushCount(1)),"doc";case"*":return yield*d(this.pushUntil(Lt)),"doc";case'"':case"'":return yield*d(this.parseQuotedScalar());case"|":case">":return s+=yield*d(this.parseBlockScalarHeader()),s+=yield*d(this.pushSpaces(!0)),yield*d(this.pushCount(t.length-s)),yield*d(this.pushNewline()),yield*d(this.parseBlockScalar());default:return yield*d(this.parsePlainScalar())}}*parseFlowCollection(){let t,s,n=-1;do t=yield*d(this.pushNewline()),t>0?(s=yield*d(this.pushSpaces(!1)),this.indentValue=n=s):s=0,s+=yield*d(this.pushSpaces(!0));while(t+s>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&W(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield wt,yield*d(this.parseLineStart());let r=0;for(;i[r]===",";)r+=yield*d(this.pushCount(1)),r+=yield*d(this.pushSpaces(!0)),this.flowKey=!1;switch(r+=yield*d(this.pushIndicators()),i[r]){case void 0:return"flow";case"#":return yield*d(this.pushCount(i.length-r)),"flow";case"{":case"[":return yield*d(this.pushCount(1)),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*d(this.pushCount(1)),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*d(this.pushUntil(Lt)),"flow";case'"':case"'":return this.flowKey=!0,yield*d(this.parseQuotedScalar());case":":{const o=this.charAt(1);if(this.flowKey||W(o)||o===",")return this.flowKey=!1,yield*d(this.pushCount(1)),yield*d(this.pushSpaces(!0)),"flow"}default:return this.flowKey=!1,yield*d(this.parsePlainScalar())}}*parseQuotedScalar(){const t=this.charAt(0);let s=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let r=0;for(;this.buffer[s-1-r]==="\\";)r+=1;if(r%2===0)break;s=this.buffer.indexOf('"',s+1)}const n=this.buffer.substring(0,s);let i=n.indexOf(`
118
+ \r `),Lt=t=>!t||Yi.has(t);class mn{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,s=!1){var i;if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!s;let n=(i=this.next)!=null?i:"stream";for(;n&&(s||this.hasChars(1));)n=yield*d(this.parseNext(n))}atLineEnd(){let e=this.pos,s=this.buffer[e];for(;s===" "||s===" ";)s=this.buffer[++e];return!s||s==="#"||s===`
119
+ `?!0:s==="\r"?this.buffer[e+1]===`
120
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let s=this.buffer[e];if(this.indentNext>0){let n=0;for(;s===" ";)s=this.buffer[++n+e];if(s==="\r"){const i=this.buffer[n+e+1];if(i===`
121
+ `||!i&&!this.atEnd)return e+n+1}return s===`
122
+ `||n>=this.indentNext||!s&&!this.atEnd?e+n:-1}if(s==="-"||s==="."){const n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&W(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
123
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*d(this.parseStream());case"line-start":return yield*d(this.parseLineStart());case"block-start":return yield*d(this.parseBlockStart());case"doc":return yield*d(this.parseDocument());case"flow":return yield*d(this.parseFlowCollection());case"quoted-scalar":return yield*d(this.parseQuotedScalar());case"block-scalar":return yield*d(this.parseBlockScalar());case"plain-scalar":return yield*d(this.parsePlainScalar())}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===gt&&(yield*d(this.pushCount(1)),e=e.substring(1)),e[0]==="%"){let s=e.length,n=e.indexOf("#");for(;n!==-1;){const r=e[n-1];if(r===" "||r===" "){s=n-1;break}else n=e.indexOf("#",n+1)}for(;;){const r=e[s-1];if(r===" "||r===" ")s-=1;else break}const i=(yield*d(this.pushCount(s)))+(yield*d(this.pushSpaces(!0)));return yield*d(this.pushCount(e.length-i)),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*d(this.pushSpaces(!0));return yield*d(this.pushCount(e.length-s)),yield*d(this.pushNewline()),"stream"}return yield bt,yield*d(this.parseLineStart())}*parseLineStart(){const 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");const s=this.peek(3);if((s==="---"||s==="...")&&W(this.charAt(3)))return yield*d(this.pushCount(3)),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*d(this.pushSpaces(!1)),this.indentNext>this.indentValue&&!W(this.charAt(1))&&(this.indentNext=this.indentValue),yield*d(this.parseBlockStart())}*parseBlockStart(){const[e,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&W(s)){const n=(yield*d(this.pushCount(1)))+(yield*d(this.pushSpaces(!0)));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*d(this.parseBlockStart())}return"doc"}*parseDocument(){yield*d(this.pushSpaces(!0));const e=this.getLine();if(e===null)return this.setNext("doc");let s=yield*d(this.pushIndicators());switch(e[s]){case"#":yield*d(this.pushCount(e.length-s));case void 0:return yield*d(this.pushNewline()),yield*d(this.parseLineStart());case"{":case"[":return yield*d(this.pushCount(1)),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*d(this.pushCount(1)),"doc";case"*":return yield*d(this.pushUntil(Lt)),"doc";case'"':case"'":return yield*d(this.parseQuotedScalar());case"|":case">":return s+=yield*d(this.parseBlockScalarHeader()),s+=yield*d(this.pushSpaces(!0)),yield*d(this.pushCount(e.length-s)),yield*d(this.pushNewline()),yield*d(this.parseBlockScalar());default:return yield*d(this.parsePlainScalar())}}*parseFlowCollection(){let e,s,n=-1;do e=yield*d(this.pushNewline()),e>0?(s=yield*d(this.pushSpaces(!1)),this.indentValue=n=s):s=0,s+=yield*d(this.pushSpaces(!0));while(e+s>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&W(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield wt,yield*d(this.parseLineStart());let r=0;for(;i[r]===",";)r+=yield*d(this.pushCount(1)),r+=yield*d(this.pushSpaces(!0)),this.flowKey=!1;switch(r+=yield*d(this.pushIndicators()),i[r]){case void 0:return"flow";case"#":return yield*d(this.pushCount(i.length-r)),"flow";case"{":case"[":return yield*d(this.pushCount(1)),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*d(this.pushCount(1)),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*d(this.pushUntil(Lt)),"flow";case'"':case"'":return this.flowKey=!0,yield*d(this.parseQuotedScalar());case":":{const o=this.charAt(1);if(this.flowKey||W(o)||o===",")return this.flowKey=!1,yield*d(this.pushCount(1)),yield*d(this.pushSpaces(!0)),"flow"}default:return this.flowKey=!1,yield*d(this.parsePlainScalar())}}*parseQuotedScalar(){const e=this.charAt(0);let s=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let r=0;for(;this.buffer[s-1-r]==="\\";)r+=1;if(r%2===0)break;s=this.buffer.indexOf('"',s+1)}const n=this.buffer.substring(0,s);let i=n.indexOf(`
124
124
  `,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
125
- `,r)}i!==-1&&(s=i-(n[i-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*d(this.pushToIndex(s+1,!1)),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const s=this.buffer[++t];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*d(this.pushUntil(s=>W(s)||s==="#"))}*parseBlockScalar(){let t=this.pos-1,s=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":s+=1;break;case`
126
- `:t=r,s=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
127
- `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=s:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(t+1);if(r===-1)break;t=this.buffer.indexOf(`
128
- `,r)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
129
- `;)n=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let r=t-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
130
- `&&r>=this.pos&&r+1+s>a)t=r;else break}while(!0);return yield Ke,yield*d(this.pushToIndex(t+1,!0)),yield*d(this.parseLineStart())}*parsePlainScalar(){const t=this.flowLevel>0;let s=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){const r=this.buffer[n+1];if(W(r)||t&&We.has(r))break;s=n}else if(W(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
125
+ `,r)}i!==-1&&(s=i-(n[i-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*d(this.pushToIndex(s+1,!1)),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const s=this.buffer[++e];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*d(this.pushUntil(s=>W(s)||s==="#"))}*parseBlockScalar(){let e=this.pos-1,s=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":s+=1;break;case`
126
+ `:e=r,s=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
127
+ `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=s:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
128
+ `,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
129
+ `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
130
+ `&&r>=this.pos&&r+1+s>a)e=r;else break}while(!0);return yield Ke,yield*d(this.pushToIndex(e+1,!0)),yield*d(this.parseLineStart())}*parsePlainScalar(){const e=this.flowLevel>0;let s=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){const r=this.buffer[n+1];if(W(r)||e&&We.has(r))break;s=n}else if(W(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
131
131
  `?(n+=1,i=`
132
- `,r=this.buffer[n+1]):s=n),r==="#"||t&&We.has(r))break;if(i===`
133
- `){const o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(t&&We.has(i))break;s=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ke,yield*d(this.pushToIndex(s+1,!0)),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,s){const n=this.buffer.slice(this.pos,t);return n?(yield n,this.pos+=n.length,n.length):(s&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*d(this.pushTag()))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()));case"&":return(yield*d(this.pushUntil(Lt)))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()));case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(W(s)||t&&We.has(s))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*d(this.pushCount(1)))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()))}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,s=this.buffer[t];for(;!W(s)&&s!==">";)s=this.buffer[++t];return yield*d(this.pushToIndex(s===">"?t+1:t,!1))}else{let t=this.pos+1,s=this.buffer[t];for(;s;)if(Qi.has(s))s=this.buffer[++t];else if(s==="%"&&bs.has(this.buffer[t+1])&&bs.has(this.buffer[t+2]))s=this.buffer[t+=3];else break;return yield*d(this.pushToIndex(t,!1))}}*pushNewline(){const t=this.buffer[this.pos];return t===`
134
- `?yield*d(this.pushCount(1)):t==="\r"&&this.charAt(1)===`
135
- `?yield*d(this.pushCount(2)):0}*pushSpaces(t){let s=this.pos-1,n;do n=this.buffer[++s];while(n===" "||t&&n===" ");const i=s-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=s),i}*pushUntil(t){let s=this.pos,n=this.buffer[s];for(;!t(n);)n=this.buffer[++s];return yield*d(this.pushToIndex(s,!1))}}class yn{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let s=0,n=this.lineStarts.length;for(;s<n;){const r=s+n>>1;this.lineStarts[r]<t?s=r+1:n=r}if(this.lineStarts[s]===t)return{line:s+1,col:1};if(s===0)return{line:0,col:t};const i=this.lineStarts[s-1];return{line:s,col:t-i+1}}}}function re(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function ws(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 gn(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function xe(e){var t;switch(e.type){case"document":return e.start;case"block-map":{const s=e.items[e.items.length-1];return(t=s.sep)!=null?t:s.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function pe(e){var s;if(e.length===0)return[];let t=e.length;e: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 e}for(;((s=e[++t])==null?void 0:s.type)==="space";);return e.splice(t,e.length)}function Ss(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!re(t.start,"explicit-key-ind")&&!re(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,gn(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class ts{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new mn,this.onNewLine=t}*parse(t,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(t,s))yield*d(this.next(n));s||(yield*d(this.end()))}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*d(this.step()),this.offset+=t.length;return}const s=pn(t);if(s)if(s==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=s,yield*d(this.step()),s){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const n=`Not a YAML token: ${t}`;yield*d(this.pop({type:"error",offset:this.offset,message:n,source:t})),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*d(this.pop())}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(!t||t.type!=="doc-end")){for(;this.stack.length>0;)yield*d(this.pop());this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*d(this.stream());switch(t.type){case"document":return yield*d(this.document(t));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*d(this.scalar(t));case"block-scalar":return yield*d(this.blockScalar(t));case"block-map":return yield*d(this.blockMap(t));case"block-seq":return yield*d(this.blockSequence(t));case"flow-collection":return yield*d(this.flowCollection(t));case"doc-end":return yield*d(this.documentEnd(t))}yield*d(this.pop())}peek(t){return this.stack[this.stack.length-t]}*pop(t){const s=t!=null?t:this.stack.pop();if(!s)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield s;else{const n=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in n?n.indent:0:s.type==="flow-collection"&&n.type==="document"&&(s.indent=0),s.type==="flow-collection"&&Ss(s),n.type){case"document":n.value=s;break;case"block-scalar":n.props.push(s);break;case"block-map":{const i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=s;else{Object.assign(i,{key:s,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:s}):i.value=s;break}case"flow-collection":{const i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:s,sep:[]}):i.sep?i.value=s:Object.assign(i,{key:s,sep:[]});return}default:yield*d(this.pop()),yield*d(this.pop(s))}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const i=s.items[s.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&ws(i.start)===-1&&(s.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<s.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),s.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":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*d(this.lineEnd(t));switch(this.type){case"doc-start":{ws(t.start)!==-1?(yield*d(this.pop()),yield*d(this.step())):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const s=this.startBlockValue(t);s?this.stack.push(s):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const s=xe(this.peek(2)),n=pe(s);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const r={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*d(this.lineEnd(t))}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let s=this.source.indexOf(`
132
+ `,r=this.buffer[n+1]):s=n),r==="#"||e&&We.has(r))break;if(i===`
133
+ `){const o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&We.has(i))break;s=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ke,yield*d(this.pushToIndex(s+1,!0)),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,s){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(s&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*d(this.pushTag()))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()));case"&":return(yield*d(this.pushUntil(Lt)))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()));case"-":case"?":case":":{const e=this.flowLevel>0,s=this.charAt(1);if(W(s)||e&&We.has(s))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*d(this.pushCount(1)))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()))}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,s=this.buffer[e];for(;!W(s)&&s!==">";)s=this.buffer[++e];return yield*d(this.pushToIndex(s===">"?e+1:e,!1))}else{let e=this.pos+1,s=this.buffer[e];for(;s;)if(Qi.has(s))s=this.buffer[++e];else if(s==="%"&&bs.has(this.buffer[e+1])&&bs.has(this.buffer[e+2]))s=this.buffer[e+=3];else break;return yield*d(this.pushToIndex(e,!1))}}*pushNewline(){const e=this.buffer[this.pos];return e===`
134
+ `?yield*d(this.pushCount(1)):e==="\r"&&this.charAt(1)===`
135
+ `?yield*d(this.pushCount(2)):0}*pushSpaces(e){let s=this.pos-1,n;do n=this.buffer[++s];while(n===" "||e&&n===" ");const i=s-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=s),i}*pushUntil(e){let s=this.pos,n=this.buffer[s];for(;!e(n);)n=this.buffer[++s];return yield*d(this.pushToIndex(s,!1))}}class yn{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let s=0,n=this.lineStarts.length;for(;s<n;){const r=s+n>>1;this.lineStarts[r]<e?s=r+1:n=r}if(this.lineStarts[s]===e)return{line:s+1,col:1};if(s===0)return{line:0,col:e};const i=this.lineStarts[s-1];return{line:s,col:e-i+1}}}}function re(t,e){for(let s=0;s<t.length;++s)if(t[s].type===e)return!0;return!1}function ws(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function gn(t){switch(t==null?void 0:t.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function xe(t){var e;switch(t.type){case"document":return t.start;case"block-map":{const s=t.items[t.items.length-1];return(e=s.sep)!=null?e:s.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function pe(t){var s;if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((s=t[++e])==null?void 0:s.type)==="space";);return t.splice(e,t.length)}function Ss(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!re(e.start,"explicit-key-ind")&&!re(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,gn(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class ts{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 mn,this.onNewLine=e}*parse(e,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(e,s))yield*d(this.next(n));s||(yield*d(this.end()))}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*d(this.step()),this.offset+=e.length;return}const s=pn(e);if(s)if(s==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=s,yield*d(this.step()),s){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const n=`Not a YAML token: ${e}`;yield*d(this.pop({type:"error",offset:this.offset,message:n,source:e})),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*d(this.pop())}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*d(this.pop());this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*d(this.stream());switch(e.type){case"document":return yield*d(this.document(e));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*d(this.scalar(e));case"block-scalar":return yield*d(this.blockScalar(e));case"block-map":return yield*d(this.blockMap(e));case"block-seq":return yield*d(this.blockSequence(e));case"flow-collection":return yield*d(this.flowCollection(e));case"doc-end":return yield*d(this.documentEnd(e))}yield*d(this.pop())}peek(e){return this.stack[this.stack.length-e]}*pop(e){const s=e!=null?e:this.stack.pop();if(!s)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield s;else{const n=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in n?n.indent:0:s.type==="flow-collection"&&n.type==="document"&&(s.indent=0),s.type==="flow-collection"&&Ss(s),n.type){case"document":n.value=s;break;case"block-scalar":n.props.push(s);break;case"block-map":{const i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=s;else{Object.assign(i,{key:s,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:s}):i.value=s;break}case"flow-collection":{const i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:s,sep:[]}):i.sep?i.value=s:Object.assign(i,{key:s,sep:[]});return}default:yield*d(this.pop()),yield*d(this.pop(s))}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const i=s.items[s.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&ws(i.start)===-1&&(s.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<s.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),s.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":{const 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*d(this.lineEnd(e));switch(this.type){case"doc-start":{ws(e.start)!==-1?(yield*d(this.pop()),yield*d(this.step())):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):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"){const s=xe(this.peek(2)),n=pe(s);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*d(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 s=this.source.indexOf(`
136
136
  `)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
137
- `,s)+1}yield*d(this.pop());break;default:yield*d(this.pop()),yield*d(this.step())}}*blockMap(t){var n;const s=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const i="end"in s.value?s.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,t.indent)){const i=t.items[t.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const i=!this.onKeyLine&&this.indent===t.indent,r=i&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(r&&s.sep&&!s.value){const a=[];for(let l=0;l<s.sep.length;++l){const c=s.sep[l];switch(c.type){case"newline":a.push(l);break;case"space":break;case"comment":c.indent>t.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=s.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):r||s.value?(o.push(this.sourceToken),t.items.push({start:o,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(s.explicitKey)if(s.sep)if(s.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(re(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(gn(s.key)&&!re(s.sep,"newline")){const a=pe(s.start),l=s.key,c=s.sep;c.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else o.length>0?s.sep=s.sep.concat(o,this.sourceToken):s.sep.push(this.sourceToken);else if(re(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const a=pe(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?t.items.push({start:o,key:null,sep:[this.sourceToken]}):re(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);r||s.value?(t.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(a):(Object.assign(s,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(t);if(a){i&&a.type!=="block-seq"&&t.items.push({start:o}),this.stack.push(a);return}}}}yield*d(this.pop()),yield*d(this.step())}*blockSequence(t){var n;const s=t.items[t.items.length-1];switch(this.type){case"newline":if(s.value){const i="end"in s.value?s.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,t.indent)){const i=t.items[t.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=t.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;s.value||re(s.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>t.indent){const i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*d(this.pop()),yield*d(this.step())}*flowCollection(t){const s=t.items[t.items.length-1];if(this.type==="flow-error-end"){let n;do yield*d(this.pop()),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?t.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!s||s.value?t.items.push({start:[],key:i,sep:[]}):s.sep?this.stack.push(i):Object.assign(s,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):(yield*d(this.pop()),yield*d(this.step()))}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===t.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*d(this.pop()),yield*d(this.step());else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const i=xe(n),r=pe(i);Ss(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*d(this.lineEnd(t))}}flowScalar(t){if(this.onNewLine){let s=this.source.indexOf(`
137
+ `,s)+1}yield*d(this.pop());break;default:yield*d(this.pop()),yield*d(this.step())}}*blockMap(e){var n;const s=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const i="end"in s.value?s.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)e.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,e.indent)){const i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),e.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(r&&s.sep&&!s.value){const a=[];for(let l=0;l<s.sep.length;++l){const c=s.sep[l];switch(c.type){case"newline":a.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=s.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):r||s.value?(o.push(this.sourceToken),e.items.push({start:o,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(s.explicitKey)if(s.sep)if(s.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(re(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(gn(s.key)&&!re(s.sep,"newline")){const a=pe(s.start),l=s.key,c=s.sep;c.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else o.length>0?s.sep=s.sep.concat(o,this.sourceToken):s.sep.push(this.sourceToken);else if(re(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const a=pe(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?e.items.push({start:o,key:null,sep:[this.sourceToken]}):re(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);r||s.value?(e.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(a):(Object.assign(s,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){i&&a.type!=="block-seq"&&e.items.push({start:o}),this.stack.push(a);return}}}}yield*d(this.pop()),yield*d(this.step())}*blockSequence(e){var n;const s=e.items[e.items.length-1];switch(this.type){case"newline":if(s.value){const i="end"in s.value?s.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,e.indent)){const i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),e.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=e.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;s.value||re(s.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*d(this.pop()),yield*d(this.step())}*flowCollection(e){const s=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*d(this.pop()),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?e.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?e.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!s||s.value?e.items.push({start:[],key:i,sep:[]}):s.sep?this.stack.push(i):Object.assign(s,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*d(this.pop()),yield*d(this.step()))}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*d(this.pop()),yield*d(this.step());else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const i=xe(n),r=pe(i);Ss(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*d(this.lineEnd(e))}}flowScalar(e){if(this.onNewLine){let s=this.source.indexOf(`
138
138
  `)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
139
- `,s)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){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;const s=xe(t),n=pe(s);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=xe(t),n=pe(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,s){return this.type!=="comment"||this.indent<=s?!1:t.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*d(this.pop())))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*d(this.pop()),yield*d(this.step());break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*d(this.pop()))}}}function bn(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new yn||null,prettyErrors:t}}function Ji(e,t={}){const{lineCounter:s,prettyErrors:n}=bn(t),i=new ts(s==null?void 0:s.addNewLine),r=new es(t),o=Array.from(r.compose(i.parse(e)));if(n&&s)for(const a of o)a.errors.forEach(nt(e,s)),a.warnings.forEach(nt(e,s));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function wn(e,t={}){const{lineCounter:s,prettyErrors:n}=bn(t),i=new ts(s==null?void 0:s.addNewLine),r=new es(t);let o=null;for(const a of r.compose(i.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new le(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&s&&(o.errors.forEach(nt(e,s)),o.warnings.forEach(nt(e,s))),o}function Wi(e,t,s){let n;typeof t=="function"?n=t:s===void 0&&t&&typeof t=="object"&&(s=t);const i=wn(e,s);if(!i)return null;if(i.warnings.forEach(r=>js(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},s))}function xi(e,t,s){var i;let n=null;if(typeof t=="function"||Array.isArray(t)?n=t:s===void 0&&t&&(s=t),typeof s=="string"&&(s=s.length),typeof s=="number"){const r=Math.round(s);s=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=(i=s!=null?s:t)!=null?i:{};if(!r)return}return new Me(e,n,s).toString(s)}const ks=Object.freeze(Object.defineProperty({__proto__:null,Alias:at,CST:Vi,Composer:es,Document:Me,Lexer:mn,LineCounter:yn,Pair:q,Parser:ts,Scalar:A,Schema:yt,YAMLError:Xt,YAMLMap:v,YAMLParseError:le,YAMLSeq:se,YAMLWarning:nn,isAlias:fe,isCollection:D,isDocument:Te,isMap:Ie,isNode:B,isPair:_,isScalar:L,isSeq:Ce,parse:Wi,parseAllDocuments:Ji,parseDocument:wn,stringify:xi,visit:te,visitAsync:ot},Symbol.toStringTag,{value:"Module"})),Gi=`# This is your query - you can modify it directly and click Run to see new results.
139
+ `,s)+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;const s=xe(e),n=pe(s);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=xe(e),n=pe(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,s){return this.type!=="comment"||this.indent<=s?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*d(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*d(this.pop()),yield*d(this.step());break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*d(this.pop()))}}}function bn(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new yn||null,prettyErrors:e}}function Ji(t,e={}){const{lineCounter:s,prettyErrors:n}=bn(e),i=new ts(s==null?void 0:s.addNewLine),r=new es(e),o=Array.from(r.compose(i.parse(t)));if(n&&s)for(const a of o)a.errors.forEach(nt(t,s)),a.warnings.forEach(nt(t,s));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function wn(t,e={}){const{lineCounter:s,prettyErrors:n}=bn(e),i=new ts(s==null?void 0:s.addNewLine),r=new es(e);let o=null;for(const a of r.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new le(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&s&&(o.errors.forEach(nt(t,s)),o.warnings.forEach(nt(t,s))),o}function Wi(t,e,s){let n;typeof e=="function"?n=e:s===void 0&&e&&typeof e=="object"&&(s=e);const i=wn(t,s);if(!i)return null;if(i.warnings.forEach(r=>js(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},s))}function xi(t,e,s){var i;let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:s===void 0&&e&&(s=e),typeof s=="string"&&(s=s.length),typeof s=="number"){const r=Math.round(s);s=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){const{keepUndefined:r}=(i=s!=null?s:e)!=null?i:{};if(!r)return}return new Me(t,n,s).toString(s)}const ks=Object.freeze(Object.defineProperty({__proto__:null,Alias:at,CST:Vi,Composer:es,Document:Me,Lexer:mn,LineCounter:yn,Pair:q,Parser:ts,Scalar:A,Schema:yt,YAMLError:Xt,YAMLMap:v,YAMLParseError:le,YAMLSeq:se,YAMLWarning:nn,isAlias:fe,isCollection:D,isDocument:Te,isMap:Ie,isNode:B,isPair:_,isScalar:L,isSeq:Ce,parse:Wi,parseAllDocuments:Ji,parseDocument:wn,stringify:xi,visit:te,visitAsync:ot},Symbol.toStringTag,{value:"Module"})),Gi=`# This is your query - you can modify it directly and click Run to see new results.
140
140
  # Try uncommenting the elements below
141
141
  # To learn more about the query syntax, visit [Doc URL]
142
142
  ---
@@ -177,5 +177,5 @@ model: {{dataSourceTitle}}
177
177
  # - name: Dimension1
178
178
  # - name: Dimension2
179
179
  # - name: Measure1
180
- # - name: Measure2`;class Hi{constructor(t,s){this.indexedFields={},this.contextTitle=t,this.indexedFields=this.indexFields(s)}indexFields(t){return t.reduce((s,n)=>{const i=n.id;s[i]=n;const r=k.sanitizeDimensionId(i);return i!==r&&(s[r]=J(K({},n),{id:r})),s},{})}concatAggTypes(){return Object.values(T.AggregationTypes).map(s=>T.DimensionalBaseMeasure.aggregationToJAQL(s)).join("|")}simplifyAggFormula(t){const{formula:s,context:n,filter:i}=t;if(!n||!s)return t;const r=Object.keys(n);if(r.length!==1)return t;const o=r[0],a=n[o],l=this.concatAggTypes(),c=new RegExp(`^\\s*(${l})\\(\\[\\w+\\]\\)$`),h=s.match(c);if(h&&s.includes(o)){const u=h[1];return{dim:a.dim,agg:u,title:t.title,filter:i?K({},i):void 0}}return t}simplifyMetadataItemJaql(t){let s=t;if("formula"in t&&(s=this.simplifyAggFormula(t)),delete s.table,delete s.column,delete s.datatype,"context"in s){const n=K({},s.context);Object.keys(n).forEach(i=>{n[i]=this.simplifyMetadataItemJaql(n[i])}),s.context=n}return s}simplifyMetadataItemFilter(t){var i;const s=t;if(s.panel!=="scope")return s;delete s.format;const{jaql:n}=s;return(i=n.filter)!=null&&i.by&&(n.filter.by=this.simplifyAggFormula(n.filter.by)),J(K({},s),{jaql:n})}simplifyMetadataItemFormat(t){const{jaql:{level:s},format:{mask:n}={}}=t;return s&&(n!=null&&n[s])?J(K({},t),{format:{mask:{[s]:n[s]}}}):t}simplifyMetadataItem(t){let s=t;s.panel&&["rows","columns","measures"].includes(s.panel)&&delete s.panel,s=this.simplifyMetadataItemFilter(s),s=this.simplifyMetadataItemFormat(s);const{jaql:n,measure:i,by:r}=s;return J(K({},s),{jaql:this.simplifyMetadataItemJaql(n),by:r?this.simplifyMetadataItemJaql(r):void 0,measure:i?this.simplifyMetadataItemJaql(i):void 0})}simplifyChartRecommendations(t){if(!("axesMapping"in t))return{};const{chartType:s,axesMapping:n,styleOptions:i}=t,r=Object.entries(n).reduce((o,[a,l])=>(o[a]=l.map(c=>T.normalizeAnyColumn(c)),o),{});return{chartType:s,dataOptions:r,styleOptions:i}}getQueryTitleWithChartType(t,s){let n="chartType"in s?s.chartType:"table";return n!=="table"&&(n+=" chart"),`${n} showing ${t.toLowerCase()}`}translateToSimple(t){try{const{jaql:s,chartRecommendations:n,queryTitle:i}=T.cloneDeep(t);return{model:s.datasource.title,metadata:s.metadata.map(r=>this.simplifyMetadataItem(r)),chart:this.simplifyChartRecommendations(n),queryTitle:this.getQueryTitleWithChartType(i,n)}}catch(s){return console.error("Error running toSimpleQuery",s),k.EMPTY_SIMPLE_QUERY_MODEL}}stringifySimple(t){const r=t,{queryTitle:s}=r,n=cs(r,["queryTitle"]),i=new ks.Document(n);return i.commentBefore=` ${k.capitalizeFirstLetter(s)}`,i.directives&&(i.directives.docStart=!0),String(i)}getQueryTemplate(){return k.populatePlaceholders(Gi,{dataSourceTitle:this.contextTitle})}parseSimple(t){try{const s=ks.parseDocument(t),{commentBefore:n}=s,i=k.validateQueryModel(s.toJS());return i.queryTitle=(n==null?void 0:n.trim())||"",i}catch(s){console.error("Error parsing the YAML string",s)}return k.EMPTY_SIMPLE_QUERY_MODEL}expandChartRecommendations(t){if(!t||!("dataOptions"in t))return{};const{chartType:s,dataOptions:n,styleOptions:i}=t;return{chartFamily:T.deriveChartFamily(s),chartType:s,axesMapping:n,styleOptions:i}}expandMetadataItemJaql(t){const{dim:s="",agg:n,context:i}=t;i&&(Object.keys(i).forEach(a=>{i[a]=this.expandMetadataItemJaql(i[a])}),t.context=i);const r=this.indexedFields[s];if(!r)return t;let{filter:o}=t;return o!=null&&o.by&&(o=J(K({},o),{by:this.expandMetadataItemJaql(o.by)}),t.filter=o),K({table:r.table,column:r.column,datatype:r.dimtype,title:n?n+" "+r.title:r.title},t)}expandMetadataItem(t){const{jaql:s,measure:n}=t;return n?J(K({},t),{jaql:this.expandMetadataItemJaql(s),measure:this.expandMetadataItemJaql(n)}):J(K({},t),{jaql:this.expandMetadataItemJaql(s)})}translateToExpanded(t){const{model:s,metadata:n,chart:i,queryTitle:r}=T.cloneDeep(t),o={datasource:{title:s},metadata:n.map(l=>this.expandMetadataItem(l))},a=this.expandChartRecommendations(i);return{jaql:o,chartRecommendations:a,queryTitle:r}}}const Xi=(e,t)=>{const s={chart:"chartWidgetPropsTmpl",pivot:"pivotTableWidgetPropsTmpl"};return`[${e.map(n=>k.getWidgetCode(n,t,s)).join(`,
181
- `)}]`},Zi="dashboardByIdTmpl",er="dashboardTmpl",tr=({dashboardOid:e,uiFramework:t="react"})=>{const s={dashboardOid:e},n=Zi;return k.generateCode(n,s,t)},sr=({dashboardProps:e,uiFramework:t="react"})=>{const s=er,n=e.widgets.some(r=>(T.isChartWidgetProps(r)||T.isPivotTableWidgetProps(r))&&k.checkIfMeasuresExist(r)),i={titleString:e.title,defaultDataSourceString:k.stringifyDataSource(e.defaultDataSource),widgetsString:Xi(e.widgets,t),filtersString:k.stringifyFilters(e.filters),componentString:"Dashboard",extraImportsString:k.stringifyExtraImports(e.filters||e.widgets.map(r=>"filters"in r?r.filters:[]).flat().filter(r=>r!==void 0)||[],n),tabbersOptionsString:k.stringifyProps(e.tabbersOptions||{},k.CODE_TEMPLATES_INDENT),layoutOptionsString:k.stringifyProps(e.layoutOptions||{},k.CODE_TEMPLATES_INDENT),widgetsOptionsString:k.stringifyProps(e.widgetsOptions||{},k.CODE_TEMPLATES_INDENT,!0),styleOptionsString:k.stringifyProps(e.styleOptions||{},k.CODE_TEMPLATES_INDENT)};return k.generateCode(s,i,t)},nr=e=>k.isByIdDashboardCodeParams(e)?tr(e):sr(e),ir=Object.freeze(Object.defineProperty({__proto__:null,toDashboardCode:nr},Symbol.toStringTag,{value:"Module"})),rr="executeQueryTmpl",or="executePivotQueryTmpl",ar=(e,t,s)=>{const n=k.checkIfMeasuresExist(e),i={dataSourceString:k.stringifyDataSource(e.dataSource),dimensionsString:k.stringifyProps(e.dimensions||[]),measuresString:k.stringifyProps(e.measures||[]),filtersString:k.stringifyFilters(e.filters),highlightsString:k.stringifyProps(e.highlights||[]),extraImportsString:k.stringifyExtraImports(e.filters||[],n)};return k.generateCode(s,i,t)},lr=(e,t,s)=>{const n=k.checkIfMeasuresExist(e),i={dataSourceString:k.stringifyDataSource(e.dataSource),rowsString:k.stringifyProps(e.rows||[]),valuesString:k.stringifyProps(e.values||[]),filtersString:k.stringifyFilters(e.filters),extraImportsString:k.stringifyExtraImports(e.filters||[],n)};return k.generateCode(s,i,t)},cr=({queryParams:e,uiFramework:t="react"})=>ar(e,t,rr),fr=({pivotQueryParams:e,uiFramework:t="react"})=>lr(e,t,or),ur=e=>cr(e),hr=e=>fr(e),dr=Object.freeze(Object.defineProperty({__proto__:null,toExecutePivotQueryCode:hr,toExecuteQueryCode:ur},Symbol.toStringTag,{value:"Module"}));class pr{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(t,s){this.keyToValue.set(t,s),this.valueToKey.set(s,t)}getByKey(t){return this.keyToValue.get(t)}getByValue(t){return this.valueToKey.get(t)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class Sn{constructor(t){this.generateIdentifier=t,this.kv=new pr}register(t,s){this.kv.getByValue(t)||(s||(s=this.generateIdentifier(t)),this.kv.set(s,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}}class mr extends Sn{constructor(){super(t=>t.name),this.classToAllowedProps=new Map}register(t,s){typeof s=="object"?(s.allowProps&&this.classToAllowedProps.set(t,s.allowProps),super.register(t,s.identifier)):super.register(t,s)}getAllowedProps(t){return this.classToAllowedProps.get(t)}}function yr(e){if("values"in Object)return Object.values(e);const t=[];for(const s in e)e.hasOwnProperty(s)&&t.push(e[s]);return t}function gr(e,t){const s=yr(e);if("find"in s)return s.find(t);const n=s;for(let i=0;i<n.length;i++){const r=n[i];if(t(r))return r}}function Ae(e,t){Object.entries(e).forEach(([s,n])=>t(n,s))}function et(e,t){return e.indexOf(t)!==-1}function Os(e,t){for(let s=0;s<e.length;s++){const n=e[s];if(t(n))return n}}class br{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return gr(this.transfomers,s=>s.isApplicable(t))}findByName(t){return this.transfomers[t]}}const wr=e=>Object.prototype.toString.call(e).slice(8,-1),kn=e=>typeof e=="undefined",Sr=e=>e===null,je=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,Ft=e=>je(e)&&Object.keys(e).length===0,ne=e=>Array.isArray(e),kr=e=>typeof e=="string",Or=e=>typeof e=="number"&&!isNaN(e),Er=e=>typeof e=="boolean",Ar=e=>e instanceof RegExp,qe=e=>e instanceof Map,ze=e=>e instanceof Set,On=e=>wr(e)==="Symbol",Nr=e=>e instanceof Date&&!isNaN(e.valueOf()),Tr=e=>e instanceof Error,Es=e=>typeof e=="number"&&isNaN(e),Ir=e=>Er(e)||Sr(e)||kn(e)||Or(e)||kr(e)||On(e),Cr=e=>typeof e=="bigint",Lr=e=>e===1/0||e===-1/0,_r=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Mr=e=>e instanceof URL,En=e=>e.replace(/\./g,"\\."),_t=e=>e.map(String).map(En).join("."),Be=e=>{const t=[];let s="";for(let i=0;i<e.length;i++){let r=e.charAt(i);if(r==="\\"&&e.charAt(i+1)==="."){s+=".",i++;continue}if(r==="."){t.push(s),s="";continue}s+=r}const n=s;return t.push(n),t};function G(e,t,s,n){return{isApplicable:e,annotation:t,transform:s,untransform:n}}const An=[G(kn,"undefined",()=>null,()=>{}),G(Cr,"bigint",e=>e.toString(),e=>typeof BigInt!="undefined"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),G(Nr,"Date",e=>e.toISOString(),e=>new Date(e)),G(Tr,"Error",(e,t)=>{const s={name:e.name,message:e.message};return t.allowedErrorProps.forEach(n=>{s[n]=e[n]}),s},(e,t)=>{const s=new Error(e.message);return s.name=e.name,s.stack=e.stack,t.allowedErrorProps.forEach(n=>{s[n]=e[n]}),s}),G(Ar,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),s=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,s)}),G(ze,"set",e=>[...e.values()],e=>new Set(e)),G(qe,"map",e=>[...e.entries()],e=>new Map(e)),G(e=>Es(e)||Lr(e),"number",e=>Es(e)?"NaN":e>0?"Infinity":"-Infinity",Number),G(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),G(Mr,"URL",e=>e.toString(),e=>new URL(e))];function St(e,t,s,n){return{isApplicable:e,annotation:t,transform:s,untransform:n}}const Nn=St((e,t)=>On(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,s)=>{const n=s.symbolRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown symbol");return n}),Dr=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),Tn=St(_r,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const s=Dr[t[1]];if(!s)throw new Error("Trying to deserialize unknown typed array");return new s(e)});function In(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}const Cn=St(In,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const s=t.classRegistry.getAllowedProps(e.constructor);if(!s)return K({},e);const n={};return s.forEach(i=>{n[i]=e[i]}),n},(e,t,s)=>{const n=s.classRegistry.getValue(t[1]);if(!n)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(n.prototype),e)}),Ln=St((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,s)=>{const n=s.customTransformerRegistry.findByName(t[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(e)}),$r=[Cn,Nn,Ln,Tn],As=(e,t)=>{const s=Os($r,i=>i.isApplicable(e,t));if(s)return{value:s.transform(e,t),type:s.annotation(e,t)};const n=Os(An,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation}},_n={};An.forEach(e=>{_n[e.annotation]=e});const Pr=(e,t,s)=>{if(ne(t))switch(t[0]){case"symbol":return Nn.untransform(e,t,s);case"class":return Cn.untransform(e,t,s);case"custom":return Ln.untransform(e,t,s);case"typed-array":return Tn.untransform(e,t,s);default:throw new Error("Unknown transformation: "+t)}else{const n=_n[t];if(!n)throw new Error("Unknown transformation: "+t);return n.untransform(e,s)}},we=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const s=e.keys();for(;t>0;)s.next(),t--;return s.next().value};function Mn(e){if(et(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(et(e,"prototype"))throw new Error("prototype is not allowed as a property");if(et(e,"constructor"))throw new Error("constructor is not allowed as a property")}const Br=(e,t)=>{Mn(t);for(let s=0;s<t.length;s++){const n=t[s];if(ze(e))e=we(e,+n);else if(qe(e)){const i=+n,r=+t[++s]==0?"key":"value",o=we(e,i);switch(r){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[n]}return e},Kt=(e,t,s)=>{if(Mn(t),t.length===0)return s(e);let n=e;for(let r=0;r<t.length-1;r++){const o=t[r];if(ne(n)){const a=+o;n=n[a]}else if(je(n))n=n[o];else if(ze(n)){const a=+o;n=we(n,a)}else if(qe(n)){if(r===t.length-2)break;const l=+o,c=+t[++r]==0?"key":"value",h=we(n,l);switch(c){case"key":n=h;break;case"value":n=n.get(h);break}}}const i=t[t.length-1];if(ne(n)?n[+i]=s(n[+i]):je(n)&&(n[i]=s(n[i])),ze(n)){const r=we(n,+i),o=s(r);r!==o&&(n.delete(r),n.add(o))}if(qe(n)){const r=+t[t.length-2],o=we(n,r);switch(+i==0?"key":"value"){case"key":{const l=s(o);n.set(l,n.get(o)),l!==o&&n.delete(o);break}case"value":{n.set(o,s(n.get(o)));break}}}return e};function jt(e,t,s=[]){if(!e)return;if(!ne(e)){Ae(e,(r,o)=>jt(r,t,[...s,...Be(o)]));return}const[n,i]=e;i&&Ae(i,(r,o)=>{jt(r,t,[...s,...Be(o)])}),t(n,s)}function Rr(e,t,s){return jt(t,(n,i)=>{e=Kt(e,i,r=>Pr(r,n,s))}),e}function Fr(e,t){function s(n,i){const r=Br(e,Be(i));n.map(Be).forEach(o=>{e=Kt(e,o,()=>r)})}if(ne(t)){const[n,i]=t;n.forEach(r=>{e=Kt(e,Be(r),()=>e)}),i&&Ae(i,s)}else Ae(t,s);return e}const Kr=(e,t)=>je(e)||ne(e)||qe(e)||ze(e)||In(e,t);function jr(e,t,s){const n=s.get(e);n?n.push(t):s.set(e,[t])}function qr(e,t){const s={};let n;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(a=>a.map(String)).sort((a,l)=>a.length-l.length));const[r,...o]=i;r.length===0?n=o.map(_t):s[_t(r)]=o.map(_t)}),n?Ft(s)?[n]:[n,s]:Ft(s)?void 0:s}const Dn=(e,t,s,n,i=[],r=[],o=new Map)=>{var y;const a=Ir(e);if(!a){jr(e,i,t);const m=o.get(e);if(m)return n?{transformedValue:null}:m}if(!Kr(e,s)){const m=As(e,s),f=m?{transformedValue:m.value,annotations:[m.type]}:{transformedValue:e};return a||o.set(e,f),f}if(et(r,e))return{transformedValue:null};const l=As(e,s),c=(y=l==null?void 0:l.value)!=null?y:e,h=ne(c)?[]:{},u={};Ae(c,(m,f)=>{if(f==="__proto__"||f==="constructor"||f==="prototype")throw new Error(`Detected property ${f}. This is a prototype pollution risk, please remove it from your object.`);const g=Dn(m,t,s,n,[...i,f],[...r,e],o);h[f]=g.transformedValue,ne(g.annotations)?u[f]=g.annotations:je(g.annotations)&&Ae(g.annotations,(b,w)=>{u[En(f)+"."+w]=b})});const p=Ft(u)?{transformedValue:h,annotations:l?[l.type]:void 0}:{transformedValue:h,annotations:l?[l.type,u]:u};return a||o.set(e,p),p};function $n(e){return Object.prototype.toString.call(e).slice(8,-1)}function Ns(e){return $n(e)==="Array"}function zr(e){if($n(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function Ur(e,t,s,n,i){const r={}.propertyIsEnumerable.call(n,t)?"enumerable":"nonenumerable";r==="enumerable"&&(e[t]=s),i&&r==="nonenumerable"&&Object.defineProperty(e,t,{value:s,enumerable:!1,writable:!0,configurable:!0})}function qt(e,t={}){if(Ns(e))return e.map(i=>qt(i,t));if(!zr(e))return e;const s=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols(e);return[...s,...n].reduce((i,r)=>{if(Ns(t.props)&&!t.props.includes(r))return i;const o=e[r],a=qt(o,t);return Ur(i,r,a,e,t.nonenumerable),i},{})}class O{constructor({dedupe:t=!1}={}){this.classRegistry=new mr,this.symbolRegistry=new Sn(s=>{var n;return(n=s.description)!=null?n:""}),this.customTransformerRegistry=new br,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const s=new Map,n=Dn(t,s,this,this.dedupe),i={json:n.transformedValue};n.annotations&&(i.meta=J(K({},i.meta),{values:n.annotations}));const r=qr(s,this.dedupe);return r&&(i.meta=J(K({},i.meta),{referentialEqualities:r})),i}deserialize(t){const{json:s,meta:n}=t;let i=qt(s);return n!=null&&n.values&&(i=Rr(i,n.values,this)),n!=null&&n.referentialEqualities&&(i=Fr(i,n.referentialEqualities)),i}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t))}registerClass(t,s){this.classRegistry.register(t,s)}registerSymbol(t,s){this.symbolRegistry.register(t,s)}registerCustom(t,s){this.customTransformerRegistry.register(K({name:s},t))}allowErrorProps(...t){this.allowedErrorProps.push(...t)}}O.defaultInstance=new O;O.serialize=O.defaultInstance.serialize.bind(O.defaultInstance);O.deserialize=O.defaultInstance.deserialize.bind(O.defaultInstance);O.stringify=O.defaultInstance.stringify.bind(O.defaultInstance);O.parse=O.defaultInstance.parse.bind(O.defaultInstance);O.registerClass=O.defaultInstance.registerClass.bind(O.defaultInstance);O.registerSymbol=O.defaultInstance.registerSymbol.bind(O.defaultInstance);O.registerCustom=O.defaultInstance.registerCustom.bind(O.defaultInstance);O.allowErrorProps=O.defaultInstance.allowErrorProps.bind(O.defaultInstance);const ue=e=>e===void 0?T.Sort.None:e,vr=e=>new k.JaqlElement(e.metadataItem,e.type),ss=e=>new T.DimensionalAttribute(e.name,e.expression,e.type,e.description,ue(e.sort),e.dataSource,e.composeCode),ns=e=>new T.DimensionalLevelAttribute(e.name,e.expression,e.granularity,e.format,e.description,ue(e.sort),e.dataSource,e.composeCode),V=e=>{switch(e.__serializable){case"DimensionalAttribute":return ss(e);case"DimensionalLevelAttribute":return ns(e);default:return e}},Pn=e=>new rt.DimensionalDimension(e.name,e.expression,e.attributes.map(t=>V(t)),e.dimensions.map(t=>Vr(t)),e.type,e.description,ue(e.sort),e.dataSource,e.composeCode,e.defaultAttribute?V(e.defaultAttribute):void 0),Bn=e=>new rt.DimensionalDateDimension(e.name,e.expression,e.description,ue(e.sort),e.dataSource,e.composeCode),Vr=e=>{switch(e.__serializable){case"DimensionalDimension":return Pn(e);case"DimensionalDateDimension":return Bn(e);default:return e}},is=e=>new T.DimensionalBaseMeasure(e.name,V(e.attribute),e.aggregation,e.format,e.description,ue(e.sort),e.dataSource,e.composeCode),rs=e=>{const t=Object.fromEntries(Object.entries(e.context).map(([s,n])=>{if(n&&typeof n=="object"&&"__serializable"in n)switch(n.__serializable){case"DimensionalAttribute":return[s,ss(n)];case"DimensionalLevelAttribute":return[s,ns(n)];case"DimensionalBaseMeasure":return[s,is(n)];case"DimensionalCalculatedMeasure":return[s,rs(n)];default:return[s,n]}return[s,n]}));return new T.DimensionalCalculatedMeasure(e.name,e.expression,t,e.format,e.description,ue(e.sort),e.dataSource,e.composeCode)},Rn=e=>new T.DimensionalMeasureTemplate(e.name,V(e.attribute),e.format,e.description,ue(e.sort),e.dataSource,e.composeCode),Ts=e=>{switch(e.__serializable){case"DimensionalBaseMeasure":return is(e);case"DimensionalCalculatedMeasure":return rs(e);case"DimensionalMeasureTemplate":return Rn(e);default:return e}},j=e=>{switch(e.__serializable){case"MembersFilter":return new T.MembersFilter(V(e.attribute),e.members,e.config.backgroundFilter?J(K({},e.config),{backgroundFilter:j(e.config.backgroundFilter)}):e.config,e.composeCode);case"LogicalAttributeFilter":return new T.LogicalAttributeFilter(e.filters.map(s=>j(s)),e.operator,e.config,e.composeCode);case"CascadingFilter":return new T.CascadingFilter(e._filters.map(s=>j(s)),e.config,e.composeCode);case"ExcludeFilter":return new T.ExcludeFilter(j(e.filter),e.input?j(e.input):void 0,e.config,e.composeCode);case"MeasureFilter":return new T.MeasureFilter(V(e.attribute),Ts(e.measure),e.operatorA,e.valueA,e.operatorB,e.valueB,e.config,e.composeCode);case"RankingFilter":return new T.RankingFilter(V(e.attribute),Ts(e.measure),e.operator,e.count,e.config,e.composeCode);case"NumericFilter":return new T.NumericFilter(V(e.attribute),e.operatorA,e.valueA,e.operatorB,e.valueB,e.config,e.composeCode);case"TextFilter":return new T.TextFilter(V(e.attribute),e.operatorA,e.valueA,e.config,e.composeCode);case"DateRangeFilter":{const{valueA:s,valueB:n}=e;return new T.DateRangeFilter(V(e.attribute),s,n,e.config,e.composeCode)}case"RelativeDateFilter":return new T.RelativeDateFilter(V(e.attribute),e.offset,e.count,e.operator,e.anchor,e.config,e.composeCode);case"CustomFilter":return new T.CustomFilter(V(e.attribute),e.jaqlExpression,e.config,e.composeCode);default:return e}};O.registerCustom({isApplicable:e=>e instanceof k.JaqlElement,serialize:e=>e.serialize(),deserialize:e=>vr(e)},"JaqlElement");O.registerCustom({isApplicable:e=>e instanceof T.DimensionalAttribute&&e.type!=="datelevel",serialize:e=>e.serialize(),deserialize:e=>ss(e)},"DimensionalAttribute");O.registerCustom({isApplicable:e=>e instanceof T.DimensionalLevelAttribute,serialize:e=>e.serialize(),deserialize:e=>ns(e)},"DimensionalLevelAttribute");O.registerCustom({isApplicable:e=>e instanceof rt.DimensionalDimension&&e.type!=="datedimension",serialize:e=>e.serialize(),deserialize:e=>Pn(e)},"DimensionalDimension");O.registerCustom({isApplicable:e=>e instanceof rt.DimensionalDateDimension,serialize:e=>e.serialize(),deserialize:e=>Bn(e)},"DimensionalDateDimension");O.registerCustom({isApplicable:e=>e instanceof T.DimensionalBaseMeasure,serialize:e=>e.serialize(),deserialize:e=>is(e)},"DimensionalBaseMeasure");O.registerCustom({isApplicable:e=>e instanceof T.DimensionalCalculatedMeasure,serialize:e=>e.serialize(),deserialize:e=>rs(e)},"DimensionalCalculatedMeasure");O.registerCustom({isApplicable:e=>e instanceof T.DimensionalMeasureTemplate,serialize:e=>e.serialize(),deserialize:e=>Rn(e)},"DimensionalMeasureTemplate");O.registerCustom({isApplicable:e=>e instanceof T.MembersFilter,serialize:e=>e.serialize(),deserialize:e=>j(e)},"MembersFilter");O.registerCustom({isApplicable:e=>e instanceof T.LogicalAttributeFilter,serialize:e=>e.serialize(),deserialize:e=>j(e)},"LogicalAttributeFilter");O.registerCustom({isApplicable:e=>e instanceof T.CascadingFilter,serialize:e=>e.serialize(),deserialize:e=>j(e)},"CascadingFilter");O.registerCustom({isApplicable:e=>e instanceof T.ExcludeFilter,serialize:e=>e.serialize(),deserialize:e=>j(e)},"ExcludeFilter");O.registerCustom({isApplicable:e=>e instanceof T.MeasureFilter,serialize:e=>e.serialize(),deserialize:e=>j(e)},"MeasureFilter");O.registerCustom({isApplicable:e=>e instanceof T.RankingFilter,serialize:e=>e.serialize(),deserialize:e=>j(e)},"RankingFilter");O.registerCustom({isApplicable:e=>e instanceof T.NumericFilter,serialize:e=>e.serialize(),deserialize:e=>j(e)},"NumericFilter");O.registerCustom({isApplicable:e=>e instanceof T.TextFilter,serialize:e=>e.serialize(),deserialize:e=>j(e)},"TextFilter");O.registerCustom({isApplicable:e=>e instanceof T.DateRangeFilter,serialize:e=>e.serialize(),deserialize:e=>j(e)},"DateRangeFilter");O.registerCustom({isApplicable:e=>e instanceof T.RelativeDateFilter,serialize:e=>e.serialize(),deserialize:e=>j(e)},"RelativeDateFilter");O.registerCustom({isApplicable:e=>e instanceof T.CustomFilter,serialize:e=>e.serialize(),deserialize:e=>j(e)},"CustomFilter");const Qr=O;exports.EMPTY_EXPANDED_QUERY_MODEL=k.EMPTY_EXPANDED_QUERY_MODEL;exports.EMPTY_SIMPLE_QUERY_MODEL=k.EMPTY_SIMPLE_QUERY_MODEL;exports.getChartDataOptions=k.getChartDataOptions;exports.getChartOptions=k.getChartOptions;exports.getChartRecommendationsOrDefault=k.getChartRecommendationsOrDefault;exports.getChartStyleOptions=k.getChartStyleOptions;exports.isByIdDashboardCodeParams=k.isByIdDashboardCodeParams;exports.isByIdWidgetCodeParams=k.isByIdWidgetCodeParams;exports.isClientSideDashboardCodeParams=k.isClientSideDashboardCodeParams;exports.isClientSideWidgetCodeParams=k.isClientSideWidgetCodeParams;exports.simplifyMetadataItem=k.simplifyMetadataItem;exports.widgetComposer=k.widgetComposer;exports.CustomSuperJSON=Qr;exports.QueryTranslator=Hi;exports.dashboardComposer=ir;exports.executeQueryComposer=dr;
180
+ # - name: Measure2`;class Hi{constructor(e,s){this.indexedFields={},this.contextTitle=e,this.indexedFields=this.indexFields(s)}indexFields(e){return e.reduce((s,n)=>{const i=n.id;s[i]=n;const r=k.sanitizeDimensionId(i);return i!==r&&(s[r]=J(K({},n),{id:r})),s},{})}concatAggTypes(){return Object.values(T.AggregationTypes).map(s=>T.DimensionalBaseMeasure.aggregationToJAQL(s)).join("|")}simplifyAggFormula(e){const{formula:s,context:n,filter:i}=e;if(!n||!s)return e;const r=Object.keys(n);if(r.length!==1)return e;const o=r[0],a=n[o],l=this.concatAggTypes(),c=new RegExp(`^\\s*(${l})\\(\\[\\w+\\]\\)$`),h=s.match(c);if(h&&s.includes(o)){const u=h[1];return{dim:a.dim,agg:u,title:e.title,filter:i?K({},i):void 0}}return e}simplifyMetadataItemJaql(e){let s=e;if("formula"in e&&(s=this.simplifyAggFormula(e)),delete s.table,delete s.column,delete s.datatype,"context"in s){const n=K({},s.context);Object.keys(n).forEach(i=>{n[i]=this.simplifyMetadataItemJaql(n[i])}),s.context=n}return s}simplifyMetadataItemFilter(e){var i;const s=e;if(s.panel!=="scope")return s;delete s.format;const{jaql:n}=s;return(i=n.filter)!=null&&i.by&&(n.filter.by=this.simplifyAggFormula(n.filter.by)),J(K({},s),{jaql:n})}simplifyMetadataItemFormat(e){const{jaql:{level:s},format:{mask:n}={}}=e;return s&&(n!=null&&n[s])?J(K({},e),{format:{mask:{[s]:n[s]}}}):e}simplifyMetadataItem(e){let s=e;s.panel&&["rows","columns","measures"].includes(s.panel)&&delete s.panel,s=this.simplifyMetadataItemFilter(s),s=this.simplifyMetadataItemFormat(s);const{jaql:n,measure:i,by:r}=s;return J(K({},s),{jaql:this.simplifyMetadataItemJaql(n),by:r?this.simplifyMetadataItemJaql(r):void 0,measure:i?this.simplifyMetadataItemJaql(i):void 0})}simplifyChartRecommendations(e){if(!("axesMapping"in e))return{};const{chartType:s,axesMapping:n,styleOptions:i}=e,r=Object.entries(n).reduce((o,[a,l])=>(o[a]=l.map(c=>T.normalizeAnyColumn(c)),o),{});return{chartType:s,dataOptions:r,styleOptions:i}}getQueryTitleWithChartType(e,s){let n="chartType"in s?s.chartType:"table";return n!=="table"&&(n+=" chart"),`${n} showing ${e.toLowerCase()}`}translateToSimple(e){try{const{jaql:s,chartRecommendations:n,queryTitle:i}=T.cloneDeep(e);return{model:s.datasource.title,metadata:s.metadata.map(r=>this.simplifyMetadataItem(r)),chart:this.simplifyChartRecommendations(n),queryTitle:this.getQueryTitleWithChartType(i,n)}}catch(s){return console.error("Error running toSimpleQuery",s),k.EMPTY_SIMPLE_QUERY_MODEL}}stringifySimple(e){const r=e,{queryTitle:s}=r,n=cs(r,["queryTitle"]),i=new ks.Document(n);return i.commentBefore=` ${k.capitalizeFirstLetter(s)}`,i.directives&&(i.directives.docStart=!0),String(i)}getQueryTemplate(){return k.populatePlaceholders(Gi,{dataSourceTitle:this.contextTitle})}parseSimple(e){try{const s=ks.parseDocument(e),{commentBefore:n}=s,i=k.validateQueryModel(s.toJS());return i.queryTitle=(n==null?void 0:n.trim())||"",i}catch(s){console.error("Error parsing the YAML string",s)}return k.EMPTY_SIMPLE_QUERY_MODEL}expandChartRecommendations(e){if(!e||!("dataOptions"in e))return{};const{chartType:s,dataOptions:n,styleOptions:i}=e;return{chartFamily:T.deriveChartFamily(s),chartType:s,axesMapping:n,styleOptions:i}}expandMetadataItemJaql(e){const{dim:s="",agg:n,context:i}=e;i&&(Object.keys(i).forEach(a=>{i[a]=this.expandMetadataItemJaql(i[a])}),e.context=i);const r=this.indexedFields[s];if(!r)return e;let{filter:o}=e;return o!=null&&o.by&&(o=J(K({},o),{by:this.expandMetadataItemJaql(o.by)}),e.filter=o),K({table:r.table,column:r.column,datatype:r.dimtype,title:n?n+" "+r.title:r.title},e)}expandMetadataItem(e){const{jaql:s,measure:n}=e;return n?J(K({},e),{jaql:this.expandMetadataItemJaql(s),measure:this.expandMetadataItemJaql(n)}):J(K({},e),{jaql:this.expandMetadataItemJaql(s)})}translateToExpanded(e){const{model:s,metadata:n,chart:i,queryTitle:r}=T.cloneDeep(e),o={datasource:{title:s},metadata:n.map(l=>this.expandMetadataItem(l))},a=this.expandChartRecommendations(i);return{jaql:o,chartRecommendations:a,queryTitle:r}}}const Xi=(t,e)=>{const s={chart:"chartWidgetPropsTmpl",pivot:"pivotTableWidgetPropsTmpl"};return`[${t.map(n=>k.getWidgetCode(n,e,s)).join(`,
181
+ `)}]`},Zi="dashboardByIdTmpl",er="dashboardTmpl",tr=({dashboardOid:t,uiFramework:e="react"})=>{const s={dashboardOid:t},n=Zi;return k.generateCode(n,s,e)},sr=({dashboardProps:t,uiFramework:e="react"})=>{const s=er,n=t.widgets.some(r=>(T.isChartWidgetProps(r)||T.isPivotTableWidgetProps(r))&&k.checkIfMeasuresExist(r)),i={titleString:t.title,defaultDataSourceString:k.stringifyDataSource(t.defaultDataSource),widgetsString:Xi(t.widgets,e),filtersString:k.stringifyFilters(t.filters),componentString:"Dashboard",extraImportsString:k.stringifyExtraImports(t.filters||t.widgets.map(r=>"filters"in r?r.filters:[]).flat().filter(r=>r!==void 0)||[],n),tabbersOptionsString:k.stringifyProps(t.tabbersOptions||{},k.CODE_TEMPLATES_INDENT),layoutOptionsString:k.stringifyProps(t.layoutOptions||{},k.CODE_TEMPLATES_INDENT),widgetsOptionsString:k.stringifyProps(t.widgetsOptions||{},k.CODE_TEMPLATES_INDENT,!0),styleOptionsString:k.stringifyProps(t.styleOptions||{},k.CODE_TEMPLATES_INDENT)};return k.generateCode(s,i,e)},nr=t=>k.isByIdDashboardCodeParams(t)?tr(t):sr(t),ir=Object.freeze(Object.defineProperty({__proto__:null,toDashboardCode:nr},Symbol.toStringTag,{value:"Module"})),rr="executeQueryTmpl",or="executePivotQueryTmpl",ar=(t,e,s)=>{const n=k.checkIfMeasuresExist(t),i={dataSourceString:k.stringifyDataSource(t.dataSource),dimensionsString:k.stringifyProps(t.dimensions||[]),measuresString:k.stringifyProps(t.measures||[]),filtersString:k.stringifyFilters(t.filters),highlightsString:k.stringifyProps(t.highlights||[]),extraImportsString:k.stringifyExtraImports(t.filters||[],n)};return k.generateCode(s,i,e)},lr=(t,e,s)=>{const n=k.checkIfMeasuresExist(t),i={dataSourceString:k.stringifyDataSource(t.dataSource),rowsString:k.stringifyProps(t.rows||[]),valuesString:k.stringifyProps(t.values||[]),filtersString:k.stringifyFilters(t.filters),extraImportsString:k.stringifyExtraImports(t.filters||[],n)};return k.generateCode(s,i,e)},cr=({queryParams:t,uiFramework:e="react"})=>ar(t,e,rr),fr=({pivotQueryParams:t,uiFramework:e="react"})=>lr(t,e,or),ur=t=>cr(t),hr=t=>fr(t),dr=Object.freeze(Object.defineProperty({__proto__:null,toExecutePivotQueryCode:hr,toExecuteQueryCode:ur},Symbol.toStringTag,{value:"Module"}));class pr{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,s){this.keyToValue.set(e,s),this.valueToKey.set(s,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class Sn{constructor(e){this.generateIdentifier=e,this.kv=new pr}register(e,s){this.kv.getByValue(e)||(s||(s=this.generateIdentifier(e)),this.kv.set(s,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}}class mr extends Sn{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,s){typeof s=="object"?(s.allowProps&&this.classToAllowedProps.set(e,s.allowProps),super.register(e,s.identifier)):super.register(e,s)}getAllowedProps(e){return this.classToAllowedProps.get(e)}}function yr(t){if("values"in Object)return Object.values(t);const e=[];for(const s in t)t.hasOwnProperty(s)&&e.push(t[s]);return e}function gr(t,e){const s=yr(t);if("find"in s)return s.find(e);const n=s;for(let i=0;i<n.length;i++){const r=n[i];if(e(r))return r}}function Ae(t,e){Object.entries(t).forEach(([s,n])=>e(n,s))}function et(t,e){return t.indexOf(e)!==-1}function Os(t,e){for(let s=0;s<t.length;s++){const n=t[s];if(e(n))return n}}class br{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return gr(this.transfomers,s=>s.isApplicable(e))}findByName(e){return this.transfomers[e]}}const wr=t=>Object.prototype.toString.call(t).slice(8,-1),kn=t=>typeof t=="undefined",Sr=t=>t===null,je=t=>typeof t!="object"||t===null||t===Object.prototype?!1:Object.getPrototypeOf(t)===null?!0:Object.getPrototypeOf(t)===Object.prototype,Ft=t=>je(t)&&Object.keys(t).length===0,ne=t=>Array.isArray(t),kr=t=>typeof t=="string",Or=t=>typeof t=="number"&&!isNaN(t),Er=t=>typeof t=="boolean",Ar=t=>t instanceof RegExp,qe=t=>t instanceof Map,ze=t=>t instanceof Set,On=t=>wr(t)==="Symbol",Nr=t=>t instanceof Date&&!isNaN(t.valueOf()),Tr=t=>t instanceof Error,Es=t=>typeof t=="number"&&isNaN(t),Ir=t=>Er(t)||Sr(t)||kn(t)||Or(t)||kr(t)||On(t),Cr=t=>typeof t=="bigint",Lr=t=>t===1/0||t===-1/0,_r=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),Mr=t=>t instanceof URL,En=t=>t.replace(/\./g,"\\."),_t=t=>t.map(String).map(En).join("."),Be=t=>{const e=[];let s="";for(let i=0;i<t.length;i++){let r=t.charAt(i);if(r==="\\"&&t.charAt(i+1)==="."){s+=".",i++;continue}if(r==="."){e.push(s),s="";continue}s+=r}const n=s;return e.push(n),e};function G(t,e,s,n){return{isApplicable:t,annotation:e,transform:s,untransform:n}}const An=[G(kn,"undefined",()=>null,()=>{}),G(Cr,"bigint",t=>t.toString(),t=>typeof BigInt!="undefined"?BigInt(t):(console.error("Please add a BigInt polyfill."),t)),G(Nr,"Date",t=>t.toISOString(),t=>new Date(t)),G(Tr,"Error",(t,e)=>{const s={name:t.name,message:t.message};return e.allowedErrorProps.forEach(n=>{s[n]=t[n]}),s},(t,e)=>{const s=new Error(t.message);return s.name=t.name,s.stack=t.stack,e.allowedErrorProps.forEach(n=>{s[n]=t[n]}),s}),G(Ar,"regexp",t=>""+t,t=>{const e=t.slice(1,t.lastIndexOf("/")),s=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,s)}),G(ze,"set",t=>[...t.values()],t=>new Set(t)),G(qe,"map",t=>[...t.entries()],t=>new Map(t)),G(t=>Es(t)||Lr(t),"number",t=>Es(t)?"NaN":t>0?"Infinity":"-Infinity",Number),G(t=>t===0&&1/t===-1/0,"number",()=>"-0",Number),G(Mr,"URL",t=>t.toString(),t=>new URL(t))];function St(t,e,s,n){return{isApplicable:t,annotation:e,transform:s,untransform:n}}const Nn=St((t,e)=>On(t)?!!e.symbolRegistry.getIdentifier(t):!1,(t,e)=>["symbol",e.symbolRegistry.getIdentifier(t)],t=>t.description,(t,e,s)=>{const n=s.symbolRegistry.getValue(e[1]);if(!n)throw new Error("Trying to deserialize unknown symbol");return n}),Dr=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((t,e)=>(t[e.name]=e,t),{}),Tn=St(_r,t=>["typed-array",t.constructor.name],t=>[...t],(t,e)=>{const s=Dr[e[1]];if(!s)throw new Error("Trying to deserialize unknown typed array");return new s(t)});function In(t,e){return t!=null&&t.constructor?!!e.classRegistry.getIdentifier(t.constructor):!1}const Cn=St(In,(t,e)=>["class",e.classRegistry.getIdentifier(t.constructor)],(t,e)=>{const s=e.classRegistry.getAllowedProps(t.constructor);if(!s)return K({},t);const n={};return s.forEach(i=>{n[i]=t[i]}),n},(t,e,s)=>{const n=s.classRegistry.getValue(e[1]);if(!n)throw new Error(`Trying to deserialize unknown class '${e[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(n.prototype),t)}),Ln=St((t,e)=>!!e.customTransformerRegistry.findApplicable(t),(t,e)=>["custom",e.customTransformerRegistry.findApplicable(t).name],(t,e)=>e.customTransformerRegistry.findApplicable(t).serialize(t),(t,e,s)=>{const n=s.customTransformerRegistry.findByName(e[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(t)}),$r=[Cn,Nn,Ln,Tn],As=(t,e)=>{const s=Os($r,i=>i.isApplicable(t,e));if(s)return{value:s.transform(t,e),type:s.annotation(t,e)};const n=Os(An,i=>i.isApplicable(t,e));if(n)return{value:n.transform(t,e),type:n.annotation}},_n={};An.forEach(t=>{_n[t.annotation]=t});const Pr=(t,e,s)=>{if(ne(e))switch(e[0]){case"symbol":return Nn.untransform(t,e,s);case"class":return Cn.untransform(t,e,s);case"custom":return Ln.untransform(t,e,s);case"typed-array":return Tn.untransform(t,e,s);default:throw new Error("Unknown transformation: "+e)}else{const n=_n[e];if(!n)throw new Error("Unknown transformation: "+e);return n.untransform(t,s)}},we=(t,e)=>{if(e>t.size)throw new Error("index out of bounds");const s=t.keys();for(;e>0;)s.next(),e--;return s.next().value};function Mn(t){if(et(t,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(et(t,"prototype"))throw new Error("prototype is not allowed as a property");if(et(t,"constructor"))throw new Error("constructor is not allowed as a property")}const Br=(t,e)=>{Mn(e);for(let s=0;s<e.length;s++){const n=e[s];if(ze(t))t=we(t,+n);else if(qe(t)){const i=+n,r=+e[++s]==0?"key":"value",o=we(t,i);switch(r){case"key":t=o;break;case"value":t=t.get(o);break}}else t=t[n]}return t},Kt=(t,e,s)=>{if(Mn(e),e.length===0)return s(t);let n=t;for(let r=0;r<e.length-1;r++){const o=e[r];if(ne(n)){const a=+o;n=n[a]}else if(je(n))n=n[o];else if(ze(n)){const a=+o;n=we(n,a)}else if(qe(n)){if(r===e.length-2)break;const l=+o,c=+e[++r]==0?"key":"value",h=we(n,l);switch(c){case"key":n=h;break;case"value":n=n.get(h);break}}}const i=e[e.length-1];if(ne(n)?n[+i]=s(n[+i]):je(n)&&(n[i]=s(n[i])),ze(n)){const r=we(n,+i),o=s(r);r!==o&&(n.delete(r),n.add(o))}if(qe(n)){const r=+e[e.length-2],o=we(n,r);switch(+i==0?"key":"value"){case"key":{const l=s(o);n.set(l,n.get(o)),l!==o&&n.delete(o);break}case"value":{n.set(o,s(n.get(o)));break}}}return t};function jt(t,e,s=[]){if(!t)return;if(!ne(t)){Ae(t,(r,o)=>jt(r,e,[...s,...Be(o)]));return}const[n,i]=t;i&&Ae(i,(r,o)=>{jt(r,e,[...s,...Be(o)])}),e(n,s)}function Rr(t,e,s){return jt(e,(n,i)=>{t=Kt(t,i,r=>Pr(r,n,s))}),t}function Fr(t,e){function s(n,i){const r=Br(t,Be(i));n.map(Be).forEach(o=>{t=Kt(t,o,()=>r)})}if(ne(e)){const[n,i]=e;n.forEach(r=>{t=Kt(t,Be(r),()=>t)}),i&&Ae(i,s)}else Ae(e,s);return t}const Kr=(t,e)=>je(t)||ne(t)||qe(t)||ze(t)||In(t,e);function jr(t,e,s){const n=s.get(t);n?n.push(e):s.set(t,[e])}function qr(t,e){const s={};let n;return t.forEach(i=>{if(i.length<=1)return;e||(i=i.map(a=>a.map(String)).sort((a,l)=>a.length-l.length));const[r,...o]=i;r.length===0?n=o.map(_t):s[_t(r)]=o.map(_t)}),n?Ft(s)?[n]:[n,s]:Ft(s)?void 0:s}const Dn=(t,e,s,n,i=[],r=[],o=new Map)=>{var y;const a=Ir(t);if(!a){jr(t,i,e);const m=o.get(t);if(m)return n?{transformedValue:null}:m}if(!Kr(t,s)){const m=As(t,s),f=m?{transformedValue:m.value,annotations:[m.type]}:{transformedValue:t};return a||o.set(t,f),f}if(et(r,t))return{transformedValue:null};const l=As(t,s),c=(y=l==null?void 0:l.value)!=null?y:t,h=ne(c)?[]:{},u={};Ae(c,(m,f)=>{if(f==="__proto__"||f==="constructor"||f==="prototype")throw new Error(`Detected property ${f}. This is a prototype pollution risk, please remove it from your object.`);const g=Dn(m,e,s,n,[...i,f],[...r,t],o);h[f]=g.transformedValue,ne(g.annotations)?u[f]=g.annotations:je(g.annotations)&&Ae(g.annotations,(b,w)=>{u[En(f)+"."+w]=b})});const p=Ft(u)?{transformedValue:h,annotations:l?[l.type]:void 0}:{transformedValue:h,annotations:l?[l.type,u]:u};return a||o.set(t,p),p};function $n(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ns(t){return $n(t)==="Array"}function zr(t){if($n(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return!!e&&e.constructor===Object&&e===Object.prototype}function Ur(t,e,s,n,i){const r={}.propertyIsEnumerable.call(n,e)?"enumerable":"nonenumerable";r==="enumerable"&&(t[e]=s),i&&r==="nonenumerable"&&Object.defineProperty(t,e,{value:s,enumerable:!1,writable:!0,configurable:!0})}function qt(t,e={}){if(Ns(t))return t.map(i=>qt(i,e));if(!zr(t))return t;const s=Object.getOwnPropertyNames(t),n=Object.getOwnPropertySymbols(t);return[...s,...n].reduce((i,r)=>{if(Ns(e.props)&&!e.props.includes(r))return i;const o=t[r],a=qt(o,e);return Ur(i,r,a,t,e.nonenumerable),i},{})}class O{constructor({dedupe:e=!1}={}){this.classRegistry=new mr,this.symbolRegistry=new Sn(s=>{var n;return(n=s.description)!=null?n:""}),this.customTransformerRegistry=new br,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const s=new Map,n=Dn(e,s,this,this.dedupe),i={json:n.transformedValue};n.annotations&&(i.meta=J(K({},i.meta),{values:n.annotations}));const r=qr(s,this.dedupe);return r&&(i.meta=J(K({},i.meta),{referentialEqualities:r})),i}deserialize(e){const{json:s,meta:n}=e;let i=qt(s);return n!=null&&n.values&&(i=Rr(i,n.values,this)),n!=null&&n.referentialEqualities&&(i=Fr(i,n.referentialEqualities)),i}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,s){this.classRegistry.register(e,s)}registerSymbol(e,s){this.symbolRegistry.register(e,s)}registerCustom(e,s){this.customTransformerRegistry.register(K({name:s},e))}allowErrorProps(...e){this.allowedErrorProps.push(...e)}}O.defaultInstance=new O;O.serialize=O.defaultInstance.serialize.bind(O.defaultInstance);O.deserialize=O.defaultInstance.deserialize.bind(O.defaultInstance);O.stringify=O.defaultInstance.stringify.bind(O.defaultInstance);O.parse=O.defaultInstance.parse.bind(O.defaultInstance);O.registerClass=O.defaultInstance.registerClass.bind(O.defaultInstance);O.registerSymbol=O.defaultInstance.registerSymbol.bind(O.defaultInstance);O.registerCustom=O.defaultInstance.registerCustom.bind(O.defaultInstance);O.allowErrorProps=O.defaultInstance.allowErrorProps.bind(O.defaultInstance);const ue=t=>t===void 0?T.Sort.None:t,vr=t=>new k.JaqlElement(t.metadataItem,t.type),ss=t=>new T.DimensionalAttribute(t.name,t.expression,t.type,t.description,ue(t.sort),t.dataSource,t.composeCode),ns=t=>new T.DimensionalLevelAttribute(t.name,t.expression,t.granularity,t.format,t.description,ue(t.sort),t.dataSource,t.composeCode),V=t=>{switch(t.__serializable){case"DimensionalAttribute":return ss(t);case"DimensionalLevelAttribute":return ns(t);default:return t}},Pn=t=>new rt.DimensionalDimension(t.name,t.expression,t.attributes.map(V),t.dimensions.map(Vr),t.type,t.description,ue(t.sort),t.dataSource,t.composeCode,t.defaultAttribute?V(t.defaultAttribute):void 0),Bn=t=>new rt.DimensionalDateDimension(t.name,t.expression,t.description,ue(t.sort),t.dataSource,t.composeCode),Vr=t=>{switch(t.__serializable){case"DimensionalDimension":return Pn(t);case"DimensionalDateDimension":return Bn(t);default:return t}},is=t=>new T.DimensionalBaseMeasure(t.name,V(t.attribute),t.aggregation,t.format,t.description,ue(t.sort),t.dataSource,t.composeCode),rs=t=>{const e=Object.fromEntries(Object.entries(t.context).map(([s,n])=>{if(n&&typeof n=="object"&&"__serializable"in n)switch(n.__serializable){case"DimensionalAttribute":return[s,ss(n)];case"DimensionalLevelAttribute":return[s,ns(n)];case"DimensionalBaseMeasure":return[s,is(n)];case"DimensionalCalculatedMeasure":return[s,rs(n)];default:return[s,n]}return[s,n]}));return new T.DimensionalCalculatedMeasure(t.name,t.expression,e,t.format,t.description,ue(t.sort),t.dataSource,t.composeCode)},Rn=t=>new T.DimensionalMeasureTemplate(t.name,V(t.attribute),t.format,t.description,ue(t.sort),t.dataSource,t.composeCode),Ts=t=>{switch(t.__serializable){case"DimensionalBaseMeasure":return is(t);case"DimensionalCalculatedMeasure":return rs(t);case"DimensionalMeasureTemplate":return Rn(t);default:return t}},j=t=>{switch(t.__serializable){case"MembersFilter":return new T.MembersFilter(V(t.attribute),t.members,t.config.backgroundFilter?J(K({},t.config),{backgroundFilter:j(t.config.backgroundFilter)}):t.config,t.composeCode);case"LogicalAttributeFilter":return new T.LogicalAttributeFilter(t.filters.map(s=>j(s)),t.operator,t.config,t.composeCode);case"CascadingFilter":return new T.CascadingFilter(t._filters.map(s=>j(s)),t.config,t.composeCode);case"ExcludeFilter":return new T.ExcludeFilter(j(t.filter),t.input?j(t.input):void 0,t.config,t.composeCode);case"MeasureFilter":return new T.MeasureFilter(V(t.attribute),Ts(t.measure),t.operatorA,t.valueA,t.operatorB,t.valueB,t.config,t.composeCode);case"RankingFilter":return new T.RankingFilter(V(t.attribute),Ts(t.measure),t.operator,t.count,t.config,t.composeCode);case"NumericFilter":return new T.NumericFilter(V(t.attribute),t.operatorA,t.valueA,t.operatorB,t.valueB,t.config,t.composeCode);case"TextFilter":return new T.TextFilter(V(t.attribute),t.operatorA,t.valueA,t.config,t.composeCode);case"DateRangeFilter":{const{valueA:s,valueB:n}=t;return new T.DateRangeFilter(V(t.attribute),s,n,t.config,t.composeCode)}case"RelativeDateFilter":return new T.RelativeDateFilter(V(t.attribute),t.offset,t.count,t.operator,t.anchor,t.config,t.composeCode);case"CustomFilter":return new T.CustomFilter(V(t.attribute),t.jaqlExpression,t.config,t.composeCode);default:return t}};O.registerCustom({isApplicable:k.isJaqlElement,serialize:t=>t.serialize(),deserialize:t=>vr(t)},"JaqlElement");O.registerCustom({isApplicable:T.isDimensionalAttribute,serialize:t=>t.serialize(),deserialize:t=>ss(t)},"DimensionalAttribute");O.registerCustom({isApplicable:T.isDimensionalLevelAttribute,serialize:t=>t.serialize(),deserialize:t=>ns(t)},"DimensionalLevelAttribute");O.registerCustom({isApplicable:rt.isDimensionalDimension,serialize:t=>t.serialize(),deserialize:t=>Pn(t)},"DimensionalDimension");O.registerCustom({isApplicable:rt.isDimensionalDateDimension,serialize:t=>t.serialize(),deserialize:t=>Bn(t)},"DimensionalDateDimension");O.registerCustom({isApplicable:T.isDimensionalBaseMeasure,serialize:t=>t.serialize(),deserialize:t=>is(t)},"DimensionalBaseMeasure");O.registerCustom({isApplicable:T.isDimensionalCalculatedMeasure,serialize:t=>t.serialize(),deserialize:t=>rs(t)},"DimensionalCalculatedMeasure");O.registerCustom({isApplicable:T.isDimensionalMeasureTemplate,serialize:t=>t.serialize(),deserialize:t=>Rn(t)},"DimensionalMeasureTemplate");O.registerCustom({isApplicable:T.isMembersFilter,serialize:t=>t.serialize(),deserialize:t=>j(t)},"MembersFilter");O.registerCustom({isApplicable:T.isLogicalAttributeFilter,serialize:t=>t.serialize(),deserialize:t=>j(t)},"LogicalAttributeFilter");O.registerCustom({isApplicable:T.isCascadingFilter,serialize:t=>t.serialize(),deserialize:t=>j(t)},"CascadingFilter");O.registerCustom({isApplicable:T.isExcludeFilter,serialize:t=>t.serialize(),deserialize:t=>j(t)},"ExcludeFilter");O.registerCustom({isApplicable:T.isMeasureFilter,serialize:t=>t.serialize(),deserialize:t=>j(t)},"MeasureFilter");O.registerCustom({isApplicable:T.isRankingFilter,serialize:t=>t.serialize(),deserialize:t=>j(t)},"RankingFilter");O.registerCustom({isApplicable:T.isNumericFilter,serialize:t=>t.serialize(),deserialize:t=>j(t)},"NumericFilter");O.registerCustom({isApplicable:T.isTextFilter,serialize:t=>t.serialize(),deserialize:t=>j(t)},"TextFilter");O.registerCustom({isApplicable:T.isDateRangeFilter,serialize:t=>t.serialize(),deserialize:t=>j(t)},"DateRangeFilter");O.registerCustom({isApplicable:T.isRelativeDateFilter,serialize:t=>t.serialize(),deserialize:t=>j(t)},"RelativeDateFilter");O.registerCustom({isApplicable:T.isCustomFilter,serialize:t=>t.serialize(),deserialize:t=>j(t)},"CustomFilter");const Qr=O;exports.EMPTY_EXPANDED_QUERY_MODEL=k.EMPTY_EXPANDED_QUERY_MODEL;exports.EMPTY_SIMPLE_QUERY_MODEL=k.EMPTY_SIMPLE_QUERY_MODEL;exports.getChartDataOptions=k.getChartDataOptions;exports.getChartOptions=k.getChartOptions;exports.getChartRecommendationsOrDefault=k.getChartRecommendationsOrDefault;exports.getChartStyleOptions=k.getChartStyleOptions;exports.isByIdDashboardCodeParams=k.isByIdDashboardCodeParams;exports.isByIdWidgetCodeParams=k.isByIdWidgetCodeParams;exports.isClientSideDashboardCodeParams=k.isClientSideDashboardCodeParams;exports.isClientSideWidgetCodeParams=k.isClientSideWidgetCodeParams;exports.simplifyMetadataItem=k.simplifyMetadataItem;exports.widgetComposer=k.widgetComposer;exports.CustomSuperJSON=Qr;exports.QueryTranslator=Hi;exports.dashboardComposer=ir;exports.executeQueryComposer=dr;