agentic-mermaid 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/agent-core.d.ts +7 -7
- package/dist/agent-core.js +1 -1
- package/dist/agent.d.ts +7 -7
- package/dist/agent.js +1 -1
- package/dist/agentic-mermaid-mcp.js +1 -1
- package/dist/am.js +1 -1
- package/dist/browser-lazy/chunks/{agentic-producer-core-CC6OOLDW.js → agentic-producer-core-ECZ3CMZM.js} +1 -1
- package/dist/browser-lazy/chunks/{architecture-QUFVKYJR.js → architecture-H5LTMKQW.js} +6 -6
- package/dist/browser-lazy/chunks/{block-6J3Q63BO.js → block-566X6FNV.js} +5 -5
- package/dist/browser-lazy/chunks/{builtin-backends-7SOZZHPF.js → builtin-backends-VAFEZXKY.js} +6 -6
- package/dist/browser-lazy/chunks/{c4-SQVBZAKJ.js → c4-ZXFDLBFK.js} +5 -5
- package/dist/browser-lazy/chunks/{chunk-5X6MJX3H.js → chunk-2JQXRKBC.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-E2WMJZNM.js → chunk-37FZNMPR.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-TYZOZXUJ.js → chunk-3JTYTXA6.js} +6 -6
- package/dist/browser-lazy/chunks/{chunk-PQGPS2YV.js → chunk-4NILRBC7.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-AMJLVPUB.js → chunk-5LKPDHPC.js} +2 -2
- package/dist/browser-lazy/chunks/{chunk-BY2CPG6B.js → chunk-62MR3LWJ.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-J7FFAFQF.js → chunk-64JFHCJC.js} +1 -1
- package/dist/browser-lazy/chunks/chunk-6GPDLZFQ.js +1 -0
- package/dist/browser-lazy/chunks/{chunk-VWVZGQE2.js → chunk-6UOOATQR.js} +1 -1
- package/dist/browser-lazy/chunks/chunk-7TTFBJYA.js +1 -0
- package/dist/browser-lazy/chunks/chunk-7UFOFWBA.js +20 -0
- package/dist/browser-lazy/chunks/{chunk-5B2Z7575.js → chunk-A7V5VDKN.js} +1 -1
- package/dist/browser-lazy/chunks/chunk-CPO5P4L2.js +1 -0
- package/dist/browser-lazy/chunks/chunk-EIYLJ4FI.js +20 -0
- package/dist/browser-lazy/chunks/{chunk-X2UYKWKM.js → chunk-G4JBA7HU.js} +3 -3
- package/dist/browser-lazy/chunks/{chunk-2UIA2IME.js → chunk-IUI4DYC3.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-QA6GJQ4X.js → chunk-J57YRC2M.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-BU5LHXNJ.js → chunk-LBXXKLIR.js} +3 -3
- package/dist/browser-lazy/chunks/chunk-NKW2ZNCD.js +1 -0
- package/dist/browser-lazy/chunks/{chunk-ICC7HBJX.js → chunk-O34YYEQV.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-UL6NDWLL.js → chunk-OBI5U5XU.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-YCEICNM6.js → chunk-OFOS57WQ.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-OZ443IVJ.js → chunk-PSZEE64O.js} +7 -7
- package/dist/browser-lazy/chunks/{chunk-SZELX2EJ.js → chunk-PXTLV57R.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-HLWUNUCM.js → chunk-QVSZOF5M.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-2GPK4VFF.js → chunk-TT5GR5EJ.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-DF6765YX.js → chunk-V6I2VGNQ.js} +5 -5
- package/dist/browser-lazy/chunks/{chunk-CN7WTBWB.js → chunk-VRZKI33U.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-2SH76OTH.js → chunk-XHU3A432.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-NO7ZIVRU.js → chunk-YVNJDVQO.js} +1 -1
- package/dist/browser-lazy/chunks/chunk-Z7UHFVKN.js +6 -0
- package/dist/browser-lazy/chunks/{class-5QA4SCTS.js → class-XIFNVBFE.js} +8 -8
- package/dist/{zenuml/chunks/decode-BWERFDGK.js → browser-lazy/chunks/decode-5MFOG3AZ.js} +1 -1
- package/dist/browser-lazy/chunks/{elk.bundled-L4CADV5W.js → elk.bundled-RYWHIS5N.js} +8 -8
- package/dist/browser-lazy/chunks/er-VEUYJBGG.js +11 -0
- package/dist/browser-lazy/chunks/{eventmodeling-2BPLHWRN.js → eventmodeling-G7DITZX7.js} +10 -10
- package/dist/browser-lazy/chunks/{flowchart-NEIMZTB5.js → flowchart-SSFIU4EU.js} +1 -1
- package/dist/browser-lazy/chunks/{forest-implementation-AEP24AIP.js → forest-implementation-RWFF7XDV.js} +1 -1
- package/dist/browser-lazy/chunks/{gantt-RDPIFYAF.js → gantt-HQNVDX2B.js} +6 -6
- package/dist/browser-lazy/chunks/{gitgraph-N4Y5RYB7.js → gitgraph-Z5MN6M6L.js} +4 -4
- package/dist/browser-lazy/chunks/{ishikawa-LD3YBDJN.js → ishikawa-UEERNFQV.js} +2 -2
- package/dist/browser-lazy/chunks/{journey-6YQR5DJX.js → journey-3BEWWGB5.js} +6 -6
- package/dist/browser-lazy/chunks/{kanban-PLMJ7NBW.js → kanban-2WFNCWLB.js} +10 -10
- package/dist/browser-lazy/chunks/{mermaid-yaml-runtime-QVYX4EWK.js → mermaid-yaml-runtime-IK4ET4BT.js} +8 -8
- package/dist/browser-lazy/chunks/{mindmap-K2UBFO3Y.js → mindmap-R2C6SNYR.js} +4 -4
- package/dist/browser-lazy/chunks/{packet-CUW4QY6Y.js → packet-GMVCI5YZ.js} +3 -3
- package/dist/browser-lazy/chunks/{pie-7F7UUCG3.js → pie-WER45DKC.js} +7 -7
- package/dist/browser-lazy/chunks/{quadrant-TOONO2WC.js → quadrant-NCUPSFKN.js} +4 -4
- package/dist/browser-lazy/chunks/{radar-J6JVWVAX.js → radar-WLYS4YC5.js} +8 -8
- package/dist/browser-lazy/chunks/render-core-42UVWIPF.js +3 -0
- package/dist/browser-lazy/chunks/{requirement-CMAKDJPO.js → requirement-AK3NWMJ6.js} +7 -7
- package/dist/browser-lazy/chunks/{sankey-AWXQEP3F.js → sankey-C2DY6WVU.js} +4 -4
- package/dist/browser-lazy/chunks/{sequence-Q2RJRB4L.js → sequence-D4WJB44W.js} +1 -1
- package/dist/browser-lazy/chunks/{state-WRBFQEDX.js → state-YUQVESE7.js} +2 -2
- package/dist/browser-lazy/chunks/{timeline-D2KILFXM.js → timeline-BMBJJXWR.js} +4 -4
- package/dist/browser-lazy/chunks/{treemap-N3VYX5D4.js → treemap-B66XBZZ6.js} +3 -3
- package/dist/browser-lazy/chunks/{xychart-G73OGK66.js → xychart-HAVFROGT.js} +6 -6
- package/dist/browser-lazy/chunks/{zenuml-H4BXNYXR.js → zenuml-62RLYFWP.js} +7 -7
- package/dist/browser-lazy/index.js +1 -1
- package/dist/browser.global.js +507 -507
- package/dist/{chunk-DQDKA5ND.js → chunk-2DNGDTJD.js} +2 -2
- package/dist/{chunk-GVCHLSHH.js → chunk-4F2UGYTM.js} +2 -2
- package/dist/{chunk-H3NCS2XZ.js → chunk-7XYB2LNC.js} +2 -2
- package/dist/chunk-DOFB572I.js +58 -0
- package/dist/chunk-EHJI3QYE.js +52 -0
- package/dist/{chunk-UA234O4M.js → chunk-HINRNKPO.js} +2 -2
- package/dist/{chunk-JZOJ4YGS.js → chunk-KXMANAST.js} +33 -33
- package/dist/{chunk-7CRDX2QR.js → chunk-U4MT3RRE.js} +2 -2
- package/dist/{chunk-NKNFOREZ.js → chunk-WYIB6BUR.js} +2 -2
- package/dist/{cli-YGGTJZH7.js → cli-ZYIDBYNS.js} +2 -2
- package/dist/{index-EeXqJXr5.d.ts → index-Bvhprdxz.d.ts} +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/{mcp-cli-63DYXTVD.js → mcp-cli-YVDCORWA.js} +2 -2
- package/dist/{paint-certification-6rwQjIv_.d.ts → paint-certification-BoLyr006.d.ts} +2 -2
- package/dist/{server-5NEOHOFS.js → server-4JGAVXR3.js} +2 -2
- package/dist/{svg-styles-BdnoM7AT.d.ts → svg-styles-BnCoXyYe.d.ts} +1 -1
- package/dist/svg-styles.d.ts +1 -1
- package/dist/svg-styles.js +1 -1
- package/dist/svg.d.ts +4 -4
- package/dist/svg.js +1 -1
- package/dist/{types-BcS52Mjt.d.ts → types-CLVJCaH2.d.ts} +1 -1
- package/dist/zenuml/chunks/{appearance-UOQ5KA6O.js → appearance-5RM5MVM2.js} +1 -1
- package/dist/zenuml/chunks/{builtin-backends-KDKE7YHO.js → builtin-backends-UTNWL4N3.js} +11 -11
- package/dist/zenuml/chunks/{chunk-QWX77U7G.js → chunk-3A6S6GNB.js} +2 -2
- package/dist/zenuml/chunks/{chunk-OXQWRSBM.js → chunk-55WS466K.js} +11 -11
- package/dist/zenuml/chunks/chunk-6J4BGPB2.js +29 -0
- package/dist/zenuml/chunks/chunk-CNLL4BGF.js +1 -0
- package/dist/zenuml/chunks/{chunk-RZ6XK5CD.js → chunk-IARQ24W3.js} +13 -13
- package/dist/zenuml/chunks/{chunk-42DXZ5C6.js → chunk-ZNZRIISS.js} +2 -2
- package/dist/{browser-lazy/chunks/decode-63UIZGD2.js → zenuml/chunks/decode-LDNNXEAO.js} +1 -1
- package/dist/zenuml/chunks/{mermaid-yaml-runtime-KZVU74WU.js → mermaid-yaml-runtime-A5CNJ3IE.js} +8 -8
- package/dist/zenuml/chunks/render-core-ECIWU5ZS.js +3 -0
- package/dist/zenuml/chunks/{zenuml-EA2ZFRUX.js → zenuml-N3LZMB2G.js} +8 -8
- package/dist/zenuml.d.ts +2 -2
- package/dist/zenuml.js +1 -1
- package/docs/MCP-DIRECTORY-LISTINGS.md +81 -12
- package/docs/api.md +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/dist/browser-lazy/chunks/chunk-4LHYF3BS.js +0 -1
- package/dist/browser-lazy/chunks/chunk-FAIMVOX5.js +0 -6
- package/dist/browser-lazy/chunks/chunk-GVOEAY52.js +0 -1
- package/dist/browser-lazy/chunks/chunk-J35HAQQF.js +0 -20
- package/dist/browser-lazy/chunks/chunk-RIVTHZAQ.js +0 -1
- package/dist/browser-lazy/chunks/chunk-Z3FDIVLN.js +0 -20
- package/dist/browser-lazy/chunks/er-7ZSKGN7Y.js +0 -11
- package/dist/browser-lazy/chunks/render-core-BZOM3K7D.js +0 -3
- package/dist/chunk-EHCMJUMD.js +0 -52
- package/dist/chunk-OMY6NRQD.js +0 -58
- package/dist/zenuml/chunks/chunk-7TVYPTDW.js +0 -1
- package/dist/zenuml/chunks/chunk-RLJEI7YN.js +0 -29
- package/dist/zenuml/chunks/render-core-V5RQ737O.js +0 -3
- /package/dist/browser-lazy/chunks/{chunk-5FQ534HP.js → chunk-BMZ24VPS.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-2I4UPL7Q.js → chunk-D6MQ7QSU.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-CQE4HQEW.js → chunk-HJVO5VC3.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-LH7HUDKW.js → chunk-L4UC3KGS.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-NMQQMRIR.js → chunk-MFTQWHUB.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-N5ELX7LR.js → chunk-PJJSDGLB.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-CSFUKSU6.js → chunk-QCU5G5PZ.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-VQYYGAXP.js → chunk-TLFX3U6S.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-5UVGUSD6.js → chunk-YHMTSXIR.js} +0 -0
- /package/dist/zenuml/chunks/{chunk-EVPSMEKN.js → chunk-GC7IPQ5P.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import"./chunk-
|
|
2
|
-
`)}};function $(e){if(/[\x00-\x19\s,[\]{}]/.test(e))throw Error(`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`);return!0}function L(e){let t=new Set;return v(e,{Value(e,s){s.anchor&&t.add(s.anchor)}}),t}function C(e,t){for(let s=1;;++s){let n=`${e}${s}`;if(!t.has(n))return n}}function _(e,t,s,n){if(n&&"object"==typeof n)if(Array.isArray(n))for(let t=0,s=n.length;t<s;++t){let s=n[t],i=_(e,n,String(t),s);void 0===i?delete n[t]:i!==s&&(n[t]=i)}else if(n instanceof Map)for(let t of Array.from(n.keys())){let s=n.get(t),i=_(e,n,t,s);void 0===i?n.delete(t):i!==s&&n.set(t,i)}else if(n instanceof Set)for(let t of Array.from(n)){let s=_(e,n,t,t);void 0===s?n.delete(t):s!==t&&(n.delete(t),n.add(s))}else for(let[t,s]of Object.entries(n)){let i=_(e,n,t,s);void 0===i?delete n[t]:i!==s&&(n[t]=i)}return e.call(t,s,n)}function
|
|
1
|
+
import"./chunk-QCU5G5PZ.js";var e,t=Symbol.for("yaml.alias"),s=Symbol.for("yaml.document"),n=Symbol.for("yaml.map"),i=Symbol.for("yaml.pair"),r=Symbol.for("yaml.scalar"),o=Symbol.for("yaml.seq"),l=Symbol.for("yaml.node.type"),a=e=>!!e&&"object"==typeof e&&e[l]===t,c=e=>!!e&&"object"==typeof e&&e[l]===s,u=e=>!!e&&"object"==typeof e&&e[l]===n,f=e=>!!e&&"object"==typeof e&&e[l]===i,h=e=>!!e&&"object"==typeof e&&e[l]===r,d=e=>!!e&&"object"==typeof e&&e[l]===o;function p(e){if(e&&"object"==typeof e)switch(e[l]){case n:case o:return!0}return!1}function m(e){if(e&&"object"==typeof e)switch(e[l]){case t:case n:case r:case o:return!0}return!1}var g=e=>(h(e)||p(e))&&!!e.anchor,y=Symbol("break visit"),b=Symbol("skip children"),k=Symbol("remove node");function v(e,t){let s=N(t);c(e)?w(null,e.contents,s,Object.freeze([e]))===k&&(e.contents=null):w(null,e,s,Object.freeze([]))}function w(e,t,s,n){let i=O(e,t,s,n);if(m(i)||f(i))return A(e,n,i),w(e,i,s,n);if("symbol"!=typeof i){if(p(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let i=w(e,t.items[e],s,n);if("number"==typeof i)e=i-1;else{if(i===y)return y;i===k&&(t.items.splice(e,1),e-=1)}}}else if(f(t)){n=Object.freeze(n.concat(t));let e=w("key",t.key,s,n);if(e===y)return y;e===k&&(t.key=null);let i=w("value",t.value,s,n);if(i===y)return y;i===k&&(t.value=null)}}return i}async function S(e,t){let s=N(t);c(e)?await E(null,e.contents,s,Object.freeze([e]))===k&&(e.contents=null):await E(null,e,s,Object.freeze([]))}async function E(e,t,s,n){let i=await O(e,t,s,n);if(m(i)||f(i))return A(e,n,i),E(e,i,s,n);if("symbol"!=typeof i){if(p(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let i=await E(e,t.items[e],s,n);if("number"==typeof i)e=i-1;else{if(i===y)return y;i===k&&(t.items.splice(e,1),e-=1)}}}else if(f(t)){n=Object.freeze(n.concat(t));let e=await E("key",t.key,s,n);if(e===y)return y;e===k&&(t.key=null);let i=await E("value",t.value,s,n);if(i===y)return y;i===k&&(t.value=null)}}return i}function N(e){return"object"==typeof e&&(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 O(e,t,s,n){return"function"==typeof s?s(e,t,n):u(t)?s.Map?.(e,t,n):d(t)?s.Seq?.(e,t,n):f(t)?s.Pair?.(e,t,n):h(t)?s.Scalar?.(e,t,n):a(t)?s.Alias?.(e,t,n):void 0}function A(e,t,s){let n=t[t.length-1];if(p(n))n.items[e]=s;else if(f(n))"key"===e?n.key=s:n.value=s;else if(c(n))n.contents=s;else{let e=a(n)?"alias":"scalar";throw Error(`Cannot replace node with ${e} parent`)}}v.BREAK=y,v.SKIP=b,v.REMOVE=k,S.BREAK=y,S.SKIP=b,S.REMOVE=k;var T={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},I=e=>e.replace(/[!,[\]{}]/g,e=>T[e]),x=class e{constructor(t,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,s)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags)}return t}add(t,s){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let n=t.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(2!==n.length&&(s(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[e,t]=n;return this.tags[e]=t,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return s(0,"%YAML directive should contain exactly one part"),!1;let[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return s(6,`Unsupported YAML version ${e}`,t),!1}}default:return s(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){let s=e.slice(2,-1);return"!"===s||"!!"===s?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),s)}let[,s,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(n)}catch(e){return t(String(e)),null}return"!"===s?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+I(e.substring(s.length));return"!"===e[0]?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),n;if(e&&s.length>0&&m(e.contents)){let t={};v(e.contents,(e,s)=>{m(s)&&s.tag&&(t[s.tag]=!0)}),n=Object.keys(t)}else n=[];for(let[i,r]of s)"!!"===i&&"tag:yaml.org,2002:"===r||(!e||n.some(e=>e.startsWith(r)))&&t.push(`%TAG ${i} ${r}`);return t.join(`
|
|
2
|
+
`)}};function $(e){if(/[\x00-\x19\s,[\]{}]/.test(e))throw Error(`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`);return!0}function L(e){let t=new Set;return v(e,{Value(e,s){s.anchor&&t.add(s.anchor)}}),t}function C(e,t){for(let s=1;;++s){let n=`${e}${s}`;if(!t.has(n))return n}}function _(e,t,s,n){if(n&&"object"==typeof n)if(Array.isArray(n))for(let t=0,s=n.length;t<s;++t){let s=n[t],i=_(e,n,String(t),s);void 0===i?delete n[t]:i!==s&&(n[t]=i)}else if(n instanceof Map)for(let t of Array.from(n.keys())){let s=n.get(t),i=_(e,n,t,s);void 0===i?n.delete(t):i!==s&&n.set(t,i)}else if(n instanceof Set)for(let t of Array.from(n)){let s=_(e,n,t,t);void 0===s?n.delete(t):s!==t&&(n.delete(t),n.add(s))}else for(let[t,s]of Object.entries(n)){let i=_(e,n,t,s);void 0===i?delete n[t]:i!==s&&(n[t]=i)}return e.call(t,s,n)}function B(e,t,s){if(Array.isArray(e))return e.map((e,t)=>B(e,String(t),s));if(e&&"function"==typeof e.toJSON){if(!s||!g(e))return e.toJSON(t,s);let n={aliasCount:0,count:1,res:void 0};s.anchors.set(e,n),s.onCreate=e=>{n.res=e,delete s.onCreate};let i=e.toJSON(t,s);return s.onCreate&&s.onCreate(i),i}return"bigint"!=typeof e||s?.keep?e:Number(e)}x.defaultYaml={explicit:!1,version:"1.2"},x.defaultTags={"!!":"tag:yaml.org,2002:"};var K=class{constructor(e){Object.defineProperty(this,l,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:n,reviver:i}={}){if(!c(e))throw TypeError("A document argument is required");let r={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof s?s:100},o=B(this,"",r);if("function"==typeof n)for(let{count:e,res:t}of r.anchors.values())n(t,e);return"function"==typeof i?_(i,{"":o},"",o):o}},j=class extends K{constructor(e){super(t),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){let s,n;if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");for(let i of(t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],v(e,{Node:(e,t)=>{(a(t)||g(t))&&s.push(t)}}),t&&(t.aliasResolveCache=s)),s)){if(i===this)break;i.anchor===this.source&&(n=i)}return n}toJSON(e,t){if(!t)return{source:this.source};let{anchors:s,doc:n,maxAliasCount:i}=t,r=this.resolve(n,t);if(!r)throw ReferenceError(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);let o=s.get(r);if(o||(B(r,null,t),o=s.get(r)),o?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(o.count+=1,0===o.aliasCount&&(o.aliasCount=function e(t,s,n){if(a(s)){let e=s.resolve(t),i=n&&e&&n.get(e);return i?i.count*i.aliasCount:0}if(p(s)){let i=0;for(let r of s.items){let s=e(t,r,n);s>i&&(i=s)}return i}return f(s)?Math.max(e(t,s.key,n),e(t,s.value,n)):1}(n,r,s)),o.count*o.aliasCount>i))throw ReferenceError("Excessive alias count indicates a resource exhaustion attack");return o.res}toString(e,t,s){let n=`*${this.source}`;if(e){if($(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source))throw Error(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);if(e.implicitKey)return`${n} `}return n}},M=e=>!e||"function"!=typeof e&&"object"!=typeof e,D=class extends K{constructor(e){super(r),this.value=e}toJSON(e,t){return t?.keep?this.value:B(this.value,e,t)}toString(){return String(this.value)}};function P(e,t,s){if(c(e)&&(e=e.contents),m(e))return e;if(f(e)){let t=s.schema[n].createNode?.(s.schema,null,s);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"u">typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:l,schema:a,sourceObjects:u}=s,h;if(i&&e&&"object"==typeof e){if(h=u.get(e))return h.anchor??(h.anchor=r(e)),new j(h.anchor);h={anchor:null,node:null},u.set(e,h)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let d=function(e,t,s){if(t){let e=s.filter(e=>e.tag===t),n=e.find(e=>!e.format)??e[0];if(!n)throw Error(`Tag ${t} not found`);return n}return s.find(t=>t.identify?.(e)&&!t.format)}(e,t,a.tags);if(!d){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){let t=new D(e);return h&&(h.node=t),t}d=e instanceof Map?a[n]:Symbol.iterator in Object(e)?a[o]:a[n]}l&&(l(d),delete s.onTagObj);let p=d?.createNode?d.createNode(s.schema,e,s):"function"==typeof d?.nodeClass?.from?d.nodeClass.from(s.schema,e,s):new D(e);return t?p.tag=t:d.default||(p.tag=d.tag),h&&(h.node=p),p}function q(e,t,s){let n=s;for(let e=t.length-1;e>=0;--e){let s=t[e];if("number"==typeof s&&Number.isInteger(s)&&s>=0){let e=[];e[s]=n,n=e}else n=new Map([[s,n]])}return P(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}D.BLOCK_FOLDED="BLOCK_FOLDED",D.BLOCK_LITERAL="BLOCK_LITERAL",D.PLAIN="PLAIN",D.QUOTE_DOUBLE="QUOTE_DOUBLE",D.QUOTE_SINGLE="QUOTE_SINGLE";var U=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done,R=class extends K{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>m(t)||f(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(U(e))this.add(t);else{let[s,...n]=e,i=this.get(s,!0);if(p(i))i.addIn(n,t);else if(void 0===i&&this.schema)this.set(s,q(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}deleteIn(e){let[t,...s]=e;if(0===s.length)return this.delete(t);let n=this.get(t,!0);if(p(n))return n.deleteIn(s);throw Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...n]=e,i=this.get(s,!0);return 0===n.length?!t&&h(i)?i.value:i:p(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!f(t))return!1;let s=t.value;return null==s||e&&h(s)&&null==s.value&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(0===s.length)return this.has(t);let n=this.get(t,!0);return!!p(n)&&n.hasIn(s)}setIn(e,t){let[s,...n]=e;if(0===n.length)this.set(s,t);else{let e=this.get(s,!0);if(p(e))e.setIn(n,t);else if(void 0===e&&this.schema)this.set(s,q(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}},F=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function J(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var V=(e,t,s)=>e.endsWith(`
|
|
3
3
|
`)?J(s,t):s.includes(`
|
|
4
4
|
`)?`
|
|
5
5
|
`+J(s,t):(e.endsWith(" ")?"":" ")+s,Y="flow",W="block",G="quoted";function H(e,t,s="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return e;i<r&&(r=0);let a=Math.max(1+r,1+i-t.length);if(e.length<=a)return e;let c=[],u={},f=i-t.length;"number"==typeof n&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let h,d,p=!1,m=-1,g=-1,y=-1;s===W&&-1!==(m=Q(e,m,t.length))&&(f=m+a);for(let n;n=e[m+=1];){if(s===G&&"\\"===n){switch(g=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}y=m}if(n===`
|
|
@@ -31,7 +31,7 @@ ${d}${v}${n}${m}`}function es(e,t,s,n){let{implicitKey:i,inFlow:r}=t,o="string"=
|
|
|
31
31
|
`)?ee(r,t):et(e,t,s,n);if(!l&&!u&&i!==D.PLAIN&&r.includes(`
|
|
32
32
|
`))return et(e,t,s,n);if(/^(%|---|\.\.\.)/m.test(r)){if(""===a)return t.forceBlockIndent=!0,et(e,t,s,n);if(l&&a===c)return ee(r,t)}let f=r.replace(/\n+/g,`$&
|
|
33
33
|
${a}`);if(o){let e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(f),{compat:s,tags:n}=t.doc.schema;if(n.some(e)||s?.some(e))return ee(r,t)}return l?f:H(f,a,Y,X(t,!1))}(o,t,s,n);default:return null}},c=a(l);if(null===c){let{defaultKeyType:e,defaultStringType:s}=t.options,n=i&&e||s;if(null===(c=a(n)))throw Error(`Unsupported default string type ${n}`)}return c}function en(e,t){let s=Object.assign({blockQuote:!0,commentString:F,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),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:"number"==typeof s.indent?" ".repeat(s.indent):" ",inFlow:n,options:s}}function ei(e,t,s,n){if(f(e))return e.toString(t,s,n);if(a(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,r=m(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=function(e,t){let s,n;if(t.tag){let s=e.filter(e=>e.tag===t.tag);if(s.length>0)return s.find(e=>e.format===t.format)??s[0]}if(h(t)){n=t.value;let i=e.filter(e=>e.identify?.(n));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}s=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else n=t,s=e.find(e=>e.nodeClass&&n instanceof e.nodeClass);if(!s){let e=n?.constructor?.name??(null===n?"null":typeof n);throw Error(`Tag not resolved for ${e} value`)}return s}(t.doc.schema.tags,r));let o=function(e,t,{anchors:s,doc:n}){if(!n.directives)return"";let i=[],r=(h(e)||p(e))&&e.anchor;r&&$(r)&&(s.add(r),i.push(`&${r}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}(r,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let l="function"==typeof i.stringify?i.stringify(r,t,s,n):h(r)?es(r,t,s,n):r.toString(t,s,n);return o?h(r)||"{"===l[0]||"["===l[0]?`${o} ${l}`:`${o}
|
|
34
|
-
${t.indent}${l}`:l}function er(e,t){("debug"===e||"warn"===e)&&console.warn(t)}var eo={identify:e=>"<<"===e||"symbol"==typeof e&&"<<"===e.description,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new D(Symbol("<<")),{addToJSMap:el}),stringify:()=>"<<"};function el(e,t,s){let n=ec(e,s);if(d(n))for(let s of n.items)ea(e,t,s);else if(Array.isArray(n))for(let s of n)ea(e,t,s);else ea(e,t,n)}function ea(e,t,s){let n=ec(e,s);if(!u(n))throw Error("Merge sources must be maps or map aliases");for(let[s,i]of n.toJSON(null,e,Map))t instanceof Map?t.has(s)||t.set(s,i):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:i,writable:!0,enumerable:!0,configurable:!0});return t}function ec(e,t){return e&&a(t)?t.resolve(e.doc,e):t}function eu(e,t,{key:s,value:n}){if(m(s)&&s.addToJSMap)s.addToJSMap(e,t,n);else if((eo.identify(s)||h(s)&&(!s.type||s.type===D.PLAIN)&&eo.identify(s.value))&&e?.doc.schema.tags.some(e=>e.tag===eo.tag&&e.default))el(e,t,n);else{let i=
|
|
34
|
+
${t.indent}${l}`:l}function er(e,t){("debug"===e||"warn"===e)&&console.warn(t)}var eo={identify:e=>"<<"===e||"symbol"==typeof e&&"<<"===e.description,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new D(Symbol("<<")),{addToJSMap:el}),stringify:()=>"<<"};function el(e,t,s){let n=ec(e,s);if(d(n))for(let s of n.items)ea(e,t,s);else if(Array.isArray(n))for(let s of n)ea(e,t,s);else ea(e,t,n)}function ea(e,t,s){let n=ec(e,s);if(!u(n))throw Error("Merge sources must be maps or map aliases");for(let[s,i]of n.toJSON(null,e,Map))t instanceof Map?t.has(s)||t.set(s,i):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:i,writable:!0,enumerable:!0,configurable:!0});return t}function ec(e,t){return e&&a(t)?t.resolve(e.doc,e):t}function eu(e,t,{key:s,value:n}){if(m(s)&&s.addToJSMap)s.addToJSMap(e,t,n);else if((eo.identify(s)||h(s)&&(!s.type||s.type===D.PLAIN)&&eo.identify(s.value))&&e?.doc.schema.tags.some(e=>e.tag===eo.tag&&e.default))el(e,t,n);else{let i=B(s,"",e);if(t instanceof Map)t.set(i,B(n,i,e));else if(t instanceof Set)t.add(i);else{let r=function(e,t,s){if(null===t)return"";if("object"!=typeof t)return String(t);if(m(e)&&s?.doc){let t=en(s.doc,{});for(let e of(t.anchors=new Set,s.anchors.keys()))t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let n=e.toString(t);if(!s.mapKeyWarned){let e=JSON.stringify(n);e.length>40&&(e=e.substring(0,36)+'..."'),er(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return n}return JSON.stringify(t)}(s,i,e),o=B(n,r,e);r in t?Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[r]=o}}return t}function ef(e,t,s){return new eh(P(e,void 0,s),P(t,void 0,s))}var eh=class e{constructor(e,t=null){Object.defineProperty(this,l,{value:i}),this.key=e,this.value=t}clone(t){let{key:s,value:n}=this;return m(s)&&(s=s.clone(t)),m(n)&&(n=n.clone(t)),new e(s,n)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return eu(t,s,this)}toString(e,t,s){return e?.doc?function({key:e,value:t},s,n,i){let r,o,l,{allNullValues:a,doc:c,indent:u,indentStep:f,options:{commentString:g,indentSeq:y,simpleKeys:b}}=s,k=m(e)&&e.comment||null;if(b){if(k)throw Error("With simple keys, key nodes cannot have comments");if(p(e)||!m(e)&&"object"==typeof e)throw Error("With simple keys, collection cannot be used as a key value")}let v=!b&&(!e||k&&null==t&&!s.inFlow||p(e)||(h(e)?e.type===D.BLOCK_FOLDED||e.type===D.BLOCK_LITERAL:"object"==typeof e));s=Object.assign({},s,{allNullValues:!1,implicitKey:!v&&(b||!a),indent:u+f});let w=!1,S=!1,E=ei(e,s,()=>w=!0,()=>S=!0);if(!v&&!s.inFlow&&E.length>1024){if(b)throw Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(s.inFlow){if(a||null==t)return w&&n&&n(),""===E?"?":v?`? ${E}`:E}else if(a&&!b||null==t&&v)return E=`? ${E}`,k&&!w?E+=V(E,s.indent,g(k)):S&&i&&i(),E;w&&(k=null),v?(k&&(E+=V(E,s.indent,g(k))),E=`? ${E}
|
|
35
35
|
${u}:`):(E=`${E}:`,k&&(E+=V(E,s.indent,g(k)))),m(t)?(r=!!t.spaceBefore,o=t.commentBefore,l=t.comment):(r=!1,o=null,l=null,t&&"object"==typeof t&&(t=c.createNode(t))),s.implicitKey=!1,!v&&!k&&h(t)&&(s.indentAtStart=E.length+1),S=!1,!(!y&&f.length>=2&&!s.inFlow&&!v&&d(t))||t.flow||t.tag||t.anchor||(s.indent=s.indent.substring(2));let N=!1,O=ei(t,s,()=>N=!0,()=>S=!0),A=" ";if(k||r||o){if(A=r?`
|
|
36
36
|
`:"",o){let e=g(o);A+=`
|
|
37
37
|
${J(e,s.indent)}`}""!==O||s.inFlow?A+=`
|
|
@@ -48,10 +48,10 @@ ${r}${i}${t}`:`
|
|
|
48
48
|
${i}${p}`}}:function({comment:e,items:t},s,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:l}){let a,{indent:c,options:{commentString:u}}=s,h=Object.assign({},s,{indent:r,type:null}),d=!1,p=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(m(i))!d&&i.spaceBefore&&p.push(""),ep(s,p,i.commentBefore,d),i.comment&&(o=i.comment);else if(f(i)){let e=m(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&p.push(""),ep(s,p,e.commentBefore,d))}d=!1;let l=ei(i,h,()=>o=null,()=>d=!0);o&&(l+=V(l,r,u(o))),d&&o&&(d=!1),p.push(n+l)}if(0===p.length)a=i.start+i.end;else{a=p[0];for(let e=1;e<p.length;++e){let t=p[e];a+=t?`
|
|
49
49
|
${c}${t}`:`
|
|
50
50
|
`}}return e?(a+=`
|
|
51
|
-
`+J(u(e),c),l&&l()):d&&o&&o(),a})(e,t,s)}function ep({indent:e,options:{commentString:t}},s,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let i=J(t(n),e);s.push(i.trimStart())}}function em(e,t){let s=h(t)?t.value:t;for(let n of e)if(f(n)&&(n.key===t||n.key===s||h(n.key)&&n.key.value===s))return n}var eg=class extends R{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(n,e),this.items=[]}static from(e,t,s){let{keepUndefined:n,replacer:i}=s,r=new this(e),o=(e,o)=>{if("function"==typeof i)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==o||n)&&r.items.push(ef(e,o,s))};if(t instanceof Map)for(let[e,s]of t)o(e,s);else if(t&&"object"==typeof t)for(let e of Object.keys(t))o(e,t[e]);return"function"==typeof e.sortMapEntries&&r.items.sort(e.sortMapEntries),r}add(e,t){let s;s=f(e)?e:e&&"object"==typeof e&&"key"in e?new eh(e.key,e.value):new eh(e,e?.value);let n=em(this.items,s.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${s.key} already set`);h(n.value)&&M(s.value)?n.value.value=s.value:n.value=s.value}else if(i){let e=this.items.findIndex(e=>0>i(s,e));-1===e?this.items.push(s):this.items.splice(e,0,s)}else this.items.push(s)}delete(e){let t=em(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let s=em(this.items,e)?.value;return(!t&&h(s)?s.value:s)??void 0}has(e){return!!em(this.items,e)}set(e,t){this.add(new eh(e,t),!0)}toJSON(e,t,s){let n=s?new s:t?.mapAsMap?new Map:{};for(let e of(t?.onCreate&&t.onCreate(n),this.items))eu(t,n,e);return n}toString(e,t,s){if(!e)return JSON.stringify(this);for(let e of this.items)if(!f(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ed(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}},ey={collection:"map",default:!0,nodeClass:eg,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(u(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,s)=>eg.from(e,t,s)},eb=class extends R{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(o,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=ek(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){let s=ek(e);if("number"!=typeof s)return;let n=this.items[s];return!t&&h(n)?n.value:n}has(e){let t=ek(e);return"number"==typeof t&&t<this.items.length}set(e,t){let s=ek(e);if("number"!=typeof s)throw Error(`Expected a valid index, not ${e}.`);let n=this.items[s];h(n)&&M(t)?n.value=t:this.items[s]=t}toJSON(e,t){let s=[];t?.onCreate&&t.onCreate(s);let n=0;for(let e of this.items)s.push(
|
|
51
|
+
`+J(u(e),c),l&&l()):d&&o&&o(),a})(e,t,s)}function ep({indent:e,options:{commentString:t}},s,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let i=J(t(n),e);s.push(i.trimStart())}}function em(e,t){let s=h(t)?t.value:t;for(let n of e)if(f(n)&&(n.key===t||n.key===s||h(n.key)&&n.key.value===s))return n}var eg=class extends R{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(n,e),this.items=[]}static from(e,t,s){let{keepUndefined:n,replacer:i}=s,r=new this(e),o=(e,o)=>{if("function"==typeof i)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==o||n)&&r.items.push(ef(e,o,s))};if(t instanceof Map)for(let[e,s]of t)o(e,s);else if(t&&"object"==typeof t)for(let e of Object.keys(t))o(e,t[e]);return"function"==typeof e.sortMapEntries&&r.items.sort(e.sortMapEntries),r}add(e,t){let s;s=f(e)?e:e&&"object"==typeof e&&"key"in e?new eh(e.key,e.value):new eh(e,e?.value);let n=em(this.items,s.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${s.key} already set`);h(n.value)&&M(s.value)?n.value.value=s.value:n.value=s.value}else if(i){let e=this.items.findIndex(e=>0>i(s,e));-1===e?this.items.push(s):this.items.splice(e,0,s)}else this.items.push(s)}delete(e){let t=em(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let s=em(this.items,e)?.value;return(!t&&h(s)?s.value:s)??void 0}has(e){return!!em(this.items,e)}set(e,t){this.add(new eh(e,t),!0)}toJSON(e,t,s){let n=s?new s:t?.mapAsMap?new Map:{};for(let e of(t?.onCreate&&t.onCreate(n),this.items))eu(t,n,e);return n}toString(e,t,s){if(!e)return JSON.stringify(this);for(let e of this.items)if(!f(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ed(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}},ey={collection:"map",default:!0,nodeClass:eg,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(u(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,s)=>eg.from(e,t,s)},eb=class extends R{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(o,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=ek(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){let s=ek(e);if("number"!=typeof s)return;let n=this.items[s];return!t&&h(n)?n.value:n}has(e){let t=ek(e);return"number"==typeof t&&t<this.items.length}set(e,t){let s=ek(e);if("number"!=typeof s)throw Error(`Expected a valid index, not ${e}.`);let n=this.items[s];h(n)&&M(t)?n.value=t:this.items[s]=t}toJSON(e,t){let s=[];t?.onCreate&&t.onCreate(s);let n=0;for(let e of this.items)s.push(B(e,String(n++),t));return s}toString(e,t,s){return e?ed(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let r of t){if("function"==typeof n){let s=t instanceof Set?r:String(e++);r=n.call(t,s,r)}i.items.push(P(r,void 0,s))}}return i}};function ek(e){let t=h(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}var ev={collection:"seq",default:!0,nodeClass:eb,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(d(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,s)=>eb.from(e,t,s)},ew={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,s,n)=>es(e,t=Object.assign({actualString:!0},t),s,n)},eS={identify:e=>null==e,createNode:()=>new D(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new D(null),stringify:({source:e},t)=>"string"==typeof e&&eS.test.test(e)?e:t.options.nullStr},eE={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new D("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},s)=>e&&eE.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?s.options.trueStr:s.options.falseStr};function eN({format:e,minFractionDigits:t,tag:s,value:n}){if("bigint"==typeof n)return String(n);let i="number"==typeof n?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!s||"tag:yaml.org,2002:float"===s)&&/^-?\d/.test(r)&&!r.includes("e")){let e=r.indexOf(".");e<0&&(e=r.length,r+=".");let s=t-(r.length-e-1);for(;s-- >0;)r+="0"}return r}var eO={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?-1/0:1/0,stringify:eN},eA={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():eN(e)}},eT={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new D(parseFloat(e)),s=e.indexOf(".");return -1!==s&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-s-1),t},stringify:eN},eI=e=>"bigint"==typeof e||Number.isInteger(e),ex=(e,t,s,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),s);function e$(e,t,s){let{value:n}=e;return eI(n)&&n>=0?s+n.toString(t):eN(e)}var eL={identify:e=>eI(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>ex(e,2,8,s),stringify:e=>e$(e,8,"0o")},eC={identify:eI,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>ex(e,0,10,s),stringify:eN},e_={identify:e=>eI(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>ex(e,2,16,s),stringify:e=>e$(e,16,"0x")},eB=[ey,ev,ew,eS,eE,eL,eC,e_,eO,eA,eT];function eK(e){return"bigint"==typeof e||Number.isInteger(e)}var ej=({value:e})=>JSON.stringify(e),eM=[ey,ev].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ej},{identify:e=>null==e,createNode:()=>new D(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ej},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:ej},{identify:eK,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})=>eK(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:ej}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),eD={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"!=typeof atob)return t("This environment does not support reading binary tags; either Buffer or atob is required"),e;{let t=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let e=0;e<t.length;++e)s[e]=t.charCodeAt(e);return s}},stringify({comment:e,type:t,value:s},n,i,r){let o;if(!s)return"";if("function"==typeof btoa){let e="";for(let t=0;t<s.length;++t)e+=String.fromCharCode(s[t]);o=btoa(e)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=D.BLOCK_LITERAL),t!==D.QUOTE_DOUBLE){let e=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),s=Math.ceil(o.length/e),i=Array(s);for(let t=0,n=0;t<s;++t,n+=e)i[t]=o.substr(n,e);o=i.join(t===D.BLOCK_LITERAL?`
|
|
52
52
|
`:" ")}return es({comment:e,type:t,value:o},n,i,r)}};function eP(e,t){if(d(e))for(let s=0;s<e.items.length;++s){let n=e.items[s];if(!f(n)){if(u(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");let e=n.items[0]||new eh(new D(null));if(n.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${n.commentBefore}
|
|
53
53
|
${e.key.commentBefore}`:n.commentBefore),n.comment){let t=e.value??e.key;t.comment=t.comment?`${n.comment}
|
|
54
|
-
${t.comment}`:n.comment}n=e}e.items[s]=f(n)?n:new eh(n)}}else t("Expected a sequence for this tag");return e}function eq(e,t,s){let{replacer:n}=s,i=new eb(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let o,l;if("function"==typeof n&&(e=n.call(t,String(r++),e)),Array.isArray(e))if(2===e.length)o=e[0],l=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(1===t.length)l=e[o=t[0]];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(ef(o,l,s))}return i}var eU={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:eP,createNode:eq},eR=class e extends eb{constructor(){super(),this.add=eg.prototype.add.bind(this),this.delete=eg.prototype.delete.bind(this),this.get=eg.prototype.get.bind(this),this.has=eg.prototype.has.bind(this),this.set=eg.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;for(let e of(t?.onCreate&&t.onCreate(s),this.items)){let n,i;if(f(e)?(n=K(e.key,"",t),i=K(e.value,n,t)):n=K(e,"",t),s.has(n))throw Error("Ordered maps must not include duplicate keys");s.set(n,i)}return s}static from(e,t,s){let n=eq(e,t,s),i=new this;return i.items=n.items,i}};eR.tag="tag:yaml.org,2002:omap";var eF={collection:"seq",identify:e=>e instanceof Map,nodeClass:eR,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let s=eP(e,t),n=[];for(let{key:e}of s.items)h(e)&&(n.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):n.push(e.value));return Object.assign(new eR,s)},createNode:(e,t,s)=>eR.from(e,t,s)};function eJ({value:e,source:t},s){return t&&(e?eV:eY).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}var eV={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new D(!0),stringify:eJ},eY={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new D(!1),stringify:eJ},eW=e=>"bigint"==typeof e||Number.isInteger(e);function eG(e,t,s,{intAsBigInt:n}){let 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}`}let t=BigInt(e);return"-"===i?BigInt(-1)*t:t}let r=parseInt(e,s);return"-"===i?-1*r:r}function eH(e,t,s){let{value:n}=e;if(eW(n)){let e=n.toString(t);return n<0?"-"+s+e.substr(1):s+e}return eN(e)}var eQ=class e extends eg{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=f(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new eh(e.key,null):new eh(e,null),em(this.items,t.key)||this.items.push(t)}get(e,t){let s=em(this.items,e);return!t&&f(s)?h(s.key)?s.key.value:s.key:s}set(e,t){if("boolean"!=typeof t)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=em(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new eh(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw Error("Set items must all have null values")}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof n&&(e=n.call(t,e,e)),i.items.push(ef(e,null,s));return i}};eQ.tag="tag:yaml.org,2002:set";var eX={collection:"map",identify:e=>e instanceof Set,nodeClass:eQ,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>eQ.from(e,t,s),resolve(e,t){if(u(e)){if(e.hasAllNullValues(!0))return Object.assign(new eQ,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ez(e,t){let s=e[0],n="-"===s||"+"===s?e.substring(1):e,i=e=>t?BigInt(e):Number(e),r=n.replace(/_/g,"").split(":").reduce((e,t)=>e*i(60)+i(t),i(0));return"-"===s?i(-1)*r:r}function eZ(e){let{value:t}=e,s=e=>e;if("bigint"==typeof t)s=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return eN(e);let n="";t<0&&(n="-",t*=s(-1));let 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(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var e0={identify:e=>"bigint"==typeof e||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})=>ez(e,s),stringify:eZ},e1={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ez(e,!1),stringify:eZ},e2={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(e2.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,n,i,r,o,l]=t.map(Number),a=Date.UTC(s,n-1,i,r||0,o||0,l||0,t[7]?Number((t[7]+"00").substr(1,3)):0),c=t[8];if(c&&"Z"!==c){let e=ez(c,!1);30>Math.abs(e)&&(e*=60),a-=6e4*e}return new Date(a)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},e9=[ey,ev,ew,eS,eV,eY,{identify:eW,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>eG(e,2,2,s),stringify:e=>eH(e,2,"0b")},{identify:eW,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>eG(e,1,8,s),stringify:e=>eH(e,8,"0")},{identify:eW,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>eG(e,0,10,s),stringify:eN},{identify:eW,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>eG(e,2,16,s),stringify:e=>eH(e,16,"0x")},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?-1/0:1/0,stringify:eN},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():eN(e)}},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new D(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(-1!==s){let n=e.substring(s+1).replace(/_/g,"");"0"===n[n.length-1]&&(t.minFractionDigits=n.length)}return t},stringify:eN},eD,eo,eF,eU,eX,e0,e1,e2],e8=new Map([["core",eK],["failsafe",[ey,ev,ew]],["json",eM],["yaml11",e9],["yaml-1.1",e9]]),e6={binary:eD,bool:eE,float:eT,floatExp:eA,floatNaN:eO,floatTime:e1,int:eC,intHex:e_,intOct:eL,intTime:e0,map:ey,merge:eo,null:eS,omap:eF,pairs:eU,seq:ev,set:eX,timestamp:e2},e4={"tag:yaml.org,2002:binary":eD,"tag:yaml.org,2002:merge":eo,"tag:yaml.org,2002:omap":eF,"tag:yaml.org,2002:pairs":eU,"tag:yaml.org,2002:set":eX,"tag:yaml.org,2002:timestamp":e2};function e3(e,t,s){let n=e8.get(t);if(n&&!e)return s&&!n.includes(eo)?n.concat(eo):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(e8.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else"function"==typeof e&&(i=e(i.slice()));return s&&(i=i.concat(eo)),i.reduce((e,t)=>{let s="string"==typeof t?e6[t]:t;if(!s){let e=JSON.stringify(t),s=Object.keys(e6).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown custom tag ${e}; use one of ${s}`)}return e.includes(s)||e.push(s),e},[])}var e7=(e,t)=>e.key<t.key?-1:+(e.key>t.key),e5=class e{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:l,sortMapEntries:a,toStringDefaults:c}){this.compat=Array.isArray(e)?e3(e,"compat"):e?e3(null,e):null,this.name="string"==typeof l&&l||"core",this.knownTags=i?e4:{},this.tags=e3(t,this.name,s),this.toStringOptions=c??null,Object.defineProperty(this,n,{value:ey}),Object.defineProperty(this,r,{value:ew}),Object.defineProperty(this,o,{value:ev}),this.sortMapEntries="function"==typeof a?a:!0===a?e7:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}},te=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,l,{value:s});let i=null;"function"==typeof t||Array.isArray(t)?i=t:void 0===n&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new x({version:o}),this.setSchema(o,n),this.contents=void 0===e?null:this.createNode(e,i,n)}clone(){let t=Object.create(e.prototype,{[l]:{value:s}});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=m(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){tt(this.contents)&&this.contents.add(e)}addIn(e,t){tt(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=L(this);e.anchor=!t||s.has(t)?C(t||"a",s):t}return new j(e.anchor)}createNode(e,t,s){var n,i;let r,o,l,a;if("function"==typeof t)e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>"number"==typeof e||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else void 0===s&&t&&(s=t,t=void 0);let{aliasDuplicateObjects:c,anchorPrefix:u,flow:f,keepUndefined:d,onTagObj:m,tag:g}=s??{},{onAnchor:y,setAnchors:b,sourceObjects:k}=(n=this,i=u||"a",o=[],l=new Map,a=null,{onAnchor:e=>{o.push(e),a??(a=L(n));let t=C(i,a);return a.add(t),t},setAnchors:()=>{for(let e of o){let t=l.get(e);if("object"==typeof t&&t.anchor&&(h(t.node)||p(t.node)))t.node.anchor=t.anchor;else{let t=Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}}},sourceObjects:l}),v={aliasDuplicateObjects:c??!0,keepUndefined:d??!1,onAnchor:y,onTagObj:m,replacer:r,schema:this.schema,sourceObjects:k},w=P(e,g,v);return f&&p(w)&&(w.flow=!0),b(),w}createPair(e,t,s={}){return new eh(this.createNode(e,null,s),this.createNode(t,null,s))}delete(e){return!!tt(this.contents)&&this.contents.delete(e)}deleteIn(e){return U(e)?null!=this.contents&&(this.contents=null,!0):!!tt(this.contents)&&this.contents.deleteIn(e)}get(e,t){return p(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return U(e)?!t&&h(this.contents)?this.contents.value:this.contents:p(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!p(this.contents)&&this.contents.has(e)}hasIn(e){return U(e)?void 0!==this.contents:!!p(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=q(this.schema,[e],t):tt(this.contents)&&this.contents.set(e,t)}setIn(e,t){U(e)?this.contents=t:null==this.contents?this.contents=q(this.schema,Array.from(e),t):tt(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let s;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new x({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new x({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new e5(Object.assign(s,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:n,onAnchor:i,reviver:r}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===s,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},l=K(this.contents,t??"",o);if("function"==typeof i)for(let{count:e,res:t}of o.anchors.values())i(t,e);return"function"==typeof r?_(r,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||0>=Number(e.indent))){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){let s=[],n=!0===t.directives;if(!1!==t.directives&&e.directives){let t=e.directives.toString(e);t?(s.push(t),n=!0):e.directives.docStart&&(n=!0)}n&&s.push("---");let i=en(e,t),{commentString:r}=i.options;if(e.commentBefore){1!==s.length&&s.unshift("");let t=r(e.commentBefore);s.unshift(J(t,""))}let o=!1,l=null;if(e.contents){if(m(e.contents)){if(e.contents.spaceBefore&&n&&s.push(""),e.contents.commentBefore){let t=r(e.contents.commentBefore);s.push(J(t,""))}i.forceBlockIndent=!!e.comment,l=e.contents.comment}let t=l?void 0:()=>o=!0,a=ei(e.contents,i,()=>l=null,t);l&&(a+=V(a,"",r(l))),("|"===a[0]||">"===a[0])&&"---"===s[s.length-1]?s[s.length-1]=`--- ${a}`:s.push(a)}else s.push(ei(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=r(e.comment);t.includes(`
|
|
54
|
+
${t.comment}`:n.comment}n=e}e.items[s]=f(n)?n:new eh(n)}}else t("Expected a sequence for this tag");return e}function eq(e,t,s){let{replacer:n}=s,i=new eb(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let o,l;if("function"==typeof n&&(e=n.call(t,String(r++),e)),Array.isArray(e))if(2===e.length)o=e[0],l=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(1===t.length)l=e[o=t[0]];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(ef(o,l,s))}return i}var eU={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:eP,createNode:eq},eR=class e extends eb{constructor(){super(),this.add=eg.prototype.add.bind(this),this.delete=eg.prototype.delete.bind(this),this.get=eg.prototype.get.bind(this),this.has=eg.prototype.has.bind(this),this.set=eg.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;for(let e of(t?.onCreate&&t.onCreate(s),this.items)){let n,i;if(f(e)?(n=B(e.key,"",t),i=B(e.value,n,t)):n=B(e,"",t),s.has(n))throw Error("Ordered maps must not include duplicate keys");s.set(n,i)}return s}static from(e,t,s){let n=eq(e,t,s),i=new this;return i.items=n.items,i}};eR.tag="tag:yaml.org,2002:omap";var eF={collection:"seq",identify:e=>e instanceof Map,nodeClass:eR,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let s=eP(e,t),n=[];for(let{key:e}of s.items)h(e)&&(n.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):n.push(e.value));return Object.assign(new eR,s)},createNode:(e,t,s)=>eR.from(e,t,s)};function eJ({value:e,source:t},s){return t&&(e?eV:eY).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}var eV={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new D(!0),stringify:eJ},eY={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new D(!1),stringify:eJ},eW=e=>"bigint"==typeof e||Number.isInteger(e);function eG(e,t,s,{intAsBigInt:n}){let 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}`}let t=BigInt(e);return"-"===i?BigInt(-1)*t:t}let r=parseInt(e,s);return"-"===i?-1*r:r}function eH(e,t,s){let{value:n}=e;if(eW(n)){let e=n.toString(t);return n<0?"-"+s+e.substr(1):s+e}return eN(e)}var eQ=class e extends eg{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=f(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new eh(e.key,null):new eh(e,null),em(this.items,t.key)||this.items.push(t)}get(e,t){let s=em(this.items,e);return!t&&f(s)?h(s.key)?s.key.value:s.key:s}set(e,t){if("boolean"!=typeof t)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=em(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new eh(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw Error("Set items must all have null values")}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof n&&(e=n.call(t,e,e)),i.items.push(ef(e,null,s));return i}};eQ.tag="tag:yaml.org,2002:set";var eX={collection:"map",identify:e=>e instanceof Set,nodeClass:eQ,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>eQ.from(e,t,s),resolve(e,t){if(u(e)){if(e.hasAllNullValues(!0))return Object.assign(new eQ,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ez(e,t){let s=e[0],n="-"===s||"+"===s?e.substring(1):e,i=e=>t?BigInt(e):Number(e),r=n.replace(/_/g,"").split(":").reduce((e,t)=>e*i(60)+i(t),i(0));return"-"===s?i(-1)*r:r}function eZ(e){let{value:t}=e,s=e=>e;if("bigint"==typeof t)s=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return eN(e);let n="";t<0&&(n="-",t*=s(-1));let 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(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var e0={identify:e=>"bigint"==typeof e||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})=>ez(e,s),stringify:eZ},e1={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ez(e,!1),stringify:eZ},e2={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(e2.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,n,i,r,o,l]=t.map(Number),a=Date.UTC(s,n-1,i,r||0,o||0,l||0,t[7]?Number((t[7]+"00").substr(1,3)):0),c=t[8];if(c&&"Z"!==c){let e=ez(c,!1);30>Math.abs(e)&&(e*=60),a-=6e4*e}return new Date(a)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},e9=[ey,ev,ew,eS,eV,eY,{identify:eW,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>eG(e,2,2,s),stringify:e=>eH(e,2,"0b")},{identify:eW,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>eG(e,1,8,s),stringify:e=>eH(e,8,"0")},{identify:eW,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>eG(e,0,10,s),stringify:eN},{identify:eW,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>eG(e,2,16,s),stringify:e=>eH(e,16,"0x")},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?-1/0:1/0,stringify:eN},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():eN(e)}},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new D(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(-1!==s){let n=e.substring(s+1).replace(/_/g,"");"0"===n[n.length-1]&&(t.minFractionDigits=n.length)}return t},stringify:eN},eD,eo,eF,eU,eX,e0,e1,e2],e8=new Map([["core",eB],["failsafe",[ey,ev,ew]],["json",eM],["yaml11",e9],["yaml-1.1",e9]]),e6={binary:eD,bool:eE,float:eT,floatExp:eA,floatNaN:eO,floatTime:e1,int:eC,intHex:e_,intOct:eL,intTime:e0,map:ey,merge:eo,null:eS,omap:eF,pairs:eU,seq:ev,set:eX,timestamp:e2},e4={"tag:yaml.org,2002:binary":eD,"tag:yaml.org,2002:merge":eo,"tag:yaml.org,2002:omap":eF,"tag:yaml.org,2002:pairs":eU,"tag:yaml.org,2002:set":eX,"tag:yaml.org,2002:timestamp":e2};function e3(e,t,s){let n=e8.get(t);if(n&&!e)return s&&!n.includes(eo)?n.concat(eo):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(e8.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else"function"==typeof e&&(i=e(i.slice()));return s&&(i=i.concat(eo)),i.reduce((e,t)=>{let s="string"==typeof t?e6[t]:t;if(!s){let e=JSON.stringify(t),s=Object.keys(e6).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown custom tag ${e}; use one of ${s}`)}return e.includes(s)||e.push(s),e},[])}var e7=(e,t)=>e.key<t.key?-1:+(e.key>t.key),e5=class e{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:l,sortMapEntries:a,toStringDefaults:c}){this.compat=Array.isArray(e)?e3(e,"compat"):e?e3(null,e):null,this.name="string"==typeof l&&l||"core",this.knownTags=i?e4:{},this.tags=e3(t,this.name,s),this.toStringOptions=c??null,Object.defineProperty(this,n,{value:ey}),Object.defineProperty(this,r,{value:ew}),Object.defineProperty(this,o,{value:ev}),this.sortMapEntries="function"==typeof a?a:!0===a?e7:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}},te=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,l,{value:s});let i=null;"function"==typeof t||Array.isArray(t)?i=t:void 0===n&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new x({version:o}),this.setSchema(o,n),this.contents=void 0===e?null:this.createNode(e,i,n)}clone(){let t=Object.create(e.prototype,{[l]:{value:s}});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=m(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){tt(this.contents)&&this.contents.add(e)}addIn(e,t){tt(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=L(this);e.anchor=!t||s.has(t)?C(t||"a",s):t}return new j(e.anchor)}createNode(e,t,s){var n,i;let r,o,l,a;if("function"==typeof t)e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>"number"==typeof e||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else void 0===s&&t&&(s=t,t=void 0);let{aliasDuplicateObjects:c,anchorPrefix:u,flow:f,keepUndefined:d,onTagObj:m,tag:g}=s??{},{onAnchor:y,setAnchors:b,sourceObjects:k}=(n=this,i=u||"a",o=[],l=new Map,a=null,{onAnchor:e=>{o.push(e),a??(a=L(n));let t=C(i,a);return a.add(t),t},setAnchors:()=>{for(let e of o){let t=l.get(e);if("object"==typeof t&&t.anchor&&(h(t.node)||p(t.node)))t.node.anchor=t.anchor;else{let t=Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}}},sourceObjects:l}),v={aliasDuplicateObjects:c??!0,keepUndefined:d??!1,onAnchor:y,onTagObj:m,replacer:r,schema:this.schema,sourceObjects:k},w=P(e,g,v);return f&&p(w)&&(w.flow=!0),b(),w}createPair(e,t,s={}){return new eh(this.createNode(e,null,s),this.createNode(t,null,s))}delete(e){return!!tt(this.contents)&&this.contents.delete(e)}deleteIn(e){return U(e)?null!=this.contents&&(this.contents=null,!0):!!tt(this.contents)&&this.contents.deleteIn(e)}get(e,t){return p(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return U(e)?!t&&h(this.contents)?this.contents.value:this.contents:p(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!p(this.contents)&&this.contents.has(e)}hasIn(e){return U(e)?void 0!==this.contents:!!p(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=q(this.schema,[e],t):tt(this.contents)&&this.contents.set(e,t)}setIn(e,t){U(e)?this.contents=t:null==this.contents?this.contents=q(this.schema,Array.from(e),t):tt(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let s;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new x({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new x({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new e5(Object.assign(s,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:n,onAnchor:i,reviver:r}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===s,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},l=B(this.contents,t??"",o);if("function"==typeof i)for(let{count:e,res:t}of o.anchors.values())i(t,e);return"function"==typeof r?_(r,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||0>=Number(e.indent))){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){let s=[],n=!0===t.directives;if(!1!==t.directives&&e.directives){let t=e.directives.toString(e);t?(s.push(t),n=!0):e.directives.docStart&&(n=!0)}n&&s.push("---");let i=en(e,t),{commentString:r}=i.options;if(e.commentBefore){1!==s.length&&s.unshift("");let t=r(e.commentBefore);s.unshift(J(t,""))}let o=!1,l=null;if(e.contents){if(m(e.contents)){if(e.contents.spaceBefore&&n&&s.push(""),e.contents.commentBefore){let t=r(e.contents.commentBefore);s.push(J(t,""))}i.forceBlockIndent=!!e.comment,l=e.contents.comment}let t=l?void 0:()=>o=!0,a=ei(e.contents,i,()=>l=null,t);l&&(a+=V(a,"",r(l))),("|"===a[0]||">"===a[0])&&"---"===s[s.length-1]?s[s.length-1]=`--- ${a}`:s.push(a)}else s.push(ei(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=r(e.comment);t.includes(`
|
|
55
55
|
`)?(s.push("..."),s.push(J(t,""))):s.push(`... ${t}`)}else s.push("...");else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,"")),t&&((!o||l)&&""!==s[s.length-1]&&s.push(""),s.push(J(r(t),"")))}return s.join(`
|
|
56
56
|
`)+`
|
|
57
57
|
`}(this,e)}};function tt(e){if(p(e))return!0;throw Error("Expected a YAML collection as document contents")}var ts=class extends Error{constructor(e,t,s,n){super(),this.name=e,this.code=s,this.message=n,this.pos=t}},tn=class extends ts{constructor(e,t,s){super("YAMLParseError",e,t,s)}},ti=class extends ts{constructor(e,t,s){super("YAMLWarning",e,t,s)}},tr=(e,t)=>s=>{if(-1===s.pos[0])return;s.linePos=s.pos.map(e=>t.linePos(e));let{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){let e=Math.min(r-39,o.length-79);o="…"+o.substring(e),r-=e-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,r))){let s=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);s.length>80&&(s=s.substring(0,79)+`\u2026
|
|
@@ -105,7 +105,7 @@ ${t}`:s}else{let e=i.commentBefore;i.commentBefore=e?`${s}
|
|
|
105
105
|
${e}`:s}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:tS(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let t of e)yield*this.next(t);yield*this.end(t,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,s,n)=>{let i=tw(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",s,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=function(e,t,{offset:s,start:n,value:i,end:r},o){let l=new te(void 0,Object.assign({_directives:t},e)),a={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},c=to(n,{indicator:"doc-start",next:i??r?.[0],offset:s,onError:o,parentIndent:0,startOnNewline:!0});c.found&&(l.directives.docStart=!0,i&&("block-map"===i.type||"block-seq"===i.type)&&!c.hasNewline&&o(c.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?tk(a,i,c,o):tv(a,c.end,n,null,c,o);let u=l.contents.range[2],f=tf(r,u,!1,o);return f.comment&&(l.comment=f.comment),l.range=[s,u,f.offset],l}(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new tn(tw(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){this.errors.push(new tn(tw(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=tf(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}
|
|
106
106
|
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new tn(tw(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new te(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),e.range=[0,t,t],this.decorate(e,!1),yield e}}},tN=Symbol("break visit"),tO=Symbol("skip children"),tA=Symbol("remove item");function tT(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),function e(t,s,n){let i=n(s,t);if("symbol"==typeof i)return i;for(let r of["key","value"]){let o=s[r];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let i=e(Object.freeze(t.concat([[r,s]])),o.items[s],n);if("number"==typeof i)s=i-1;else{if(i===tN)return tN;i===tA&&(o.items.splice(s,1),s-=1)}}"function"==typeof i&&"key"===r&&(i=i(s,t))}}return"function"==typeof i?i(s,t):i}(Object.freeze([]),e,t)}function tI(e){switch(e){case void 0:case" ":case`
|
|
107
107
|
`:case"\r":case" ":return!0;default:return!1}}tT.BREAK=tN,tT.SKIP=tO,tT.REMOVE=tA,tT.itemAtPath=(e,t)=>{let s=e;for(let[e,n]of t){let t=s?.[e];if(!t||!("items"in t))return;s=t.items[n]}return s},tT.parentCollection=(e,t)=>{let s=tT.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=s?.[n];if(i&&"items"in i)return i;throw Error("Parent collection not found")};var tx=new Set("0123456789ABCDEFabcdef"),t$=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),tL=new Set(",[]{}"),tC=new Set(` ,[]{}
|
|
108
|
-
\r `),t_=e=>!e||tC.has(e),
|
|
108
|
+
\r `),t_=e=>!e||tC.has(e),tB=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||" "===t;)t=this.buffer[++e];return!t||"#"===t||t===`
|
|
109
109
|
`||"\r"===t&&this.buffer[e+1]===`
|
|
110
110
|
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;" "===t;)t=this.buffer[++s+e];if("\r"===t){let t=this.buffer[s+e+1];if(t===`
|
|
111
111
|
`||!t&&!this.atEnd)return e+s+1}return t!==`
|
|
@@ -122,13 +122,13 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
122
122
|
`,i=this.buffer[s+1]):t=s),"#"===i||e&&tL.has(i))break;if(n===`
|
|
123
123
|
`){let e=this.continueScalar(s+1);if(-1===e)break;s=Math.max(s,e-2)}}else{if(e&&tL.has(n))break;t=s}return n||this.atEnd?(yield"\x1f",yield*this.pushToIndex(t+1,!0),e?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){let e=0;for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue;case"&":e+=yield*this.pushUntil(t_),e+=yield*this.pushSpaces(!0);continue;case"-":case"?":case":":{let t=this.flowLevel>0,s=this.charAt(1);if(tI(s)||t&&tL.has(s)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue}}}break}return e}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!tI(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(t$.has(t))t=this.buffer[++e];else if("%"===t&&tx.has(this.buffer[e+1])&&tx.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
124
124
|
`?yield*this.pushCount(1):"\r"===e&&this.charAt(1)===`
|
|
125
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(" "===s||e&&" "===s)let n=t-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=t),n}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},
|
|
125
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(" "===s||e&&" "===s)let n=t-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=t),n}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},tK=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){let n=t+s>>1;this.lineStarts[n]<e?t=n+1:s=n}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}};function tj(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function tM(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 tD(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function tP(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function tq(e){if(0===e.length)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(;e[++t]?.type==="space";);return e.splice(t,e.length)}function tU(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let s=0;s<t.length;++s)e.push(t[s])}function tR(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||tj(t.start,"explicit-key-ind")||tj(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,tD(t.value)?t.value.end?tU(t.value.end,t.sep):t.value.end=t.sep:tU(t.start,t.sep),delete t.sep)}var tF=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new tB,this.onNewLine=e}*parse(e,t=!1){for(let s of(this.onNewLine&&0===this.offset&&this.onNewLine(0),this.lexer.lex(e,t)))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=function(e){switch(e){case"\uFEFF":return"byte-order-mark";case"\x02":return"doc-mode";case"\x18":return"flow-error-end";case"\x1f":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
126
126
|
`:case`\r
|
|
127
127
|
`: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}(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if("doc-end"===this.type&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{let e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&tR(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{let s=e.items[e.items.length-1];if(s.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(s.sep)s.value=t;else{Object.assign(s,{key:t,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=e.items[e.items.length-1];s.value?e.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{let s=e.items[e.items.length-1];!s||s.value?e.items.push({start:[],key:t,sep:[]}):s.sep?s.value=t:Object.assign(s,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if(("document"===e.type||"block-map"===e.type||"block-seq"===e.type)&&("block-map"===t.type||"block-seq"===t.type)){let s=t.items[t.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&-1===tM(s.start)&&(0===t.indent||s.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=s.start:e.items.push({start:s.start}),t.items.splice(-1,1))}}else yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};"doc-start"===this.type&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":return void(-1!==tM(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken));case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){let t=tq(tP(this.peek(2))),s;e.end?((s=e.end).push(this.sourceToken),delete e.end):s=[this.sourceToken];let n={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=n}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
|
|
128
128
|
`)+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
129
129
|
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){tU(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,n=s&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type,i=[];if(n&&t.sep&&!t.value){let s=[];for(let n=0;n<t.sep.length;++n){let i=t.sep[n];switch(i.type){case"newline":s.push(n);break;case"space":break;case"comment":i.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(i=t.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":n||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":t.sep||t.explicitKey?n||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(tj(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(tD(t.key)&&!tj(t.sep,"newline")){let e=tq(t.start),s=t.key,n=t.sep;n.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:s,sep:n}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(tj(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=tq(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:i,key:null,sep:[this.sourceToken]}):tj(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);n||t.value?(e.items.push({start:i,key:s,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(s):(Object.assign(t,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let n=this.startBlockValue(e);if(n){if("block-seq"===n.type){if(!t.explicitKey&&t.sep&&!tj(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else s&&e.items.push({start:i});this.stack.push(n);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){tU(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||tj(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do yield*this.pop(),e=this.peek(1);while(e?.type==="flow-collection")}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:s,sep:[]}):t.sep?this.stack.push(s):Object.assign(t,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if("block-map"!==t.type||("map-value-ind"!==this.type||t.indent!==e.indent)&&("newline"!==this.type||t.items[t.items.length-1].sep))if("map-value-ind"===this.type&&"flow-collection"!==t.type){let s=tq(tP(t));tR(e);let n=e.end.splice(1,e.end.length);n.push(this.sourceToken);let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e);else yield*this.pop(),yield*this.step()}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
130
130
|
`)+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
131
|
-
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=tq(tP(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=tq(tP(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}};function tJ(e,t={}){let s,{lineCounter:n,prettyErrors:i}=(s=!1!==t.prettyErrors,{lineCounter:t.lineCounter||s&&new
|
|
131
|
+
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=tq(tP(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=tq(tP(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}};function tJ(e,t={}){let s,{lineCounter:n,prettyErrors:i}=(s=!1!==t.prettyErrors,{lineCounter:t.lineCounter||s&&new tK||null,prettyErrors:s}),r=new tF(n?.addNewLine),o=new tE(t),l=null;for(let t of o.compose(r.parse(e),!0,e.length))if(l){if("silent"!==l.options.logLevel){l.errors.push(new tn(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else l=t;return i&&n&&(l.errors.forEach(tr(e,n)),l.warnings.forEach(tr(e,n))),l}var tV=/^[-+]?(?:0b[01]+|0x[0-9a-fA-F]+|0o[0-7]+|[0-9]+)$/,tY=/^(?:[-+]?[0-9]+(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/,tW={identify:e=>"number"==typeof e&&Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",test:tV,resolve:function(e,t){if(!tV.test(e))return t(`cannot resolve ${JSON.stringify(e)} as an integer`),NaN;let s=e,n="-"===s[0]?-1:1;("-"===s[0]||"+"===s[0])&&(s=s.slice(1));let i="b"===s[1]?2:"x"===s[1]?16:"o"===s[1]?8:10,r=n*Number.parseInt(10===i?s:s.slice(2),i);return Number.isFinite(r)?r:e},stringify:eN},tG={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:tY,resolve:function(e,t){if(!tY.test(e))return t(`cannot resolve ${JSON.stringify(e)} as a float`),NaN;let s=e.toLowerCase(),n="-"===s[0]?-1:1;if(("-"===s[0]||"+"===s[0])&&(s=s.slice(1)),".inf"===s)return 1/0*n;if(".nan"===s)return NaN;let i=n*Number.parseFloat(s);return Number.isFinite(i)?i:e},stringify:eN},tH={schema:"core",customTags:e=>[...e.filter(e=>"string"==typeof e||e.tag!==tW.tag&&e.tag!==tG.tag),tW,tG]},tQ=/(?:^|[[{,]|[:?-][ \t])[ \t]*$/,tX=/(?:^|[:?-][ \t])[ \t]*[|>][-+0-9]*[ \t]*(?:#.*)?$/;function tz(e){let t,s,n=tJ(e,{...tH,logLevel:"silent"}),i=n.errors.find(t=>!("MISSING_CHAR"===t.code&&t.message.startsWith("Comments must be separated from other tokens by white space characters"))||!!/[|>][-+0-9]*$/.test(e.slice(0,t.pos[0])))??n.warnings[0];if(i)return{ok:!1,message:i.message.split(`
|
|
132
132
|
`)[0]};if(t=!1,v(n,{Pair(s,n,i){let r=i[i.length-1],o=n.key,l=h(o)&&""===o.source&&o.range?.[0]===o.range?.[1]?o.range[0]:-1;if(l>=0&&u(r)&&!r.flow&&/^[ \t]*:/.test(e.slice(l))&&/^[ \t]*$/.test(e.slice(e.lastIndexOf(`
|
|
133
133
|
`,l-1)+1,l)))return t=!0,v.BREAK}}),t)return{ok:!1,message:"a block mapping entry has no key"};if(v(n,{Scalar(e,t){let n=t.tag===tW.tag?tV:t.tag===tG.tag?tY:void 0;n&&(!n.test(t.source??"")||"number"!=typeof t.value)&&(s=`cannot resolve ${JSON.stringify(t.source)} as ${t.tag}`)},Pair(e,t){h(t.key)&&null===t.key.value&&(t.key=new D("null"))}}),s)return{ok:!1,message:s};try{return{ok:!0,value:n.toJS()}}catch(e){return{ok:!1,message:e instanceof Error?e.message:String(e)}}}function tZ(e){let t=e.length>0&&!/[\n\r]$/.test(e)?`${e}
|
|
134
134
|
`:e,s=tz(t);if(s.ok)return s;let n=function(e){let t=e.split(`
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{h as e}from"./chunk-
|
|
1
|
+
import{h as e}from"./chunk-64JFHCJC.js";import{a as t,c as i}from"./chunk-MFTQWHUB.js";import{b as n,c as a}from"./chunk-XHU3A432.js";import{d as r}from"./chunk-5LKPDHPC.js";import{t as o}from"./chunk-V6I2VGNQ.js";import"./chunk-7UFOFWBA.js";import{c as l}from"./chunk-VRZKI33U.js";import{D as s,a as d,b as c,c as h,d as p,e as m,g as f,i as u}from"./chunk-QVSZOF5M.js";import{C as g,c as y,n as b,o as x,q as w,x as v,y as $}from"./chunk-G4JBA7HU.js";import{i as k,j as M,k as _,l as I,q as S}from"./chunk-3JTYTXA6.js";import{h as z,l as W,n as N,o as j}from"./chunk-YVNJDVQO.js";import{H as F,N as D,O as E,S as T,T as A,_ as C,da as B,oa as P,sa as L,xa as O}from"./chunk-EIYLJ4FI.js";import{C as U,D as q}from"./chunk-PJJSDGLB.js";import"./chunk-YHMTSXIR.js";import"./chunk-QCU5G5PZ.js";var J=Object.freeze({id:"mindmap",upstreamId:"mindmap",maturity:"stable",label:"Mindmap",headers:["mindmap"],aliases:[],config:{section:"mindmap",keys:["padding","maxNodeWidth","layoutAlgorithm","colorBy"],noopKeys:["colorBy","layoutAlgorithm"]},identity:{id:"family:mindmap",kind:"family",version:"1.0.0",compatibility:{core:"0.5.4"},provenance:{owner:"agentic-mermaid",source:"built-in"}},collisionPriority:100,semanticChannels:["importance","category"],semanticRoles:["prelude","title","chrome","edge","node","icon","label"],scenePrimitiveEvidence:[{role:"prelude",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"title",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"edge",primitive:"connector",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"node",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"icon",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"icon",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"icon",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"label",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]}],example:`mindmap
|
|
2
2
|
root((Product))
|
|
3
3
|
Research
|
|
4
4
|
Interviews
|
|
5
5
|
Evidence
|
|
6
6
|
Delivery
|
|
7
|
-
Launch`,detect:
|
|
7
|
+
Launch`,detect:U,detectLoose:q}),G={padding:a,maxNodeWidth:n},H=class extends Error{constructor(e,t){super(e),this.line=t,this.name="MindmapParseError"}line},V=class extends H{constructor(e,t){super(`Duplicate mindmap node identity '${e}' on line ${t}; every node identity must be unique.`,t),this.id=e}id;code="MINDMAP_DUPLICATE_ID"};function R(e){let t=e.map((e,t)=>t);try{for(let{start:i,end:n}of Q(e,0))t[i]=n}catch{}return t}function*Q(e,t){let i,n;for(let a=t;a<e.length;a++){let t=a,r=e[a];if(r.includes('["`')&&!r.includes('`"]')){let t=[r],i=!1;for(;++a<e.length;)if(t.push(e[a]),e[a].includes('`"]')){i=!0;break}if(!i)throw new H("Unclosed mindmap Markdown String",a+1);r=t.join(`
|
|
8
8
|
`)}if("open"===K(r.trimStart())){let t=e=>/^\s*%%/.test(e);i??=e.map(e=>t(e)?"":e).join(`
|
|
9
9
|
`);let o=(n??=e.reduce((i,n,a)=>(i.push(0===a?0:i[a-1]+(t(e[a-1])?0:e[a-1].length)+1),i),[]))[a]+r.length-r.trimStart().length,l=K(i.slice(o));if(l&&"open"!==l){let n=a+i.slice(o,o+l.end).split(`
|
|
10
10
|
`).length-1;r=[e[a].trimEnd(),...e.slice(a+1,n+1).filter(e=>!t(e)).map(e=>e.trim())].join(`
|
|
11
|
-
`),a=n}}yield{raw:X(r),start:t,end:a}}}function
|
|
12
|
-
`))],W=r.accessibilityTitle??r.nodes[0]?.label;for(let e of(W&&$.push(n.documentText({id:"acc-title",element:"title",domId:h,text:W})),r.accessibilityDescription&&$.push(n.documentText({id:"acc-desc",element:"description",domId:p,text:r.accessibilityDescription})),r.title&&$.push(n.text(F(r.title,N(s,void 0,l.styleFace)))),r.edges)){let t=v(e.to),[i,a,r,o]=e.points;if(!i||!a||!r||!o)throw Error(`Mindmap edge "${e.from}" -> "${e.to}" requires four cubic control points`);let l=B(e.d,i,[{kind:"cubic",control1:a,control2:r,end:o}]);$.push(n.connector({id:T(e.from,e.to),role:"edge",geometry:l.geometry,lineStyle:"solid",paint:{fill:"none",stroke:t,strokeWidth:"2.5"},endpoints:{from:e.from,to:e.to},relationship:{kind:"mindmap-branch",direction:"forward"},route:{ownership:"layout",contours:l.contours},stroke:{lineCap:"round"},channels:{importance:1,category:String(g.get(e.to)??0)},attributes:{className:"mindmap-edge",data:{"branch-index":String(g.get(e.to)??0)}}}))}for(let e of r.nodes)$.push(function(e,n,a,r,o){let l=O(a.bg)&&O(a.fg)&&(void 0===a.accent||O(a.accent)),s=l?S(a).arrow:"var(--_arrow)",d=l?L(o,a.bg,1===n.depth?30:2===n.depth?20:13):"var(--_node-fill)",c=0===n.depth?s:d,h=0===n.depth?s:o,p=0===n.depth?l?U(a.bg,s,4.5,a.fg):"var(--bg)":l?U(a.fg,d,4.5):"var(--_text)",m=function(e){let{x:t,y:i,width:n,height:a}=e,r=(e,t)=>({x:eh(e),y:eh(t)});if("circle"===e.shape)return{kind:"circle",cx:eh(t+n/2),cy:eh(i+a/2),r:eh(Math.min(n,a)/2)};if("cloud"===e.shape)return{kind:"ellipse",cx:eh(t+n/2),cy:eh(i+a/2),rx:eh(n/2),ry:eh(a/2)};if("hexagon"===e.shape)return{kind:"polygon",points:[r(t+12,i),r(t+n-12,i),r(t+n,i+a/2),r(t+n-12,i+a),r(t+12,i+a),r(t,i+a/2)]};if("bang"===e.shape){let e=[];for(let o=0;o<12;o++){let l=-Math.PI/2+o*Math.PI/6,s=o%2==0?n/2:.38*n,d=o%2==0?a/2:.38*a;e.push(r(t+n/2+Math.cos(l)*s,i+a/2+Math.sin(l)*d))}return{kind:"polygon",points:e}}return{kind:"rect",x:eh(t),y:eh(i),width:eh(n),height:eh(a),rx:"rect"===e.shape?0:"rounded"===e.shape?10:16,ry:"rect"===e.shape?0:"rounded"===e.shape?10:16}}(n),f=[{node:e.shape({id:A(n.id,"shape"),role:"chrome",geometry:m,paint:{fill:c,stroke:h,strokeWidth:"1.5"}}),indent:2}];if(n.icon){let a=i(n.icon);if(a){let t=n.x+n.width/2-7,i=n.y+4,r=14/24;f.push({node:e.pathArtwork({id:A(n.id,"icon"),paths:a.paths,owner:{id:n.id,role:"node"},open:`<g class="mindmap-icon-glyph" data-icon="${D(n.icon)}" data-icon-source="${D(a.source)}" transform="translate(${eh(t)} ${eh(i)}) scale(${eh(r)})">`,transform:{kind:"matrix",a:eh(r),b:0,c:0,d:eh(r),e:eh(t),f:eh(i)},paint:{fill:p,stroke:p,strokeWidth:"0.8"}}),indent:2})}else{let i=t(n.icon);f.push({node:e.text({id:A(n.id,"icon"),role:"icon",owner:{id:n.id,role:"node"},text:i,block:n.iconFallbackBlock,x:eh(n.x+n.width/2),y:eh(n.y+12),fontSize:9,anchor:"middle",paint:{fill:p},baselineShift:0,attributes:{className:"mindmap-icon-fallback",data:{icon:n.icon}}}),indent:2})}}let u=n.y+n.height/2+5*!!n.icon,g=n.labelBlock?.fontSize??13,y=n.labelBlock?.fontWeight??500,b=n.labelBlock?.letterSpacing??0;f.push({node:e.text({id:A(n.id,"label"),role:"label",text:n.label,block:n.labelBlock,x:n.x+n.width/2,y:u,fontSize:g,fontWeight:y,letterSpacing:b,anchor:"middle",paint:{fill:p}}),indent:2});let x=n.className?` ${D(n.className)}`:"";return e.group({id:n.id,role:"node",channels:{importance:Math.max(1,5-n.depth),...void 0===r?{}:{category:String(r)}},open:`<g class="mindmap-node depth-${n.depth}${x}" data-id="${D(n.id)}" data-label="${E(n.label)}"${void 0===r?"":` data-branch-index="${r}"`}${n.parentId?` data-parent-id="${D(n.parentId)}"`:""}>`,close:"</g>",children:f})}(n,e,o,g.get(e.id),v(e.id)));return $.push(n.documentClose()),{family:"mindmap",width:r.width,height:r.height,colors:o,transparent:c,parts:$}}),em=p(R,{configDiagnostics:e=>{let t=r("mindmap",e,H),i=e.root,n=i&&"object"==typeof i&&!Array.isArray(i)?i:void 0;return n&&"layout"in n&&!["tidy-tree","cose-bilkent","radial"].includes(String(n.layout))&&t.push({code:"INEFFECTIVE_CONFIG",field:"layout",message:'layout must be "cose-bilkent", "radial", or "tidy-tree" for mindmap diagrams; the invalid value has no effect.'}),t},statementEnds:Z,normalizeRequest:e=>({familyConfig:{position:ec(e.source.config.mindmap,e.source.config.layout)}}),layout:e=>h(function(e,n,a={groupLetterSpacing:0}){return function(e,t,i,n={}){let a=W(t,i);if(!a)return e;let r=es(n.padding,32),o=a.height,l=e.nodes.map(e=>({...e,y:e.y+o})),s=e.edges.map(e=>{let t=e.points.map(e=>({x:e.x,y:e.y+o})),[i,n,a,r]=t;return{...e,points:t,d:`M ${ed(i.x)} ${ed(i.y)} C ${ed(n.x)} ${ed(n.y)} ${ed(a.x)} ${ed(a.y)} ${ed(r.x)} ${ed(r.y)}`}}),d=Math.max(e.width,a.width+2*r);return{...e,width:d,height:e.height+o,nodes:l,edges:s,title:z(a,d,r)}}(function(e,n={}){var a,r;let o,l,s,d,c,h,p,m,f,u,g,y,b,x,w,v,$,k,M,_,S=es(n.padding,32),I=es(n.maxNodeWidth,180),N=es(n.nodeGap,40),W=es(n.layerGap,20),z=(a=e.root,r=n.textStyle,o=new Map,(l=(e,n,a)=>{let s=C(e.label,{fontSize:r?.nodeLabelFontSize??13,fontWeight:r?.nodeLabelFontWeight??500,letterSpacing:r?.nodeLetterSpacing,transform:r?.nodeTextTransform,maxWidth:I}),d=s.text,c=Math.max(56,s.width+24),h=Math.max(34,s.height+18+14*!!e.icon);for(let r of("circle"===e.shape&&(c=h=Math.max(c,h,54)),("bang"===e.shape||"cloud"===e.shape)&&(c+=18,h+=10),o.set(e.id,{id:e.id,label:d,labelBlock:s,iconFallbackBlock:e.icon&&!i(e.icon)?C(t(e.icon),{fontSize:9,fontWeight:400}):void 0,shape:e.shape,markdown:e.markdown,icon:e.icon,className:e.className,...a?{parentId:a}:{},depth:n,side:0===n?"root":"right",x:0,y:0,width:c,height:h}),e.children))l(r,n+1,e.id)})(a,0),o);return"tidy-tree"===n.layout?function(e,t,i,n,a){let r=function(e){let t=new Map;for(let i of e.values())t.set(i.depth,Math.max(t.get(i.depth)??0,i.width));return t}(t),o=new Map([[0,i]]),l=Math.max(...Array.from(t.values(),e=>e.depth));for(let e=1;e<=l;e++)o.set(e,o.get(e-1)+(r.get(e-1)??0)+a);let s=i,d=e=>{let a=t.get(e.id);if(a.side=0===a.depth?"root":"right",a.x=o.get(a.depth),0===e.children.length)return a.y=s,s+=a.height+n,a.y+a.height/2;let r=e.children.map(d);return a.y=Math.max(i,(r[0]+r.at(-1))/2-a.height/2),a.y+a.height/2};return d(e.root),eo(t,i),el(e,t,i)}(e,z,S,N,W):(s=z.get(e.root.id),d=e=>{let t=z.get(e.id).height;return 0===e.children.length?t:Math.max(t,e.children.reduce((e,t)=>e+d(t),0)+N*(e.children.length-1))},c=[],h=[],p=0,m=0,e.root.children.forEach((e,t)=>{let i=d(e)+N;1===t||t>1&&p<m?(c.push(e),p+=i):(h.push(e),m+=i)}),f=(e,t)=>{z.get(e.id).side=t,e.children.forEach(e=>f(e,t))},c.forEach(e=>f(e,"left")),h.forEach(e=>f(e,"right")),g=(u=e=>{let t=new Map;for(let i of z.values())i.side===e&&t.set(i.depth,Math.max(t.get(i.depth)??0,i.width));return t})("left"),y=u("right"),s.x=S+[...g.values()].reduce((e,t)=>e+t+W,0),x=(b=(e,t)=>{let i=new Map,n="left"===e?s.x:s.x+s.width,a=Math.max(0,...t.keys());for(let r=1;r<=a;r++){let a=t.get(r)??0;"left"===e?(n-=W+a,i.set(r,n)):(n+=W,i.set(r,n),n+=a)}return i})("left",g),w=b("right",y),$=(v=(e,t)=>{let i=S,n="left"===t?g:y,a="left"===t?x:w,r=e=>{let o=z.get(e.id),l=a.get(o.depth);if(o.x="left"===t?l+(n.get(o.depth)-o.width):l,0===e.children.length)return o.y=i,i+=o.height+N,o.y+o.height/2;let s=e.children.map(r),d=(s[0]+s.at(-1))/2;return o.y=d-o.height/2,d};return e.forEach(r),{min:S,max:Math.max(S,i-N)}})(c,"left"),k=v(h,"right"),M=Math.max(s.height,$.max-$.min,k.max-k.min),s.y=S+Math.max(0,(M-s.height)/2),(_=(e,t)=>{if(0===e.length)return;let i=S+(M-(t.max-t.min))/2-t.min,n=e=>{z.get(e.id).y+=i,e.children.forEach(n)};e.forEach(n)})(c,$),_(h,k),eo(z,S),el(e,z,S))}(e,{...n,textStyle:a}),e.title,a,n)}(o(g(function(e){let t=e.replace(/^\uFEFF/,"").split(/\r?\n/).map(e=>v([e],0)?.form==="inline"?X(e,!1):e),i=$(t,Z(t));if(void 0!==i.unclosedIndex)throw new Q("Unclosed accDescr block",i.unclosedIndex+1);let n=w(i.accessibility),a=i.familyLines,r=a.findIndex(e=>/^\s*mindmap\s*$/i.test(e));if(r<0)throw new Q("Mindmap source must start with the mindmap header");m("mindmap")&&f("mindmap","header",a[r],{line:r+1,unit:"normalized"});let o=[],l=new Set,s,d,c=n.title,h=n.descr;for(let{raw:e,start:t,end:i}of(m("mindmap")&&u("mindmap","initialize",{accessibilityTitle:c,accessibilityDescription:h}),G(a,r+1))){let n=t+1,a=e.trim();if(!a||a.startsWith("%%"))continue;if(/^acc(?:Title|Descr)\b/i.test(a)){let e=/^accTitle\b/i.test(a)?"accTitle":"accDescr";throw new Q(`Mindmap ${e} must contain a non-empty value`,i+1)}if(/^::icon\b/i.test(a)){m("mindmap")&&f("mindmap","icon",a,{line:n,unit:"normalized"});let e=a.match(/^::icon\(([^)]*)\)$/i),t=e?.[1]?.trim();if(!e||!t)throw new Q("Mindmap icon decoration must contain a non-empty value without closing parentheses",i+1);if(!d)throw new Q("Mindmap icon decoration requires a preceding node",i+1);d.icon=t,m("mindmap")&&u("mindmap","setIcon",{id:d.id,icon:t},{line:n,unit:"normalized"});continue}if(a.startsWith(":::")){m("mindmap")&&f("mindmap","class",a,{line:n,unit:"normalized"});let e=a.match(/^:::\s*(.+)$/);if(!e)throw new Q("Mindmap class decoration must contain at least one class name",i+1);if(!d)throw new Q("Mindmap class decoration requires a preceding node",i+1);d.className=e[1].trim().replace(/\s+/g," "),m("mindmap")&&u("mindmap","setClass",{id:d.id,className:d.className},{line:n,unit:"normalized"});continue}let r=ee(a);if(m("mindmap")&&f("mindmap",r?"node":"invalid",a,{line:n,unit:"normalized"}),!r)throw new Q(`Invalid mindmap node syntax on line ${i+1}: ${a}`,i+1);if(l.has(r.id))throw new V(r.id,i+1);l.add(r.id);let c={...r,children:[]};m("mindmap")&&u("mindmap","createNode",c,{line:n,unit:"normalized"});let h=function(e){let t=0;for(let i of e)if(" "===i)t++;else if(" "===i)t+=4;else break;return t}(e);for(;o.length>0&&o[o.length-1].indent>=h;)o.pop();if(0===o.length){if(s)throw new Q(`There can be only one mindmap root; '${c.label}' has no parent on line ${i+1}.`,i+1);s=c,m("mindmap")&&u("mindmap","setRoot",{id:c.id},{line:n,unit:"normalized"})}else o[o.length-1].node.children.push(c),m("mindmap")&&u("mindmap","attachChild",{id:c.id,parentId:o[o.length-1].node.id},{line:n,unit:"normalized"});o.push({indent:h,node:c}),d=c}if(!s)throw new Q("Mindmap requires exactly one root node");return{root:s,...c?{accessibilityTitle:c}:{},...h?{accessibilityDescription:h}:{}}}(e.source.authoredFamilyBody??e.source.familyBody),e.source.accessibility),e.source.frontmatter),e.familyConfig?.position??ec(void 0,void 0),N(e.renderOptions,void 0,e.styleFace)),{injectAccessibility:!1}),projectPositioned:d(function({positioned:e}){return{version:1,nodes:e.nodes.map(e=>({id:e.id,x:l(e.x),y:l(e.y),w:l(e.width),h:l(e.height),shape:"circle"===e.shape?"ellipse":"rectangle",label:e.label,...s(e.labelBlock,e.x+e.width/2,e.y+e.height/2+5*!!e.icon,e)})),edges:e.edges.map((e,t)=>({id:`edge#${t}:${e.from}->${e.to}`,from:e.from,to:e.to,path:e.points.map(e=>[l(e.x),l(e.y)])})),groups:[],bounds:{w:l(e.width),h:l(e.height)}}}),lowerScene:c(ep)});export{em as default};
|
|
11
|
+
`),a=n}}yield{raw:X(r),start:t,end:a}}}function Y(e){let t=K(e);return"open"===t?null:t}function K(e){let t=e.match(/^([^()[{}]*?)(\(\(|\{\{|\[|\)\)|\)|\()/);if(!t)return null;let i=t[2],n=t[0].length,a=n;if(e.startsWith('"`',n)){let t=e.indexOf('`"',n+2);if(t<0)return"open";a=t+2}else if('"'===e[n]){for(a=n+1;a<e.length;){if("\\"===e[a]){a+=2;continue}if('"'===e[a++])break}if('"'!==e[a-1]||a===n+1)return"open"}else for(;a<e.length&&!/[)\](}]/.test(e[a]);)a++;let r=e.slice(n,a),o='"'===e[n];for(;a<e.length&&(o?/[ \t]/:/\s/).test(e[a]);)a++;if(a===e.length)return o?null:"open";let l=["))","}}","((","(-","-)",")","]","("].find(t=>e.startsWith(t,a));if(!l)return null;let s="["===i?"rect":"{{"===i?"hexagon":"(("===i?"circle":"))"===i?"bang":")"===i||")"!==l?"cloud":"rounded";return{id:t[1].trim(),label:r,shape:s,end:a+l.length}}function X(e,t=!0){if(e.trimStart().startsWith(":::"))return e;let i=v([e],0)?.form==="inline",n=e.trimStart(),a=t&&!n.startsWith("::")?Y(n):null;if(a){let t=e.indexOf("%%",e.length-n.length+a.end);return t<0?e:e.slice(0,t)}let r=!1,o=!1;for(let t=0;t<e.length-1;t++){let n=e[t];if(o){o=!1;continue}if("\\"===n){o=!0;continue}if('"'===n){r=!r;continue}if(r||"%"!==n||"%"!==e[t+1])continue;let a=e.slice(0,t).trim();if(!a||i||/^::icon\([^)]*\)$/.test(a))return e.slice(0,t);let l=ee(a);if(l&&"default"!==l.shape)return e.slice(0,t)}return e}var Z=/^(?!mindmap\b)[^([\r\n){}]*$/i;function ee(e){return function(e){let t=Y(e);if(t&&!e.slice(t.end).trim()){let e=ei(t.id,t.label,t.shape);return e&&{node:e}}for(let{regex:t,shape:i}of et){let n=e.match(t);if(!n)continue;let a=n[2],r=!a.includes('"')&&function(e){let t=[];for(let i of e){let e="("===i?")":"["===i?"]":"{"===i?"}":void 0;if(e)t.push(e);else if((")"===i||"]"===i||"}"===i)&&t.pop()!==i)return!1}return 0===t.length}(a)?ei(n[1].trim(),a,i):null;return r&&{node:r,nested:!0}}if(!Z.test(e))return null;let i=en(e),n=ea(i.label);return n?{node:{id:n,label:i.label,shape:"default",...i.markdown?{markdown:!0}:{}}}:null}(e)?.node??null}var et=[{regex:/^(.*?)\(\((.*)\)\)$/,shape:"circle"},{regex:/^(.*?)\{\{(.*)\}\}$/,shape:"hexagon"},{regex:/^(.*?)\[([\s\S]*)\]$/,shape:"rect"},{regex:/^(.*?)\)\)(.*)\(\($/,shape:"bang"},{regex:/^(.*?)\)(.*)\($/,shape:"cloud"},{regex:/^(.*?)\((.*)\)$/,shape:"rounded"}];function ei(e,t,i){if(!Z.test(e))return null;let n=en(t),a=e||ea(n.label);return a&&n.label?{id:a,label:n.label,shape:i,...n.markdown?{markdown:!0}:{}}:null}function en(e){let t=e.trim(),i=t.startsWith('"`')&&t.endsWith('`"');return i?t=b(t.slice(2,-2)).replace(/\*\*([\s\S]+?)\*\*/g,"<b>$1</b>").replace(/\*([\s\S]+?)\*/g,"<i>$1</i>"):(t.startsWith('"')&&t.endsWith('"')&&(t=t.slice(1,-1)),t=(t=b(t)).replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1")),{label:x(F(t),"*()[]").trim(),markdown:i}}function ea(e){return e.replace(/<\/?(?:b|i)>/gi,"").trim()}function er(e,t){let i=e.width*("bang"===e.shape?.38:.5);return e.x+e.width/2+("right"===t?i:-i)}function eo(e,t){let i=Math.min(...Array.from(e.values(),e=>e.y));if(i<t)for(let n of e.values())n.y+=t-i}function el(e,t,i){let n=Array.from(t.values()).flatMap(e=>{if(!e.parentId)return[];let i=t.get(e.parentId),n="left"===e.side,a={x:er(i,n?"left":"right"),y:i.y+i.height/2},r={x:er(e,n?"right":"left"),y:e.y+e.height/2},o=.42*Math.abs(r.x-a.x),l={x:a.x+(n?-o:o),y:a.y},s={x:r.x+(n?o:-o),y:r.y};return[{from:i.id,to:e.id,points:[a,l,s,r],d:`M ${ed(a.x)} ${ed(a.y)} C ${ed(l.x)} ${ed(l.y)} ${ed(s.x)} ${ed(s.y)} ${ed(r.x)} ${ed(r.y)}`}]}),a=Math.min(...Array.from(t.values(),e=>e.x));if(a<i){let e=i-a;for(let i of t.values())i.x+=e;for(let t of n){t.points.forEach(t=>{t.x+=e});let[i,n,a,r]=t.points;t.d=`M ${ed(i.x)} ${ed(i.y)} C ${ed(n.x)} ${ed(n.y)} ${ed(a.x)} ${ed(a.y)} ${ed(r.x)} ${ed(r.y)}`}}return{width:Math.max(...Array.from(t.values(),e=>e.x+e.width))+i,height:Math.max(...Array.from(t.values(),e=>e.y+e.height))+i,accessibilityTitle:e.accessibilityTitle,accessibilityDescription:e.accessibilityDescription,nodes:[...t.values()],edges:n}}function es(e,t){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:t}function ed(e){return Math.round(1e3*e)/1e3}function ec(e,t){let i={layout:"tidy-tree"===t?"tidy-tree":"radial"};return!e||"object"!=typeof e||Array.isArray(e)||("number"==typeof e.padding&&Number.isFinite(e.padding)&&e.padding>=0&&(i.padding=e.padding),"number"==typeof e.maxNodeWidth&&Number.isFinite(e.maxNodeWidth)&&e.maxNodeWidth>0&&(i.maxNodeWidth=e.maxNodeWidth)),i}function eh(e){return Math.round(1e3*e)/1e3}var ep=y(function(n,a){let{positioned:r,colors:o,resolved:l}=a,s=l.renderOptions,d=o.font??"Inter",c=s.transparent??!1,h="mindmap-title",p="mindmap-desc",m=S(r.accessibilityTitle??r.nodes[0]?.label,r.accessibilityDescription,h,p,"mindmap"),f=[_(r.width,r.height,o,c,{attrs:m}),M(d,!1,o.shadow,o.embedFontImport)],u=k(o);u&&f.push(`<defs>${u}</defs>`);let g=function(e){let t=new Map,i=e.nodes.find(e=>0===e.depth);if(!i)return t;let n=0;for(let a of[...e.nodes].sort((e,t)=>e.depth-t.depth))0!==a.depth&&(a.parentId===i.id?t.set(a.id,n++):a.parentId&&t.has(a.parentId)&&t.set(a.id,t.get(a.parentId)));return t}(r),y=new Set(g.values()).size,b=O(o.accent??"")?o.accent:"#3b82f6",x=O(o.bg)?o.bg:"#ffffff",w=e(y,y<=6?{accent:b,bg:x}:{accent:o.accent??b,bg:o.bg}),v=e=>w[g.get(e)??0]??b,$=[n.documentOpen({id:"prelude",width:r.width,height:r.height,colors:o,transparent:c,font:d,hasMonoFont:!1},f.join(`
|
|
12
|
+
`))],W=r.accessibilityTitle??r.nodes[0]?.label;for(let e of(W&&$.push(n.documentText({id:"acc-title",element:"title",domId:h,text:W})),r.accessibilityDescription&&$.push(n.documentText({id:"acc-desc",element:"description",domId:p,text:r.accessibilityDescription})),r.title&&$.push(n.text(j(r.title,z(s,void 0,l.styleFace)))),r.edges)){let t=v(e.to),[i,a,r,o]=e.points;if(!i||!a||!r||!o)throw Error(`Mindmap edge "${e.from}" -> "${e.to}" requires four cubic control points`);let l=B(e.d,i,[{kind:"cubic",control1:a,control2:r,end:o}]);$.push(n.connector({id:T(e.from,e.to),role:"edge",geometry:l.geometry,lineStyle:"solid",paint:{fill:"none",stroke:t,strokeWidth:"2.5"},endpoints:{from:e.from,to:e.to},relationship:{kind:"mindmap-branch",direction:"forward"},route:{ownership:"layout",contours:l.contours},stroke:{lineCap:"round"},channels:{importance:1,category:String(g.get(e.to)??0)},attributes:{className:"mindmap-edge",data:{"branch-index":String(g.get(e.to)??0)}}}))}for(let e of r.nodes)$.push(function(e,n,a,r,o){let l=O(a.bg)&&O(a.fg)&&(void 0===a.accent||O(a.accent)),s=l?I(a).arrow:"var(--_arrow)",d=l?P(o,a.bg,1===n.depth?30:2===n.depth?20:13):"var(--_node-fill)",c=0===n.depth?s:d,h=0===n.depth?s:o,p=0===n.depth?l?L(a.bg,s,4.5,a.fg):"var(--bg)":l?L(a.fg,d,4.5):"var(--_text)",m=function(e){let{x:t,y:i,width:n,height:a}=e,r=(e,t)=>({x:eh(e),y:eh(t)});if("circle"===e.shape)return{kind:"circle",cx:eh(t+n/2),cy:eh(i+a/2),r:eh(Math.min(n,a)/2)};if("cloud"===e.shape)return{kind:"ellipse",cx:eh(t+n/2),cy:eh(i+a/2),rx:eh(n/2),ry:eh(a/2)};if("hexagon"===e.shape)return{kind:"polygon",points:[r(t+12,i),r(t+n-12,i),r(t+n,i+a/2),r(t+n-12,i+a),r(t+12,i+a),r(t,i+a/2)]};if("bang"===e.shape){let e=[];for(let o=0;o<12;o++){let l=-Math.PI/2+o*Math.PI/6,s=o%2==0?n/2:.38*n,d=o%2==0?a/2:.38*a;e.push(r(t+n/2+Math.cos(l)*s,i+a/2+Math.sin(l)*d))}return{kind:"polygon",points:e}}return{kind:"rect",x:eh(t),y:eh(i),width:eh(n),height:eh(a),rx:"rect"===e.shape?0:"rounded"===e.shape?10:16,ry:"rect"===e.shape?0:"rounded"===e.shape?10:16}}(n),f=[{node:e.shape({id:A(n.id,"shape"),role:"chrome",geometry:m,paint:{fill:c,stroke:h,strokeWidth:"1.5"}}),indent:2}];if(n.icon){let a=i(n.icon);if(a){let t=n.x+n.width/2-7,i=n.y+4,r=14/24;f.push({node:e.pathArtwork({id:A(n.id,"icon"),paths:a.paths,owner:{id:n.id,role:"node"},open:`<g class="mindmap-icon-glyph" data-icon="${D(n.icon)}" data-icon-source="${D(a.source)}" transform="translate(${eh(t)} ${eh(i)}) scale(${eh(r)})">`,transform:{kind:"matrix",a:eh(r),b:0,c:0,d:eh(r),e:eh(t),f:eh(i)},paint:{fill:p,stroke:p,strokeWidth:"0.8"}}),indent:2})}else{let i=t(n.icon);f.push({node:e.text({id:A(n.id,"icon"),role:"icon",owner:{id:n.id,role:"node"},text:i,block:n.iconFallbackBlock,x:eh(n.x+n.width/2),y:eh(n.y+12),fontSize:9,anchor:"middle",paint:{fill:p},baselineShift:0,attributes:{className:"mindmap-icon-fallback",data:{icon:n.icon}}}),indent:2})}}let u=n.y+n.height/2+5*!!n.icon,g=n.labelBlock?.fontSize??13,y=n.labelBlock?.fontWeight??500,b=n.labelBlock?.letterSpacing??0;f.push({node:e.text({id:A(n.id,"label"),role:"label",text:n.label,block:n.labelBlock,x:n.x+n.width/2,y:u,fontSize:g,fontWeight:y,letterSpacing:b,anchor:"middle",paint:{fill:p}}),indent:2});let x=n.className?` ${D(n.className)}`:"";return e.group({id:n.id,role:"node",channels:{importance:Math.max(1,5-n.depth),...void 0===r?{}:{category:String(r)}},open:`<g class="mindmap-node depth-${n.depth}${x}" data-id="${D(n.id)}" data-label="${E(n.label)}"${void 0===r?"":` data-branch-index="${r}"`}${n.parentId?` data-parent-id="${D(n.parentId)}"`:""}>`,close:"</g>",children:f})}(n,e,o,g.get(e.id),v(e.id)));return $.push(n.documentClose()),{family:"mindmap",width:r.width,height:r.height,colors:o,transparent:c,parts:$}}),em=p(J,{configDiagnostics:e=>{let t=r("mindmap",e,G),i=e.root,n=i&&"object"==typeof i&&!Array.isArray(i)?i:void 0;return n&&"layout"in n&&!["tidy-tree","cose-bilkent","radial"].includes(String(n.layout))&&t.push({code:"INEFFECTIVE_CONFIG",field:"layout",message:'layout must be "cose-bilkent", "radial", or "tidy-tree" for mindmap diagrams; the invalid value has no effect.'}),t},statementEnds:R,normalizeRequest:e=>({familyConfig:{position:ec(e.source.config.mindmap,e.source.config.layout)}}),layout:e=>h(function(e,n,a={groupLetterSpacing:0}){return function(e,t,i,n={}){let a=W(t,i);if(!a)return e;let r=es(n.padding,32),o=a.height,l=e.nodes.map(e=>({...e,y:e.y+o})),s=e.edges.map(e=>{let t=e.points.map(e=>({x:e.x,y:e.y+o})),[i,n,a,r]=t;return{...e,points:t,d:`M ${ed(i.x)} ${ed(i.y)} C ${ed(n.x)} ${ed(n.y)} ${ed(a.x)} ${ed(a.y)} ${ed(r.x)} ${ed(r.y)}`}}),d=Math.max(e.width,a.width+2*r);return{...e,width:d,height:e.height+o,nodes:l,edges:s,title:N(a,d,r)}}(function(e,n={}){var a,r;let o,l,s,d,c,h,p,m,f,u,g,y,b,x,w,v,$,k,M,_,I=es(n.padding,32),S=es(n.maxNodeWidth,180),z=es(n.nodeGap,40),W=es(n.layerGap,20),N=(a=e.root,r=n.textStyle,o=new Map,(l=(e,n,a)=>{let s=C(e.label,{fontSize:r?.nodeLabelFontSize??13,fontWeight:r?.nodeLabelFontWeight??500,letterSpacing:r?.nodeLetterSpacing,transform:r?.nodeTextTransform,maxWidth:S}),d=s.text,c=Math.max(56,s.width+24),h=Math.max(34,s.height+18+14*!!e.icon);for(let r of("circle"===e.shape&&(c=h=Math.max(c,h,54)),("bang"===e.shape||"cloud"===e.shape)&&(c+=18,h+=10),o.set(e.id,{id:e.id,label:d,labelBlock:s,iconFallbackBlock:e.icon&&!i(e.icon)?C(t(e.icon),{fontSize:9,fontWeight:400}):void 0,shape:e.shape,markdown:e.markdown,icon:e.icon,className:e.className,...a?{parentId:a}:{},depth:n,side:0===n?"root":"right",x:0,y:0,width:c,height:h}),e.children))l(r,n+1,e.id)})(a,0),o);return"tidy-tree"===n.layout?function(e,t,i,n,a){let r=function(e){let t=new Map;for(let i of e.values())t.set(i.depth,Math.max(t.get(i.depth)??0,i.width));return t}(t),o=new Map([[0,i]]),l=Math.max(...Array.from(t.values(),e=>e.depth));for(let e=1;e<=l;e++)o.set(e,o.get(e-1)+(r.get(e-1)??0)+a);let s=i,d=e=>{let a=t.get(e.id);if(a.side=0===a.depth?"root":"right",a.x=o.get(a.depth),0===e.children.length)return a.y=s,s+=a.height+n,a.y+a.height/2;let r=e.children.map(d);return a.y=Math.max(i,(r[0]+r.at(-1))/2-a.height/2),a.y+a.height/2};return d(e.root),eo(t,i),el(e,t,i)}(e,N,I,z,W):(s=N.get(e.root.id),d=e=>{let t=N.get(e.id).height;return 0===e.children.length?t:Math.max(t,e.children.reduce((e,t)=>e+d(t),0)+z*(e.children.length-1))},c=[],h=[],p=0,m=0,e.root.children.forEach((e,t)=>{let i=d(e)+z;1===t||t>1&&p<m?(c.push(e),p+=i):(h.push(e),m+=i)}),f=(e,t)=>{N.get(e.id).side=t,e.children.forEach(e=>f(e,t))},c.forEach(e=>f(e,"left")),h.forEach(e=>f(e,"right")),g=(u=e=>{let t=new Map;for(let i of N.values())i.side===e&&t.set(i.depth,Math.max(t.get(i.depth)??0,i.width));return t})("left"),y=u("right"),s.x=I+[...g.values()].reduce((e,t)=>e+t+W,0),x=(b=(e,t)=>{let i=new Map,n="left"===e?s.x:s.x+s.width,a=Math.max(0,...t.keys());for(let r=1;r<=a;r++){let a=t.get(r)??0;"left"===e?(n-=W+a,i.set(r,n)):(n+=W,i.set(r,n),n+=a)}return i})("left",g),w=b("right",y),$=(v=(e,t)=>{let i=I,n="left"===t?g:y,a="left"===t?x:w,r=e=>{let o=N.get(e.id),l=a.get(o.depth);if(o.x="left"===t?l+(n.get(o.depth)-o.width):l,0===e.children.length)return o.y=i,i+=o.height+z,o.y+o.height/2;let s=e.children.map(r),d=(s[0]+s.at(-1))/2;return o.y=d-o.height/2,d};return e.forEach(r),{min:I,max:Math.max(I,i-z)}})(c,"left"),k=v(h,"right"),M=Math.max(s.height,$.max-$.min,k.max-k.min),s.y=I+Math.max(0,(M-s.height)/2),(_=(e,t)=>{if(0===e.length)return;let i=I+(M-(t.max-t.min))/2-t.min,n=e=>{N.get(e.id).y+=i,e.children.forEach(n)};e.forEach(n)})(c,$),_(h,k),eo(N,I),el(e,N,I))}(e,{...n,textStyle:a}),e.title,a,n)}(o(g(function(e){let t=e.replace(/^\uFEFF/,"").split(/\r?\n/).map(e=>v([e],0)?.form==="inline"?X(e,!1):e),i=$(t,R(t));if(void 0!==i.unclosedIndex)throw new H("Unclosed accDescr block",i.unclosedIndex+1);let n=w(i.accessibility),a=i.familyLines,r=a.findIndex(e=>/^\s*mindmap\s*$/i.test(e));if(r<0)throw new H("Mindmap source must start with the mindmap header");m("mindmap")&&f("mindmap","header",a[r],{line:r+1,unit:"normalized"});let o=[],l=new Set,s,d,c=n.title,h=n.descr;for(let{raw:e,start:t,end:i}of(m("mindmap")&&u("mindmap","initialize",{accessibilityTitle:c,accessibilityDescription:h}),Q(a,r+1))){let n=t+1,a=e.trim();if(!a||a.startsWith("%%"))continue;if(/^acc(?:Title|Descr)\b/i.test(a)){let e=/^accTitle\b/i.test(a)?"accTitle":"accDescr";throw new H(`Mindmap ${e} must contain a non-empty value`,i+1)}if(/^::icon\b/i.test(a)){m("mindmap")&&f("mindmap","icon",a,{line:n,unit:"normalized"});let e=a.match(/^::icon\(([^)]*)\)$/i),t=e?.[1]?.trim();if(!e||!t)throw new H("Mindmap icon decoration must contain a non-empty value without closing parentheses",i+1);if(!d)throw new H("Mindmap icon decoration requires a preceding node",i+1);d.icon=t,m("mindmap")&&u("mindmap","setIcon",{id:d.id,icon:t},{line:n,unit:"normalized"});continue}if(a.startsWith(":::")){m("mindmap")&&f("mindmap","class",a,{line:n,unit:"normalized"});let e=a.match(/^:::\s*(.+)$/);if(!e)throw new H("Mindmap class decoration must contain at least one class name",i+1);if(!d)throw new H("Mindmap class decoration requires a preceding node",i+1);d.className=e[1].trim().replace(/\s+/g," "),m("mindmap")&&u("mindmap","setClass",{id:d.id,className:d.className},{line:n,unit:"normalized"});continue}let r=ee(a);if(m("mindmap")&&f("mindmap",r?"node":"invalid",a,{line:n,unit:"normalized"}),!r)throw new H(`Invalid mindmap node syntax on line ${i+1}: ${a}`,i+1);if(l.has(r.id))throw new V(r.id,i+1);l.add(r.id);let c={...r,children:[]};m("mindmap")&&u("mindmap","createNode",c,{line:n,unit:"normalized"});let h=function(e){let t=0;for(let i of e)if(" "===i)t++;else if(" "===i)t+=4;else break;return t}(e);for(;o.length>0&&o[o.length-1].indent>=h;)o.pop();if(0===o.length){if(s)throw new H(`There can be only one mindmap root; '${c.label}' has no parent on line ${i+1}.`,i+1);s=c,m("mindmap")&&u("mindmap","setRoot",{id:c.id},{line:n,unit:"normalized"})}else o[o.length-1].node.children.push(c),m("mindmap")&&u("mindmap","attachChild",{id:c.id,parentId:o[o.length-1].node.id},{line:n,unit:"normalized"});o.push({indent:h,node:c}),d=c}if(!s)throw new H("Mindmap requires exactly one root node");return{root:s,...c?{accessibilityTitle:c}:{},...h?{accessibilityDescription:h}:{}}}(e.source.authoredFamilyBody??e.source.familyBody),e.source.accessibility),e.source.frontmatter),e.familyConfig?.position??ec(void 0,void 0),z(e.renderOptions,void 0,e.styleFace)),{injectAccessibility:!1}),projectPositioned:d(function({positioned:e}){return{version:1,nodes:e.nodes.map(e=>({id:e.id,x:l(e.x),y:l(e.y),w:l(e.width),h:l(e.height),shape:"circle"===e.shape?"ellipse":"rectangle",label:e.label,...s(e.labelBlock,e.x+e.width/2,e.y+e.height/2+5*!!e.icon,e)})),edges:e.edges.map((e,t)=>({id:`edge#${t}:${e.from}->${e.to}`,from:e.from,to:e.to,path:e.points.map(e=>[l(e.x),l(e.y)])})),groups:[],bounds:{w:l(e.width),h:l(e.height)}}}),lowerScene:c(ep)});export{em as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{b as e}from"./chunk-
|
|
1
|
+
import{b as e}from"./chunk-D6MQ7QSU.js";import{a as t,b as i,c as a,e as o,j as n}from"./chunk-XHU3A432.js";import{d as r}from"./chunk-5LKPDHPC.js";import{t as s,y as l}from"./chunk-V6I2VGNQ.js";import"./chunk-7UFOFWBA.js";import{a as d}from"./chunk-IUI4DYC3.js";import{a as c,c as p}from"./chunk-VRZKI33U.js";import{D as h,a as f,b as b,c as m,d as g,e as u,g as x,i as y}from"./chunk-QVSZOF5M.js";import{M as k,c as w,pa as v,s as S,y as _}from"./chunk-G4JBA7HU.js";import"./chunk-3JTYTXA6.js";import{h as P,l as W,n as $,o as z}from"./chunk-YVNJDVQO.js";import{D as B,N as M,_ as I}from"./chunk-EIYLJ4FI.js";import{L as j}from"./chunk-PJJSDGLB.js";import"./chunk-YHMTSXIR.js";import"./chunk-QCU5G5PZ.js";var R=Object.freeze({id:"packet",upstreamId:"packet",maturity:"stable",label:"Packet",headers:["packet","packet-beta"],aliases:[],config:{section:"packet",keys:["bitsPerRow","bitOrder","showBits","rowHeight","bitWidth","paddingX","paddingY","useMaxWidth"],noopKeys:["useMaxWidth"]},identity:{id:"family:packet",kind:"family",version:"1.0.0",compatibility:{core:"0.5.4"},provenance:{owner:"agentic-mermaid",source:"built-in"}},collisionPriority:100,semanticChannels:[],semanticRoles:["prelude","chrome","title","node","label"],scenePrimitiveEvidence:[{role:"prelude",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"title",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"node",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"node",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"label",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]}],example:`packet
|
|
2
2
|
0-15: "Source port"
|
|
3
|
-
16-31: "Destination port"`,detect:
|
|
3
|
+
16-31: "Destination port"`,detect:j,detectLoose:j});function F(e={}){let t=l(e,["packet"])??{},i=(e,i)=>"number"==typeof t[e]&&Number.isFinite(t[e])&&t[e]>0?t[e]:i,a=e=>"number"==typeof t[e]&&Number.isFinite(t[e])&&t[e]>=0?t[e]:5;return{bitsPerRow:"number"==typeof t.bitsPerRow&&Number.isSafeInteger(t.bitsPerRow)&&t.bitsPerRow>0?t.bitsPerRow:32,bitOrder:"descending"===t.bitOrder?"descending":"ascending",showBits:!1!==t.showBits,rowHeight:i("rowHeight",32),bitWidth:i("bitWidth",32),paddingX:a("paddingX"),paddingY:a("paddingY")}}var O=w(function(e,{positioned:t,colors:i,resolved:a}){let o=P(a.renderOptions,void 0,a.styleFace),n=a.renderOptions.transparent??!1,r=[];t.title&&r.push(e.text(z(t.title,o)));let s=o.nodeFillColor??"var(--_node-fill)",l=o.nodeTextColor??v(void 0,i,s)("var(--_text)");for(let i of t.fields){let t=[e.shape({id:`${i.id}:box`,role:"node",identity:!1,owner:{id:i.id,role:"node"},geometry:{kind:"rect",x:i.x,y:i.y,width:i.width,height:i.height,rx:o.cornerRadius},paint:{fill:s,stroke:o.nodeBorderColor??"var(--_node-stroke)",strokeWidth:String(o.nodeLineWidth)}}),e.text({id:`${i.id}:label`,role:"label",owner:{id:i.id,role:"node"},text:i.labelBlock.text,block:i.labelBlock,x:i.x+i.width/2,y:i.y+i.height/2,fontSize:i.labelBlock.fontSize,fontWeight:i.labelBlock.fontWeight,letterSpacing:i.labelBlock.letterSpacing,anchor:"middle",paint:{fill:l}})];for(let[a,n]of i.bitLabels.entries())t.push(e.text({id:`${i.id}:bit-${a}`,role:"label",text:n.text,block:n.block,x:n.x,y:n.y,fontSize:n.block.fontSize,fontWeight:n.block.fontWeight,anchor:n.anchor,paint:{fill:o.edgeTextColor??"var(--_text-muted)"}}));r.push(e.group({id:i.id,role:"node",open:`<g data-id="${M(i.id)}" data-field-id="${M(i.fieldId)}" data-start="${i.start}" data-end="${i.end}" data-field-label="${M(B(i.labelBlock.prepared))}">`,close:"</g>",children:t.map(e=>({node:e,indent:2}))}))}return d(e,"packet",t,i,n,r)}),L=g(R,{configDiagnostics:e=>r("packet",e,{bitsPerRow:t("a positive safe integer",e=>Number.isSafeInteger(e)&&Number(e)>=1),bitOrder:n("ascending","descending"),showBits:o,rowHeight:i,bitWidth:i,paddingX:a,paddingY:a,useMaxWidth:o}),normalizeRequest:e=>({familyConfig:{visual:F(e.source.frontmatter)}}),layout:t=>m(function(e,t={},i=F(),a){let o=e.fields.length?Math.floor(e.fields.at(-1).end/i.bitsPerRow)+1:0;k("nodes",o+e.fields.length);let n=P(t,void 0,a),r=t.padding??24,s=W(e.title,n),l=a?.node?.paddingX,d=a?.node?.paddingY??8,c=Math.max(8,Math.min(11,n.edgeLabelFontSize)),p=i.showBits?1.5*c+4:0,h=[],f=Array.from({length:o},()=>i.rowHeight),b={display:"formatted",transform:n.nodeTextTransform,fontSize:n.nodeLabelFontSize,fontWeight:n.nodeLabelFontWeight,letterSpacing:n.nodeLetterSpacing,fontFamily:t.font};for(let t of e.fields){let e;for(let a=t.start;a<=t.end;){let o=Math.floor(a/i.bitsPerRow),n=o*i.bitsPerRow,s=Math.min(t.end,n+i.bitsPerRow-1),c=(s-a+1)*i.bitWidth,p=Math.min(i.paddingX,c-1),m=c-p;a===s&&(e??=I(t.label,b));let g=a===s&&1===e.lines.length&&e.text.length<=4,u=Math.max(1,m-(void 0===l?g?2:8:2*l)),x=g?Math.max(9,Math.min(b.fontSize,Math.floor(b.fontSize*u/Math.max(1,e.width)))):b.fontSize,y=I(t.label,{...b,fontSize:x,maxWidth:u}),w=r+("descending"===i.bitOrder?i.bitsPerRow-(s-n+1):a-n)*i.bitWidth+p/2;h.push({...t,id:`${t.id}:row-${o}`,fieldId:t.id,start:a,end:s,row:o,x:w,y:0,width:m,slotWidth:c,height:0,labelBlock:y,bitLabels:[]}),f[o]=Math.max(f[o],y.height+2*d),k("nodes",h.length),a=s+1}}let m=r+(s?.height??0),g=0;for(let e=0;e<o;e++){for(;g<h.length&&h[g].row===e;){let t=h[g++];if(t.y=m+p,t.height=f[e],i.showBits){let e=t.start===t.end,a="descending"===i.bitOrder?t.end:t.start,o="descending"===i.bitOrder?t.start:t.end,n=e?[{bit:t.start,x:t.x+t.width/2,anchor:"middle"}]:[{bit:a,x:t.x+2,anchor:"start"},{bit:o,x:t.x+t.width-2,anchor:"end"}];t.bitLabels=n.map(e=>({text:String(e.bit),x:e.x,y:m+p/2,anchor:e.anchor,block:I(String(e.bit),{display:"literal",fontSize:c,fontWeight:400})}))}}m+=p+f[e]+i.paddingY}let u=Math.max(2*r+i.bitsPerRow*i.bitWidth,(s?.width??0)+2*r);return{width:u,height:Math.max(2*r+(s?.height??0),m+r),rows:o,fields:h,visual:i,...s?{title:$(s,u,r)}:{},accessibility:{title:e.accessibilityTitle,descr:e.accessibilityDescription}}}(s(function(t,i={}){let a=_("string"==typeof t?t.split(/\r?\n/):[...t]),o=[...a.familyLines];for(;o.length&&(!o[0].trim()||o[0].trim().startsWith("%%"));)o.shift();let n=o.shift()??"";if(x("packet","header",n,{line:1,unit:"normalized"}),!/^packet(?:-beta)?\s*$/i.test(e(n).trim()))throw S({what:"Invalid packet header",expectedForm:"packet",example:`packet
|
|
4
4
|
+8: "Byte"`});let r={kind:"packet",fields:[],accessibilityTitle:i.title??a.accessibility.title,accessibilityDescription:i.descr??a.accessibility.descr},s=o.join(`
|
|
5
5
|
`),l=/(?:title(?:[ \t]+([^\n]*))?(?:\n|$)|(\+)?(0|[1-9]\d*)[ \t]*(?:-[ \t]*(0|[1-9]\d*))?[ \t]*:[ \t]*("(?:[^"\\]|\\[\s\S])*"|'(?:[^'\\]|\\[\s\S])*')[ \t]*(?:%%[^\n]*)?(?:\n|$))/gy,d=0,c=-1,p=0,h=2;for(;d<s.length;){let t=/^(?:\s+|%%[^\n]*(?:\n|$))/.exec(s.slice(d));if(t){d+=t[0].length;continue}l.lastIndex=d;let i=l.exec(s);if(!i){if(!s.slice(d).trim())break;throw S({what:`Invalid packet statement: ${s.slice(d).split(`
|
|
6
6
|
`)[0]}`,expectedForm:'start-end: "label" or +bits: "label"',example:'+16: "Source Port"'})}if(d=l.lastIndex,u("packet")){for(;p<i.index;p++)10===s.charCodeAt(p)&&h++;x("packet",void 0===i[2]&&void 0===i[3]?"title":"field",i[0],{line:h,offset:i.index,endOffset:l.lastIndex,unit:"normalized"})}if(void 0===i[2]&&void 0===i[3]){r.title=e(i[1]??"").trim(),y("packet","set-title",r.title);continue}let a=Number(i[3]),o="+"===i[2],n=o?c+1:a,f=o?n+a-1:void 0===i[4]?n:Number(i[4]);if(o&&void 0!==i[4]||!Number.isSafeInteger(n)||!Number.isSafeInteger(f)||n<0||f<n)throw S({what:`Invalid packet bit range ${n}-${f}`,expectedForm:"a positive bit count or increasing inclusive bit range",example:'+8: "Byte"'});if(n!==c+1)throw S({what:`Packet block ${n}-${f} is not contiguous; it must start from ${c+1}`,expectedForm:`a field starting at ${c+1}`,example:'+8: "Next byte"'});let b=i[5].slice(1,-1);b=b.replace(/\\([\s\S])/g,(e,t)=>({n:`
|
|
7
|
-
`,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"})[t]??t);let m={id:`field-${r.fields.length}`,start:n,end:f,label:b};r.fields.push(m),y("packet","add-field",m),k("nodes",r.fields.length),c=f}return r}(t.source.familyBody,t.source.accessibility),t.source.frontmatter),t.renderOptions,t.familyConfig?.visual??F(),t.styleFace)),projectPositioned:f(function({positioned:e}){return{version:1,nodes:e.fields.map(t=>({id:t.id,x:p(t.x),y:p(t.y),w:p(t.width),h:p(t.height),shape:"rectangle",label:t.label,...h(t.labelBlock,t.x+t.width/2,t.y+t.height/2,c(e),"middle")})),edges:[],groups:[],bounds:{w:p(e.width),h:p(e.height)}}}),lowerScene:b(
|
|
7
|
+
`,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"})[t]??t);let m={id:`field-${r.fields.length}`,start:n,end:f,label:b};r.fields.push(m),y("packet","add-field",m),k("nodes",r.fields.length),c=f}return r}(t.source.familyBody,t.source.accessibility),t.source.frontmatter),t.renderOptions,t.familyConfig?.visual??F(),t.styleFace)),projectPositioned:f(function({positioned:e}){return{version:1,nodes:e.fields.map(t=>({id:t.id,x:p(t.x),y:p(t.y),w:p(t.width),h:p(t.height),shape:"rectangle",label:t.label,...h(t.labelBlock,t.x+t.width/2,t.y+t.height/2,c(e),"middle")})),edges:[],groups:[],bounds:{w:p(e.width),h:p(e.height)}}}),lowerScene:b(O)});export{L as default};
|