agentic-mermaid 0.2.0 → 0.3.1
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 +31 -0
- package/dist/agent-core.d.ts +8 -3
- package/dist/agent-core.js +2 -2
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +4 -4
- package/dist/agentic-mermaid-mcp.js +5 -5
- package/dist/am.js +6 -6
- package/dist/browser-lazy/chunks/architecture-3CGEU363.js +31 -0
- package/dist/browser-lazy/chunks/chunk-2U4EUPSI.js +4 -0
- package/dist/browser-lazy/chunks/chunk-4IUBLBJJ.js +11 -0
- package/dist/browser-lazy/chunks/chunk-4U2TVB2S.js +1 -0
- package/dist/browser-lazy/chunks/chunk-5Q4S74UO.js +1 -0
- package/dist/browser-lazy/chunks/chunk-6UT2VTFI.js +1 -0
- package/dist/browser-lazy/chunks/chunk-7D24ZLOV.js +1 -0
- package/dist/browser-lazy/chunks/chunk-A7L4WWVW.js +143 -0
- package/dist/browser-lazy/chunks/chunk-CTVVJPMX.js +24 -0
- package/dist/browser-lazy/chunks/chunk-DPSSG7LR.js +4 -0
- package/dist/browser-lazy/chunks/chunk-EPFMQPXX.js +1 -0
- package/dist/browser-lazy/chunks/chunk-FFOHLPDA.js +2 -0
- package/dist/browser-lazy/chunks/chunk-FLD63DXE.js +2 -0
- package/dist/browser-lazy/chunks/chunk-FXBBGAMJ.js +46 -0
- package/dist/browser-lazy/chunks/chunk-GRXCKTHX.js +0 -0
- package/dist/browser-lazy/chunks/chunk-HZ4ADQMK.js +1 -0
- package/dist/browser-lazy/chunks/chunk-I6VE56S7.js +1 -0
- package/dist/browser-lazy/chunks/chunk-JX5ZZY3T.js +1 -0
- package/dist/browser-lazy/chunks/chunk-KJVNXJ5Y.js +1 -0
- package/dist/browser-lazy/chunks/chunk-KTTWXSIX.js +1 -0
- package/dist/browser-lazy/chunks/chunk-M6BT2HIP.js +1 -0
- package/dist/browser-lazy/chunks/chunk-MMWVZP6M.js +1 -0
- package/dist/browser-lazy/chunks/chunk-OFRMKQA6.js +1 -0
- package/dist/browser-lazy/chunks/chunk-P7HMSKHJ.js +1 -0
- package/dist/browser-lazy/chunks/chunk-PXRUFH7U.js +1 -0
- package/dist/browser-lazy/chunks/chunk-PZEWZT35.js +1 -0
- package/dist/browser-lazy/chunks/chunk-RVO6J7S3.js +1 -0
- package/dist/browser-lazy/chunks/chunk-STQRDZ67.js +1 -0
- package/dist/browser-lazy/chunks/chunk-T7IJ6V4B.js +3 -0
- package/dist/browser-lazy/chunks/chunk-VDTSULBU.js +7 -0
- package/dist/browser-lazy/chunks/chunk-WEUWIFG3.js +1 -0
- package/dist/browser-lazy/chunks/class-B3AVLSIF.js +9 -0
- package/dist/browser-lazy/chunks/er-AF4BKKKC.js +9 -0
- package/dist/browser-lazy/chunks/flowchart-BE6BQZLZ.js +4 -0
- package/dist/browser-lazy/chunks/gantt-U4BMMSEL.js +28 -0
- package/dist/browser-lazy/chunks/gitgraph-UPSWNFRP.js +8 -0
- package/dist/browser-lazy/chunks/journey-PDZ7FDJR.js +40 -0
- package/dist/browser-lazy/chunks/mindmap-BFEUURLS.js +9 -0
- package/dist/browser-lazy/chunks/pie-ZFYW5JZO.js +19 -0
- package/dist/browser-lazy/chunks/quadrant-XJVEYYXK.js +24 -0
- package/dist/browser-lazy/chunks/radar-OVXFNRNC.js +32 -0
- package/dist/browser-lazy/chunks/render-core-R4ZGGEFS.js +12 -0
- package/dist/browser-lazy/chunks/sequence-AWY6JCSB.js +12 -0
- package/dist/browser-lazy/chunks/state-TCE4DXKR.js +4 -0
- package/dist/browser-lazy/chunks/timeline-W4ZVT3FF.js +20 -0
- package/dist/browser-lazy/chunks/xychart-K3QQACKS.js +36 -0
- package/dist/browser-lazy/index.d.ts +1012 -0
- package/dist/browser-lazy/index.js +1 -0
- package/dist/browser.global.js +778 -0
- package/dist/{chunk-MYPDVZCO.js → chunk-BSVM3VMO.js} +18 -5
- package/dist/{chunk-2P5FKUQC.js → chunk-FGO3J7RA.js} +7 -7
- package/dist/{chunk-2SILJDW2.js → chunk-JJ7JRYZV.js} +2 -2
- package/dist/{chunk-2S3VSS6I.js → chunk-KQMJ37OY.js} +4 -4
- package/dist/{chunk-FDM43XU7.js → chunk-MBIR6S3B.js} +2 -2
- package/dist/{chunk-BJYMBT4I.js → chunk-XVY324NY.js} +47701 -47630
- package/dist/{index-DWPa2MJs.d.ts → index-Do8z5rPq.d.ts} +5409 -5391
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp-cli-7FLGTEG3.js +17 -0
- package/docs/README.md +1 -0
- package/docs/browser.md +491 -0
- package/docs/fork-differences.md +33 -0
- package/docs/style-authoring.md +1 -1
- package/package.json +19 -5
- package/server.json +2 -2
- package/dist/mcp-cli-5J47WEY3.js +0 -17
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as ne}from"./chunk-5Q4S74UO.js";import{g as I}from"./chunk-PXRUFH7U.js";import{a as q}from"./chunk-M6BT2HIP.js";import{e as A,g as R,h as W,j as L,k as N}from"./chunk-RVO6J7S3.js";import{G as Q,H as O,I as G,N as X,O as p,P as z,Q as K,ea as U,fa as Y,i as E,ia as C,ja as T,ka as P,la as _,na as J,oa as ee,pa as v,qa as te,v as V,xa as re,y as Z,z as B}from"./chunk-FXBBGAMJ.js";function Je(e){let{positioned:s,colors:n,resolved:o}=e,t=o.renderOptions,r=n.font??"Inter",i=t.transparent??!1,$=[],c=o.familyAppearance?.visual??t.stateVisual,a=N(t,c?.styleDefaults,o.styleFace);$.push(te({id:"prelude",width:s.width,height:s.height,colors:n,transparent:i,font:r,hasMonoFont:!1},G(s.width,s.height,n,i)+`
|
|
2
|
+
`+O(r,!1,n.shadow,n.embedFontImport)));let d=[];d.push("<defs>");let l=Q(n);l&&d.push(l);let h=new Set;a.edgeStrokeColor&&h.add(a.edgeStrokeColor);let u=!1,f=!1;for(let m of s.edges)m.inlineStyle?.stroke&&h.add(m.inlineStyle.stroke),(m.startMarker==="circle"||m.endMarker==="circle")&&(u=!0),(m.startMarker==="cross"||m.endMarker==="cross")&&(f=!0);let g=pe(h,u,f);d.splice(1,0,re(g)),d.push("</defs>"),$.push(J({id:"defs",markerResources:g},d.join(`
|
|
3
|
+
`)));for(let m of s.groups)$.push(j(m,r,a));let x=new Map,S=new Map;for(let m of s.edges){if(m.points.length<2)continue;let y=`${m.source}->${m.target}`,k=x.get(y)??0;x.set(y,k+1);let b=`edge:${y}#${k}`;S.set(m,b),$.push(fe(m,a,b,g))}for(let m of s.edges){let y=S.get(m);m.label&&y&&$.push(ke(m,r,a,he(y)))}for(let m of s.nodes)$.push(be(m,r,a,t.security!=="strict"));for(let m of s.notes??[])$.push(ge(m,r,a));return $.push(ee()),{family:"flowchart",width:s.width,height:s.height,colors:n,transparent:i,parts:$}}function oe(e){let s=R.width,n=R.height,o=s-1,t=e??"var(--_arrow)",r=e?`-${H(e)}`:"",i={fill:t,stroke:t,strokeWidth:"0.75",strokeLinejoin:"round"};return[{id:`arrowhead${r}`,shape:"arrow",size:{width:s,height:n},ref:{x:o,y:n/2},orient:"auto",geometry:{kind:"polygon",points:[{x:0,y:0},{x:s,y:n/2},{x:0,y:n}]},paint:i},{id:`arrowhead-start${r}`,shape:"arrow",size:{width:s,height:n},ref:{x:1,y:n/2},orient:"auto",geometry:{kind:"polygon",points:[{x:s,y:0},{x:0,y:n/2},{x:s,y:n}]},paint:i}]}function ie(e){let s=R.width,n=e?`-${H(e)}`:"",o=e??"var(--_arrow)",t=s/2-.75,r={shape:"circle",size:{width:s,height:s},orient:"auto",geometry:{kind:"circle",cx:s/2,cy:s/2,r:t},paint:{fill:"none",stroke:o,strokeWidth:"1"}};return[{...r,id:`circlehead${n}`,ref:{x:s-.5,y:s/2}},{...r,id:`circlehead-start${n}`,ref:{x:.5,y:s/2}}]}function se(e){let s=R.width,n=e?`-${H(e)}`:"",o=e??"var(--_arrow)",t=1.25,r=t,i=s-t,$={shape:"cross",size:{width:s,height:s},orient:"auto",geometry:{kind:"compound",children:[{kind:"line",x1:r,y1:r,x2:i,y2:i},{kind:"line",x1:r,y1:i,x2:i,y2:r}]},paint:{stroke:o,strokeWidth:"1.25",strokeLinecap:"round"}};return[{...$,id:`crosshead${n}`,ref:{x:i,y:s/2}},{...$,id:`crosshead-start${n}`,ref:{x:t,y:s/2}}]}function pe(e,s,n){let o=[...oe()];s&&o.push(...ie()),n&&o.push(...se());for(let t of e)o.push(...oe(t)),s&&o.push(...ie(t)),n&&o.push(...se(t));return o}function ae(e){return e==="circle"?"circlehead":e==="cross"?"crosshead":"arrowhead"}function H(e){return e.replace(/[^a-zA-Z0-9]/g,s=>s.charCodeAt(0).toString(16))}function j(e,s,n,o){if(e.concurrencyRegion)return v({id:`group:${e.id}`,role:"group",open:`<g class="concurrency-region" data-id="${p(e.id)}"${o?` data-parent-id="${p(o)}"`:""}>`,close:"</g>",children:e.children.map(u=>({indent:0,node:j(u,s,n,e.id)}))});let t=n.groupHeaderFontSize+16,r=[],i=`<g class="subgraph" data-id="${p(e.id)}" data-region="subgraph" data-label="${p(e.label)}"${o?` data-parent-id="${p(o)}"`:""}>`,$=n.groupFillColor??"var(--_group-fill)",c=n.groupBorderColor??"var(--_node-stroke)";r.push({indent:2,node:C({id:`group-rect:${e.id}`,role:"group",geometry:{kind:"rect",x:e.x,y:e.y,width:e.width,height:e.height,rx:n.groupCornerRadius,ry:n.groupCornerRadius},paint:{fill:$,stroke:c,strokeWidth:String(n.groupLineWidth)}},`<rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="${n.groupCornerRadius}" ry="${n.groupCornerRadius}" fill="${p($)}" stroke="${p(c)}" stroke-width="${n.groupLineWidth}" />`)});let a=n.groupHeaderFillColor??"var(--_group-hdr)",d=q(e.x,e.y,e.width,t,n.groupCornerRadius);r.push({indent:2,node:C({id:`group-header:${e.id}`,role:"group-header",geometry:{kind:"path",d},paint:{fill:a,stroke:c,strokeWidth:String(n.groupLineWidth)}},`<path d="${d}" fill="${p(a)}" stroke="${p(c)}" stroke-width="${n.groupLineWidth}" />`)});let l=L(e.label,n.groupTextTransform),h=n.groupTextColor??"var(--_text-sec)";r.push({indent:2,node:P({id:`group-label:${e.id}`,role:"group-header",text:l,x:e.x+n.groupLabelPaddingX,y:e.y+t/2,fontSize:n.groupHeaderFontSize,anchor:"start",paint:{fill:h}},z(l,e.x+n.groupLabelPaddingX,e.y+t/2,n.groupHeaderFontSize,`font-size="${n.groupHeaderFontSize}" font-weight="${n.groupHeaderFontWeight}"${n.groupFont?` font-family="${p(n.groupFont)}"`:""}${n.groupLetterSpacing!==0?` letter-spacing="${n.groupLetterSpacing}"`:""} fill="${p(h)}"`))});for(let u of me(e,t))r.push({indent:2,node:C({id:`region-separator:${e.id}:${u.index}`,role:"group",geometry:{kind:"line",x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2},paint:{stroke:c,strokeWidth:String(n.groupLineWidth),strokeDasharray:"6 4"}},`<line class="region-separator" x1="${u.x1}" y1="${u.y1}" x2="${u.x2}" y2="${u.y2}" stroke="${p(c)}" stroke-width="${n.groupLineWidth}" stroke-dasharray="6 4" />`)});for(let u of e.children)r.push({indent:0,node:j(u,s,n,e.id)});return v({id:`group:${e.id}`,role:"group",open:i,close:"</g>",children:r})}function me(e,s){let n=e.children.filter(c=>c.concurrencyRegion);if(n.length<2)return[];let o=c=>Math.max(...n.map(c))-Math.min(...n.map(c)),t=o(c=>c.x+c.width/2)>=o(c=>c.y+c.height/2),r=[...n].sort((c,a)=>t?c.x-a.x:c.y-a.y),i=4,$=[];for(let c=1;c<r.length;c++){let a=r[c-1],d=r[c];if(t){let l=(a.x+a.width+d.x)/2;$.push({index:c-1,x1:l,y1:e.y+s+i,x2:l,y2:e.y+e.height-i})}else{let l=(a.y+a.height+d.y)/2;$.push({index:c-1,x1:e.x+i,y1:l,x2:e.x+e.width-i,y2:l})}}return $}function ge(e,s,n){let{x:o,y:t,width:r,height:i}=e,$=n.groupHeaderFillColor??"var(--_group-hdr)",c=n.groupBorderColor??"var(--_node-stroke)",a=n.edgeTextColor??"var(--_text-sec)",d=L(e.text,n.nodeTextTransform),l=`state-note:${e.id}`;return v({id:l,role:"note",open:`<g class="state-note" data-id="${p(e.id)}" data-target="${p(e.target)}" data-side="${e.side}">`,close:"</g>",children:[{indent:2,node:C({id:`${l}:rect`,role:"note",geometry:{kind:"rect",x:o,y:t,width:r,height:i,rx:4,ry:4},paint:{fill:$,stroke:c,strokeWidth:String(A.innerBox)}},`<rect x="${o}" y="${t}" width="${r}" height="${i}" rx="4" ry="4" fill="${p($)}" stroke="${p(c)}" stroke-width="${A.innerBox}" />`)},{indent:2,node:P({id:`${l}:text`,role:"label",text:d,x:o+r/2,y:t+i/2,fontSize:n.edgeLabelFontSize,anchor:"middle",paint:{fill:a}},z(d,o+r/2,t+i/2,n.edgeLabelFontSize,`text-anchor="middle" font-size="${n.edgeLabelFontSize}" font-weight="${n.edgeLabelFontWeight}"${n.edgeLetterSpacing!==0?` letter-spacing="${n.edgeLetterSpacing}"`:""} fill="${p(a)}"`))}]})}function fe(e,s,n,o){let t=e.style==="dotted"?"dotted":e.style==="thick"?"thick":e.style==="invisible"?"invisible":"solid",r=he(n),i=e.labelPosition??ue(e.points),$=s.edgeTextColor??"var(--_text-sec)",c=e.label?[{id:`${n}:label`,text:e.label,anchor:i,paint:{fill:$},fontSize:s.edgeLabelFontSize,textAnchor:"middle",visual:{kind:"companion",markId:`${r}:text`}}]:[],a={identity:{id:e.id??n},endpoints:{from:e.source,to:e.target},relationship:{kind:"flowchart-edge",direction:e.source===e.target?"self":e.hasArrowStart&&e.hasArrowEnd?"bidirectional":e.hasArrowStart?"reverse":e.hasArrowEnd?"forward":"undirected"},route:{ownership:"layout",bendRadius:s.edgeBendRadius,labelAnchors:e.labelPosition?[e.labelPosition]:[]},labels:c};if(e.style==="invisible")return T({id:n,role:"edge",geometry:{kind:"polyline",points:e.points},lineStyle:"invisible",paint:{},...a},"");let d=e.curve?xe(e.points):s.edgeBendRadius>0?Y(e.points,s.edgeBendRadius,{precision:3}):void 0,l=d?.geometry.d??ye(e.points),h=e.style==="dotted"?`${W.dash} ${W.gap}`:e.animate?"8 4":void 0,u=h?` stroke-dasharray="${h}"`:"",f=e.style==="thick"?s.lineWidth*2:s.lineWidth,g=e.inlineStyle?.stroke??s.edgeStrokeColor,x=p(g??"var(--_line)"),S=p(e.inlineStyle?.["stroke-width"]??String(f)),m=g?`-${H(g)}`:"",y="",k,b;if(e.hasArrowEnd){let M=ae(e.endMarker??"arrow");if(k=o.find(F=>F.id===`${M}${m}`),!k)throw new Error(`Missing marker resource "${M}${m}"`);y+=` marker-end="url(#${M}${m})"`}if(e.hasArrowStart){let M=ae(e.startMarker??"arrow");if(b=o.find(F=>F.id===`${M}-start${m}`),!b)throw new Error(`Missing marker resource "${M}-start${m}"`);y+=` marker-start="url(#${M}-start${m})"`}let w=['class="edge"',...e.id?[`data-id="${p(e.id)}"`]:[],`data-from="${p(e.source)}"`,`data-to="${p(e.target)}"`,`data-style="${e.style}"`,`data-arrow-start="${e.hasArrowStart}"`,`data-arrow-end="${e.hasArrowEnd}"`];e.hasArrowStart&&w.push(`data-marker-start="${e.startMarker??"arrow"}"`),e.hasArrowEnd&&w.push(`data-marker-end="${e.endMarker??"arrow"}"`),e.label&&w.push(`data-label="${p(e.label)}"`),e.curve&&w.push(`data-curve="${p(e.curve)}"`),e.animate&&w.push('data-animate="true"',`data-animation="${e.animation??"slow"}"`);let D={stroke:g??"var(--_line)",strokeWidth:e.inlineStyle?.["stroke-width"]??String(f),...h?{strokeDasharray:h}:{}};if(s.edgeBendRadius>0||e.curve){if(!d)throw new Error(`Missing path projection for flowchart edge "${n}"`);return T({id:n,role:"edge",geometry:d.geometry,lineStyle:t,paint:D,markers:{...b?{start:b}:{},mid:[],...k?{end:k}:{}},...a,route:{...a.route,contours:d.contours}},`<path ${w.join(" ")} d="${l}" fill="none" stroke="${x}" stroke-width="${S}"${u}${y} />`)}return T({id:n,role:"edge",geometry:{kind:"polyline",points:e.points},lineStyle:t,paint:D,markers:{...b?{start:b}:{},mid:[],...k?{end:k}:{}},...a},`<polyline ${w.join(" ")} points="${l}" fill="none" stroke="${x}" stroke-width="${S}"${u}${y} />`)}function he(e){return e.startsWith("edge:")?`edge-label:${e.slice(5)}`:`${e}:label`}function xe(e){let s=e[0],n=`M ${s.x} ${s.y}`,o=[];for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],$=(r.x+i.x)/2;n+=` C ${$} ${r.y}, ${$} ${i.y}, ${i.x} ${i.y}`,o.push({kind:"cubic",control1:{x:$,y:r.y},control2:{x:$,y:i.y},end:i})}return U(n,s,o)}function ye(e){return e.map(s=>`${s.x},${s.y}`).join(" ")}function et(e){let s=/<((?:[A-Za-z_][\w.-]*:)?(?:style|text|title|desc|metadata))\b[\s\S]*?<\/\1>/gi,n=[],o=0,t;for(;(t=s.exec(e))!==null;)t.index>o&&n.push({kind:"plain",text:e.slice(o,t.index)}),n.push({kind:"protected",text:t[0]}),o=t.index+t[0].length;return o<e.length&&n.push({kind:"plain",text:e.slice(o)}),n.map(r=>r.kind==="protected"?r.text:r.text.replace(/>\s*\r?\n\s*</g,"><")).join("")}function tt(e,s){if(!/^[A-Za-z0-9_.:-]+$/.test(s))throw new Error("idPrefix must be non-empty and contain only ASCII letters, digits, underscore, hyphen, dot, and colon");let n=new Set;for(let r of V(e))for(let i of r.attributes)i.name==="id"&&n.add(i.value);let o=r=>r.startsWith(s)?r:`${s}${r}`,t=Z(e,r=>{if(r.name==="id")return o(r.value);if(r.name==="aria-labelledby"||r.name==="aria-describedby")return r.value.split(/\s+/).map(i=>n.has(i)?o(i):i).join(" ");if((r.name==="href"||r.name==="xlink:href")&&r.value.startsWith("#")){let i=r.value.slice(1);return n.has(i)?`#${o(i)}`:r.value}});return B(t,r=>r.replace(/url\(#([^)]+)\)/g,(i,$)=>n.has($)?`url(#${o($)})`:i))}function ke(e,s,n,o){let t=e.labelPosition??ue(e.points),r=L(e.label,n.edgeTextTransform),i=8,$=e.style==="thick"?n.lineWidth*2:n.lineWidth,c=i+Math.max(4,$*2),a=E(r,n.edgeLabelFontSize,n.edgeLabelFontWeight),d=a.width+c*2,l=a.height+c*2,h=t.x-d/2,u=t.y-l/2,f=C({id:`${o}:halo`,role:"chrome",geometry:{kind:"rect",x:h,y:u,width:d,height:l,rx:4,ry:4},paint:{fill:"var(--bg)",stroke:"none"}},`<rect class="edge-label-halo" x="${h}" y="${u}" width="${d}" height="${l}" rx="4" ry="4" fill="var(--bg)" stroke="none" />`),g=n.edgeTextColor??"var(--_text-sec)",x=P({id:`${o}:text`,role:"label",text:r,x:t.x,y:t.y,fontSize:n.edgeLabelFontSize,anchor:"middle",paint:{fill:g}},K(r,t.x,t.y,a.width,a.height,n.edgeLabelFontSize,i,`text-anchor="middle" font-size="${n.edgeLabelFontSize}" font-weight="${n.edgeLabelFontWeight}"${n.edgeLetterSpacing!==0?` letter-spacing="${n.edgeLetterSpacing}"`:""} fill="${p(g)}"`,'rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1"'));return v({id:o,role:"edge-label",open:`<g class="edge-label" data-from="${p(e.source)}" data-to="${p(e.target)}" data-label="${p(e.label)}">`,close:"</g>",children:[{indent:2,node:f},{indent:2,node:x}]})}function ue(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let s=0;for(let o=1;o<e.length;o++)s+=ce(e[o-1],e[o]);let n=s/2;for(let o=1;o<e.length;o++){let t=ce(e[o-1],e[o]);if(n<=t){let r=n/t;return{x:e[o-1].x+r*(e[o].x-e[o-1].x),y:e[o-1].y+r*(e[o].y-e[o-1].y)}}n-=t}return e[e.length-1]}function ce(e,s){return Math.sqrt((s.x-e.x)**2+(s.y-e.y)**2)}function be(e,s,n,o){let t=Me(e,n),r=Ee(e,s,n),$=["node",...(e.classNames??[]).map(u=>u.replace(/[^A-Za-z0-9_-]/g,"")).filter(Boolean)].join(" "),c=e.shape==="state-start"?{status:"start"}:e.shape==="state-end"?{status:"end"}:void 0,a=[{indent:2,node:t}],d=we(e,n);d&&a.push({indent:2,node:d}),r&&a.push({indent:2,node:r});let l=e.semanticShape?` data-semantic-shape="${p(e.semanticShape)}"`:"",h=o&&e.href?` data-href="${p(e.href)}" role="link" tabindex="0"`:"";return v({id:`node:${e.id}`,role:"node",open:`<g class="${$}" data-id="${p(e.id)}" data-label="${p(e.label)}" data-shape="${e.shape}"${l}${h}>`,close:"</g>",children:a,channels:c})}function Se(e,s,n,o){let{x:t,y:r,width:i,height:$}=e,c=t+i,a=r+$,d=t+i/2,l=r+$/2,h=(f,g="")=>({geometry:{kind:"path",d:f},crisp:`<path d="${f}" fill="${g.includes('fill="none"')?"none":s}" stroke="${n}" stroke-width="${o}" />`}),u=f=>({geometry:{kind:"polygon",points:f},crisp:`<polygon points="${f.map(g=>`${g.x},${g.y}`).join(" ")}" fill="${s}" stroke="${n}" stroke-width="${o}" />`});switch(e.semanticShape){case"bang":{let f=Array.from({length:16},(g,x)=>{let S=-Math.PI/2+x*Math.PI/8,m=x%2===0?1:.62;return{x:d+Math.cos(S)*i/2*m,y:l+Math.sin(S)*$/2*m}});return u(f)}case"notch-rect":return u([{x:t+10,y:r},{x:c,y:r},{x:c,y:a},{x:t,y:a},{x:t,y:r+10}]);case"cloud":return h(`M${t+i*.18} ${a}C${t-4} ${a} ${t-4} ${l} ${t+i*.12} ${l}C${t+i*.08} ${r+$*.15} ${t+i*.38} ${r-4} ${t+i*.48} ${r+$*.18}C${t+i*.65} ${r-5} ${c} ${r+$*.16} ${t+i*.88} ${l}C${c+5} ${l} ${c+5} ${a} ${t+i*.72} ${a}Z`);case"hourglass":return u([{x:t,y:r},{x:c,y:r},{x:t+i*.62,y:l},{x:c,y:a},{x:t,y:a},{x:t+i*.38,y:l}]);case"bolt":return u([{x:t+i*.55,y:r},{x:t+i*.25,y:l},{x:t+i*.48,y:l},{x:t+i*.35,y:a},{x:t+i*.78,y:r+$*.4},{x:t+i*.55,y:r+$*.4}]);case"brace":return h(`M${c} ${r}C${t+i*.4} ${r} ${t+i*.7} ${l} ${t} ${l}C${t+i*.7} ${l} ${t+i*.4} ${a} ${c} ${a}`,' fill="none"');case"brace-r":return h(`M${t} ${r}C${t+i*.6} ${r} ${t+i*.3} ${l} ${c} ${l}C${t+i*.3} ${l} ${t+i*.6} ${a} ${t} ${a}`,' fill="none"');case"braces":return h(`M${t+i*.25} ${r}C${t} ${r} ${t+i*.15} ${l} ${t} ${l}C${t+i*.15} ${l} ${t} ${a} ${t+i*.25} ${a}M${t+i*.75} ${r}C${c} ${r} ${t+i*.85} ${l} ${c} ${l}C${t+i*.85} ${l} ${c} ${a} ${t+i*.75} ${a}`,' fill="none"');case"datastore":return h(`M${t+8} ${r}H${c}V${a}H${t+8}M${t+8} ${r}C${t-2} ${r+$*.2} ${t-2} ${a-$*.2} ${t+8} ${a}`,' fill="none"');case"delay":return h(`M${t} ${r}H${c-$/2}A${$/2} ${$/2} 0 0 1 ${c-$/2} ${a}H${t}Z`);case"h-cyl":return h(`M${t+10} ${r}H${c-10}A10 ${$/2} 0 0 1 ${c-10} ${a}H${t+10}A10 ${$/2} 0 0 1 ${t+10} ${r}Z M${c-10} ${r}A10 ${$/2} 0 0 0 ${c-10} ${a}`);case"lin-cyl":return h(`M${t} ${r+8}A${i/2} 8 0 0 1 ${c} ${r+8}V${a-8}A${i/2} 8 0 0 1 ${t} ${a-8}Z M${t} ${r+8}A${i/2} 8 0 0 0 ${c} ${r+8}M${t} ${a-16}A${i/2} 8 0 0 0 ${c} ${a-16}`);case"curv-trap":return h(`M${t+12} ${r}Q${d} ${r+8} ${c-12} ${r}L${c} ${a}Q${d} ${a-8} ${t} ${a}Z`);case"div-rect":return h(`M${t} ${r}H${c}V${a}H${t}ZM${t} ${l}H${c}`);case"doc":return h(`M${t} ${r}H${c}V${a-8}Q${t+i*.75} ${a+2} ${d} ${a-8}Q${t+i*.25} ${a-18} ${t} ${a-8}Z`);case"tri":return u([{x:d,y:r},{x:c,y:a},{x:t,y:a}]);case"fork":return{geometry:{kind:"rect",x:t,y:l-4,width:i,height:8},crisp:`<rect x="${t}" y="${l-4}" width="${i}" height="8" fill="${n}" stroke="${n}" stroke-width="${o}" />`};case"win-pane":return h(`M${t} ${r}H${c}V${a}H${t}ZM${t+i*.28} ${r}V${a}M${t} ${r+$*.32}H${c}`);case"f-circ":return{geometry:{kind:"circle",cx:d,cy:l,r:Math.min(i,$)/2},crisp:`<circle cx="${d}" cy="${l}" r="${Math.min(i,$)/2}" fill="${n}" stroke="${n}" stroke-width="${o}" />`};case"lin-doc":return h(`M${t} ${r}H${c}V${a-8}Q${t+i*.75} ${a+2} ${d} ${a-8}Q${t+i*.25} ${a-18} ${t} ${a-8}ZM${t+8} ${r+8}H${c-8}`);case"lin-rect":return h(`M${t} ${r}H${c}V${a}H${t}ZM${t+6} ${r}V${a}M${c-6} ${r}V${a}`);case"notch-pent":return u([{x:t,y:r},{x:c-10,y:r},{x:c,y:l},{x:c-10,y:a},{x:t,y:a},{x:t+8,y:l}]);case"flip-tri":return u([{x:t,y:r},{x:c,y:r},{x:d,y:a}]);case"docs":return h(`M${t+8} ${r}H${c}V${a-8}Q${t+i*.7} ${a} ${t+i*.45} ${a-8}Q${t+i*.22} ${a-16} ${t+8} ${a-8}ZM${t} ${r+8}H${t+8}M${t} ${r+8}V${a}`);case"st-rect":return h(`M${t+8} ${r}H${c}V${a-8}H${t+8}ZM${t} ${r+8}H${c-8}V${a}H${t}Z`);case"flag":return h(`M${t} ${r+6}Q${t+i*.25} ${r-4} ${d} ${r+6}Q${t+i*.75} ${r+16} ${c} ${r+6}V${a-6}Q${t+i*.75} ${a+4} ${d} ${a-6}Q${t+i*.25} ${a-16} ${t} ${a-6}Z`);case"sm-circ":return{geometry:{kind:"circle",cx:d,cy:l,r:Math.min(i,$)*.22},crisp:`<circle cx="${d}" cy="${l}" r="${Math.min(i,$)*.22}" fill="${s}" stroke="${n}" stroke-width="${o}" />`};case"cross-circ":return h(`M${d} ${r}A${i/2} ${$/2} 0 1 1 ${d-.01} ${r}M${t+i*.28} ${r+$*.28}L${t+i*.72} ${r+$*.72}M${t+i*.72} ${r+$*.28}L${t+i*.28} ${r+$*.72}`);case"bow-rect":return h(`M${t} ${r}Q${t+12} ${l} ${t} ${a}H${c}Q${c-12} ${l} ${c} ${r}Z`);case"tag-doc":return h(`M${t+10} ${r}H${c}V${a-8}Q${t+i*.7} ${a} ${d} ${a-8}Q${t+i*.25} ${a-16} ${t} ${a-8}V${r+10}ZM${t} ${r+10}L${t+10} ${r}`);case"tag-rect":return u([{x:t+10,y:r},{x:c,y:r},{x:c,y:a},{x:t,y:a},{x:t,y:r+10}]);case"text":return{geometry:{kind:"path",d:`M${t} ${r}`},crisp:`<path d="M${t} ${r}" fill="none" stroke="none" />`};default:return null}}function we(e,s){let n=p(s.nodeTextColor??"var(--_text)"),o=Math.min(28,e.height*.4),t=e.x+e.width/2,r=e.y+6;if(e.icon){let i=ne(e.icon);if(i){let c=o/24,a=i.paths.map(d=>`<path d="${d}"/>`).join("");return _({id:`node:${e.id}:icon`,role:"icon"},`<g class="flowchart-icon" data-icon="${p(e.icon)}" transform="translate(${t-o/2} ${r}) scale(${c})" fill="${n}" stroke="${n}" stroke-width="0.8">${a}</g>`)}let $=e.icon.split(/[:/\s-]+/).filter(Boolean).at(-1)?.slice(0,2).toUpperCase()||"?";return P({id:`node:${e.id}:icon`,role:"icon",text:$,x:t,y:r+o/2,fontSize:10,anchor:"middle",paint:{fill:n}},`<text class="flowchart-icon-fallback" data-icon="${p(e.icon)}" x="${t}" y="${r+o/2}" text-anchor="middle" font-size="10" fill="${n}">${X($)}</text>`)}if(e.image){let i=t-o/2;return _({id:`node:${e.id}:image`,role:"icon"},`<g class="flowchart-image-placeholder" data-image-src="${p(e.image)}" fill="none" stroke="${n}" stroke-width="1.2"><rect x="${i}" y="${r}" width="${o}" height="${o*.72}" rx="2"/><circle cx="${i+o*.72}" cy="${r+o*.2}" r="${o*.08}"/><path d="M${i+2} ${r+o*.66}L${i+o*.36} ${r+o*.36}L${i+o*.52} ${r+o*.5}L${i+o*.7} ${r+o*.32}L${i+o-2} ${r+o*.66}"/></g>`)}return null}function Me(e,s){let{x:n,y:o,width:t,height:r,shape:i,inlineStyle:$}=e,c=$?.fill??s.nodeFillColor??"var(--_node-fill)",a=$?.stroke??s.nodeBorderColor??"var(--_node-stroke)",d=$?.["stroke-width"]??String(s.nodeLineWidth),l=p(c),h=p(a),u=p(d),f=(()=>{let x=Se(e,l,h,u);if(x)return x;switch(i){case"service":return $e(n,o,t,r,l,h,u,s.cornerRadius??0);case"diamond":return le(n,o,t,r,l,h,u);case"rounded":return Ce(n,o,t,r,l,h,u,s.cornerRadius??6);case"stadium":return Pe(n,o,t,r,l,h,u);case"circle":return de(n,o,t,r,l,h,u);case"subroutine":return ve(n,o,t,r,l,h,u,s.cornerRadius??0);case"doublecircle":return Re(n,o,t,r,l,h,u);case"hexagon":return Le(n,o,t,r,l,h,u);case"cylinder":return Ae(n,o,t,r,l,h,u);case"asymmetric":return ze(n,o,t,r,l,h,u);case"trapezoid":return Te(n,o,t,r,l,h,u);case"trapezoid-alt":return He(n,o,t,r,l,h,u);case"lean-r":return Fe(n,o,t,r,l,h,u);case"lean-l":return We(n,o,t,r,l,h,u);case"state-start":return _e(n,o,t,r);case"state-end":return je(n,o,t,r);case"state-fork":case"state-join":return De(n,o,t,r);case"state-choice":return le(n,o,t,r,l,h,u);case"state-history":return de(n,o,t,r,l,h,u);default:return $e(n,o,t,r,l,h,u,s.cornerRadius??0)}})(),g=i==="state-start"||i==="state-fork"||i==="state-join"?{fill:"var(--_text)",stroke:"none"}:i==="state-end"?{fill:"var(--_text)",stroke:"var(--_text)"}:{fill:c,stroke:a,strokeWidth:d};return C({id:`node-shape:${e.id}`,role:"node",geometry:f.geometry,paint:g},f.crisp)}function $e(e,s,n,o,t,r,i,$=0){return{geometry:{kind:"rect",x:e,y:s,width:n,height:o,rx:$,ry:$},crisp:`<rect x="${e}" y="${s}" width="${n}" height="${o}" rx="${$}" ry="${$}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Ce(e,s,n,o,t,r,i,$=6){return{geometry:{kind:"rect",x:e,y:s,width:n,height:o,rx:$,ry:$},crisp:`<rect x="${e}" y="${s}" width="${n}" height="${o}" rx="${$}" ry="${$}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Pe(e,s,n,o,t,r,i){let $=o/2;return{geometry:{kind:"rect",x:e,y:s,width:n,height:o,rx:$,ry:$},crisp:`<rect x="${e}" y="${s}" width="${n}" height="${o}" rx="${$}" ry="${$}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function de(e,s,n,o,t,r,i){let $=e+n/2,c=s+o/2,a=Math.min(n,o)/2;return{geometry:{kind:"circle",cx:$,cy:c,r:a},crisp:`<circle cx="${$}" cy="${c}" r="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function le(e,s,n,o,t,r,i){let $=e+n/2,c=s+o/2,a=n/2,d=o/2,l=[{x:$,y:c-d},{x:$+a,y:c},{x:$,y:c+d},{x:$-a,y:c}],h=l.map(u=>`${u.x},${u.y}`).join(" ");return{geometry:{kind:"polygon",points:l},crisp:`<polygon points="${h}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function ve(e,s,n,o,t,r,i,$=0){return{geometry:{kind:"compound",children:[{kind:"rect",x:e,y:s,width:n,height:o,rx:$,ry:$},{kind:"line",x1:e+8,y1:s,x2:e+8,y2:s+o},{kind:"line",x1:e+n-8,y1:s,x2:e+n-8,y2:s+o}]},crisp:`<rect x="${e}" y="${s}" width="${n}" height="${o}" rx="${$}" ry="${$}" fill="${t}" stroke="${r}" stroke-width="${i}" />
|
|
4
|
+
<line x1="${e+8}" y1="${s}" x2="${e+8}" y2="${s+o}" stroke="${r}" stroke-width="${i}" />
|
|
5
|
+
<line x1="${e+n-8}" y1="${s}" x2="${e+n-8}" y2="${s+o}" stroke="${r}" stroke-width="${i}" />`}}function Re(e,s,n,o,t,r,i){let $=e+n/2,c=s+o/2,a=Math.min(n,o)/2,d=a-5;return{geometry:{kind:"compound",children:[{kind:"circle",cx:$,cy:c,r:a},{kind:"circle",cx:$,cy:c,r:d}]},crisp:`<circle cx="${$}" cy="${c}" r="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />
|
|
6
|
+
<circle cx="${$}" cy="${c}" r="${d}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Le(e,s,n,o,t,r,i){let $=o/4,c=[{x:e+$,y:s},{x:e+n-$,y:s},{x:e+n,y:s+o/2},{x:e+n-$,y:s+o},{x:e+$,y:s+o},{x:e,y:s+o/2}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Ae(e,s,n,o,t,r,i){let c=e+n/2,a=s+7,d=o-14;return{geometry:{kind:"compound",children:[{kind:"rect",x:e,y:a,width:n,height:d},{kind:"line",x1:e,y1:a,x2:e,y2:a+d},{kind:"line",x1:e+n,y1:a,x2:e+n,y2:a+d},{kind:"ellipse",cx:c,cy:s+o-7,rx:n/2,ry:7},{kind:"ellipse",cx:c,cy:a,rx:n/2,ry:7}]},crisp:`<rect x="${e}" y="${a}" width="${n}" height="${d}" fill="${t}" stroke="none" />
|
|
7
|
+
<line x1="${e}" y1="${a}" x2="${e}" y2="${a+d}" stroke="${r}" stroke-width="${i}" />
|
|
8
|
+
<line x1="${e+n}" y1="${a}" x2="${e+n}" y2="${a+d}" stroke="${r}" stroke-width="${i}" />
|
|
9
|
+
<ellipse cx="${c}" cy="${s+o-7}" rx="${n/2}" ry="7" fill="${t}" stroke="${r}" stroke-width="${i}" />
|
|
10
|
+
<ellipse cx="${c}" cy="${a}" rx="${n/2}" ry="7" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function ze(e,s,n,o,t,r,i){let c=[{x:e+12,y:s},{x:e+n,y:s},{x:e+n,y:s+o},{x:e+12,y:s+o},{x:e,y:s+o/2}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Te(e,s,n,o,t,r,i){let $=n*.15,c=[{x:e+$,y:s},{x:e+n-$,y:s},{x:e+n,y:s+o},{x:e,y:s+o}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function He(e,s,n,o,t,r,i){let $=n*.15,c=[{x:e,y:s},{x:e+n,y:s},{x:e+n-$,y:s+o},{x:e+$,y:s+o}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function Fe(e,s,n,o,t,r,i){let $=n*.15,c=[{x:e+$,y:s},{x:e+n,y:s},{x:e+n-$,y:s+o},{x:e,y:s+o}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function We(e,s,n,o,t,r,i){let $=n*.15,c=[{x:e,y:s},{x:e+n-$,y:s},{x:e+n,y:s+o},{x:e+$,y:s+o}],a=c.map(d=>`${d.x},${d.y}`).join(" ");return{geometry:{kind:"polygon",points:c},crisp:`<polygon points="${a}" fill="${t}" stroke="${r}" stroke-width="${i}" />`}}function _e(e,s,n,o){let t=e+n/2,r=s+o/2,i=Math.min(n,o)/2-2;return{geometry:{kind:"circle",cx:t,cy:r,r:i},crisp:`<circle cx="${t}" cy="${r}" r="${i}" fill="var(--_text)" stroke="none" />`}}function je(e,s,n,o){let t=e+n/2,r=s+o/2,i=Math.min(n,o)/2-2,$=i-4;return{geometry:{kind:"compound",children:[{kind:"circle",cx:t,cy:r,r:i},{kind:"circle",cx:t,cy:r,r:$}]},crisp:`<circle cx="${t}" cy="${r}" r="${i}" fill="none" stroke="var(--_text)" stroke-width="${A.innerBox*2}" />
|
|
11
|
+
<circle cx="${t}" cy="${r}" r="${$}" fill="var(--_text)" stroke="none" />`}}function De(e,s,n,o){let t=Math.min(n,o)/2;return{geometry:{kind:"rect",x:e,y:s,width:n,height:o,rx:t,ry:t},crisp:`<rect x="${e}" y="${s}" width="${n}" height="${o}" rx="${t}" ry="${t}" fill="var(--_text)" stroke="none" />`}}function Ee(e,s,n){if((e.shape==="state-start"||e.shape==="state-end"||e.shape==="state-fork"||e.shape==="state-join"||e.shape==="state-choice")&&!e.label)return null;let o=e.x+e.width/2,t=e.y+e.height/2,r=I(e.inlineStyle,n.nodeTextColor??"var(--_text)"),i=p(r),$=L(e.label,n.nodeTextTransform);return P({id:`node-label:${e.id}`,role:"label",text:$,x:o,y:t,fontSize:n.nodeLabelFontSize,anchor:"middle",paint:{fill:r}},z($,o,t,n.nodeLabelFontSize,`text-anchor="middle" font-size="${n.nodeLabelFontSize}" font-weight="${n.nodeLabelFontWeight}"${n.nodeLetterSpacing!==0?` letter-spacing="${n.nodeLetterSpacing}"`:""} fill="${i}"`))}export{Je as a,et as b,tt as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as l}from"./chunk-RVO6J7S3.js";import{f as S}from"./chunk-P7HMSKHJ.js";var h=["compositTitleSize","dividerMargin","fontSize","forkHeight","forkWidth","nodeSpacing","noteMargin","padding","radius","rankSpacing"],F=["arrowMarkerAbsolute","edgeLengthFactor","fontSizeFactor","labelHeight","miniPadding","sizeUnit","textHeight","titleShift","titleTopMargin"],k=["arrowMarkerAbsolute","compositTitleSize","defaultRenderer","dividerMargin","edgeLengthFactor","fontSize","fontSizeFactor","forkHeight","forkWidth","labelHeight","miniPadding","nodeSpacing","noteMargin","padding","radius","rankSpacing","sizeUnit","textHeight","titleShift","titleTopMargin"],C=new Set(k),E=new Set(h),R=new Set(F),I=new Set(["fontSize","compositTitleSize","forkWidth","forkHeight"]),f=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0,a=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?e:void 0;function y(e){return e.filter(n=>!!n&&typeof n=="object"&&!Array.isArray(n))}function w(e,n=!1){let i=new Map;for(let t of y(e))for(let[o,r]of Object.entries(t))i.set(o,r);let s=[];for(let[t,o]of[...i].sort(([r],[d])=>S(r,d))){if(!C.has(t)){n&&s.push({code:"INEFFECTIVE_CONFIG",field:`state.${t}`,message:`State config field "state.${t}" is unknown and has no effect; check the spelling or remove it.`});continue}if(R.has(t)){s.push({code:"INEFFECTIVE_CONFIG",field:`state.${t}`,message:`State config field "state.${t}" is a legacy Dagre/fixed-metric option with no faithful effect in the ELK measured-text renderer.`});continue}if(t==="defaultRenderer"){o!=="elk"&&s.push({code:"INEFFECTIVE_CONFIG",field:"state.defaultRenderer",message:`State config field "state.defaultRenderer" requested ${JSON.stringify(o)}; this renderer supports only "elk" and will not silently select a different engine.`});continue}if(E.has(t)){let r=I.has(t);(r?f(o)!==void 0:a(o)!==void 0)||s.push({code:"INEFFECTIVE_CONFIG",field:`state.${t}`,message:`State config field "state.${t}" must be a ${r?"positive":"non-negative"} finite number; the supplied value was ignored.`})}}return s}function p(e){let n=e?.state;return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function D(e,n){let i={...p(e),...p(n.mermaidConfig)},s=a(i.nodeSpacing),t=a(i.rankSpacing),o=a(i.padding),r=a(i.radius),d=f(i.fontSize),c=f(i.compositTitleSize),m={...l,...o===void 0?{}:{nodePaddingX:o,nodePaddingY:o},...r===void 0?{}:{nodeCornerRadius:r},...d===void 0?{}:{nodeLabelFontSize:d,edgeLabelFontSize:d},...c===void 0?{}:{groupHeaderFontSize:c}},g=n.nodeSpacing??s,u=n.layerSpacing??t;return{...n,...g===void 0?{}:{nodeSpacing:g},...u===void 0?{}:{layerSpacing:u},stateVisual:{forkWidth:f(i.forkWidth)??70,forkHeight:f(i.forkHeight)??10,noteMargin:a(i.noteMargin)??18,dividerMargin:a(i.dividerMargin)??0,styleDefaults:m}}}export{w as a,D as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-STQRDZ67.js";var r=Object.freeze({book:Object.freeze(["M3 5.5C6 4.5 9 4.8 12 6V20C9 18.8 6 18.5 3 19.5Z","M21 5.5C18 4.5 15 4.8 12 6V20C15 18.8 18 18.5 21 19.5Z"]),skull:Object.freeze(["M5 11A7 7 0 1 1 19 11C19 15 17 17 15 18V21H9V18C7 17 5 15 5 11Z","M8 11A1.5 1.5 0 1 0 11 11A1.5 1.5 0 1 0 8 11ZM13 11A1.5 1.5 0 1 0 16 11A1.5 1.5 0 1 0 13 11Z","M10 17V20M12 17V20M14 17V20"])});function d(t){let e=(t.trim().toLowerCase().split(/\s+/).filter(Boolean).findLast(s=>!["fa","fas","far","fab","mdi"].includes(s))??"").replace(/^(?:fa-|mdi-)/,""),l=r[e==="book-open"?"book":e==="skull-outline"?"skull":e];if(l)return{viewBox:"0 0 24 24",paths:l,source:"bundled-symbol"};let o=n(t)??n(`mdi:${e}`);return o?{viewBox:o.viewBox,paths:[o.path],source:o.source}:null}export{d as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as d,d as o}from"./chunk-A7L4WWVW.js";import{C as u}from"./chunk-FXBBGAMJ.js";var C=["axisColor","axisStrokeWidth","axisLabelFontSize","curveOpacity","curveStrokeWidth","graticuleColor","graticuleStrokeWidth","graticuleOpacity","legendBoxSize","legendFontSize"],L=["width","height","axisScaleFactor"],r=Object.freeze({dimension:4096,margin:4096,factor:8,axisLabelFactorMin:1.1,fontSize:256,lineWidth:64,legendBoxSize:512}),z=["marginTop","marginRight","marginBottom","marginLeft"];function W(a={}){let n=d(a,["radar"])??{},i={};for(let t of L){let e=o(n,[t]),f=t==="width"||t==="height"?r.dimension:r.factor;typeof e=="number"&&Number.isFinite(e)&&e>0&&e<=f&&(i[t]=e)}let s=o(n,["axisLabelFactor"]);typeof s=="number"&&Number.isFinite(s)&&s>=r.axisLabelFactorMin&&s<=r.factor&&(i.axisLabelFactor=s);for(let t of z){let e=o(n,[t]);typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=r.margin&&(i[t]=e)}let c=o(n,["curveTension"]);typeof c=="number"&&Number.isFinite(c)&&c>=0&&c<=1&&(i.curveTension=c);let g=o(n,["useMaxWidth"]);typeof g=="boolean"&&(i.useMaxWidth=g);let F=o(n,["tickLabels"]);typeof F=="boolean"&&(i.tickLabels=F);let b=d(a,["themeVariables","radar"])??{},p=["axisStrokeWidth","axisLabelFontSize","curveStrokeWidth","graticuleStrokeWidth","legendBoxSize","legendFontSize"];for(let t of p){let e=o(b,[t]),f=t==="legendBoxSize"?r.legendBoxSize:t.endsWith("FontSize")?r.fontSize:r.lineWidth;typeof e=="number"&&Number.isFinite(e)&&e>0&&e<=f&&(i[t]=e)}for(let t of["curveOpacity","graticuleOpacity"]){let e=o(b,[t]);typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1&&(i[t]=e)}for(let t of["axisColor","graticuleColor"]){let e=u(o(b,[t]));e&&(i[t]=e)}let S=u(o(a,["themeVariables","titleColor"]));S&&(i.titleColor=S);let l=o(a,["themeVariables","fontSize"]),m=typeof l=="number"?l:typeof l=="string"&&/^\d+(?:\.\d+)?(?:px)?$/i.test(l.trim())?Number.parseFloat(l):Number.NaN;Number.isFinite(m)&&m>0&&m<=r.fontSize&&(i.titleFontSize=m);let h=[],x=!1;for(let t=0;t<12;t++){let e=u(o(a,["themeVariables",`cScale${t}`]));e&&(h[t]=e,x=!0)}return x&&(i.paletteOverrides=h),i}export{C as a,r as b,W as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as S,l as O,m as L,q as y,s as M,t as w}from"./chunk-FXBBGAMJ.js";var A="#3b82f6";function R(t){let[e,n,i]=S(t),r=e/255,o=n/255,c=i/255,s=Math.max(r,o,c),a=Math.min(r,o,c),u=(s+a)/2;if(s===a)return[0,0,u*100];let l=s-a,f=u>.5?l/(2-s-a):l/(s+a),d;return s===r?d=((o-c)/l+(o<c?6:0))/6:s===o?d=((c-r)/l+2)/6:d=((r-o)/l+4)/6,[d*360,f*100,u*100]}function j(t,e,n){let i=e/100,r=n/100,o=(1-Math.abs(2*r-1))*i,c=o*(1-Math.abs(t/60%2-1)),s=r-o/2,a,u,l;t<60?(a=o,u=c,l=0):t<120?(a=c,u=o,l=0):t<180?(a=0,u=o,l=c):t<240?(a=0,u=c,l=o):t<300?(a=c,u=0,l=o):(a=o,u=0,l=c);let f=d=>Math.round((d+s)*255).toString(16).padStart(2,"0");return`#${f(a)}${f(u)}${f(l)}`}function B(t){return y(t)}function q(t){return R(t)[2]<50}function v(t,e,n){if(t===0)return e;let i=B(e)?e:A,r=n&&B(n)?n:void 0,[o,c]=R(i),s=Math.max(55,Math.min(85,c)),a=Math.ceil(t/2),u=t%2===1,l=r&&q(r)?!u:u,f=l?Math.max(25,48-a*13):Math.min(78,55+a*11),d=(l?-8:12)*a,m=((o+d)%360+360)%360;return j(m,s,f)}function P(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function k(t){return t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055}function b(t){let e=O(t);if(!e)return null;let n=P(e[0]/255),i=P(e[1]/255),r=P(e[2]/255),o=.4122214708*n+.5363325363*i+.0514459929*r,c=.2119034982*n+.6806995451*i+.1073969566*r,s=.0883024619*n+.2817188376*i+.6299787005*r,a=Math.cbrt(o),u=Math.cbrt(c),l=Math.cbrt(s);return{L:.2104542553*a+.793617785*u-.0040720468*l,a:1.9779984951*a-2.428592205*u+.4505937099*l,b:.0259040371*a+.7827717662*u-.808675766*l}}function Y(t){let e=t.L+.3963377774*t.a+.2158037573*t.b,n=t.L-.1055613458*t.a-.0638541728*t.b,i=t.L-.0894841775*t.a-1.291485548*t.b,r=e*e*e,o=n*n*n,c=i*i*i,s=4.0767416621*r-3.3077115913*o+.2309699292*c,a=-1.2684380046*r+2.6097574011*o-.3413193965*c,u=-.0041960863*r-.7034186147*o+1.707614701*c;return L(k(s)*255,k(a)*255,k(u)*255)}function z(t){let e=Math.hypot(t.a,t.b),n=(Math.atan2(t.b,t.a)*180/Math.PI+360)%360;return{L:t.L,C:e,h:n}}function J(t){let e=t.h*Math.PI/180;return{L:t.L,a:t.C*Math.cos(e),b:t.C*Math.sin(e)}}function g(t){return Y(J(t))}function _(t){let e=b(t);return e?z(e):null}function D(t,e){let n=b(t),i=b(e);return!n||!i?null:Math.hypot(n.L-i.L,n.a-i.a,n.b-i.b)}function W(t){let e=1/0;for(let n=0;n<t.length;n++)for(let i=n+1;i<t.length;i++){let r=D(t[n],t[i]);r!==null&&r<e&&(e=r)}return e}var E=2.4,Q=.2126729,Z=.7151522,tt=.072175,N=.022,nt=1.414,et=1.14,rt=1.14,ot=.027,it=.027,at=5e-4,F=.1;function K(t){let e=O(t);if(!e)return null;let n=Q*(e[0]/255)**E+Z*(e[1]/255)**E+tt*(e[2]/255)**E;return n<N?n+(N-n)**nt:n}function st(t,e){let n=K(t),i=K(e);if(n===null||i===null)return null;if(Math.abs(i-n)<at)return 0;let r,o;return i>n?(r=(i**.56-n**.57)*et,o=r<F?0:r-ot):(r=(i**.65-n**.62)*rt,o=r>-F?0:r+it),o*100}function x(t,e){let n=st(t,e);return n===null?null:Math.abs(n)}var ct=6,ut=1.25,lt=15,H=.1,ft=24,G=264,dt=.11,T=.16;function Tt(t,e={}){return mt(t,e)}function mt(t,e,n){if(t<=ct){let o=e.accent??A;return Array.from({length:Math.max(0,t)},(c,s)=>v(s,o,e.bg))}let i=U(e.bg),r=U(e.accent,i)??A;return bt(t,r,i,n)}function U(t,e){if(t===void 0)return;let n=M(t);if(!n)return;if(n[3]===1)return L(n[0],n[1],n[2]);if(e===void 0)return;let i=M(e);if(!(!i||i[3]!==1))return L(n[0]*n[3]+i[0]*(1-n[3]),n[1]*n[3]+i[1]*(1-n[3]),n[2]*n[3]+i[2]*(1-n[3]))}function bt(t,e,n,i){let r=_(e)??{L:.6,C:T,h:G},o=r.C<.03,c=o?G:r.h,s=Math.max(dt,Math.min(T,o?T:r.C)),a=((n===void 0?null:b(n))?.L??1)<.55,u=a?[.74,.6]:[.56,.7],l=360/t,f=Array.from({length:t},(d,m)=>{if(m===0&&h(e,n))return e;let C=m===0?c:((c+m*l)%360+360)%360,$=m===0?r.L:u[m%2];return X({L:$,C:s,h:C},n,a,i)});return t<=ft?Ct(f,n,a,i):pt(f,n,a,i)}function h(t,e){if(e===void 0)return!0;let n=w(t,e),i=x(t,e);return n!==null&&i!==null&&n>=ut&&i>=lt}function X(t,e,n,i){i&&i.candidateEvaluations++;let r=g(t);if(e===void 0||h(r,e))return r;let o=b(e)?.L??(n?0:1),c=t.L>=o?1:-1;for(let a=1;a<=24;a++){let u=a*.04;for(let l of[c,-c]){i&&i.candidateEvaluations++;let f=g({...t,L:p(t.L+l*u)});if(h(f,e))return f}}let s=["#000000","#ffffff"].filter(a=>h(a,e));return s.length>0?s.sort((a,u)=>(x(u,e)??0)-(x(a,e)??0))[0]:r}function Ct(t,e,n,i){let r=[];for(let o=0;o<t.length;o++){let c=t[o],s=o===0&&h(c,e);r.push(s||I(c,r,i)>=H?c:ht(c,r,e,n,i))}return i&&(i.pairDistanceChecks+=r.length*(r.length-1)/2),W(r)>=H?r:Lt(r,e,i)}function I(t,e,n){let i=1/0;for(let r of e){n&&n.pairDistanceChecks++;let o=D(t,r);o!==null&&o<i&&(i=o)}return i}var p=t=>Math.max(.08,Math.min(.97,t));function ht(t,e,n,i,r){let o=_(t);if(!o)return t;let c=t,s=I(t,e,r);for(let a=1;a<=12;a++){let u=a*.03,l=a*7,f=[{...o,L:p(o.L+u)},{...o,L:p(o.L-u)},{...o,h:(o.h+l)%360},{...o,h:(o.h-l+360)%360},{...o,L:p(i?o.L+u:o.L-u),h:(o.h+l)%360}];for(let d of f){r&&r.candidateEvaluations++;let m=g(d);if(n!==void 0&&!h(m,n))continue;let C=I(m,e,r);if(C>=H)return m;C>s&&(s=C,c=m)}}return c}function gt(t,e){let n=new Map,i=r=>{if(e&&e.candidateEvaluations++,n.has(r)||t!==void 0&&!h(r,t))return;let o=b(r);o&&n.set(r,{hex:r,lab:o})};i("#000000"),i("#ffffff");for(let r=0;r<=22;r++){let o=.08+r*.04;i(g({L:o,C:0,h:0}));for(let c of[.04,.08,.12,.16,.2,.24,.28])for(let s=0;s<360;s+=10)i(g({L:o,C:c,h:s}))}return[...n.values()]}var V=(t,e)=>Math.hypot(t.L-e.L,t.a-e.a,t.b-e.b);function Lt(t,e,n){if(t.length<2)return t;let i=gt(e,n),r=b(t[0]);if(!r)return t;let o=[{hex:t[0],lab:r}],c=new Set([t[0].toLowerCase()]);for(;o.length<t.length;){let s,a=-1,u=1/0,l=b(t[o.length]);for(let f of i){if(c.has(f.hex.toLowerCase()))continue;n&&n.candidateEvaluations++;let d=1/0;for(let C of o)n&&n.pairDistanceChecks++,d=Math.min(d,V(f.lab,C.lab));let m=l?V(f.lab,l):0;(d>a+1e-12||Math.abs(d-a)<=1e-12&&m<u)&&(s=f,a=d,u=m)}if(!s)return t;o.push(s),c.add(s.hex.toLowerCase())}return o.map(s=>s.hex)}function pt(t,e,n,i){let r=new Set;return t.map((o,c)=>{if(i&&i.tailItems++,!r.has(o.toLowerCase()))return r.add(o.toLowerCase()),o;let s=_(o);if(s)for(let a=1;a<=24;a++){i&&i.candidateEvaluations++;let u=X({...s,L:p(s.L+(a%2===0?1:-1)*Math.ceil(a/2)*.008),h:(s.h+a*137.508+c*.01)%360},e,n,i);if(!r.has(u.toLowerCase()))return r.add(u.toLowerCase()),u}return o})}export{A as a,R as b,j as c,B as d,q as e,Tt as f};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import{c as Yt,d as Ne,e as zt}from"./chunk-FFOHLPDA.js";import{a as In,b as Fn}from"./chunk-FLD63DXE.js";import{c as Ln}from"./chunk-P7HMSKHJ.js";var Nn={};Ln(Nn,{Alias:()=>te,CST:()=>Sn,Composer:()=>we,Document:()=>ie,Lexer:()=>Be,LineCounter:()=>Re,Pair:()=>I,Parser:()=>Se,Scalar:()=>y,Schema:()=>$e,YAMLError:()=>Pe,YAMLMap:()=>F,YAMLParseError:()=>j,YAMLSeq:()=>P,YAMLWarning:()=>_e,isAlias:()=>K,isCollection:()=>T,isDocument:()=>q,isMap:()=>V,isNode:()=>E,isPair:()=>O,isScalar:()=>C,isSeq:()=>U,parse:()=>Ei,parseAllDocuments:()=>Oi,parseDocument:()=>Mn,stringify:()=>Ti,visit:()=>Y,visitAsync:()=>qe});var ot=Symbol.for("yaml.alias"),at=Symbol.for("yaml.document"),J=Symbol.for("yaml.map"),Gt=Symbol.for("yaml.pair"),R=Symbol.for("yaml.scalar"),oe=Symbol.for("yaml.seq"),D=Symbol.for("yaml.node.type"),K=n=>!!n&&typeof n=="object"&&n[D]===ot,q=n=>!!n&&typeof n=="object"&&n[D]===at,V=n=>!!n&&typeof n=="object"&&n[D]===J,O=n=>!!n&&typeof n=="object"&&n[D]===Gt,C=n=>!!n&&typeof n=="object"&&n[D]===R,U=n=>!!n&&typeof n=="object"&&n[D]===oe;function T(n){if(n&&typeof n=="object")switch(n[D]){case J:case oe:return!0}return!1}function E(n){if(n&&typeof n=="object")switch(n[D]){case ot:case J:case R:case oe:return!0}return!1}var lt=n=>(C(n)||T(n))&&!!n.anchor;var B=Symbol("break visit"),vn=Symbol("skip children"),Z=Symbol("remove node");function Y(n,e){let t=$n(e);q(n)?Ae(null,n.contents,t,Object.freeze([n]))===Z&&(n.contents=null):Ae(null,n,t,Object.freeze([]))}Y.BREAK=B;Y.SKIP=vn;Y.REMOVE=Z;function Ae(n,e,t,i){let s=xn(n,e,t,i);if(E(s)||O(s))return Pn(n,i,s),Ae(n,s,t,i);if(typeof s!="symbol"){if(T(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let o=Ae(r,e.items[r],t,i);if(typeof o=="number")r=o-1;else{if(o===B)return B;o===Z&&(e.items.splice(r,1),r-=1)}}}else if(O(e)){i=Object.freeze(i.concat(e));let r=Ae("key",e.key,t,i);if(r===B)return B;r===Z&&(e.key=null);let o=Ae("value",e.value,t,i);if(o===B)return B;o===Z&&(e.value=null)}}return s}async function qe(n,e){let t=$n(e);q(n)?await Ce(null,n.contents,t,Object.freeze([n]))===Z&&(n.contents=null):await Ce(null,n,t,Object.freeze([]))}qe.BREAK=B;qe.SKIP=vn;qe.REMOVE=Z;async function Ce(n,e,t,i){let s=await xn(n,e,t,i);if(E(s)||O(s))return Pn(n,i,s),Ce(n,s,t,i);if(typeof s!="symbol"){if(T(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let o=await Ce(r,e.items[r],t,i);if(typeof o=="number")r=o-1;else{if(o===B)return B;o===Z&&(e.items.splice(r,1),r-=1)}}}else if(O(e)){i=Object.freeze(i.concat(e));let r=await Ce("key",e.key,t,i);if(r===B)return B;r===Z&&(e.key=null);let o=await Ce("value",e.value,t,i);if(o===B)return B;o===Z&&(e.value=null)}}return s}function $n(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function xn(n,e,t,i){if(typeof t=="function")return t(n,e,i);if(V(e))return t.Map?.(n,e,i);if(U(e))return t.Seq?.(n,e,i);if(O(e))return t.Pair?.(n,e,i);if(C(e))return t.Scalar?.(n,e,i);if(K(e))return t.Alias?.(n,e,i)}function Pn(n,e,t){let i=e[e.length-1];if(T(i))i.items[n]=t;else if(O(i))n==="key"?i.key=t:i.value=t;else if(q(i))i.contents=t;else{let s=K(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}var Ri={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ji=n=>n.replace(/[!,[\]{}]/g,e=>Ri[e]),ee=class n{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),s=i.shift();switch(s){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[r,o]=i;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=i;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${s}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,i,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);let r=this.tags[i];if(r)try{return r+decodeURIComponent(s)}catch(o){return t(String(o)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+ji(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),s;if(e&&i.length>0&&E(e.contents)){let r={};Y(e.contents,(o,a)=>{E(a)&&a.tag&&(r[a.tag]=!0)}),s=Object.keys(r)}else s=[];for(let[r,o]of i)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
|
|
2
|
+
`)}};ee.defaultYaml={explicit:!1,version:"1.2"};ee.defaultTags={"!!":"tag:yaml.org,2002:"};function ct(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function Qt(n){let e=new Set;return Y(n,{Value(t,i){i.anchor&&e.add(i.anchor)}}),e}function Ht(n,e){for(let t=1;;++t){let i=`${n}${t}`;if(!e.has(i))return i}}function _n(n,e){let t=[],i=new Map,s=null;return{onAnchor:r=>{t.push(r),s??(s=Qt(n));let o=Ht(e,s);return s.add(o),o},setAnchors:()=>{for(let r of t){let o=i.get(r);if(typeof o=="object"&&o.anchor&&(C(o.node)||T(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:i}}function ue(n,e,t,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let s=0,r=i.length;s<r;++s){let o=i[s],a=ue(n,i,String(s),o);a===void 0?delete i[s]:a!==o&&(i[s]=a)}else if(i instanceof Map)for(let s of Array.from(i.keys())){let r=i.get(s),o=ue(n,i,s,r);o===void 0?i.delete(s):o!==r&&i.set(s,o)}else if(i instanceof Set)for(let s of Array.from(i)){let r=ue(n,i,s,s);r===void 0?i.delete(s):r!==s&&(i.delete(s),i.add(r))}else for(let[s,r]of Object.entries(i)){let o=ue(n,i,s,r);o===void 0?delete i[s]:o!==r&&(i[s]=o)}return n.call(e,t,i)}function x(n,e,t){if(Array.isArray(n))return n.map((i,s)=>x(i,String(s),t));if(n&&typeof n.toJSON=="function"){if(!t||!lt(n))return n.toJSON(e,t);let i={aliasCount:0,count:1,res:void 0};t.anchors.set(n,i),t.onCreate=r=>{i.res=r,delete t.onCreate};let s=n.toJSON(e,t);return t.onCreate&&t.onCreate(s),s}return typeof n=="bigint"&&!t?.keep?Number(n):n}var me=class{constructor(e){Object.defineProperty(this,D,{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:i,onAnchor:s,reviver:r}={}){if(!q(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=x(this,"",o);if(typeof s=="function")for(let{count:l,res:c}of o.anchors.values())s(c,l);return typeof r=="function"?ue(r,{"":a},"",a):a}};var te=class extends me{constructor(e){super(ot),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],Y(e,{Node:(r,o)=>{(K(o)||lt(o))&&i.push(o)}}),t&&(t.aliasResolveCache=i));let s;for(let r of i){if(r===this)break;r.anchor===this.source&&(s=r)}return s}toJSON(e,t){if(!t)return{source:this.source};let{anchors:i,doc:s,maxAliasCount:r}=t,o=this.resolve(s,t);if(!o){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=i.get(o);if(a||(x(o,null,t),a=i.get(o)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ft(s,o,i)),a.count*a.aliasCount>r)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,i){let s=`*${this.source}`;if(e){if(ct(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${s} `}return s}};function ft(n,e,t){if(K(e)){let i=e.resolve(n),s=t&&i&&t.get(i);return s?s.count*s.aliasCount:0}else if(T(e)){let i=0;for(let s of e.items){let r=ft(n,s,t);r>i&&(i=r)}return i}else if(O(e)){let i=ft(n,e.key,t),s=ft(n,e.value,t);return Math.max(i,s)}return 1}var ut=n=>!n||typeof n!="function"&&typeof n!="object",y=class extends me{constructor(e){super(R),this.value=e}toJSON(e,t){return t?.keep?this.value:x(this.value,e,t)}toString(){return String(this.value)}};y.BLOCK_FOLDED="BLOCK_FOLDED";y.BLOCK_LITERAL="BLOCK_LITERAL";y.PLAIN="PLAIN";y.QUOTE_DOUBLE="QUOTE_DOUBLE";y.QUOTE_SINGLE="QUOTE_SINGLE";var Ki="tag:yaml.org,2002:";function qi(n,e,t){if(e){let i=t.filter(r=>r.tag===e),s=i.find(r=>!r.format)??i[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return t.find(i=>i.identify?.(n)&&!i.format)}function ae(n,e,t){if(q(n)&&(n=n.contents),E(n))return n;if(O(n)){let f=t.schema[J].createNode?.(t.schema,null,t);return f.items.push(n),f}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:i,onAnchor:s,onTagObj:r,schema:o,sourceObjects:a}=t,l;if(i&&n&&typeof n=="object"){if(l=a.get(n),l)return l.anchor??(l.anchor=s(n)),new te(l.anchor);l={anchor:null,node:null},a.set(n,l)}e?.startsWith("!!")&&(e=Ki+e.slice(2));let c=qi(n,e,o.tags);if(!c){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let f=new y(n);return l&&(l.node=f),f}c=n instanceof Map?o[J]:Symbol.iterator in Object(n)?o[oe]:o[J]}r&&(r(c),delete t.onTagObj);let d=c?.createNode?c.createNode(t.schema,n,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,n,t):new y(n);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}function Ve(n,e,t){let i=t;for(let s=e.length-1;s>=0;--s){let r=e[s];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=i,i=o}else i=new Map([[r,i]])}return ae(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var Ee=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,Oe=class extends me{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(i=>E(i)||O(i)?i.clone(e):i),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ee(e))this.add(t);else{let[i,...s]=e,r=this.get(i,!0);if(T(r))r.addIn(s,t);else if(r===void 0&&this.schema)this.set(i,Ve(this.schema,s,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}}deleteIn(e){let[t,...i]=e;if(i.length===0)return this.delete(t);let s=this.get(t,!0);if(T(s))return s.deleteIn(i);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${i}`)}getIn(e,t){let[i,...s]=e,r=this.get(i,!0);return s.length===0?!t&&C(r)?r.value:r:T(r)?r.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!O(t))return!1;let i=t.value;return i==null||e&&C(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[t,...i]=e;if(i.length===0)return this.has(t);let s=this.get(t,!0);return T(s)?s.hasIn(i):!1}setIn(e,t){let[i,...s]=e;if(s.length===0)this.set(i,t);else{let r=this.get(i,!0);if(T(r))r.setIn(s,t);else if(r===void 0&&this.schema)this.set(i,Ve(this.schema,s,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}}};var Dn=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function W(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var ne=(n,e,t)=>n.endsWith(`
|
|
3
|
+
`)?W(t,e):t.includes(`
|
|
4
|
+
`)?`
|
|
5
|
+
`+W(t,e):(n.endsWith(" ")?"":" ")+t;var Xt="flow",mt="block",Ue="quoted";function We(n,e,t="flow",{indentAtStart:i,lineWidth:s=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return n;s<r&&(r=0);let l=Math.max(1+r,1+s-e.length);if(n.length<=l)return n;let c=[],d={},f=s-e.length;typeof i=="number"&&(i>s-Math.max(2,r)?c.push(0):f=s-i);let u,p,g=!1,m=-1,h=-1,w=-1;t===mt&&(m=Bn(n,m,e.length),m!==-1&&(f=m+l));for(let k;k=n[m+=1];){if(t===Ue&&k==="\\"){switch(h=m,n[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}w=m}if(k===`
|
|
6
|
+
`)t===mt&&(m=Bn(n,m,e.length)),f=m+e.length+l,u=void 0;else{if(k===" "&&p&&p!==" "&&p!==`
|
|
7
|
+
`&&p!==" "){let M=n[m+1];M&&M!==" "&&M!==`
|
|
8
|
+
`&&M!==" "&&(u=m)}if(m>=f)if(u)c.push(u),f=u+l,u=void 0;else if(t===Ue){for(;p===" "||p===" ";)p=k,k=n[m+=1],g=!0;let M=m>w+1?m-2:h-1;if(d[M])return n;c.push(M),d[M]=!0,f=M+l,u=void 0}else g=!0}p=k}if(g&&a&&a(),c.length===0)return n;o&&o();let S=n.slice(0,c[0]);for(let k=0;k<c.length;++k){let M=c[k],N=c[k+1]||n.length;M===0?S=`
|
|
9
|
+
${e}${n.slice(0,N)}`:(t===Ue&&d[M]&&(S+=`${n[M]}\\`),S+=`
|
|
10
|
+
${e}${n.slice(M+1,N)}`)}return S}function Bn(n,e,t){let i=e,s=e+1,r=n[s];for(;r===" "||r===" ";)if(e<s+t)r=n[++e];else{do r=n[++e];while(r&&r!==`
|
|
11
|
+
`);i=e,s=e+1,r=n[s]}return i}var ht=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),pt=n=>/^(%|---|\.\.\.)/m.test(n);function Vi(n,e,t){if(!e||e<0)return!1;let i=e-t,s=n.length;if(s<=i)return!1;for(let r=0,o=0;r<s;++r)if(n[r]===`
|
|
12
|
+
`){if(r-o>i)return!0;if(o=r+1,s-o<=i)return!1}return!0}function Je(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:i}=e,s=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(pt(n)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let d=t.substr(l+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(i||t[l+2]==='"'||t.length<s)l+=1;else{for(o+=t.slice(a,l)+`
|
|
13
|
+
|
|
14
|
+
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
|
|
15
|
+
`,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,i?o:We(o,r,Ue,ht(e,!1))}function Zt(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return Je(n,e);let t=e.indent||(pt(n)?" ":""),i="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${t}`)+"'";return e.implicitKey?i:We(i,t,Xt,ht(e,!1))}function Te(n,e){let{singleQuote:t}=e.options,i;if(t===!1)i=Je;else{let s=n.includes('"'),r=n.includes("'");s&&!r?i=Zt:r&&!s?i=Je:i=t?Zt:Je}return i(n,e)}var en;try{en=new RegExp(`(^|(?<!
|
|
18
|
+
))
|
|
19
|
+
+(?!
|
|
20
|
+
|$)`,"g")}catch{en=/\n+(?!\n|$)/g}function dt({comment:n,type:e,value:t},i,s,r){let{blockQuote:o,commentString:a,lineWidth:l}=i.options;if(!o||/\n[\t ]+$/.test(t))return Te(t,i);let c=i.indent||(i.forceBlockIndent||pt(t)?" ":""),d=o==="literal"?!0:o==="folded"||e===y.BLOCK_FOLDED?!1:e===y.BLOCK_LITERAL?!0:!Vi(t,l,c.length);if(!t)return d?`|
|
|
21
|
+
`:`>
|
|
22
|
+
`;let f,u;for(u=t.length;u>0;--u){let N=t[u-1];if(N!==`
|
|
23
|
+
`&&N!==" "&&N!==" ")break}let p=t.substring(u),g=p.indexOf(`
|
|
24
|
+
`);g===-1?f="-":t===p||g!==p.length-1?(f="+",r&&r()):f="",p&&(t=t.slice(0,-p.length),p[p.length-1]===`
|
|
25
|
+
`&&(p=p.slice(0,-1)),p=p.replace(en,`$&${c}`));let m=!1,h,w=-1;for(h=0;h<t.length;++h){let N=t[h];if(N===" ")m=!0;else if(N===`
|
|
26
|
+
`)w=h;else break}let S=t.substring(0,w<h?w+1:h);S&&(t=t.substring(S.length),S=S.replace(/\n+/g,`$&${c}`));let M=(m?c?"2":"1":"")+f;if(n&&(M+=" "+a(n.replace(/ ?[\r\n]+/g," ")),s&&s()),!d){let N=t.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,L=ht(i,!0);o!=="folded"&&e!==y.BLOCK_FOLDED&&(L.onOverflow=()=>{A=!0});let b=We(`${S}${N}${p}`,c,mt,L);if(!A)return`>${M}
|
|
28
|
+
${c}${b}`}return t=t.replace(/\n+/g,`$&${c}`),`|${M}
|
|
29
|
+
${c}${S}${t}${p}`}function Ui(n,e,t,i){let{type:s,value:r}=n,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:d}=e;if(a&&r.includes(`
|
|
30
|
+
`)||d&&/[[\]{},]/.test(r))return Te(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||d||!r.includes(`
|
|
31
|
+
`)?Te(r,e):dt(n,e,t,i);if(!a&&!d&&s!==y.PLAIN&&r.includes(`
|
|
32
|
+
`))return dt(n,e,t,i);if(pt(r)){if(l==="")return e.forceBlockIndent=!0,dt(n,e,t,i);if(a&&l===c)return Te(r,e)}let f=r.replace(/\n+/g,`$&
|
|
33
|
+
${l}`);if(o){let u=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:p,tags:g}=e.doc.schema;if(g.some(u)||p?.some(u))return Te(r,e)}return a?f:We(f,l,Xt,ht(e,!1))}function le(n,e,t,i){let{implicitKey:s,inFlow:r}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==y.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=y.QUOTE_DOUBLE);let l=d=>{switch(d){case y.BLOCK_FOLDED:case y.BLOCK_LITERAL:return s||r?Te(o.value,e):dt(o,e,t,i);case y.QUOTE_DOUBLE:return Je(o.value,e);case y.QUOTE_SINGLE:return Zt(o.value,e);case y.PLAIN:return Ui(o,e,t,i);default:return null}},c=l(a);if(c===null){let{defaultKeyType:d,defaultStringType:f}=e.options,u=s&&d||f;if(c=l(u),c===null)throw new Error(`Unsupported default string type ${u}`)}return c}function gt(n,e){let t=Object.assign({blockQuote:!0,commentString:Dn,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},n.schema.toStringOptions,e),i;switch(t.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:i,options:t}}function Wi(n,e){if(e.tag){let s=n.filter(r=>r.tag===e.tag);if(s.length>0)return s.find(r=>r.format===e.format)??s[0]}let t,i;if(C(e)){i=e.value;let s=n.filter(r=>r.identify?.(i));if(s.length>1){let r=s.filter(o=>o.test);r.length>0&&(s=r)}t=s.find(r=>r.format===e.format)??s.find(r=>!r.format)}else i=e,t=n.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!t){let s=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return t}function Ji(n,e,{anchors:t,doc:i}){if(!i.directives)return"";let s=[],r=(C(n)||T(n))&&n.anchor;r&&ct(r)&&(t.add(r),s.push(`&${r}`));let o=n.tag??(e.default?null:e.tag);return o&&s.push(i.directives.tagString(o)),s.join(" ")}function ce(n,e,t,i){if(O(n))return n.toString(e,t,i);if(K(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let s,r=E(n)?n:e.doc.createNode(n,{onTagObj:l=>s=l});s??(s=Wi(e.doc.schema.tags,r));let o=Ji(r,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof s.stringify=="function"?s.stringify(r,e,t,i):C(r)?le(r,e,t,i):r.toString(e,t,i);return o?C(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
34
|
+
${e.indent}${a}`:a}function Rn({key:n,value:e},t,i,s){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:f}}=t,u=E(n)&&n.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(T(n)||!E(n)&&typeof n=="object"){let L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let p=!f&&(!n||u&&e==null&&!t.inFlow||T(n)||(C(n)?n.type===y.BLOCK_FOLDED||n.type===y.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(f||!r),indent:a+l});let g=!1,m=!1,h=ce(n,t,()=>g=!0,()=>m=!0);if(!p&&!t.inFlow&&h.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(r||e==null)return g&&i&&i(),h===""?"?":p?`? ${h}`:h}else if(r&&!f||e==null&&p)return h=`? ${h}`,u&&!g?h+=ne(h,t.indent,c(u)):m&&s&&s(),h;g&&(u=null),p?(u&&(h+=ne(h,t.indent,c(u))),h=`? ${h}
|
|
35
|
+
${a}:`):(h=`${h}:`,u&&(h+=ne(h,t.indent,c(u))));let w,S,k;E(e)?(w=!!e.spaceBefore,S=e.commentBefore,k=e.comment):(w=!1,S=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!p&&!u&&C(e)&&(t.indentAtStart=h.length+1),m=!1,!d&&l.length>=2&&!t.inFlow&&!p&&U(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let M=!1,N=ce(e,t,()=>M=!0,()=>m=!0),A=" ";if(u||w||S){if(A=w?`
|
|
36
|
+
`:"",S){let L=c(S);A+=`
|
|
37
|
+
${W(L,t.indent)}`}N===""&&!t.inFlow?A===`
|
|
38
|
+
`&&k&&(A=`
|
|
39
|
+
|
|
40
|
+
`):A+=`
|
|
41
|
+
${t.indent}`}else if(!p&&T(e)){let L=N[0],b=N.indexOf(`
|
|
42
|
+
`),v=b!==-1,fe=t.inFlow??e.flow??e.items.length===0;if(v||!fe){let Me=!1;if(v&&(L==="&"||L==="!")){let $=N.indexOf(" ");L==="&"&&$!==-1&&$<b&&N[$+1]==="!"&&($=N.indexOf(" ",$+1)),($===-1||b<$)&&(Me=!0)}Me||(A=`
|
|
43
|
+
${t.indent}`)}}else(N===""||N[0]===`
|
|
44
|
+
`)&&(A="");return h+=A+N,t.inFlow?M&&i&&i():k&&!M?h+=ne(h,t.indent,c(k)):m&&s&&s(),h}function yt(n,e){(n==="debug"||n==="warn")&&console.warn(e)}var bt="<<",z={identify:n=>n===bt||typeof n=="symbol"&&n.description===bt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new y(Symbol(bt)),{addToJSMap:nn}),stringify:()=>bt},jn=(n,e)=>(z.identify(e)||C(e)&&(!e.type||e.type===y.PLAIN)&&z.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===z.tag&&t.default);function nn(n,e,t){let i=Kn(n,t);if(U(i))for(let s of i.items)tn(n,e,s);else if(Array.isArray(i))for(let s of i)tn(n,e,s);else tn(n,e,i)}function tn(n,e,t){let i=Kn(n,t);if(!V(i))throw new Error("Merge sources must be maps or map aliases");let s=i.toJSON(null,n,Map);for(let[r,o]of s)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Kn(n,e){return n&&K(e)?e.resolve(n.doc,n):e}function wt(n,e,{key:t,value:i}){if(E(t)&&t.addToJSMap)t.addToJSMap(n,e,i);else if(jn(n,t))nn(n,e,i);else{let s=x(t,"",n);if(e instanceof Map)e.set(s,x(i,s,n));else if(e instanceof Set)e.add(s);else{let r=Yi(t,s,n),o=x(i,r,n);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Yi(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(E(n)&&t?.doc){let i=gt(t.doc,{});i.anchors=new Set;for(let r of t.anchors.keys())i.anchors.add(r.anchor);i.inFlow=!0,i.inStringifyKey=!0;let s=n.toString(i);if(!t.mapKeyWarned){let r=JSON.stringify(s);r.length>40&&(r=r.substring(0,36)+'..."'),yt(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return s}return JSON.stringify(e)}function Le(n,e,t){let i=ae(n,void 0,t),s=ae(e,void 0,t);return new I(i,s)}var I=class n{constructor(e,t=null){Object.defineProperty(this,D,{value:Gt}),this.key=e,this.value=t}clone(e){let{key:t,value:i}=this;return E(t)&&(t=t.clone(e)),E(i)&&(i=i.clone(e)),new n(t,i)}toJSON(e,t){let i=t?.mapAsMap?new Map:{};return wt(t,i,this)}toString(e,t,i){return e?.doc?Rn(this,e,t,i):JSON.stringify(this)}};function kt(n,e,t){return(e.inFlow??n.flow?Gi:zi)(n,e,t)}function zi({comment:n,items:e},t,{blockItemPrefix:i,flowChars:s,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,d=Object.assign({},t,{indent:r,type:null}),f=!1,u=[];for(let g=0;g<e.length;++g){let m=e[g],h=null;if(E(m))!f&&m.spaceBefore&&u.push(""),St(t,u,m.commentBefore,f),m.comment&&(h=m.comment);else if(O(m)){let S=E(m.key)?m.key:null;S&&(!f&&S.spaceBefore&&u.push(""),St(t,u,S.commentBefore,f))}f=!1;let w=ce(m,d,()=>h=null,()=>f=!0);h&&(w+=ne(w,r,c(h))),f&&h&&(f=!1),u.push(i+w)}let p;if(u.length===0)p=s.start+s.end;else{p=u[0];for(let g=1;g<u.length;++g){let m=u[g];p+=m?`
|
|
45
|
+
${l}${m}`:`
|
|
46
|
+
`}}return n?(p+=`
|
|
47
|
+
`+W(c(n),l),a&&a()):f&&o&&o(),p}function Gi({items:n},e,{flowChars:t,itemIndent:i}){let{indent:s,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;i+=r;let l=Object.assign({},e,{indent:i,inFlow:!0,type:null}),c=!1,d=0,f=[];for(let g=0;g<n.length;++g){let m=n[g],h=null;if(E(m))m.spaceBefore&&f.push(""),St(e,f,m.commentBefore,!1),m.comment&&(h=m.comment);else if(O(m)){let S=E(m.key)?m.key:null;S&&(S.spaceBefore&&f.push(""),St(e,f,S.commentBefore,!1),S.comment&&(c=!0));let k=E(m.value)?m.value:null;k?(k.comment&&(h=k.comment),k.commentBefore&&(c=!0)):m.value==null&&S?.comment&&(h=S.comment)}h&&(c=!0);let w=ce(m,l,()=>h=null);c||(c=f.length>d||w.includes(`
|
|
48
|
+
`)),g<n.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((S,k)=>S+k.length+2,2)+(w.length+2)>e.options.lineWidth)),c&&(w+=",")),h&&(w+=ne(w,i,a(h))),f.push(w),d=f.length}let{start:u,end:p}=t;if(f.length===0)return u+p;if(!c){let g=f.reduce((m,h)=>m+h.length+2,2);c=e.options.lineWidth>0&&g>e.options.lineWidth}if(c){let g=u;for(let m of f)g+=m?`
|
|
49
|
+
${r}${s}${m}`:`
|
|
50
|
+
`;return`${g}
|
|
51
|
+
${s}${p}`}else return`${u}${o}${f.join(" ")}${o}${p}`}function St({indent:n,options:{commentString:e}},t,i,s){if(i&&s&&(i=i.replace(/^\n+/,"")),i){let r=W(e(i),n);t.push(r.trimStart())}}function de(n,e){let t=C(e)?e.value:e;for(let i of n)if(O(i)&&(i.key===e||i.key===t||C(i.key)&&i.key.value===t))return i}var F=class extends Oe{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(J,e),this.items=[]}static from(e,t,i){let{keepUndefined:s,replacer:r}=i,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||s)&&o.items.push(Le(l,c,i))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let i;O(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new I(e,e?.value):i=new I(e.key,e.value);let s=de(this.items,i.key),r=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${i.key} already set`);C(s.value)&&ut(i.value)?s.value.value=i.value:s.value=i.value}else if(r){let o=this.items.findIndex(a=>r(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let t=de(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let s=de(this.items,e)?.value;return(!t&&C(s)?s.value:s)??void 0}has(e){return!!de(this.items,e)}set(e,t){this.add(new I(e,t),!0)}toJSON(e,t,i){let s=i?new i:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(s);for(let r of this.items)wt(t,s,r);return s}toString(e,t,i){if(!e)return JSON.stringify(this);for(let s of this.items)if(!O(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),kt(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:t})}};var G={collection:"map",default:!0,nodeClass:F,tag:"tag:yaml.org,2002:map",resolve(n,e){return V(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>F.from(n,e,t)};var P=class extends Oe{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(oe,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Mt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let i=Mt(e);if(typeof i!="number")return;let s=this.items[i];return!t&&C(s)?s.value:s}has(e){let t=Mt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let i=Mt(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let s=this.items[i];C(s)&&ut(t)?s.value=t:this.items[i]=t}toJSON(e,t){let i=[];t?.onCreate&&t.onCreate(i);let s=0;for(let r of this.items)i.push(x(r,String(s++),t));return i}toString(e,t,i){return e?kt(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:t}):JSON.stringify(this)}static from(e,t,i){let{replacer:s}=i,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof s=="function"){let l=t instanceof Set?a:String(o++);a=s.call(t,l,a)}r.items.push(ae(a,void 0,i))}}return r}};function Mt(n){let e=C(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}var Q={collection:"seq",default:!0,nodeClass:P,tag:"tag:yaml.org,2002:seq",resolve(n,e){return U(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>P.from(n,e,t)};var he={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,i){return e=Object.assign({actualString:!0},e),le(n,e,t,i)}};var be={identify:n=>n==null,createNode:()=>new y(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new y(null),stringify:({source:n},e)=>typeof n=="string"&&be.test.test(n)?n:e.options.nullStr};var Ye={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new y(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&Ye.test.test(n)){let i=n[0]==="t"||n[0]==="T";if(e===i)return n}return e?t.options.trueStr:t.options.falseStr}};function _({format:n,minFractionDigits:e,tag:t,value:i}){if(typeof i=="bigint")return String(i);let s=typeof i=="number"?i:Number(i);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let r=Object.is(i,-0)?"-0":JSON.stringify(i);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}var Nt={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:_},At={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():_(n)}},Ct={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new y(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:_};var Ot=n=>typeof n=="bigint"||Number.isInteger(n),sn=(n,e,t,{intAsBigInt:i})=>i?BigInt(n):parseInt(n.substring(e),t);function qn(n,e,t){let{value:i}=n;return Ot(i)&&i>=0?t+i.toString(e):_(n)}var Et={identify:n=>Ot(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>sn(n,2,8,t),stringify:n=>qn(n,8,"0o")},Tt={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>sn(n,0,10,t),stringify:_},Lt={identify:n=>Ot(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>sn(n,2,16,t),stringify:n=>qn(n,16,"0x")};var Vn=[G,Q,he,be,Ye,Et,Tt,Lt,Nt,At,Ct];function Un(n){return typeof n=="bigint"||Number.isInteger(n)}var It=({value:n})=>JSON.stringify(n),Qi=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:It},{identify:n=>n==null,createNode:()=>new y(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:It},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:It},{identify:Un,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>Un(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:It}],Hi={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},Wn=[G,Q].concat(Qi,Hi);var ze={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),i=new Uint8Array(t.length);for(let s=0;s<t.length;++s)i[s]=t.charCodeAt(s);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},i,s,r){if(!t)return"";let o=t,a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=y.BLOCK_LITERAL),e!==y.QUOTE_DOUBLE){let l=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(a.length/l),d=new Array(c);for(let f=0,u=0;f<c;++f,u+=l)d[f]=a.substr(u,l);a=d.join(e===y.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return le({comment:n,type:e,value:a},i,s,r)}};function rn(n,e){if(U(n))for(let t=0;t<n.items.length;++t){let i=n.items[t];if(!O(i)){if(V(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let s=i.items[0]||new I(new y(null));if(i.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${i.commentBefore}
|
|
53
|
+
${s.key.commentBefore}`:i.commentBefore),i.comment){let r=s.value??s.key;r.comment=r.comment?`${i.comment}
|
|
54
|
+
${r.comment}`:i.comment}i=s}n.items[t]=O(i)?i:new I(i)}}else e("Expected a sequence for this tag");return n}function on(n,e,t){let{replacer:i}=t,s=new P(n);s.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;s.items.push(Le(a,l,t))}return s}var Ge={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:rn,createNode:on};var Ie=class n extends P{constructor(){super(),this.add=F.prototype.add.bind(this),this.delete=F.prototype.delete.bind(this),this.get=F.prototype.get.bind(this),this.has=F.prototype.has.bind(this),this.set=F.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let i=new Map;t?.onCreate&&t.onCreate(i);for(let s of this.items){let r,o;if(O(s)?(r=x(s.key,"",t),o=x(s.value,r,t)):r=x(s,"",t),i.has(r))throw new Error("Ordered maps must not include duplicate keys");i.set(r,o)}return i}static from(e,t,i){let s=on(e,t,i),r=new this;return r.items=s.items,r}};Ie.tag="tag:yaml.org,2002:omap";var Qe={collection:"seq",identify:n=>n instanceof Map,nodeClass:Ie,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=rn(n,e),i=[];for(let{key:s}of t.items)C(s)&&(i.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):i.push(s.value));return Object.assign(new Ie,t)},createNode:(n,e,t)=>Ie.from(n,e,t)};function Jn({value:n,source:e},t){return e&&(n?an:ln).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var an={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new y(!0),stringify:Jn},ln={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new y(!1),stringify:Jn};var Yn={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:_},zn={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():_(n)}},Gn={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new y(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let i=n.substring(t+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:_};var He=n=>typeof n=="bigint"||Number.isInteger(n);function Ft(n,e,t,{intAsBigInt:i}){let s=n[0];if((s==="-"||s==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),i){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return s==="-"?BigInt(-1)*o:o}let r=parseInt(n,t);return s==="-"?-1*r:r}function cn(n,e,t){let{value:i}=n;if(He(i)){let s=i.toString(e);return i<0?"-"+t+s.substr(1):t+s}return _(n)}var Qn={identify:He,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Ft(n,2,2,t),stringify:n=>cn(n,2,"0b")},Hn={identify:He,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Ft(n,1,8,t),stringify:n=>cn(n,8,"0")},Xn={identify:He,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Ft(n,0,10,t),stringify:_},Zn={identify:He,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Ft(n,2,16,t),stringify:n=>cn(n,16,"0x")};var Fe=class n extends F{constructor(e){super(e),this.tag=n.tag}add(e){let t;O(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new I(e.key,null):t=new I(e,null),de(this.items,t.key)||this.items.push(t)}get(e,t){let i=de(this.items,e);return!t&&O(i)?C(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=de(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new I(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,i);throw new Error("Set items must all have null values")}static from(e,t,i){let{replacer:s}=i,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof s=="function"&&(o=s.call(t,o,o)),r.items.push(Le(o,null,i));return r}};Fe.tag="tag:yaml.org,2002:set";var Xe={collection:"map",identify:n=>n instanceof Set,nodeClass:Fe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>Fe.from(n,e,t),resolve(n,e){if(V(n)){if(n.hasAllNullValues(!0))return Object.assign(new Fe,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function fn(n,e){let t=n[0],i=t==="-"||t==="+"?n.substring(1):n,s=o=>e?BigInt(o):Number(o),r=i.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return t==="-"?s(-1)*r:r}function ei(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return _(n);let i="";e<0&&(i="-",e*=t(-1));let s=t(60),r=[e%s];return e<60?r.unshift(0):(e=(e-r[0])/s,r.unshift(e%s),e>=60&&(e=(e-r[0])/s,r.unshift(e))),i+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var vt={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>fn(n,t),stringify:ei},$t={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>fn(n,!1),stringify:ei},ve={identify:n=>n 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(n){let e=n.match(ve.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,i,s,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,i-1,s,r||0,o||0,a||0,l),d=e[8];if(d&&d!=="Z"){let f=fn(d,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};var un=[G,Q,he,be,an,ln,Qn,Hn,Xn,Zn,Yn,zn,Gn,ze,z,Qe,Ge,Xe,vt,$t,ve];var ti=new Map([["core",Vn],["failsafe",[G,Q,he]],["json",Wn],["yaml11",un],["yaml-1.1",un]]),ni={binary:ze,bool:Ye,float:Ct,floatExp:At,floatNaN:Nt,floatTime:$t,int:Tt,intHex:Lt,intOct:Et,intTime:vt,map:G,merge:z,null:be,omap:Qe,pairs:Ge,seq:Q,set:Xe,timestamp:ve},ii={"tag:yaml.org,2002:binary":ze,"tag:yaml.org,2002:merge":z,"tag:yaml.org,2002:omap":Qe,"tag:yaml.org,2002:pairs":Ge,"tag:yaml.org,2002:set":Xe,"tag:yaml.org,2002:timestamp":ve};function xt(n,e,t){let i=ti.get(e);if(i&&!n)return t&&!i.includes(z)?i.concat(z):i.slice();let s=i;if(!s)if(Array.isArray(n))s=[];else{let r=Array.from(ti.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(n))for(let r of n)s=s.concat(r);else typeof n=="function"&&(s=n(s.slice()));return t&&(s=s.concat(z)),s.reduce((r,o)=>{let a=typeof o=="string"?ni[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(ni).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}var Xi=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,$e=class n{constructor({compat:e,customTags:t,merge:i,resolveKnownTags:s,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?xt(e,"compat"):e?xt(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=s?ii:{},this.tags=xt(t,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,J,{value:G}),Object.defineProperty(this,R,{value:he}),Object.defineProperty(this,oe,{value:Q}),this.sortMapEntries=typeof o=="function"?o:o===!0?Xi:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function si(n,e){let t=[],i=e.directives===!0;if(e.directives!==!1&&n.directives){let l=n.directives.toString(n);l?(t.push(l),i=!0):n.directives.docStart&&(i=!0)}i&&t.push("---");let s=gt(n,e),{commentString:r}=s.options;if(n.commentBefore){t.length!==1&&t.unshift("");let l=r(n.commentBefore);t.unshift(W(l,""))}let o=!1,a=null;if(n.contents){if(E(n.contents)){if(n.contents.spaceBefore&&i&&t.push(""),n.contents.commentBefore){let d=r(n.contents.commentBefore);t.push(W(d,""))}s.forceBlockIndent=!!n.comment,a=n.contents.comment}let l=a?void 0:()=>o=!0,c=ce(n.contents,s,()=>a=null,l);a&&(c+=ne(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(ce(n.contents,s));if(n.directives?.docEnd)if(n.comment){let l=r(n.comment);l.includes(`
|
|
55
|
+
`)?(t.push("..."),t.push(W(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=n.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(W(r(l),"")))}return t.join(`
|
|
56
|
+
`)+`
|
|
57
|
+
`}var ie=class n{constructor(e,t,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,D,{value:at});let s=null;typeof t=="function"||Array.isArray(t)?s=t:i===void 0&&t&&(i=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"},i);this.options=r;let{version:o}=r;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ee({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,s,i)}clone(){let e=Object.create(n.prototype,{[D]:{value:at}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=E(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){xe(this.contents)&&this.contents.add(e)}addIn(e,t){xe(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let i=Qt(this);e.anchor=!t||i.has(t)?Ht(t||"a",i):t}return new te(e.anchor)}createNode(e,t,i){let s;if(typeof t=="function")e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){let h=S=>typeof S=="number"||S instanceof String||S instanceof Number,w=t.filter(h).map(String);w.length>0&&(t=t.concat(w)),s=t}else i===void 0&&t&&(i=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:d}=i??{},{onAnchor:f,setAnchors:u,sourceObjects:p}=_n(this,o||"a"),g={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:s,schema:this.schema,sourceObjects:p},m=ae(e,d,g);return a&&T(m)&&(m.flow=!0),u(),m}createPair(e,t,i={}){let s=this.createNode(e,null,i),r=this.createNode(t,null,i);return new I(s,r)}delete(e){return xe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ee(e)?this.contents==null?!1:(this.contents=null,!0):xe(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return T(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ee(e)?!t&&C(this.contents)?this.contents.value:this.contents:T(this.contents)?this.contents.getIn(e,t):void 0}has(e){return T(this.contents)?this.contents.has(e):!1}hasIn(e){return Ee(e)?this.contents!==void 0:T(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ve(this.schema,[e],t):xe(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ee(e)?this.contents=t:this.contents==null?this.contents=Ve(this.schema,Array.from(e),t):xe(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ee({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ee({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(i)this.schema=new $e(Object.assign(i,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:i,maxAliasCount:s,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=x(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:d}of a.anchors.values())r(d,c);return typeof o=="function"?ue(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return si(this,e)}};function xe(n){if(T(n))return!0;throw new Error("Expected a YAML collection as document contents")}var Pe=class extends Error{constructor(e,t,i,s){super(),this.name=e,this.code=i,this.message=s,this.pos=t}},j=class extends Pe{constructor(e,t,i){super("YAMLParseError",e,t,i)}},_e=class extends Pe{constructor(e,t,i){super("YAMLWarning",e,t,i)}},Ze=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:i,col:s}=t.linePos[0];t.message+=` at line ${i}, column ${s}`;let r=s-1,o=n.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(o.substring(0,r))){let a=n.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
58
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===i&&l.col>s&&(a=Math.max(1,Math.min(l.col-s,80-r)));let c=" ".repeat(r)+"^".repeat(a);t.message+=`:
|
|
59
|
+
|
|
60
|
+
${o}
|
|
61
|
+
${c}
|
|
62
|
+
`}};function se(n,{flow:e,indicator:t,next:i,offset:s,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,d=a,f="",u="",p=!1,g=!1,m=null,h=null,w=null,S=null,k=null,M=null,N=null;for(let b of n)switch(g&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&r(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),m&&(c&&b.type!=="comment"&&b.type!=="newline"&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),b.type){case"space":!e&&(t!=="doc-start"||i?.type!=="flow-collection")&&b.source.includes(" ")&&(m=b),d=!0;break;case"comment":{d||r(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let v=b.source.substring(1)||" ";f?f+=u+v:f=v,u="",c=!1;break}case"newline":c?f?f+=b.source:(!M||t!=="seq-item-ind")&&(l=!0):u+=b.source,c=!0,p=!0,(h||w)&&(S=b),d=!0;break;case"anchor":h&&r(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&r(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=b,N??(N=b.offset),c=!1,d=!1,g=!0;break;case"tag":{w&&r(b,"MULTIPLE_TAGS","A node can have at most one tag"),w=b,N??(N=b.offset),c=!1,d=!1,g=!0;break}case t:(h||w)&&r(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),M&&r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),M=b,c=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&r(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=b,c=!1,d=!1;break}default:r(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),c=!1,d=!1}let A=n[n.length-1],L=A?A.offset+A.source.length:s;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&r(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:M,spaceBefore:l,comment:f,hasNewline:p,anchor:h,tag:w,newlineAfterProp:S,end:L,start:N??L}}function pe(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
63
|
+
`))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(pe(e.key)||pe(e.value))return!0}return!1;default:return!0}}function et(n,e,t){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===n&&(i.source==="]"||i.source==="}")&&pe(e)&&t(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Pt(n,e,t){let{uniqueKeys:i}=n.options;if(i===!1)return!1;let s=typeof i=="function"?i:(r,o)=>r===o||C(r)&&C(o)&&r.value===o.value;return e.some(r=>s(r.key,t))}var ri="All mapping items must start at the same column";function oi({composeNode:n,composeEmptyNode:e},t,i,s,r){let o=r?.nodeClass??F,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=i.offset,c=null;for(let d of i.items){let{start:f,key:u,sep:p,value:g}=d,m=se(f,{indicator:"explicit-key-ind",next:u??p?.[0],offset:l,onError:s,parentIndent:i.indent,startOnNewline:!0}),h=!m.found;if(h){if(u&&(u.type==="block-seq"?s(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==i.indent&&s(l,"BAD_INDENT",ri)),!m.anchor&&!m.tag&&!p){c=m.end,m.comment&&(a.comment?a.comment+=`
|
|
64
|
+
`+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||pe(u))&&s(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==i.indent&&s(l,"BAD_INDENT",ri);t.atKey=!0;let w=m.end,S=u?n(t,u,m,s):e(t,w,f,null,m,s);t.schema.compat&&et(i.indent,u,s),t.atKey=!1,Pt(t,a.items,S)&&s(w,"DUPLICATE_KEY","Map keys must be unique");let k=se(p??[],{indicator:"map-value-ind",next:g,offset:S.range[2],onError:s,parentIndent:i.indent,startOnNewline:!u||u.type==="block-scalar"});if(l=k.end,k.found){h&&(g?.type==="block-map"&&!k.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&m.start<k.found.offset-1024&&s(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let M=g?n(t,g,k,s):e(t,l,p,null,k,s);t.schema.compat&&et(i.indent,g,s),l=M.range[2];let N=new I(S,M);t.options.keepSourceTokens&&(N.srcToken=d),a.items.push(N)}else{h&&s(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(S.comment?S.comment+=`
|
|
65
|
+
`+k.comment:S.comment=k.comment);let M=new I(S);t.options.keepSourceTokens&&(M.srcToken=d),a.items.push(M)}}return c&&c<l&&s(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,l,c??l],a}function ai({composeNode:n,composeEmptyNode:e},t,i,s,r){let o=r?.nodeClass??P,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=i.offset,c=null;for(let{start:d,value:f}of i.items){let u=se(d,{indicator:"seq-item-ind",next:f,offset:l,onError:s,parentIndent:i.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)f?.type==="block-seq"?s(u.end,"BAD_INDENT","All sequence items must start at the same column"):s(l,"MISSING_CHAR","Sequence item without - indicator");else{c=u.end,u.comment&&(a.comment=u.comment);continue}let p=f?n(t,f,u,s):e(t,u.end,d,null,u,s);t.schema.compat&&et(i.indent,f,s),l=p.range[2],a.items.push(p)}return a.range=[i.offset,l,c??l],a}function re(n,e,t,i){let s="";if(n){let r=!1,o="";for(let a of n){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=l.substring(1)||" ";s?s+=o+d:s=d,o="";break}case"newline":s&&(o+=l),r=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:s,offset:e}}var mn="Block collections are not allowed within flow collections",dn=n=>n&&(n.type==="block-map"||n.type==="block-seq");function li({composeNode:n,composeEmptyNode:e},t,i,s,r){let o=i.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?F:P),c=new l(t.schema);c.flow=!0;let d=t.atRoot;d&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=i.offset+i.start.source.length;for(let h=0;h<i.items.length;++h){let w=i.items[h],{start:S,key:k,sep:M,value:N}=w,A=se(S,{flow:a,indicator:"explicit-key-ind",next:k??M?.[0],offset:f,onError:s,parentIndent:i.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!M&&!N){h===0&&A.comma?s(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):h<i.items.length-1&&s(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),A.comment&&(c.comment?c.comment+=`
|
|
66
|
+
`+A.comment:c.comment=A.comment),f=A.end;continue}!o&&t.options.strict&&pe(k)&&s(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)A.comma&&s(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(A.comma||s(A.start,"MISSING_CHAR",`Missing , between ${a} items`),A.comment){let L="";e:for(let b of S)switch(b.type){case"comma":case"space":break;case"comment":L=b.source.substring(1);break e;default:break e}if(L){let b=c.items[c.items.length-1];O(b)&&(b=b.value??b.key),b.comment?b.comment+=`
|
|
67
|
+
`+L:b.comment=L,A.comment=A.comment.substring(L.length+1)}}if(!o&&!M&&!A.found){let L=N?n(t,N,A,s):e(t,A.end,M,null,A,s);c.items.push(L),f=L.range[2],dn(N)&&s(L.range,"BLOCK_IN_FLOW",mn)}else{t.atKey=!0;let L=A.end,b=k?n(t,k,A,s):e(t,L,S,null,A,s);dn(k)&&s(b.range,"BLOCK_IN_FLOW",mn),t.atKey=!1;let v=se(M??[],{flow:a,indicator:"map-value-ind",next:N,offset:b.range[2],onError:s,parentIndent:i.indent,startOnNewline:!1});if(v.found){if(!o&&!A.found&&t.options.strict){if(M)for(let $ of M){if($===v.found)break;if($.type==="newline"){s($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<v.found.offset-1024&&s(v.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else N&&("source"in N&&N.source?.[0]===":"?s(N,"MISSING_CHAR",`Missing space after : in ${a}`):s(v.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let fe=N?n(t,N,v,s):v.found?e(t,v.end,M,null,v,s):null;fe?dn(N)&&s(fe.range,"BLOCK_IN_FLOW",mn):v.comment&&(b.comment?b.comment+=`
|
|
68
|
+
`+v.comment:b.comment=v.comment);let Me=new I(b,fe);if(t.options.keepSourceTokens&&(Me.srcToken=w),o){let $=c;Pt(t,$.items,b)&&s(L,"DUPLICATE_KEY","Map keys must be unique"),$.items.push(Me)}else{let $=new F(t.schema);$.flow=!0,$.items.push(Me);let Tn=(fe??b).range;$.range=[b.range[0],Tn[1],Tn[2]],c.items.push($)}f=fe?fe.range[2]:v.end}}let u=o?"}":"]",[p,...g]=i.end,m=f;if(p?.source===u)m=p.offset+p.source.length;else{let h=a[0].toUpperCase()+a.substring(1),w=d?`${h} must end with a ${u}`:`${h} in block collection must be sufficiently indented and end with a ${u}`;s(f,d?"MISSING_CHAR":"BAD_INDENT",w),p&&p.source.length!==1&&g.unshift(p)}if(g.length>0){let h=re(g,m,t.options.strict,s);h.comment&&(c.comment?c.comment+=`
|
|
69
|
+
`+h.comment:c.comment=h.comment),c.range=[i.offset,m,h.offset]}else c.range=[i.offset,m,m];return c}function hn(n,e,t,i,s,r){let o=t.type==="block-map"?oi(n,e,t,i,r):t.type==="block-seq"?ai(n,e,t,i,r):li(n,e,t,i,r),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function ci(n,e,t,i,s){let r=i.tag,o=r?e.directives.tagName(r.source,u=>s(r,"TAG_RESOLVE_FAILED",u)):null;if(t.type==="block-seq"){let{anchor:u,newlineAfterProp:p}=i,g=u&&r?u.offset>r.offset?u:r:u??r;g&&(!p||p.offset<g.offset)&&s(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===F.tagName&&a==="map"||o===P.tagName&&a==="seq")return hn(n,e,t,s,o);let l=e.schema.tags.find(u=>u.tag===o&&u.collection===a);if(!l){let u=e.schema.knownTags[o];if(u?.collection===a)e.schema.tags.push(Object.assign({},u,{default:!1})),l=u;else return u?s(r,"BAD_COLLECTION_TYPE",`${u.tag} used for ${a} collection, but expects ${u.collection??"scalar"}`,!0):s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),hn(n,e,t,s,o)}let c=hn(n,e,t,s,o,l),d=l.resolve?.(c,u=>s(r,"TAG_RESOLVE_FAILED",u),e.options)??c,f=E(d)?d:new y(d);return f.range=c.range,f.tag=o,l?.format&&(f.format=l.format),f}function _t(n,e,t){let i=e.offset,s=Zi(e,n.options.strict,t);if(!s)return{value:"",type:null,comment:"",range:[i,i,i]};let r=s.mode===">"?y.BLOCK_FOLDED:y.BLOCK_LITERAL,o=e.source?es(e.source):[],a=o.length;for(let m=o.length-1;m>=0;--m){let h=o[m][1];if(h===""||h==="\r")a=m;else break}if(a===0){let m=s.chomp==="+"&&o.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,o.length-1)):"",h=i+s.length;return e.source&&(h+=e.source.length),{value:m,type:r,comment:s.comment,range:[i,h,h]}}let l=e.indent+s.indent,c=e.offset+s.length,d=0;for(let m=0;m<a;++m){let[h,w]=o[m];if(w===""||w==="\r")s.indent===0&&h.length>l&&(l=h.length);else{h.length<l&&t(c+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(l=h.length),d=m,l===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=h.length+w.length+1}for(let m=o.length-1;m>=a;--m)o[m][0].length>l&&(a=m+1);let f="",u="",p=!1;for(let m=0;m<d;++m)f+=o[m][0].slice(l)+`
|
|
71
|
+
`;for(let m=d;m<a;++m){let[h,w]=o[m];c+=h.length+w.length+1;let S=w[w.length-1]==="\r";if(S&&(w=w.slice(0,-1)),w&&h.length<l){let M=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;t(c-w.length-(S?2:1),"BAD_INDENT",M),h=""}r===y.BLOCK_LITERAL?(f+=u+h.slice(l)+w,u=`
|
|
72
|
+
`):h.length>l||w[0]===" "?(u===" "?u=`
|
|
73
|
+
`:!p&&u===`
|
|
74
|
+
`&&(u=`
|
|
75
|
+
|
|
76
|
+
`),f+=u+h.slice(l)+w,u=`
|
|
77
|
+
`,p=!0):w===""?u===`
|
|
78
|
+
`?f+=`
|
|
79
|
+
`:u=`
|
|
80
|
+
`:(f+=u+w,u=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let m=a;m<o.length;++m)f+=`
|
|
81
|
+
`+o[m][0].slice(l);f[f.length-1]!==`
|
|
82
|
+
`&&(f+=`
|
|
83
|
+
`);break;default:f+=`
|
|
84
|
+
`}let g=i+s.length+e.source.length;return{value:f,type:r,comment:s.comment,range:[i,g,g]}}function Zi({offset:n,props:e},t,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:s}=e[0],r=s[0],o=0,a="",l=-1;for(let u=1;u<s.length;++u){let p=s[u];if(!a&&(p==="-"||p==="+"))a=p;else{let g=Number(p);!o&&g?o=g:l===-1&&(l=n+u)}}l!==-1&&i(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let c=!1,d="",f=s.length;for(let u=1;u<e.length;++u){let p=e[u];switch(p.type){case"space":c=!0;case"newline":f+=p.source.length;break;case"comment":t&&!c&&i(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,d=p.source.substring(1);break;case"error":i(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{let g=`Unexpected token in block scalar header: ${p.type}`;i(p,"UNEXPECTED_TOKEN",g);let m=p.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:r,indent:o,chomp:a,comment:d,length:f}}function es(n){let e=n.split(/\n( *)/),t=e[0],i=t.match(/^( *)/),r=[i?.[1]?[i[1],t.slice(i[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}function Dt(n,e,t){let{offset:i,type:s,source:r,end:o}=n,a,l,c=(u,p,g)=>t(i+u,p,g);switch(s){case"scalar":a=y.PLAIN,l=ts(r,c);break;case"single-quoted-scalar":a=y.QUOTE_SINGLE,l=ns(r,c);break;case"double-quoted-scalar":a=y.QUOTE_DOUBLE,l=is(r,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[i,i+r.length,i+r.length]}}let d=i+r.length,f=re(o,d,e,t);return{value:l,type:a,comment:f.comment,range:[i,d,f.offset]}}function ts(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),fi(n)}function ns(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),fi(n.slice(1,-1)).replace(/''/g,"'")}function fi(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
|
+
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(n);if(!i)return n;let s=i[1],r=" ",o=e.lastIndex;for(t.lastIndex=o;i=t.exec(n);)i[1]===""?r===`
|
|
87
|
+
`?s+=r:r=`
|
|
88
|
+
`:(s+=r+i[1],r=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,i=a.exec(n),s+r+(i?.[1]??"")}function is(n,e){let t="";for(let i=1;i<n.length-1;++i){let s=n[i];if(!(s==="\r"&&n[i+1]===`
|
|
89
|
+
`))if(s===`
|
|
90
|
+
`){let{fold:r,offset:o}=ss(n,i);t+=r,i=o}else if(s==="\\"){let r=n[++i],o=rs[r];if(o)t+=o;else if(r===`
|
|
91
|
+
`)for(r=n[i+1];r===" "||r===" ";)r=n[++i+1];else if(r==="\r"&&n[i+1]===`
|
|
92
|
+
`)for(r=n[++i+1];r===" "||r===" ";)r=n[++i+1];else if(r==="x"||r==="u"||r==="U"){let a=r==="x"?2:r==="u"?4:8;t+=os(n,i+1,a,e),i+=a}else{let a=n.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(s===" "||s===" "){let r=i,o=n[i+1];for(;o===" "||o===" ";)o=n[++i+1];o!==`
|
|
93
|
+
`&&!(o==="\r"&&n[i+2]===`
|
|
94
|
+
`)&&(t+=i>r?n.slice(r,i+1):s)}else t+=s}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function ss(n,e){let t="",i=n[e+1];for(;(i===" "||i===" "||i===`
|
|
95
|
+
`||i==="\r")&&!(i==="\r"&&n[e+2]!==`
|
|
96
|
+
`);)i===`
|
|
97
|
+
`&&(t+=`
|
|
98
|
+
`),e+=1,i=n[e+1];return t||(t=" "),{fold:t,offset:e}}var rs={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function os(n,e,t,i){let s=n.substr(e,t),o=s.length===t&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{let a=n.substr(e-2,t+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function pn(n,e,t,i){let{value:s,type:r,comment:o,range:a}=e.type==="block-scalar"?_t(n,e,i):Dt(e,n.options.strict,i),l=t?n.directives.tagName(t.source,f=>i(t,"TAG_RESOLVE_FAILED",f)):null,c;n.options.stringKeys&&n.atKey?c=n.schema[R]:l?c=as(n.schema,s,l,t,i):e.type==="scalar"?c=ls(n,s,e,i):c=n.schema[R];let d;try{let f=c.resolve(s,u=>i(t??e,"TAG_RESOLVE_FAILED",u),n.options);d=C(f)?f:new y(f)}catch(f){let u=f instanceof Error?f.message:String(f);i(t??e,"TAG_RESOLVE_FAILED",u),d=new y(s)}return d.range=a,d.source=s,r&&(d.type=r),l&&(d.tag=l),c.format&&(d.format=c.format),o&&(d.comment=o),d}function as(n,e,t,i,s){if(t==="!")return n[R];let r=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[R])}function ls({atKey:n,directives:e,schema:t},i,s,r){let o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(i))||t[R];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(i))??t[R];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;r(s,"TAG_RESOLVE_FAILED",d,!0)}}return o}function ui(n,e,t){if(e){t??(t=e.length);for(let i=t-1;i>=0;--i){let s=e[i];switch(s.type){case"space":case"comment":case"newline":n-=s.source.length;continue}for(s=e[++i];s?.type==="space";)n+=s.source.length,s=e[++i];break}}return n}var cs={composeNode:gn,composeEmptyNode:Bt};function gn(n,e,t,i){let s=n.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t,c,d=!0;switch(e.type){case"alias":c=fs(n,e,i),(a||l)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=pn(n,e,l,i),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=ci(cs,n,e,t,i),a&&(c.anchor=a.source.substring(1))}catch(f){let u=f instanceof Error?f.message:String(f);i(e,"RESOURCE_EXHAUSTION",u)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",f),d=!1}}return c??(c=Bt(n,e.offset,void 0,null,t,i)),a&&c.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&n.options.stringKeys&&(!C(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),n.options.keepSourceTokens&&d&&(c.srcToken=e),c}function Bt(n,e,t,i,{spaceBefore:s,comment:r,anchor:o,tag:a,end:l},c){let d={type:"scalar",offset:ui(e,t,i),indent:-1,source:""},f=pn(n,d,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function fs({options:n},{offset:e,source:t,end:i},s){let r=new te(t.substring(1));r.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&s(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=re(i,o,n.strict,s);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function mi(n,e,{offset:t,start:i,value:s,end:r},o){let a=Object.assign({_directives:e},n),l=new ie(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=se(i,{indicator:"doc-start",next:s??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=s?gn(c,s,d,o):Bt(c,d.end,i,null,d,o);let f=l.contents.range[2],u=re(r,f,!1,o);return u.comment&&(l.comment=u.comment),l.range=[t,f,u.offset],l}function tt(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function di(n){let e="",t=!1,i=!1;for(let s=0;s<n.length;++s){let r=n[s];switch(r[0]){case"#":e+=(e===""?"":i?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(r.substring(1)||" "),t=!0,i=!1;break;case"%":n[s+1]?.[0]!=="#"&&(s+=1),t=!1;break;default:t||(i=!0),t=!1}}return{comment:e,afterEmptyLine:i}}var we=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,i,s,r)=>{let o=tt(t);r?this.warnings.push(new _e(o,i,s)):this.errors.push(new j(o,i,s))},this.directives=new ee({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:i,afterEmptyLine:s}=di(this.prelude);if(i){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${i}`:i;else if(s||e.directives.docStart||!r)e.commentBefore=i;else if(T(r)&&!r.flow&&r.items.length>0){let o=r.items[0];O(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${i}
|
|
104
|
+
${a}`:i}else{let o=r.commentBefore;r.commentBefore=o?`${i}
|
|
105
|
+
${o}`:i}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:di(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,i=-1){for(let s of e)yield*this.next(s);yield*this.end(t,i)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,i,s)=>{let r=tt(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",i,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=mi(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,i=new j(tt(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new j(tt(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let t=re(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new j(tt(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 i=Object.assign({_directives:this.directives},this.options),s=new ie(void 0,i);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,t,t],this.decorate(s,!1),yield s}}};var Sn={};Ln(Sn,{BOM:()=>nt,DOCUMENT:()=>it,FLOW_END:()=>st,SCALAR:()=>De,createScalarToken:()=>pi,isCollection:()=>ds,isScalar:()=>hs,prettyToken:()=>ps,resolveAsScalar:()=>hi,setScalarValue:()=>gi,stringify:()=>bi,tokenType:()=>wn,visit:()=>ge});function hi(n,e=!0,t){if(n){let i=(s,r,o)=>{let a=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(t)t(a,r,o);else throw new j([a,a+1],r,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Dt(n,e,i);case"block-scalar":return _t({options:{strict:e}},n,i)}}return null}function pi(n,e){let{implicitKey:t=!1,indent:i,inFlow:s=!1,offset:r=-1,type:o="PLAIN"}=e,a=le({type:o,value:n},{implicitKey:t,indent:i>0?" ".repeat(i):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
107
|
+
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
108
|
+
`),d=a.substring(0,c),f=a.substring(c+1)+`
|
|
109
|
+
`,u=[{type:"block-scalar-header",offset:r,indent:i,source:d}];return yi(u,l)||u.push({type:"newline",offset:-1,indent:i,source:`
|
|
110
|
+
`}),{type:"block-scalar",offset:r,indent:i,props:u,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:i,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:i,source:a,end:l};default:return{type:"scalar",offset:r,indent:i,source:a,end:l}}}function gi(n,e,t={}){let{afterKey:i=!1,implicitKey:s=!1,inFlow:r=!1,type:o}=t,a="indent"in n?n.indent:null;if(i&&typeof a=="number"&&(a+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=n.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=le({type:o,value:e},{implicitKey:s||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":us(n,l);break;case'"':yn(n,l,"double-quoted-scalar");break;case"'":yn(n,l,"single-quoted-scalar");break;default:yn(n,l,"scalar")}}function us(n,e){let t=e.indexOf(`
|
|
111
|
+
`),i=e.substring(0,t),s=e.substring(t+1)+`
|
|
112
|
+
`;if(n.type==="block-scalar"){let r=n.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=i,n.source=s}else{let{offset:r}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:i}];yi(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
113
|
+
`});for(let l of Object.keys(n))l!=="type"&&l!=="offset"&&delete n[l];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:s})}}function yi(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function yn(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let i=n.props.slice(1),s=e.length;n.props[0].type==="block-scalar-header"&&(s-=n.props[0].source.length);for(let r of i)r.offset+=s;delete n.props,Object.assign(n,{type:t,source:e,end:i});break}case"block-map":case"block-seq":{let s={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
|
|
114
|
+
`};delete n.items,Object.assign(n,{type:t,source:e,end:[s]});break}default:{let i="indent"in n?n.indent:-1,s="end"in n&&Array.isArray(n.end)?n.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(n))r!=="type"&&r!=="offset"&&delete n[r];Object.assign(n,{type:t,indent:i,source:e,end:s})}}}var bi=n=>"type"in n?jt(n):Rt(n);function jt(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=jt(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=Rt(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=Rt(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=Rt(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function Rt({start:n,key:e,sep:t,value:i}){let s="";for(let r of n)s+=r.source;if(e&&(s+=jt(e)),t)for(let r of t)s+=r.source;return i&&(s+=jt(i)),s}var bn=Symbol("break visit"),ms=Symbol("skip children"),wi=Symbol("remove item");function ge(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),Si(Object.freeze([]),n,e)}ge.BREAK=bn;ge.SKIP=ms;ge.REMOVE=wi;ge.itemAtPath=(n,e)=>{let t=n;for(let[i,s]of e){let r=t?.[i];if(r&&"items"in r)t=r.items[s];else return}return t};ge.parentCollection=(n,e)=>{let t=ge.itemAtPath(n,e.slice(0,-1)),i=e[e.length-1][0],s=t?.[i];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function Si(n,e,t){let i=t(e,n);if(typeof i=="symbol")return i;for(let s of["key","value"]){let r=e[s];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=Si(Object.freeze(n.concat([[s,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===bn)return bn;a===wi&&(r.items.splice(o,1),o-=1)}}typeof i=="function"&&s==="key"&&(i=i(e,n))}}return typeof i=="function"?i(e,n):i}var nt="\uFEFF",it="",st="",De="",ds=n=>!!n&&"items"in n,hs=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function ps(n){switch(n){case nt:return"<BOM>";case it:return"<DOC>";case st:return"<FLOW_END>";case De:return"<SCALAR>";default:return JSON.stringify(n)}}function wn(n){switch(n){case nt:return"byte-order-mark";case it:return"doc-mode";case st:return"flow-error-end";case De:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
115
|
+
`:case`\r
|
|
116
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function H(n){switch(n){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case" ":return!0;default:return!1}}var ki=new Set("0123456789ABCDEFabcdef"),gs=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Kt=new Set(",[]{}"),ys=new Set(` ,[]{}
|
|
118
|
+
\r `),kn=n=>!n||ys.has(n),Be=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let i=this.next??"stream";for(;i&&(t||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
119
|
+
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
120
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let i=0;for(;t===" ";)t=this.buffer[++i+e];if(t==="\r"){let s=this.buffer[i+e+1];if(s===`
|
|
121
|
+
`||!s&&!this.atEnd)return e+i+1}return t===`
|
|
122
|
+
`||i>=this.indentNext||!t&&!this.atEnd?e+i:-1}if(t==="-"||t==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&H(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
123
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===nt&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,i=e.indexOf("#");for(;i!==-1;){let r=e[i-1];if(r===" "||r===" "){t=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let s=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield it,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&H(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!H(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&H(t)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(kn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,i=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=i=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let s=this.getLine();if(s===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&s[0]!=="#"||i===0&&(s.startsWith("---")||s.startsWith("..."))&&H(s[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield st,yield*this.parseLineStart();let r=0;for(;s[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),s[r]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(kn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||H(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}let i=this.buffer.substring(0,t),s=i.indexOf(`
|
|
124
|
+
`,this.pos);if(s!==-1){for(;s!==-1;){let r=this.continueScalar(s+1);if(r===-1)break;s=i.indexOf(`
|
|
125
|
+
`,r)}s!==-1&&(t=s-(i[s-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>H(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,i;e:for(let r=this.pos;i=this.buffer[r];++r)switch(i){case" ":t+=1;break;case`
|
|
126
|
+
`:e=r,t=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
127
|
+
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
|
|
128
|
+
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(i=this.buffer[s];i===" ";)i=this.buffer[++s];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
129
|
+
`;)i=this.buffer[++s];e=s-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
|
|
130
|
+
`&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield De,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,i=this.pos-1,s;for(;s=this.buffer[++i];)if(s===":"){let r=this.buffer[i+1];if(H(r)||e&&Kt.has(r))break;t=i}else if(H(s)){let r=this.buffer[i+1];if(s==="\r"&&(r===`
|
|
131
|
+
`?(i+=1,s=`
|
|
132
|
+
`,r=this.buffer[i+1]):t=i),r==="#"||e&&Kt.has(r))break;if(s===`
|
|
133
|
+
`){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&Kt.has(s))break;t=i}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield De,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(kn),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,i=this.charAt(1);if(H(i)||t&&Kt.has(i)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!H(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(gs.has(t))t=this.buffer[++e];else if(t==="%"&&ki.has(this.buffer[e+1])&&ki.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
134
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
135
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,i;do i=this.buffer[++t];while(i===" "||e&&i===" ");let s=t-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=t),s}*pushUntil(e){let t=this.pos,i=this.buffer[t];for(;!e(i);)i=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};var Re=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,i=this.lineStarts.length;for(;t<i;){let r=t+i>>1;this.lineStarts[r]<e?t=r+1:i=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let s=this.lineStarts[t-1];return{line:t,col:e-s+1}}}};function ye(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Mi(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Ai(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function qt(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function je(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function Vt(n,e){if(e.length<1e5)Array.prototype.push.apply(n,e);else for(let t=0;t<e.length;++t)n.push(e[t])}function Ni(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!ye(e.start,"explicit-key-ind")&&!ye(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Ai(e.value)?e.value.end?Vt(e.value.end,e.sep):e.value.end=e.sep:Vt(e.start,e.sep),delete e.sep)}var Se=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 Be,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,t))yield*this.next(i);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=wn(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.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)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let i=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in i?i.indent:0:t.type==="flow-collection"&&i.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Ni(t),i.type){case"document":i.value=t;break;case"block-scalar":i.props.push(t);break;case"block-map":{let s=i.items[i.items.length-1];if(s.value){i.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=t;else{Object.assign(s,{key:t,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=i.items[i.items.length-1];s.value?i.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{let s=i.items[i.items.length-1];!s||s.value?i.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((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let s=t.items[t.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Mi(s.start)===-1&&(t.indent===0||s.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(i.type==="document"?i.end=s.start:i.items.push({start:s.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Mi(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=qt(this.peek(2)),i=je(t),s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
136
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
137
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Vt(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,s=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(s&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):s||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ye(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Ai(t.key)&&!ye(t.sep,"newline")){let o=je(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(ye(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=je(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:r,key:null,sep:[this.sourceToken]}):ye(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);s||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ye(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:r});this.stack.push(o);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 i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Vt(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||ye(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let 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 i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let s=qt(i),r=je(s);Ni(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
138
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
139
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=qt(e),i=je(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=qt(e),i=je(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function Ci(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Re||null,prettyErrors:e}}function Oi(n,e={}){let{lineCounter:t,prettyErrors:i}=Ci(e),s=new Se(t?.addNewLine),r=new we(e),o=Array.from(r.compose(s.parse(n)));if(i&&t)for(let a of o)a.errors.forEach(Ze(n,t)),a.warnings.forEach(Ze(n,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function Mn(n,e={}){let{lineCounter:t,prettyErrors:i}=Ci(e),s=new Se(t?.addNewLine),r=new we(e),o=null;for(let a of r.compose(s.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new j(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(o.errors.forEach(Ze(n,t)),o.warnings.forEach(Ze(n,t))),o}function Ei(n,e,t){let i;typeof e=="function"?i=e:t===void 0&&e&&typeof e=="object"&&(t=e);let s=Mn(n,t);if(!s)return null;if(s.warnings.forEach(r=>yt(s.options.logLevel,r)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:i},t))}function Ti(n,e,t){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let s=Math.round(t);t=s<1?void 0:s>8?{indent:8}:{indent:s}}if(n===void 0){let{keepUndefined:s}=t??e??{};if(!s)return}return q(n)&&!i?n.toString(t):new ie(n,i,t).toString(t)}var An=Nn;var Cn=/^\uFEFF?\s*---\s*\r?\n([\s\S]*?)\r?\n\s*---\s*(?:\r?\n|$)/,Wt=/^[^\S\r\n]*%%\{\s*(?:init|initialize)\s*:\s*([\s\S]*?)\}\s*%%[^\S\r\n]*(?:\r?\n|$)?/gm,Li=/^\s*%%(?!\{)\s*(.*)\r?$/;function bs(n){let e=[],t=new RegExp(Wt.source,"gm"),i;for(;(i=t.exec(n))!==null;)e.push({raw:i[0],parsed:Ke(Pi((i[1]??"").trim())??{})});return e}function ws(n,e={}){let t=ks(n,$i(e)),i=Fn(t.body.split(/\r?\n/)),s=Ss(n,i.accessibility),r=i.familyLines.join(`
|
|
140
|
+
`),o=Fi(r);return{originalText:n,text:t.lines.join(`
|
|
141
|
+
`),body:t.body,lines:t.lines,familyBody:r,familyText:o.join(`
|
|
142
|
+
`),familyLines:o,firstLine:t.lines[0]?.toLowerCase()??"",config:xi(t.frontmatter),frontmatter:t.frontmatter,...s.wrapperSource!==void 0?{wrapperSource:s.wrapperSource}:{},initDirectives:s.initDirectives,comments:s.comments,accessibility:s.accessibility}}function pf(n,e={}){let t=ws(n);if(Object.keys(e).length===0)return t;let i=rt(t.frontmatter,$i(e));return{...t,frontmatter:i,config:xi(i)}}function Ss(n,e){let i=n.match(Cn)?.[0].length??(n.startsWith("\uFEFF")?1:0),s=bs(n.slice(i)),r=n.replace(Cn,"").replace(new RegExp(Wt.source,"gm"),""),o=[],a=r.split(/\r?\n/);for(let d=0;d<a.length;d++){let f=In(a,d);if(f===void 0)break;if(f!==null){d=f.endIndex;continue}let p=a[d].match(Li);p&&o.push({text:p[1],line:d+1})}let l=i,c=new RegExp(Wt.source);for(;;){let d=n.slice(l);if(d.length===0)break;let f=d.match(c);if(f?.index===0&&f[0].length>0){l+=f[0].length;continue}let u=d.indexOf(`
|
|
143
|
+
`),p=u===-1?d:d.slice(0,u);if(/^\s*$/.test(p)||Li.test(p)){l+=u===-1?d.length:u+1;continue}break}return{...l>0?{wrapperSource:n.slice(0,l)}:{},initDirectives:s,comments:o,accessibility:e}}function ks(n,e={}){let t=n.match(Cn),i=t?Ke(As(t[1])):{},s=t?n.slice(t[0].length):n,{body:r,frontmatter:o}=Cs(s),a=rt(rt(Ke(e),i),Ke(o));return{body:r,lines:Fi(r),frontmatter:a}}function Fi(n){return n.replace(/^\uFEFF/,"").split(/\r?\n/).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith("%%"))}function rt(n,e){return vi(n,e)}function vi(n,e){let t=ke(n);for(let[i,s]of Object.entries(e)){if(s===void 0)continue;let r=t[i];if(X(r)&&X(s)){t[i]=vi(r,s);continue}t[i]=On(s)}return t}function gf(n,e){let t=n;for(let i of e){if(!X(t))return;t=t[i]}return X(t)?t:void 0}function yf(n,e){let t=n;for(let i of e){if(!X(t))return;t=t[i]}return t!==void 0&&!Array.isArray(t)&&(typeof t!="object"||t===null)?t:void 0}function bf(n,e){let t=n;for(let i of e){if(!X(t))return;t=t[i]}return Array.isArray(t)?t:void 0}function $i(n){return Ne(n,"Mermaid runtime configuration"),Ke(Jt(n)??{})}function xi(n){let e=ke(n);return X(e.themeVariables)&&(e.themeVariables=ke(e.themeVariables)),X(e.timeline)&&(e.timeline=Ms(e.timeline)),X(e.journey)&&(e.journey=Ns(e.journey)),e}function Ms(n){let e=ke(n);typeof e.disableMulticolor!="boolean"&&delete e.disableMulticolor;let t=Ut(e.sectionFills);t.length>0?e.sectionFills=t:delete e.sectionFills;let i=Ut(e.sectionColours),s=Ut(e.sectionColors);return i.length>0?e.sectionColours=i:s.length>0?e.sectionColours=s:delete e.sectionColours,delete e.sectionColors,e}function Ns(n){let e=ke(n);for(let s of["diagramMarginX","diagramMarginY","leftMargin","maxLabelWidth","width","height","boxMargin","boxTextMargin","noteMargin","messageMargin","bottomMarginAdj","taskMargin","activationWidth"]){let r=e[s];(typeof r!="number"||!Number.isFinite(r)||r<0)&&delete e[s]}typeof e.useMaxWidth!="boolean"&&delete e.useMaxWidth,typeof e.rightAngles!="boolean"&&delete e.rightAngles,e.messageAlign!=="left"&&e.messageAlign!=="center"&&e.messageAlign!=="right"&&delete e.messageAlign;let t=Ii(e.taskFontSize);t!==void 0?e.taskFontSize=t:delete e.taskFontSize;for(let s of["taskFontFamily","textPlacement","titleColor","titleFontFamily"])(typeof e[s]!="string"||e[s].trim().length===0)&&delete e[s];let i=Ii(e.titleFontSize);i!==void 0?e.titleFontSize=i:delete e.titleFontSize;for(let s of["actorColours","sectionFills","sectionColours"]){let r=Ut(e[s]);r.length>0?e[s]=r:delete e[s]}return e}function Ii(n){if(typeof n=="number"&&Number.isFinite(n)&&n>0)return n;if(typeof n=="string"&&n.trim().length>0)return n.trim()}function Ut(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"):[]}function Ke(n){Ne(n,"Mermaid configuration");let e=ke(n),t=X(e.config)?e.config:void 0;return delete e.config,t?rt(t,e):e}function As(n){zt(n,"Mermaid frontmatter");try{let e=An.parse(n);return Ne(e,"Mermaid frontmatter"),Jt(e)??{}}catch(e){if(e instanceof Yt)throw e;return{}}}function Cs(n){let e={};return{body:n.replace(new RegExp(Wt.source,"gm"),(i,s)=>{let r=Pi(s);return r&&(e=rt(e,Ke(r))),""}),frontmatter:e}}function Pi(n){zt(n,"Mermaid init directive",{trackFlowDepth:!0});try{let e=An.parse(n);return Ne(e,"Mermaid init directive"),Jt(e)}catch(e){if(e instanceof Yt)throw e;let t=Ts(n);return t!==void 0&&Ne(t,"Mermaid init directive"),t}}function Jt(n){if(!Os(n))return;let e={};for(let[t,i]of Object.entries(n)){let s=_i(i);s!==void 0&&(e[t]=s)}return e}function _i(n){if(n===null)return null;if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")return n;if(Array.isArray(n)){let e=[];for(let t of n){let i=_i(t);if(i===void 0)return;e.push(i)}return e}return Jt(n)}function ke(n){let e={};for(let[t,i]of Object.entries(n))e[t]=On(i);return e}function On(n){return n==null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"?n:Array.isArray(n)?n.map(e=>On(e)):ke(n)}function X(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Os(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Es(n){return n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'")?Bi(n):n==="true"?!0:n==="false"?!1:n==="null"?null:/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(n)?Number(n):n}function Ts(n){let e=En(n.trim());return X(e)?e:void 0}function En(n){let e=n.trim();if(e.length!==0)return e.startsWith("{")&&e.endsWith("}")?Ls(e.slice(1,-1)):e.startsWith("[")&&e.endsWith("]")?Is(e.slice(1,-1)):Es(e)}function Ls(n){let e={};for(let t of Di(n)){let i=vs(t,":");if(i===-1)return;let s=t.slice(0,i).trim(),r=t.slice(i+1).trim(),o=Fs(s);if(!o)return;let a=En(r);if(a===void 0)return;e[o]=a}return e}function Is(n){let e=[];for(let t of Di(n)){let i=En(t);if(i===void 0)return;e.push(i)}return e}function Fs(n){let e=n.trim();if(e)return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?Bi(e):e}function Di(n){let e=[],t="",i=null,s=0,r=0;for(let a=0;a<n.length;a++){let l=n[a];if(i){t+=l,l===i&&n[a-1]!=="\\"&&(i=null);continue}if(l==='"'||l==="'"){i=l,t+=l;continue}if(l==="{"){s++,t+=l;continue}if(l==="}"){s--,t+=l;continue}if(l==="["){r++,t+=l;continue}if(l==="]"){r--,t+=l;continue}if(l===","&&s===0&&r===0){let c=t.trim();c&&e.push(c),t="";continue}t+=l}let o=t.trim();return o&&e.push(o),e}function vs(n,e){let t=null,i=0,s=0;for(let r=0;r<n.length;r++){let o=n[r];if(t){o===t&&n[r-1]!=="\\"&&(t=null);continue}if(o==='"'||o==="'"){t=o;continue}if(o==="{"){i++;continue}if(o==="}"){i--;continue}if(o==="["){s++;continue}if(o==="]"){s--;continue}if(o===e&&i===0&&s===0)return r}return-1}function Bi(n){try{return n.startsWith("'")?n.slice(1,-1).replace(/\\\\/g,"\\").replace(/\\'/g,"'"):JSON.parse(n)}catch{return n.slice(1,-1)}}export{ws as a,pf as b,gf as c,yf as d,bf as e};
|