house-lights 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/cli.mjs +3 -2
- package/package.json +4 -3
- package/skills/cast-list/assets/VERSION +2 -0
- package/skills/cast-list/assets/lesson.html +182 -0
- package/skills/cast-list/assets/map.html +244 -0
- package/skills/cast-list/examples/LICENSE-microsoft-skills-for-copilot-studio +21 -0
- package/skills/cast-list/examples/NOTICE.md +27 -0
- package/skills/cast-list/examples/agents/bodega-cupons/actions/ConsultarCuponsAtivos.mcs.yml +34 -0
- package/skills/cast-list/examples/agents/bodega-cupons/actions/EnviarCupomEmail.mcs.yml +34 -0
- package/skills/cast-list/examples/agents/bodega-cupons/actions/PromocoesMCP.mcs.yml +20 -0
- package/skills/cast-list/examples/agents/bodega-cupons/agent.mcs.yml +27 -0
- package/skills/cast-list/examples/agents/bodega-cupons/connectionreferences.mcs.yml +17 -0
- package/skills/cast-list/examples/agents/bodega-cupons/knowledge/RegulamentoCupons.knowledge.mcs.yml +7 -0
- package/skills/cast-list/examples/agents/bodega-cupons/settings.mcs.yml +13 -0
- package/skills/cast-list/examples/agents/bodega-cupons/topics/ConsultarRegulamentoCupons.topic.mcs.yml +56 -0
- package/skills/cast-list/examples/agents/bodega-cupons/topics/Escalate.topic.mcs.yml +20 -0
- package/skills/cast-list/examples/agents/bodega-cupons/topics/Fallback.topic.mcs.yml +32 -0
- package/skills/cast-list/examples/agents/bodega-cupons/topics/Greeting.topic.mcs.yml +14 -0
- package/skills/cast-list/examples/agents/bodega-cupons/topics/OnError.topic.mcs.yml +48 -0
- package/skills/cast-list/examples/agents/bodega-cupons/topics/RecebimentoOrquestrador.topic.mcs.yml +16 -0
- package/skills/cast-list/examples/agents/bodega-cupons/variables/CategoriaSolicitacao.mcs.yml +10 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/actions/AbrirSolicitacaoDevolucao.mcs.yml +32 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/agent.mcs.yml +26 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/connectionreferences.mcs.yml +6 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/knowledge/PoliticaTrocasDevolucoes.knowledge.mcs.yml +7 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/settings.mcs.yml +13 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/ConsultarPoliticaDevolucoes.topic.mcs.yml +56 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Escalate.topic.mcs.yml +20 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Fallback.topic.mcs.yml +32 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Greeting.topic.mcs.yml +14 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/OnError.topic.mcs.yml +48 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/topics/RecebimentoOrquestrador.topic.mcs.yml +16 -0
- package/skills/cast-list/examples/agents/bodega-devolucoes/variables/CategoriaSolicitacao.mcs.yml +10 -0
- package/skills/cast-list/examples/agents/bodega-frete/actions/EnviarOpcoesFrete.mcs.yml +34 -0
- package/skills/cast-list/examples/agents/bodega-frete/agent.mcs.yml +26 -0
- package/skills/cast-list/examples/agents/bodega-frete/connectionreferences.mcs.yml +6 -0
- package/skills/cast-list/examples/agents/bodega-frete/knowledge/TabelaFreteEntregas.knowledge.mcs.yml +7 -0
- package/skills/cast-list/examples/agents/bodega-frete/settings.mcs.yml +13 -0
- package/skills/cast-list/examples/agents/bodega-frete/topics/ConsultarTabelaFrete.topic.mcs.yml +56 -0
- package/skills/cast-list/examples/agents/bodega-frete/topics/Fallback.topic.mcs.yml +31 -0
- package/skills/cast-list/examples/agents/bodega-frete/topics/Greeting.topic.mcs.yml +14 -0
- package/skills/cast-list/examples/agents/bodega-frete/topics/OnError.topic.mcs.yml +48 -0
- package/skills/cast-list/examples/agents/bodega-frete/topics/RecebimentoOrquestrador.topic.mcs.yml +16 -0
- package/skills/cast-list/examples/agents/bodega-frete/variables/CategoriaSolicitacao.mcs.yml +10 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/actions/EnviarInstrucoesRetirada.mcs.yml +34 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/agent.mcs.yml +27 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/connectionreferences.mcs.yml +6 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/knowledge/GuiaLojaFisica.knowledge.mcs.yml +8 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/settings.mcs.yml +13 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/ConsultarGuiaLojaFisica.topic.mcs.yml +56 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Escalate.topic.mcs.yml +20 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Fallback.topic.mcs.yml +32 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Greeting.topic.mcs.yml +14 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/OnError.topic.mcs.yml +43 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/RecebimentoOrquestrador.topic.mcs.yml +16 -0
- package/skills/cast-list/examples/agents/bodega-loja-fisica/variables/CategoriaSolicitacao.mcs.yml +10 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/actions/AgenteCupons.mcs.yml +24 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/actions/AgenteDevolucoes.mcs.yml +24 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/actions/AgenteFrete.mcs.yml +24 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/actions/AgenteLojaFisica.mcs.yml +24 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/actions/AgentePedidos.mcs.yml +24 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/agent.mcs.yml +35 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/agents/SobreBodegaAzul/agent.mcs.yml +32 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/settings.mcs.yml +12 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/topics/ClassificarSolicitacao.topic.mcs.yml +35 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/topics/Escalate.topic.mcs.yml +20 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/topics/Fallback.topic.mcs.yml +32 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/topics/Greeting.topic.mcs.yml +14 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/topics/OnError.topic.mcs.yml +48 -0
- package/skills/cast-list/examples/agents/bodega-orquestrador/variables/CategoriaSolicitacao.mcs.yml +9 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/actions/EnviarResumoPedido.mcs.yml +34 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/agent.mcs.yml +26 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/connectionreferences.mcs.yml +6 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/knowledge/PoliticasPedidos.knowledge.mcs.yml +7 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/settings.mcs.yml +13 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/topics/ConsultarPoliticasPedidos.topic.mcs.yml +56 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/topics/Escalate.topic.mcs.yml +20 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/topics/Fallback.topic.mcs.yml +32 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/topics/Greeting.topic.mcs.yml +14 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/topics/OnError.topic.mcs.yml +48 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/topics/RecebimentoOrquestrador.topic.mcs.yml +16 -0
- package/skills/cast-list/examples/agents/bodega-pedidos/variables/CategoriaSolicitacao.mcs.yml +10 -0
- package/skills/cast-list/examples/demo.cast.yaml +10 -0
- package/skills/cast-list/examples/profile.cast.yaml +15 -0
- package/skills/cast-list/references/format.md +50 -0
- package/skills/cast-list/references/keys.md +107 -0
- package/skills/cast-list/references/profile.md +32 -0
- package/skills/cast-list/scripts/browser.mjs +198 -0
- package/skills/cast-list/scripts/build.mjs +179 -0
- package/skills/cast-list/scripts/engine.mjs +155 -0
- package/skills/cast-list/scripts/page.mjs +15 -0
- package/skills/cast-list/scripts/read-xlsx.mjs +67 -0
- package/skills/cast-list/vendor/microsoft/LICENSE +21 -0
- package/skills/cast-list/vendor/microsoft/NOTICE +9 -0
- package/skills/cast-list/vendor/microsoft/package.json +1 -0
- package/skills/cast-list/vendor/microsoft/reference/bot.schema.yaml-authoring.json +27605 -0
- package/skills/cast-list/vendor/microsoft/scripts/schema-lookup.bundle.js +3495 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// GENERATED by tools/assets.mjs (way engine v0.259.0). Do not edit.
|
|
2
|
+
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
3
|
+
var gl=Object.create;var Ur=Object.defineProperty;var yl=Object.getOwnPropertyDescriptor;var bl=Object.getOwnPropertyNames;var wl=Object.getPrototypeOf,kl=Object.prototype.hasOwnProperty;var xt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var O=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Sl=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of bl(e))!kl.call(t,r)&&r!==n&&Ur(t,r,{get:()=>e[r],enumerable:!(s=yl(e,r))||s.enumerable});return t};var Wn=(t,e,n)=>(n=t!=null?gl(wl(t)):{},Sl(e||!t||!t.__esModule?Ur(n,"default",{value:t,enumerable:!0}):n,t));var M=O(U=>{"use strict";var Xn=Symbol.for("yaml.alias"),Jr=Symbol.for("yaml.document"),Mt=Symbol.for("yaml.map"),Wr=Symbol.for("yaml.pair"),Hn=Symbol.for("yaml.scalar"),It=Symbol.for("yaml.seq"),le=Symbol.for("yaml.node.type"),El=t=>!!t&&typeof t=="object"&&t[le]===Xn,Cl=t=>!!t&&typeof t=="object"&&t[le]===Jr,ql=t=>!!t&&typeof t=="object"&&t[le]===Mt,Tl=t=>!!t&&typeof t=="object"&&t[le]===Wr,Gr=t=>!!t&&typeof t=="object"&&t[le]===Hn,Pl=t=>!!t&&typeof t=="object"&&t[le]===It;function Xr(t){if(t&&typeof t=="object")switch(t[le]){case Mt:case It:return!0}return!1}function Ll(t){if(t&&typeof t=="object")switch(t[le]){case Xn:case Mt:case Hn:case It:return!0}return!1}var xl=t=>(Gr(t)||Xr(t))&&!!t.anchor;U.ALIAS=Xn;U.DOC=Jr;U.MAP=Mt;U.NODE_TYPE=le;U.PAIR=Wr;U.SCALAR=Hn;U.SEQ=It;U.hasAnchor=xl;U.isAlias=El;U.isCollection=Xr;U.isDocument=Cl;U.isMap=ql;U.isNode=Ll;U.isPair=Tl;U.isScalar=Gr;U.isSeq=Pl});var Ye=O(Qn=>{"use strict";var K=M(),X=Symbol("break visit"),Hr=Symbol("skip children"),ie=Symbol("remove node");function Dt(t,e){let n=Qr(e);K.isDocument(t)?qe(null,t.contents,n,Object.freeze([t]))===ie&&(t.contents=null):qe(null,t,n,Object.freeze([]))}Dt.BREAK=X;Dt.SKIP=Hr;Dt.REMOVE=ie;function qe(t,e,n,s){let r=Zr(t,e,n,s);if(K.isNode(r)||K.isPair(r))return ei(t,s,r),qe(t,r,n,s);if(typeof r!="symbol"){if(K.isCollection(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let o=qe(i,e.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===X)return X;o===ie&&(e.items.splice(i,1),i-=1)}}}else if(K.isPair(e)){s=Object.freeze(s.concat(e));let i=qe("key",e.key,n,s);if(i===X)return X;i===ie&&(e.key=null);let o=qe("value",e.value,n,s);if(o===X)return X;o===ie&&(e.value=null)}}return r}async function Rt(t,e){let n=Qr(e);K.isDocument(t)?await Te(null,t.contents,n,Object.freeze([t]))===ie&&(t.contents=null):await Te(null,t,n,Object.freeze([]))}Rt.BREAK=X;Rt.SKIP=Hr;Rt.REMOVE=ie;async function Te(t,e,n,s){let r=await Zr(t,e,n,s);if(K.isNode(r)||K.isPair(r))return ei(t,s,r),Te(t,r,n,s);if(typeof r!="symbol"){if(K.isCollection(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let o=await Te(i,e.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===X)return X;o===ie&&(e.items.splice(i,1),i-=1)}}}else if(K.isPair(e)){s=Object.freeze(s.concat(e));let i=await Te("key",e.key,n,s);if(i===X)return X;i===ie&&(e.key=null);let o=await Te("value",e.value,n,s);if(o===X)return X;o===ie&&(e.value=null)}}return r}function Qr(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Zr(t,e,n,s){if(typeof n=="function")return n(t,e,s);if(K.isMap(e))return n.Map?.(t,e,s);if(K.isSeq(e))return n.Seq?.(t,e,s);if(K.isPair(e))return n.Pair?.(t,e,s);if(K.isScalar(e))return n.Scalar?.(t,e,s);if(K.isAlias(e))return n.Alias?.(t,e,s)}function ei(t,e,n){let s=e[e.length-1];if(K.isCollection(s))s.items[t]=n;else if(K.isPair(s))t==="key"?s.key=n:s.value=n;else if(K.isDocument(s))s.contents=n;else{let r=K.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}Qn.visit=Dt;Qn.visitAsync=Rt});var Zn=O(ni=>{"use strict";var ti=M(),Ml=Ye(),Il={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Dl=t=>t.replace(/[!,[\]{}]/g,e=>Il[e]),ze=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[i,o]=s;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,s,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(o){return n(String(o)),null}return s==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,s]of Object.entries(this.tags))if(e.startsWith(s))return n+Dl(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),r;if(e&&s.length>0&&ti.isNode(e.contents)){let i={};Ml.visit(e.contents,(o,a)=>{ti.isNode(a)&&a.tag&&(i[a.tag]=!0)}),r=Object.keys(i)}else r=[];for(let[i,o]of s)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
|
|
4
|
+
`)}};ze.defaultYaml={explicit:!1,version:"1.2"};ze.defaultTags={"!!":"tag:yaml.org,2002:"};ni.Directives=ze});var _t=O(Ve=>{"use strict";var si=M(),Rl=Ye();function _l(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function ri(t){let e=new Set;return Rl.visit(t,{Value(n,s){s.anchor&&e.add(s.anchor)}}),e}function ii(t,e){for(let n=1;;++n){let s=`${t}${n}`;if(!e.has(s))return s}}function Fl(t,e){let n=[],s=new Map,r=null;return{onAnchor:i=>{n.push(i),r??(r=ri(t));let o=ii(e,r);return r.add(o),o},setAnchors:()=>{for(let i of n){let o=s.get(i);if(typeof o=="object"&&o.anchor&&(si.isScalar(o.node)||si.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:s}}Ve.anchorIsValid=_l;Ve.anchorNames=ri;Ve.createNodeAnchors=Fl;Ve.findNewAnchor=ii});var es=O(oi=>{"use strict";function Je(t,e,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){let o=s[r],a=Je(t,s,String(r),o);a===void 0?delete s[r]:a!==o&&(s[r]=a)}else if(s instanceof Map)for(let r of Array.from(s.keys())){let i=s.get(r),o=Je(t,s,r,i);o===void 0?s.delete(r):o!==i&&s.set(r,o)}else if(s instanceof Set)for(let r of Array.from(s)){let i=Je(t,s,r,r);i===void 0?s.delete(r):i!==r&&(s.delete(r),s.add(i))}else for(let[r,i]of Object.entries(s)){let o=Je(t,s,r,i);o===void 0?delete s[r]:o!==i&&(s[r]=o)}return t.call(e,n,s)}oi.applyReviver=Je});var fe=O(li=>{"use strict";var jl=M();function ai(t,e,n){if(Array.isArray(t))return t.map((s,r)=>ai(s,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!jl.hasAnchor(t))return t.toJSON(e,n);let s={aliasCount:0,count:1,res:void 0};n.anchors.set(t,s),n.onCreate=i=>{s.res=i,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}li.toJS=ai});var Ft=O(fi=>{"use strict";var Bl=es(),ci=M(),Kl=fe(),ts=class{constructor(e){Object.defineProperty(this,ci.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:s,onAnchor:r,reviver:i}={}){if(!ci.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=Kl.toJS(this,"",o);if(typeof r=="function")for(let{count:l,res:c}of o.anchors.values())r(c,l);return typeof i=="function"?Bl.applyReviver(i,{"":a},"",a):a}};fi.NodeBase=ts});var We=O(ui=>{"use strict";var Ul=_t(),Yl=Ye(),Pe=M(),zl=Ft(),Vl=fe(),ns=class extends zl.NodeBase{constructor(e){super(Pe.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;n?.aliasResolveCache?s=n.aliasResolveCache:(s=[],Yl.visit(e,{Node:(i,o)=>{(Pe.isAlias(o)||Pe.hasAnchor(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let r;for(let i of s){if(i===this)break;i.anchor===this.source&&(r=i)}if(r&&n){let{anchors:i,doc:o,maxAliasCount:a}=n,l=i.get(r);if(l||(Vl.toJS(r,null,n),l=i.get(r)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=jt(o,r,i)),l.count*l.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return r}toJSON(e,n){if(!n)return{source:this.source};let s=this.resolve(n.doc,n);if(!s){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(r)}return n.anchors.get(s).res}toString(e,n,s){let r=`*${this.source}`;if(e){if(Ul.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${r} `}return r}};function jt(t,e,n){if(Pe.isAlias(e)){let s=e.resolve(t),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(Pe.isCollection(e)){let s=0;for(let r of e.items){let i=jt(t,r,n);i>s&&(s=i)}return s}else if(Pe.isPair(e)){let s=jt(t,e.key,n),r=jt(t,e.value,n);return Math.max(s,r)}return 1}ui.Alias=ns});var j=O(ss=>{"use strict";var Jl=M(),Wl=Ft(),Gl=fe(),Xl=t=>!t||typeof t!="function"&&typeof t!="object",ue=class extends Wl.NodeBase{constructor(e){super(Jl.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:Gl.toJS(this.value,e,n)}toString(){return String(this.value)}};ue.BLOCK_FOLDED="BLOCK_FOLDED";ue.BLOCK_LITERAL="BLOCK_LITERAL";ue.PLAIN="PLAIN";ue.QUOTE_DOUBLE="QUOTE_DOUBLE";ue.QUOTE_SINGLE="QUOTE_SINGLE";ss.Scalar=ue;ss.isScalarValue=Xl});var Ge=O(pi=>{"use strict";var Hl=We(),Se=M(),di=j(),Ql="tag:yaml.org,2002:";function Zl(t,e,n){if(e){let s=n.filter(i=>i.tag===e),r=s.find(i=>!i.format)??s[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(s=>s.identify?.(t)&&!s.format)}function ec(t,e,n){if(Se.isDocument(t)&&(t=t.contents),Se.isNode(t))return t;if(Se.isPair(t)){let u=n.schema[Se.MAP].createNode?.(n.schema,null,n);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:s,onAnchor:r,onTagObj:i,schema:o,sourceObjects:a}=n,l;if(s&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=r(t)),new Hl.Alias(l.anchor);l={anchor:null,node:null},a.set(t,l)}e?.startsWith("!!")&&(e=Ql+e.slice(2));let c=Zl(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new di.Scalar(t);return l&&(l.node=u),u}c=t instanceof Map?o[Se.MAP]:Symbol.iterator in Object(t)?o[Se.SEQ]:o[Se.MAP]}i&&(i(c),delete n.onTagObj);let p=c?.createNode?c.createNode(n.schema,t,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,t,n):new di.Scalar(t);return e?p.tag=e:c.default||(p.tag=c.tag),l&&(l.node=p),p}pi.createNode=ec});var Kt=O(Bt=>{"use strict";var tc=Ge(),oe=M(),nc=Ft();function rs(t,e,n){let s=n;for(let r=e.length-1;r>=0;--r){let i=e[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=s,s=o}else s=new Map([[i,s]])}return tc.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var hi=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,is=class extends nc.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(s=>oe.isNode(s)||oe.isPair(s)?s.clone(e):s),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(hi(e))this.add(n);else{let[s,...r]=e,i=this.get(s,!0);if(oe.isCollection(i))i.addIn(r,n);else if(i===void 0&&this.schema)this.set(s,rs(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(e){let[n,...s]=e;if(s.length===0)return this.delete(n);let r=this.get(n,!0);if(oe.isCollection(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(e,n){let[s,...r]=e,i=this.get(s,!0);return r.length===0?!n&&oe.isScalar(i)?i.value:i:oe.isCollection(i)?i.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!oe.isPair(n))return!1;let s=n.value;return s==null||e&&oe.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[n,...s]=e;if(s.length===0)return this.has(n);let r=this.get(n,!0);return oe.isCollection(r)?r.hasIn(s):!1}setIn(e,n){let[s,...r]=e;if(r.length===0)this.set(s,n);else{let i=this.get(s,!0);if(oe.isCollection(i))i.setIn(r,n);else if(i===void 0&&this.schema)this.set(s,rs(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}};Bt.Collection=is;Bt.collectionFromPath=rs;Bt.isEmptyPath=hi});var Xe=O(Ut=>{"use strict";var sc=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function os(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var rc=(t,e,n)=>t.endsWith(`
|
|
5
|
+
`)?os(n,e):n.includes(`
|
|
6
|
+
`)?`
|
|
7
|
+
`+os(n,e):(t.endsWith(" ")?"":" ")+n;Ut.indentComment=os;Ut.lineComment=rc;Ut.stringifyComment=sc});var gi=O(He=>{"use strict";var ic="flow",as="block",Yt="quoted";function oc(t,e,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return t;r<i&&(i=0);let l=Math.max(1+i,1+r-e.length);if(t.length<=l)return t;let c=[],p={},u=r-e.length;typeof s=="number"&&(s>r-Math.max(2,i)?c.push(0):u=r-s);let f,m,d=!1,h=-1,g=-1,k=-1;n===as&&(h=mi(t,h,e.length),h!==-1&&(u=h+l));for(let E;E=t[h+=1];){if(n===Yt&&E==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}k=h}if(E===`
|
|
8
|
+
`)n===as&&(h=mi(t,h,e.length)),u=h+e.length+l,f=void 0;else{if(E===" "&&m&&m!==" "&&m!==`
|
|
9
|
+
`&&m!==" "){let y=t[h+1];y&&y!==" "&&y!==`
|
|
10
|
+
`&&y!==" "&&(f=h)}if(h>=u)if(f)c.push(f),u=f+l,f=void 0;else if(n===Yt){for(;m===" "||m===" ";)m=E,E=t[h+=1],d=!0;let y=h>k+1?h-2:g-1;if(p[y])return t;c.push(y),p[y]=!0,u=y+l,f=void 0}else d=!0}m=E}if(d&&a&&a(),c.length===0)return t;o&&o();let $=t.slice(0,c[0]);for(let E=0;E<c.length;++E){let y=c[E],S=c[E+1]||t.length;y===0?$=`
|
|
11
|
+
${e}${t.slice(0,S)}`:(n===Yt&&p[y]&&($+=`${t[y]}\\`),$+=`
|
|
12
|
+
${e}${t.slice(y+1,S)}`)}return $}function mi(t,e,n){let s=e,r=e+1,i=t[r];for(;i===" "||i===" ";)if(e<r+n)i=t[++e];else{do i=t[++e];while(i&&i!==`
|
|
13
|
+
`);s=e,r=e+1,i=t[r]}return s}He.FOLD_BLOCK=as;He.FOLD_FLOW=ic;He.FOLD_QUOTED=Yt;He.foldFlowLines=oc});var Ze=O(yi=>{"use strict";var ne=j(),de=gi(),Vt=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Jt=t=>/^(%|---|\.\.\.)/m.test(t);function ac(t,e,n){if(!e||e<0)return!1;let s=e-n,r=t.length;if(r<=s)return!1;for(let i=0,o=0;i<r;++i)if(t[i]===`
|
|
14
|
+
`){if(i-o>s)return!0;if(o=i+1,r-o<=s)return!1}return!0}function Qe(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:s}=e,r=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Jt(t)?" ":""),o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);let p=n.substr(l+2,4);switch(p){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:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||n[l+2]==='"'||n.length<r)l+=1;else{for(o+=n.slice(a,l)+`
|
|
15
|
+
|
|
16
|
+
`;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)o+=`
|
|
17
|
+
`,l+=2;o+=i,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,s?o:de.foldFlowLines(o,i,de.FOLD_QUOTED,Vt(e,!1))}function ls(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
18
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return Qe(t,e);let n=e.indent||(Jt(t)?" ":""),s="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
+
${n}`)+"'";return e.implicitKey?s:de.foldFlowLines(s,n,de.FOLD_FLOW,Vt(e,!1))}function Le(t,e){let{singleQuote:n}=e.options,s;if(n===!1)s=Qe;else{let r=t.includes('"'),i=t.includes("'");r&&!i?s=ls:i&&!r?s=Qe:s=n?ls:Qe}return s(t,e)}var cs;try{cs=new RegExp(`(^|(?<!
|
|
20
|
+
))
|
|
21
|
+
+(?!
|
|
22
|
+
|$)`,"g")}catch{cs=/\n+(?!\n|$)/g}function zt({comment:t,type:e,value:n},s,r,i){let{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(n))return Le(n,s);let c=s.indent||(s.forceBlockIndent||Jt(n)?" ":""),p=o==="literal"?!0:o==="folded"||e===ne.Scalar.BLOCK_FOLDED?!1:e===ne.Scalar.BLOCK_LITERAL?!0:!ac(n,l,c.length);if(!n)return p?`|
|
|
23
|
+
`:`>
|
|
24
|
+
`;let u,f;for(f=n.length;f>0;--f){let S=n[f-1];if(S!==`
|
|
25
|
+
`&&S!==" "&&S!==" ")break}let m=n.substring(f),d=m.indexOf(`
|
|
26
|
+
`);d===-1?u="-":n===m||d!==m.length-1?(u="+",i&&i()):u="",m&&(n=n.slice(0,-m.length),m[m.length-1]===`
|
|
27
|
+
`&&(m=m.slice(0,-1)),m=m.replace(cs,`$&${c}`));let h=!1,g,k=-1;for(g=0;g<n.length;++g){let S=n[g];if(S===" ")h=!0;else if(S===`
|
|
28
|
+
`)k=g;else break}let $=n.substring(0,k<g?k+1:g);$&&(n=n.substring($.length),$=$.replace(/\n+/g,`$&${c}`));let y=(h?c?"2":"1":"")+u;if(t&&(y+=" "+a(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!p){let S=n.replace(/\n+/g,`
|
|
29
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,T=Vt(s,!0);o!=="folded"&&e!==ne.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{A=!0});let N=de.foldFlowLines(`${$}${S}${m}`,c,de.FOLD_BLOCK,T);if(!A)return`>${y}
|
|
30
|
+
${c}${N}`}return n=n.replace(/\n+/g,`$&${c}`),`|${y}
|
|
31
|
+
${c}${$}${n}${m}`}function lc(t,e,n,s){let{type:r,value:i}=t,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:p}=e;if(a&&i.includes(`
|
|
32
|
+
`)||p&&/[[\]{},]/.test(i))return Le(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||p||!i.includes(`
|
|
33
|
+
`)?Le(i,e):zt(t,e,n,s);if(!a&&!p&&r!==ne.Scalar.PLAIN&&i.includes(`
|
|
34
|
+
`))return zt(t,e,n,s);if(Jt(i)){if(l==="")return e.forceBlockIndent=!0,zt(t,e,n,s);if(a&&l===c)return Le(i,e)}let u=i.replace(/\n+/g,`$&
|
|
35
|
+
${l}`);if(o){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(u),{compat:m,tags:d}=e.doc.schema;if(d.some(f)||m?.some(f))return Le(i,e)}return a?u:de.foldFlowLines(u,l,de.FOLD_FLOW,Vt(e,!1))}function cc(t,e,n,s){let{implicitKey:r,inFlow:i}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==ne.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ne.Scalar.QUOTE_DOUBLE);let l=p=>{switch(p){case ne.Scalar.BLOCK_FOLDED:case ne.Scalar.BLOCK_LITERAL:return r||i?Le(o.value,e):zt(o,e,n,s);case ne.Scalar.QUOTE_DOUBLE:return Qe(o.value,e);case ne.Scalar.QUOTE_SINGLE:return ls(o.value,e);case ne.Scalar.PLAIN:return lc(o,e,n,s);default:return null}},c=l(a);if(c===null){let{defaultKeyType:p,defaultStringType:u}=e.options,f=r&&p||u;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}yi.stringifyString=cc});var et=O(fs=>{"use strict";var fc=_t(),pe=M(),uc=Xe(),dc=Ze();function pc(t,e){let n=Object.assign({blockQuote:!0,commentString:uc.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function hc(t,e){if(e.tag){let r=t.filter(i=>i.tag===e.tag);if(r.length>0)return r.find(i=>i.format===e.format)??r[0]}let n,s;if(pe.isScalar(e)){s=e.value;let r=t.filter(i=>i.identify?.(s));if(r.length>1){let i=r.filter(o=>o.test);i.length>0&&(r=i)}n=r.find(i=>i.format===e.format)??r.find(i=>!i.format)}else s=e,n=t.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){let r=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return n}function mc(t,e,{anchors:n,doc:s}){if(!s.directives)return"";let r=[],i=(pe.isScalar(t)||pe.isCollection(t))&&t.anchor;i&&fc.anchorIsValid(i)&&(n.add(i),r.push(`&${i}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function gc(t,e,n,s){if(pe.isPair(t))return t.toString(e,n,s);if(pe.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,i=pe.isNode(t)?t:e.doc.createNode(t,{onTagObj:l=>r=l});r??(r=hc(e.doc.schema.tags,i));let o=mc(i,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(i,e,n,s):pe.isScalar(i)?dc.stringifyString(i,e,n,s):i.toString(e,n,s);return o?pe.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
36
|
+
${e.indent}${a}`:a}fs.createStringifyContext=pc;fs.stringify=gc});var Si=O(ki=>{"use strict";var ce=M(),bi=j(),wi=et(),tt=Xe();function yc({key:t,value:e},n,s,r){let{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:p,simpleKeys:u}}=n,f=ce.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(ce.isCollection(t)||!ce.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let m=!u&&(!t||f&&e==null&&!n.inFlow||ce.isCollection(t)||(ce.isScalar(t)?t.type===bi.Scalar.BLOCK_FOLDED||t.type===bi.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(u||!i),indent:a+l});let d=!1,h=!1,g=wi.stringify(t,n,()=>d=!0,()=>h=!0);if(!m&&!n.inFlow&&g.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(i||e==null)return d&&s&&s(),g===""?"?":m?`? ${g}`:g}else if(i&&!u||e==null&&m)return g=`? ${g}`,f&&!d?g+=tt.lineComment(g,n.indent,c(f)):h&&r&&r(),g;d&&(f=null),m?(f&&(g+=tt.lineComment(g,n.indent,c(f))),g=`? ${g}
|
|
37
|
+
${a}:`):(g=`${g}:`,f&&(g+=tt.lineComment(g,n.indent,c(f))));let k,$,E;ce.isNode(e)?(k=!!e.spaceBefore,$=e.commentBefore,E=e.comment):(k=!1,$=null,E=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!m&&!f&&ce.isScalar(e)&&(n.indentAtStart=g.length+1),h=!1,!p&&l.length>=2&&!n.inFlow&&!m&&ce.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let y=!1,S=wi.stringify(e,n,()=>y=!0,()=>h=!0),A=" ";if(f||k||$){if(A=k?`
|
|
38
|
+
`:"",$){let T=c($);A+=`
|
|
39
|
+
${tt.indentComment(T,n.indent)}`}S===""&&!n.inFlow?A===`
|
|
40
|
+
`&&E&&(A=`
|
|
41
|
+
|
|
42
|
+
`):A+=`
|
|
43
|
+
${n.indent}`}else if(!m&&ce.isCollection(e)){let T=S[0],N=S.indexOf(`
|
|
44
|
+
`),w=N!==-1,L=n.inFlow??e.flow??e.items.length===0;if(w||!L){let v=!1;if(w&&(T==="&"||T==="!")){let q=S.indexOf(" ");T==="&"&&q!==-1&&q<N&&S[q+1]==="!"&&(q=S.indexOf(" ",q+1)),(q===-1||N<q)&&(v=!0)}v||(A=`
|
|
45
|
+
${n.indent}`)}}else(S===""||S[0]===`
|
|
46
|
+
`)&&(A="");return g+=A+S,n.inFlow?y&&s&&s():E&&!y?g+=tt.lineComment(g,n.indent,c(E)):h&&r&&r(),g}ki.stringifyPair=yc});var ds=O(us=>{"use strict";var vi=xt("process");function bc(t,...e){t==="debug"&&console.log(...e)}function wc(t,e){(t==="debug"||t==="warn")&&(typeof vi.emitWarning=="function"?vi.emitWarning(e):console.warn(e))}us.debug=bc;us.warn=wc});var Qt=O(Ht=>{"use strict";var Xt=M(),$i=j(),Wt="<<",Gt={identify:t=>t===Wt||typeof t=="symbol"&&t.description===Wt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new $i.Scalar(Symbol(Wt)),{addToJSMap:Ai}),stringify:()=>Wt},kc=(t,e)=>(Gt.identify(e)||Xt.isScalar(e)&&(!e.type||e.type===$i.Scalar.PLAIN)&&Gt.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Gt.tag&&n.default);function Ai(t,e,n){let s=Oi(t,n);if(Xt.isSeq(s))for(let r of s.items)ps(t,e,r);else if(Array.isArray(s))for(let r of s)ps(t,e,r);else ps(t,e,s)}function ps(t,e,n){let s=Oi(t,n);if(!Xt.isMap(s))throw new Error("Merge sources must be maps or map aliases");let r=s.toJSON(null,t,Map);for(let[i,o]of r)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Oi(t,e){return t&&Xt.isAlias(e)?e.resolve(t.doc,t):e}Ht.addMergeToJSMap=Ai;Ht.isMergeKey=kc;Ht.merge=Gt});var ms=O(Ci=>{"use strict";var Sc=ds(),Ni=Qt(),vc=et(),Ei=M(),hs=fe();function $c(t,e,{key:n,value:s}){if(Ei.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,s);else if(Ni.isMergeKey(t,n))Ni.addMergeToJSMap(t,e,s);else{let r=hs.toJS(n,"",t);if(e instanceof Map)e.set(r,hs.toJS(s,r,t));else if(e instanceof Set)e.add(r);else{let i=Ac(n,r,t),o=hs.toJS(s,i,t);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function Ac(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Ei.isNode(t)&&n?.doc){let s=vc.createStringifyContext(n.doc,{});s.anchors=new Set;for(let i of n.anchors.keys())s.anchors.add(i.anchor);s.inFlow=!0,s.inStringifyKey=!0;let r=t.toString(s);if(!n.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),Sc.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}Ci.addPairToJSMap=$c});var he=O(gs=>{"use strict";var qi=Ge(),Oc=Si(),Nc=ms(),Zt=M();function Ec(t,e,n){let s=qi.createNode(t,void 0,n),r=qi.createNode(e,void 0,n);return new en(s,r)}var en=class t{constructor(e,n=null){Object.defineProperty(this,Zt.NODE_TYPE,{value:Zt.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:s}=this;return Zt.isNode(n)&&(n=n.clone(e)),Zt.isNode(s)&&(s=s.clone(e)),new t(n,s)}toJSON(e,n){let s=n?.mapAsMap?new Map:{};return Nc.addPairToJSMap(n,s,this)}toString(e,n,s){return e?.doc?Oc.stringifyPair(this,e,n,s):JSON.stringify(this)}};gs.Pair=en;gs.createPair=Ec});var ys=O(Pi=>{"use strict";var ve=M(),Ti=et(),tn=Xe();function Cc(t,e,n){return(e.inFlow??t.flow?Tc:qc)(t,e,n)}function qc({comment:t,items:e},n,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=n,p=Object.assign({},n,{indent:i,type:null}),u=!1,f=[];for(let d=0;d<e.length;++d){let h=e[d],g=null;if(ve.isNode(h))!u&&h.spaceBefore&&f.push(""),nn(n,f,h.commentBefore,u),h.comment&&(g=h.comment);else if(ve.isPair(h)){let $=ve.isNode(h.key)?h.key:null;$&&(!u&&$.spaceBefore&&f.push(""),nn(n,f,$.commentBefore,u))}u=!1;let k=Ti.stringify(h,p,()=>g=null,()=>u=!0);g&&(k+=tn.lineComment(k,i,c(g))),u&&g&&(u=!1),f.push(s+k)}let m;if(f.length===0)m=r.start+r.end;else{m=f[0];for(let d=1;d<f.length;++d){let h=f[d];m+=h?`
|
|
47
|
+
${l}${h}`:`
|
|
48
|
+
`}}return t?(m+=`
|
|
49
|
+
`+tn.indentComment(c(t),l),a&&a()):u&&o&&o(),m}function Tc({items:t},e,{flowChars:n,itemIndent:s}){let{indent:r,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;s+=i;let l=Object.assign({},e,{indent:s,inFlow:!0,type:null}),c=!1,p=0,u=[];for(let d=0;d<t.length;++d){let h=t[d],g=null;if(ve.isNode(h))h.spaceBefore&&u.push(""),nn(e,u,h.commentBefore,!1),h.comment&&(g=h.comment);else if(ve.isPair(h)){let $=ve.isNode(h.key)?h.key:null;$&&($.spaceBefore&&u.push(""),nn(e,u,$.commentBefore,!1),$.comment&&(c=!0));let E=ve.isNode(h.value)?h.value:null;E?(E.comment&&(g=E.comment),E.commentBefore&&(c=!0)):h.value==null&&$?.comment&&(g=$.comment)}g&&(c=!0);let k=Ti.stringify(h,l,()=>g=null);c||(c=u.length>p||k.includes(`
|
|
50
|
+
`)),d<t.length-1?k+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=u.reduce(($,E)=>$+E.length+2,2)+(k.length+2)>e.options.lineWidth)),c&&(k+=",")),g&&(k+=tn.lineComment(k,s,a(g))),u.push(k),p=u.length}let{start:f,end:m}=n;if(u.length===0)return f+m;if(!c){let d=u.reduce((h,g)=>h+g.length+2,2);c=e.options.lineWidth>0&&d>e.options.lineWidth}if(c){let d=f;for(let h of u)d+=h?`
|
|
51
|
+
${i}${r}${h}`:`
|
|
52
|
+
`;return`${d}
|
|
53
|
+
${r}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}function nn({indent:t,options:{commentString:e}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){let i=tn.indentComment(e(s),t);n.push(i.trimStart())}}Pi.stringifyCollection=Cc});var ge=O(ws=>{"use strict";var Pc=ys(),Lc=ms(),xc=Kt(),me=M(),sn=he(),Mc=j();function nt(t,e){let n=me.isScalar(e)?e.value:e;for(let s of t)if(me.isPair(s)&&(s.key===e||s.key===n||me.isScalar(s.key)&&s.key.value===n))return s}var bs=class extends xc.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(me.MAP,e),this.items=[]}static from(e,n,s){let{keepUndefined:r,replacer:i}=s,o=new this(e),a=(l,c)=>{if(typeof i=="function")c=i.call(n,l,c);else if(Array.isArray(i)&&!i.includes(l))return;(c!==void 0||r)&&o.items.push(sn.createPair(l,c,s))};if(n instanceof Map)for(let[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(let l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let s;me.isPair(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new sn.Pair(e,e?.value):s=new sn.Pair(e.key,e.value);let r=nt(this.items,s.key),i=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);me.isScalar(r.value)&&Mc.isScalarValue(s.value)?r.value.value=s.value:r.value=s.value}else if(i){let o=this.items.findIndex(a=>i(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){let n=nt(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=nt(this.items,e)?.value;return(!n&&me.isScalar(r)?r.value:r)??void 0}has(e){return!!nt(this.items,e)}set(e,n){this.add(new sn.Pair(e,n),!0)}toJSON(e,n,s){let r=s?new s:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let i of this.items)Lc.addPairToJSMap(n,r,i);return r}toString(e,n,s){if(!e)return JSON.stringify(this);for(let r of this.items)if(!me.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Pc.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:n})}};ws.YAMLMap=bs;ws.findPair=nt});var xe=O(xi=>{"use strict";var Ic=M(),Li=ge(),Dc={collection:"map",default:!0,nodeClass:Li.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Ic.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Li.YAMLMap.from(t,e,n)};xi.map=Dc});var ye=O(Mi=>{"use strict";var Rc=Ge(),_c=ys(),Fc=Kt(),on=M(),jc=j(),Bc=fe(),ks=class extends Fc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(on.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=rn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let s=rn(e);if(typeof s!="number")return;let r=this.items[s];return!n&&on.isScalar(r)?r.value:r}has(e){let n=rn(e);return typeof n=="number"&&n<this.items.length}set(e,n){let s=rn(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[s];on.isScalar(r)&&jc.isScalarValue(n)?r.value=n:this.items[s]=n}toJSON(e,n){let s=[];n?.onCreate&&n.onCreate(s);let r=0;for(let i of this.items)s.push(Bc.toJS(i,String(r++),n));return s}toString(e,n,s){return e?_c.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(e,n,s){let{replacer:r}=s,i=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof r=="function"){let l=n instanceof Set?a:String(o++);a=r.call(n,l,a)}i.items.push(Rc.createNode(a,void 0,s))}}return i}};function rn(t){let e=on.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Mi.YAMLSeq=ks});var Me=O(Di=>{"use strict";var Kc=M(),Ii=ye(),Uc={collection:"seq",default:!0,nodeClass:Ii.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Kc.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Ii.YAMLSeq.from(t,e,n)};Di.seq=Uc});var st=O(Ri=>{"use strict";var Yc=Ze(),zc={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,s){return e=Object.assign({actualString:!0},e),Yc.stringifyString(t,e,n,s)}};Ri.string=zc});var an=O(ji=>{"use strict";var _i=j(),Fi={identify:t=>t==null,createNode:()=>new _i.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _i.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Fi.test.test(t)?t:e.options.nullStr};ji.nullTag=Fi});var Ss=O(Ki=>{"use strict";var Vc=j(),Bi={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Vc.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&Bi.test.test(t)){let s=t[0]==="t"||t[0]==="T";if(e===s)return t}return e?n.options.trueStr:n.options.falseStr}};Ki.boolTag=Bi});var Ie=O(Ui=>{"use strict";function Jc({format:t,minFractionDigits:e,tag:n,value:s}){if(typeof s=="bigint")return String(s);let r=typeof s=="number"?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=Object.is(s,-0)?"-0":JSON.stringify(s);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}Ui.stringifyNumber=Jc});var $s=O(ln=>{"use strict";var Wc=j(),vs=Ie(),Gc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:vs.stringifyNumber},Xc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():vs.stringifyNumber(t)}},Hc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Wc.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:vs.stringifyNumber};ln.float=Hc;ln.floatExp=Xc;ln.floatNaN=Gc});var Os=O(fn=>{"use strict";var Yi=Ie(),cn=t=>typeof t=="bigint"||Number.isInteger(t),As=(t,e,n,{intAsBigInt:s})=>s?BigInt(t):parseInt(t.substring(e),n);function zi(t,e,n){let{value:s}=t;return cn(s)&&s>=0?n+s.toString(e):Yi.stringifyNumber(t)}var Qc={identify:t=>cn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>As(t,2,8,n),stringify:t=>zi(t,8,"0o")},Zc={identify:cn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>As(t,0,10,n),stringify:Yi.stringifyNumber},ef={identify:t=>cn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>As(t,2,16,n),stringify:t=>zi(t,16,"0x")};fn.int=Zc;fn.intHex=ef;fn.intOct=Qc});var Ji=O(Vi=>{"use strict";var tf=xe(),nf=an(),sf=Me(),rf=st(),of=Ss(),Ns=$s(),Es=Os(),af=[tf.map,sf.seq,rf.string,nf.nullTag,of.boolTag,Es.intOct,Es.int,Es.intHex,Ns.floatNaN,Ns.floatExp,Ns.float];Vi.schema=af});var Xi=O(Gi=>{"use strict";var lf=j(),cf=xe(),ff=Me();function Wi(t){return typeof t=="bigint"||Number.isInteger(t)}var un=({value:t})=>JSON.stringify(t),uf=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:un},{identify:t=>t==null,createNode:()=>new lf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:un},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:un},{identify:Wi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Wi(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:un}],df={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},pf=[cf.map,ff.seq].concat(uf,df);Gi.schema=pf});var qs=O(Hi=>{"use strict";var rt=xt("buffer"),Cs=j(),hf=Ze(),mf={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof rt.Buffer=="function")return rt.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let r=0;r<n.length;++r)s[r]=n.charCodeAt(r);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},s,r,i){if(!n)return"";let o=n,a;if(typeof rt.Buffer=="function")a=o instanceof rt.Buffer?o.toString("base64"):rt.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Cs.Scalar.BLOCK_LITERAL),e!==Cs.Scalar.QUOTE_DOUBLE){let l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(a.length/l),p=new Array(c);for(let u=0,f=0;u<c;++u,f+=l)p[u]=a.substr(f,l);a=p.join(e===Cs.Scalar.BLOCK_LITERAL?`
|
|
54
|
+
`:" ")}return hf.stringifyString({comment:t,type:e,value:a},s,r,i)}};Hi.binary=mf});var hn=O(pn=>{"use strict";var dn=M(),Ts=he(),gf=j(),yf=ye();function Qi(t,e){if(dn.isSeq(t))for(let n=0;n<t.items.length;++n){let s=t.items[n];if(!dn.isPair(s)){if(dn.isMap(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");let r=s.items[0]||new Ts.Pair(new gf.Scalar(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
|
|
55
|
+
${r.key.commentBefore}`:s.commentBefore),s.comment){let i=r.value??r.key;i.comment=i.comment?`${s.comment}
|
|
56
|
+
${i.comment}`:s.comment}s=r}t.items[n]=dn.isPair(s)?s:new Ts.Pair(s)}}else e("Expected a sequence for this tag");return t}function Zi(t,e,n){let{replacer:s}=n,r=new yf.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(i++),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;r.items.push(Ts.createPair(a,l,n))}return r}var bf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Qi,createNode:Zi};pn.createPairs=Zi;pn.pairs=bf;pn.resolvePairs=Qi});var xs=O(Ls=>{"use strict";var eo=M(),Ps=fe(),it=ge(),wf=ye(),to=hn(),$e=class t extends wf.YAMLSeq{constructor(){super(),this.add=it.YAMLMap.prototype.add.bind(this),this.delete=it.YAMLMap.prototype.delete.bind(this),this.get=it.YAMLMap.prototype.get.bind(this),this.has=it.YAMLMap.prototype.has.bind(this),this.set=it.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let s=new Map;n?.onCreate&&n.onCreate(s);for(let r of this.items){let i,o;if(eo.isPair(r)?(i=Ps.toJS(r.key,"",n),o=Ps.toJS(r.value,i,n)):i=Ps.toJS(r,"",n),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o)}return s}static from(e,n,s){let r=to.createPairs(e,n,s),i=new this;return i.items=r.items,i}};$e.tag="tag:yaml.org,2002:omap";var kf={collection:"seq",identify:t=>t instanceof Map,nodeClass:$e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=to.resolvePairs(t,e),s=[];for(let{key:r}of n.items)eo.isScalar(r)&&(s.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new $e,n)},createNode:(t,e,n)=>$e.from(t,e,n)};Ls.YAMLOMap=$e;Ls.omap=kf});var oo=O(Ms=>{"use strict";var no=j();function so({value:t,source:e},n){return e&&(t?ro:io).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var ro={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new no.Scalar(!0),stringify:so},io={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new no.Scalar(!1),stringify:so};Ms.falseTag=io;Ms.trueTag=ro});var ao=O(mn=>{"use strict";var Sf=j(),Is=Ie(),vf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Is.stringifyNumber},$f={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Is.stringifyNumber(t)}},Af={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Sf.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let s=t.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:Is.stringifyNumber};mn.float=Af;mn.floatExp=$f;mn.floatNaN=vf});var co=O(at=>{"use strict";var lo=Ie(),ot=t=>typeof t=="bigint"||Number.isInteger(t);function gn(t,e,n,{intAsBigInt:s}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),s){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let i=parseInt(t,n);return r==="-"?-1*i:i}function Ds(t,e,n){let{value:s}=t;if(ot(s)){let r=s.toString(e);return s<0?"-"+n+r.substr(1):n+r}return lo.stringifyNumber(t)}var Of={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>gn(t,2,2,n),stringify:t=>Ds(t,2,"0b")},Nf={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>gn(t,1,8,n),stringify:t=>Ds(t,8,"0")},Ef={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>gn(t,0,10,n),stringify:lo.stringifyNumber},Cf={identify:ot,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>gn(t,2,16,n),stringify:t=>Ds(t,16,"0x")};at.int=Ef;at.intBin=Of;at.intHex=Cf;at.intOct=Nf});var _s=O(Rs=>{"use strict";var wn=M(),yn=he(),bn=ge(),Ae=class t extends bn.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;wn.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new yn.Pair(e.key,null):n=new yn.Pair(e,null),bn.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let s=bn.findPair(this.items,e);return!n&&wn.isPair(s)?wn.isScalar(s.key)?s.key.value:s.key:s}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let s=bn.findPair(this.items,e);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new yn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(e,n,s){let{replacer:r}=s,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),i.items.push(yn.createPair(o,null,s));return i}};Ae.tag="tag:yaml.org,2002:set";var qf={collection:"map",identify:t=>t instanceof Set,nodeClass:Ae,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ae.from(t,e,n),resolve(t,e){if(wn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ae,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Rs.YAMLSet=Ae;Rs.set=qf});var js=O(kn=>{"use strict";var Tf=Ie();function Fs(t,e){let n=t[0],s=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),i=s.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return n==="-"?r(-1)*i:i}function fo(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Tf.stringifyNumber(t);let s="";e<0&&(s="-",e*=n(-1));let r=n(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),s+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Pf={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Fs(t,n),stringify:fo},Lf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Fs(t,!1),stringify:fo},uo={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(uo.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,s,r,i,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,s-1,r,i||0,o||0,a||0,l),p=e[8];if(p&&p!=="Z"){let u=Fs(p,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};kn.floatTime=Lf;kn.intTime=Pf;kn.timestamp=uo});var mo=O(ho=>{"use strict";var xf=xe(),Mf=an(),If=Me(),Df=st(),Rf=qs(),po=oo(),Bs=ao(),Sn=co(),_f=Qt(),Ff=xs(),jf=hn(),Bf=_s(),Ks=js(),Kf=[xf.map,If.seq,Df.string,Mf.nullTag,po.trueTag,po.falseTag,Sn.intBin,Sn.intOct,Sn.int,Sn.intHex,Bs.floatNaN,Bs.floatExp,Bs.float,Rf.binary,_f.merge,Ff.omap,jf.pairs,Bf.set,Ks.intTime,Ks.floatTime,Ks.timestamp];ho.schema=Kf});var Oo=O(zs=>{"use strict";var wo=xe(),Uf=an(),ko=Me(),Yf=st(),zf=Ss(),Us=$s(),Ys=Os(),Vf=Ji(),Jf=Xi(),So=qs(),lt=Qt(),vo=xs(),$o=hn(),go=mo(),Ao=_s(),vn=js(),yo=new Map([["core",Vf.schema],["failsafe",[wo.map,ko.seq,Yf.string]],["json",Jf.schema],["yaml11",go.schema],["yaml-1.1",go.schema]]),bo={binary:So.binary,bool:zf.boolTag,float:Us.float,floatExp:Us.floatExp,floatNaN:Us.floatNaN,floatTime:vn.floatTime,int:Ys.int,intHex:Ys.intHex,intOct:Ys.intOct,intTime:vn.intTime,map:wo.map,merge:lt.merge,null:Uf.nullTag,omap:vo.omap,pairs:$o.pairs,seq:ko.seq,set:Ao.set,timestamp:vn.timestamp},Wf={"tag:yaml.org,2002:binary":So.binary,"tag:yaml.org,2002:merge":lt.merge,"tag:yaml.org,2002:omap":vo.omap,"tag:yaml.org,2002:pairs":$o.pairs,"tag:yaml.org,2002:set":Ao.set,"tag:yaml.org,2002:timestamp":vn.timestamp};function Gf(t,e,n){let s=yo.get(e);if(s&&!t)return n&&!s.includes(lt.merge)?s.concat(lt.merge):s.slice();let r=s;if(!r)if(Array.isArray(t))r=[];else{let i=Array.from(yo.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(t))for(let i of t)r=r.concat(i);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(lt.merge)),r.reduce((i,o)=>{let a=typeof o=="string"?bo[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(bo).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}zs.coreKnownTags=Wf;zs.getTags=Gf});var Ws=O(No=>{"use strict";var Vs=M(),Xf=xe(),Hf=Me(),Qf=st(),$n=Oo(),Zf=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Js=class t{constructor({compat:e,customTags:n,merge:s,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?$n.getTags(e,"compat"):e?$n.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?$n.coreKnownTags:{},this.tags=$n.getTags(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,Vs.MAP,{value:Xf.map}),Object.defineProperty(this,Vs.SCALAR,{value:Qf.string}),Object.defineProperty(this,Vs.SEQ,{value:Hf.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Zf:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};No.Schema=Js});var Co=O(Eo=>{"use strict";var eu=M(),Gs=et(),ct=Xe();function tu(t,e){let n=[],s=e.directives===!0;if(e.directives!==!1&&t.directives){let l=t.directives.toString(t);l?(n.push(l),s=!0):t.directives.docStart&&(s=!0)}s&&n.push("---");let r=Gs.createStringifyContext(t,e),{commentString:i}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let l=i(t.commentBefore);n.unshift(ct.indentComment(l,""))}let o=!1,a=null;if(t.contents){if(eu.isNode(t.contents)){if(t.contents.spaceBefore&&s&&n.push(""),t.contents.commentBefore){let p=i(t.contents.commentBefore);n.push(ct.indentComment(p,""))}r.forceBlockIndent=!!t.comment,a=t.contents.comment}let l=a?void 0:()=>o=!0,c=Gs.stringify(t.contents,r,()=>a=null,l);a&&(c+=ct.lineComment(c,"",i(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Gs.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let l=i(t.comment);l.includes(`
|
|
57
|
+
`)?(n.push("..."),n.push(ct.indentComment(l,""))):n.push(`... ${l}`)}else n.push("...");else{let l=t.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(ct.indentComment(i(l),"")))}return n.join(`
|
|
58
|
+
`)+`
|
|
59
|
+
`}Eo.stringifyDocument=tu});var ft=O(qo=>{"use strict";var nu=We(),De=Kt(),Z=M(),su=he(),ru=fe(),iu=Ws(),ou=Co(),Xs=_t(),au=es(),lu=Ge(),Hs=Zn(),Qs=class t{constructor(e,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Z.NODE_TYPE,{value:Z.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:s===void 0&&n&&(s=n,n=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:o}=i;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Hs.Directives({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,r,s)}clone(){let e=Object.create(t.prototype,{[Z.NODE_TYPE]:{value:Z.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Z.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Re(this.contents)&&this.contents.add(e)}addIn(e,n){Re(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let s=Xs.anchorNames(this);e.anchor=!n||s.has(n)?Xs.findNewAnchor(n||"a",s):n}return new nu.Alias(e.anchor)}createNode(e,n,s){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let g=$=>typeof $=="number"||$ instanceof String||$ instanceof Number,k=n.filter(g).map(String);k.length>0&&(n=n.concat(k)),r=n}else s===void 0&&n&&(s=n,n=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:p}=s??{},{onAnchor:u,setAnchors:f,sourceObjects:m}=Xs.createNodeAnchors(this,o||"a"),d={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:m},h=lu.createNode(e,p,d);return a&&Z.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,n,s={}){let r=this.createNode(e,null,s),i=this.createNode(n,null,s);return new su.Pair(r,i)}delete(e){return Re(this.contents)?this.contents.delete(e):!1}deleteIn(e){return De.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Re(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Z.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return De.isEmptyPath(e)?!n&&Z.isScalar(this.contents)?this.contents.value:this.contents:Z.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Z.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return De.isEmptyPath(e)?this.contents!==void 0:Z.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=De.collectionFromPath(this.schema,[e],n):Re(this.contents)&&this.contents.set(e,n)}setIn(e,n){De.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=De.collectionFromPath(this.schema,Array.from(e),n):Re(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Hs.Directives({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Hs.Directives({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new iu.Schema(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:s,maxAliasCount:r,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=ru.toJS(this.contents,n??"",a);if(typeof i=="function")for(let{count:c,res:p}of a.anchors.values())i(p,c);return typeof o=="function"?au.applyReviver(o,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}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 n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return ou.stringifyDocument(this,e)}};function Re(t){if(Z.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}qo.Document=Qs});var pt=O(dt=>{"use strict";var ut=class extends Error{constructor(e,n,s,r){super(),this.name=e,this.code=s,this.message=r,this.pos=n}},Zs=class extends ut{constructor(e,n,s){super("YAMLParseError",e,n,s)}},er=class extends ut{constructor(e,n,s){super("YAMLWarning",e,n,s)}},cu=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let i=r-1,o=t.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),s>1&&/^ *$/.test(o.substring(0,i))){let a=t.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
60
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=n.linePos[1];l?.line===s&&l.col>r&&(a=Math.max(1,Math.min(l.col-r,80-i)));let c=" ".repeat(i)+"^".repeat(a);n.message+=`:
|
|
61
|
+
|
|
62
|
+
${o}
|
|
63
|
+
${c}
|
|
64
|
+
`}};dt.YAMLError=ut;dt.YAMLParseError=Zs;dt.YAMLWarning=er;dt.prettifyError=cu});var ht=O(To=>{"use strict";function fu(t,{flow:e,indicator:n,next:s,offset:r,onError:i,parentIndent:o,startOnNewline:a}){let l=!1,c=a,p=a,u="",f="",m=!1,d=!1,h=null,g=null,k=null,$=null,E=null,y=null,S=null;for(let N of t)switch(d&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&i(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),h&&(c&&N.type!=="comment"&&N.type!=="newline"&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),N.type){case"space":!e&&(n!=="doc-start"||s?.type!=="flow-collection")&&N.source.includes(" ")&&(h=N),p=!0;break;case"comment":{p||i(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let w=N.source.substring(1)||" ";u?u+=f+w:u=w,f="",c=!1;break}case"newline":c?u?u+=N.source:(!y||n!=="seq-item-ind")&&(l=!0):f+=N.source,c=!0,m=!0,(g||k)&&($=N),p=!0;break;case"anchor":g&&i(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&i(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=N,S??(S=N.offset),c=!1,p=!1,d=!0;break;case"tag":{k&&i(N,"MULTIPLE_TAGS","A node can have at most one tag"),k=N,S??(S=N.offset),c=!1,p=!1,d=!0;break}case n:(g||k)&&i(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),y&&i(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${e??"collection"}`),y=N,c=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(e){E&&i(N,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),E=N,c=!1,p=!1;break}default:i(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),c=!1,p=!1}let A=t[t.length-1],T=A?A.offset+A.source.length:r;return d&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:E,found:y,spaceBefore:l,comment:u,hasNewline:m,anchor:g,tag:k,newlineAfterProp:$,end:T,start:S??T}}To.resolveProps=fu});var An=O(Po=>{"use strict";function tr(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
65
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(tr(e.key)||tr(e.value))return!0}return!1;default:return!0}}Po.containsNewline=tr});var nr=O(Lo=>{"use strict";var uu=An();function du(t,e,n){if(e?.type==="flow-collection"){let s=e.end[0];s.indent===t&&(s.source==="]"||s.source==="}")&&uu.containsNewline(e)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Lo.flowIndentCheck=du});var sr=O(Mo=>{"use strict";var xo=M();function pu(t,e,n){let{uniqueKeys:s}=t.options;if(s===!1)return!1;let r=typeof s=="function"?s:(i,o)=>i===o||xo.isScalar(i)&&xo.isScalar(o)&&i.value===o.value;return e.some(i=>r(i.key,n))}Mo.mapIncludes=pu});var jo=O(Fo=>{"use strict";var Io=he(),hu=ge(),Do=ht(),mu=An(),Ro=nr(),gu=sr(),_o="All mapping items must start at the same column";function yu({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=i?.nodeClass??hu.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=s.offset,c=null;for(let p of s.items){let{start:u,key:f,sep:m,value:d}=p,h=Do.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==s.indent&&r(l,"BAD_INDENT",_o)),!h.anchor&&!h.tag&&!m){c=h.end,h.comment&&(a.comment?a.comment+=`
|
|
66
|
+
`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||mu.containsNewline(f))&&r(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==s.indent&&r(l,"BAD_INDENT",_o);n.atKey=!0;let k=h.end,$=f?t(n,f,h,r):e(n,k,u,null,h,r);n.schema.compat&&Ro.flowIndentCheck(s.indent,f,r),n.atKey=!1,gu.mapIncludes(n,a.items,$)&&r(k,"DUPLICATE_KEY","Map keys must be unique");let E=Do.resolveProps(m??[],{indicator:"map-value-ind",next:d,offset:$.range[2],onError:r,parentIndent:s.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=E.end,E.found){g&&(d?.type==="block-map"&&!E.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&h.start<E.found.offset-1024&&r($.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let y=d?t(n,d,E,r):e(n,l,m,null,E,r);n.schema.compat&&Ro.flowIndentCheck(s.indent,d,r),l=y.range[2];let S=new Io.Pair($,y);n.options.keepSourceTokens&&(S.srcToken=p),a.items.push(S)}else{g&&r($.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),E.comment&&($.comment?$.comment+=`
|
|
67
|
+
`+E.comment:$.comment=E.comment);let y=new Io.Pair($);n.options.keepSourceTokens&&(y.srcToken=p),a.items.push(y)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,c??l],a}Fo.resolveBlockMap=yu});var Ko=O(Bo=>{"use strict";var bu=ye(),wu=ht(),ku=nr();function Su({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=i?.nodeClass??bu.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=s.offset,c=null;for(let{start:p,value:u}of s.items){let f=wu.resolveProps(p,{indicator:"seq-item-ind",next:u,offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}let m=u?t(n,u,f,r):e(n,f.end,p,null,f,r);n.schema.compat&&ku.flowIndentCheck(s.indent,u,r),l=m.range[2],a.items.push(m)}return a.range=[s.offset,l,c??l],a}Bo.resolveBlockSeq=Su});var _e=O(Uo=>{"use strict";function vu(t,e,n,s){let r="";if(t){let i=!1,o="";for(let a of t){let{source:l,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{n&&!i&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=l.substring(1)||" ";r?r+=o+p:r=p,o="";break}case"newline":r&&(o+=l),i=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:r,offset:e}}Uo.resolveEnd=vu});var Jo=O(Vo=>{"use strict";var $u=M(),Au=he(),Yo=ge(),Ou=ye(),Nu=_e(),zo=ht(),Eu=An(),Cu=sr(),rr="Block collections are not allowed within flow collections",ir=t=>t&&(t.type==="block-map"||t.type==="block-seq");function qu({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=s.start.source==="{",a=o?"flow map":"flow sequence",l=i?.nodeClass??(o?Yo.YAMLMap:Ou.YAMLSeq),c=new l(n.schema);c.flow=!0;let p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){let k=s.items[g],{start:$,key:E,sep:y,value:S}=k,A=zo.resolveProps($,{flow:a,indicator:"explicit-key-ind",next:E??y?.[0],offset:u,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!y&&!S){g===0&&A.comma?r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<s.items.length-1&&r(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),A.comment&&(c.comment?c.comment+=`
|
|
68
|
+
`+A.comment:c.comment=A.comment),u=A.end;continue}!o&&n.options.strict&&Eu.containsNewline(E)&&r(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)A.comma&&r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(A.comma||r(A.start,"MISSING_CHAR",`Missing , between ${a} items`),A.comment){let T="";e:for(let N of $)switch(N.type){case"comma":case"space":break;case"comment":T=N.source.substring(1);break e;default:break e}if(T){let N=c.items[c.items.length-1];$u.isPair(N)&&(N=N.value??N.key),N.comment?N.comment+=`
|
|
69
|
+
`+T:N.comment=T,A.comment=A.comment.substring(T.length+1)}}if(!o&&!y&&!A.found){let T=S?t(n,S,A,r):e(n,A.end,y,null,A,r);c.items.push(T),u=T.range[2],ir(S)&&r(T.range,"BLOCK_IN_FLOW",rr)}else{n.atKey=!0;let T=A.end,N=E?t(n,E,A,r):e(n,T,$,null,A,r);ir(E)&&r(N.range,"BLOCK_IN_FLOW",rr),n.atKey=!1;let w=zo.resolveProps(y??[],{flow:a,indicator:"map-value-ind",next:S,offset:N.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(w.found){if(!o&&!A.found&&n.options.strict){if(y)for(let q of y){if(q===w.found)break;if(q.type==="newline"){r(q,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<w.found.offset-1024&&r(w.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source?.[0]===":"?r(S,"MISSING_CHAR",`Missing space after : in ${a}`):r(w.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let L=S?t(n,S,w,r):w.found?e(n,w.end,y,null,w,r):null;L?ir(S)&&r(L.range,"BLOCK_IN_FLOW",rr):w.comment&&(N.comment?N.comment+=`
|
|
70
|
+
`+w.comment:N.comment=w.comment);let v=new Au.Pair(N,L);if(n.options.keepSourceTokens&&(v.srcToken=k),o){let q=c;Cu.mapIncludes(n,q.items,N)&&r(T,"DUPLICATE_KEY","Map keys must be unique"),q.items.push(v)}else{let q=new Yo.YAMLMap(n.schema);q.flow=!0,q.items.push(v);let D=(L??N).range;q.range=[N.range[0],D[1],D[2]],c.items.push(q)}u=L?L.range[2]:w.end}}let f=o?"}":"]",[m,...d]=s.end,h=u;if(m?.source===f)h=m.offset+m.source.length;else{let g=a[0].toUpperCase()+a.substring(1),k=p?`${g} must end with a ${f}`:`${g} in block collection must be sufficiently indented and end with a ${f}`;r(u,p?"MISSING_CHAR":"BAD_INDENT",k),m&&m.source.length!==1&&d.unshift(m)}if(d.length>0){let g=Nu.resolveEnd(d,h,n.options.strict,r);g.comment&&(c.comment?c.comment+=`
|
|
71
|
+
`+g.comment:c.comment=g.comment),c.range=[s.offset,h,g.offset]}else c.range=[s.offset,h,h];return c}Vo.resolveFlowCollection=qu});var Go=O(Wo=>{"use strict";var Tu=M(),Pu=j(),Lu=ge(),xu=ye(),Mu=jo(),Iu=Ko(),Du=Jo();function or(t,e,n,s,r,i){let o=n.type==="block-map"?Mu.resolveBlockMap(t,e,n,s,i):n.type==="block-seq"?Iu.resolveBlockSeq(t,e,n,s,i):Du.resolveFlowCollection(t,e,n,s,i),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function Ru(t,e,n,s,r){let i=s.tag,o=i?e.directives.tagName(i.source,f=>r(i,"TAG_RESOLVE_FAILED",f)):null;if(n.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=s,d=f&&i?f.offset>i.offset?f:i:f??i;d&&(!m||m.offset<d.offset)&&r(d,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===Lu.YAMLMap.tagName&&a==="map"||o===xu.YAMLSeq.tagName&&a==="seq")return or(t,e,n,r,o);let l=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!l){let f=e.schema.knownTags[o];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else return f?r(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),or(t,e,n,r,o)}let c=or(t,e,n,r,o,l),p=l.resolve?.(c,f=>r(i,"TAG_RESOLVE_FAILED",f),e.options)??c,u=Tu.isNode(p)?p:new Pu.Scalar(p);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}Wo.composeCollection=Ru});var lr=O(Xo=>{"use strict";var ar=j();function _u(t,e,n){let s=e.offset,r=Fu(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};let i=r.mode===">"?ar.Scalar.BLOCK_FOLDED:ar.Scalar.BLOCK_LITERAL,o=e.source?ju(e.source):[],a=o.length;for(let h=o.length-1;h>=0;--h){let g=o[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=r.chomp==="+"&&o.length>0?`
|
|
72
|
+
`.repeat(Math.max(1,o.length-1)):"",g=s+r.length;return e.source&&(g+=e.source.length),{value:h,type:i,comment:r.comment,range:[s,g,g]}}let l=e.indent+r.indent,c=e.offset+r.length,p=0;for(let h=0;h<a;++h){let[g,k]=o[h];if(k===""||k==="\r")r.indent===0&&g.length>l&&(l=g.length);else{g.length<l&&n(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=g.length),p=h,l===0&&!t.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+k.length+1}for(let h=o.length-1;h>=a;--h)o[h][0].length>l&&(a=h+1);let u="",f="",m=!1;for(let h=0;h<p;++h)u+=o[h][0].slice(l)+`
|
|
73
|
+
`;for(let h=p;h<a;++h){let[g,k]=o[h];c+=g.length+k.length+1;let $=k[k.length-1]==="\r";if($&&(k=k.slice(0,-1)),k&&g.length<l){let y=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(c-k.length-($?2:1),"BAD_INDENT",y),g=""}i===ar.Scalar.BLOCK_LITERAL?(u+=f+g.slice(l)+k,f=`
|
|
74
|
+
`):g.length>l||k[0]===" "?(f===" "?f=`
|
|
75
|
+
`:!m&&f===`
|
|
76
|
+
`&&(f=`
|
|
77
|
+
|
|
78
|
+
`),u+=f+g.slice(l)+k,f=`
|
|
79
|
+
`,m=!0):k===""?f===`
|
|
80
|
+
`?u+=`
|
|
81
|
+
`:f=`
|
|
82
|
+
`:(u+=f+k,f=" ",m=!1)}switch(r.chomp){case"-":break;case"+":for(let h=a;h<o.length;++h)u+=`
|
|
83
|
+
`+o[h][0].slice(l);u[u.length-1]!==`
|
|
84
|
+
`&&(u+=`
|
|
85
|
+
`);break;default:u+=`
|
|
86
|
+
`}let d=s+r.length+e.source.length;return{value:u,type:i,comment:r.comment,range:[s,d,d]}}function Fu({offset:t,props:e},n,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],i=r[0],o=0,a="",l=-1;for(let f=1;f<r.length;++f){let m=r[f];if(!a&&(m==="-"||m==="+"))a=m;else{let d=Number(m);!o&&d?o=d:l===-1&&(l=t+f)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,p="",u=r.length;for(let f=1;f<e.length;++f){let m=e[f];switch(m.type){case"space":c=!0;case"newline":u+=m.source.length;break;case"comment":n&&!c&&s(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,p=m.source.substring(1);break;case"error":s(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let d=`Unexpected token in block scalar header: ${m.type}`;s(m,"UNEXPECTED_TOKEN",d);let h=m.source;h&&typeof h=="string"&&(u+=h.length)}}}return{mode:i,indent:o,chomp:a,comment:p,length:u}}function ju(t){let e=t.split(/\n( *)/),n=e[0],s=n.match(/^( *)/),i=[s?.[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}Xo.resolveBlockScalar=_u});var fr=O(Qo=>{"use strict";var cr=j(),Bu=_e();function Ku(t,e,n){let{offset:s,type:r,source:i,end:o}=t,a,l,c=(f,m,d)=>n(s+f,m,d);switch(r){case"scalar":a=cr.Scalar.PLAIN,l=Uu(i,c);break;case"single-quoted-scalar":a=cr.Scalar.QUOTE_SINGLE,l=Yu(i,c);break;case"double-quoted-scalar":a=cr.Scalar.QUOTE_DOUBLE,l=zu(i,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}let p=s+i.length,u=Bu.resolveEnd(o,p,e,n);return{value:l,type:a,comment:u.comment,range:[s,p,u.offset]}}function Uu(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Ho(t)}function Yu(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Ho(t.slice(1,-1)).replace(/''/g,"'")}function Ho(t){let e=/(.*?)\r?\n/sy,n=e.exec(t);if(!n)return t;let s,r;try{s=new RegExp("(?<![ ])[ ]+$"),r=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{s=/[ \t]+$/,r=/^[ \t]+|[ \t]+$/g}let i=n[1].replace(s,""),o=" ",a=e.lastIndex;for(;n=e.exec(t);){let c=n[1].replace(r,"");c===""?o===`
|
|
87
|
+
`?i+=o:o=`
|
|
88
|
+
`:(i+=o+c,o=" "),a=e.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,n=l.exec(t),i+o+(n?.[1]??"")}function zu(t,e){let n="";for(let s=1;s<t.length-1;++s){let r=t[s];if(!(r==="\r"&&t[s+1]===`
|
|
89
|
+
`))if(r===`
|
|
90
|
+
`){let{fold:i,offset:o}=Vu(t,s);n+=i,s=o}else if(r==="\\"){let i=t[++s],o=Ju[i];if(o)n+=o;else if(i===`
|
|
91
|
+
`)for(i=t[s+1];i===" "||i===" ";)i=t[++s+1];else if(i==="\r"&&t[s+1]===`
|
|
92
|
+
`)for(i=t[++s+1];i===" "||i===" ";)i=t[++s+1];else if(i==="x"||i==="u"||i==="U"){let a=i==="x"?2:i==="u"?4:8;n+=Wu(t,s+1,a,e),s+=a}else{let a=t.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){let i=s,o=t[s+1];for(;o===" "||o===" ";)o=t[++s+1];o!==`
|
|
93
|
+
`&&!(o==="\r"&&t[s+2]===`
|
|
94
|
+
`)&&(n+=s>i?t.slice(i,s+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Vu(t,e){let n="",s=t[e+1];for(;(s===" "||s===" "||s===`
|
|
95
|
+
`||s==="\r")&&!(s==="\r"&&t[e+2]!==`
|
|
96
|
+
`);)s===`
|
|
97
|
+
`&&(n+=`
|
|
98
|
+
`),e+=1,s=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Ju={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 Wu(t,e,n,s){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let a=t.substr(e-2,n+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Qo.resolveFlowScalar=Ku});var ta=O(ea=>{"use strict";var Oe=M(),Zo=j(),Gu=lr(),Xu=fr();function Hu(t,e,n,s){let{value:r,type:i,comment:o,range:a}=e.type==="block-scalar"?Gu.resolveBlockScalar(t,e,s):Xu.resolveFlowScalar(e,t.options.strict,s),l=n?t.directives.tagName(n.source,u=>s(n,"TAG_RESOLVE_FAILED",u)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[Oe.SCALAR]:l?c=Qu(t.schema,r,l,n,s):e.type==="scalar"?c=Zu(t,r,e,s):c=t.schema[Oe.SCALAR];let p;try{let u=c.resolve(r,f=>s(n??e,"TAG_RESOLVE_FAILED",f),t.options);p=Oe.isScalar(u)?u:new Zo.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);s(n??e,"TAG_RESOLVE_FAILED",f),p=new Zo.Scalar(r)}return p.range=a,p.source=r,i&&(p.type=i),l&&(p.tag=l),c.format&&(p.format=c.format),o&&(p.comment=o),p}function Qu(t,e,n,s,r){if(n==="!")return t[Oe.SCALAR];let i=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Oe.SCALAR])}function Zu({atKey:t,directives:e,schema:n},s,r,i){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(s))||n[Oe.SCALAR];if(n.compat){let a=n.compat.find(l=>l.default&&l.test?.test(s))??n[Oe.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),p=`Value may be parsed as either ${l} or ${c}`;i(r,"TAG_RESOLVE_FAILED",p,!0)}}return o}ea.composeScalar=Hu});var sa=O(na=>{"use strict";function ed(t,e,n){if(e){n??(n=e.length);for(let s=n-1;s>=0;--s){let r=e[s];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++s];r?.type==="space";)t+=r.source.length,r=e[++s];break}}return t}na.emptyScalarPosition=ed});var oa=O(dr=>{"use strict";var td=We(),nd=M(),sd=Go(),ra=ta(),rd=_e(),id=sa(),od={composeNode:ia,composeEmptyNode:ur};function ia(t,e,n,s){let r=t.atKey,{spaceBefore:i,comment:o,anchor:a,tag:l}=n,c,p=!0;switch(e.type){case"alias":c=ad(t,e,s),(a||l)&&s(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=ra.composeScalar(t,e,l,s),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=sd.composeCollection(od,t,e,n,s),a&&(c.anchor=a.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);s(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",u),p=!1}}return c??(c=ur(t,e.offset,void 0,null,n,s)),a&&c.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!nd.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&p&&(c.srcToken=e),c}function ur(t,e,n,s,{spaceBefore:r,comment:i,anchor:o,tag:a,end:l},c){let p={type:"scalar",offset:id.emptyScalarPosition(e,n,s),indent:-1,source:""},u=ra.composeScalar(t,p,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(u.spaceBefore=!0),i&&(u.comment=i,u.range[2]=l),u}function ad({options:t},{offset:e,source:n,end:s},r){let i=new td.Alias(n.substring(1));i.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=rd.resolveEnd(s,o,t.strict,r);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}dr.composeEmptyNode=ur;dr.composeNode=ia});var ca=O(la=>{"use strict";var ld=ft(),aa=oa(),cd=_e(),fd=ht();function ud(t,e,{offset:n,start:s,value:r,end:i},o){let a=Object.assign({_directives:e},t),l=new ld.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},p=fd.resolveProps(s,{indicator:"doc-start",next:r??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?aa.composeNode(c,r,p,o):aa.composeEmptyNode(c,p.end,s,null,p,o);let u=l.contents.range[2],f=cd.resolveEnd(i,u,!1,o);return f.comment&&(l.comment=f.comment),l.range=[n,u,f.offset],l}la.composeDoc=ud});var hr=O(da=>{"use strict";var dd=xt("process"),pd=Zn(),hd=ft(),mt=pt(),fa=M(),md=ca(),gd=_e();function gt(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function ua(t){let e="",n=!1,s=!1;for(let r=0;r<t.length;++r){let i=t[r];switch(i[0]){case"#":e+=(e===""?"":s?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(i.substring(1)||" "),n=!0,s=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:e,afterEmptyLine:s}}var pr=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,i)=>{let o=gt(n);i?this.warnings.push(new mt.YAMLWarning(o,s,r)):this.errors.push(new mt.YAMLParseError(o,s,r))},this.directives=new pd.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:s,afterEmptyLine:r}=ua(this.prelude);if(s){let i=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${s}`:s;else if(r||e.directives.docStart||!i)e.commentBefore=s;else if(fa.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];fa.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${s}
|
|
104
|
+
${a}`:s}else{let o=i.commentBefore;i.commentBefore=o?`${s}
|
|
105
|
+
${o}`:s}}if(n){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:ua(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,s=-1){for(let r of e)yield*this.next(r);yield*this.end(n,s)}*next(e){switch(dd.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,s,r)=>{let i=gt(e);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",s,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=md.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new mt.YAMLParseError(gt(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){let s="Unexpected doc-end without preceding document";this.errors.push(new mt.YAMLParseError(gt(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let n=gd.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
|
|
106
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new mt.YAMLParseError(gt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let s=Object.assign({_directives:this.directives},this.options),r=new hd.Document(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};da.Composer=pr});var ma=O(On=>{"use strict";var yd=lr(),bd=fr(),wd=pt(),pa=Ze();function kd(t,e=!0,n){if(t){let s=(r,i,o)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,i,o);else throw new wd.YAMLParseError([a,a+1],i,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return bd.resolveFlowScalar(t,e,s);case"block-scalar":return yd.resolveBlockScalar({options:{strict:e}},t,s)}}return null}function Sd(t,e){let{implicitKey:n=!1,indent:s,inFlow:r=!1,offset:i=-1,type:o="PLAIN"}=e,a=pa.stringifyString({type:o,value:t},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:s,source:`
|
|
107
|
+
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
108
|
+
`),p=a.substring(0,c),u=a.substring(c+1)+`
|
|
109
|
+
`,f=[{type:"block-scalar-header",offset:i,indent:s,source:p}];return ha(f,l)||f.push({type:"newline",offset:-1,indent:s,source:`
|
|
110
|
+
`}),{type:"block-scalar",offset:i,indent:s,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:i,indent:s,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:i,indent:s,source:a,end:l};default:return{type:"scalar",offset:i,indent:s,source:a,end:l}}}function vd(t,e,n={}){let{afterKey:s=!1,implicitKey:r=!1,inFlow:i=!1,type:o}=n,a="indent"in t?t.indent:null;if(s&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=pa.stringifyString({type:o,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":$d(t,l);break;case'"':mr(t,l,"double-quoted-scalar");break;case"'":mr(t,l,"single-quoted-scalar");break;default:mr(t,l,"scalar")}}function $d(t,e){let n=e.indexOf(`
|
|
111
|
+
`),s=e.substring(0,n),r=e.substring(n+1)+`
|
|
112
|
+
`;if(t.type==="block-scalar"){let i=t.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=s,t.source=r}else{let{offset:i}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:s}];ha(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
113
|
+
`});for(let l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:r})}}function ha(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function mr(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let s=t.props.slice(1),r=e.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(let i of s)i.offset+=r;delete t.props,Object.assign(t,{type:n,source:e,end:s});break}case"block-map":case"block-seq":{let r={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
114
|
+
`};delete t.items,Object.assign(t,{type:n,source:e,end:[r]});break}default:{let s="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(t))i!=="type"&&i!=="offset"&&delete t[i];Object.assign(t,{type:n,indent:s,source:e,end:r})}}}On.createScalarToken=Sd;On.resolveAsScalar=kd;On.setScalarValue=vd});var ya=O(ga=>{"use strict";var Ad=t=>"type"in t?En(t):Nn(t);function En(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=En(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=Nn(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=Nn(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=Nn(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function Nn({start:t,key:e,sep:n,value:s}){let r="";for(let i of t)r+=i.source;if(e&&(r+=En(e)),n)for(let i of n)r+=i.source;return s&&(r+=En(s)),r}ga.stringify=Ad});var Sa=O(ka=>{"use strict";var gr=Symbol("break visit"),Od=Symbol("skip children"),ba=Symbol("remove item");function Ne(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),wa(Object.freeze([]),t,e)}Ne.BREAK=gr;Ne.SKIP=Od;Ne.REMOVE=ba;Ne.itemAtPath=(t,e)=>{let n=t;for(let[s,r]of e){let i=n?.[s];if(i&&"items"in i)n=i.items[r];else return}return n};Ne.parentCollection=(t,e)=>{let n=Ne.itemAtPath(t,e.slice(0,-1)),s=e[e.length-1][0],r=n?.[s];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function wa(t,e,n){let s=n(e,t);if(typeof s=="symbol")return s;for(let r of["key","value"]){let i=e[r];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=wa(Object.freeze(t.concat([[r,o]])),i.items[o],n);if(typeof a=="number")o=a-1;else{if(a===gr)return gr;a===ba&&(i.items.splice(o,1),o-=1)}}typeof s=="function"&&r==="key"&&(s=s(e,t))}}return typeof s=="function"?s(e,t):s}ka.visit=Ne});var Cn=O(H=>{"use strict";var yr=ma(),Nd=ya(),Ed=Sa(),br="\uFEFF",wr="",kr="",Sr="",Cd=t=>!!t&&"items"in t,qd=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Td(t){switch(t){case br:return"<BOM>";case wr:return"<DOC>";case kr:return"<FLOW_END>";case Sr:return"<SCALAR>";default:return JSON.stringify(t)}}function Pd(t){switch(t){case br:return"byte-order-mark";case wr:return"doc-mode";case kr:return"flow-error-end";case Sr: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(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}H.createScalarToken=yr.createScalarToken;H.resolveAsScalar=yr.resolveAsScalar;H.setScalarValue=yr.setScalarValue;H.stringify=Nd.stringify;H.visit=Ed.visit;H.BOM=br;H.DOCUMENT=wr;H.FLOW_END=kr;H.SCALAR=Sr;H.isCollection=Cd;H.isScalar=qd;H.prettyToken=Td;H.tokenType=Pd});var Ar=O($a=>{"use strict";var yt=Cn();function se(t){switch(t){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case" ":return!0;default:return!1}}var va=new Set("0123456789ABCDEFabcdef"),Ld=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),qn=new Set(",[]{}"),xd=new Set(` ,[]{}
|
|
118
|
+
\r `),vr=t=>!t||xd.has(t),$r=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,n=!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=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
|
|
119
|
+
`?!0:n==="\r"?this.buffer[e+1]===`
|
|
120
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+e];if(n==="\r"){let r=this.buffer[s+e+1];if(r===`
|
|
121
|
+
`||!r&&!this.atEnd)return e+s+1}return n===`
|
|
122
|
+
`||s>=this.indentNext||!n&&!this.atEnd?e+s:-1}if(n==="-"||n==="."){let s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&se(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]===yt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,s=e.indexOf("#");for(;s!==-1;){let i=e[s-1];if(i===" "||i===" "){n=s-1;break}else s=e.indexOf("#",s+1)}for(;;){let i=e[n-1];if(i===" "||i===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield yt.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&se(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!se(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&se(n)){let s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);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(vr),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,s=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&r[0]!=="#"||s===0&&(r.startsWith("---")||r.startsWith("..."))&&se(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield yt.FLOW_END,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(vr),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||se(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),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}let s=this.buffer.substring(0,n),r=s.indexOf(`
|
|
124
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let i=this.continueScalar(r+1);if(i===-1)break;r=s.indexOf(`
|
|
125
|
+
`,i)}r!==-1&&(n=r-(s[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>se(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,s;e:for(let i=this.pos;s=this.buffer[i];++i)switch(s){case" ":n+=1;break;case`
|
|
126
|
+
`:e=i,n=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
127
|
+
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
128
|
+
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(s=this.buffer[r];s===" ";)s=this.buffer[++r];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
|
|
129
|
+
`;)s=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
|
|
130
|
+
`&&i>=this.pos&&i+1+n>a)e=i;else break}while(!0);return yield yt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,s=this.pos-1,r;for(;r=this.buffer[++s];)if(r===":"){let i=this.buffer[s+1];if(se(i)||e&&qn.has(i))break;n=s}else if(se(r)){let i=this.buffer[s+1];if(r==="\r"&&(i===`
|
|
131
|
+
`?(s+=1,r=`
|
|
132
|
+
`,i=this.buffer[s+1]):n=s),i==="#"||e&&qn.has(i))break;if(r===`
|
|
133
|
+
`){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&qn.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield yt.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(n&&(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(vr),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,s=this.charAt(1);if(se(s)||n&&qn.has(s)){n?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,n=this.buffer[e];for(;!se(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Ld.has(n))n=this.buffer[++e];else if(n==="%"&&va.has(this.buffer[e+1])&&va.has(this.buffer[e+2]))n=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 n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||e&&s===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,s=this.buffer[n];for(;!e(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};$a.Lexer=$r});var Nr=O(Aa=>{"use strict";var Or=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,s=this.lineStarts.length;for(;n<s;){let i=n+s>>1;this.lineStarts[i]<e?n=i+1:s=i}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};Aa.LineCounter=Or});var Cr=O(qa=>{"use strict";var Md=xt("process"),Oa=Cn(),Id=Ar();function be(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Na(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Ca(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Tn(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Fe(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Pn(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function Ea(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!be(e.start,"explicit-key-ind")&&!be(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Ca(e.value)?e.value.end?Pn(e.value.end,e.sep):e.value.end=e.sep:Pn(e.start,e.sep),delete e.sep)}var Er=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 Id.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let s of this.lexer.lex(e,n))yield*this.next(s);n||(yield*this.end())}*next(e){if(this.source=e,Md.env.LOG_TOKENS&&console.log("|",Oa.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=Oa.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){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 s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,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 n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Ea(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{let r=s.items[s.items.length-1];if(r.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=s.items[s.items.length-1];r.value?s.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=s.items[s.items.length-1];!r||r.value?s.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Na(r.start)===-1&&(n.indent===0||r.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(s.type==="document"?s.end=r.start:s.items.push({start:r.start}),n.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":{Na(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 n=this.startBlockValue(e);n?this.stack.push(n):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 n=Tn(this.peek(2)),s=Fe(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}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 n=this.source.indexOf(`
|
|
136
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
137
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let s="end"in n.value?n.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Pn(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,r=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let l=n.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&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(be(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Ca(n.key)&&!be(n.sep,"newline")){let o=Fe(n.start),a=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(be(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Fe(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):be(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||n.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!be(n.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 s&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let s="end"in n.value?n.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Pn(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||be(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let r=Tn(s),i=Fe(r);Ea(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:i,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 n=this.source.indexOf(`
|
|
138
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
139
|
+
`,n)+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 n=Tn(e),s=Fe(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Tn(e),s=Fe(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(s=>s.type==="newline"||s.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;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};qa.Parser=Er});var Ma=O(wt=>{"use strict";var Ta=hr(),Dd=ft(),bt=pt(),Rd=ds(),_d=M(),Fd=Nr(),Pa=Cr();function La(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Fd.LineCounter||null,prettyErrors:e}}function jd(t,e={}){let{lineCounter:n,prettyErrors:s}=La(e),r=new Pa.Parser(n?.addNewLine),i=new Ta.Composer(e),o=Array.from(i.compose(r.parse(t)));if(s&&n)for(let a of o)a.errors.forEach(bt.prettifyError(t,n)),a.warnings.forEach(bt.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function xa(t,e={}){let{lineCounter:n,prettyErrors:s}=La(e),r=new Pa.Parser(n?.addNewLine),i=new Ta.Composer(e),o=null;for(let a of i.compose(r.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new bt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(bt.prettifyError(t,n)),o.warnings.forEach(bt.prettifyError(t,n))),o}function Bd(t,e,n){let s;typeof e=="function"?s=e:n===void 0&&e&&typeof e=="object"&&(n=e);let r=xa(t,n);if(!r)return null;if(r.warnings.forEach(i=>Rd.warn(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}function Kd(t,e,n){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=n??e??{};if(!r)return}return _d.isDocument(t)&&!s?t.toString(n):new Dd.Document(t,s,n).toString(n)}wt.parse=Bd;wt.parseAllDocuments=jd;wt.parseDocument=xa;wt.stringify=Kd});var xn=O(I=>{"use strict";var Ud=hr(),Yd=ft(),zd=Ws(),qr=pt(),Vd=We(),we=M(),Jd=he(),Wd=j(),Gd=ge(),Xd=ye(),Hd=Cn(),Qd=Ar(),Zd=Nr(),ep=Cr(),Ln=Ma(),Ia=Ye();I.Composer=Ud.Composer;I.Document=Yd.Document;I.Schema=zd.Schema;I.YAMLError=qr.YAMLError;I.YAMLParseError=qr.YAMLParseError;I.YAMLWarning=qr.YAMLWarning;I.Alias=Vd.Alias;I.isAlias=we.isAlias;I.isCollection=we.isCollection;I.isDocument=we.isDocument;I.isMap=we.isMap;I.isNode=we.isNode;I.isPair=we.isPair;I.isScalar=we.isScalar;I.isSeq=we.isSeq;I.Pair=Jd.Pair;I.Scalar=Wd.Scalar;I.YAMLMap=Gd.YAMLMap;I.YAMLSeq=Xd.YAMLSeq;I.CST=Hd;I.Lexer=Qd.Lexer;I.LineCounter=Zd.LineCounter;I.Parser=ep.Parser;I.parse=Ln.parse;I.parseAllDocuments=Ln.parseAllDocuments;I.parseDocument=Ln.parseDocument;I.stringify=Ln.stringify;I.visit=Ia.visit;I.visitAsync=Ia.visitAsync});import{readdirSync as vl,readFileSync as $l}from"node:fs";import{basename as Al,join as Gn}from"node:path";var Ol=/^agent\.mcs\.ya?ml$/,Nl=/\.ya?ml$/,Yr=t=>vl(t,{withFileTypes:!0}).filter(e=>!e.name.startsWith(".")&&e.name!=="node_modules");function zr(t,e=""){return Yr(t).flatMap(n=>{let s=e?`${e}/${n.name}`:n.name;return n.isDirectory()?zr(Gn(t,n.name),s):n.isFile()?[{path:s,text:Nl.test(n.name)?$l(Gn(t,n.name),"utf8"):""}]:[]})}function Vr(t){let e=Yr(t);return e.some(n=>n.isFile()&&Ol.test(n.name))?[{id:Al(t),dir:t,files:zr(t)}]:e.filter(n=>n.isDirectory()).flatMap(n=>Vr(Gn(t,n.name)))}var re=Wn(xn()),Y=t=>t&&typeof t=="object"&&!Array.isArray(t)?t:void 0,_=t=>typeof t=="string"&&t.trim()?t:void 0,Tr=t=>Array.isArray(t)?t:[];function tp(t){if(!t.trim())return"empty";let e=new re.LineCounter,n=(0,re.parseDocument)(t,{lineCounter:e,uniqueKeys:!1});if(n.errors.length)return"yaml";let s=new WeakMap,r=o=>{if((0,re.isMap)(o)){let a={};o.range&&s.set(a,o.range[0]);for(let l of o.items)a[String((0,re.isScalar)(l.key)?l.key.value:l.key)]=r(l.value);return a}return(0,re.isSeq)(o)?o.items.map(r):(0,re.isScalar)(o)?o.value:o},i=r(n.contents);return i==null?"empty":{data:i,lineOf:o=>o&&typeof o=="object"&&s.has(o)?e.linePos(s.get(o)).line:void 0}}function*St(t){if(Array.isArray(t))for(let n of t)yield*St(n);let e=Y(t);if(e){typeof e.kind=="string"&&(yield e);for(let n of Object.values(e))yield*St(n)}}var kt=t=>t.split(".")[1]??t,Pr=(t,e)=>t.slice(t.lastIndexOf(e)+(t.includes(e)?e.length:0)),np=new Set(["LogCustomTelemetryEvent","CSATQuestion","SearchAndSummarizeContent","SearchKnowledgeSources"]);function sp(t,e,n){let s={id:t,facts:{},children:[],unknown:[]},r=[];for(let i of[...e].sort((o,a)=>o.path.localeCompare(a.path))){if(!/\.ya?ml$/.test(i.path)){s.unknown.push({file:i.path,why:"file"});continue}let o=tp(i.text);if(o==="yaml"||o==="empty"){s.unknown.push({file:i.path,why:o});continue}let a=Y(o.data),l=/^agents\/([^/]+)\//.exec(i.path)?.[1],c=s.facts;if(l){let d=s.children.find(h=>h.name===l);d||s.children.push(d={name:l,facts:{}}),c=d.facts}let p=(d,h,g=c)=>(g[d]??=[]).push({file:i.path,line:o.lineOf(h??a)});if(l&&p(`child:${l}`,a,s.facts),!l&&/^settings\.mcs\.ya?ml$/.test(i.path)&&a){s.schemaName=_(a.schemaName)??s.schemaName,s.displayName=_(a.displayName)??s.displayName,_(a.authenticationMode)&&p(`auth:${a.authenticationMode}`);let d=Y(a.configuration),h=Y(d?.settings)?.GenerativeActionsEnabled;typeof h=="boolean"&&p(`setting:generative=${h?"on":"off"}`,d),d?.isAgentConnectable===!0&&p("setting:connectable",d);continue}let u=n?[...St(a)].map(d=>d.kind).find(d=>!n.has(d)):void 0;if(u&&s.unknown.push({file:i.path,why:"kind",kind:u}),typeof a?.kind!="string"){u||s.unknown.push({file:i.path,why:"kind"});continue}let f=i.text,m=(d,h)=>{_(d)&&(p("instructions:present",h),/\b(Today|Now)\(\)/.test(d)&&p("ms:date-context",h))};switch(a.kind){case"GptComponentMetadata":{s.displayName??=_(a.displayName),m(a.instructions,a);let d=Y(Y(a.aISettings)?.model);_(d?.modelNameHint)&&p(`model:${d.modelNameHint}`,d);break}case"AgentDialog":{let d=Y(a.beginDialog);_(d?.kind)&&p(`trigger:${d.kind}`,d),m(Y(a.settings)?.instructions,a.settings);break}case"AdaptiveDialog":{let d=Y(a.beginDialog),h=_(d?.kind);h&&p(`trigger:${h}`,d),_(a.modelDescription)&&p("topics:with-model-description");let g=Tr(a.inputs).some(k=>Y(k)?.kind==="AutomaticTaskInput"&&Y(k)?.shouldPromptUser===!1);h==="OnRecognizedIntent"&&g&&p("ms:orchestrator-variables",d),h==="OnError"&&f.includes("System.Error.SubCode")&&p("ms:rai-error-handling",d),h==="OnKnowledgeRequested"&&[...St(d)].some(k=>k.kind==="SendActivity")&&p("ms:knowledge-hold-message",d),h==="OnGeneratedResponse"&&f.includes("System.ContinueResponse")&&p("ms:prevent-tool-call-leaks",d);break}case"TaskDialog":{let d=Y(a.action),h=_(d?.connectionReference);d?.kind==="InvokeConnectorTaskAction"&&h&&(p(`connector:${kt(h)}`,d),_(d.operationId)&&p(`operation:${kt(h)}/${d.operationId}`,d)),d?.kind==="InvokeExternalAgentTaskAction"&&Y(d.operationDetails)?.kind==="ModelContextProtocolMetadata"&&h&&p(`mcp:${kt(h)}`,d),d?.kind==="InvokeConnectedAgentTaskAction"&&_(d.botSchemaName)&&p(`calls:${d.botSchemaName}`,d),d?.kind==="InvokeFlowTaskAction"&&_(d.flowId)&&p(`flow:${d.flowId}`,d);break}case"KnowledgeSourceConfiguration":{let d=Y(a.source);_(d?.kind)&&p(`knowledge:${d.kind}`,d),d&&"triggerCondition"in d&&p("yaml-only:triggerCondition",d),r.push({file:i.path,line:o.lineOf(a)});break}case"GlobalVariableComponent":{let d=Y(a.variable)??a,h=_(d.name)??(_(a.schemaName)?Pr(a.schemaName,"."):void 0);if(!h)break;p(`var:${h}`),d.isExternalInitializationAllowed===!0&&p(`var-in:${h}`);break}case"ConnectionReferencesSourceFile":for(let d of Tr(a.connectionReferences).map(Y)){let h=_(d?.connectorId)?Pr(d.connectorId,"/"):_(d?.connectionReferenceLogicalName)?kt(d.connectionReferenceLogicalName):void 0;h&&p(`connref:${h}`,d)}break}for(let d of St(a)){if(np.has(d.kind)&&p(`node:${d.kind}`,d),d.kind==="InvokeConnectorAction"&&_(d.connectionReference)){let g=kt(d.connectionReference);p(`connector:${g}`,d),_(d.operationId)&&p(`operation:${g}/${d.operationId}`,d)}if(d.kind==="InvokeFlowAction"&&_(d.flowId)&&p(`flow:${d.flowId}`,d),(d.kind==="BeginDialog"||d.kind==="ReplaceDialog")&&_(d.dialog)){let g=d.dialog;g.startsWith("=")?g.includes("Switch(")&&p("ms:dynamic-topic-redirect",d):p(`calls:topic:${Pr(g,".topic.")}`,d)}let h=g=>typeof g=="string"&&g.includes("System.Activity.ChannelId");(d.kind==="ConditionGroup"&&Tr(d.conditions).some(g=>h(Y(g)?.condition))||d.kind==="SetVariable"&&h(d.value))&&p("ms:channel-aware-behavior",d),(d.kind==="SendActivity"||d.kind==="Question")&&JSON.stringify(d).includes("<br")&&p("ms:line-breaks-in-messages",d)}}r.length&&(s.facts[`knowledge:count=${r.length}`]=r);for(let i of[s.facts,...s.children.map(o=>o.facts)])for(let[o,a]of Object.entries(i))i[o]=a.filter((l,c)=>a.findIndex(p=>p.file===l.file&&p.line===l.line)===c);return s}function rp(t){let e=new Set,n=r=>{if(!r||typeof r!="object")return;let{const:i,enum:o}=r;if(typeof i=="string"&&e.add(i),Array.isArray(o))for(let a of o)typeof a=="string"&&e.add(a)},s=r=>{if(Array.isArray(r))return r.forEach(s);if(!r||typeof r!="object")return;let i=r;n(i.kind),n(i.properties?.kind);for(let o of Object.values(i))s(o)};for(let r of Object.values(t.definitions??{}))s(r);return e}var je=Wn(xn(),1);function Mn(t,e){let n=new je.LineCounter,s=(0,je.parseDocument)(t,{lineCounter:n,prettyErrors:!1}),r=o=>{for(let a=o;a.length;a=a.slice(0,-1)){let l=s.getIn(a,!0);if(l?.range)return n.linePos(l.range[0]).line}return 1};if(s.errors.length)return{ok:!1,problem:{line:n.linePos(s.errors[0].pos[0]).line,key:"syntax",detail:s.errors[0].code}};let i=s.toJS();return!i||typeof i!="object"||Array.isArray(i)||i.format!==e||!(0,je.isMap)(s.contents)?{ok:!1,problem:{line:r(["format"]),key:"format"}}:{ok:!0,format:{raw:i,doc:s,at:r,lineOf:o=>n.linePos(o).line}}}var Da="cast-list/profile-v1",Ir=["orchestrator","specialist"],Mr={roles:{},threshold:.7,minAgents:3,rules:[],focusAreas:[],ignore:[],microsoftPatterns:!0},ip=["format","name","roles","threshold","min_agents","rules","focus_areas","ignore","microsoft_patterns"],Lr=t=>!!t&&typeof t=="object"&&!Array.isArray(t),z=t=>typeof t=="string"?t.trim():typeof t=="number"?String(t):"",xr=t=>Array.isArray(t)?t.map(z).filter(Boolean):z(t)?[z(t)]:[],Ra=t=>Ir.includes(t);function op(t){let e=Mn(t,Da);if(!e.ok)return{problems:[e.problem.key==="format"?{...e.problem,format:Da}:e.problem]};let{raw:n,at:s}=e.format,r=[];for(let k of Object.keys(n))ip.includes(k)||r.push({line:s([k]),key:"unknownKey",what:k});let i=(k,$,E)=>(z(k)||r.push({line:s(E),key:"missing",what:$}),z(k)),o=(k,$)=>{let E=new Set;$.forEach((y,S)=>{y&&E.has(y)&&r.push({line:s([k,S]),key:"duplicate",what:k,id:y}),E.add(y)})},a=k=>Array.isArray(n[k])?n[k]:[],l=n.threshold===void 0?Mr.threshold:Number(n.threshold);l>0&&l<=1||r.push({line:s(["threshold"]),key:"threshold",value:z(n.threshold)});let c=n.min_agents===void 0?Mr.minAgents:Number(n.min_agents);Number.isInteger(c)&&c>=1||r.push({line:s(["min_agents"]),key:"minAgents",value:z(n.min_agents)});let p={},u=Lr(n.roles)?n.roles:{};for(let k of Object.keys(u))Ra(k)?p[k]=z(u[k])==="*"?"*":xr(u[k]):r.push({line:s(["roles",k]),key:"role",what:`roles.${k}`,value:k});let f=(k,$,E)=>(Ra(z(k))||r.push({line:s(E),key:"role",what:$,value:z(k)}),z(k)),m=a("rules").filter(Lr).map((k,$)=>{let E=i(k.has,`rules[${$}].has`,["rules",$]);return{id:i(k.id,`rules[${$}].id`,["rules",$]),role:f(k.role,`rules[${$}].role`,["rules",$,"role"]),has:E,says:z(k.says)||E}});o("rules",m.map(k=>k.id));let d=a("focus_areas").filter(Lr).map((k,$)=>{let E=xr(k.facts);E.length||r.push({line:s(["focus_areas",$]),key:"missing",what:`focus_areas[${$}].facts`});let y=i(k.id,`focus_areas[${$}].id`,["focus_areas",$]);return{id:y,name:z(k.name)||y,facts:E}});o("focus_areas",d.map(k=>k.id));let h=n.microsoft_patterns,g={...z(n.name)?{name:z(n.name)}:{},roles:p,threshold:l,minAgents:c,rules:m,focusAreas:d,ignore:xr(n.ignore),microsoftPatterns:!(h===!1||z(h).toLowerCase()==="off")};return r.length?{problems:r}:{profile:g,problems:r}}var ap=t=>Object.keys(t.facts).some(e=>e.startsWith("calls:")&&!e.startsWith("calls:topic:"));function _a(t,e,n={}){let{orchestrator:s,specialist:r}=e.roles,i=(c,p)=>Array.isArray(c)&&c.includes(p),o=Object.fromEntries(t.map(c=>[c.id,i(s,c.id)?"orchestrator":i(r,c.id)?"specialist":n[c.id]??(s==="*"?"orchestrator":r==="*"?"specialist":ap(c)?"orchestrator":"specialist")])),a=new Set(t.map(c=>c.id)),l=[s,r].flatMap(c=>Array.isArray(c)?c:[]).filter(c=>!a.has(c));return{roles:o,unmatched:l}}var ae=Wn(xn());var vt="cast-list/cast-v1",lp=["accepted","rejected"],cp=["platform","specialist","orchestrator"],fp=["format","name","agents","declared","decisions"],up=t=>!!t&&typeof t=="object"&&!Array.isArray(t),Q=t=>typeof t=="string"?t.trim():typeof t=="number"||typeof t=="boolean"?String(t):"";function dp(t){let e=Mn(t,vt);if(!e.ok)return{problems:[e.problem.key==="format"?{...e.problem,format:vt}:e.problem]};let{raw:n,at:s}=e.format,r=[];for(let u of Object.keys(n))fp.includes(u)||r.push({line:s([u]),key:"unknownKey",what:u});let i=u=>(Array.isArray(n[u])?n[u]:[]).filter(up),o=(u,f,m)=>(Q(u)||r.push({line:s(m),key:"missing",what:f}),Q(u)),a=(u,f)=>{let m=new Set;f.forEach((d,h)=>{d&&m.has(d)&&r.push({line:s([u,h]),key:"duplicate",what:u,id:d}),m.add(d)})},l=i("agents").map((u,f)=>{let m=Q(u.role);return Ir.includes(m)||r.push({line:s(["agents",f,"role"]),key:"role",what:`agents[${f}].role`,value:m}),{id:o(u.id,`agents[${f}].id`,["agents",f]),role:m}});a("agents",l.map(u=>u.id));let c=i("declared").map((u,f)=>({agent:o(u.agent,`declared[${f}].agent`,["declared",f]),key:o(u.key,`declared[${f}].key`,["declared",f]),value:Q(u.value),source:Q(u.source)}));a("declared",c.map(u=>`${u.agent} ${u.key}`));let p=i("decisions").map((u,f)=>{let m=Q(u.status),d=Q(u.scope);return lp.includes(m)||r.push({line:s(["decisions",f,"status"]),key:"status",value:m}),cp.includes(d)||r.push({line:s(["decisions",f,"scope"]),key:"scope",value:d}),{key:o(u.key,`decisions[${f}].key`,["decisions",f]),status:m,scope:d,why:Q(u.why)}});return a("decisions",p.map(u=>u.key)),r.length?{problems:r}:{cast:{...Q(n.name)?{name:Q(n.name)}:{},agents:l,declared:c,decisions:p},problems:r}}var pp=` What people said about the agents, and what was decided. build.mjs keeps it up to date; edit it, or fill the
|
|
140
|
+
workbook's \xABDeclared\xBB sheet and the \xABDecision\xBB column and read it back with --from.`,hp={agents:t=>Q(t.id),declared:t=>`${Q(t.agent)} ${Q(t.key)}`,decisions:t=>Q(t.key)},mp=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==""&&e!==void 0));function gp(t,e){let n=e?(0,ae.parseDocument)(e):void 0,s=n&&!n.errors.length&&(0,ae.isMap)(n.contents)?n:new ae.Document({format:vt});s!==n&&(s.commentBefore=pp),s.get("format")!==vt&&s.set("format",vt),t.name===void 0?s.delete("name"):s.get("name")!==t.name&&s.set("name",t.name);for(let[r,i]of Object.entries(hp)){let o=t[r];if(!o.length){s.delete(r);continue}let a=s.get(r,!0);if((0,ae.isSeq)(a)||s.set(r,a=s.createNode([])),!(0,ae.isSeq)(a))continue;let l=new Map(a.items.filter(ae.isMap).map(c=>[i(c.toJSON()),c]));a.items=o.map(c=>{let p=mp(c),u=l.get(i(p));if(!u){let f=s.createNode(p);return f.flow=!0,f}for(let[f,m]of Object.entries(p))u.get(f)!==m&&u.set(f,m);for(let f of Object.keys(u.toJSON()))f in p||u.delete(f);return u})}return s.toString({lineWidth:0,flowCollectionPadding:!0})}function yp(t,e="en"){let n=e==="pt";switch(t.key){case"syntax":return n?`n\xE3o se l\xEA como YAML (${t.detail})`:`does not read as YAML (${t.detail})`;case"format":return n?`\xABformat\xBB precisa ser ${t.format}`:`\xABformat\xBB must be ${t.format}`;case"missing":return n?`falta \xAB${t.what}\xBB`:`\xAB${t.what}\xBB is missing`;case"duplicate":return n?`${t.what}: o id \xAB${t.id}\xBB se repete`:`${t.what}: the id \xAB${t.id}\xBB is repeated`;case"unknownKey":return n?`\xAB${t.what}\xBB n\xE3o \xE9 um campo deste arquivo`:`\xAB${t.what}\xBB is not a field of this file`;case"threshold":return n?`\xABthreshold\xBB vai de 0 a 1, como 0.7 (est\xE1 \xAB${t.value}\xBB)`:`\xABthreshold\xBB goes from 0 to 1, like 0.7 (it is \xAB${t.value}\xBB)`;case"minAgents":return n?`\xABmin_agents\xBB \xE9 um n\xFAmero inteiro a partir de 1 (est\xE1 \xAB${t.value}\xBB)`:`\xABmin_agents\xBB is a whole number from 1 (it is \xAB${t.value}\xBB)`;case"role":return n?`\xAB${t.what}\xBB \xE9 orchestrator ou specialist (est\xE1 \xAB${t.value}\xBB)`:`\xAB${t.what}\xBB is orchestrator or specialist (it is \xAB${t.value}\xBB)`;case"status":return n?`\xABstatus\xBB \xE9 accepted ou rejected (est\xE1 \xAB${t.value}\xBB)`:`\xABstatus\xBB is accepted or rejected (it is \xAB${t.value}\xBB)`;case"scope":return n?`\xABscope\xBB \xE9 platform, specialist ou orchestrator (est\xE1 \xAB${t.value}\xBB)`:`\xABscope\xBB is platform, specialist or orchestrator (it is \xAB${t.value}\xBB)`}}var In=[{id:"orchestrator-variables",name:"Orchestrator-Generated Variables",sign:"an OnRecognizedIntent topic with an AutomaticTaskInput that has shouldPromptUser: false"},{id:"rai-error-handling",name:"RAI Error Handling",sign:"the OnError topic reads System.Error.SubCode"},{id:"knowledge-hold-message",name:"Knowledge Hold Message",sign:"an OnKnowledgeRequested topic that sends a message"},{id:"prevent-tool-call-leaks",name:"Prevent Tool Call Leaks",sign:"an OnGeneratedResponse topic that sets System.ContinueResponse"},{id:"dynamic-topic-redirect",name:"Dynamic Topic Redirect",sign:"a BeginDialog whose dialog is a =Switch( expression"},{id:"channel-aware-behavior",name:"Channel-Aware Behavior",sign:"a condition or SetVariable that reads System.Activity.ChannelId (not a tool input)"},{id:"date-context",name:"Date Context",sign:"the instructions use Today() or Now()"},{id:"line-breaks-in-messages",name:"Line Breaks in Messages",sign:"<br /> inside a SendActivity or Question"},{id:"conversation-history-variable",name:"Conversation History Variable"},{id:"chain-of-thought-logging",name:"Chain of Thought Logging"},{id:"deterministic-mcp-calls",name:"Deterministic MCP Calls"},{id:"prevent-child-agent-responses",name:"Prevent Child Agent Responses"},{id:"jit-glossary",name:"JIT Glossary"},{id:"jit-user-context",name:"JIT User Context"},{id:"teams-production-hardening",name:"Teams Production Hardening"}];var bp=/^(no|não|nao|false|off|0)$/i,wp=new Set(In.filter(t=>!t.sign).map(t=>`ms:${t.id}`)),kp=t=>t.includes(":")&&!t.startsWith("declared:")&&!wp.has(t),Sp=t=>t.startsWith("declared:")?t:`declared:${t}`;function vp(t,e,n){let s=Object.fromEntries(n.agents.map(y=>[y.id,y.role])),{roles:r,unmatched:i}=_a(t,e,s),o=y=>e.ignore.includes(y)||!e.microsoftPatterns&&y.startsWith("ms:"),a=[],l=t.map(y=>{let S=Object.fromEntries(Object.entries(y.facts).filter(([A])=>!o(A)));for(let A of n.declared.filter(T=>T.agent===y.id)){let T=!bp.test(A.value);if(kp(A.key)){let N=A.key in y.facts;T!==N&&a.push({agent:y.id,key:A.key,declared:A.value||"yes",observed:N,source:A.source})}else T&&(S[Sp(A.key)]??=[]).push({file:A.source?`declared: ${A.source}`:"declared"})}return{id:y.id,role:r[y.id],...y.schemaName?{schemaName:y.schemaName}:{},...y.displayName?{displayName:y.displayName}:{},facts:S,children:y.children}}),c=y=>l.filter(S=>S.role===y),p=(y,S=l)=>S.filter(A=>y in A.facts),u=(y,S=l)=>S.flatMap(A=>A.facts[y]??[]),f=[...new Set(l.flatMap(y=>Object.keys(y.facts)))].sort(),m=y=>n.decisions.find(S=>S.key===y),d=y=>y==="platform"?l:c(y),h=[];for(let y of["specialist","orchestrator"]){let S=c(y);if(S.length<e.minAgents)continue;let A=c(y==="specialist"?"orchestrator":"specialist");for(let T of f){if(T.startsWith("declared:")||h.some(q=>q.key===T))continue;let w=p(T,S).length/S.length;if(w<e.threshold)continue;let L=A.length>0&&p(T,A).length/A.length>=(A.length>=e.minAgents?e.threshold:1),v=m(T);h.push({key:T,role:y,scope:v?.scope??(L?"platform":y),share:w,agents:p(T).map(q=>q.id),sources:u(T),...v?{decision:v}:{}})}}for(let y of n.decisions.filter(S=>S.status==="accepted"&&!h.some(A=>A.key===S.key))){let S=d(y.scope),A=p(y.key,S);h.push({key:y.key,role:y.scope==="orchestrator"?"orchestrator":"specialist",scope:y.scope,share:S.length?A.length/S.length:0,agents:A.map(T=>T.id),sources:u(y.key),decision:y})}h.sort((y,S)=>y.scope.localeCompare(S.scope)||y.key.localeCompare(S.key));let g=h.filter(y=>y.decision?.status!=="rejected").flatMap(y=>d(y.scope).filter(S=>!(y.key in S.facts)).map(S=>({agent:S.id,key:y.key,scope:y.scope}))).sort((y,S)=>y.agent.localeCompare(S.agent)||y.key.localeCompare(S.key)),k=[],$=[];for(let y of f){if(y.startsWith("declared:"))continue;let S=p(y),A={key:y,agents:S.map(T=>T.id),sources:u(y)};S.every(T=>T.role==="orchestrator")?$.push(A):S.length===1&&k.push(A)}let E=e.rules.map(y=>({rule:y,agents:c(y.role).filter(S=>!(y.has in S.facts)).map(S=>S.id)})).filter(y=>y.agents.length);return{...e.name??n.name?{name:e.name??n.name}:{},roles:r,unmatched:i,agents:l,patterns:h,offPattern:g,solos:k,orchestratorDoes:$,gaps:E,conflicts:a,unknown:t.flatMap(y=>y.unknown.map(S=>({...S,agent:y.id})))}}var Dr={conversation:{en:"A. Conversation",pt:"A. Conversa"},integrations:{en:"B. Integrations",pt:"B. Integra\xE7\xF5es"},knowledge:{en:"C. Knowledge",pt:"C. Conhecimento"},orchestration:{en:"D. Orchestrator",pt:"D. Orquestrador"},governance:{en:"E. Governance",pt:"E. Governan\xE7a"},microsoft:{en:"Microsoft patterns",pt:"Padr\xF5es Microsoft"},declared:{en:"Declared",pt:"Declarado"}},Dn={"trigger:OnConversationStart":{dim:"conversation",en:"Greeting",pt:"Boas-vindas"},"trigger:OnUnknownIntent":{dim:"conversation",en:"Fallback (when it does not understand)",pt:"Fallback (quando n\xE3o entende)"},"trigger:OnEscalate":{dim:"conversation",en:"Escalation to a person",pt:"Escalonamento para humano",lacks:{en:["does not escalate to a person","do not escalate to a person"],pt:["n\xE3o escala para humano","n\xE3o escalam para humano"]}},"trigger:OnError":{dim:"conversation",en:"Error handling",pt:"Tratamento de erro",lacks:{en:["does not handle errors","do not handle errors"],pt:["n\xE3o trata erro","n\xE3o tratam erro"]}},"trigger:OnRecognizedIntent":{dim:"conversation",en:"A topic of its own, by intent",pt:"T\xF3pico pr\xF3prio, por inten\xE7\xE3o"},"trigger:OnRedirect":{dim:"orchestration",en:"Takes a call from the orchestrator",pt:"Recebe chamada do orquestrador",lacks:{en:["takes no call from the orchestrator","take no call from the orchestrator"],pt:["n\xE3o recebe chamada do orquestrador","n\xE3o recebem chamada do orquestrador"]}},"trigger:OnSelectIntent":{dim:"conversation",en:"Disambiguation (\xABdid you mean\u2026\xBB)",pt:"Desambigua\xE7\xE3o (\xABvoc\xEA quis dizer\u2026\xBB)"},"trigger:OnSignIn":{dim:"conversation",en:"Sign-in",pt:"Login"},"trigger:OnGeneratedResponse":{dim:"conversation",en:"Reviews the generated answer",pt:"Revisa a resposta gerada"},"trigger:OnKnowledgeRequested":{dim:"knowledge",en:"Before searching knowledge",pt:"Antes de buscar no conhecimento"},"trigger:OnToolSelected":{dim:"orchestration",en:"Child chosen as a tool",pt:"Filho escolhido como ferramenta"},"trigger:OnActivity":{dim:"conversation",en:"On every message",pt:"Em toda mensagem"},"setting:generative=on":{dim:"conversation",en:"Generative orchestration on",pt:"Orquestra\xE7\xE3o generativa ligada"},"setting:generative=off":{dim:"conversation",en:"Generative orchestration off",pt:"Orquestra\xE7\xE3o generativa desligada"},"setting:connectable":{dim:"orchestration",en:"Can be called by an orchestrator",pt:"Pode ser chamado por um orquestrador"},"topics:with-model-description":{dim:"conversation",en:"Topics described for the model",pt:"T\xF3picos descritos para o modelo"},"instructions:present":{dim:"governance",en:"Has instructions",pt:"Tem instru\xE7\xF5es",lacks:{en:["has no instructions","have no instructions"],pt:["n\xE3o tem instru\xE7\xF5es","n\xE3o t\xEAm instru\xE7\xF5es"]}},"node:LogCustomTelemetryEvent":{dim:"governance",en:"Logs telemetry",pt:"Registra telemetria",lacks:{en:["logs no telemetry","log no telemetry"],pt:["n\xE3o registra telemetria","n\xE3o registram telemetria"]}},"node:CSATQuestion":{dim:"governance",en:"Asks for satisfaction (CSAT)",pt:"Pergunta a satisfa\xE7\xE3o (CSAT)",lacks:{en:["does not ask for satisfaction","do not ask for satisfaction"],pt:["n\xE3o pergunta a satisfa\xE7\xE3o","n\xE3o perguntam a satisfa\xE7\xE3o"]}},"node:SearchAndSummarizeContent":{dim:"knowledge",en:"Generative answers from knowledge",pt:"Respostas generativas sobre o conhecimento"},"node:SearchKnowledgeSources":{dim:"knowledge",en:"Searches the knowledge sources",pt:"Busca nas fontes de conhecimento"},"yaml-only:triggerCondition":{dim:"knowledge",en:"Search condition only in YAML (the editor may erase it)",pt:"Condi\xE7\xE3o de busca s\xF3 no YAML (a tela pode apagar)"},"knowledge:SharePointSearchSource":{dim:"knowledge",en:"Knowledge in SharePoint",pt:"Conhecimento no SharePoint"},"declared:kpi":{dim:"declared",en:"KPI declared",pt:"KPI declarado",lacks:{en:["has no KPI declared","have no KPI declared"],pt:["n\xE3o tem KPI declarado","n\xE3o t\xEAm KPI declarado"]}},"declared:owner":{dim:"declared",en:"Owner declared",pt:"Dono declarado",lacks:{en:["has no owner declared","have no owner declared"],pt:["n\xE3o tem dono declarado","n\xE3o t\xEAm dono declarado"]}}},$p=Object.fromEntries(In.map(t=>[t.id,t.name])),Ap=[["calls:topic:","conversation","Calls the topic","Chama o t\xF3pico"],["trigger:","conversation","Trigger","Gatilho"],["setting:","conversation","Setting","Configura\xE7\xE3o"],["connector:","integrations","Connector","Conector"],["operation:","integrations","Operation","Opera\xE7\xE3o"],["connref:","integrations","Connection reference","Refer\xEAncia de conex\xE3o"],["mcp:","integrations","MCP server","Servidor MCP"],["flow:","integrations","Flow","Fluxo"],["knowledge:","knowledge","Knowledge","Conhecimento"],["node:","governance","Node","N\xF3"],["calls:","orchestration","Calls","Chama"],["child:","orchestration","Child","Filho"],["var-in:","orchestration","Receives from the orchestrator","Recebe do orquestrador"],["var:","orchestration","Global variable","Vari\xE1vel global"],["model:","governance","Model","Modelo"],["auth:","governance","Sign-in","Login"],["ms:","microsoft","Microsoft pattern:","Padr\xE3o Microsoft:"],["declared:","declared","Declared:","Declarado:"]],Fa=t=>Ap.find(([e])=>t.startsWith(e)),ja=t=>!!Dn[t]?.lacks;function Rn(t){return Dn[t]?.dim??Fa(t)?.[1]??"governance"}function ee(t,e){let n=Dn[t];if(n)return n[e];let s=/^knowledge:count=(\d+)$/.exec(t);if(s){let o=Number(s[1]);return e==="pt"?`${o} ${o===1?"fonte":"fontes"} de conhecimento`:`${o} knowledge ${o===1?"source":"sources"}`}let r=Fa(t);if(!r)return t;let i=t.slice(r[0].length);return r[0]==="ms:"&&(i=$p[i]??i),r[0]==="auth:"&&i==="None"?e==="pt"?"Sem login":"No sign-in":`${r[e==="pt"?3:2]} ${i}`}function _n(t,e,n){let s=Dn[t]?.lacks?.[e];if(s)return s[n===1?0:1];if(t.startsWith("calls:topic:"))return e==="pt"?`${n===1?"n\xE3o chama":"n\xE3o chamam"} o t\xF3pico ${t.slice(12)}`:`${n===1?"does":"do"} not call the topic ${t.slice(12)}`;let r=ee(t,e);return e==="pt"?`${n===1?"n\xE3o tem":"n\xE3o t\xEAm"} \xAB${r}\xBB`:`${n===1?"does":"do"} not have \xAB${r}\xBB`}var Op={specialist:{en:["specialist","specialists"],pt:["especialista","especialistas"]},orchestrator:{en:["orchestrator","orchestrators"],pt:["orquestrador","orquestradores"]}},Ee=(t,e,n)=>Op[t][e][n===1?0:1],Fn={en:{summary:"Summary",matrix:"Matrix",patterns:"Patterns",off:"Off pattern",gaps:"Gaps",conflicts:"Conflicts",agents:"Cast",evidence:"Evidence",declared:"Declared",unknown:"Not understood",dimension:"Dimension",fact:"Fact",key:"Key",agent:"Who",name:"Name",role:"Role",scope:"Scope",share:"Share",have:"Who has it",lack:"Who lacks it",decision:"Decision",why:"Why",missing:"Missing",accepted:"Accepted pattern",rule:"Rule",says:"Says",notMet:"Who does not meet it",value:"Value",source:"Source",inYaml:"In the YAML",file:"File",line:"Line",facts:"Facts",alone:"Only it has",children:"Children",kind:"Kind",yes:"yes",no:"no",accept:"accepted",reject:"rejected",platform:"platform",specialist:"specialist",orchestrator:"orchestrator",title:"The cast, compared",look:"To look at",nothing:"Nothing to look at",privacy:"This file holds the client\u2019s data: keep it in the client\u2019s environment.",count:{agents:"In the cast",orchestrators:"Orchestrators",specialists:"Specialists",patterns:"Patterns",off:"Off a pattern",gaps:"Rules not met",conflicts:"Conflicts",solos:"Only one has it"},why_:{yaml:"YAML that does not read",empty:"empty",kind:"a kind Copilot Studio does not have",file:"not a Copilot Studio file"}},pt:{summary:"Resumo",matrix:"Matriz",patterns:"Padr\xF5es",off:"Fora do padr\xE3o",gaps:"Lacunas",conflicts:"Conflitos",agents:"Elenco",evidence:"Evid\xEAncias",declared:"Declarado",unknown:"N\xE3o entendeu",dimension:"Dimens\xE3o",fact:"Fato",key:"Chave",agent:"Quem",name:"Nome",role:"Papel",scope:"Escopo",share:"Quantos",have:"Quem tem",lack:"Quem falta",decision:"Decis\xE3o",why:"Por qu\xEA",missing:"Falta",accepted:"Padr\xE3o aceito",rule:"Regra",says:"Diz",notMet:"Quem n\xE3o cumpre",value:"Valor",source:"Fonte",inYaml:"No YAML",file:"Arquivo",line:"Linha",facts:"Fatos",alone:"S\xF3 ele tem",children:"Filhos",kind:"Kind",yes:"sim",no:"n\xE3o",accept:"aceito",reject:"rejeitado",platform:"plataforma",specialist:"especialista",orchestrator:"orquestrador",title:"Elenco comparado",look:"Para olhar",nothing:"Nada para olhar",privacy:"Este arquivo tem dados do cliente: deixe-o no ambiente dele.",count:{agents:"No elenco",orchestrators:"Orquestradores",specialists:"Especialistas",patterns:"Padr\xF5es",off:"Fora do padr\xE3o",gaps:"Regras n\xE3o cumpridas",conflicts:"Conflitos",solos:"S\xF3 um tem"},why_:{yaml:"YAML que n\xE3o se l\xEA",empty:"vazio",kind:"um kind que o Copilot Studio n\xE3o tem",file:"n\xE3o \xE9 arquivo do Copilot Studio"}}};var $t=t=>t.join(", ");function Np(t){let e=[];for(let i of t.conflicts){let o=i.source?`\xAB${i.source}\xBB`:null,[a,l]=[ee(i.key,"en"),ee(i.key,"pt")];e.push(i.observed?{key:"conflict",agents:[i.agent],fact:i.key,en:`${i.agent}: ${o??"what was declared"} says it does not have \xAB${a}\xBB, but the YAML has it`,pt:`${i.agent}: ${o??"o declarado"} diz que n\xE3o tem \xAB${l}\xBB, mas o YAML tem`}:{key:"conflict",agents:[i.agent],fact:i.key,en:`${i.agent}: ${o??"what was declared"} says it has \xAB${a}\xBB, but the YAML does not`,pt:`${i.agent}: ${o??"o declarado"} diz que tem \xAB${l}\xBB, mas o YAML n\xE3o tem`})}let n=new Map;for(let i of t.offPattern){let o=t.roles[i.agent],a=n.get(`${i.key} ${o}`)??{key:i.key,role:o,agents:[]};a.agents.push(i.agent),n.set(`${i.key} ${o}`,a)}for(let i of n.values()){let o=i.agents.length,a=t.patterns.find(c=>c.key===i.key)?.decision?.status==="accepted",l=c=>`${o} ${Ee(i.role,c,o)} ${_n(i.key,c,o)} (${$t(i.agents)})`;e.push({key:"off",agents:i.agents,fact:i.key,en:a?`${l("en")}, and the pattern was accepted: correct it?`:`${l("en")}: on purpose?`,pt:a?`${l("pt")}, e o padr\xE3o foi aceito: corrigir?`:`${l("pt")}: \xE9 intencional?`})}for(let i of t.gaps){let o=i.agents.filter(l=>!t.offPattern.some(c=>c.agent===l&&c.key===i.rule.has)).sort(),a=o.length;a&&e.push({key:"gap",agents:o,fact:i.rule.has,en:`Rule \xAB${i.rule.says}\xBB: ${a} ${Ee(i.rule.role,"en",a)} ${a===1?"does":"do"} not meet it (${$t(o)})`,pt:`Regra \xAB${i.rule.says}\xBB: ${a} ${Ee(i.rule.role,"pt",a)} n\xE3o ${a===1?"cumpre":"cumprem"} (${$t(o)})`})}let s=new Set(t.solos.filter(i=>/^(connector|mcp):/.test(i.key)).map(i=>`${i.agents[0]} ${i.key.slice(i.key.indexOf(":")+1)}`));for(let i of t.solos){let o=i.agents[0],a=i.key.startsWith("connref:")?i.key.slice(8):i.key.startsWith("operation:")?i.key.slice(10).split("/")[0]:void 0;a&&s.has(`${o} ${a}`)||e.push({key:"solo",agents:[o],fact:i.key,en:`Only ${o} has \xAB${ee(i.key,"en")}\xBB: innovation or debt?`,pt:`S\xF3 ${o} tem \xAB${ee(i.key,"pt")}\xBB: inova\xE7\xE3o ou d\xEDvida?`})}let r=new Map;for(let i of t.unknown)r.set(i.agent,[...r.get(i.agent)??[],i.file]);for(let[i,o]of r){let a=o.length;e.push({key:"unknown",agents:[i],en:`${i}: the analysis did not understand ${a} ${a===1?"file":"files"} (${$t(o)})`,pt:`${i}: a an\xE1lise n\xE3o entendeu ${a} ${a===1?"arquivo":"arquivos"} (${$t(o)})`})}for(let i of t.unmatched)e.push({key:"unmatched",agents:[],en:`The profile names \xAB${i}\xBB, which is not in the folder`,pt:`O perfil cita \xAB${i}\xBB, que n\xE3o est\xE1 na pasta`});return e}function At(t){let e=n=>n.share===1&&!n.decision&&!t.offPattern.some(s=>s.key===n.key);return{look:t.patterns.filter(n=>!e(n)),everyone:t.patterns.filter(e)}}var Ba=new TextEncoder,Rr=t=>t.replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e]).replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,""),Ot=t=>t<26?String.fromCharCode(65+t):Ot(Math.floor(t/26)-1)+String.fromCharCode(65+t%26),Ep=t=>t.replace(/[:\\/?*[\]]/g," ").slice(0,31)||"Sheet";function Cp(t){let e=[{}],n=f=>JSON.stringify([f.bold??!1,f.fill??"",f.color??"",f.center??!1,f.wrap??!1]),s=new Map([[n({}),0]]);for(let f of t)for(let m of f.rows)for(let d of m){if(typeof d!="object")continue;let{v:h,...g}=d,k=n(g);s.has(k)||(s.set(k,e.length),e.push(g))}let r=new Map([["|",0]]),i=new Map([["",0]]),o=f=>{let m=`${f.bold?"b":""}|${f.color??""}`;return r.has(m)||r.set(m,r.size),r.get(m)},a=f=>f.fill?(i.has(f.fill)||i.set(f.fill,i.size+1),i.get(f.fill)):0,l=e.map(f=>{let m=f.center||f.wrap?`<alignment${f.center?' horizontal="center"':""}${f.wrap?' wrapText="1"':""} vertical="top"/>`:'<alignment vertical="top"/>';return`<xf numFmtId="0" fontId="${o(f)}" fillId="${a(f)}" borderId="${f.fill||f.bold?1:0}" xfId="0" applyFont="1" applyFill="1" applyBorder="1" applyAlignment="1">${m}</xf>`}),c=[...r.keys()].map(f=>{let[m,d]=f.split("|");return`<font>${m?"<b/>":""}<sz val="11"/>${d?`<color rgb="FF${d}"/>`:""}<name val="Calibri"/><family val="2"/></font>`}),p=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>',...[...i.keys()].filter(Boolean).map(f=>`<fill><patternFill patternType="solid"><fgColor rgb="FF${f}"/><bgColor indexed="64"/></patternFill></fill>`)];return{xml:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
141
|
+
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
|
|
142
|
+
<fonts count="${c.length}">${c.join("")}</fonts>
|
|
143
|
+
<fills count="${p.length}">${p.join("")}</fills>
|
|
144
|
+
<borders count="2"><border><left/><right/><top/><bottom/><diagonal/></border><border><left style="thin"><color rgb="FFD0D7E2"/></left><right style="thin"><color rgb="FFD0D7E2"/></right><top style="thin"><color rgb="FFD0D7E2"/></top><bottom style="thin"><color rgb="FFD0D7E2"/></bottom><diagonal/></border></borders>
|
|
145
|
+
<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>
|
|
146
|
+
<cellXfs count="${l.length}">${l.join("")}</cellXfs>
|
|
147
|
+
<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>
|
|
148
|
+
</styleSheet>`,styleOf:f=>typeof f=="object"?s.get(n((({v:m,...d})=>d)(f)))??0:0}}function qp(t,e){let n=Math.max(t.columns.length,...t.rows.map(l=>l.length),1),s=t.rows.map((l,c)=>{let p=l.map((u,f)=>{let m=`${Ot(f)}${c+1}`,d=typeof u=="object"?u.v:u,h=e(u),g=h?` s="${h}"`:"";return d===""||d===void 0||d===null?h?`<c r="${m}"${g}/>`:"":typeof d=="number"?`<c r="${m}"${g}><v>${d}</v></c>`:`<c r="${m}"${g} t="inlineStr"><is><t xml:space="preserve">${Rr(String(d))}</t></is></c>`}).join("");return`<row r="${c+1}">${p}</row>`}),r=`${Ot(n-1)}${Math.max(1,t.rows.length)}`,i=t.header?'<pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft" activeCell="A2" sqref="A2"/>':"",o=t.columns.length?`<cols>${t.columns.map((l,c)=>`<col min="${c+1}" max="${c+1}" width="${l.width}" customWidth="1"/>`).join("")}</cols>`:"",a=t.header&&t.rows.length>1?`<autoFilter ref="A1:${Ot(Math.max(0,t.columns.length-1))}${t.rows.length}"/>`:"";return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
149
|
+
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
150
|
+
<dimension ref="A1:${r}"/><sheetViews><sheetView workbookViewId="0">${i}</sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>${o}<sheetData>${s.join("")}</sheetData>${a}
|
|
151
|
+
</worksheet>`}function Ka(t){let{xml:e,styleOf:n}=Cp(t),s=t.map(o=>Ep(o.name)),r=t.map((o,a)=>o.header&&o.rows.length>1?`<definedName name="_xlnm._FilterDatabase" localSheetId="${a}" hidden="1">'${Rr(s[a]).replace(/'/g,"''")}'!$A$1:$${Ot(Math.max(0,o.columns.length-1))}$${o.rows.length}</definedName>`:"").join(""),i=[["[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
152
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>${t.map((o,a)=>`<Override PartName="/xl/worksheets/sheet${a+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")}</Types>`],["_rels/.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
153
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`],["xl/workbook.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
154
|
+
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><bookViews><workbookView/></bookViews><sheets>${s.map((o,a)=>`<sheet name="${Rr(o)}" sheetId="${a+1}" r:id="rId${a+1}"/>`).join("")}</sheets>${r?`<definedNames>${r}</definedNames>`:""}</workbook>`],["xl/_rels/workbook.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
155
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${t.map((o,a)=>`<Relationship Id="rId${a+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${a+1}.xml"/>`).join("")}<Relationship Id="rId${t.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`],["xl/styles.xml",e],...t.map((o,a)=>[`xl/worksheets/sheet${a+1}.xml`,qp(o,n)])];return Lp(i.map(([o,a])=>[o,Ba.encode(a)]))}var Tp=(()=>{let t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;t[e]=n>>>0}return t})();function Pp(t){let e=4294967295;for(let n=0;n<t.length;n++)e=Tp[(e^t[n])&255]^e>>>8;return(e^4294967295)>>>0}function Lp(t){let e=[],n=[],s=0;for(let[c,p]of t){let u=Ba.encode(c),f=Pp(p),m=new DataView(new ArrayBuffer(30));m.setUint32(0,67324752,!0),m.setUint16(4,20,!0),m.setUint16(6,2048,!0),m.setUint16(8,0,!0),m.setUint32(14,f,!0),m.setUint32(18,p.length,!0),m.setUint32(22,p.length,!0),m.setUint16(26,u.length,!0),e.push(new Uint8Array(m.buffer),u,p);let d=new DataView(new ArrayBuffer(46));d.setUint32(0,33639248,!0),d.setUint16(4,20,!0),d.setUint16(6,20,!0),d.setUint16(8,2048,!0),d.setUint32(16,f,!0),d.setUint32(20,p.length,!0),d.setUint32(24,p.length,!0),d.setUint16(28,u.length,!0),d.setUint32(42,s,!0),n.push(new Uint8Array(d.buffer),u),s+=30+u.length+p.length}let r=n.reduce((c,p)=>c+p.length,0),i=new DataView(new ArrayBuffer(22));i.setUint32(0,101010256,!0),i.setUint16(8,t.length,!0),i.setUint16(10,t.length,!0),i.setUint32(12,r,!0),i.setUint32(16,s,!0);let o=[...e,...n,new Uint8Array(i.buffer)],a=new Uint8Array(o.reduce((c,p)=>c+p.length,0)),l=0;for(let c of o)a.set(c,l),l+=c.length;return a}var xp=t=>Ka(t),Mp={bold:!0,fill:"E8EEF7"},Ip={v:"\u25CF",fill:"DDF3E6",center:!0},Dp={v:"\xD7",fill:"FFD5CC",center:!0,bold:!0},Rp={v:"\u25D0",fill:"FFF3C4",center:!0},Ua=Object.keys(Dr);function _p(t,e,n,s="en"){let r=Fn[s],i=(w,L,v)=>({key:w,name:r[w],header:!0,columns:L.map(([q,D])=>({title:q,width:D})),rows:[L.map(([q])=>({v:q,...Mp})),...v]}),o=w=>r[t.roles[w]],a=w=>r[w],l=w=>ee(w,s),c=[...t.agents].sort((w,L)=>w.role===L.role?w.id.localeCompare(L.id):w.role==="orchestrator"?-1:1),p=[...new Set([...c.flatMap(w=>Object.keys(w.facts)),...t.patterns.map(w=>w.key)])].sort((w,L)=>Ua.indexOf(Rn(w))-Ua.indexOf(Rn(L))||w.localeCompare(L)),u=new Set(t.offPattern.map(w=>`${w.agent} ${w.key}`)),f=w=>t.agents.filter(L=>L.role===w).length,m={key:"summary",name:r.summary,header:!1,columns:[{title:"",width:28},{title:"",width:100}],rows:[[{v:t.name??r.title,bold:!0},""],[{v:r.privacy,color:"B42318"},""],[r.count.agents,t.agents.length],[r.count.orchestrators,f("orchestrator")],[r.count.specialists,f("specialist")],[r.count.patterns,t.patterns.length],[r.count.off,new Set(t.offPattern.map(w=>w.agent)).size],[r.count.gaps,t.gaps.length],[r.count.conflicts,t.conflicts.length],[r.count.solos,e.filter(w=>w.key==="solo").length],["",""],[{v:e.length?r.look:r.nothing,bold:!0},""],...e.map(w=>["",{v:w[s],wrap:!0}])]},d=i("matrix",[[r.dimension,18],[r.fact,40],[r.key,34],...c.map(w=>[w.id,14])],p.map(w=>[Dr[Rn(w)][s],l(w),w,...c.map(L=>w in L.facts?w.startsWith("declared:")?Rp:Ip:u.has(`${L.id} ${w}`)?Dp:"")])),{look:h,everyone:g}=At(t),k=i("patterns",[[r.key,34],[r.fact,40],[r.scope,14],[r.role,14],[r.share,10],[r.have,50],[r.lack,40],[r.decision,12],[r.why,50]],[...h,...g].map(w=>{let L=t.offPattern.filter(v=>v.key===w.key).map(v=>v.agent);return[w.key,l(w.key),a(w.scope),r[w.role],`${Math.round(w.share*100)}%`,w.agents.join(", "),L.join(", "),w.decision?r[w.decision.status==="accepted"?"accept":"reject"]:"",w.decision?.why??""]})),$=i("off",[[r.agent,24],[r.role,14],[r.missing,44],[r.key,34],[r.scope,14],[r.accepted,14]],t.offPattern.map(w=>[w.agent,o(w.agent),l(w.key),w.key,a(w.scope),t.patterns.find(L=>L.key===w.key)?.decision?.status==="accepted"?r.yes:""])),E=i("gaps",[[r.rule,16],[r.says,50],[r.role,14],[r.notMet,60]],t.gaps.map(w=>[w.rule.id,w.rule.says,r[w.rule.role],w.agents.join(", ")])),y=i("conflicts",[[r.agent,24],[r.fact,40],[r.key,34],[r.declared,20],[r.source,40],[r.inYaml,12]],t.conflicts.map(w=>[w.agent,l(w.key),w.key,w.declared,w.source,w.observed?r.yes:r.no])),S=i("agents",[[r.agent,24],[r.name,32],[r.role,14],[r.facts,8],[r.off,44],[r.alone,44],[r.children,24],[r.unknown,12]],c.map(w=>[w.id,w.displayName??"",r[w.role],Object.keys(w.facts).length,t.offPattern.filter(L=>L.agent===w.id).map(L=>l(L.key)).join("; "),t.solos.filter(L=>L.agents[0]===w.id).map(L=>l(L.key)).join("; "),w.children.map(L=>L.name).join(", "),t.unknown.filter(L=>L.agent===w.id).length||""])),A=i("evidence",[[r.agent,30],[r.fact,40],[r.key,34],[r.file,50],[r.line,8]],c.flatMap(w=>[{who:w.id,facts:w.facts},...w.children.map(L=>({who:`${w.id} \u203A ${L.name}`,facts:L.facts}))]).flatMap(({who:w,facts:L})=>Object.entries(L).sort(([v],[q])=>v.localeCompare(q)).flatMap(([v,q])=>q.map(D=>[w,l(v),v,D.file,D.line??""])))),T=i("declared",[[r.agent,24],[r.key,34],[r.value,40],[r.source,40]],n.declared.map(w=>[w.agent,w.key,w.value,w.source])),N=[m,d,k,$,E,y,S,A,T];return t.unknown.length&&N.push(i("unknown",[[r.agent,24],[r.file,50],[r.why,40],[r.kind,24]],t.unknown.map(w=>[w.agent,w.file,r.why_[w.why],w.kind??""]))),N}var Be=t=>String(t??"").normalize("NFD").replace(/[̀-ͯ]/g,"").trim().toLowerCase(),Nt=Object.values(Fn),Ya=(t,e)=>t.find(n=>Nt.some(s=>Be(s[e])===Be(n.name)));function za(t,...e){let n=e.map(s=>t?.rows[0]?.findIndex(r=>Nt.some(i=>Be(i[s])===Be(r)))??-1);return s=>n.map(r=>r<0?"":String(s[r]??"").trim())}var Va=(t,e)=>e.find(([,n])=>Nt.some(s=>Be(s[n])===Be(t)))?.[0],Ja=t=>t.slice(1).filter(e=>e.some(n=>String(n??"").trim())),Wa=(t,e)=>JSON.stringify(t)===JSON.stringify(e);function Fp(t,e){let n=[],s=[],r=Ya(e,"declared");if(r){let o=za(r,"agent","key","value","source"),a=[];Ja(r.rows).forEach((p,u)=>{let[f,m,d,h]=o(p);!f||!m?s.push(`${r.name}, ${u+2}: \xAB${o(r.rows[0])[f?1:0]}\xBB ?`):a.push({agent:f,key:m,value:d,source:h})});let l=p=>`${p.agent} ${p.key}`,c=0;for(let p of a){let u=t.declared.find(f=>l(f)===l(p));u?Wa(u,p)||n.push({key:`d${++c}`,kind:"declared",op:"set",before:u,after:p}):n.push({key:`d${++c}`,kind:"declared",op:"add",after:p})}for(let p of t.declared)a.some(u=>l(u)===l(p))||n.push({key:`d${++c}`,kind:"declared",op:"remove",before:p})}let i=Ya(e,"patterns");if(i){let o=za(i,"key","scope","decision","why"),a=0;for(let l of Ja(i.rows)){let[c,p,u,f]=o(l);if(!c)continue;let m=t.decisions.find(g=>g.key===c);if(!u){m&&n.push({key:`p${++a}`,kind:"decision",op:"remove",before:m});continue}let d=Va(u,[["accepted","accept"],["rejected","reject"]]),h=Va(p,[["platform","platform"],["specialist","specialist"],["orchestrator","orchestrator"]]);if(!d)s.push(`${i.name}, ${c}: \xAB${u}\xBB \u2014 ${Nt.map(g=>`${g.accept}/${g.reject}`).join(", ")}`);else if(!h)s.push(`${i.name}, ${c}: \xAB${p}\xBB \u2014 ${Nt.map(g=>`${g.platform}/${g.specialist}/${g.orchestrator}`).join(", ")}`);else{let g={key:c,status:d,scope:h,why:f};m?Wa(m,g)||n.push({key:`p${++a}`,kind:"decision",op:"set",before:m,after:g}):n.push({key:`p${++a}`,kind:"decision",op:"add",after:g})}}}return{changes:n,problems:s}}function jp(t,e,n){let s={...t,declared:[...t.declared],decisions:[...t.decisions]};for(let r of e.filter(i=>n.includes(i.key)))if(r.kind==="declared"){let i=a=>`${a.agent} ${a.key}`,o=r.before?s.declared.findIndex(a=>i(a)===i(r.before)):-1;r.op==="add"?s.declared.push(r.after):r.op==="set"?s.declared[o]=r.after:s.declared.splice(o,1)}else{let i=r.before?s.decisions.findIndex(o=>o.key===r.before.key):-1;r.op==="add"?s.decisions.push(r.after):r.op==="set"?s.decisions[i]=r.after:s.decisions.splice(i,1)}return s}var Et="#8C8578";var jn="#C8442C",Xa="#2E8F62";var Ga=t=>Math.round(t*10)/10,_r=t=>[Ga(t[0]),Ga(t[1])],ke=(t,e,n=22,s="start",r)=>({type:"text",at:_r(t),text:e,size:n,anchor:s,...r?{style:{color:r}}:{}});var Ha=(t,e,n)=>({type:"arrow",from:_r(t),to:_r(e),...n?{style:n}:{}});var Bp=(t,e)=>t.length*e*.48;function Bn(t,e,n){let s=[],r="";for(let i of t.split(/\s+/).filter(Boolean)){let o=r?`${r} ${i}`:i;r&&Bp(o,e)>n?(s.push(r),r=i):r=o}return r&&s.push(r),s.length?s:[""]}var Kn=150,Ct=40,Kp=24,Qa=250,Za=20,Fr=6,jr=4,Up=/^(auth|model|setting|topics|connref|operation):/,Yp={en:{chapters:["The cast","What repeats","Who is off","What is missing","What to decide"],cast:(t,e)=>t?`${t} ${t===1?"orchestrator calls":"orchestrators call"} ${e} ${e===1?"specialist":"specialists"}.`:`${e} ${e===1?"specialist":"specialists"}, with no orchestrator.`,repeats:(t,e,n)=>t?`${t} patterns: ${e} of the platform, ${n} of the specialists.`:"Nothing repeats enough to be a pattern yet.",off:t=>t.length?`Off a pattern: ${t.join(", ")}.`:"Nobody is off a pattern.",missing:t=>t?`${t} ${t===1?"rule is":"rules are"} not met.`:"Every rule is met.",decide:t=>t?`${t} ${t===1?"thing":"things"} to decide.`:"Nothing left to decide.",pattern:t=>`A pattern? \xAB${t}\xBB`,platform:"platform",specialist:"specialists",more:t=>`+ ${t} more`,none:"nothing"},pt:{chapters:["O elenco","O que se repete","Quem est\xE1 fora","O que falta","O que decidir"],cast:(t,e)=>t?`${t} ${t===1?"orquestrador chama":"orquestradores chamam"} ${e} ${e===1?"especialista":"especialistas"}.`:`${e} ${e===1?"especialista":"especialistas"}, sem orquestrador.`,repeats:(t,e,n)=>t?`${t} padr\xF5es: ${e} da plataforma, ${n} dos especialistas.`:"Nada se repete o bastante para ser padr\xE3o ainda.",off:t=>t.length?`Fora do padr\xE3o: ${t.join(", ")}.`:"Ningu\xE9m est\xE1 fora do padr\xE3o.",missing:t=>t?`${t} ${t===1?"regra n\xE3o \xE9 cumprida":"regras n\xE3o s\xE3o cumpridas"}.`:"Todas as regras s\xE3o cumpridas.",decide:t=>t?`${t} ${t===1?"coisa":"coisas"} para decidir.`:"Nada em aberto para decidir.",pattern:t=>`Padr\xE3o? \xAB${t}\xBB`,platform:"plataforma",specialist:"especialistas",more:t=>`+ ${t}`,none:"nada"}};function zp(t,e,n="en"){let s=Yp[n],r=t.agents.filter(v=>v.role==="orchestrator").sort((v,q)=>v.id.localeCompare(q.id)),i=t.agents.filter(v=>v.role==="specialist").sort((v,q)=>v.id.localeCompare(q.id)),o=Math.max(1,Math.ceil(i.length/Kp)),a=Math.max(1,Math.ceil(i.length/o)),l=Math.max(1e3,Ct*2+Math.max(a,r.length)*Kn),c=(v,q)=>l/2+(v-(q-1)/2)*Kn,p=[{...ke([Ct,52],t.name??s.chapters[0],30),chapter:s.chapters[0],say:`${t.name?`${t.name}: `:""}${s.cast(r.length,i.length)}`}],u=(v,q,D)=>Bn(v,15,Kn-12).slice(0,2).forEach((B,G)=>p.push(ke([q[0],q[1]+G*18],B,15,"middle",D))),f=170,m=new Map;r.forEach((v,q)=>{let D=c(q,r.length);m.set(v.id,[D,f]),p.push({type:"prop",name:"robot",at:[D,f],size:70}),u(v.id,[D,f+24],Et)}),i.forEach((v,q)=>{let D=Math.floor(q/a),B=Math.min(a,i.length-D*a),G=[c(q%a,B),340+D*Qa];m.set(v.id,G),p.push({type:"prop",name:"robot",at:G,size:64}),u(v.id,[G[0],G[1]+24])});for(let v of r){let q=m.get(v.id);for(let D of i.filter(B=>B.schemaName&&`calls:${B.schemaName}`in v.facts)){let B=m.get(D.id);B[1]===340&&p.push(Ha([q[0],q[1]+44],[B[0],B[1]-76],{color:Et}))}}let d=340+(o-1)*Qa+160,h=(l-Ct*2)/3,g=d,k=(v,q,D,B,G)=>{let Tt=Ct+v*h;p.push({...ke([Tt,d],q,22,"start",G),chapter:q,say:D});let Vn=d+34,Pt=B.slice(0,Fr);B.length>Fr&&Pt.push(s.more(B.length-Fr)),Pt.length||Pt.push(s.none);for(let hl of Pt){let Lt=Bn(hl,15,h-30),Kr=Lt.length>jr?[...Lt.slice(0,jr-1),`${Lt[jr-1]}\u2026`]:Lt;Kr.forEach((ml,Jn)=>p.push(ke([Tt+(Jn?14:0),Vn+Jn*Za],`${Jn?"":"\xB7 "}${ml}`,15,"start",Et))),Vn+=Kr.length*Za+6}g=Math.max(g,Vn)},$=v=>ja(v)?0:Up.test(v)?2:1,E=[...t.patterns].sort((v,q)=>$(v.key)-$(q.key)||(v.scope===q.scope?0:v.scope==="platform"?-1:1)||q.share-v.share||v.key.localeCompare(q.key)),y=v=>v==="platform"?s.platform:s.specialist;k(0,s.chapters[1],s.repeats(t.patterns.length,t.patterns.filter(v=>v.scope==="platform").length,t.patterns.filter(v=>v.scope!=="platform").length),E.map(v=>`${ee(v.key,n)} \xB7 ${y(v.scope)}${v.share<1?` \xB7 ${Math.round(v.share*100)}%`:""}`),Xa);let S=[...new Set(t.offPattern.map(v=>v.agent))].sort();S.forEach((v,q)=>{let D=m.get(v),B=t.offPattern.filter(G=>G.agent===v).flatMap(G=>Bn(_n(G.key,n,1),13,Kn-10)).slice(0,4);p.push({...ke([D[0]+34,D[1]-50],"\xD7",30,"middle",jn),...q===0?{chapter:s.chapters[2],say:s.off(S)}:{}}),B.forEach((G,Tt)=>p.push(ke([D[0],D[1]+66+Tt*16],G,13,"middle",jn)))}),S.length||p.push({...ke([l-Ct,92],s.off([]),16,"end",Et),chapter:s.chapters[2],say:s.off([])});let A=t.gaps.flatMap(v=>{let q=v.agents.filter(D=>!t.offPattern.some(B=>B.agent===D&&B.key===v.rule.has)).length;return q?[n==="pt"?`\xAB${v.rule.says}\xBB: ${q} ${Ee(v.rule.role,n,q)} n\xE3o ${q===1?"cumpre":"cumprem"}`:`\xAB${v.rule.says}\xBB: ${q} ${Ee(v.rule.role,n,q)} ${q===1?"does":"do"} not meet it`]:[]}),T=t.unknown.length;T&&A.push(n==="pt"?`${T} ${T===1?"arquivo n\xE3o entendido":"arquivos n\xE3o entendidos"}`:`${T} ${T===1?"file":"files"} not understood`),k(1,s.chapters[3],s.missing(e.filter(v=>v.key==="gap").length),A,jn);let{look:N}=At(t),w=[...N.filter(v=>!v.decision).map(v=>s.pattern(ee(v.key,n))),...e.filter(v=>v.key==="solo"||v.key==="conflict").map(v=>v[n])];return k(2,s.chapters[4],s.decide(w.length),w),{id:(t.name??"cast").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)||"cast",title:t.name??s.chapters[0],width:l,height:Math.min(4e3,g+40),background:"plain",locale:n==="pt"?"pt-BR":"en-US",steps:p}}var el=["and","or","not"];var Br=["person","person-pointing","person-sitting","house","car","bus","coin","phone","document","server","bank","cloud","queue","desk","computer","clock","lock","money-arrow","tree","school","hospital","factory","truck","cart","safe","bulb","gear","database","robot","ship","container","warehouse","box","pallet","shop","shelf","field","cup","function","api-gateway","cache","cluster","board","book","pencil"],Un={pessoa:"person","pessoa-apontando":"person-pointing","pessoa-sentada":"person-sitting",casa:"house",carro:"car",onibus:"bus",moeda:"coin",celular:"phone",documento:"document",servidor:"server",banco:"bank",nuvem:"cloud",fila:"queue",mesa:"desk",computador:"computer",relogio:"clock",cadeado:"lock","seta-dinheiro":"money-arrow"},Yn=t=>Br.includes(t)?t:typeof t=="string"&&Object.hasOwn(Un,t)?Un[t]:void 0;var nl=t=>Yn(t)!==void 0,b={skin:"#E8C6A5",shirt:"#A9BCC3",wood:"#D8C29C",gold:"#F2C94C",paper:"#FFFFFF",screen:"#DCE8F0",device:"#5B6B7C",roof:"#D9785F",wall:"#F3E3C3",car:"#7FA7C9",bus:"#E9C46A",green:"#7DBE8A",dark:"#4A4A4A",metal:"#C9D3DD",board:"#2F4F3F",chalk:"#F2EFE6"},C=(t,e,n,s,r,i)=>({kind:"polygon",points:[[t,e],[t+n,e],[t+n,e+s],[t,e+s]],fill:r,main:i}),P=(...t)=>({kind:"polyline",points:t});function sl(t){return[{kind:"polygon",points:[[-.15,-.72],[.15,-.72],[.19,-.38],[-.19,-.38]],fill:b.shirt,main:!0},{kind:"circle",c:[0,-.87],r:.11,fill:b.skin},...t,P([-.08,-.38],[-.1,0]),P([.08,-.38],[.1,0])]}var tl=sl([P([-.15,-.7],[-.25,-.42]),P([.15,-.7],[.25,-.42])]);function Vp(t,e,n){let s=([r,i])=>[n+r*e,i*e];return t.map(r=>r.kind==="circle"?{...r,c:s(r.c),r:r.r*e}:{...r,points:r.points.map(s)})}function Jp(){let t=[[-.28,-.3,.18],[-.06,-.45,.25],[.2,-.4,.21],[.37,-.27,.13]],e=[];for(let n=0;n<=24;n++){let s=-.46+.96*n/24,r=t.filter(([i,,o])=>Math.abs(s-i)<=o).map(([i,o,a])=>o-Math.sqrt(Math.max(0,a*a-(s-i)**2)));r.length&&e.push([s,Math.min(...r)])}return[...e,[.42,-.12],[-.4,-.12]]}var sg={person:tl,"person-pointing":sl([P([-.15,-.7],[-.25,-.42]),P([.15,-.69],[.47,-.73])]),"person-sitting":[P([-.3,-.8],[-.27,-.4]),P([-.32,-.4],[.2,-.4]),P([-.27,-.4],[-.27,0]),P([.16,-.4],[.16,0]),{kind:"polygon",points:[[-.22,-.77],[.04,-.77],[.06,-.44],[-.22,-.44]],fill:b.shirt,main:!0},{kind:"circle",c:[-.08,-.9],r:.1,fill:b.skin},P([-.1,-.44],[.3,-.44],[.32,0]),P([0,-.74],[.18,-.55],[.3,-.58])],house:[C(-.4,-.6,.8,.6,b.wall,!0),{kind:"polygon",points:[[-.5,-.58],[0,-1],[.5,-.58]],fill:b.roof},C(-.08,-.32,.16,.32,b.wood),C(.16,-.46,.16,.14,b.screen)],car:[{kind:"polygon",fill:b.car,main:!0,points:[[-.5,-.14],[-.5,-.32],[-.3,-.36],[-.18,-.56],[.2,-.56],[.32,-.36],[.5,-.32],[.5,-.14]]},{kind:"polygon",points:[[-.14,-.51],[.17,-.51],[.25,-.37],[-.22,-.37]],fill:b.screen},{kind:"circle",c:[-.28,-.12],r:.1,fill:b.dark},{kind:"circle",c:[.28,-.12],r:.1,fill:b.dark}],bus:[C(-.5,-.66,1,.52,b.bus,!0),...[-.42,-.21,0,.21].map(t=>C(t,-.6,.15,.16,b.screen)),P([-.5,-.3],[.5,-.3]),{kind:"circle",c:[-.3,-.12],r:.1,fill:b.dark},{kind:"circle",c:[.3,-.12],r:.1,fill:b.dark}],coin:[{kind:"circle",c:[0,-.42],r:.4,fill:b.gold,main:!0},{kind:"circle",c:[0,-.42],r:.3},{kind:"curve",points:[[.1,-.56],[-.08,-.57],[-.09,-.46],[.08,-.39],[.08,-.29],[-.11,-.28]]},P([0,-.64],[0,-.2])],phone:[C(-.26,-1,.52,1,b.device,!0),C(-.2,-.92,.4,.76,b.screen),{kind:"circle",c:[0,-.08],r:.035,fill:b.paper}],document:[{kind:"polygon",points:[[-.36,-1],[.16,-1],[.36,-.8],[.36,0],[-.36,0]],fill:b.paper,main:!0},P([.16,-1],[.16,-.8],[.36,-.8]),...[-.66,-.5,-.34,-.18].map(t=>P([-.22,t],[.22,t]))],server:[-1,-.66,-.32].flatMap(t=>[C(-.36,t,.72,.3,b.metal,!0),P([-.26,t+.15],[.06,t+.15]),{kind:"circle",c:[.22,t+.15],r:.035,fill:b.green}]),bank:[{kind:"polygon",points:[[-.5,-.74],[0,-1],[.5,-.74]],fill:b.wall,main:!0},C(-.45,-.74,.9,.08,b.wall),...[-.33,-.11,.11,.33].map(t=>C(t-.04,-.66,.08,.56,b.paper)),C(-.5,-.1,1,.1,b.wall)],cloud:[{kind:"polygon",points:Jp(),fill:b.paper,main:!0}],queue:[-.32,0,.32].flatMap(t=>Vp(tl,.7,t)),desk:[C(-.5,-.5,1,.07,b.wood,!0),P([-.42,-.43],[-.42,0]),P([.42,-.43],[.42,0])],computer:[C(-.45,-1,.9,.6,b.device,!0),C(-.39,-.94,.78,.48,b.screen),{kind:"polygon",points:[[-.06,-.4],[.06,-.4],[.1,-.1],[-.1,-.1]],fill:b.device},C(-.25,-.1,.5,.08,b.device)],clock:[{kind:"circle",c:[0,-.48],r:.45,fill:b.paper,main:!0},...[[0,-.9,0,-.82],[.42,-.48,.34,-.48],[0,-.06,0,-.14],[-.42,-.48,-.34,-.48]].map(([t,e,n,s])=>P([t,e],[n,s])),P([0,-.48],[0,-.78]),P([0,-.48],[.2,-.48])],lock:[{kind:"curve",points:[[-.22,-.52],[-.22,-.76],[0,-.96],[.22,-.76],[.22,-.52]]},C(-.36,-.54,.72,.54,b.bus,!0),{kind:"circle",c:[0,-.32],r:.06,fill:b.dark},P([0,-.28],[0,-.14])],"money-arrow":[{kind:"polygon",fill:b.green,main:!0,points:[[-.5,-.4],[.12,-.4],[.12,-.56],[.5,-.3],[.12,-.04],[.12,-.2],[-.5,-.2]]},{kind:"circle",c:[-.2,-.3],r:.16,fill:b.gold},P([-.2,-.4],[-.2,-.2])],tree:[C(-.07,-.36,.14,.36,b.wood),{kind:"circle",c:[0,-.64],r:.3,fill:b.green,main:!0}],school:[C(-.45,-.6,.9,.6,b.wall,!0),{kind:"polygon",points:[[-.5,-.6],[0,-.82],[.5,-.6]],fill:b.roof},C(-.08,-.28,.16,.28,b.wood),C(-.36,-.48,.16,.12,b.screen),C(.2,-.48,.16,.12,b.screen),P([0,-.82],[0,-1]),{kind:"polygon",points:[[0,-1],[.17,-.95],[0,-.9]],fill:b.roof}],hospital:[C(-.4,-.8,.8,.8,b.paper,!0),C(-.045,-.7,.09,.26,"#C8442C"),C(-.13,-.615,.26,.09,"#C8442C"),C(-.1,-.24,.2,.24,b.metal)],factory:[{kind:"polygon",points:[[-.5,0],[-.5,-.5],[-.25,-.65],[-.25,-.5],[0,-.65],[0,-.5],[.25,-.65],[.25,-.5],[.5,-.5],[.5,0]],fill:b.wall,main:!0},C(.3,-.95,.12,.3,b.dark),C(-.38,-.32,.16,.12,b.screen),C(-.08,-.32,.16,.12,b.screen),C(.22,-.32,.16,.12,b.screen)],truck:[C(-.5,-.62,.62,.46,b.metal,!0),{kind:"polygon",points:[[.12,-.16],[.12,-.5],[.34,-.5],[.48,-.32],[.48,-.16]],fill:b.bus},{kind:"polygon",points:[[.18,-.46],[.32,-.46],[.42,-.33],[.18,-.33]],fill:b.screen},{kind:"circle",c:[-.3,-.1],r:.1,fill:b.dark},{kind:"circle",c:[.3,-.1],r:.1,fill:b.dark}],cart:[P([-.48,-.78],[-.4,-.62]),{kind:"polygon",points:[[-.4,-.62],[.42,-.62],[.32,-.26],[-.3,-.26]],fill:b.metal,main:!0},P([-.3,-.26],[-.3,-.14],[.32,-.14]),{kind:"circle",c:[-.22,-.07],r:.06,fill:b.dark},{kind:"circle",c:[.24,-.07],r:.06,fill:b.dark}],safe:[C(-.4,-.82,.8,.82,b.device,!0),C(-.3,-.72,.6,.62,b.metal),{kind:"circle",c:[0,-.41],r:.13,fill:b.paper},P([0,-.41],[.08,-.47])],bulb:[{kind:"circle",c:[0,-.62],r:.3,fill:b.gold,main:!0},C(-.13,-.33,.26,.2,b.metal),{kind:"curve",points:[[-.09,-.52],[0,-.66],[.09,-.52]]},P([-.08,-.08],[.08,-.08])],gear:[{kind:"polygon",points:[[.42,-.5],[.296,-.378],[.297,-.203],[.122,-.204],[0,-.08],[-.122,-.204],[-.297,-.203],[-.296,-.378],[-.42,-.5],[-.296,-.622],[-.297,-.797],[-.122,-.796],[-0,-.92],[.122,-.796],[.297,-.797],[.296,-.622]],fill:b.metal,main:!0},{kind:"circle",c:[0,-.5],r:.12,fill:b.paper}],database:[{kind:"polygon",points:[[-.35,-.8],[.35,-.8],[.35,-.16],[-.35,-.16]],fill:b.screen,main:!0},{kind:"polygon",points:[[.35,-.8],[.303,-.755],[.175,-.722],[0,-.71],[-.175,-.722],[-.303,-.755],[-.35,-.8],[-.303,-.845],[-.175,-.878],[-0,-.89],[.175,-.878],[.303,-.845]],fill:b.metal},{kind:"curve",points:[[-.35,-.16],[0,-.06],[.35,-.16]]},{kind:"curve",points:[[-.35,-.58],[0,-.48],[.35,-.58]]},{kind:"curve",points:[[-.35,-.37],[0,-.27],[.35,-.37]]}],robot:[P([0,-.95],[0,-1]),C(-.22,-.95,.44,.3,b.metal),{kind:"circle",c:[-.09,-.81],r:.045,fill:b.screen},{kind:"circle",c:[.09,-.81],r:.045,fill:b.screen},C(-.28,-.62,.56,.42,b.metal,!0),P([-.28,-.55],[-.42,-.35]),P([.28,-.55],[.42,-.35]),C(-.2,-.2,.12,.2,b.device),C(.08,-.2,.12,.2,b.device)],ship:[{kind:"polygon",points:[[-.48,-.3],[.48,-.3],[.36,-.04],[-.4,-.04]],fill:b.car,main:!0},C(-.42,-.62,.14,.32,b.wall),C(-.24,-.5,.2,.2,b.roof),C(-.02,-.5,.2,.2,b.bus),C(.2,-.5,.2,.2,b.green),{kind:"curve",points:[[-.5,0],[-.3,-.04],[-.1,0],[.1,-.04],[.3,0],[.5,-.04]]}],container:[C(-.46,-.52,.92,.52,b.roof,!0),...[-.3,-.15,0,.15,.3].map(t=>P([t,-.48],[t,-.04]))],warehouse:[{kind:"polygon",points:[[-.46,0],[.46,0],[.46,-.55],[0,-.82],[-.46,-.55]],fill:b.wall,main:!0},C(-.2,-.38,.4,.38,b.metal),P([-.2,-.26],[.2,-.26]),P([-.2,-.13],[.2,-.13])],box:[C(-.36,-.5,.52,.5,b.wood,!0),{kind:"polygon",points:[[-.36,-.5],[.16,-.5],[.36,-.64],[-.16,-.64]],fill:b.wood},{kind:"polygon",points:[[.16,0],[.36,-.14],[.36,-.64],[.16,-.5]],fill:b.wood},P([-.1,-.5],[.1,-.64])],pallet:[C(-.46,-.12,.92,.06,b.wood),...[-.42,-.05,.32].map(t=>C(t,-.06,.1,.06,b.wood)),C(-.42,-.5,.4,.38,b.wood,!0),C(.02,-.5,.4,.38,b.wood),C(-.2,-.82,.4,.32,b.wood)],shop:[C(-.42,-.6,.84,.6,b.wall,!0),{kind:"polygon",points:[[-.48,-.6],[.48,-.6],[.42,-.78],[-.42,-.78]],fill:b.roof},C(-.34,-.48,.34,.26,b.screen),C(.08,-.42,.24,.42,b.wood)],shelf:[C(-.4,-.92,.8,.92,b.paper,!0),P([-.4,-.62],[.4,-.62]),P([-.4,-.32],[.4,-.32]),C(-.32,-.8,.16,.18,b.roof),C(-.1,-.78,.14,.16,b.bus),C(.1,-.5,.22,.18,b.green),C(-.3,-.2,.24,.2,b.wood)],field:[P([-.48,0],[.48,0]),...[-.3,0,.3].flatMap(t=>[{kind:"curve",points:[[t,0],[t-.02,-.25],[t,-.5]]},{kind:"circle",c:[t-.08,-.32],r:.07,fill:b.green,main:!0},{kind:"circle",c:[t+.08,-.42],r:.07,fill:b.green,main:!0},{kind:"circle",c:[t,-.52],r:.06,fill:b.roof}])],cup:[{kind:"polygon",points:[[-.26,-.52],[.26,-.52],[.2,-.1],[-.2,-.1]],fill:b.paper,main:!0},{kind:"curve",points:[[.24,-.44],[.4,-.38],[.22,-.2]]},{kind:"polygon",points:[[-.46,-.1],[.46,-.1],[.36,0],[-.36,0]],fill:b.paper},{kind:"curve",points:[[-.08,-.62],[-.02,-.72],[-.08,-.84]]},{kind:"curve",points:[[.08,-.62],[.14,-.72],[.08,-.84]]}],function:[C(-.38,-.72,.76,.62,b.screen,!0),P([-.14,-.62],[0,-.62],[.14,-.2]),P([.02,-.42],[-.14,-.2])],"api-gateway":[C(-.12,-.8,.24,.8,b.metal,!0),P([-.48,-.55],[-.16,-.55]),P([-.24,-.62],[-.16,-.55],[-.24,-.48]),P([.16,-.3],[.48,-.3]),P([.4,-.37],[.48,-.3],[.4,-.23])],cache:[C(-.34,-.66,.68,.66,b.metal,!0),{kind:"polygon",points:[[.04,-.58],[-.12,-.3],[0,-.3],[-.06,-.08],[.14,-.38],[.02,-.38]],fill:b.gold}],cluster:[{kind:"curve",points:[[-.4,-.8],[0,-.86],[.4,-.8],[.48,-.45],[.4,-.1],[0,-.04],[-.4,-.1],[-.48,-.45],[-.4,-.8]]},C(-.3,-.7,.24,.2,b.screen,!0),C(.06,-.7,.24,.2,b.screen,!0),C(-.12,-.38,.24,.2,b.screen,!0)],board:[C(-.48,-.9,.96,.6,b.board,!0),C(-.34,-.76,.42,.03,b.chalk),C(-.34,-.62,.58,.03,b.chalk),C(-.34,-.48,.3,.03,b.chalk),P([-.3,-.3],[-.36,0]),P([.3,-.3],[.36,0])],book:[{kind:"polygon",points:[[0,-.62],[-.46,-.7],[-.46,-.1],[0,-.04]],fill:b.paper,main:!0},{kind:"polygon",points:[[0,-.62],[.46,-.7],[.46,-.1],[0,-.04]],fill:b.paper,main:!0},P([-.36,-.52],[-.1,-.48]),P([-.36,-.38],[-.1,-.34]),P([.1,-.48],[.36,-.52]),P([.1,-.34],[.36,-.38])],pencil:[{kind:"polygon",points:[[-.38,-.12],[.22,-.72],[.34,-.6],[-.26,0]],fill:b.bus,main:!0},{kind:"polygon",points:[[.22,-.72],[.34,-.6],[.44,-.86]],fill:b.wood},{kind:"polygon",points:[[-.38,-.12],[-.26,0],[-.46,-.02]],fill:b.roof}]},rl=["happy","sad","surprised","worried","idea"],Wp={person:[0,-.87,.11],"person-pointing":[0,-.87,.11],"person-sitting":[-.08,-.9,.1]},il=t=>{let e=Yn(t);return!!e&&e in Wp};var ol=["spin","drive","steam","talk","pulse","float"],Gp=["lesson","pitch","arch","decision","data","timeline","story"],al=8,ll=6,cl=2e5,fl=6e5,ul=24;var pl=["card","line","arrow","polyline","polygon","curve","circle","ellipse","plot","text","highlight","pause","prop","repeat","when","move","link","counter","row","column","grid","axis","timeline","balloon","brace","note","table","bars","chain","animate","lottie"],Ke=["text","prop","card","counter","circle","ellipse"],dl=["row","column","grid","chain"],Xp=50;function F(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e}: expected an object.`)}function R(t,e){if(typeof t!="string"||!t.trim()||t.length>2e3)throw new Error(`${e}: expected text of 1 to 2000 characters.`)}function x(t,e,n=-1e4,s=1e4){if(typeof t!="number"||!Number.isFinite(t)||t<n||t>s)throw new Error(`${e}: expected a number between ${n} and ${s}.`)}function J(t,e){if(typeof t=="string"){if(R(t,e),t.length>300)throw new Error(`${e}: expression too long.`)}else x(t,e)}function V(t,e){if(!Array.isArray(t)||t.length!==2)throw new Error(`${e}: expected [x, y].`);t.forEach((n,s)=>J(n,`${e}[${s}]`))}function te(t,e){t!==void 0&&R(t,e)}function W(t,e,n){if(t!==void 0&&(typeof t!="string"||!e.includes(t)))throw new Error(`${n}: choose one of ${e.join(", ")}.`)}function zn(t){if(!/^[A-Za-z_][A-Za-z_0-9]*$/.test(t)||["__proto__","constructor","prototype",...el].includes(t))throw new Error(`Invalid variable name: "${t}".`)}var Ue=(t,e)=>e.includes("{")||t.exact.has(e)||[...t.repeated].some(n=>e.startsWith(`${n}-`)&&/^\d+$/.test(e.slice(n.length+1)));function Ce(t,e,n,s){s&&t[e]===void 0&&(t[e]=[0,0]),V(t[e],`${n}.${e}`)}function qt(t,e,n,s,r=!1){if(F(t,e),++n.count>500)throw new Error(`${e}: a recipe draws at most 500 steps, counting those inside repeat and when.`);if(s){for(let a of["chapter","say","duration"])if(t[a]!==void 0)throw new Error(`${e}.${a}: put it on the ${s} step itself, not on a step inside it.`);if(t.type==="pause")throw new Error(`${e}: a pause cannot go inside ${s}.`);if(t.type==="repeat"&&s==="repeat")throw new Error(`${e}: a repeat cannot go inside another repeat.`);if(dl.includes(s)&&t.place!==void 0)throw new Error(`${e}.place: the ${s} places the steps inside it.`)}if(!pl.includes(t.type))throw new Error(`${e}: unknown type "${t.type}".`);for(let a of["id","say","chapter"])te(t[a],`${e}.${a}`);if(t.duration!==void 0&&x(t.duration,`${e}.duration`,0,3e4),t.nudge!==void 0){if(["pause","move","link","animate"].includes(t.type))throw new Error(`${e}.nudge: a ${t.type} has no place of its own to move.`);if(!Array.isArray(t.nudge)||t.nudge.length!==2)throw new Error(`${e}.nudge: use [dx, dy].`);t.nudge.forEach((a,l)=>x(a,`${e}.nudge[${l}]`,-900,900))}let i=s!==null&&dl.includes(s)||r;if(t.place!==void 0){if(!Ke.includes(t.type))throw new Error(`${e}.place: only ${Ke.join(", ")} can be placed.`);if(F(t.place,`${e}.place`),R(t.place.to,`${e}.place.to`),!Ue(n,String(t.place.to)))throw new Error(`${e}.place.to: no earlier step has the id "${t.place.to}".`);if(!["below","above","left","right"].includes(t.place.side))throw new Error(`${e}.place.side: choose one of below, above, left, right.`);t.place.gap!==void 0&&x(t.place.gap,`${e}.place.gap`,-200,400),W(t.place.align,["center","start","end"],`${e}.place.align`)}let o=i||t.place!==void 0;if(t.style!==void 0){F(t.style,`${e}.style`);for(let a of["color","fill"]){let l=t.style[a];if(l!==void 0&&(typeof l!="string"||!/^(#[\da-f]{3,8}|[a-z]+)$/i.test(l)))throw new Error(`${e}.style.${a}: use a hex colour or a colour name, no URLs.`)}for(let a of["width","roughness","bowing"])t.style[a]!==void 0&&x(t.style[a],`${e}.style.${a}`,0,20);if(t.style.opacity!==void 0&&x(t.style.opacity,`${e}.style.opacity`,0,1),t.style.dashed!==void 0&&typeof t.style.dashed!="boolean")throw new Error(`${e}: dashed must be a boolean.`);W(t.style.fillStyle,["hachure","solid","zigzag","cross-hatch","dots"],`${e}.style.fillStyle`)}switch(t.type){case"line":case"arrow":case"highlight":V(t.from,`${e}.from`),V(t.to,`${e}.to`),t.thickness!==void 0&&x(t.thickness,`${e}.thickness`,1,200);break;case"polyline":case"polygon":case"curve":if(!Array.isArray(t.points)||t.points.length<(t.type==="polygon"?3:2)||t.points.length>500)throw new Error(`${e}: points needs ${t.type==="polygon"?3:2} to 500 points.`);t.points.forEach((a,l)=>V(a,`${e}.points[${l}]`));break;case"circle":case"ellipse":Ce(t,"center",e,o);for(let a of t.type==="circle"?["r"]:["rx","ry"])J(t[a],`${e}.${a}`),typeof t[a]=="number"&&x(t[a],`${e}.${a}`,0);break;case"text":Ce(t,"at",e,o),R(t.text,`${e}.text`),t.size!==void 0&&x(t.size,`${e}.size`,1,200),t.rotate!==void 0&&x(t.rotate,`${e}.rotate`,-360,360),W(t.font,["hand","body"],`${e}.font`),W(t.anchor,["start","middle","end"],`${e}.anchor`);break;case"card":Ce(t,"at",e,o),J(t.w,`${e}.w`),J(t.h,`${e}.h`);for(let a of["w","h"])typeof t[a]=="number"&&x(t[a],`${e}.${a}`,40);if(R(t.title,`${e}.title`),t.lines!==void 0){if(!Array.isArray(t.lines)||t.lines.length>6)throw new Error(`${e}: at most 6 lines per card.`);t.lines.forEach((a,l)=>R(a,`${e}.lines[${l}]`))}break;case"plot":R(t.fn,`${e}.fn`),t.var!==void 0&&(R(t.var,`${e}.var`),zn(String(t.var))),V(t.domain,`${e}.domain`),V(t.range,`${e}.range`),F(t.box,`${e}.box`);for(let a of["x","y","w","h"])J(t.box[a],`${e}.box.${a}`);if(t.samples!==void 0&&(x(t.samples,`${e}.samples`,2,1e3),!Number.isInteger(t.samples)))throw new Error(`${e}: samples must be an integer.`);break;case"pause":x(t.ms,`${e}.ms`,0,3e4),te(t.ask,`${e}.ask`);break;case"prop":if(!nl(t.name)&&!n.figures.has(String(t.name))){let a=n.figures.size?`, or one the recipe defines (${[...n.figures].join(", ")})`:"";throw new Error(`${e}.name: unknown prop "${String(t.name)}"; use one of ${Br.join(", ")}${a}.`)}if(Ce(t,"at",e,o),t.size!==void 0&&(J(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,10,1e3)),te(t.label,`${e}.label`),t.flip!==void 0&&typeof t.flip!="boolean")throw new Error(`${e}.flip: expected true or false.`);if(t.mood!==void 0){if(!il(t.name))throw new Error(`${e}.mood: only a person (person, person-pointing, person-sitting) has a face.`);W(t.mood,rl,`${e}.mood`)}break;case"repeat":if(J(t.times,`${e}.times`),typeof t.times=="number"&&(x(t.times,`${e}.times`,0,Xp),!Number.isInteger(t.times)))throw new Error(`${e}.times: expected a whole number.`);qt(t.step,`${e}.step`,n,"repeat",i);break;case"when":if(J(t.if,`${e}.if`),!Array.isArray(t.steps)||t.steps.length===0||t.steps.length>50)throw new Error(`${e}.steps: expected 1 to 50 steps.`);t.steps.forEach((a,l)=>qt(a,`${e}.steps[${l}]`,n,s??"when"));break;case"move":if(R(t.target,`${e}.target`),!Ue(n,String(t.target)))throw new Error(`${e}.target: no earlier step has the id "${t.target}".`);V(t.to,`${e}.to`),W(t.along,["line","curve"],`${e}.along`),t.ms!==void 0&&x(t.ms,`${e}.ms`,200,5e3);break;case"lottie":if(R(t.src,`${e}.src`),V(t.at,`${e}.at`),t.size!==void 0&&(J(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,24,1e3)),t.loop!==void 0&&typeof t.loop!="boolean")throw new Error(`${e}.loop: expected true or false.`);break;case"animate":if(R(t.target,`${e}.target`),!Ue(n,String(t.target)))throw new Error(`${e}.target: no earlier step has the id "${t.target}".`);if(W(t.effect,[...ol,"stop"],`${e}.effect`),t.effect===void 0)throw new Error(`${e}.effect: choose one of ${[...ol,"stop"].join(", ")}.`);W(t.speed,["slow","fast"],`${e}.speed`);break;case"link":for(let a of["from","to"])if(R(t[a],`${e}.${a}`),!Ue(n,String(t[a])))throw new Error(`${e}.${a}: no earlier step has the id "${t[a]}".`);te(t.label,`${e}.label`);break;case"counter":if(Ce(t,"at",e,o),J(t.value,`${e}.value`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "R$ {v:0}".`);t.size!==void 0&&x(t.size,`${e}.size`,1,200),W(t.anchor,["start","middle","end"],`${e}.anchor`);break;case"row":case"column":case"grid":if(i)throw new Error(`${e}: a ${t.type} cannot go inside another ${s}.`);if(Ce(t,"at",e,!1),t.gap!==void 0&&x(t.gap,`${e}.gap`,0,400),t.type==="grid"){if(x(t.columns,`${e}.columns`,1,12),!Number.isInteger(t.columns))throw new Error(`${e}.columns: expected a whole number.`)}else W(t.align,["center","start","end"],`${e}.align`);if(!Array.isArray(t.steps)||t.steps.length===0||t.steps.length>50)throw new Error(`${e}.steps: expected 1 to 50 steps.`);t.steps.forEach((a,l)=>{F(a,`${e}.steps[${l}]`);let c=a.type==="repeat"?a.step?.type:a.type;if(!Ke.includes(c))throw new Error(`${e}.steps[${l}]: a ${t.type} holds only ${Ke.join(", ")} (or a repeat of one).`);qt(a,`${e}.steps[${l}]`,n,t.type)});break;case"chain":if(i)throw new Error(`${e}: a chain cannot go inside a ${s}.`);if(Ce(t,"at",e,!1),t.gap!==void 0&&t.gap!=="auto"&&x(t.gap,`${e}.gap`,0,400),W(t.direction,["right","down"],`${e}.direction`),t.wrap!==void 0&&typeof t.wrap!="boolean")throw new Error(`${e}.wrap: expected true or false.`);if(te(t.forward,`${e}.forward`),te(t.back,`${e}.back`),t.size!==void 0&&(J(t.size,`${e}.size`),typeof t.size=="number"&&x(t.size,`${e}.size`,10,1e3)),!Array.isArray(t.steps)||t.steps.length<2||t.steps.length>12)throw new Error(`${e}.steps: a chain joins 2 to 12 pieces.`);t.steps.forEach((a,l)=>{if(F(a,`${e}.steps[${l}]`),!Ke.includes(a.type))throw new Error(`${e}.steps[${l}]: a chain holds only ${Ke.join(", ")}.`);qt(a,`${e}.steps[${l}]`,n,"chain")});break;case"axis":case"timeline":if(V(t.from,`${e}.from`),V(t.to,`${e}.to`),V(t.domain,`${e}.domain`),t.type==="axis"){if(t.ticks!==void 0){if(Array.isArray(t.ticks)){if(t.ticks.length>30)throw new Error(`${e}.ticks: at most 30 marks.`);t.ticks.forEach((a,l)=>x(a,`${e}.ticks[${l}]`))}else if(x(t.ticks,`${e}.ticks`,0,30),!Number.isInteger(t.ticks))throw new Error(`${e}.ticks: expected a whole number.`)}if(te(t.label,`${e}.label`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "{v} km".`)}else{if(!Array.isArray(t.marks)||t.marks.length===0||t.marks.length>20)throw new Error(`${e}.marks: expected 1 to 20 marks.`);t.marks.forEach((a,l)=>{F(a,`${e}.marks[${l}]`),J(a.at,`${e}.marks[${l}].at`),te(a.label,`${e}.marks[${l}].label`),te(a.text,`${e}.marks[${l}].text`)})}break;case"balloon":if(R(t.to,`${e}.to`),!Ue(n,String(t.to)))throw new Error(`${e}.to: no earlier step has the id "${t.to}".`);if(R(t.text,`${e}.text`),String(t.text).length>300)throw new Error(`${e}.text: keep a balloon under 300 characters.`);W(t.side,["below","above","left","right"],`${e}.side`),W(t.kind,["speech","thought"],`${e}.kind`),t.width!==void 0&&x(t.width,`${e}.width`,80,600),t.size!==void 0&&x(t.size,`${e}.size`,12,60);break;case"brace":if(V(t.from,`${e}.from`),V(t.to,`${e}.to`),te(t.label,`${e}.label`),t.flip!==void 0&&typeof t.flip!="boolean")throw new Error(`${e}.flip: expected true or false.`);break;case"note":if(V(t.at,`${e}.at`),R(t.text,`${e}.text`),t.to===void 0==(t.point===void 0))throw new Error(`${e}: a note points either to an element (to) or to a point (point).`);if(t.to!==void 0){if(R(t.to,`${e}.to`),!Ue(n,String(t.to)))throw new Error(`${e}.to: no earlier step has the id "${t.to}".`)}else V(t.point,`${e}.point`);t.size!==void 0&&x(t.size,`${e}.size`,12,60);break;case"table":if(V(t.at,`${e}.at`),!Array.isArray(t.rows)||t.rows.length===0||t.rows.length>12)throw new Error(`${e}.rows: expected 1 to 12 rows.`);if(t.rows.forEach((a,l)=>{if(!Array.isArray(a)||a.length===0||a.length>6)throw new Error(`${e}.rows[${l}]: expected 1 to 6 cells.`);a.forEach((c,p)=>{if(typeof c!="string"||c.length>120)throw new Error(`${e}.rows[${l}][${p}]: expected text of up to 120 characters.`)})}),t.header!==void 0&&typeof t.header!="boolean")throw new Error(`${e}.header: expected true or false.`);t.size!==void 0&&x(t.size,`${e}.size`,12,40);break;case"bars":F(t.box,`${e}.box`);for(let a of["x","y","w","h"])J(t.box[a],`${e}.box.${a}`);if(!Array.isArray(t.values)||t.values.length===0||t.values.length>12)throw new Error(`${e}.values: expected 1 to 12 values.`);if(t.values.forEach((a,l)=>J(a,`${e}.values[${l}]`)),t.labels!==void 0){if(!Array.isArray(t.labels)||t.labels.length>t.values.length)throw new Error(`${e}.labels: at most one label per value.`);t.labels.forEach((a,l)=>R(a,`${e}.labels[${l}]`))}if(t.max!==void 0&&J(t.max,`${e}.max`),t.format!==void 0&&(R(t.format,`${e}.format`),!String(t.format).includes("{v")))throw new Error(`${e}.format: show the number as {v}, e.g. "{v}%".`);break}typeof t.id=="string"&&(s==="repeat"?n.repeated:n.exact).add(t.id)}function Hp(t,e){let n=`defs.${t}`;if(!/^[a-z][a-z0-9-]{1,30}$/.test(t))throw new Error(`${n}: a figure's name is 2 to 31 lowercase letters, digits or -, starting with a letter.`);if(Yn(t)||Object.hasOwn(Un,t)||pl.includes(t)||["define","title","param","switch","var"].includes(t))throw new Error(`${n}: "${t}" is already a prop or a step; choose another name.`);if(F(e,n),!Array.isArray(e.shapes)||e.shapes.length===0||e.shapes.length>ul)throw new Error(`${n}.shapes: expected 1 to ${ul} shapes.`);let s=(r,i)=>{if(typeof r!="number"||!Number.isInteger(r)||r<0||r>100)throw new Error(`${i}: expected a whole number from 0 to 100 (the figure's grid, y down; it stands at 50,100).`)};e.shapes.forEach((r,i)=>{let o=`${n}.shapes[${i}]`;if(F(r,o),r.fill!==void 0&&(typeof r.fill!="string"||!/^(#[0-9a-fA-F]{3,8}|[a-z]{3,20})$/.test(r.fill)))throw new Error(`${o}.fill: a colour, as hex or a plain name.`);if(r.kind==="circle"){if(!Array.isArray(r.c)||r.c.length!==2)throw new Error(`${o}.c: expected [x, y].`);r.c.forEach((l,c)=>s(l,`${o}.c[${c}]`)),s(r.r,`${o}.r`);return}if(!["polygon","polyline","curve"].includes(r.kind))throw new Error(`${o}.kind: choose one of polygon, polyline, curve, circle.`);let a=r.kind==="polygon"?3:2;if(!Array.isArray(r.points)||r.points.length<a||r.points.length>40)throw new Error(`${o}.points: a ${r.kind} takes ${a} to 40 points.`);r.points.forEach((l,c)=>{if(!Array.isArray(l)||l.length!==2)throw new Error(`${o}.points[${c}]: expected [x, y].`);l.forEach((p,u)=>s(p,`${o}.points[${c}][${u}]`))})})}function Qp(t,e){let n=`lottie "${t}"`;F(e,n);let s=JSON.stringify(e).length;if(s>cl)throw new Error(`${n}: ${Math.round(s/1e3)} KB; an animation can have at most ${cl/1e3} KB.`);for(let i of["fr","ip","op","w","h"])x(e[i],`${n}.${i}`,0,1e5);if(typeof e.v!="string"||!Array.isArray(e.layers))throw new Error(`${n}: not a Lottie animation (it needs v and layers).`);let r=(i,o)=>{if(Array.isArray(i))return i.forEach((a,l)=>r(a,`${o}[${l}]`));if(!(!i||typeof i!="object"))for(let[a,l]of Object.entries(i)){if(a==="x"&&typeof l=="string")throw new Error(`${n}: the animation has an expression (code inside it, at ${o}); only animations without expressions play.`);r(l,`${o}.${a}`)}};r(e.layers,"layers");for(let i of Array.isArray(e.assets)?e.assets:[]){let o=i?.p;if(typeof o=="string"&&o&&!o.startsWith("data:")&&!Array.isArray(i.layers))throw new Error(`${n}: an image from outside the animation ("${o.slice(0,40)}"); only images inside it (data:) are kept.`)}return s}function Zp(t){F(t,"The recipe");let e=t;x(e.width,"width",100,4e3),x(e.height,"height",100,4e3);for(let r of["id","title","category"])te(e[r],r);if(e.locale!==void 0&&!(typeof e.locale=="string"&&/^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$/.test(e.locale)&&Intl.NumberFormat.supportedLocalesOf([e.locale]).length>0))throw new Error('locale: expected a language tag such as "en-US" or "pt-BR".');if(W(e.background,["dots","grid","plain"],"background"),W(e.kind,Gp,"kind"),te(e.source,"source"),e.quiz!==void 0&&e.kind!==void 0&&e.kind!=="lesson")throw new Error(`quiz: only a lesson has a quiz (this drawing is a ${e.kind}).`);if(W(e.theme,["paper","chalkboard"],"theme"),e.quiz!==void 0){if(F(e.quiz,"quiz"),R(e.quiz.question,"quiz.question"),!Array.isArray(e.quiz.options)||e.quiz.options.length<2||e.quiz.options.length>4)throw new Error("quiz.options: expected 2 to 4 options.");if(e.quiz.options.forEach((r,i)=>{if(F(r,`quiz.options[${i}]`),R(r.text,`quiz.options[${i}].text`),R(r.why,`quiz.options[${i}].why`),typeof r.right!="boolean")throw new Error(`quiz.options[${i}].right: expected true or false.`)}),e.quiz.options.filter(r=>r.right===!0).length!==1)throw new Error("quiz.options: exactly one option is right.")}if(e.learning!==void 0){F(e.learning,"learning");for(let r of["goal","question","answer","caveat"])R(e.learning[r],`learning.${r}`)}if(e.params!==void 0){F(e.params,"params");for(let[r,i]of Object.entries(e.params))if(zn(r),F(i,`params.${r}`),R(i.label,`params.${r}.label`),x(i.min,`${r}.min`),x(i.max,`${r}.max`),x(i.step,`${r}.step`,1e-6),x(i.value,`${r}.value`,i.min,i.max),i.max<=i.min)throw new Error(`${r}: max must be greater than min.`)}if(e.vars!==void 0){F(e.vars,"vars");for(let[r,i]of Object.entries(e.vars))zn(r),J(i,`vars.${r}`)}if(e.switches!==void 0){F(e.switches,"switches");let r=Object.entries(e.switches);if(r.length>8)throw new Error("switches: at most 8.");for(let[i,o]of r){if(zn(i),Object.hasOwn(e.params??{},i)||Object.hasOwn(e.vars??{},i))throw new Error(`switches.${i}: the name is already a param or a var.`);if(F(o,`switches.${i}`),R(o.label,`switches.${i}.label`),typeof o.on!="boolean")throw new Error(`switches.${i}.on: expected true or false.`)}}if(!Array.isArray(e.steps)||e.steps.length===0||e.steps.length>250)throw new Error("A recipe needs 1 to 250 steps.");let n=new Set;if(e.defs!==void 0){F(e.defs,"defs");let r=Object.entries(e.defs);if(r.length>al)throw new Error(`defs: at most ${al} figures.`);for(let[i,o]of r)Hp(i,o),n.add(i)}if(e.lotties!==void 0){F(e.lotties,"lotties");let r=Object.entries(e.lotties);if(r.length>ll)throw new Error(`lotties: at most ${ll} animations.`);let i=r.reduce((o,[a,l])=>o+Qp(a,l),0);if(i>fl)throw new Error(`lotties: ${Math.round(i/1e3)} KB in all; at most ${fl/1e3} KB.`)}if(e.credits!==void 0){if(!Array.isArray(e.credits)||e.credits.length>5)throw new Error("credits: at most 5 lines.");e.credits.forEach((r,i)=>R(r,`credits[${i}]`))}let s={exact:new Set,repeated:new Set,count:0,figures:n};return e.steps.forEach((r,i)=>qt(r,`Step ${i+1}`,s,null)),{...e,id:e.id??"pasted",title:e.title??"",background:e.background??"dots"}}export{Mr as DEFAULT_PROFILE,Vr as agentsIn,jp as applyChanges,vp as compare,sp as extractAgent,Fp as fromSheets,At as groupPatterns,rp as knownKinds,ee as labelOf,zp as lessonOf,yp as problemText,dp as readCast,op as readProfile,Np as reviewCast,Zp as validateScene,xp as workbookFile,_p as workbookOf,gp as writeCast};
|