| 670 | `))return!0;if(q.end){for(let K of q.end)if(K.type==="newline")return!0}return!1;case"flow-collection":for(let K of q.items){for(let _ of K.start)if(_.type==="newline")return!0;if(K.sep){for(let _ of K.sep)if(_.type==="newline")return!0}if(aR1(K.key)||aR1(K.value))return!0}return!1;default:return!0}}jE_.containsNewline=aR1});var sR1=m((XE_)=>{var JE_=hG8();function ME_(q,K,_){if(K?.type==="flow-collection"){let z=K.end[0];if(z.indent===q&&(z.source==="]"||z.source==="}")&&JE_.containsNewline(K))_(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}XE_.flowIndentCheck=ME_});var tR1=m((DE_)=>{var A44=uY();function WE_(q,K,_){let{uniqueKeys:z}=q.options;if(z===!1)return!1;let Y=typeof z==="function"?z:($,A)=>$===A||A44.isScalar($)&&A44.isScalar(A)&&$.value===A.value;return K.some(($)=>Y($.key,_))}DE_.mapIncludes=WE_});var J44=m((kE_)=>{var O44=a16(),ZE_=t16(),w44=Jn6(),GE_=hG8(),j44=sR1(),TE_=tR1(),H44="All mapping items must start at the same column";function vE_({composeNode:q,composeEmptyNode:K},_,z,Y,$){let O=new($?.nodeClass??ZE_.YAMLMap)(_.schema);if(_.atRoot)_.atRoot=!1;let w=z.offset,j=null;for(let H of z.items){let{start:J,key:M,sep:X,value:P}=H,W=w44.resolveProps(J,{indicator:"explicit-key-ind",next:M??X?.[0],offset:w,onError:Y,parentIndent:z.indent,startOnNewline:!0}),D=!W.found;if(D){if(M){if(M.type==="block-seq")Y(w,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in M&&M.indent!==z.indent)Y(w,"BAD_INDENT",H44)}if(!W.anchor&&!W.tag&&!X){if(j=W.end,W.comment)if(O.comment)O.comment+=` |
| 671 | `+W.comment;else O.comment=W.comment;continue}if(W.newlineAfterProp||GE_.containsNewline(M))Y(M??J[J.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(W.found?.indent!==z.indent)Y(w,"BAD_INDENT",H44);_.atKey=!0;let f=W.end,G=M?q(_,M,W,Y):K(_,f,J,null,W,Y);if(_.schema.compat)j44.flowIndentCheck(z.indent,M,Y);if(_.atKey=!1,TE_.mapIncludes(_,O.items,G))Y(f,"DUPLICATE_KEY","Map keys must be unique");let Z=w44.resolveProps(X??[],{indicator:"map-value-ind",next:P,offset:G.range[2],onError:Y,parentIndent:z.indent,startOnNewline:!M||M.type==="block-scalar"});if(w=Z.end,Z.found){if(D){if(P?.type==="block-map"&&!Z.hasNewline)Y(w,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(_.options.strict&&W.start<Z.found.offset-1024)Y(G.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let T=P?q(_,P,Z,Y):K(_,w,X,null,Z,Y);if(_.schema.compat)j44.flowIndentCheck(z.indent,P,Y);w=T.range[2];let v=new O44.Pair(G,T);if(_.options.keepSourceTokens)v.srcToken=H;O.items.push(v)}else{if(D)Y(G.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(Z.comment)if(G.comment)G.comment+=` |
| 672 | `+Z.comment;else G.comment=Z.comment;let T=new O44.Pair(G);if(_.options.keepSourceTokens)T.srcToken=H;O.items.push(T)}}if(j&&j<w)Y(j,"IMPOSSIBLE","Map comment with trailing content");return O.range=[z.offset,w,j??w],O}kE_.resolveBlockMap=vE_});var M44=m((RE_)=>{var NE_=e16(),yE_=Jn6(),EE_=sR1();function LE_({composeNode:q,composeEmptyNode:K},_,z,Y,$){let O=new($?.nodeClass??NE_.YAMLSeq)(_.schema);if(_.atRoot)_.atRoot=!1;if(_.atKey)_.atKey=!1;let w=z.offset,j=null;for(let{start:H,value:J}of z.items){let M=yE_.resolveProps(H,{indicator:"seq-item-ind",next:J,offset:w,onError:Y,parentIndent:z.indent,startOnNewline:!0});if(!M.found)if(M.anchor||M.tag||J)if(J&&J.type==="block-seq")Y(M.end,"BAD_INDENT","All sequence items must start at the same column");else Y(w,"MISSING_CHAR","Sequence item without - indicator");else{if(j=M.end,M.comment)O.comment=M.comment;continue}let X=J?q(_,J,M,Y):K(_,M.end,H,null,M,Y);if(_.schema.compat)EE_.flowIndentCheck(z.indent,J,Y);w=X.range[2],O.items.push(X)}return O.range=[z.offset,w,j??w],O}RE_.resolveBlockSeq=LE_});var Mv6=m((CE_)=>{function SE_(q,K,_,z){let Y="";if(q){let $=!1,A="";for(let O of q){let{source:w,type:j}=O;switch(j){case"space":$=!0;break;case"comment":{if(_&&!$)z(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let H=w.substring(1)||" ";if(!Y)Y=H;else Y+=A+H;A="";break}case"newline":if(Y)A+=w;$=!0;break;default:z(O,"UNEXPECTED_TOKEN",`Unexpected ${j} at node end`)}K+=w.length}}return{comment:Y,offset:K}}CE_.resolveEnd=SE_});var W44=m((FE_)=>{var xE_=uY(),IE_=a16(),X44=t16(),uE_=e16(),mE_=Mv6(),P44=Jn6(),pE_=hG8(),BE_=tR1(),eR1="Block collections are not allowed within flow collections",qh1=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function gE_({composeNode:q,composeEmptyNode:K},_,z,Y,$){let A=z.start.source==="{",O=A?"flow map":"flow sequence",j=new($?.nodeClass??(A?X44.YAMLMap:uE_.YAMLSeq))(_.schema);j.flow=!0;let H=_.atRoot;if(H)_.atRoot=!1;if(_.atKey)_.atKey=!1;let J=z.offset+z.start.source.length;for(let D=0;D<z.items.length;++D){let f=z.items[D],{start:G,key:Z,sep:T,value:v}=f,V=P44.resolveProps(G,{flow:O,indicator:"explicit-key-ind",next:Z??T?.[0],offset:J,onError:Y,parentIndent:z.indent,startOnNewline:!1});if(!V.found){if(!V.anchor&&!V.tag&&!T&&!v){if(D===0&&V.comma)Y(V.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${O}`);else if(D<z.items.length-1)Y(V.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${O}`);if(V.comment)if(j.comment)j.comment+=` |
| 673 | `+V.comment;else j.comment=V.comment;J=V.end;continue}if(!A&&_.options.strict&&pE_.containsNewline(Z))Y(Z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0){if(V.comma)Y(V.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${O}`)}else{if(!V.comma)Y(V.start,"MISSING_CHAR",`Missing , between ${O} items`);if(V.comment){let E="";q:for(let S of G)switch(S.type){case"comma":case"space":break;case"comment":E=S.source.substring(1);break q;default:break q}if(E){let S=j.items[j.items.length-1];if(xE_.isPair(S))S=S.value??S.key;if(S.comment)S.comment+=` |
| 674 | `+E;else S.comment=E;V.comment=V.comment.substring(E.length+1)}}}if(!A&&!T&&!V.found){let E=v?q(_,v,V,Y):K(_,V.end,T,null,V,Y);if(j.items.push(E),J=E.range[2],qh1(v))Y(E.range,"BLOCK_IN_FLOW",eR1)}else{_.atKey=!0;let E=V.end,S=Z?q(_,Z,V,Y):K(_,E,G,null,V,Y);if(qh1(Z))Y(S.range,"BLOCK_IN_FLOW",eR1);_.atKey=!1;let R=P44.resolveProps(T??[],{flow:O,indicator:"map-value-ind",next:v,offset:S.range[2],onError:Y,parentIndent:z.indent,startOnNewline:!1});if(R.found){if(!A&&!V.found&&_.options.strict){if(T)for(let B of T){if(B===R.found)break;if(B.type==="newline"){Y(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(V.start<R.found.offset-1024)Y(R.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(v)if("source"in v&&v.source&&v.source[0]===":")Y(v,"MISSING_CHAR",`Missing space after : in ${O}`);else Y(R.start,"MISSING_CHAR",`Missing , or : between ${O} items`);let x=v?q(_,v,R,Y):R.found?K(_,R.end,T,null,R,Y):null;if(x){if(qh1(v))Y(x.range,"BLOCK_IN_FLOW",eR1)}else if(R.comment)if(S.comment)S.comment+=` |
| 675 | `+R.comment;else S.comment=R.comment;let I=new IE_.Pair(S,x);if(_.options.keepSourceTokens)I.srcToken=f;if(A){let B=j;if(BE_.mapIncludes(_,B.items,S))Y(E,"DUPLICATE_KEY","Map keys must be unique");B.items.push(I)}else{let B=new X44.YAMLMap(_.schema);B.flow=!0,B.items.push(I);let p=(x??S).range;B.range=[S.range[0],p[1],p[2]],j.items.push(B)}J=x?x.range[2]:R.end}}let M=A?"}":"]",[X,...P]=z.end,W=J;if(X&&X.source===M)W=X.offset+X.source.length;else{let D=O[0].toUpperCase()+O.substring(1),f=H?`${D} must end with a ${M}`:`${D} in block collection must be sufficiently indented and end with a ${M}`;if(Y(J,H?"MISSING_CHAR":"BAD_INDENT",f),X&&X.source.length!==1)P.unshift(X)}if(P.length>0){let D=mE_.resolveEnd(P,W,_.options.strict,Y);if(D.comment)if(j.comment)j.comment+=` |
| 676 | `+D.comment;else j.comment=D.comment;j.range=[z.offset,W,D.offset]}else j.range=[z.offset,W,W];return j}FE_.resolveFlowCollection=gE_});var D44=m((aE_)=>{var QE_=uY(),dE_=DX(),cE_=t16(),lE_=e16(),nE_=J44(),iE_=M44(),rE_=W44();function Kh1(q,K,_,z,Y,$){let A=_.type==="block-map"?nE_.resolveBlockMap(q,K,_,z,$):_.type==="block-seq"?iE_.resolveBlockSeq(q,K,_,z,$):rE_.resolveFlowCollection(q,K,_,z,$),O=A.constructor;if(Y==="!"||Y===O.tagName)return A.tag=O.tagName,A;if(Y)A.tag=Y;return A}function oE_(q,K,_,z,Y){let $=z.tag,A=!$?null:K.directives.tagName($.source,(M)=>Y($,"TAG_RESOLVE_FAILED",M));if(_.type==="block-seq"){let{anchor:M,newlineAfterProp:X}=z,P=M&&$?M.offset>$.offset?M:$:M??$;if(P&&(!X||X.offset<P.offset))Y(P,"MISSING_CHAR","Missing newline after block sequence props")}let O=_.type==="block-map"?"map":_.type==="block-seq"?"seq":_.start.source==="{"?"map":"seq";if(!$||!A||A==="!"||A===cE_.YAMLMap.tagName&&O==="map"||A===lE_.YAMLSeq.tagName&&O==="seq")return Kh1(q,K,_,Y,A);let w=K.schema.tags.find((M)=>M.tag===A&&M.collection===O);if(!w){let M=K.schema.knownTags[A];if(M&&M.collection===O)K.schema.tags.push(Object.assign({},M,{default:!1})),w=M;else{if(M)Y($,"BAD_COLLECTION_TYPE",`${M.tag} used for ${O} collection, but expects ${M.collection??"scalar"}`,!0);else Y($,"TAG_RESOLVE_FAILED",`Unresolved tag: ${A}`,!0);return Kh1(q,K,_,Y,A)}}let j=Kh1(q,K,_,Y,A,w),H=w.resolve?.(j,(M)=>Y($,"TAG_RESOLVE_FAILED",M),K.options)??j,J=QE_.isNode(H)?H:new dE_.Scalar(H);if(J.range=j.range,J.tag=A,w?.format)J.format=w.format;return J}aE_.composeCollection=oE_});var zh1=m((KL_)=>{var _h1=DX();function tE_(q,K,_){let z=K.offset,Y=eE_(K,q.options.strict,_);if(!Y)return{value:"",type:null,comment:"",range:[z,z,z]};let $=Y.mode===">"?_h1.Scalar.BLOCK_FOLDED:_h1.Scalar.BLOCK_LITERAL,A=K.source?qL_(K.source):[],O=A.length;for(let W=A.length-1;W>=0;--W){let D=A[W][1];if(D===""||D==="\r")O=W;else break}if(O===0){let W=Y.chomp==="+"&&A.length>0?` |
| 677 | `.repeat(Math.max(1,A.length-1)):"",D=z+Y.length;if(K.source)D+=K.source.length;return{value:W,type:$,comment:Y.comment,range:[z,D,D]}}let w=K.indent+Y.indent,j=K.offset+Y.length,H=0;for(let W=0;W<O;++W){let[D,f]=A[W];if(f===""||f==="\r"){if(Y.indent===0&&D.length>w)w=D.length}else{if(D.length<w)_(j+D.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(Y.indent===0)w=D.length;if(H=W,w===0&&!q.atRoot)_(j,"BAD_INDENT","Block scalar values in collections must be indented");break}j+=D.length+f.length+1}for(let W=A.length-1;W>=O;--W)if(A[W][0].length>w)O=W+1;let J="",M="",X=!1;for(let W=0;W<H;++W)J+=A[W][0].slice(w)+` |
| 678 | `;for(let W=H;W<O;++W){let[D,f]=A[W];j+=D.length+f.length+1;let G=f[f.length-1]==="\r";if(G)f=f.slice(0,-1);if(f&&D.length<w){let T=`Block scalar lines must not be less indented than their ${Y.indent?"explicit indentation indicator":"first line"}`;_(j-f.length-(G?2:1),"BAD_INDENT",T),D=""}if($===_h1.Scalar.BLOCK_LITERAL)J+=M+D.slice(w)+f,M=` |
| 679 | `;else if(D.length>w||f[0]==="\t"){if(M===" ")M=` |