From 27cdd15a80d8bfa6eaa1c9c1c3857b1bf117012c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Moitti=C3=A9?= Date: Wed, 5 Jul 2023 16:33:46 +0200 Subject: [PATCH] Release version 0.2.1 --- changelog.md | 3 ++- dist/githubator-plugin.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index d25f2a8..0ba29fc 100644 --- a/changelog.md +++ b/changelog.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) -## [Unreleased] +## [0.2.1] - 2023/07/05 ### Changed @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Setup first version of parser. - Setup first version of renderer. +[0.2.1]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.2.1 [0.2.0]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.2.0 [0.1.1]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.1.1 [0.1.0]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.1.0 diff --git a/dist/githubator-plugin.js b/dist/githubator-plugin.js index 91a249f..93e5dc7 100644 --- a/dist/githubator-plugin.js +++ b/dist/githubator-plugin.js @@ -1,2 +1,2 @@ /*! For license information please see githubator-plugin.js.LICENSE.txt */ -(()=>{var t={181:(t,e)=>{(()=>{var t={985:function(t){var e;"undefined"!=typeof self&&self,e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){"use strict";var r=Array.prototype,i=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},s=/[&"'<>\\]/g;function a(t,e){return i.hasOwnProperty.call(t,e)}function c(t){return o[t]}function l(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,l.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var s=Object.getOwnPropertyDescriptor(i,"stack");(o=s&&(s.get||function(){return s.value}))||(o=function(){return i.stack})}else{var a=new Error(t).stack;o=function(){return a}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function u(t){return"[object Function]"===i.toString.call(t)}function f(t){return"[object Array]"===i.toString.call(t)}function h(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)s=i.slice(0,t.length),i.slice(s.length,l).forEach((function(t,n){n2?i-2:0),s=2;s0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:c,Root:f,NodeList:u,Value:l,Literal:h,Symbol:p,Group:d,Array:m,Pair:y,Dict:v,Output:$,Capture:K,TemplateData:V,If:b,IfAsync:w,InlineIf:_,For:k,AsyncEach:E,AsyncAll:x,Macro:O,Caller:S,Import:T,FromImport:A,FunCall:L,Filter:N,FilterAsync:C,KeywordArgs:j,Block:P,Super:I,Extends:R,Include:M,Set:B,Switch:D,Case:F,LookupVal:g,BinOp:q,In:z,Is:W,Or:G,And:H,Not:Y,Add:J,Concat:X,Sub:Q,Mul:Z,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:st,CompareOperand:at,CallExtension:ct,CallExtensionAsync:lt,printNodes:function t(e,n){if(n=n||0,ut(e.typename+": ",n),e instanceof u)ut("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof ct)ut(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof c?r.push([e,t]):(i=i||{})[e]=t})),i?ut(JSON.stringify(i,null,2)+"\n",null,!0):ut("\n"),r.forEach((function(e){var r=e[0],i=e[1];ut("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),s=n(3),a=n(0).TemplateError,c=n(2).Frame,l=n(1).Obj,u={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},f=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new a(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var c=this._tmpid();this._emitLine(", "+this._makeCallback(c)),this._emitLine(this.buffer+" += runtime.suppressValue("+c+", "+a+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+a+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof s.Symbol?n=new s.Literal(n.lineno,n.colno,n.value):n instanceof s.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+u[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,s.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,s.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof s.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,s){var a=n._tmpid();n._emitLine("var "+a+" = "+o+"["+r+"]["+s+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+s+"]);"),e.set(t.name.children[s].value,a)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var a=t.name.children,c=a[0],l=a[1],u=this._tmpid(),f=this._tmpid();e.set(c.value,u),e.set(l.value,f),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+u+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+f+" = "+o+"["+u+"];"),this._emitLine('frame.set("'+c.value+'", '+u+");"),this._emitLine('frame.set("'+l.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var h=this._tmpid();e.set(t.name.value,h),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+h+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),a=this._tmpid(),c=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+a+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof s.Array){var l=t.name.children.length;this._emit("runtime."+c+"("+a+", "+l+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var u=t.name.value;this._emitLine("runtime."+c+"("+a+", 1, function("+u+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+u+'", '+u+");"),e.set(u,u)}this._emitLoopBindings(t,a,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var f=this._tmpid();this._emitLine("}, "+this._makeCallback(f)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+f+";"),t.else_&&(this._emitLine("if (!"+a+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),a=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof s.Dict?i=e:(n.assertType(e,s.Symbol),r.push(e))}));var l,u=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),f=r.map((function(t){return'"'+t.value+'"'})),h=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));l=a?e.push(!0):new c,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+u.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),l.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,l),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,l)})),this._emitLine("frame = "+(a?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),s=this._makeCallback(i),a=n?"true":"false",c=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+a+", "+o+", "+c+", "+s),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,a=n._tmpid();t instanceof s.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+a+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,a),e.parent?n._emitLine('frame.set("'+o+'", '+a+");"):n._emitLine('context.setVariable("'+o+'", '+a+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof s.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new c,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(s.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new c;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(l);t.exports={compile:function(t,e,n,r,s){void 0===s&&(s={});var a=new f(r,s.throwOnUndefined),c=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return a.compile(o.transform(i.parse(c,n,s),e,r)),a.getCode()},Compiler:f}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var s=o.prototype;return s.resolve=function(t,e){return i.resolve(i.dirname(t),e)},s.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),s=n(15),a=n(0),c=n(5),l=n(18),u=n(10),f=u.FileSystemLoader,h=u.WebLoader,p=u.PrecompiledLoader,d=n(20),m=n(21),y=n(1),v=y.Obj,g=y.EmitterObj,b=n(2),w=b.handleError,_=b.Frame,k=n(22);function E(t,e,n){o((function(){t(e,n)}))}var x={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(w(t,null,null))}}}},O=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=a.isArray(t)?t:[t]:f?this.loaders=[new f("views")]:h&&(this.loaders=[new h("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],a._entries(l).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),a._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=a.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,s=this,c=this,l=null;if(t&&t.raw&&(t=t.raw),a.isFunction(n)&&(i=n,n=null,e=e||!1),a.isFunction(e)&&(i=e,e=!1),t instanceof T)l=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var u=0;u0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var a=this.parsePrimary();if("_"===a.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",a.lineno,a.colno),this.skipSymbol("as")){var c=this.parsePrimary();r.addChild(new o.Pair(a.lineno,a.colno,a,c))}else r.addChild(a);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},c.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},c.parseExtends=function(){var t="extends",e=this.peekToken();this.skipSymbol(t)||this.fail("parseTemplateRef: expected "+t);var n=new o.Extends(e.lineno,e.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(e.value),n},c.parseInclude=function(){var t="include",e=this.peekToken();this.skipSymbol(t)||this.fail("parseInclude: expected "+t);var n=new o.Include(e.lineno,e.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(e.value),n},c.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},c.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},c.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var s=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var a,c=this.peekToken(),l=[];do{this.skipSymbol(n);var u=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);l.push(new o.Case(c.line,c.col,u,f)),c=this.peekToken()}while(c&&c.value===n);switch(c.value){case r:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,s,l,a)},c.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==a.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var c=s[0],l=s[1],u=s[2];u===t?r+=1:u===e&&(r-=1),0===r?(i+=l,this.tokens.backN(c.length-l.length)):i+=c}return new o.Output(a.lineno,a.colno,[new o.TemplateData(a.lineno,a.colno,i)])},c.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},c.parseExpression=function(){return this.parseInlineIf()},c.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},c.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},c.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},c.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},c.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},c.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},c.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},c.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},c.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},c.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},c.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},c.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},c.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},c.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},c.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},c.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},c.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},c.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},c.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},c.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var s=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,s))}else{var a=this.parseExpression();t.addChild(a)}}return t},c.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),s=new o.KeywordArgs(n.lineno,n.colno),a=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(a&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var c=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?s.addChild(new o.Pair(c.lineno,c.colno,c,this.parseExpression())):r.addChild(c)}a=!0}return s.children.length&&r.addChild(s),r},c.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],B=C+this.current();switch(-1!==r.indexOf(M,B)&&(this.forward(),C=B,-1!==r.indexOf(M,B+this.current())&&(C=B+this.current(),this.forward())),C){case"(":R=d;break;case")":R=m;break;case"[":R=y;break;case"]":R=v;break;case"{":R=g;break;case"}":R=b;break;case",":R=_;break;case":":R=k;break;case"~":R=E;break;case"|":R=x;break;default:R=w}return N(R,C,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var D=this._extract("0123456789");return N(O,t+"."+D,e,n)}return N("int",t,e,n)}if(t.match(/^(true|false)$/))return N(S,t,e,n);if("none"===t)return N(T,t,e,n);if("null"===t)return N(T,t,e,n);if(t)return N(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,$=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,N(l,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,N(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil($));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!K){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var V=t.slice(-this.colno);if(/^\s+$/.test(V)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return N(K?p:c,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[t];if(void 0===c)return!1;if("function"==typeof c)o(c,this,e);else{var l=c.length,u=y(c,l);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function s(){return"hole_"+o++}function a(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,s=r.repeat(" ",n/2-n%2),a=r.repeat(" ",n/2);return i.copySafeness(t,s+t+a)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var s in t)o.push([s,t[s]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],s=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(s)&&(s=s.toUpperCase())),o>s?1:o===s?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var s=t.split("\n"),a=r.repeat(" ",e),c=s.map((function(t,e){return 0!==e||n?""+a+t:t})).join("\n");return i.copySafeness(t,c)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=c,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=l(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=l(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var s="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return s=n+t.split("").join(n)+n,i.copySafeness(t,s);var a=t.indexOf(e);if(0===r||-1===a)return t;for(var c=0,l=0;a>-1&&(-1===r||l=i&&u.push(n),o.push(u)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,s=r.map(t,(function(t){return t})),a=r.getAttrGetter(i);return s.sort((function(t,s){var c=i?a(t):t,l=i?a(s):s;if(o.env.opts.throwOnUndefined&&i&&(void 0===c||void 0===l))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(c)&&r.isString(l)&&(c=c.toLowerCase(),l=l.toLowerCase()),cl?e?-1:1:0})),s})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=u((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return a(t)}));return i.copySafeness(t,e.join(" "))},e.trim=u,e.truncate=function(t,e,n,r){var s=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var a=t.lastIndexOf(" ",e);-1===a&&(a=e),t=t.substring(0,a)}return t+=null!=r?r:"...",i.copySafeness(s,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var f=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,h=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){s(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(f),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":h.test(i)?''+i+"":m.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return s(n)?e:n};var y=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return s(r)?e:r}));e.int=y,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return t=Array.prototype.slice.call(arguments),e=-1,{current:null,reset:function(){e=-1,this.current=null},next:function(){return++e>=t.length&&(e=0),this.current=t[e],this.current}};var t,e},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,s=n(5),a=n(7).Environment,c=n(24);function l(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function u(t,e){(e=e||{}).isString=!0;var n=e.env||new a([]),r=e.wrapper||c;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([f(t,e.name,n)],e)}function f(t,e,n){var r,i=(n=n||new a([])).asyncFilters,c=n.extensionsList;e=e.replace(/\\/g,"/");try{r=s.compile(t,i,c,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new a([]),o=e.wrapper||c;if(e.isString)return u(t,e);var s=r.existsSync(t)&&r.statSync(t),h=[],p=[];if(s.isFile())h.push(f(r.readFileSync(t,"utf-8"),e.name||t,n));else if(s.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(s){var a=i.join(o,s),c=a.substr(i.join(t,"/").length),u=r.statSync(a);u&&u.isDirectory()?l(c+="/",e.exclude)||n(a):l(c,e.include)&&p.push(a)}))}(t);for(var d=0;dt.length||i>0&&s>=r||i<0&&s<=r);s+=i)o.push(n.memberLookup(t,s));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}r.r(i),r.d(i,{Component:()=>f,ComponentAttribute:()=>n,ComponentAttributeDefinition:()=>b,ComponentDefinition:()=>p,ComponentDrawOption:()=>w,ComponentLink:()=>x,ComponentLinkDefinition:()=>S,DefaultConfiguration:()=>Wi,DefaultData:()=>$i,DefaultDrawer:()=>yi,DefaultMetadata:()=>gi,DefaultParser:()=>_i,DefaultPlugin:()=>Yi,DefaultRender:()=>xi,FileInformation:()=>s,FileInput:()=>N,ParseError:()=>Ci});var e=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,value:null,type:null,definition:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.name,r=t.value,i=t.type,o=t.definition;this.name=n||null,this.value=null!=r?r:null,this.type=i||null,this.definition=o||null}var n,r;return n=e,r=[{key:"hasError",value:function(){return null===this.definition?null===this.value||("array"===this.type.toLowerCase()?!Array.isArray(this.value):t(this.value)!==this.type.toLowerCase()):null!==this.value&&void 0!==this.value&&(this.__typeOfValueValidation()||this.__ruleValueValidation()||this.__ruleMinAndMaxValidation()||this.__ruleRegexValidation())}},{key:"__typeOfValueValidation",value:function(){var e=this.type.toLowerCase();return"array"===e?"Link"===this.definition.type?!Array.isArray(this.value)||this.value.some((function(t){return"string"!=typeof t})):!Array.isArray(this.value):t(this.value)!==e}},{key:"__ruleValueValidation",value:function(){return this.definition.rules.values&&!this.definition.rules.values.includes(this.value)}},{key:"__ruleMinAndMaxValidation",value:function(){var t="number"==typeof this.value?this.value:this.value.length;return null!==this.definition.rules.min&&tthis.definition.rules.max}},{key:"__ruleRegexValidation",value:function(){return null!==this.definition.rules.regex&&!new RegExp(this.definition.rules.regex).test(this.value)}}],r&&function(e,n){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{path:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.path;this.path=n||null}var e,n;return e=t,(n=[{key:"fileName",get:function(){return this.path?this.path.replace(/^.*[\\/]/,""):null}}])&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{id:null,name:null,definition:null,drawOption:null,attributes:[]};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),t=s.call(this,e);var n=e.id,r=e.name,i=e.definition,o=e.drawOption,a=e.attributes;return t.__class="Component",t.id=n||null,t.name=r||null,t.definition=i||null,t.drawOption=o||null,t.attributes=a||[],t}return e=u,r=[{key:"setReferenceAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.containerRef===t.definition.type}));if(e){var r=this.attributes.filter((function(t){var n=t.definition;return(null==n?void 0:n.name)===e.name}));r.length>0?r.forEach((function(e){e.value=t.id})):this.attributes.push(new n({name:e.name,value:t.id,type:"String",definition:e}))}}},{key:"removeAllReferenceAttributes",value:function(t){this.attributes=t?this.attributes.filter((function(e){var n=e.definition,r=e.value;return!("Reference"===n.type&&n.containerRef===t.definition.type&&r===t.id)})):this.attributes.filter((function(t){return"Reference"!==t.definition.type}))}},{key:"setLinkAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.name===t.definition.attributeRef})),r=this.attributes.find((function(t){var n=t.definition;return"Link"===n.type&&e.name===n.name}));r&&!r.value.includes(t.target)?r.value.push(t.target):r||this.attributes.push(new n({name:e.name,definition:e,type:"Array",value:[t.target]}))}},{key:"removeLinkAttribute",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.attributes=this.attributes.filter((function(n){if(e&&n.name!==e)return!0;if(n.definition&&"Link"===n.definition.type){var r=n.value.findIndex((function(e){return e===t}));return r>=0&&n.value.splice(r,1),0!==n.value.length}return!0}))}},{key:"getAttributeByName",value:function(t){return this.__getAttributeByName(this.attributes,t)}},{key:"__getAttributeByName",value:function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,icon:null,model:null,displayName:null,description:null,url:null,parentTypes:[],childrenTypes:[],definedAttributes:[],isContainer:!1,displayType:null,preventChildrenMovement:!1,childrenPerLine:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.type,r=e.icon,i=e.model,o=e.displayName,s=e.description,a=e.url,c=e.parentTypes,l=e.childrenTypes,u=e.definedAttributes,f=e.isContainer,h=e.displayType,p=e.preventChildrenMovement,d=e.childrenPerLine;this.type=n||null,this.icon=r||null,this.model=i||null,this.displayName=o||null,this.description=s||null,this.url=a||null,this.parentTypes=c||[],this.childrenTypes=l||[],this.definedAttributes=u||[],this.isContainer=void 0!==f&&f,this.displayType=h||null,this.preventChildrenMovement=null!=p&&p,this.childrenPerLine=null!=d?d:null}));const p=h;function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function y(t,e,n){return(e=v(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v(t){var e=function(t,e){if("object"!==d(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===d(e)?e:String(e)}var g=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,displayName:null,description:null,url:null,linkType:null,linkRef:[],linkColor:"black",linkWidth:2,linkDashStyle:null,containerRef:null,required:!1,definedAttributes:[],rules:{values:null,min:null,max:null,regex:null}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.name,r=e.type,i=e.displayName,o=e.description,s=e.url,a=e.linkType,c=e.linkRef,l=e.linkColor,u=e.linkWidth,f=e.linkDashStyle,h=e.containerRef,p=e.definedAttributes,d=e.required,v=e.rules;this.name=n||null,this.type=r||null,this.displayName=i||null,this.description=o||null,this.url=s||null,this.linkType=a||null,this.linkRef=c||[],this.linkColor=l||"black",this.linkWidth=u||2,this.linkDashStyle=f||null,this.containerRef=h||null,this.definedAttributes=p||[],this.required=d||!1,this.rules=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{x:null,y:null,width:null,height:null,needsResizing:!1,needsPositioning:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.x,r=e.y,i=e.width,o=e.height,s=e.needsResizing,a=e.needsPositioning;this.x=n||null,this.y=r||null,this.width=i||null,this.height=o||null,this.needsResizing=s||!1,this.needsPositioning=a||!1}));function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},k(t,e)}function E(t){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},E(t)}const x=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&k(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=E(n);if(r){var i=E(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{source:null,target:null,definition:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this);var n=e.source,r=e.target,s=e.definition;return t.__class="Link",t.source=n||null,t.target=r||null,t.definition=s||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(s);var O=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{attributeRef:null,sourceRef:null,targetRef:null,type:null,color:"black",width:2,dashStyle:null,marker:{width:5,height:5,refX:4,refY:2.5,orient:"auto-start-reverse",path:"M 0 0 L 5 2.5 L 0 5"}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.attributeRef,r=e.sourceRef,i=e.targetRef,o=e.type,s=e.color,a=e.width,c=e.dashStyle,l=e.marker;this.attributeRef=n||null,this.sourceRef=r||null,this.targetRef=i||null,this.type=o||null,this.color=s||"black",this.width=a||2,this.dashStyle=c||null,this.marker=l||{width:5,height:5,refX:4,refY:2.5,orient:"auto-start-reverse",path:"M 0 0 L 5 2.5 L 0 5"}}));const S=O;function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function A(t,e){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},A(t,e)}function L(t){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},L(t)}const N=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&A(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=L(n);if(r){var i=L(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===T(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,name:null,content:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this,e);var n=e.content;return t.content=n||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(s);class C extends Map{constructor(t,e=P){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(j(this,t))}has(t){return super.has(j(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}(this,t))}}function j({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function P(t){return null!==t&&"object"==typeof t?t.valueOf():t}function I(t){return t}function R(){}function M(t){return null==t?R:function(){return this.querySelector(t)}}function B(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function D(){return[]}function F(t){return null==t?D:function(){return this.querySelectorAll(t)}}function $(t){return function(){return this.matches(t)}}function K(t){return function(e){return e.matches(t)}}var V=Array.prototype.find;function U(){return this.firstElementChild}var q=Array.prototype.filter;function z(){return Array.from(this.children)}function W(t){return new Array(t.length)}function G(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function H(t,e,n,r,i,o){for(var s,a=0,c=e.length,l=o.length;ae?1:t>=e?0:NaN}G.prototype={constructor:G,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Z="http://www.w3.org/1999/xhtml";const tt={svg:"http://www.w3.org/2000/svg",xhtml:Z,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function et(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),tt.hasOwnProperty(e)?{space:tt[e],local:t}:t}function nt(t){return function(){this.removeAttribute(t)}}function rt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function it(t,e){return function(){this.setAttribute(t,e)}}function ot(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function st(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function at(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ct(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function lt(t){return function(){this.style.removeProperty(t)}}function ut(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ft(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function ht(t,e){return t.style.getPropertyValue(e)||ct(t).getComputedStyle(t,null).getPropertyValue(e)}function pt(t){return function(){delete this[t]}}function dt(t,e){return function(){this[t]=e}}function mt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function yt(t){return t.trim().split(/^|\s+/)}function vt(t){return t.classList||new gt(t)}function gt(t){this._node=t,this._names=yt(t.getAttribute("class")||"")}function bt(t,e){for(var n=vt(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var qt=[null];function zt(t,e){this._groups=t,this._parents=e}function Wt(){return new zt([[document.documentElement]],qt)}zt.prototype=Wt.prototype={constructor:zt,select:function(t){"function"!=typeof t&&(t=M(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=_&&(_=w+1);!(b=v[_])&&++_=0;)(r=i[o])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Q);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?lt:"function"==typeof e?ft:ut)(t,e,null==n?"":n)):ht(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?pt:"function"==typeof e?mt:dt)(t,e)):this.node()[t]},classed:function(t,e){var n=yt(t+"");if(arguments.length<2){for(var r=vt(this.node()),i=-1,o=n.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),s=o.length;if(!(arguments.length<2)){for(a=e?$t:Ft,r=0;r{}};function Yt(){for(var t,e=0,n=arguments.length,r={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),s=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s0)for(var n,r,i=new Array(n),o=0;o=0&&e._call.call(void 0,t),e=e._next;--ne}()}finally{ne=0,function(){for(var t,e,n=te,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:te=e);ee=t,ve(r)}(),ae=0}}function ye(){var t=le.now(),e=t-se;e>oe&&(ce-=e,se=t)}function ve(t){ne||(re&&(re=clearTimeout(re)),t-ae>24?(t<1/0&&(re=setTimeout(me,t-le.now()-ce)),ie&&(ie=clearInterval(ie))):(ie||(se=le.now(),ie=setInterval(ye,oe)),ne=1,ue(me)))}function ge(t,e,n){var r=new pe;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}pe.prototype=de.prototype={constructor:pe,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?fe():+n)+(null==e?0:+e),this._next||ee===this||(ee?ee._next=this:te=this,ee=this),this._call=t,this._time=n,ve()},stop:function(){this._call&&(this._call=null,this._time=1/0,ve())}};var be=Zt("start","end","cancel","interrupt"),we=[],_e=0,ke=3;function Ee(t,e,n,r,i,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(c){var l,u,f,h;if(1!==n.state)return a();for(l in i)if((h=i[l]).name===n.name){if(h.state===ke)return ge(o);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[l]):+l_e)throw new Error("too late; already scheduled");return n}function Oe(t,e){var n=Se(t,e);if(n.state>ke)throw new Error("too late; already running");return n}function Se(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Te(t,e){var n,r,i,o=t.__transition,s=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):s=!1;s&&delete t.__transition}}function Ae(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Le,Ne=180/Math.PI,Ce={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function je(t,e,n,r,i,o){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Ae(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,s.rotate,a,c),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Ae(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,s.skewX,a,c),function(t,e,n,r,o,s){if(t!==n||e!==r){var a=o.push(i(o)+"scale(",null,",",null,")");s.push({i:a-4,x:Ae(t,n)},{i:a-2,x:Ae(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,c),o=s=null,function(t){for(var e,n=-1,r=c.length;++n>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?sn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?sn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=He.exec(t))?new cn(e[1],e[2],e[3],1):(e=Ye.exec(t))?new cn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Je.exec(t))?sn(e[1],e[2],e[3],e[4]):(e=Xe.exec(t))?sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Qe.exec(t))?dn(e[1],e[2]/100,e[3]/100,1):(e=Ze.exec(t))?dn(e[1],e[2]/100,e[3]/100,e[4]):tn.hasOwnProperty(t)?on(tn[t]):"transparent"===t?new cn(NaN,NaN,NaN,0):null}function on(t){return new cn(t>>16&255,t>>8&255,255&t,1)}function sn(t,e,n,r){return r<=0&&(t=e=n=NaN),new cn(t,e,n,r)}function an(t,e,n,r){return 1===arguments.length?((i=t)instanceof Ke||(i=rn(i)),i?new cn((i=i.rgb()).r,i.g,i.b,i.opacity):new cn):new cn(t,e,n,null==r?1:r);var i}function cn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ln(){return`#${pn(this.r)}${pn(this.g)}${pn(this.b)}`}function un(){const t=fn(this.opacity);return`${1===t?"rgb(":"rgba("}${hn(this.r)}, ${hn(this.g)}, ${hn(this.b)}${1===t?")":`, ${t})`}`}function fn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function hn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function pn(t){return((t=hn(t))<16?"0":"")+t.toString(16)}function dn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new yn(t,e,n,r)}function mn(t){if(t instanceof yn)return new yn(t.h,t.s,t.l,t.opacity);if(t instanceof Ke||(t=rn(t)),!t)return new yn;if(t instanceof yn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(s=e===o?(n-r)/a+6*(n0&&c<1?0:s,new yn(s,a,c,t.opacity)}function yn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function vn(t){return(t=(t||0)%360)<0?t+360:t}function gn(t){return Math.max(0,Math.min(1,t||0))}function bn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function wn(t,e,n,r,i){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*n+(1+3*t+3*o-3*s)*r+s*i)/6}Fe(Ke,rn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:en,formatHex:en,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return mn(this).formatHsl()},formatRgb:nn,toString:nn}),Fe(cn,an,$e(Ke,{brighter(t){return t=null==t?Ue:Math.pow(Ue,t),new cn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ve:Math.pow(Ve,t),new cn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new cn(hn(this.r),hn(this.g),hn(this.b),fn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ln,formatHex:ln,formatHex8:function(){return`#${pn(this.r)}${pn(this.g)}${pn(this.b)}${pn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:un,toString:un})),Fe(yn,(function(t,e,n,r){return 1===arguments.length?mn(t):new yn(t,e,n,null==r?1:r)}),$e(Ke,{brighter(t){return t=null==t?Ue:Math.pow(Ue,t),new yn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ve:Math.pow(Ve,t),new yn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new cn(bn(t>=240?t-240:t+120,i,r),bn(t,i,r),bn(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new yn(vn(this.h),gn(this.s),gn(this.l),fn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=fn(this.opacity);return`${1===t?"hsl(":"hsla("}${vn(this.h)}, ${100*gn(this.s)}%, ${100*gn(this.l)}%${1===t?")":`, ${t})`}`}}));const _n=t=>()=>t;function kn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):_n(isNaN(t)?e:t)}const En=function t(e){var n=function(t){return 1==(t=+t)?kn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):_n(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=an(t)).r,(e=an(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),s=kn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=s(e),t+""}}return r.gamma=t,r}(1);function xn(t){return function(e){var n,r,i=e.length,o=new Array(i),s=new Array(i),a=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=ro&&(i=e.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,c.push({i:s,x:Ae(n,r)})),o=Sn.lastIndex;return o=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?xe:Oe;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}(n,t,e))},attr:function(t,e){var n=et(t),r="transform"===n?Re:An;return this.attrTween(t,"function"==typeof e?(n.local?In:Pn)(n,r,De(this,"attr."+t,e)):null==e?(n.local?Nn:Ln)(n):(n.local?jn:Cn)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=et(t);return this.tween(n,(r.local?Rn:Mn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Ie:An;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=ht(this,t),s=(this.style.removeProperty(t),ht(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}(t,r)).on("end.style."+t,Vn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var s=ht(this,t),a=n(this),c=a+"";return null==a&&(this.style.removeProperty(t),c=a=ht(this,t)),s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a))}}(t,r,De(this,"style."+t,e))).each(function(t,e){var n,r,i,o,s="style."+e,a="end."+s;return function(){var c=Oe(this,t),l=c.on,u=null==c.value[s]?o||(o=Vn(e)):void 0;l===n&&i===u||(r=(n=l).copy()).on(a,i=u),c.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var s=ht(this,t);return s===o?null:s===r?i:i=e(r=s,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(De(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=Se(this.node(),n).tween,o=0,s=i.length;o()=>t;function cr(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}function lr(t){return!t.ctrlKey&&!t.button}function ur(){return this.parentNode}function fr(t,e){return null==e?{x:t.x,y:t.y}:e}function hr(){return navigator.maxTouchPoints||"ontouchstart"in this}function pr(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function dr(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=yr)):void 0===e&&(e=mr);for(var n,r,i,o,s,a=new br(t),c=[a];n=c.pop();)if((i=e(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)c.push(r=i[o]=new br(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(gr)}function mr(t){return t.children}function yr(t){return Array.isArray(t)?t[1]:null}function vr(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function gr(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function br(t){this.data=t,this.depth=this.height=0,this.parent=null}function wr(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function _r(t,e,n,r,i){for(var o,s=t.children,a=-1,c=s.length,l=t.value&&(r-e)/t.value;++a=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return dr(this).eachBefore(vr)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;nh&&(h=a),y=u*u*m,(p=Math.max(h/y,y/f))>d){u-=a;break}d=p}v.push(s={value:u,dice:c1?e:1)},n}((1+Math.sqrt(5))/2);function xr(){return 0}function Or(t){return function(){return t}}function Sr(t){return"string"==typeof t?new zt([document.querySelectorAll(t)],[document.documentElement]):new zt([B(t)],qt)}var Tr=Array.prototype.slice;function Ar(t){return function(){return t}}const Lr=Math.PI,Nr=2*Lr,Cr=1e-6,jr=Nr-Cr;function Pr(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Pr;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;eCr)if(Math.abs(u*a-c*l)>Cr&&i){let h=n-o,p=r-s,d=a*a+c*c,m=h*h+p*p,y=Math.sqrt(d),v=Math.sqrt(f),g=i*Math.tan((Lr-Math.acos((d+f-m)/(2*y*v)))/2),b=g/v,w=g/y;Math.abs(b-1)>Cr&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*p)},${this._x1=t+w*a},${this._y1=e+w*c}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(r),a=n*Math.sin(r),c=t+s,l=e+a,u=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Cr||Math.abs(this._y1-l)>Cr)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%Nr+Nr),f>jr?this._append`A${n},${n},0,1,${u},${t-s},${e-a}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>Cr&&this._append`A${n},${n},0,${+(f>=Lr)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Rr(t){return t[0]}function Mr(t){return t[1]}function Br(t){return t.source}function Dr(t){return t.target}class Fr{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function $r(t){return new Fr(t,!0)}function Kr(t){return new Fr(t,!1)}function Vr(t){return((t=Math.exp(t))+1/t)/2}const Ur=function t(e,n,r){function i(t,i){var o,s,a=t[0],c=t[1],l=t[2],u=i[0],f=i[1],h=i[2],p=u-a,d=f-c,m=p*p+d*d;if(m<1e-12)s=Math.log(h/l)/e,o=function(t){return[a+t*p,c+t*d,l*Math.exp(e*t*s)]};else{var y=Math.sqrt(m),v=(h*h-l*l+r*m)/(2*l*n*y),g=(h*h-l*l-r*m)/(2*h*n*y),b=Math.log(Math.sqrt(v*v+1)-v),w=Math.log(Math.sqrt(g*g+1)-g);s=(w-b)/e,o=function(t){var r,i=t*s,o=Vr(b),u=l/(n*y)*(o*(r=e*i+b,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[a+u*p,c+u*d,l*o/Vr(e*i+b)]}}return o.duration=1e3*s*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4),qr=t=>()=>t;function zr(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Wr(t,e,n){this.k=t,this.x=e,this.y=n}Wr.prototype={constructor:Wr,scale:function(t){return 1===t?this:new Wr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Wr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Gr=new Wr(1,0,0);function Hr(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Gr;return t.__zoom}function Yr(t){t.stopImmediatePropagation()}function Jr(t){t.preventDefault(),t.stopImmediatePropagation()}function Xr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Qr(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Zr(){return this.__zoom||Gr}function ti(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function ei(){return navigator.maxTouchPoints||"ontouchstart"in this}function ni(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}Hr.prototype=Wr.prototype;var ri=r(985),ii=r.n(ri);const oi='';function si(t){return si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},si(t)}function ai(t){return function(t){if(Array.isArray(t))return pi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||hi(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ci(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function li(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pluginData=e,this.rootId=r,this.resources=n,this.minWidth=void 0!==i.minWidth?i.minWidth:230,this.minHeight=void 0!==i.minHeight?i.minHeight:50,this.padding=void 0!==i.padding?i.padding:30,this.margin=void 0!==i.margin?i.margin:6,this.lineLengthPerDepth=void 0!==i.lineLengthPerDepth?i.lineLengthPerDepth:[5,1],this.actionMenuButtonSize=i.actionMenuButtonSize||24,this.actions={selection:{current:null,style:"2px solid hsl(205, 100%, 50%)",offset:"3px"},linkCreation:{source:null,target:null,creating:!1},drag:{offsetX:0,offsetY:0,state:!1,target:null},zoom:{scale:1,translate:{x:0,y:0}}}}var e,n;return e=t,n=[{key:"screenToSVG",value:function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||this.svg.node();return new DOMPoint(t,e).matrixTransform(n.getScreenCTM().inverse())}},{key:"SVGToScreen",value:function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||this.svg.node();return new DOMPoint(t,e).matrixTransform(n.getScreenCTM())}},{key:"__getVerticalCoefficient",value:function(t){var e,n,r,i,o,s,a=this,c=this.getLineLengthForDepth(t.depth,null===(e=t.parent)||void 0===e||null===(n=e.data)||void 0===n||null===(r=n.definition)||void 0===r?void 0:r.childrenPerLine);if((null===(i=t.children)||void 0===i?void 0:i.length)>0){var l,u,f=Math.ceil(t.children.filter((function(t){var e,n;return null==t||null===(e=t.data)||void 0===e||null===(n=e.definition)||void 0===n?void 0:n.isContainer})).reduce((function(t,e){return t+a.__getVerticalCoefficient(e)}),0));return t.children.filter((function(t){var e,n;return!(null!==(e=t.data)&&void 0!==e&&null!==(n=e.definition)&&void 0!==n&&n.isContainer)})).reduce((function(t,e){return t+e.value}),0)/c+f+(null!==(l=t.data)&&void 0!==l&&null!==(u=l.definition)&&void 0!==u&&u.isContainer?1:0)}return(c===1/0?1:t.value/c)+(null!==(o=t.data)&&void 0!==o&&null!==(s=o.definition)&&void 0!==s&&s.isContainer?1:0)}},{key:"getLineLengthForDepth",value:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||this.lineLengthPerDepth[Math.min(t,this.lineLengthPerDepth.length-1)]}},{key:"setDisabledStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".component";Sr("#".concat(this.rootId," ").concat(t||".component")).classed("disabled",!0)}},{key:"unsetAllDisabledStyles",value:function(){Sr("#".concat(this.rootId," .disabled")).classed("disabled",!1)}},{key:"dragHandler",value:function(t,e){this.hideActionMenu();var n=document.elementsFromPoint(e.sourceEvent.x,e.sourceEvent.y).find((function(t){return e.subject.data.id!==t.dataset.parentId&&(t.classList.contains("container-background")||t.classList.contains("container"))})),r=Zn("#".concat(e.subject.data.id)).attr("cursor","grabbing");Zn("#root-components").append((function(){return r.node()}));var i=this.screenToSVG(e.sourceEvent.clientX,e.sourceEvent.clientY,this.svg.select(".container").node());if(Zn(t).attr("transform",e.subject.transform="translate(".concat(i.x-this.actions.drag.offsetX,",\n ").concat(i.y-this.actions.drag.offsetY,")")),e.subject.x=i.x-this.actions.drag.offsetX,e.subject.y=i.y-this.actions.drag.offsetY,e.subject.data.definition){var o=e.subject.data.definition.parentTypes.map((function(t){return":not(.".concat(t,")")})).join("");this.setDisabledStyle(".component:not(#".concat(e.subject.data.id,")").concat(o))}return this.drawLinks(),n}},{key:"setupDragBehavior",value:function(){var t=this,e=null,n=!1,r=this.dragHandler.bind(this);return function(){var t,e,n,r,i=lr,o=ur,s=fr,a=hr,c={},l=Zt("start","drag","end"),u=0,f=0;function h(t){t.on("mousedown.drag",p).filter(a).on("touchstart.drag",y).on("touchmove.drag",v,er).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(s,a){if(!r&&i.call(this,s,a)){var c=b(this,o.call(this,s,a),s,a,"mouse");c&&(Zn(s.view).on("mousemove.drag",d,nr).on("mouseup.drag",m,nr),or(s.view),rr(s),n=!1,t=s.clientX,e=s.clientY,c("start",s))}}function d(r){if(ir(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>f}c.mouse("drag",r)}function m(t){Zn(t.view).on("mousemove.drag mouseup.drag",null),sr(t.view,n),ir(t),c.mouse("end",t)}function y(t,e){if(i.call(this,t,e)){var n,r,s=t.changedTouches,a=o.call(this,t,e),c=s.length;for(n=0;n0){var u;this.pluginData.insertComponentBefore(e.subject.data.id,null===(u=o.children[0].data)||void 0===u?void 0:u.id)}}this.pluginData.emitEvent({type:"Drawer",action:s?"update":"move",status:"success",components:[e.subject.data.id]})}},{key:"findInsertionPosition",value:function(t,e){var n=t.x0-e.subject.parent.x0,r=t.y0-e.subject.parent.y0,i=e.x-n,o=e.y-r;if(!t.children)return null;var s=t.children.filter((function(t){var n,r,i;return(null===(n=t.data)||void 0===n?void 0:n.id)!==(null===(r=e.subject)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.id)})).filter((function(t){return t.y0<=o&&t.y1>=o}));if(s.length>0){var a=s.reduce((function(t,e){var n=i-e.x1;return n>0&&n0&&n<=t.distance&&(t={distance:n,component:e}),t}),{distance:1/0,component:null}).component}},{key:"__fillMissingBracket",value:function(t,e,n){var r;if((null===(r=t.children)||void 0===r?void 0:r.length)>1&&!e.componentLeft&&e.componentRight){var i=t.children.findIndex((function(t){var e,r;return(null===(e=t.data)||void 0===e?void 0:e.id)===(null==n||null===(r=n.data)||void 0===r?void 0:r.id)})),o=t.children.findIndex((function(t){var n,r;return(null===(n=t.data)||void 0===n?void 0:n.id)===(null===(r=e.componentRight.data)||void 0===r?void 0:r.id)})),s=i===o-1?o-2:o-1;s>=0&&(e.componentLeft=t.children[s])}}},{key:"__isInverted",value:function(t,e,n){var r=t.children.findIndex((function(t){var n;return t.data.id===(null==e||null===(n=e.data)||void 0===n?void 0:n.id)})),i=t.children.findIndex((function(t){var e;return t.data.id===(null==n||null===(e=n.data)||void 0===e?void 0:e.id)}));return!!(-1===r&&i===t.children.length-1||r>=0&&i>=0&&r>i)}},{key:"createRenderingContext",value:function(){Zn("#".concat(this.rootId,">svg")).empty()?(this.svg=Zn("#".concat(this.rootId)).append("svg").attr("preserveAspectRatio","xMinYMin meet").style("font","10px sans-serif").attr("height","100%").attr("width","100%"),this.svg.append("g").attr("class","container"),this.svg.append("defs"),this.__initializeArrowMarker()):this.svg=Zn("#".concat(this.rootId)).select("svg")}},{key:"draw",value:function(t,e){var n=this,r=this.pluginData.emitEvent({type:"Drawer",action:"write",status:"running",data:{rootId:t}});if(this.rootId=t,this.createRenderingContext(),this.__unselectComponent(),this.drawComponents(e),this.drawLinks(e),this.setViewPortAction(e),Zn("body").on("keyup",(function(t){var e=n.actions.selection.current;"Delete"===t.key&&e&&("Component"===e.__class?n.removeComponentHandler():"Link"===e.__class&&n.removeLinkHandler())})),e){var i=document.querySelector("#".concat(this.rootId," svg")).getBBox(),o=i.width,s=i.height,a=i.x,c=i.y;Zn("#".concat(this.rootId," svg")).attr("viewBox","".concat(a," ").concat(c," ").concat(o," ").concat(s))}this.pluginData.emitEvent({id:r,status:"success"})}},{key:"clickHandler",value:function(t){t.stopPropagation(),this.__selectComponent(Zn(t.currentTarget))}},{key:"drawComponents",value:function(t){var e=this;this.shadowRoot={children:this.pluginData.components,id:"__shadowRoot",name:""};var n=this.buildTree(),r=this.clickHandler.bind(this),i=this.setupDragBehavior(),o=this.svg.select(".container").selectAll("g").data(n,(function(t){return t})).join("g").attr("id",(function(t){return fi(t,1)[0]})).selectAll("g").data((function(t){return fi(t,2)[1]})).join("g").attr("id",(function(t){return t.data.id})).on("click",t?null:r).call(t?function(){}:i).attr("x",(function(t){return t.x0})).attr("y",(function(t){return t.y0})).attr("transform",(function(t){var e=t.x0,n=t.y0;return"translate(".concat(e,",").concat(n,")")}));o.filter((function(t){return"__shadowRoot"!==t.data.id})).attr("class",(function(t){var e=t.data;return"component\n component-".concat(e.definition.model,"\n ").concat(e.definition.type)})).html((function(t){var n=t.data;return ii().renderString(e.resources.models[n.definition.model],li(li({},n),{},{hasError:n.hasError(),getAttribute:function(t){return n.attributes.find((function(e){return e.name===t}))}}))})).select("svg").attr("id",(function(t){var e=t.data;return"svg-".concat(e.id)})).attr("height",(function(t){return e.getComponentHeight(t)})).attr("width",(function(t){return e.getComponentWidth(t)})),o.select(".component-icon").html((function(t){var n=t.data;return e.resources.icons[n.definition.icon]})),o.select("rect").filter((function(t){var e,n;return null===(e=t.data)||void 0===e||null===(n=e.definition)||void 0===n?void 0:n.isContainer})).attr("height",(function(t){return e.getComponentHeight(t)})).attr("width",(function(t){return e.getComponentWidth(t)})),o.select(".component-container").attr("height",(function(t){return e.getComponentHeight(t)-e.minHeight-e.margin})).attr("width",(function(t){return e.getComponentWidth(t)-2*e.margin})).attr("x",(function(){return e.margin})).filter((function(t){return t.children})).append((function(t){var e=t.data;return Zn("#group-".concat(e.id)).node()})),o.select(".component-container>rect").attr("data-parentId",(function(t){return t.data.id}))}},{key:"initializeComponentDrawOptions",value:function(t){var e,n,r,i,o=Math.min(t.value,this.getLineLengthForDepth(t.depth,null===(e=t.data.definition)||void 0===e?void 0:e.childrenPerLine)),s=Math.ceil(this.__getVerticalCoefficient(t)),a=o*(this.minWidth+2*this.margin)+2*t.height*this.padding+(o-1)*(this.padding+2*this.margin),c=s*this.minHeight+t.height*this.padding+(s-1)*(this.padding+this.margin);!t.data.drawOption||null!==(n=t.parent)&&void 0!==n&&null!==(r=n.data)&&void 0!==r&&null!==(i=r.definition)&&void 0!==i&&i.preventChildrenMovement?t.data.drawOption=new w({needsPositioning:!0,width:a,height:c}):(t.data.drawOption.width=a,t.data.drawOption.height=c)}},{key:"buildTree",value:function(){var t=this,e=function(){var t=Er,e=!1,n=1,r=1,i=[0],o=xr,s=xr,a=xr,c=xr,l=xr;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(wr),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,h=e.y1-n;f=r.length)return n(i);const s=new C,a=r[o++];let c=-1;for(const t of i){const e=a(t,++c,i),n=s.get(e);n?n.push(t):s.set(e,[t])}for(const[e,n]of s)s.set(e,t(n,o));return e(s)}(t,0)}(t,Array.from,I,e)}(n,(function(t){var e=t.parent;return e&&"__shadowRoot"!==e.data.id?"group-".concat(e.data.id):"root-components"})).filter((function(t){return"root-__shadowRoot"!==fi(t,1)[0]}))}},{key:"getAnchorPoint",value:function(t,e){if(t.empty()||e.empty())return null;var n,r=t.node().getBoundingClientRect(),i=this.getSelectionCenter(t),o=this.getSelectionCenter(e),s=this.getBearing(this.screenToSVG(i.x,i.y,this.svg.select(".container").node()),this.screenToSVG(o.x,o.y,this.svg.select(".container").node())),a={y:r.top,x:r.x+r.width/2},c={y:r.bottom,x:r.x+r.width/2},l={x:r.left,y:r.top+r.height/2},u={x:r.right,y:r.top+r.height/2};n=s<45||s>=315?c:s>=45&&s<135?u:s>=135&&s<225?a:l;var f=this.screenToSVG(n.x,n.y);return[f.x,f.y]}},{key:"__initializeArrowMarker",value:function(){var t=this.pluginData.getUsedLinkDefinitions();this.svg.select("defs").selectAll("arrow").data(t,(function(t){return"".concat(t.attributeRef,"-").concat(t.sourceRef,"-").concat(t.targetRef)})).join("marker").attr("class","arrow").attr("id",(function(t){return"".concat(t.attributeRef,"-").concat(t.sourceRef,"-").concat(t.targetRef,"-arrow")})).attr("refX",(function(t){return t.marker.refX})).attr("refY",(function(t){return t.marker.refY})).attr("markerWidth",(function(t){return t.marker.width})).attr("markerHeight",(function(t){return t.marker.height})).attr("orient",(function(t){return t.marker.orient})).append("path").attr("d",(function(t){return t.marker.path})).attr("fill",(function(t){return t.color}))}},{key:"drawLinks",value:function(t){var e=this,n=this.pluginData.getLinks();if(n){var r=this.svg.selectAll(".link");r.data(n,(function(t){return t})).join("path").filter((function(t){var e=t.source,n=t.target;return!Zn("#".concat(e)).empty()&&!Zn("#".concat(n)).empty()})).classed("link",!0).attr("d",(function(t){return e.getLinkGenerator(t)(t)})).attr("id",(function(t){var e=t.definition,n=t.source,r=t.target;return"link-".concat(e.sourceRef,"-").concat(e.attributeRef,"-").concat(n,"-").concat(r)})).attr("fill","none").attr("stroke",(function(t){return t.definition.color})).attr("stroke-width",(function(t){return t.definition.width*e.actions.zoom.scale})).attr("stroke-dasharray",(function(t){return t.definition.dashStyle?t.definition.dashStyle.map((function(t){return t*e.actions.zoom.scale})):"none"})).attr("marker-start",(function(t){var e=t.definition,n=e.attributeRef,r=e.sourceRef,i=e.targetRef;return"Reverse"===t.definition.type?"url(#".concat(n,"-").concat(r,"-").concat(i,"-arrow)"):"none"})).attr("marker-end",(function(t){var e=t.definition,n=e.attributeRef,r=e.sourceRef,i=e.targetRef;return"Reverse"!==t.definition.type?"url(#".concat(n,"-").concat(r,"-").concat(i,"-arrow)"):"none"})).attr("cursor",t?"default":"pointer").on("click",(function(n){return t?null:e.clickHandler(n)})),r.raise()}}},{key:"getSelectionCenter",value:function(t){var e=t.node().getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height/2}}},{key:"getBearing",value:function(t,e){var n=e.x-t.x,r=e.y-t.y,i=n/Math.sqrt(Math.pow(n,2)+Math.pow(r,2)),o=r/Math.sqrt(Math.pow(n,2)+Math.pow(r,2));return(Math.atan2(i,o)*(180/Math.PI)+360)%360}},{key:"getLinkGenerator",value:function(t){var e=Zn("#".concat(t.source)),n=Zn("#".concat(t.target)),r=this.getAnchorPoint(e,n),i=this.getAnchorPoint(n,e),o=this.getSelectionCenter(e),s=this.getSelectionCenter(n),a=this.getBearing(this.screenToSVG(o.x,o.y,this.svg.select(".container").node()),this.screenToSVG(s.x,s.y,this.svg.select(".container").node()));return function(t){let e=Br,n=Dr,r=Rr,i=Mr,o=null,s=null,a=function(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Ir(e)}(c);function c(){let c;const l=Tr.call(arguments),u=e.apply(this,l),f=n.apply(this,l);if(null==o&&(s=t(c=a())),s.lineStart(),l[0]=u,s.point(+r.apply(this,l),+i.apply(this,l)),l[0]=f,s.point(+r.apply(this,l),+i.apply(this,l)),s.lineEnd(),c)return s=null,c+""||null}return c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(n=t,c):n},c.x=function(t){return arguments.length?(r="function"==typeof t?t:Ar(+t),c):r},c.y=function(t){return arguments.length?(i="function"==typeof t?t:Ar(+t),c):i},c.context=function(e){return arguments.length?(null==e?o=s=null:s=t(o=e),c):o},c}(a<45||a>=315||a>=135&&a<225?Kr:$r).source((function(){return r})).target((function(){return i}))}},{key:"getComponentHeight",value:function(t){if("__shadowRoot"===t.id)return 0;var e=this.minHeight+this.padding+this.margin,n=t.children?t.children.map((function(t){return t.y1+e})):[0];return t.data.drawOption.height=Math.max.apply(Math,[this.minHeight+t.data.definition.isContainer*e].concat(ai(n))),t.data.drawOption.height}},{key:"getComponentWidth",value:function(t){if("__shadowRoot"===t.id)return 0;var e=t.children?t.children.map((function(t){return t.x1})):[0];return t.data.drawOption.width=Math.max.apply(Math,[this.minWidth].concat(ai(e)))+!!t.children*(this.padding+this.margin),t.data.drawOption.width}},{key:"setupTiles",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={x1:0,y1:0};t.forEach((function(t){t.items=t.items.map((function(t){return t.data.drawOption||(t.data.drawOption=new w({needsPositioning:!0,needsResizing:!0})),t})).map((function(t){return t.data.drawOption.needsResizing&&(e.initializeComponentDrawOptions(t),t.data.drawOption.needsResizing=!1),t})).sort((function(t,e){return t.data.drawOption.needsPositioning&&!e.data.drawOption.needsPositioning?1:t.data.drawOption.needsPositioning||e.data.drawOption.needsPositioning?0:t.data.drawOption.x-e.data.drawOption.x}))}));var i=Math.max.apply(Math,ai(t.map((function(t){return t.items.reduce((function(t,e){return t+e.data.drawOption.width}),0)+(t.items.length+1)*e.padding}))));t.forEach((function(t,o){var s={x1:0,x0:i,y0:t.band+e.padding};if(t.items.forEach((function(t){t.data.drawOption.needsPositioning&&(t.data.drawOption.x=n&&o%2?s.x0-t.data.drawOption.width-e.padding:s.x1+e.padding,t.data.drawOption.y=r.y1+e.padding,t.data.drawOption.needsPositioning=!1),t.x0=t.data.drawOption.x,t.y0=t.data.drawOption.y,s=t,t.x1=t.x0+t.data.drawOption.width,t.y1=t.y0+t.data.drawOption.height})),t.items.length>0){var a=Math.max.apply(Math,ai(t.items.map((function(t){return t.value}))));r=t.items.find((function(t){return t.value===a}))}}))}},{key:"__buildLines",value:function(t,e){var n=this,r=[],i=0,o=r[i];return t.forEach((function(t){if(r=r.sort((function(t,e){return t.band-e.band})),t.data.drawOption&&!t.data.drawOption.needsPositioning)-1===(i=r.findIndex((function(e){return e.band===100*Math.floor(t.data.drawOption.y/100)})))&&(r.push({total:0,band:100*Math.floor(t.data.drawOption.y/100),items:[]}),i=r.length-1);else{for(i=0;i=n.getLineLengthForDepth(e,null===(s=t.parent)||void 0===s||null===(a=s.data)||void 0===a||null===(c=a.definition)||void 0===c?void 0:c.childrenPerLine);){var s,a,c;i+=1}i===r.length&&r.push({total:0,band:i>0?r[i-1].band+100:0,items:[]})}(o=r[i]).total+=t.value,o.items.push(t)})),r.sort((function(t,e){return t.band-e.band}))}},{key:"setViewPortAction",value:function(t){var e=this;if(this.svg.on("click",(function(){e.__unselectComponent(),e.cancelLinkCreationInteraction()})),!t){var n=this.drawLinks.bind(this);this.svg.call(function(){var t,e,n,r=Xr,i=Qr,o=ni,s=ti,a=ei,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,f=Ur,h=Zt("start","zoom","end"),p=500,d=150,m=0,y=10;function v(t){t.property("__zoom",Zr).on("wheel.zoom",x,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",S).filter(a).on("touchstart.zoom",T).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,e){return(e=Math.max(c[0],Math.min(c[1],e)))===t.k?t:new Wr(e,t.x,t.y)}function b(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new Wr(t.k,r,i)}function w(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function _(t,e,n,r){t.on("start.zoom",(function(){k(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){k(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,s=k(t,o).event(r),a=i.apply(t,o),c=null==n?w(a):"function"==typeof n?n.apply(t,o):n,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=t.__zoom,h="function"==typeof e?e.apply(t,o):e,p=f(u.invert(c).concat(l/u.k),h.invert(c).concat(l/h.k));return function(t){if(1===t)t=h;else{var e=p(t),n=l/e[2];t=new Wr(n,c[0]-e[0]*n,c[1]-e[1]*n)}s.zoom(null,t)}}))}function k(t,e,n){return!n&&t.__zooming||new E(t,e)}function E(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function x(t,...e){if(r.apply(this,arguments)){var n=k(this,e).event(t),i=this.__zoom,a=Math.max(c[0],Math.min(c[1],i.k*Math.pow(2,s.apply(this,arguments)))),u=tr(t);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=i.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(i.k===a)return;n.mouse=[u,i.invert(u)],Te(this),n.start()}Jr(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),d),n.zoom("mouse",o(b(g(i,a),n.mouse[0],n.mouse[1]),n.extent,l))}}function O(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,s=k(this,e,!0).event(t),a=Zn(t.view).on("mousemove.zoom",(function(t){if(Jr(t),!s.moved){var e=t.clientX-u,n=t.clientY-f;s.moved=e*e+n*n>m}s.event(t).zoom("mouse",o(b(s.that.__zoom,s.mouse[0]=tr(t,i),s.mouse[1]),s.extent,l))}),!0).on("mouseup.zoom",(function(t){a.on("mousemove.zoom mouseup.zoom",null),sr(t.view,s.moved),Jr(t),s.event(t).end()}),!0),c=tr(t,i),u=t.clientX,f=t.clientY;or(t.view),Yr(t),s.mouse=[c,this.__zoom.invert(c)],Te(this),s.start()}}function S(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,s=tr(t.changedTouches?t.changedTouches[0]:t,this),a=n.invert(s),c=n.k*(t.shiftKey?.5:2),f=o(b(g(n,c),s,a),i.apply(this,e),l);Jr(t),u>0?Zn(this).transition().duration(u).call(_,f,s,t):Zn(this).call(v.transform,f,s,t)}}function T(n,...i){if(r.apply(this,arguments)){var o,s,a,c,l=n.touches,u=l.length,f=k(this,i,n.changedTouches.length===u).event(n);for(Yr(n),s=0;sr&&(r=t)})),o.attr("width",r+20+15).attr("height",30*t.length).attr("x",(function(){return parseInt(i.getAttribute("x"),10)+i.getBBox().width/2-parseInt(this.getAttribute("width"),10)/2})).attr("y",parseInt(i.getAttribute("y"),10)+i.getBBox().height+10),s.on("mouseenter",(function(){Zn(this).select("rect").attr("fill","grey").attr("cursor","pointer")})).on("mouseleave",(function(){Zn(this).select("rect").attr("fill","lightgrey").attr("cursor","default")})).on("click",(function(t,e){n.actions.linkCreation.source=n.actions.selection.current;var r=n.pluginData.addComponent(e);n.pluginData.getComponentById(r).path=n.actions.linkCreation.source.path,n.draw(n.rootId),n.actions.linkCreation.target=Zn("#".concat(r)).datum().data,n.createLink(r)}))}},{key:"startLinkCreationInteraction",value:function(){if(this.actions.selection.current){var t=this.pluginData.getComponentById(this.actions.selection.current.id),e=t.definition.definedAttributes.filter((function(t){return"Link"===t.type})).map((function(t){return":not(.".concat(t.linkRef,")")})).join("");this.actions.linkCreation.creating=!0,this.actions.linkCreation.source=t,this.setDisabledStyle(".component:not(#".concat(t.id,")").concat(e))}}},{key:"removeComponentHandler",value:function(){this.pluginData.removeComponentById(this.actions.selection.current.id),this.pluginData.emitEvent({type:"Drawer",action:"delete",status:"success",components:[this.actions.selection.current.id]}),this.draw(this.rootId)}},{key:"removeLinkHandler",value:function(){this.pluginData.removeLink(this.actions.selection.current),this.pluginData.emitEvent({type:"Drawer",action:"delete",status:"success",components:[]}),this.draw(this.rootId)}},{key:"getMenuActions",value:function(t){return t.classed("component")?[{id:"create-linkable-component",icon:'',handler:function(){var e,n=null===(e=t.datum().data)||void 0===e?void 0:e.getDefinedAttributesByType("Link").map((function(t){return t.linkRef})),r=this.pluginData.definitions.components.filter((function(t){return n.includes(t.type)}));r.length>0&&this.initializeCreateLinkableComponentMenu(r)}},{id:"create-link",icon:'',handler:function(){this.startLinkCreationInteraction()}},{id:"remove-component",icon:oi,handler:this.removeComponentHandler.bind(this)}]:[{id:"remove-link",icon:oi,handler:this.removeLinkHandler.bind(this)}]}},{key:"cancelLinkCreationInteraction",value:function(){this.actions.linkCreation.creating=!1,this.actions.linkCreation.source=null,this.actions.linkCreation.target=null,this.unsetAllDisabledStyles()}},{key:"hideActionMenu",value:function(){Zn("#action-menu").remove(),Zn("#linkable-menu").remove()}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return t.path}))}},{key:"getModelFolders",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return t.path}))}},{key:"parseConfiguration",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.pluginData.emitEvent({parent:n,type:"Parser",action:"read",status:"running",files:[t.path],data:{global:!1}});if(null!=t.content){var i=JSON.parse(t.content);i[this.pluginData.name]?(Object.keys(i[this.pluginData.name]).forEach((function(t){var n=e.pluginData.getComponentById(t);n&&i[e.pluginData.name][t]&&(n.drawOption=new w(i[e.pluginData.name][t]))})),this.pluginData.emitEvent({id:r,status:"success"})):this.pluginData.emitEvent({id:r,status:"warning",data:{code:"no_plugin_content",global:!1}})}else this.pluginData.emitEvent({id:r,status:"warning",data:{code:"no_content",global:!1}})}},{key:"isParsable",value:function(t){return null!=t}}],n&&function(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(t,e){return t[e.path]="",t}),{});return this.renderFiles(t).forEach((function(t){e[t.path]=t.content})),Object.keys(e).map((function(t){return new N({path:t,content:e[t]})}))}},{key:"renderFiles",value:function(){return[]}},{key:"renderConfiguration",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.pluginData.emitEvent({parent:e,type:"Render",action:"write",status:"running",files:[t.path],data:{global:!1}}),r={};this.pluginData.components.filter((function(t){return t.drawOption})).forEach((function(t){r[t.id]=t.drawOption}));var i=JSON.parse(t.content)||{};i[this.pluginData.name]=r,t.content=JSON.stringify(i,(function(t,e){return null===e?void 0:e}),2),this.pluginData.emitEvent({id:n,status:"success"})}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"Error happened when trying to parse.",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"Error";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).name="ParseError",t.startLine=n,t.startColumn=r,t.endLine=s,t.endColumn=a,t.severity=c,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(Si(Error));var ji=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:null,parentId:null,files:null,components:null,links:null,type:null,action:null,status:null,data:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.id,r=e.parentId,i=e.files,o=e.components,s=e.links,a=e.type,c=e.action,l=e.status,u=e.data;this.id=n||null,this.parentId=r||null,this.startDate=null,this.endDate=null,this.files=i||null,this.components=o||null,this.links=s||null,this.type=a||null,this.action=c||null,this.status=l||null,this.data=u||null}));const Pi=ji;function Ii(t){return Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ii(t)}function Ri(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mi(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{name:null,version:null,components:[],definitions:{components:[],links:[]},parseErrors:[]},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=n.name||null,this.version=n.version||null,this.components=n.components||[],this.definitions={components:[],links:[]},n.definitions&&(this.definitions.components=n.definitions.components||[],this.definitions.links=n.definitions.links||[]),this.parseErrors=n.parseErrors||[],this.__eventIndex=0,this.eventManager=r,this.eventLogs=[],this.configuration=e}var e,n;return e=t,n=[{key:"coreVersion",get:function(){return"0.16.0"}},{key:"getComponentById",value:function(t){return this.components.find((function(e){return e.id===t}))||null}},{key:"getComponentsByType",value:function(t){return this.components.filter((function(e){var n=e.definition;return n&&n.type===t}))}},{key:"addComponent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.configuration.defaultFileName||"",r=this.generateComponentId(t);return this.components.push(new f({id:r,name:r,definition:t,path:"".concat(e).concat(n)})),r}},{key:"generateComponentId",value:function(t){for(var e="".concat(t.type,"_"),n=this.components.map((function(t){return t.id})).filter((function(t){return new RegExp("".concat(e,"\\d+")).test(t)})).map((function(t){return parseInt(t.substring(e.length),10)})),r=1;n.includes(r);)r+=1;return"".concat(e).concat(r)}},{key:"removeComponentById",value:function(t){var e=this;this.getChildren(t).forEach((function(t){return e.removeComponentById(t.id)})),this.components=this.components.filter((function(e){return e.id!==t})),this.components.forEach((function(e){e.removeLinkAttribute(t)}))}},{key:"removeLink",value:function(t){var e=t.source,n=t.target,r=t.definition.attributeRef;this.getComponentById(e).removeLinkAttribute(n,r)}},{key:"getLinks",value:function(){var t=this,e=[];return this.definitions.links.forEach((function(n){t.getComponentsByType(n.sourceRef).forEach((function(t){var r=t.getAttributeByName(n.attributeRef);r&&r.value.forEach((function(r){return e.push(new x({definition:n,source:t.id,target:r}))}))}))})),e.concat(this.getWorkflowLinks())}},{key:"getWorkflowLinks",value:function(){var t=this;return this.components.filter((function(t){var e;return null===(e=t.definition.displayType)||void 0===e?void 0:e.match("workflow")})).reduce((function(e,n){var r=t.getChildren(n.id);if(r.length>1)for(var i=0;in,this.components.splice(i,0,r),this.components.splice(n+(it}))}},{key:"emitEvent",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.id;return r?(e=this.getEventLogById(r),Object.keys(n).forEach((function(t){e[t]=n[t]}))):(this.__eventIndex+=1,r=this.__eventIndex,(e=new Pi(Mi(Mi({},n),{},{id:r}))).startDate=Date.now(),this.eventLogs.push(e)),["success","warning","error"].includes(e.status)&&(e.endDate=Date.now()),null!==(t=this.eventManager)&&void 0!==t&&t.next&&this.eventManager.next({plugin:this.name,event:Mi({},e)}),r}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{editor:{syntax:null},defaultFileName:null,defaultFileExtension:null,tags:[]};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.editor=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{event:null,configuration:null,pluginData:null,pluginDrawer:null,pluginMetadata:null,pluginParser:null,pluginRenderer:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.configuration=e.configuration||new Wi,this.data=e.pluginData||new $i(this.configuration,{},e.event),this.__drawer=e.pluginDrawer||new yi(this.data),this.__metadata=e.pluginMetadata||new gi(this.data),this.__parser=e.pluginParser||new _i(this.data),this.__renderer=e.pluginRenderer||new xi(this.data)}var e,n;return e=t,n=[{key:"init",value:function(){var t=this.data.emitEvent({type:"Plugin",action:"init",status:"running"});this.__metadata.parse(t),this.data.initLinkDefinitions(t),this.data.emitEvent({id:t,status:"success"})}},{key:"initResources",value:function(t){this.__drawer.resources=t}},{key:"draw",value:function(t,e){this.__drawer.draw(t,e)}},{key:"parse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this.data.emitEvent({type:"Parser",action:"read",status:"running",files:e.map((function(t){return t.path})).concat(null==t?void 0:t.path),data:{global:!0}});this.__parser.parse(e,n),this.__parser.parseConfiguration(t,n),this.data.emitEvent({id:n,status:"success"})}},{key:"isParsable",value:function(t){return this.__parser.isParsable(t)}},{key:"getModels",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.__parser.getModels(e.filter((function(e){return t.isParsable(e)})))}},{key:"getModelFolders",value:function(t){return this.__parser.getModelFolders(t)}},{key:"render",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this.data.emitEvent({type:"Render",action:"write",status:"running",files:e.map((function(t){return t.path})).concat(t.path),data:{global:!0}});this.__renderer.renderConfiguration(t,n);var r=this.__renderer.render(e,n).concat(t);return this.data.emitEvent({id:n,status:"success"}),r}}],n&&function(t,e){for(var n=0;n":">","\\":"\"},s=/[&"'<>\\]/g;function a(t,e){return i.hasOwnProperty.call(t,e)}function c(t){return o[t]}function l(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,l.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var s=Object.getOwnPropertyDescriptor(i,"stack");(o=s&&(s.get||function(){return s.value}))||(o=function(){return i.stack})}else{var a=new Error(t).stack;o=function(){return a}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function u(t){return"[object Function]"===i.toString.call(t)}function f(t){return"[object Array]"===i.toString.call(t)}function h(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)s=i.slice(0,t.length),i.slice(s.length,l).forEach((function(t,n){n2?i-2:0),s=2;s0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:l,Root:h,NodeList:f,Value:u,Literal:p,Symbol:d,Group:m,Array:y,Pair:v,Dict:g,Output:K,Capture:V,TemplateData:U,If:w,IfAsync:_,InlineIf:k,For:E,AsyncEach:x,AsyncAll:O,Macro:S,Caller:T,Import:A,FromImport:L,FunCall:N,Filter:C,FilterAsync:j,KeywordArgs:P,Block:I,Super:R,Extends:M,Include:B,Set:D,Switch:F,Case:$,LookupVal:b,BinOp:z,In:W,Is:G,Or:H,And:Y,Not:J,Add:X,Concat:Q,Sub:Z,Mul:tt,Div:et,FloorDiv:nt,Mod:rt,Pow:it,Neg:ot,Pos:st,Compare:at,CompareOperand:ct,CallExtension:lt,CallExtensionAsync:ut,printNodes:function t(e,n){if(n=n||0,ft(e.typename+": ",n),e instanceof f)ft("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof lt)ft(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof l?r.push([e,t]):(i=i||{})[e]=t})),i?ft(JSON.stringify(i,null,2)+"\n",null,!0):ft("\n"),r.forEach((function(e){var r=e[0],i=e[1];ft("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),s=n(3),a=n(0).TemplateError,c=n(2).Frame,l=n(1).Obj,u={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},f=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new a(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var c=this._tmpid();this._emitLine(", "+this._makeCallback(c)),this._emitLine(this.buffer+" += runtime.suppressValue("+c+", "+a+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+a+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof s.Symbol?n=new s.Literal(n.lineno,n.colno,n.value):n instanceof s.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+u[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,s.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,s.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof s.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,s){var a=n._tmpid();n._emitLine("var "+a+" = "+o+"["+r+"]["+s+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+s+"]);"),e.set(t.name.children[s].value,a)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var a=t.name.children,c=a[0],l=a[1],u=this._tmpid(),f=this._tmpid();e.set(c.value,u),e.set(l.value,f),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+u+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+f+" = "+o+"["+u+"];"),this._emitLine('frame.set("'+c.value+'", '+u+");"),this._emitLine('frame.set("'+l.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var h=this._tmpid();e.set(t.name.value,h),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+h+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),a=this._tmpid(),c=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+a+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof s.Array){var l=t.name.children.length;this._emit("runtime."+c+"("+a+", "+l+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var u=t.name.value;this._emitLine("runtime."+c+"("+a+", 1, function("+u+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+u+'", '+u+");"),e.set(u,u)}this._emitLoopBindings(t,a,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var f=this._tmpid();this._emitLine("}, "+this._makeCallback(f)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+f+";"),t.else_&&(this._emitLine("if (!"+a+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),a=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof s.Dict?i=e:(n.assertType(e,s.Symbol),r.push(e))}));var l,u=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),f=r.map((function(t){return'"'+t.value+'"'})),h=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));l=a?e.push(!0):new c,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+u.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),l.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,l),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,l)})),this._emitLine("frame = "+(a?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),s=this._makeCallback(i),a=n?"true":"false",c=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+a+", "+o+", "+c+", "+s),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,a=n._tmpid();t instanceof s.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+a+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,a),e.parent?n._emitLine('frame.set("'+o+'", '+a+");"):n._emitLine('context.setVariable("'+o+'", '+a+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof s.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new c,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(s.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new c;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(l);t.exports={compile:function(t,e,n,r,s){void 0===s&&(s={});var a=new f(r,s.throwOnUndefined),c=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return a.compile(o.transform(i.parse(c,n,s),e,r)),a.getCode()},Compiler:f}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var s=o.prototype;return s.resolve=function(t,e){return i.resolve(i.dirname(t),e)},s.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),s=n(15),a=n(0),c=n(5),l=n(18),u=n(10),f=u.FileSystemLoader,h=u.WebLoader,p=u.PrecompiledLoader,d=n(20),m=n(21),y=n(1),v=y.Obj,g=y.EmitterObj,b=n(2),w=b.handleError,_=b.Frame,k=n(22);function E(t,e,n){o((function(){t(e,n)}))}var x={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(w(t,null,null))}}}},O=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=a.isArray(t)?t:[t]:f?this.loaders=[new f("views")]:h&&(this.loaders=[new h("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],a._entries(l).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),a._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=a.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,s=this,c=this,l=null;if(t&&t.raw&&(t=t.raw),a.isFunction(n)&&(i=n,n=null,e=e||!1),a.isFunction(e)&&(i=e,e=!1),t instanceof T)l=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var u=0;u0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var a=this.parsePrimary();if("_"===a.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",a.lineno,a.colno),this.skipSymbol("as")){var c=this.parsePrimary();r.addChild(new o.Pair(a.lineno,a.colno,a,c))}else r.addChild(a);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},c.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},c.parseExtends=function(){var t="extends",e=this.peekToken();this.skipSymbol(t)||this.fail("parseTemplateRef: expected "+t);var n=new o.Extends(e.lineno,e.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(e.value),n},c.parseInclude=function(){var t="include",e=this.peekToken();this.skipSymbol(t)||this.fail("parseInclude: expected "+t);var n=new o.Include(e.lineno,e.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(e.value),n},c.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},c.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},c.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var s=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var a,c=this.peekToken(),l=[];do{this.skipSymbol(n);var u=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);l.push(new o.Case(c.line,c.col,u,f)),c=this.peekToken()}while(c&&c.value===n);switch(c.value){case r:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,s,l,a)},c.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==a.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var c=s[0],l=s[1],u=s[2];u===t?r+=1:u===e&&(r-=1),0===r?(i+=l,this.tokens.backN(c.length-l.length)):i+=c}return new o.Output(a.lineno,a.colno,[new o.TemplateData(a.lineno,a.colno,i)])},c.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},c.parseExpression=function(){return this.parseInlineIf()},c.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},c.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},c.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},c.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},c.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},c.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},c.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},c.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},c.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},c.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},c.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},c.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},c.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},c.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},c.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},c.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},c.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},c.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},c.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},c.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var s=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,s))}else{var a=this.parseExpression();t.addChild(a)}}return t},c.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),s=new o.KeywordArgs(n.lineno,n.colno),a=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(a&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var c=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?s.addChild(new o.Pair(c.lineno,c.colno,c,this.parseExpression())):r.addChild(c)}a=!0}return s.children.length&&r.addChild(s),r},c.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],B=C+this.current();switch(-1!==r.indexOf(M,B)&&(this.forward(),C=B,-1!==r.indexOf(M,B+this.current())&&(C=B+this.current(),this.forward())),C){case"(":R=d;break;case")":R=m;break;case"[":R=y;break;case"]":R=v;break;case"{":R=g;break;case"}":R=b;break;case",":R=_;break;case":":R=k;break;case"~":R=E;break;case"|":R=x;break;default:R=w}return N(R,C,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var D=this._extract("0123456789");return N(O,t+"."+D,e,n)}return N("int",t,e,n)}if(t.match(/^(true|false)$/))return N(S,t,e,n);if("none"===t)return N(T,t,e,n);if("null"===t)return N(T,t,e,n);if(t)return N(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,$=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,N(l,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,N(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil($));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!K){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var V=t.slice(-this.colno);if(/^\s+$/.test(V)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return N(K?p:c,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[t];if(void 0===c)return!1;if("function"==typeof c)o(c,this,e);else{var l=c.length,u=y(c,l);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function s(){return"hole_"+o++}function a(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,s=r.repeat(" ",n/2-n%2),a=r.repeat(" ",n/2);return i.copySafeness(t,s+t+a)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var s in t)o.push([s,t[s]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],s=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(s)&&(s=s.toUpperCase())),o>s?1:o===s?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var s=t.split("\n"),a=r.repeat(" ",e),c=s.map((function(t,e){return 0!==e||n?""+a+t:t})).join("\n");return i.copySafeness(t,c)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=c,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=l(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=l(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var s="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return s=n+t.split("").join(n)+n,i.copySafeness(t,s);var a=t.indexOf(e);if(0===r||-1===a)return t;for(var c=0,l=0;a>-1&&(-1===r||l=i&&u.push(n),o.push(u)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,s=r.map(t,(function(t){return t})),a=r.getAttrGetter(i);return s.sort((function(t,s){var c=i?a(t):t,l=i?a(s):s;if(o.env.opts.throwOnUndefined&&i&&(void 0===c||void 0===l))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(c)&&r.isString(l)&&(c=c.toLowerCase(),l=l.toLowerCase()),cl?e?-1:1:0})),s})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=u((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return a(t)}));return i.copySafeness(t,e.join(" "))},e.trim=u,e.truncate=function(t,e,n,r){var s=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var a=t.lastIndexOf(" ",e);-1===a&&(a=e),t=t.substring(0,a)}return t+=null!=r?r:"...",i.copySafeness(s,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var f=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,h=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){s(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(f),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":h.test(i)?''+i+"":m.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return s(n)?e:n};var y=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return s(r)?e:r}));e.int=y,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return t=Array.prototype.slice.call(arguments),e=-1,{current:null,reset:function(){e=-1,this.current=null},next:function(){return++e>=t.length&&(e=0),this.current=t[e],this.current}};var t,e},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,s=n(5),a=n(7).Environment,c=n(24);function l(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function u(t,e){(e=e||{}).isString=!0;var n=e.env||new a([]),r=e.wrapper||c;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([f(t,e.name,n)],e)}function f(t,e,n){var r,i=(n=n||new a([])).asyncFilters,c=n.extensionsList;e=e.replace(/\\/g,"/");try{r=s.compile(t,i,c,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new a([]),o=e.wrapper||c;if(e.isString)return u(t,e);var s=r.existsSync(t)&&r.statSync(t),h=[],p=[];if(s.isFile())h.push(f(r.readFileSync(t,"utf-8"),e.name||t,n));else if(s.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(s){var a=i.join(o,s),c=a.substr(i.join(t,"/").length),u=r.statSync(a);u&&u.isDirectory()?l(c+="/",e.exclude)||n(a):l(c,e.include)&&p.push(a)}))}(t);for(var d=0;dt.length||i>0&&s>=r||i<0&&s<=r);s+=i)o.push(n.memberLookup(t,s));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{default:()=>Zr});var t=n(181);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e
Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows","childrenTypes":["trigger","job"],"isContainer":true,"available":true,"attributes":[{"name":"name","type":"String","required":true,"description":"The name of the workflow as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows#understanding-the-workflow-file"}]},"trigger":{"type":"trigger","model":"trigger","icon":"DefaultTrigger","available":false,"parentTypes":["workflow"],"attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true}]},"job":{"type":"job","model":"job","displayName":"Job","description":"A workflow run is made up of one or more jobs, which run in parallel by default.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow","icon":"DefaultJob","available":true,"parentTypes":["workflow"],"childrenTypes":["step"],"isContainer":true,"displayType":"workflow","preventChildrenMovement":true,"childrenPerLine":10,"attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true},{"name":"name","type":"String","description":"The name of the job as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"runs-on","type":"String","displayName":"Type of runner","description":"The type of machine to run the job on.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on"},{"name":"needs","displayName":"Previous job(s)","description":"Identify any jobs that must complete successfully before this job will run","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#defining-prerequisite-jobs","type":"Link","linkType":"Reverse","linkRef":"job"}]},"step":{"type":"step","model":"step","icon":"DefaultStep","available":false,"parentTypes":["job"],"description":"Task of the job. Step can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsteps","attributes":[{"name":"job_id","displayName":"Id of job","type":"Reference","containerRef":"job","required":true},{"name":"name","type":"String","description":"The name of the step as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"env","type":"Object","displayName":"Environment variables","description":"Variables for steps to use in the runner environment.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv"}]}}'),trigger:JSON.parse('[{"type":"trigger","icon":"PushTrigger","displayName":"Trigger - push","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push","action":"push","attributes":[{"name":"branches","type":"Array","description":"Select branch name on push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-only-when-a-push-to-specific-branches-occurs"}]},{"type":"trigger","icon":"PullRequestTrigger","displayName":"Trigger - pull request","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a pull request event.","action":"pull_request","attributes":[{"name":"types","type":"Array","displayName":"Activity types","description":"Run your workflow when an activity on a pull request occurs in the workflow\'s repository.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request"}]}]'),step:JSON.parse('[{"type":"step","displayName":"Command step","icon":"CommandStep","name":"command-step","attributes":[{"name":"run","type":"String","required":true}]},{"type":"step","displayName":"Reusable step","icon":"ReusableStep","name":"reusable-step","attributes":[{"name":"uses","type":"String","required":true,"displayName":"External action","description":"Select an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses"},{"name":"with","type":"Object","displayName":"Input parameters","description":"Input parameters of the action defined by \\"uses\\" keyword.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith"}]}]')};function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}const m=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(n);if(r){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===h(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{available:!1};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).available=!!e.available,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(t.ComponentDefinition);function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},g(t)}const b=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=g(n);if(r){var i=g(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{action:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).action=e.action||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(t.ComponentDefinition);function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n!!t&&"object"==typeof t&&t[K]===R,U=t=>!!t&&"object"==typeof t&&t[K]===M,q=t=>!!t&&"object"==typeof t&&t[K]===B,z=t=>!!t&&"object"==typeof t&&t[K]===D,W=t=>!!t&&"object"==typeof t&&t[K]===F,G=t=>!!t&&"object"==typeof t&&t[K]===$;function H(t){if(t&&"object"==typeof t)switch(t[K]){case B:case $:return!0}return!1}function Y(t){if(t&&"object"==typeof t)switch(t[K]){case R:case B:case F:case $:return!0}return!1}const J=t=>(W(t)||H(t))&&!!t.anchor,X=Symbol("break visit"),Q=Symbol("skip children"),Z=Symbol("remove node");function tt(t,e){const n=it(e);U(t)?et(null,t.contents,n,Object.freeze([t]))===Z&&(t.contents=null):et(null,t,n,Object.freeze([]))}function et(t,e,n,r){const i=ot(t,e,n,r);if(Y(i)||z(i))return st(t,r,i),et(t,i,n,r);if("symbol"!=typeof i)if(H(e)){r=Object.freeze(r.concat(e));for(let t=0;t"!==t[t.length-1]&&e("Verbatim tags must end with a >"),n)}const[,n,r]=t.match(/^(.*!)([^!]*)$/);r||e(`The ${t} tag has no suffix`);const i=this.tags[n];return i?i+decodeURIComponent(r):"!"===n?t:(e(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[e,n]of Object.entries(this.tags))if(t.startsWith(n))return e+t.substring(n.length).replace(/[!,[\]{}]/g,(t=>at[t]));return"!"===t[0]?t:`!<${t}>`}toString(t){const e=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let r;if(t&&n.length>0&&Y(t.contents)){const e={};tt(t.contents,((t,n)=>{Y(n)&&n.tag&&(e[n.tag]=!0)})),r=Object.keys(e)}else r=[];for(const[i,o]of n)"!!"===i&&"tag:yaml.org,2002:"===o||t&&!r.some((t=>t.startsWith(o)))||e.push(`%TAG ${i} ${o}`);return e.join("\n")}}function lt(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const e=JSON.stringify(t);throw new Error(`Anchor must not contain whitespace or control characters: ${e}`)}return!0}function ut(t){const e=new Set;return tt(t,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function ft(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function ht(t,e,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let e=0,n=r.length;ept(t,String(e),n)));if(t&&"function"==typeof t.toJSON){if(!n||!J(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=t=>{r.res=t,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return"bigint"!=typeof t||n?.keep?t:Number(t)}ct.defaultYaml={explicit:!1,version:"1.2"},ct.defaultTags={"!!":"tag:yaml.org,2002:"};class dt{constructor(t){Object.defineProperty(this,K,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:e,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!U(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:!0===e,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},s=pt(this,"",o);if("function"==typeof r)for(const{count:t,res:e}of o.anchors.values())r(e,t);return"function"==typeof i?ht(i,{"":s},"",s):s}}class mt extends dt{constructor(t){super(R),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let e;return tt(t,{Node:(t,n)=>{if(n===this)return tt.BREAK;n.anchor===this.source&&(e=n)}}),e}toJSON(t,e){if(!e)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=e,o=this.resolve(r);if(!o){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(t)}let s=n.get(o);if(s||(pt(o,null,e),s=n.get(o)),!s||void 0===s.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(s.count+=1,0===s.aliasCount&&(s.aliasCount=yt(r,o,n)),s.count*s.aliasCount>i))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return s.res}toString(t,e,n){const r=`*${this.source}`;if(t){if(lt(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(t)}if(t.implicitKey)return`${r} `}return r}}function yt(t,e,n){if(V(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(H(e)){let r=0;for(const i of e.items){const e=yt(t,i,n);e>r&&(r=e)}return r}if(z(e)){const r=yt(t,e.key,n),i=yt(t,e.value,n);return Math.max(r,i)}return 1}const vt=t=>!t||"function"!=typeof t&&"object"!=typeof t;class gt extends dt{constructor(t){super(F),this.value=t}toJSON(t,e){return e?.keep?this.value:pt(this.value,t,e)}toString(){return String(this.value)}}gt.BLOCK_FOLDED="BLOCK_FOLDED",gt.BLOCK_LITERAL="BLOCK_LITERAL",gt.PLAIN="PLAIN",gt.QUOTE_DOUBLE="QUOTE_DOUBLE",gt.QUOTE_SINGLE="QUOTE_SINGLE";const bt="tag:yaml.org,2002:";function wt(t,e,n){if(U(t)&&(t=t.contents),Y(t))return t;if(z(t)){const e=n.schema[B].createNode?.(n.schema,null,n);return e.items.push(t),e}(t instanceof String||t instanceof Number||t instanceof Boolean||"undefined"!=typeof BigInt&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n;let c;if(r&&t&&"object"==typeof t){if(c=a.get(t),c)return c.anchor||(c.anchor=i(t)),new mt(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=bt+e.slice(2));let l=function(t,e,n){if(e){const t=n.filter((t=>t.tag===e)),r=t.find((t=>!t.format))??t[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find((e=>e.identify?.(t)&&!e.format))}(t,e,s.tags);if(!l){if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),!t||"object"!=typeof t){const e=new gt(t);return c&&(c.node=e),e}l=t instanceof Map?s[B]:Symbol.iterator in Object(t)?s[$]:s[B]}o&&(o(l),delete n.onTagObj);const u=l?.createNode?l.createNode(n.schema,t,n):"function"==typeof l?.nodeClass?.from?l.nodeClass.from(n.schema,t,n):new gt(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}function _t(t,e,n){let r=n;for(let t=e.length-1;t>=0;--t){const n=e[t];if("number"==typeof n&&Number.isInteger(n)&&n>=0){const t=[];t[n]=r,r=t}else r=new Map([[n,r]])}return wt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const kt=t=>null==t||"object"==typeof t&&!!t[Symbol.iterator]().next().done;class Et extends dt{constructor(t,e){super(t),Object.defineProperty(this,"schema",{value:e,configurable:!0,enumerable:!1,writable:!0})}clone(t){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(e.schema=t),e.items=e.items.map((e=>Y(e)||z(e)?e.clone(t):e)),this.range&&(e.range=this.range.slice()),e}addIn(t,e){if(kt(t))this.add(e);else{const[n,...r]=t,i=this.get(n,!0);if(H(i))i.addIn(r,e);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,_t(this.schema,r,e))}}}deleteIn(t){const[e,...n]=t;if(0===n.length)return this.delete(e);const r=this.get(e,!0);if(H(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn(t,e){const[n,...r]=t,i=this.get(n,!0);return 0===r.length?!e&&W(i)?i.value:i:H(i)?i.getIn(r,e):void 0}hasAllNullValues(t){return this.items.every((e=>{if(!z(e))return!1;const n=e.value;return null==n||t&&W(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag}))}hasIn(t){const[e,...n]=t;if(0===n.length)return this.has(e);const r=this.get(e,!0);return!!H(r)&&r.hasIn(n)}setIn(t,e){const[n,...r]=t;if(0===r.length)this.set(n,e);else{const t=this.get(n,!0);if(H(t))t.setIn(r,e);else{if(void 0!==t||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,_t(this.schema,r,e))}}}}Et.maxFlowStringSingleLineLength=60;const xt=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Ot(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const St=(t,e,n)=>t.endsWith("\n")?Ot(n,e):n.includes("\n")?"\n"+Ot(n,e):(t.endsWith(" ")?"":" ")+n,Tt="flow",At="block",Lt="quoted";function Nt(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;const c=Math.max(1+o,1+i-e.length);if(t.length<=c)return t;const l=[],u={};let f,h,p=i-e.length;"number"==typeof r&&(r>i-Math.max(2,o)?l.push(0):p=i-r);let d=!1,m=-1,y=-1,v=-1;n===At&&(m=Ct(t,m),-1!==m&&(p=m+c));for(let e;e=t[m+=1];){if(n===Lt&&"\\"===e){switch(y=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}v=m}if("\n"===e)n===At&&(m=Ct(t,m)),p=m+c,f=void 0;else{if(" "===e&&h&&" "!==h&&"\n"!==h&&"\t"!==h){const e=t[m+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(f=m)}if(m>=p)if(f)l.push(f),p=f+c,f=void 0;else if(n===Lt){for(;" "===h||"\t"===h;)h=e,e=t[m+=1],d=!0;const n=m>v+1?m-2:y-1;if(u[n])return t;l.push(n),u[n]=!0,p=n+c,f=void 0}else d=!0}h=e}if(d&&a&&a(),0===l.length)return t;s&&s();let g=t.slice(0,l[0]);for(let r=0;r({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Pt=t=>/^(%|---|\.\.\.)/m.test(t);function It(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Pt(t)?" ":"");let s="",a=0;for(let t=0,e=n[t];e;e=n[++t])if(" "===e&&"\\"===n[t+1]&&"n"===n[t+2]&&(s+=n.slice(a,t)+"\\ ",t+=1,a=t,e="\\"),"\\"===e)switch(n[t+1]){case"u":{s+=n.slice(a,t);const e=n.substr(t+2,4);switch(e){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:"00"===e.substr(0,2)?s+="\\x"+e.substr(2):s+=n.substr(t,6)}t+=5,a=t+1}break;case"n":if(r||'"'===n[t+2]||n.lengthr)return!0;if(n=e+1,i-n<=r)return!1}return!0}(n,c,l.length));if(!n)return u?"|\n":">\n";let f,h;for(h=n.length;h>0;--h){const t=n[h-1];if("\n"!==t&&"\t"!==t&&" "!==t)break}let p=n.substring(h);const d=p.indexOf("\n");-1===d?f="-":n===p||d!==p.length-1?(f="+",o&&o()):f="",p&&(n=n.slice(0,-p.length),"\n"===p[p.length-1]&&(p=p.slice(0,-1)),p=p.replace(Bt,`$&${l}`));let m,y=!1,v=-1;for(m=0;m")+(y?l?"2":"1":"")+f;return t&&(b+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),u?`${b}\n${l}${g}${n=n.replace(/\n+/g,`$&${l}`)}${p}`:`${b}\n${l}${Nt(`${g}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`)}${p}`,l,At,jt(r,!0))}`}function Ft(t,e,n,r){const{implicitKey:i,inFlow:o}=e,s="string"==typeof t.value?t:Object.assign({},t,{value:String(t.value)});let{type:a}=t;a!==gt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=gt.QUOTE_DOUBLE);const c=t=>{switch(t){case gt.BLOCK_FOLDED:case gt.BLOCK_LITERAL:return i||o?Mt(s.value,e):Dt(s,e,n,r);case gt.QUOTE_DOUBLE:return It(s.value,e);case gt.QUOTE_SINGLE:return Rt(s.value,e);case gt.PLAIN:return function(t,e,n,r){const{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&/[\n[\]{},]/.test(o)||u&&/[[\]{},]/.test(o))return Mt(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes("\n")?Mt(o,e):Dt(t,e,n,r);if(!a&&!u&&i!==gt.PLAIN&&o.includes("\n"))return Dt(t,e,n,r);if(Pt(o)){if(""===c)return e.forceBlockIndent=!0,Dt(t,e,n,r);if(a&&c===l)return Mt(o,e)}const f=o.replace(/\n+/g,`$&\n${c}`);if(s){const t=t=>t.default&&"tag:yaml.org,2002:str"!==t.tag&&t.test?.test(f),{compat:n,tags:r}=e.doc.schema;if(r.some(t)||n?.some(t))return Mt(o,e)}return a?f:Nt(f,c,Tt,jt(e,!1))}(s,e,n,r);default:return null}};let l=c(a);if(null===l){const{defaultKeyType:t,defaultStringType:n}=e.options,r=i&&t||n;if(l=c(r),null===l)throw new Error(`Unsupported default string type ${r}`)}return l}function $t(t,e){const n=Object.assign({blockQuote:!0,commentString:xt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Kt(t,e,n,r){if(z(t))return t.toString(e,n,r);if(V(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 i;const o=Y(t)?t:e.doc.createNode(t,{onTagObj:t=>i=t});i||(i=function(t,e){if(e.tag){const n=t.filter((t=>t.tag===e.tag));if(n.length>0)return n.find((t=>t.format===e.format))??n[0]}let n,r;if(W(e)){r=e.value;const i=t.filter((t=>t.identify?.(r)));n=i.find((t=>t.format===e.format))??i.find((t=>!t.format))}else r=e,n=t.find((t=>t.nodeClass&&r instanceof t.nodeClass));if(!n)throw new Error(`Tag not resolved for ${r?.constructor?.name??typeof r} value`);return n}(e.doc.schema.tags,o));const s=function(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],o=(W(t)||H(t))&&t.anchor;o&<(o)&&(n.add(o),i.push(`&${o}`));const s=t.tag?t.tag:e.default?null:e.tag;return s&&i.push(r.directives.tagString(s)),i.join(" ")}(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);const a="function"==typeof i.stringify?i.stringify(o,e,n,r):W(o)?Ft(o,e,n,r):o.toString(e,n,r);return s?W(o)||"{"===a[0]||"["===a[0]?`${s} ${a}`:`${s}\n${e.indent}${a}`:a}function Vt(t,e){"debug"!==t&&"warn"!==t||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(e):console.warn(e))}function Ut(t,e,{key:n,value:r}){if(t?.doc.schema.merge&&qt(n))if(r=V(r)?r.resolve(t.doc):r,G(r))for(const n of r.items)zt(t,e,n);else if(Array.isArray(r))for(const n of r)zt(t,e,n);else zt(t,e,r);else{const i=pt(n,"",t);if(e instanceof Map)e.set(i,pt(r,i,t));else if(e instanceof Set)e.add(i);else{const o=function(t,e,n){if(null===e)return"";if("object"!=typeof e)return String(e);if(Y(t)&&n&&n.doc){const e=$t(n.doc,{});e.anchors=new Set;for(const t of n.anchors.keys())e.anchors.add(t.anchor);e.inFlow=!0,e.inStringifyKey=!0;const r=t.toString(e);if(!n.mapKeyWarned){let t=JSON.stringify(r);t.length>40&&(t=t.substring(0,36)+'..."'),Vt(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${t}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}(n,i,t),s=pt(r,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}const qt=t=>"<<"===t||W(t)&&"<<"===t.value&&(!t.type||t.type===gt.PLAIN);function zt(t,e,n){const r=t&&V(n)?n.resolve(t.doc):n;if(!q(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,t,Map);for(const[t,n]of i)e instanceof Map?e.has(t)||e.set(t,n):e instanceof Set?e.add(t):Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0});return e}function Wt(t,e,n){const r=wt(t,void 0,n),i=wt(e,void 0,n);return new Gt(r,i)}class Gt{constructor(t,e=null){Object.defineProperty(this,K,{value:D}),this.key=t,this.value=e}clone(t){let{key:e,value:n}=this;return Y(e)&&(e=e.clone(t)),Y(n)&&(n=n.clone(t)),new Gt(e,n)}toJSON(t,e){return Ut(e,e?.mapAsMap?new Map:{},this)}toString(t,e,n){return t?.doc?function({key:t,value:e},n,r,i){const{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=n;let h=Y(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(H(t))throw new Error("With simple keys, collection cannot be used as a key value")}let p=!f&&(!t||h&&null==e&&!n.inFlow||H(t)||(W(t)?t.type===gt.BLOCK_FOLDED||t.type===gt.BLOCK_LITERAL:"object"==typeof t));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:a+c});let d,m,y,v=!1,g=!1,b=Kt(t,n,(()=>v=!0),(()=>g=!0));if(!p&&!n.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||null==e)return v&&r&&r(),""===b?"?":p?`? ${b}`:b}else if(o&&!f||null==e&&p)return b=`? ${b}`,h&&!v?b+=St(b,n.indent,l(h)):g&&i&&i(),b;v&&(h=null),p?(h&&(b+=St(b,n.indent,l(h))),b=`? ${b}\n${a}:`):(b=`${b}:`,h&&(b+=St(b,n.indent,l(h)))),Y(e)?(d=!!e.spaceBefore,m=e.commentBefore,y=e.comment):(d=!1,m=null,y=null,e&&"object"==typeof e&&(e=s.createNode(e))),n.implicitKey=!1,p||h||!W(e)||(n.indentAtStart=b.length+1),g=!1,u||!(c.length>=2)||n.inFlow||p||!G(e)||e.flow||e.tag||e.anchor||(n.indent=n.indent.substring(2));let w=!1;const _=Kt(e,n,(()=>w=!0),(()=>g=!0));let k=" ";if(h||d||m)k=d?"\n":"",m&&(k+=`\n${Ot(l(m),n.indent)}`),""!==_||n.inFlow?k+=`\n${n.indent}`:"\n"===k&&(k="\n\n");else if(!p&&H(e)){const t=_[0],r=_.indexOf("\n"),i=-1!==r,o=n.inFlow??e.flow??0===e.items.length;if(i||!o){let e=!1;if(i&&("&"===t||"!"===t)){let n=_.indexOf(" ");"&"===t&&-1!==n&&ns=null),(()=>f=!0));s&&(a+=St(a,o,l(s))),f&&s&&(f=!1),h.push(r+a)}let p;if(0===h.length)p=i.start+i.end;else{p=h[0];for(let t=1;to=null));th||s.includes("\n"))&&(f=!0),p.push(s),h=p.length}let d;const{start:m,end:y}=r;if(0===p.length)d=m+y;else if(f||(f=p.reduce(((t,e)=>t+e.length+2),2)>Et.maxFlowStringSingleLineLength),f){d=m;for(const t of p)d+=t?`\n${a}${s}${t}`:"\n";d+=`\n${s}${y}`}else d=`${m}${c}${p.join(" ")}${c}${y}`;return t&&(d+=St(d,s,l(t)),o&&o()),d}function Xt({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const i=Ot(e(r),t);n.push(i.trimStart())}}function Qt(t,e){const n=W(e)?e.value:e;for(const r of t)if(z(r)){if(r.key===e||r.key===n)return r;if(W(r.key)&&r.key.value===n)return r}}class Zt extends Et{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(B,t),this.items=[]}static from(t,e,n){const{keepUndefined:r,replacer:i}=n,o=new this(t),s=(t,s)=>{if("function"==typeof i)s=i.call(e,t,s);else if(Array.isArray(i)&&!i.includes(t))return;(void 0!==s||r)&&o.items.push(Wt(t,s,n))};if(e instanceof Map)for(const[t,n]of e)s(t,n);else if(e&&"object"==typeof e)for(const t of Object.keys(e))s(t,e[t]);return"function"==typeof t.sortMapEntries&&o.items.sort(t.sortMapEntries),o}add(t,e){let n;n=z(t)?t:t&&"object"==typeof t&&"key"in t?new Gt(t.key,t.value):new Gt(t,t?.value);const r=Qt(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!e)throw new Error(`Key ${n.key} already set`);W(r.value)&&vt(n.value)?r.value.value=n.value:r.value=n.value}else if(i){const t=this.items.findIndex((t=>i(n,t)<0));-1===t?this.items.push(n):this.items.splice(t,0,n)}else this.items.push(n)}delete(t){const e=Qt(this.items,t);return!!e&&this.items.splice(this.items.indexOf(e),1).length>0}get(t,e){const n=Qt(this.items,t),r=n?.value;return(!e&&W(r)?r.value:r)??void 0}has(t){return!!Qt(this.items,t)}set(t,e){this.add(new Gt(t,e),!0)}toJSON(t,e,n){const r=n?new n:e?.mapAsMap?new Map:{};e?.onCreate&&e.onCreate(r);for(const t of this.items)Ut(e,r,t);return r}toString(t,e,n){if(!t)return JSON.stringify(this);for(const t of this.items)if(!z(t))throw new Error(`Map items must all be pairs; found ${JSON.stringify(t)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Ht(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:e})}}const te={collection:"map",default:!0,nodeClass:Zt,tag:"tag:yaml.org,2002:map",resolve:(t,e)=>(q(t)||e("Expected a mapping for this tag"),t),createNode:(t,e,n)=>Zt.from(t,e,n)};class ee extends Et{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super($,t),this.items=[]}add(t){this.items.push(t)}delete(t){const e=ne(t);return"number"==typeof e&&this.items.splice(e,1).length>0}get(t,e){const n=ne(t);if("number"!=typeof n)return;const r=this.items[n];return!e&&W(r)?r.value:r}has(t){const e=ne(t);return"number"==typeof e&&e=0?e:null}const re={collection:"seq",default:!0,nodeClass:ee,tag:"tag:yaml.org,2002:seq",resolve:(t,e)=>(G(t)||e("Expected a sequence for this tag"),t),createNode:(t,e,n)=>ee.from(t,e,n)},ie={identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:(t,e,n,r)=>Ft(t,e=Object.assign({actualString:!0},e),n,r)},oe={identify:t=>null==t,createNode:()=>new gt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new gt(null),stringify:({source:t},e)=>"string"==typeof t&&oe.test.test(t)?t:e.options.nullStr},se={identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new gt("t"===t[0]||"T"===t[0]),stringify:({source:t,value:e},n)=>t&&se.test.test(t)&&e===("t"===t[0]||"T"===t[0])?t:e?n.options.trueStr:n.options.falseStr};function ae({format:t,minFractionDigits:e,tag:n,value:r}){if("bigint"==typeof r)return String(r);const i="number"==typeof r?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=JSON.stringify(r);if(!t&&e&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(o)){let t=o.indexOf(".");t<0&&(t=o.length,o+=".");let n=e-(o.length-t-1);for(;n-- >0;)o+="0"}return o}const ce={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ae},le={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ae(t)}},ue={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new gt(parseFloat(t)),n=t.indexOf(".");return-1!==n&&"0"===t[t.length-1]&&(e.minFractionDigits=t.length-n-1),e},stringify:ae},fe=t=>"bigint"==typeof t||Number.isInteger(t),he=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function pe(t,e,n){const{value:r}=t;return fe(r)&&r>=0?n+r.toString(e):ae(t)}const de={identify:t=>fe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>he(t,2,8,n),stringify:t=>pe(t,8,"0o")},me={identify:fe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>he(t,0,10,n),stringify:ae},ye={identify:t=>fe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>he(t,2,16,n),stringify:t=>pe(t,16,"0x")},ve=[te,re,ie,oe,se,de,me,ye,ce,le,ue];function ge(t){return"bigint"==typeof t||Number.isInteger(t)}const be=({value:t})=>JSON.stringify(t),we=[te,re].concat([{identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:be},{identify:t=>null==t,createNode:()=>new gt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:be},{identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>"true"===t,stringify:be},{identify:ge,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})=>ge(t)?t.toString():JSON.stringify(t)},{identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:be}],{default:!0,tag:"",test:/^/,resolve:(t,e)=>(e(`Unresolved plain scalar ${JSON.stringify(t)}`),t)}),_e={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if("function"==typeof Buffer)return Buffer.from(t,"base64");if("function"==typeof atob){const e=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(e.length);for(let t=0;t1&&e("Each pair must have its own sequence indicator");const t=r.items[0]||new Gt(new gt(null));if(r.commentBefore&&(t.key.commentBefore=t.key.commentBefore?`${r.commentBefore}\n${t.key.commentBefore}`:r.commentBefore),r.comment){const e=t.value??t.key;e.comment=e.comment?`${r.comment}\n${e.comment}`:r.comment}r=t}t.items[n]=z(r)?r:new Gt(r)}}else e("Expected a sequence for this tag");return t}function Ee(t,e,n){const{replacer:r}=n,i=new ee(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let t of e){let s,a;if("function"==typeof r&&(t=r.call(e,String(o++),t)),Array.isArray(t)){if(2!==t.length)throw new TypeError(`Expected [key, value] tuple: ${t}`);s=t[0],a=t[1]}else if(t&&t instanceof Object){const e=Object.keys(t);if(1!==e.length)throw new TypeError(`Expected { key: value } tuple: ${t}`);s=e[0],a=t[s]}else s=t;i.items.push(Wt(s,a,n))}return i}const xe={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ke,createNode:Ee};class Oe extends ee{constructor(){super(),this.add=Zt.prototype.add.bind(this),this.delete=Zt.prototype.delete.bind(this),this.get=Zt.prototype.get.bind(this),this.has=Zt.prototype.has.bind(this),this.set=Zt.prototype.set.bind(this),this.tag=Oe.tag}toJSON(t,e){if(!e)return super.toJSON(t);const n=new Map;e?.onCreate&&e.onCreate(n);for(const t of this.items){let r,i;if(z(t)?(r=pt(t.key,"",e),i=pt(t.value,r,e)):r=pt(t,"",e),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,i)}return n}static from(t,e,n){const r=Ee(t,e,n),i=new this;return i.items=r.items,i}}Oe.tag="tag:yaml.org,2002:omap";const Se={collection:"seq",identify:t=>t instanceof Map,nodeClass:Oe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=ke(t,e),r=[];for(const{key:t}of n.items)W(t)&&(r.includes(t.value)?e(`Ordered maps must not include duplicate keys: ${t.value}`):r.push(t.value));return Object.assign(new Oe,n)},createNode:(t,e,n)=>Oe.from(t,e,n)};function Te({value:t,source:e},n){return e&&(t?Ae:Le).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Ae={identify:t=>!0===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new gt(!0),stringify:Te},Le={identify:t=>!1===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>new gt(!1),stringify:Te},Ne={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ae},Ce={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ae(t)}},je={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new gt(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(-1!==n){const r=t.substring(n+1).replace(/_/g,"");"0"===r[r.length-1]&&(e.minFractionDigits=r.length)}return e},stringify:ae},Pe=t=>"bigint"==typeof t||Number.isInteger(t);function Ie(t,e,n,{intAsBigInt:r}){const i=t[0];if("-"!==i&&"+"!==i||(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`}const e=BigInt(t);return"-"===i?BigInt(-1)*e:e}const o=parseInt(t,n);return"-"===i?-1*o:o}function Re(t,e,n){const{value:r}=t;if(Pe(r)){const t=r.toString(e);return r<0?"-"+n+t.substr(1):n+t}return ae(t)}const Me={identify:Pe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Ie(t,2,2,n),stringify:t=>Re(t,2,"0b")},Be={identify:Pe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Ie(t,1,8,n),stringify:t=>Re(t,8,"0")},De={identify:Pe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Ie(t,0,10,n),stringify:ae},Fe={identify:Pe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Ie(t,2,16,n),stringify:t=>Re(t,16,"0x")};class $e extends Zt{constructor(t){super(t),this.tag=$e.tag}add(t){let e;e=z(t)?t:t&&"object"==typeof t&&"key"in t&&"value"in t&&null===t.value?new Gt(t.key,null):new Gt(t,null),Qt(this.items,e.key)||this.items.push(e)}get(t,e){const n=Qt(this.items,t);return!e&&z(n)?W(n.key)?n.key.value:n.key:n}set(t,e){if("boolean"!=typeof e)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof e);const n=Qt(this.items,t);n&&!e?this.items.splice(this.items.indexOf(n),1):!n&&e&&this.items.push(new Gt(t))}toJSON(t,e){return super.toJSON(t,e,Set)}toString(t,e,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),e,n);throw new Error("Set items must all have null values")}static from(t,e,n){const{replacer:r}=n,i=new this(t);if(e&&Symbol.iterator in Object(e))for(let t of e)"function"==typeof r&&(t=r.call(e,t,t)),i.items.push(Wt(t,null,n));return i}}$e.tag="tag:yaml.org,2002:set";const Ke={collection:"map",identify:t=>t instanceof Set,nodeClass:$e,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>$e.from(t,e,n),resolve(t,e){if(q(t)){if(t.hasAllNullValues(!0))return Object.assign(new $e,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function Ve(t,e){const n=t[0],r="-"===n||"+"===n?t.substring(1):t,i=t=>e?BigInt(t):Number(t),o=r.replace(/_/g,"").split(":").reduce(((t,e)=>t*i(60)+i(e)),i(0));return"-"===n?i(-1)*o:o}function Ue(t){let{value:e}=t,n=t=>t;if("bigint"==typeof e)n=t=>BigInt(t);else if(isNaN(e)||!isFinite(e))return ae(t);let r="";e<0&&(r="-",e*=n(-1));const i=n(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),r+o.map((t=>String(t).padStart(2,"0"))).join(":").replace(/000000\d*$/,"")}const qe={identify:t=>"bigint"==typeof t||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})=>Ve(t,n),stringify:Ue},ze={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Ve(t,!1),stringify:Ue},We={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(We.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0;let l=Date.UTC(n,r-1,i,o||0,s||0,a||0,c);const u=e[8];if(u&&"Z"!==u){let t=Ve(u,!1);Math.abs(t)<30&&(t*=60),l-=6e4*t}return new Date(l)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},Ge=[te,re,ie,oe,Ae,Le,Me,Be,De,Fe,Ne,Ce,je,_e,Se,xe,Ke,qe,ze,We],He=new Map([["core",ve],["failsafe",[te,re,ie]],["json",we],["yaml11",Ge],["yaml-1.1",Ge]]),Ye={binary:_e,bool:se,float:ue,floatExp:le,floatNaN:ce,floatTime:ze,int:me,intHex:ye,intOct:de,intTime:qe,map:te,null:oe,omap:Se,pairs:xe,seq:re,set:Ke,timestamp:We},Je={"tag:yaml.org,2002:binary":_e,"tag:yaml.org,2002:omap":Se,"tag:yaml.org,2002:pairs":xe,"tag:yaml.org,2002:set":Ke,"tag:yaml.org,2002:timestamp":We};function Xe(t,e){let n=He.get(e);if(!n){if(!Array.isArray(t)){const t=Array.from(He.keys()).filter((t=>"yaml11"!==t)).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${t} or define customTags array`)}n=[]}if(Array.isArray(t))for(const e of t)n=n.concat(e);else"function"==typeof t&&(n=t(n.slice()));return n.map((t=>{if("string"!=typeof t)return t;const e=Ye[t];if(e)return e;const n=Object.keys(Ye).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown custom tag "${t}"; use one of ${n}`)}))}const Qe=(t,e)=>t.keye.key?1:0;class Ze{constructor({compat:t,customTags:e,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(t)?Xe(t,"compat"):t?Xe(null,t):null,this.merge=!!n,this.name="string"==typeof i&&i||"core",this.knownTags=r?Je:{},this.tags=Xe(e,this.name),this.toStringOptions=s??null,Object.defineProperty(this,B,{value:te}),Object.defineProperty(this,F,{value:ie}),Object.defineProperty(this,$,{value:re}),this.sortMapEntries="function"==typeof o?o:!0===o?Qe:null}clone(){const t=Object.create(Ze.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}class tn{constructor(t,e,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,K,{value:M});let r=null;"function"==typeof e||Array.isArray(e)?r=e:void 0===n&&e&&(n=e,e=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ct({version:o}),this.setSchema(o,n),this.contents=void 0===t?null:this.createNode(t,r,n)}clone(){const t=Object.create(tn.prototype,{[K]:{value:M}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Y(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){en(this.contents)&&this.contents.add(t)}addIn(t,e){en(this.contents)&&this.contents.addIn(t,e)}createAlias(t,e){if(!t.anchor){const n=ut(this);t.anchor=!e||n.has(e)?ft(e||"a",n):e}return new mt(t.anchor)}createNode(t,e,n){let r;if("function"==typeof e)t=e.call({"":t},"",t),r=e;else if(Array.isArray(e)){const t=t=>"number"==typeof t||t instanceof String||t instanceof Number,n=e.filter(t).map(String);n.length>0&&(e=e.concat(n)),r=e}else void 0===n&&e&&(n=e,e=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:s,keepUndefined:a,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:f,sourceObjects:h}=function(t,e){const n=[],r=new Map;let i=null;return{onAnchor:r=>{n.push(r),i||(i=ut(t));const o=ft(e,i);return i.add(o),o},setAnchors:()=>{for(const t of n){const e=r.get(t);if("object"!=typeof e||!e.anchor||!W(e.node)&&!H(e.node)){const e=new Error("Failed to resolve repeated object (this should not happen)");throw e.source=t,e}e.node.anchor=e.anchor}},sourceObjects:r}}(this,o||"a"),p=wt(t,l,{aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:h});return s&&H(p)&&(p.flow=!0),f(),p}createPair(t,e,n={}){const r=this.createNode(t,null,n),i=this.createNode(e,null,n);return new Gt(r,i)}delete(t){return!!en(this.contents)&&this.contents.delete(t)}deleteIn(t){return kt(t)?null!=this.contents&&(this.contents=null,!0):!!en(this.contents)&&this.contents.deleteIn(t)}get(t,e){return H(this.contents)?this.contents.get(t,e):void 0}getIn(t,e){return kt(t)?!e&&W(this.contents)?this.contents.value:this.contents:H(this.contents)?this.contents.getIn(t,e):void 0}has(t){return!!H(this.contents)&&this.contents.has(t)}hasIn(t){return kt(t)?void 0!==this.contents:!!H(this.contents)&&this.contents.hasIn(t)}set(t,e){null==this.contents?this.contents=_t(this.schema,[t],e):en(this.contents)&&this.contents.set(t,e)}setIn(t,e){kt(t)?this.contents=e:null==this.contents?this.contents=_t(this.schema,Array.from(t),e):en(this.contents)&&this.contents.setIn(t,e)}setSchema(t,e={}){let n;switch("number"==typeof t&&(t=String(t)),t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ct({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new ct({version:t}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const e=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${e}`)}}if(e.schema instanceof Object)this.schema=e.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new Ze(Object.assign(n,e))}}toJS({json:t,jsonArg:e,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){const s={anchors:new Map,doc:this,keep:!t,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},a=pt(this.contents,e??"",s);if("function"==typeof i)for(const{count:t,res:e}of s.anchors.values())i(e,t);return"function"==typeof o?ht(o,{"":a},"",a):a}toJSON(t,e){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:e})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const e=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${e}`)}return function(t,e){const n=[];let r=!0===e.directives;if(!1!==e.directives&&t.directives){const e=t.directives.toString(t);e?(n.push(e),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");const i=$t(t,e),{commentString:o}=i.options;if(t.commentBefore){1!==n.length&&n.unshift("");const e=o(t.commentBefore);n.unshift(Ot(e,""))}let s=!1,a=null;if(t.contents){if(Y(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const e=o(t.contents.commentBefore);n.push(Ot(e,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}const e=a?void 0:()=>s=!0;let c=Kt(t.contents,i,(()=>a=null),e);a&&(c+=St(c,"",o(a))),"|"!==c[0]&&">"!==c[0]||"---"!==n[n.length-1]?n.push(c):n[n.length-1]=`--- ${c}`}else n.push(Kt(t.contents,i));if(t.directives?.docEnd)if(t.comment){const e=o(t.comment);e.includes("\n")?(n.push("..."),n.push(Ot(e,""))):n.push(`... ${e}`)}else n.push("...");else{let e=t.comment;e&&s&&(e=e.replace(/^\n+/,"")),e&&(s&&!a||""===n[n.length-1]||n.push(""),n.push(Ot(o(e),"")))}return n.join("\n")+"\n"}(this,t)}}function en(t){if(H(t))return!0;throw new Error("Expected a YAML collection as document contents")}class nn extends Error{constructor(t,e,n,r){super(),this.name=t,this.code=n,this.message=r,this.pos=e}}class rn extends nn{constructor(t,e,n){super("YAMLParseError",t,e,n)}}class on extends nn{constructor(t,e,n){super("YAMLWarning",t,e,n)}}const sn=(t,e)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map((t=>e.linePos(t)));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){const t=Math.min(o-39,s.length-79);s="…"+s.substring(t),o-=t-1}if(s.length>80&&(s=s.substring(0,79)+"…"),r>1&&/^ *$/.test(s.substring(0,o))){let n=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),s=n+s}if(/[^ ]/.test(s)){let t=1;const e=n.linePos[1];e&&e.line===r&&e.col>i&&(t=Math.max(1,Math.min(e.col-i,80-o)));const a=" ".repeat(o)+"^".repeat(t);n.message+=`:\n\n${s}\n${a}\n`}};function an(t,{flow:e,indicator:n,next:r,offset:i,onError:o,startOnNewline:s}){let a=!1,c=s,l=s,u="",f="",h=!1,p=!1,d=!1,m=null,y=null,v=null,g=null,b=null;for(const r of t)switch(d&&("space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),r.type){case"space":!e&&c&&"doc-start"!==n&&"\t"===r.source[0]&&o(r,"TAB_AS_INDENT","Tabs are not allowed as indentation"),l=!0;break;case"comment":{l||o(r,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=r.source.substring(1)||" ";u?u+=f+t:u=t,f="",c=!1;break}case"newline":c?u?u+=r.source:a=!0:f+=r.source,c=!0,h=!0,(m||y)&&(p=!0),l=!0;break;case"anchor":m&&o(r,"MULTIPLE_ANCHORS","A node can have at most one anchor"),r.source.endsWith(":")&&o(r.offset+r.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=r,null===b&&(b=r.offset),c=!1,l=!1,d=!0;break;case"tag":y&&o(r,"MULTIPLE_TAGS","A node can have at most one tag"),y=r,null===b&&(b=r.offset),c=!1,l=!1,d=!0;break;case n:(m||y)&&o(r,"BAD_PROP_ORDER",`Anchors and tags must be after the ${r.source} indicator`),g&&o(r,"UNEXPECTED_TOKEN",`Unexpected ${r.source} in ${e??"collection"}`),g=r,c=!1,l=!1;break;case"comma":if(e){v&&o(r,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=r,c=!1,l=!1;break}default:o(r,"UNEXPECTED_TOKEN",`Unexpected ${r.type} token`),c=!1,l=!1}const w=t[t.length-1],_=w?w.offset+w.source.length:i;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),{comma:v,found:g,spaceBefore:a,comment:u,hasNewline:h,hasNewlineAfterProp:p,anchor:m,tag:y,end:_,start:b??_}}function cn(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes("\n"))return!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const e of t.items){for(const t of e.start)if("newline"===t.type)return!0;if(e.sep)for(const t of e.sep)if("newline"===t.type)return!0;if(cn(e.key)||cn(e.value))return!0}return!1;default:return!0}}function ln(t,e,n){if("flow-collection"===e?.type){const r=e.end[0];r.indent!==t||"]"!==r.source&&"}"!==r.source||!cn(e)||n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function un(t,e,n){const{uniqueKeys:r}=t.options;if(!1===r)return!1;const i="function"==typeof r?r:(e,n)=>e===n||W(e)&&W(n)&&e.value===n.value&&!("<<"===e.value&&t.schema.merge);return e.some((t=>i(t.key,n)))}const fn="All mapping items must start at the same column";function hn(t,e,n,r){let i="";if(t){let o=!1,s="";for(const a of t){const{source:t,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{n&&!o&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=t.substring(1)||" ";i?i+=s+e:i=e,s="";break}case"newline":i&&(s+=t),o=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=t.length}}return{comment:i,offset:e}}const pn="Block collections are not allowed within flow collections",dn=t=>t&&("block-map"===t.type||"block-seq"===t.type);function mn(t,e,n,r,i,o){const s="block-map"===n.type?function({composeNode:t,composeEmptyNode:e},n,r,i,o){const s=new(o?.nodeClass??Zt)(n.schema);n.atRoot&&(n.atRoot=!1);let a=r.offset,c=null;for(const o of r.items){const{start:l,key:u,sep:f,value:h}=o,p=an(l,{indicator:"explicit-key-ind",next:u??f?.[0],offset:a,onError:i,startOnNewline:!0}),d=!p.found;if(d){if(u&&("block-seq"===u.type?i(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==r.indent&&i(a,"BAD_INDENT",fn)),!p.anchor&&!p.tag&&!f){c=p.end,p.comment&&(s.comment?s.comment+="\n"+p.comment:s.comment=p.comment);continue}(p.hasNewlineAfterProp||cn(u))&&i(u??l[l.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(a,"BAD_INDENT",fn);const m=p.end,y=u?t(n,u,p,i):e(n,m,l,null,p,i);n.schema.compat&&ln(r.indent,u,i),un(n,s.items,y)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const v=an(f??[],{indicator:"map-value-ind",next:h,offset:y.range[2],onError:i,startOnNewline:!u||"block-scalar"===u.type});if(a=v.end,v.found){d&&("block-map"!==h?.type||v.hasNewline||i(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start0){const t=hn(p,d,n.options.strict,i);t.comment&&(c.comment?c.comment+="\n"+t.comment:c.comment=t.comment),c.range=[r.offset,d,t.offset]}else c.range=[r.offset,d,d];return c}(t,e,n,r,o),a=s.constructor;return"!"===i||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function yn(t){let e,n;try{e=new RegExp("(.*?)(?"===i.mode?gt.BLOCK_FOLDED:gt.BLOCK_LITERAL,s=t.source?function(t){const e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let t=1;t=0;--t){const e=s[t][1];if(""!==e&&"\r"!==e)break;a=t}if(0===a){const e="+"===i.chomp&&s.length>0?"\n".repeat(Math.max(1,s.length-1)):"";let n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:o,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;tc&&(c=e.length),l+=e.length+r.length+1}for(let t=s.length-1;t>=a;--t)s[t][0].length>c&&(a=t+1);let f="",h="",p=!1;for(let t=0;tc||"\t"===r[0]?(" "===h?h="\n":p||"\n"!==h||(h="\n\n"),f+=h+e.slice(c)+r,h="\n",p=!0):""===r?"\n"===h?f+="\n":h="\n":(f+=h+r,h=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let t=a;tn(r+t,e,i);switch(i){case"scalar":a=gt.PLAIN,c=function(t,e){let n="";switch(t[0]){case"\t":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]}`}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),yn(t)}(o,l);break;case"single-quoted-scalar":a=gt.QUOTE_SINGLE,c=function(t,e){return"'"===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR","Missing closing 'quote"),yn(t.slice(1,-1)).replace(/''/g,"'")}(o,l);break;case"double-quoted-scalar":a=gt.QUOTE_DOUBLE,c=function(t,e){let n="";for(let r=1;re?t.slice(e,r+1):i)}else n+=i}return'"'===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}(o,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const u=r+o.length,f=hn(s,u,e,n);return{value:c,type:a,comment:f.comment,range:[r,u,f.offset]}}(e,t.options.strict,r),c=n?t.directives.tagName(n.source,(t=>r(n,"TAG_RESOLVE_FAILED",t))):null,l=n&&c?function(t,e,n,r,i){if("!"===n)return t[F];const o=[];for(const e of t.tags)if(!e.collection&&e.tag===n){if(!e.default||!e.test)return e;o.push(e)}for(const t of o)if(t.test?.test(e))return t;const s=t.knownTags[n];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),t[F])}(t.schema,i,c,n,r):"scalar"===e.type?function({directives:t,schema:e},n,r,i){const o=e.tags.find((t=>t.default&&t.test?.test(n)))||e[F];if(e.compat){const s=e.compat.find((t=>t.default&&t.test?.test(n)))??e[F];o.tag!==s.tag&&i(r,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(s.tag)}`,!0)}return o}(t,i,e,r):t.schema[F];let u;try{const o=l.resolve(i,(t=>r(n??e,"TAG_RESOLVE_FAILED",t)),t.options);u=W(o)?o:new gt(o)}catch(t){const o=t instanceof Error?t.message:String(t);r(n??e,"TAG_RESOLVE_FAILED",o),u=new gt(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function _n(t,e,n){if(e){null===n&&(n=e.length);for(let r=n-1;r>=0;--r){let n=e[r];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++r];"space"===n?.type;)t+=n.source.length,n=e[++r];break}}return t}const kn={composeNode:En,composeEmptyNode:xn};function En(t,e,n,r){const{spaceBefore:i,comment:o,anchor:s,tag:a}=n;let c,l=!0;switch(e.type){case"alias":c=function({options:t},{offset:e,source:n,end:r},i){const o=new mt(n.substring(1));""===o.source&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const s=e+n.length,a=hn(r,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}(t,e,r),(s||a)&&r(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=wn(t,e,a,r),s&&(c.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=function(t,e,n,r,i){const o=r?e.directives.tagName(r.source,(t=>i(r,"TAG_RESOLVE_FAILED",t))):null,s="block-map"===n.type?"map":"block-seq"===n.type?"seq":"{"===n.start.source?"map":"seq";if(!r||!o||"!"===o||o===Zt.tagName&&"map"===s||o===ee.tagName&&"seq"===s||!s)return mn(t,e,n,i,o);let a=e.schema.tags.find((t=>t.tag===o&&t.collection===s));if(!a){const c=e.schema.knownTags[o];if(!c||c.collection!==s)return c?.collection?i(r,"BAD_COLLECTION_TYPE",`${c.tag} used for ${s} collection, but expects ${c.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),mn(t,e,n,i,o);e.schema.tags.push(Object.assign({},c,{default:!1})),a=c}const c=mn(t,e,n,i,o,a),l=a.resolve?.(c,(t=>i(r,"TAG_RESOLVE_FAILED",t)),e.options)??c,u=Y(l)?l:new gt(l);return u.range=c.range,u.tag=o,a?.format&&(u.format=a.format),u}(kn,t,e,a,r),s&&(c.anchor=s.source.substring(1));break;default:r(e,"UNEXPECTED_TOKEN","error"===e.type?e.message:`Unsupported token (type: ${e.type})`),c=xn(t,e.offset,void 0,null,n,r),l=!1}return s&&""===c.anchor&&r(s,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(c.spaceBefore=!0),o&&("scalar"===e.type&&""===e.source?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&l&&(c.srcToken=e),c}function xn(t,e,n,r,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){const u=wn(t,{type:"scalar",offset:_n(e,n,r),indent:-1,source:""},a,l);return s&&(u.anchor=s.source.substring(1),""===u.anchor&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),o&&(u.comment=o,u.range[2]=c),u}function On(t){if("number"==typeof t)return[t,t+1];if(Array.isArray(t))return 2===t.length?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+("string"==typeof n?n.length:1)]}function Sn(t){let e="",n=!1,r=!1;for(let i=0;i{const i=On(t);r?this.warnings.push(new on(i,e,n)):this.errors.push(new rn(i,e,n))},this.directives=new ct({version:t.version||"1.2"}),this.options=t}decorate(t,e){const{comment:n,afterEmptyLine:r}=Sn(this.prelude);if(n){const i=t.contents;if(e)t.comment=t.comment?`${t.comment}\n${n}`:n;else if(r||t.directives.docStart||!i)t.commentBefore=n;else if(H(i)&&!i.flow&&i.items.length>0){let t=i.items[0];z(t)&&(t=t.key);const e=t.commentBefore;t.commentBefore=e?`${n}\n${e}`:n}else{const t=i.commentBefore;i.commentBefore=t?`${n}\n${t}`:n}}e?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Sn(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,e=!1,n=-1){for(const e of t)yield*this.next(e);yield*this.end(e,n)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,((e,n,r)=>{const i=On(t);i[0]+=e,this.onError(i,"BAD_DIRECTIVE",n,r)})),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const e=function(t,e,{offset:n,start:r,value:i,end:o},s){const a=Object.assign({_directives:e},t),c=new tn(void 0,a),l={atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=an(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:s,startOnNewline:!0});u.found&&(c.directives.docStart=!0,!i||"block-map"!==i.type&&"block-seq"!==i.type||u.hasNewline||s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?En(l,i,u,s):xn(l,u.end,r,null,u,s);const f=c.contents.range[2],h=hn(o,f,!1,s);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new rn(On(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const e="Unexpected doc-end without preceding document";this.errors.push(new rn(On(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=hn(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),e.comment){const t=this.doc.comment;this.doc.comment=t?`${t}\n${e.comment}`:e.comment}this.doc.range[2]=e.offset;break}default:this.errors.push(new rn(On(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,e=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const t=Object.assign({_directives:this.directives},this.options),n=new tn(void 0,t);this.atDirectives&&this.onError(e,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,e,e],this.decorate(n,!1),yield n}}}const An=Symbol("break visit"),Ln=Symbol("skip children"),Nn=Symbol("remove item");function Cn(t,e){"type"in t&&"document"===t.type&&(t={start:t.start,value:t.value}),jn(Object.freeze([]),t,e)}function jn(t,e,n){let r=n(e,t);if("symbol"==typeof r)return r;for(const i of["key","value"]){const o=e[i];if(o&&"items"in o){for(let e=0;e{let n=t;for(const[t,r]of e){const e=n?.[t];if(!e||!("items"in e))return;n=e.items[r]}return n},Cn.parentCollection=(t,e)=>{const n=Cn.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Pn(t){switch(t){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const In="0123456789ABCDEFabcdef".split(""),Rn="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""),Mn=",[]{}".split(""),Bn=" ,[]{}\n\r\t".split(""),Dn=t=>!t||Bn.includes(t);class Fn{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,e=!1){t&&(this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null),this.atEnd=!e;let n=this.next??"stream";for(;n&&(e||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let t=this.pos,e=this.buffer[t];for(;" "===e||"\t"===e;)e=this.buffer[++t];return!e||"#"===e||"\n"===e||"\r"===e&&"\n"===this.buffer[t+1]}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let e=this.buffer[t];if(this.indentNext>0){let n=0;for(;" "===e;)e=this.buffer[++n+t];if("\r"===e){const e=this.buffer[n+t+1];if("\n"===e||!e&&!this.atEnd)return t+n+1}return"\n"===e||n>=this.indentNext||!e&&!this.atEnd?t+n:-1}if("-"===e||"."===e){const e=this.buffer.substr(t,3);if(("---"===e||"..."===e)&&Pn(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return("number"!=typeof t||-1!==t&&tthis.indentValue&&!Pn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,e]=this.peek(2);if(!e&&!this.atEnd)return this.setNext("block-start");if(("-"===t||"?"===t||":"===t)&&Pn(e)){const t=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=t,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(null===t)return this.setNext("doc");let e=yield*this.pushIndicators();switch(t[e]){case"#":yield*this.pushCount(t.length-e);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(Dn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return e+=(yield*this.parseBlockScalarHeader()),e+=(yield*this.pushSpaces(!0)),yield*this.pushCount(t.length-e),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,e,n=-1;do{t=yield*this.pushNewline(),t>0?(e=yield*this.pushSpaces(!1),this.indentValue=n=e):e=0,e+=(yield*this.pushSpaces(!0))}while(t+e>0);const r=this.getLine();if(null===r)return this.setNext("flow");if((-1!==n&&n"0"&&e<="9")this.blockScalarIndent=Number(e)-1;else if("-"!==e)break}return yield*this.pushUntil((t=>Pn(t)||"#"===t))}*parseBlockScalar(){let t,e=this.pos-1,n=0;t:for(let r=this.pos;t=this.buffer[r];++r)switch(t){case" ":n+=1;break;case"\n":e=r,n=0;break;case"\r":{const t=this.buffer[r+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break t}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext+=this.blockScalarIndent;do{const t=this.continueScalar(e+1);if(-1===t)break;e=this.buffer.indexOf("\n",t)}while(-1!==e);if(-1===e){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}if(!this.blockScalarKeep)for(;;){let t=e-1,r=this.buffer[t];"\r"===r&&(r=this.buffer[--t]);const i=t;for(;" "===r||"\t"===r;)r=this.buffer[--t];if(!("\n"===r&&t>=this.pos&&t+1+n>i))break;e=t}return yield"",yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let e,n=this.pos-1,r=this.pos-1;for(;e=this.buffer[++r];)if(":"===e){const e=this.buffer[r+1];if(Pn(e)||t&&","===e)break;n=r}else if(Pn(e)){let i=this.buffer[r+1];if("\r"===e&&("\n"===i?(r+=1,e="\n",i=this.buffer[r+1]):n=r),"#"===i||t&&Mn.includes(i))break;if("\n"===e){const t=this.continueScalar(r+1);if(-1===t)break;r=Math.max(r,t-2)}}else{if(t&&Mn.includes(e))break;n=r}return e||this.atEnd?(yield"",yield*this.pushToIndex(n+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,e){const n=this.buffer.slice(this.pos,t);return n?(yield n,this.pos+=n.length,n.length):(e&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Dn))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,e=this.charAt(1);if(Pn(e)||t&&Mn.includes(e))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let t=this.pos+2,e=this.buffer[t];for(;!Pn(e)&&">"!==e;)e=this.buffer[++t];return yield*this.pushToIndex(">"===e?t+1:t,!1)}{let t=this.pos+1,e=this.buffer[t];for(;e;)if(Rn.includes(e))e=this.buffer[++t];else{if("%"!==e||!In.includes(this.buffer[t+1])||!In.includes(this.buffer[t+2]))break;e=this.buffer[t+=3]}return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return"\n"===t?yield*this.pushCount(1):"\r"===t&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(t){let e,n=this.pos-1;do{e=this.buffer[++n]}while(" "===e||t&&"\t"===e);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let e=this.pos,n=this.buffer[e];for(;!t(n);)n=this.buffer[++e];return yield*this.pushToIndex(e,!1)}}class $n{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let e=0,n=this.lineStarts.length;for(;e>1;this.lineStarts[r]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break t}for(;"space"===t[++e]?.type;);return t.splice(e,t.length)}function Wn(t){if("flow-seq-start"===t.start.type)for(const e of t.items)!e.sep||e.value||Kn(e.start,"explicit-key-ind")||Kn(e.sep,"map-value-ind")||(e.key&&(e.value=e.key),delete e.key,Un(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Gn{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Fn,this.onNewLine=t}*parse(t,e=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(t,e))yield*this.next(n);e||(yield*this.end())}*next(t){if(this.source=t,this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=t.length);const e=function(t){switch(t){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":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"\t":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}(t);if(e)if("scalar"===e)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=e,yield*this.step(),e){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&" "===t[0]&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const e=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:t}),this.offset+=t.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(){const t=this.peek(1);if("doc-end"!==this.type||t&&"doc-end"===t.type){if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(t){return this.stack[this.stack.length-t]}*pop(t){const e=t??this.stack.pop();if(e)if(0===this.stack.length)yield e;else{const t=this.peek(1);switch("block-scalar"===e.type?e.indent="indent"in t?t.indent:0:"flow-collection"===e.type&&"document"===t.type&&(e.indent=0),"flow-collection"===e.type&&Wn(e),t.type){case"document":t.value=e;break;case"block-scalar":t.props.push(e);break;case"block-map":{const n=t.items[t.items.length-1];if(n.value)return t.items.push({start:[],key:e,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:e,sep:[]}),void(this.onKeyLine=!Kn(n.start,"explicit-key-ind"));n.value=e;break}case"block-seq":{const n=t.items[t.items.length-1];n.value?t.items.push({start:[],value:e}):n.value=e;break}case"flow-collection":{const n=t.items[t.items.length-1];return void(!n||n.value?t.items.push({start:[],key:e,sep:[]}):n.sep?n.value=e:Object.assign(n,{key:e,sep:[]}))}default:yield*this.pop(),yield*this.pop(e)}if(!("document"!==t.type&&"block-map"!==t.type&&"block-seq"!==t.type||"block-map"!==e.type&&"block-seq"!==e.type)){const n=e.items[e.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===Vn(n.start)&&(0===e.indent||n.start.every((t=>"comment"!==t.type||t.indent=t.indent){const n=!this.onKeyLine&&this.indent===t.indent&&e.sep;let r=[];if(n&&e.sep&&!e.value){const n=[];for(let r=0;rt.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(r=e.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(n||e.value?(r.push(this.sourceToken),t.items.push({start:r}),this.onKeyLine=!0):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"explicit-key-ind":return e.sep||Kn(e.start,"explicit-key-ind")?n||e.value?(r.push(this.sourceToken),t.items.push({start:r})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}):e.start.push(this.sourceToken),void(this.onKeyLine=!0);case"map-value-ind":if(Kn(e.start,"explicit-key-ind"))if(e.sep)if(e.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Kn(e.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Un(e.key)&&!Kn(e.sep,"newline")){const t=zn(e.start),n=e.key,r=e.sep;r.push(this.sourceToken),delete e.key,delete e.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:n,sep:r}]})}else r.length>0?e.sep=e.sep.concat(r,this.sourceToken):e.sep.push(this.sourceToken);else if(Kn(e.start,"newline"))Object.assign(e,{key:null,sep:[this.sourceToken]});else{const t=zn(e.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]})}else e.sep?e.value||n?t.items.push({start:r,key:null,sep:[this.sourceToken]}):Kn(e.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);return void(n||e.value?(t.items.push({start:r,key:i,sep:[]}),this.onKeyLine=!0):e.sep?this.stack.push(i):(Object.assign(e,{key:i,sep:[]}),this.onKeyLine=!0))}default:{const i=this.startBlockValue(t);if(i)return n&&"block-seq"!==i.type&&Kn(e.start,"explicit-key-ind")&&t.items.push({start:r}),void this.stack.push(i)}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const e=t.items[t.items.length-1];switch(this.type){case"newline":if(e.value){const n="end"in e.value?e.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else e.start.push(this.sourceToken);return;case"space":case"comment":if(e.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(e.start,t.indent)){const n=t.items[t.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,e.start),r.push(this.sourceToken),void t.items.pop()}e.start.push(this.sourceToken)}return;case"anchor":case"tag":if(e.value||this.indent<=t.indent)break;return void e.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==t.indent)break;return void(e.value||Kn(e.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken))}if(this.indent>t.indent){const e=this.startBlockValue(t);if(e)return void this.stack.push(e)}yield*this.pop(),yield*this.step()}*flowCollection(t){const e=t.items[t.items.length-1];if("flow-error-end"===this.type){let t;do{yield*this.pop(),t=this.peek(1)}while(t&&"flow-collection"===t.type)}else if(0===t.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!e||e.sep?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken));case"map-value-ind":return void(!e||e.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!e||e.value?t.items.push({start:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!e||e.value?t.items.push({start:[],key:n,sep:[]}):e.sep?this.stack.push(n):Object.assign(e,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void t.end.push(this.sourceToken)}const n=this.startBlockValue(t);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const e=this.peek(2);if("block-map"===e.type&&("map-value-ind"===this.type&&e.indent===t.indent||"newline"===this.type&&!e.items[e.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==e.type){const n=zn(qn(e));Wn(t);const r=t.end.splice(1,t.end.length);r.push(this.sourceToken);const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let t=this.source.indexOf("\n")+1;for(;0!==t;)this.onNewLine(this.offset+t),t=this.source.indexOf("\n",t)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const e=zn(qn(t));return e.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e}]}}case"map-value-ind":{this.onKeyLine=!0;const e=zn(qn(t));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,e){return"comment"===this.type&&!(this.indent<=e)&&t.every((t=>"newline"===t.type||"space"===t.type))}*documentEnd(t){"doc-mode"!==this.type&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function Hn(t,e={}){const{lineCounter:n,prettyErrors:r}=function(t){const e=!1!==t.prettyErrors;return{lineCounter:t.lineCounter||e&&new $n||null,prettyErrors:e}}(e),i=new Gn(n?.addNewLine),o=new Tn(e);let s=null;for(const e of o.compose(i.parse(t),!0,t.length))if(s){if("silent"!==s.options.logLevel){s.errors.push(new rn(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else s=e;return r&&n&&(s.errors.forEach(sn(t,n)),s.warnings.forEach(sn(t,n))),s}class Yn extends nn{constructor(t,e,n){super(t,e,"IMPOSSIBLE",n),this.name=t}pretty(t){this.linePos=t.lineCounter.linePos(this.pos);const{line:e,col:n}=this.linePos;this.message+=` at line ${e}, column ${n} ${t.file?" @"+t.file:""}`}}class Jn{constructor(){this.lineCounter=new $n,this.src="",this.txt="",this.errors=[],this.warnings=[],this.yaml_ok=!1,this.contents=null,this.listener=null,this.prog={}}errors(t){this.errors=this.errors.concat(t)}warnings(t){this.warnings=this.warnings.concat(t)}fileError(t){let e=new Yn("FILE_ERROR",0,`FileError : ${t}`);return this.errors.push(e),e}syntaxError(t,e){let n=new Yn("SYNTAX_ERROR",t.range?t.range[0]:0,`SyntaxError : ${e}`);return this.errors.push(n),n}syntaxWarning(t,e){let n=new Yn("SYNTAX_WARNING",t.range?t.range[0]:0,`SyntaxWarning : ${e}`);return this.warnings.push(n),n}typeError(t,e){let n=new Yn("TYPE_ERROR",t.range?t.range[0]:0,`TypeError : ${e}`);return this.errors.push(n),n}grammarError(t){let e=new Yn("GRAMMAR_ERROR",0,`GrammarError : ${t}`);this.errors.push(e)}grammarWarning(t){let e=new Yn("GRAMMAR_WARNING",0,`GrammarWarning : ${t}`);return this.warnings.push(e),e}fails(){return this.errors.length>0}success(){return 0==this.errors.length&&0==this.warnings.length}result(){return this.contents}}class Xn{constructor(t,e,n){this.ctx=t,this.type=e,this.current=n,this.start=n.range[0],this.end=n.range[1],this.childs=[]}getChild(t){return this.childs[t]}getChildCount(){return this.childs.length}getValue(){return this.value}toString(){return this.value}}class Qn extends Xn{constructor(t,e,n){super(t,e,n)}equals(t){if(t instanceof Qn)return this.value==t.value;this.ctx.syntaxError(this.current,`Error can not compare values '${this.value}' and '${t.value}'`)}}class Zn extends Qn{constructor(t,e){if(super(t,"string",e),!Zn.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a string`);this.value=e.value}static checkCurrent(t){return W(t)&&"string"==typeof t.value}static parse(t,e){try{return new Zn(t,e)}catch(t){return null}}}class tr extends Qn{constructor(t,e){if(super(t,"binary",e),!tr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a base64 string`);this.value=e.value}static checkCurrent(t){return W(t)&&"string"==typeof t.value&&/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(t.value)}static parse(t,e){try{return new tr(t,e)}catch(t){return null}}}class er extends Qn{constructor(t,e){if(super(t,"int",e),!er.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not an integer`);this.value=e.value}static checkCurrent(t){return W(t)&&"number"==typeof t.value&&t.value==Math.floor(t.value)}static parse(t,e){try{return new er(t,e)}catch(t){return null}}}class nr extends Qn{constructor(t,e){if(super(t,"float",e),!nr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a number`);this.value=e.value}static checkCurrent(t){return W(t)&&"number"==typeof t.value}static parse(t,e){try{return new nr(t,e)}catch(t){return null}}}class rr extends Qn{constructor(t,e){if(super(t,"boolean",e),this.value=null,!rr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e.value}' is not a boolean`);this.value=e.value}static checkCurrent(t){return W(t)&&"boolean"==typeof t.value}static parse(t,e){try{return new rr(t,e)}catch(t){return null}}}class ir extends Qn{constructor(t,e){if(super(t,"null",e),this.value=null,!ir.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not the null value`)}static checkCurrent(t){return W(t)&&(null==t.value||["Null","NULL","null","~"].includes(t.value))}static parse(t,e){try{return new ir(t,e)}catch(t){return null}}}class or extends Qn{constructor(t,e,n){if(super(t,"timestamp",e),!or.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a timestamp in ISO9601 format`);this.value=new Date(e.value)}static checkCurrent(t){let e=W(t)&&"string"==typeof t.value&&/\d{4}-\d{2}-\d{2}|\d{4}-\d{2}?-\d{2}?([Tt]|[ \t]+)\d{2}?:\d{2}:\d{2}(\.\d*)?(([ \t]*)Z|[-+]\d\d?(:\d{2})?)?/.test(t.value);if(1==e)try{new Date(t.value)}catch(t){e=!1}return e}static parse(t,e){try{return new or(t,e)}catch(t){return null}}equals(t){return t instanceof or?this.value.getTime()==t.value.getTime():this.ctx.syntaxError("Error : can not compare a timestamp with something else")}}class sr extends Xn{constructor(t,e,n){super(t,e,n)}length(){return this.childs.length}isEmpty(){return 0==this.length()}}class ar extends sr{constructor(t,e,n){if(super(t,"map",e),"object"!=typeof n||n instanceof Array)throw t.syntaxError(e,"Erorr : MapNode must be initialized with a parsed map. This should not happen.");this.value=n;for(const t in n)this.childs.push(n[t])}static checkCurrent(t){return q(t)&&t.items.every((t=>t.key&&W(t.key)&&"string"==typeof t.key.value))}}class cr{static parse(t,e,n){"object"!=typeof e&&t.grammarError("Error: oneof rule can not be parsed'");let r=e._oneOf;if(r instanceof Array){let e=[].concat(t.errors),i=[].concat(t.warnings),o=t.errors.length;for(let s of r){let r=wr(t,null,s,n);if(o==t.errors.length)return t.errors=e,t.warnings=i,r;o=t.errors.length}return t.syntaxError(n,"Syntax Error : no valid alternative found during parsing"),null}t.grammarError("Error: _oneof rules expects a sequence of alternatives")}}var lr="undefined"!=typeof Symbol;function ur(t){var e=typeof t;return"string"===e||"number"===e||"boolean"===e||!0===lr&&"symbol"===e||null==t||!0===lr&&t instanceof Symbol||t instanceof String||t instanceof Number||t instanceof Boolean}class fr{static parse(t,e){if("object"==typeof e){if(e._oneOf){let n;!e._oneOf instanceof Array&&t.grammarError("Error : _oneof value have to be a list"),e._oneOf=e._oneOf.map((e=>fr.parse(t,e)));do{if(n=e._oneOf.findIndex((t=>t._oneOf)),n>=0){let t=e._oneOf[n]._oneOf;(e={_oneOf:[].concat(e._oneOf)})._oneOf.splice(n,1),e._oneOf=e._oneOf.concat(t)}}while(n>=0);return e}if(e._merge){if(!(e._merge instanceof Array))return t.grammarError("Error : _merge value have to be a map"),null;const{_merge:n,...r}=e;let i;e={_merge:e._merge},Object.keys(r).length&&e._merge.push(r),e._merge=e._merge.map((e=>ur(e)&&t.rules[e]?t.rules[e]:e)),e._merge=e._merge.map((e=>fr.parse(t,e)));do{if(i=e._merge.findIndex((t=>t._merge)),i>=0){let t=e.one._merge;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),e._merge=e._merge.concat(t)}}while(i>=0);let o={_oneOf:[]};do{if(i=(e={_merge:[].concat(e._merge)})._merge.findIndex((t=>t._oneOf)),i>=0){let t=e._merge[i]._oneOf;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),t.forEach((t=>{let n={_merge:[t].concat(e._merge)};o._oneOf.push(n)}))}}while(i>=0);if(o._oneOf.length>=1)return fr.parse(t,o);e._merge.some((t=>t._merge||t._oneOf))&&t.grammarError("Error : merge has not been processed successfully. This error should not occur.");let s={},a={},c=null,l=-1,u=-1,f=-1;e._merge.forEach((e=>{if(e._map){s={...s};for(let n in e._map)s.key&&t.grammarError("Error : can not merge two maps with some identical keys"),s[n]=e._map[n]}if(e._mapFacultative){a={...a};for(let n in e._mapFacultative)a.key&&t.grammarError("Error : can not merge two maps with some identical keys"),a[n]=e._mapFacultative[n]}if(e._mapOf){if(null!=c)return t.grammarError("Error : only one '_mapOf' is allowed in a '_merge' clause"),null;c=e._mapOf}e._nb&&(l<0||l==e._nb?l=e._nb:t.grammarError("Contradictory sizing in merge clause")),e._min&&(u=Math.max(e._min,u)),e._max&&(nax=l>0?Math.min(e._max,f):e._max)}));let h={};return l>=0&&(h._nb=l),u>=0&&(h._min=u),f>=0&&(h._max=f),Object.keys(s).length>0&&(h._map=s),Object.keys(a).length>0&&(h._mapFacultative=a),null!=c&&(h._mapOf=c),h}if(e._map){let n={};for(const r in e._map)n[r]=fr.parse(t,e._map[r]);e._map=n}if(e._mapFacultative){let n={};for(const r in e._mapFacultative)n[r]=fr.parse(t,e._mapFacultative[r]);e._mapFacultative=n}if(e._mapOf){let n={};for(const r in e._mapOf){let i=fr.parse(t,r),o=fr.parse(t,e._mapOf[r]);n[i]=o}e._mapOf=n}e._list&&(e._list=e._list.map((e=>fr.parse(t,e)))),e._listFacultative&&(e._listFacultative=e._listFacultative.map((e=>fr.parse(t,e)))),e._listOf&&(e._listOf=fr.parse(t,e._listOf))}return e}}class hr{static isPositiveInt(t){return"number"==typeof t&&t==Math.floor(t)&&t>0}static sizeChecker(t,e,n,r){if(hr.isPositiveInt(n))if(q(r)||G(r))switch(e){case"eq":return r.items.length==n;case"min":return r.items.length>=n;case"max":return r.items.length<=n}else t.syntaxError(r,"Error : a map is expected");else t.grammarError(`Error: the map checker '${e}' does not have a positive integer as value`);return!1}static sizeCheckers(t,e,n){return null==e._nb||hr.sizeChecker(t,"eq",e._nb,n)?null==e._min||hr.sizeChecker(t,"min",e._min,n)?!(null!=e._max&&!hr.sizeChecker(t,"max",e._max,n)&&(t.syntaxError(n,`Error : map expected with more than ${e._max} elements but ${n.items.length} are provided`),1)):(t.syntaxError(n,`Error : map expected with more than ${e._min} elements but ${n.items.length} are provided`),!1):(t.syntaxError(n,`Error : map expected with ${e._nb} elements but ${n.items.length} are provided`),!1)}}class pr{static parse(t,e,n){if(!ar.checkCurrent(n))return t.syntaxError(n,"Error : a map whose keys are strings is expected "),null;if(e._merge&&(e=fr.parse(t,e))._oneOf)return cr.parse(t,e,n);let r=e._map,i=e._mapOf,o=e._mapFacultative;if(null!=i&&"object"!=typeof i||null!=o&&"object"!=typeof o)return t.grammarError("Error : error in map value definition"),null;if(!hr.sizeCheckers(t,e,n))return null;if(null!=r)for(let e in r){if("string"!=typeof e)return t.grammarError("Error : error in map definition"),null;if(!n.has(e))return t.syntaxError(n,`Error : key '${e}' not found in current value`),null}let s,a=null;if(i){let t=Object.entries(i);1==t.length&&([[s,a]]=t)}let c={};for(let i of n.items){let n=i.key.value,l=i.value,u=null;if(r&&r[n])u=wr(t,null,r[n],l);else if(o&&o[n])u=wr(t,null,o[n],l);else{if(!s||!a)return t.syntaxError(l,`Error : '${n}' is not a valid key (in rule : ${JSON.stringify(e)})`),null;{let e=wr(t,null,s,i.key);if(u=wr(t,null,a,l),e.value!=n)return t.syntaxError(n,`Error : '${n}' does not match expected '${s}' type`),null}}if(null==u)return t.syntaxError(l,`Error : bad value '${l}'found for '${n}' (mapparser.parse)`),null;let f=new Zn(t,i.key);if(u.key=f,null!=c[n])return t.syntaxError(l,`Error : more than one value provided in the map for the key '${n}'`),null;c[n]=u}return new ar(t,n,c)}static parse_any(t,e){if(!ar.checkCurrent(e))return t.syntaxError(e,"Error : a map whose keys are strings is expected "),null;let n={};return e.items.forEach((e=>{let r=e.key.value,i=e.value,o=yr.parse_any(t,i);if(null==o)return t.syntaxError(i,`Error : bad value '${i}' found for '${r}' (mapparser.parse_any)`),null;let s=new Zn(t,e.key);o.key=s,null!=n[r]&&t.syntaxError(i,`Error : more than one value provided in the map for the key '${r}'`),n[r]=o})),new ar(t,e,n)}}class dr extends sr{constructor(t,e,n){if(super(t,"list",e),!n instanceof Array)throw t.syntaxError(e,"Erorr : ListNode must be initialized with an array. This should not happen.");this.value=n,this.childs=this.value}static checkCurrent(t){return G(t)}}class mr{static parse(t,e,n){if(!dr.checkCurrent(n))return t.syntaxError(n,"Error : a list is expected "),null;if(!hr.sizeCheckers(t,e,n))return null;let r=e._list,i=e._listOf,o=e._listFacultative;if(null!=r&&!(r instanceof Array)||null!=o&&!(o instanceof Array))return t.grammarError("Error : error in list value definition"),null;let s=0,a=n.items.length,c=[];r&&r.forEach((e=>{if(!(s{if(s{let r=yr.parse_any(t,e);if(null==r)return t.SyntaxError(value,`Error : bad value '${value}' found for '${key}' (listparser.parse_any)`),null;n.push(r)})),new dr(t,e,n)}}class yr{static parse(t,e,n){switch(e){case"string":return Zn.parse(t,n);case"binary":return tr.parse(t,n);case"timestamp":return or.parse(t,n);case"int":return er.parse(t,n);case"float":return nr.parse(t,n);case"boolean":return rr.parse(t,n);case"null":return ir.parse(t,n);case"any":return yr.parse_any(t,n);default:return _r(t,e,n)}}static parse_any(t,e){if(W(e)){switch(typeof e.value){case"number":return er.checkCurrent(e)?er.parse(t,e):nr.parse(t,e);case"boolean":return rr.parse(t,e);case"string":return Zn.parse(t,e);case"object":if(null==e.value)return ir.parse(t,e);t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`);default:t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`)}return null}return q(e)?pr.parse_any(t,e):G(e)?mr.parse_any(t,e):null}}class vr{static parse(t,e,n){"object"==typeof e&&e._in||t.grammarError("Error: can not parse _in rule'");let r=e._in;if(!(r instanceof Array))return t.grammarError("Error: _in rules expects a sequence of alternatives"),null;for(let e of r)if(!ur(e))return t.grammarError("Error: _in rules expects each alternative to be a scalar"),null;if(!W(n))return t.syntaxError(n,"Syntax Error : scalar value expected by rule '_in'"),null;let i=yr.parse_any(t,n);if(i){let e=[].concat(t.errors),n=[].concat(t.warnings),o=t.errors.length,s=i.value;for(let a of r)if(a){let r=a==s?i:null;if(null!=r)return t.errors=e,t.warnings=n,r;o=t.errors.length}}return t.syntaxError(n,"Syntax Error : no valid alternative for '_in' rule found during parsing"),null}}class gr{static parse(t,e,n){if(!Zn.checkCurrent(n))return t.syntaxError(n,`Error: regular expressions match only strings, '${n?n.value:""}' is not a string`),null;let r=e._regex;if(null==r)return t.grammarError("Error : regep rule must have a value for key '_regex'"),null;let i=null;try{i=new RegExp(r)}catch(t){}return null==i?(t.grammarError(`Error: value '${i}' is not a valid regular expression`),null):i.test(n.value)?new Zn(t,n):(t.syntaxError(n,`Error: value '${n.value}' does not match the regular expression '${i}'`),null)}}class br{static scalartypes=["string","int","float","null","boolean","binary","timestamp"];static keywords=["_map","_mapOf","_mapFacultative","_list","_listOf","_listFacultative","_oneOf","_regex","_nb","_min","_max","_in"];static parse(t,e,n,r){if(null==r)return t.fileError("No source to parse"),null;if(br.scalartypes.includes(e)||br.keywords.includes(e))return t.syntaxError(r,`'${e}' is not allowed as rule_name in Lidy Grammar (reserved keyword)`),null;let i="enter_"+e;r.ctx=t,t.listener&&t.listener[i]&&t.listener[i](r);let o=wr(t,null,n,r),s="exit_"+e;return"node_template"==e&&console.log("Sortie de node_template"),t.listener&&t.listener[s]&&t.listener[s](o),o}}function wr(t,e,n,r){if(e)return br.parse(t,e,n,r);if(ur(n))return yr.parse(t,n,r);if("object"==typeof n){if(n._map||n._mapOf||n._mapFacultative||n._merge)return pr.parse(t,n,r);if(n._list||n._listOf||n._listFacultative)return mr.parse(t,n,r);if(n._oneOf)return cr.parse(t,n,r);if(n._regex)return gr.parse(t,n,r);if(n._in)return vr.parse(t,n,r)}return t.grammarError("Error : grammar error : no valid keyword found"),null}function _r(t,e,n){let r=t.rules[e];return void 0!==r?wr(t,e,r,n):(t.grammarError(`no rule named ${e} found.`),null)}function kr(t){t.keyword||(t.keyword="main");let e=new Jn;return e.prog=t.prog,t.rules?e.rules=t.rules:function(t,e,n){try{t.rules=function(t,e,n){let r;const i=Hn(t,n);if(!i)return null;if(i.warnings.forEach((t=>Vt(i.options.logLevel,t))),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}(e)}catch(e){throw t.errors.push(e),t.grammarError("ERROR : can not parse dsl ")}if("object"==(t.rules,!1))throw t.grammarError("ERROR : can not parse dsl ");if(!t.rules[n])throw Error("ERROR : no rule labeled '"+n+"' in the grammar")}(e,t.dsl_data,t.keyword),e.listener=t.listener,function(t,e){t.lineCounter=new $n;let n=Hn(e,{lineCounter:t.lineCounter});n||t.fileError("can not parse the provided source code."),t.src=n.contents,t.txt=e,t.errors=n.errors,t.warnings=n.warnings,t.yaml_ok=0==t.errors.length&&0==t.warnings.length}(e,t.src_data),function(t,e,n){let r=_r(t,e,n);return t.errors.filter((t=>t instanceof Yn)).forEach((e=>e.pretty(t))),t.warnings.filter((t=>t instanceof Yn)).forEach((e=>e.pretty(t))),t.contents=r,t}(e,t.keyword,e.src)}var Er={main:"workflow",workflow:{_mapFacultative:{name:"WorkflowName",on:{_mapFacultative:{push:"PushTrigger",pull_request:"PullRequestTrigger"}},jobs:{_mapOf:{JobId:"Job"}}}},WorkflowName:"string",PushTrigger:{_map:{branches:"PushTriggerBranches"}},PushTriggerBranches:{_listOf:"string"},PullRequestTrigger:{_map:{types:"PullRequestTriggerTypes"}},PullRequestTriggerTypes:{_listOf:"string"},Job:{_mapFacultative:{name:"JobName","runs-on":"JobRunsOn",needs:"JobNeeds",steps:{_listOf:"Step"}}},JobId:"string",JobName:"string",JobRunsOn:"string",JobNeeds:{_listOf:"string"},Step:{_oneOf:["CommandStep","ReusableStep"]},ReusableStep:{_map:{uses:"StepUses"},_mapFacultative:{name:"StepName",with:"StepWith",env:"StepEnv"}},CommandStep:{_map:{run:"StepRun"},_mapFacultative:{name:"StepName",env:"StepEnv"}},StepUses:"string",StepName:"string",StepRun:"string",StepWith:{_mapOf:{StepMapKey:"StepMapValue"}},StepEnv:{_mapOf:{StepMapKey:"StepMapValue"}},StepMapKey:"string",StepMapValue:{_oneOf:["int","float","string"]}};function xr(t){return xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xr(t)}function Or(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.pluginData.components=[],this.pluginData.parseErrors=[],e.filter((function(e){var r=e.path,i=e.content;return!(!i||""===i.trim())||(t.pluginData.emitEvent({parent:n,type:"Parser",action:"read",status:"warning",files:[r],data:{code:"no_content",global:!1}}),!1)})).forEach((function(e,r){var i=t.pluginData.emitEvent({parent:n,type:"Parser",action:"read",status:"running",files:[e.path],data:{global:!1}}),o=new I(e,t.pluginData.definitions.components,"workflow_".concat(r+1));!function(t){t.rules=Er,kr(t)}({src_data:e.content,listener:o,path:e.path,prog:{errors:[],warnings:[],imports:[],alreadyImported:[],root:[]}}),o.components.forEach((function(e){return t.pluginData.components.push(e)})),t.pluginData.emitEvent({id:i,status:"success"})}))}}],n&&Or(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(t.DefaultParser);var Nr=n(985),Cr=n.n(Nr);const jr={root:"name: {{ workflowName.value }}\n\n{% if triggers.length > 0 %}\non:\n{% for trigger in triggers %}\n{% if trigger.definition.action === 'push' %}{% set branches = getTriggerAttribute(trigger, 'branches').value %}\n push:\n branches: [{% if branches.length > 0 %}{{ branches.join(', ') }}{% endif %}]\n{% else %}{% set types = getTriggerAttribute(trigger, 'types').value %}\n pull_request:\n types: [{% if types.length > 0 %}{{ types.join(', ') }}{% endif %}]\n{% endif %}\n{% endfor %}\n{% endif %}\n\njobs:\n{% for job in jobs %}\n {{ job.id }}:\n{% for attribute in getAttributes(job) %}\n {% if attribute.type === 'Array' %}\n {{attribute.name}}: [{{ attribute.value.join(', ')}}]\n {% else %}\n {{attribute.name}}: {{attribute.value }}\n {% endif %}\n{% endfor %}\n{% if getSteps(job.id).length > 0 %}\n steps:\n{% for step in getSteps(job.id) %}\n{% for attribute in getAttributes(step) %}\n{% if attribute.type === 'Array' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: [{{ attribute.value.join(', ')}}]\n{% elif attribute.type === 'Object' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}:\n{% for value in attribute.value %}\n{{value.name | indent(10,true)}}: {% if value.type == 'Number' and value.value == null %}0{% else %}{{ value.value }}{% endif %}\n\n{% endfor %}\n{% else %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: {{ attribute.value }}\n{% endif %}\n{% endfor %}\n{% endfor %}\n\n{% endif %}\n{% endfor %}"};function Pr(t){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(t)}function Ir(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,i=[];return e.forEach((function(e,o){var s=n.pluginData.emitEvent({parent:r,type:"Render",action:"write",status:"running",files:[o],data:{global:!1}}),a=e.find((function(t){return"workflow"===t.definition.type})),c=e.filter((function(t){return"trigger"===t.definition.type})),l=e.filter((function(t){return"step"===t.definition.type})),u="".concat(n.template.render({workflow:a,workflowName:null==a?void 0:a.attributes.find((function(t){return"name"===t.name})),triggers:c,jobs:e.filter((function(t){return"job"===t.definition.type})),getAttributes:function(t){return t.attributes.filter((function(t){var e=t.name;return"workflow_id"!==e&&"job_id"!==e}))},getTriggerAttribute:function(t,e){return t.attributes.find((function(t){return t.name===e}))},getSteps:function(t){return l.filter((function(e){return e.attributes.some((function(e){var n=e.name,r=e.value;return"job_id"===n&&r===t}))}))}}).trim(),"\n");i.push(new t.FileInput({path:o,content:u})),n.pluginData.emitEvent({id:s,status:"success"})})),i}}],r&&Ir(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),a}(t.DefaultRender);const Fr=Dr,$r=JSON.parse('{"u2":"githubator-plugin","i8":"0.2.0"}'),Kr={name:"githubAction",languageSettings:{id:"githubAction",extensions:[".yml",".yaml"],aliases:["githubaction","Githubaction","githubAction","GithubAction"],mimetypes:["string"]},languageConfiguration:{comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],colorizedBracketPairs:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"(",close:")"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"'",close:"'",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{offSide:!0}},tokenProvider:{tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?\d+)/,numberFloat:/(?:0|[+-]?\d+)(?:\.\d+)?(?:e[-+][1-9]\d*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,{[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|]\d*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]}])/,"number"],[/@numberFloat(?=[ \t]*[,\]}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]}])/,"number.date"]],tagHandle:[[/![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}}};function Vr(t){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vr(t)}function Ur(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qr(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{event:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var n=new Yr({defaultFileName:"new_workflow.yml",defaultFileExtension:"yml"}),r=new t.DefaultData(n,{name:$r.u2,version:$r.i8},e.event);return o.call(this,{configuration:n,pluginData:r,pluginDrawer:new u(r),pluginMetadata:new N(r),pluginParser:new Lr(r),pluginRenderer:new Fr(r)})}return n=s,Object.defineProperty(n,"prototype",{writable:!1}),n}(t.DefaultPlugin)})();var i=exports;for(var o in r)i[o]=r[o];r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var t={181:(t,e)=>{(()=>{var t={985:function(t){var e;"undefined"!=typeof self&&self,e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){"use strict";var r=Array.prototype,i=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},s=/[&"'<>\\]/g;function a(t,e){return i.hasOwnProperty.call(t,e)}function c(t){return o[t]}function l(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,l.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var s=Object.getOwnPropertyDescriptor(i,"stack");(o=s&&(s.get||function(){return s.value}))||(o=function(){return i.stack})}else{var a=new Error(t).stack;o=function(){return a}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function u(t){return"[object Function]"===i.toString.call(t)}function f(t){return"[object Array]"===i.toString.call(t)}function h(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)s=i.slice(0,t.length),i.slice(s.length,l).forEach((function(t,n){n2?i-2:0),s=2;s0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:c,Root:f,NodeList:u,Value:l,Literal:h,Symbol:p,Group:d,Array:m,Pair:y,Dict:v,Output:$,Capture:K,TemplateData:V,If:b,IfAsync:w,InlineIf:_,For:k,AsyncEach:E,AsyncAll:x,Macro:O,Caller:S,Import:T,FromImport:A,FunCall:L,Filter:N,FilterAsync:C,KeywordArgs:j,Block:P,Super:I,Extends:R,Include:M,Set:B,Switch:D,Case:F,LookupVal:g,BinOp:q,In:z,Is:W,Or:G,And:H,Not:Y,Add:J,Concat:X,Sub:Q,Mul:Z,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:st,CompareOperand:at,CallExtension:ct,CallExtensionAsync:lt,printNodes:function t(e,n){if(n=n||0,ut(e.typename+": ",n),e instanceof u)ut("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof ct)ut(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof c?r.push([e,t]):(i=i||{})[e]=t})),i?ut(JSON.stringify(i,null,2)+"\n",null,!0):ut("\n"),r.forEach((function(e){var r=e[0],i=e[1];ut("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),s=n(3),a=n(0).TemplateError,c=n(2).Frame,l=n(1).Obj,u={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},f=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new a(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var c=this._tmpid();this._emitLine(", "+this._makeCallback(c)),this._emitLine(this.buffer+" += runtime.suppressValue("+c+", "+a+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+a+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof s.Symbol?n=new s.Literal(n.lineno,n.colno,n.value):n instanceof s.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+u[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,s.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,s.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof s.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,s){var a=n._tmpid();n._emitLine("var "+a+" = "+o+"["+r+"]["+s+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+s+"]);"),e.set(t.name.children[s].value,a)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var a=t.name.children,c=a[0],l=a[1],u=this._tmpid(),f=this._tmpid();e.set(c.value,u),e.set(l.value,f),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+u+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+f+" = "+o+"["+u+"];"),this._emitLine('frame.set("'+c.value+'", '+u+");"),this._emitLine('frame.set("'+l.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var h=this._tmpid();e.set(t.name.value,h),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+h+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),a=this._tmpid(),c=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+a+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof s.Array){var l=t.name.children.length;this._emit("runtime."+c+"("+a+", "+l+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var u=t.name.value;this._emitLine("runtime."+c+"("+a+", 1, function("+u+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+u+'", '+u+");"),e.set(u,u)}this._emitLoopBindings(t,a,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var f=this._tmpid();this._emitLine("}, "+this._makeCallback(f)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+f+";"),t.else_&&(this._emitLine("if (!"+a+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),a=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof s.Dict?i=e:(n.assertType(e,s.Symbol),r.push(e))}));var l,u=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),f=r.map((function(t){return'"'+t.value+'"'})),h=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));l=a?e.push(!0):new c,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+u.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),l.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,l),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,l)})),this._emitLine("frame = "+(a?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),s=this._makeCallback(i),a=n?"true":"false",c=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+a+", "+o+", "+c+", "+s),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,a=n._tmpid();t instanceof s.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+a+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,a),e.parent?n._emitLine('frame.set("'+o+'", '+a+");"):n._emitLine('context.setVariable("'+o+'", '+a+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof s.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new c,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(s.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new c;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(l);t.exports={compile:function(t,e,n,r,s){void 0===s&&(s={});var a=new f(r,s.throwOnUndefined),c=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return a.compile(o.transform(i.parse(c,n,s),e,r)),a.getCode()},Compiler:f}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var s=o.prototype;return s.resolve=function(t,e){return i.resolve(i.dirname(t),e)},s.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),s=n(15),a=n(0),c=n(5),l=n(18),u=n(10),f=u.FileSystemLoader,h=u.WebLoader,p=u.PrecompiledLoader,d=n(20),m=n(21),y=n(1),v=y.Obj,g=y.EmitterObj,b=n(2),w=b.handleError,_=b.Frame,k=n(22);function E(t,e,n){o((function(){t(e,n)}))}var x={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(w(t,null,null))}}}},O=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=a.isArray(t)?t:[t]:f?this.loaders=[new f("views")]:h&&(this.loaders=[new h("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],a._entries(l).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),a._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=a.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,s=this,c=this,l=null;if(t&&t.raw&&(t=t.raw),a.isFunction(n)&&(i=n,n=null,e=e||!1),a.isFunction(e)&&(i=e,e=!1),t instanceof T)l=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var u=0;u0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var a=this.parsePrimary();if("_"===a.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",a.lineno,a.colno),this.skipSymbol("as")){var c=this.parsePrimary();r.addChild(new o.Pair(a.lineno,a.colno,a,c))}else r.addChild(a);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},c.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},c.parseExtends=function(){var t="extends",e=this.peekToken();this.skipSymbol(t)||this.fail("parseTemplateRef: expected "+t);var n=new o.Extends(e.lineno,e.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(e.value),n},c.parseInclude=function(){var t="include",e=this.peekToken();this.skipSymbol(t)||this.fail("parseInclude: expected "+t);var n=new o.Include(e.lineno,e.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(e.value),n},c.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},c.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},c.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var s=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var a,c=this.peekToken(),l=[];do{this.skipSymbol(n);var u=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);l.push(new o.Case(c.line,c.col,u,f)),c=this.peekToken()}while(c&&c.value===n);switch(c.value){case r:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,s,l,a)},c.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==a.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var c=s[0],l=s[1],u=s[2];u===t?r+=1:u===e&&(r-=1),0===r?(i+=l,this.tokens.backN(c.length-l.length)):i+=c}return new o.Output(a.lineno,a.colno,[new o.TemplateData(a.lineno,a.colno,i)])},c.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},c.parseExpression=function(){return this.parseInlineIf()},c.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},c.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},c.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},c.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},c.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},c.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},c.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},c.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},c.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},c.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},c.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},c.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},c.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},c.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},c.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},c.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},c.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},c.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},c.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},c.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var s=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,s))}else{var a=this.parseExpression();t.addChild(a)}}return t},c.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),s=new o.KeywordArgs(n.lineno,n.colno),a=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(a&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var c=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?s.addChild(new o.Pair(c.lineno,c.colno,c,this.parseExpression())):r.addChild(c)}a=!0}return s.children.length&&r.addChild(s),r},c.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],B=C+this.current();switch(-1!==r.indexOf(M,B)&&(this.forward(),C=B,-1!==r.indexOf(M,B+this.current())&&(C=B+this.current(),this.forward())),C){case"(":R=d;break;case")":R=m;break;case"[":R=y;break;case"]":R=v;break;case"{":R=g;break;case"}":R=b;break;case",":R=_;break;case":":R=k;break;case"~":R=E;break;case"|":R=x;break;default:R=w}return N(R,C,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var D=this._extract("0123456789");return N(O,t+"."+D,e,n)}return N("int",t,e,n)}if(t.match(/^(true|false)$/))return N(S,t,e,n);if("none"===t)return N(T,t,e,n);if("null"===t)return N(T,t,e,n);if(t)return N(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,$=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,N(l,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,N(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil($));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!K){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var V=t.slice(-this.colno);if(/^\s+$/.test(V)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return N(K?p:c,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[t];if(void 0===c)return!1;if("function"==typeof c)o(c,this,e);else{var l=c.length,u=y(c,l);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function s(){return"hole_"+o++}function a(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,s=r.repeat(" ",n/2-n%2),a=r.repeat(" ",n/2);return i.copySafeness(t,s+t+a)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var s in t)o.push([s,t[s]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],s=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(s)&&(s=s.toUpperCase())),o>s?1:o===s?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var s=t.split("\n"),a=r.repeat(" ",e),c=s.map((function(t,e){return 0!==e||n?""+a+t:t})).join("\n");return i.copySafeness(t,c)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=c,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=l(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=l(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var s="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return s=n+t.split("").join(n)+n,i.copySafeness(t,s);var a=t.indexOf(e);if(0===r||-1===a)return t;for(var c=0,l=0;a>-1&&(-1===r||l=i&&u.push(n),o.push(u)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,s=r.map(t,(function(t){return t})),a=r.getAttrGetter(i);return s.sort((function(t,s){var c=i?a(t):t,l=i?a(s):s;if(o.env.opts.throwOnUndefined&&i&&(void 0===c||void 0===l))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(c)&&r.isString(l)&&(c=c.toLowerCase(),l=l.toLowerCase()),cl?e?-1:1:0})),s})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=u((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return a(t)}));return i.copySafeness(t,e.join(" "))},e.trim=u,e.truncate=function(t,e,n,r){var s=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var a=t.lastIndexOf(" ",e);-1===a&&(a=e),t=t.substring(0,a)}return t+=null!=r?r:"...",i.copySafeness(s,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var f=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,h=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){s(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(f),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":h.test(i)?''+i+"":m.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return s(n)?e:n};var y=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return s(r)?e:r}));e.int=y,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return t=Array.prototype.slice.call(arguments),e=-1,{current:null,reset:function(){e=-1,this.current=null},next:function(){return++e>=t.length&&(e=0),this.current=t[e],this.current}};var t,e},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,s=n(5),a=n(7).Environment,c=n(24);function l(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function u(t,e){(e=e||{}).isString=!0;var n=e.env||new a([]),r=e.wrapper||c;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([f(t,e.name,n)],e)}function f(t,e,n){var r,i=(n=n||new a([])).asyncFilters,c=n.extensionsList;e=e.replace(/\\/g,"/");try{r=s.compile(t,i,c,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new a([]),o=e.wrapper||c;if(e.isString)return u(t,e);var s=r.existsSync(t)&&r.statSync(t),h=[],p=[];if(s.isFile())h.push(f(r.readFileSync(t,"utf-8"),e.name||t,n));else if(s.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(s){var a=i.join(o,s),c=a.substr(i.join(t,"/").length),u=r.statSync(a);u&&u.isDirectory()?l(c+="/",e.exclude)||n(a):l(c,e.include)&&p.push(a)}))}(t);for(var d=0;dt.length||i>0&&s>=r||i<0&&s<=r);s+=i)o.push(n.memberLookup(t,s));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}r.r(i),r.d(i,{Component:()=>f,ComponentAttribute:()=>n,ComponentAttributeDefinition:()=>b,ComponentDefinition:()=>p,ComponentDrawOption:()=>w,ComponentLink:()=>x,ComponentLinkDefinition:()=>S,DefaultConfiguration:()=>Gi,DefaultData:()=>Ki,DefaultDrawer:()=>vi,DefaultMetadata:()=>bi,DefaultParser:()=>ki,DefaultPlugin:()=>Ji,DefaultRender:()=>Oi,FileInformation:()=>s,FileInput:()=>N,ParseError:()=>ji,Tag:()=>Qi});var e=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,value:null,type:null,definition:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.name,r=t.value,i=t.type,o=t.definition;this.name=n||null,this.value=null!=r?r:null,this.type=i||null,this.definition=o||null}var n,r;return n=e,r=[{key:"hasError",value:function(){return null===this.definition?null===this.value||("array"===this.type.toLowerCase()?!Array.isArray(this.value):t(this.value)!==this.type.toLowerCase()):null!==this.value&&void 0!==this.value&&(this.__typeOfValueValidation()||this.__ruleValueValidation()||this.__ruleMinAndMaxValidation()||this.__ruleRegexValidation())}},{key:"__typeOfValueValidation",value:function(){var e=this.type.toLowerCase();return"array"===e?"Link"===this.definition.type?!Array.isArray(this.value)||this.value.some((function(t){return"string"!=typeof t})):!Array.isArray(this.value):t(this.value)!==e}},{key:"__ruleValueValidation",value:function(){return this.definition.rules.values&&!this.definition.rules.values.includes(this.value)}},{key:"__ruleMinAndMaxValidation",value:function(){var t="number"==typeof this.value?this.value:this.value.length;return null!==this.definition.rules.min&&tthis.definition.rules.max}},{key:"__ruleRegexValidation",value:function(){return null!==this.definition.rules.regex&&!new RegExp(this.definition.rules.regex).test(this.value)}}],r&&function(e,n){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{path:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.path;this.path=n||null}var e,n;return e=t,(n=[{key:"fileName",get:function(){return this.path?this.path.replace(/^.*[\\/]/,""):null}}])&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{id:null,name:null,definition:null,drawOption:null,attributes:[]};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),t=s.call(this,e);var n=e.id,r=e.name,i=e.definition,o=e.drawOption,a=e.attributes;return t.__class="Component",t.id=n||null,t.name=r||null,t.definition=i||null,t.drawOption=o||null,t.attributes=a||[],t}return e=u,r=[{key:"setReferenceAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.containerRef===t.definition.type}));if(e){var r=this.attributes.filter((function(t){var n=t.definition;return(null==n?void 0:n.name)===e.name}));r.length>0?r.forEach((function(e){e.value=t.id})):this.attributes.push(new n({name:e.name,value:t.id,type:"String",definition:e}))}}},{key:"removeAllReferenceAttributes",value:function(t){this.attributes=t?this.attributes.filter((function(e){var n=e.definition,r=e.value;return!("Reference"===n.type&&n.containerRef===t.definition.type&&r===t.id)})):this.attributes.filter((function(t){return"Reference"!==t.definition.type}))}},{key:"setLinkAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.name===t.definition.attributeRef})),r=this.attributes.find((function(t){var n=t.definition;return"Link"===n.type&&e.name===n.name}));r&&!r.value.includes(t.target)?r.value.push(t.target):r||this.attributes.push(new n({name:e.name,definition:e,type:"Array",value:[t.target]}))}},{key:"removeLinkAttribute",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.attributes=this.attributes.filter((function(n){if(e&&n.name!==e)return!0;if(n.definition&&"Link"===n.definition.type){var r=n.value.findIndex((function(e){return e===t}));return r>=0&&n.value.splice(r,1),0!==n.value.length}return!0}))}},{key:"getAttributeByName",value:function(t){return this.__getAttributeByName(this.attributes,t)}},{key:"__getAttributeByName",value:function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,icon:null,model:null,displayName:null,description:null,url:null,parentTypes:[],childrenTypes:[],definedAttributes:[],isContainer:!1,displayType:null,preventChildrenMovement:!1,childrenPerLine:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.type,r=e.icon,i=e.model,o=e.displayName,s=e.description,a=e.url,c=e.parentTypes,l=e.childrenTypes,u=e.definedAttributes,f=e.isContainer,h=e.displayType,p=e.preventChildrenMovement,d=e.childrenPerLine;this.type=n||null,this.icon=r||null,this.model=i||null,this.displayName=o||null,this.description=s||null,this.url=a||null,this.parentTypes=c||[],this.childrenTypes=l||[],this.definedAttributes=u||[],this.isContainer=void 0!==f&&f,this.displayType=h||null,this.preventChildrenMovement=null!=p&&p,this.childrenPerLine=null!=d?d:null}));const p=h;function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function y(t,e,n){return(e=v(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v(t){var e=function(t,e){if("object"!==d(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===d(e)?e:String(e)}var g=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,displayName:null,description:null,url:null,linkType:null,linkRef:[],linkColor:"black",linkWidth:2,linkDashStyle:null,containerRef:null,required:!1,definedAttributes:[],rules:{values:null,min:null,max:null,regex:null}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.name,r=e.type,i=e.displayName,o=e.description,s=e.url,a=e.linkType,c=e.linkRef,l=e.linkColor,u=e.linkWidth,f=e.linkDashStyle,h=e.containerRef,p=e.definedAttributes,d=e.required,v=e.rules;this.name=n||null,this.type=r||null,this.displayName=i||null,this.description=o||null,this.url=s||null,this.linkType=a||null,this.linkRef=c||[],this.linkColor=l||"black",this.linkWidth=u||2,this.linkDashStyle=f||null,this.containerRef=h||null,this.definedAttributes=p||[],this.required=d||!1,this.rules=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{x:null,y:null,width:null,height:null,needsResizing:!1,needsPositioning:!1,manuallyResized:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.x,r=e.y,i=e.width,o=e.height,s=e.needsResizing,a=e.needsPositioning,c=e.manuallyResized;this.x=n||null,this.y=r||null,this.width=i||null,this.height=o||null,this.needsResizing=s||!1,this.needsPositioning=a||!1,this.manuallyResized=c||!1}));function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},k(t,e)}function E(t){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},E(t)}const x=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&k(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=E(n);if(r){var i=E(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{source:null,target:null,definition:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this);var n=e.source,r=e.target,s=e.definition;return t.__class="Link",t.source=n||null,t.target=r||null,t.definition=s||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(s);var O=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{attributeRef:null,sourceRef:null,targetRef:null,type:null,color:"black",width:2,dashStyle:null,marker:{width:5,height:5,refX:4,refY:2.5,orient:"auto-start-reverse",path:"M 0 0 L 5 2.5 L 0 5"}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.attributeRef,r=e.sourceRef,i=e.targetRef,o=e.type,s=e.color,a=e.width,c=e.dashStyle,l=e.marker;this.attributeRef=n||null,this.sourceRef=r||null,this.targetRef=i||null,this.type=o||null,this.color=s||"black",this.width=a||2,this.dashStyle=c||null,this.marker=l||{width:5,height:5,refX:4,refY:2.5,orient:"auto-start-reverse",path:"M 0 0 L 5 2.5 L 0 5"}}));const S=O;function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function A(t,e){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},A(t,e)}function L(t){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},L(t)}const N=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&A(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=L(n);if(r){var i=L(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===T(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,name:null,content:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this,e);var n=e.content;return t.content=n||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(s);class C extends Map{constructor(t,e=P){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(j(this,t))}has(t){return super.has(j(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}(this,t))}}function j({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function P(t){return null!==t&&"object"==typeof t?t.valueOf():t}function I(t){return t}function R(){}function M(t){return null==t?R:function(){return this.querySelector(t)}}function B(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function D(){return[]}function F(t){return null==t?D:function(){return this.querySelectorAll(t)}}function $(t){return function(){return this.matches(t)}}function K(t){return function(e){return e.matches(t)}}var V=Array.prototype.find;function U(){return this.firstElementChild}var q=Array.prototype.filter;function z(){return Array.from(this.children)}function W(t){return new Array(t.length)}function G(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function H(t,e,n,r,i,o){for(var s,a=0,c=e.length,l=o.length;ae?1:t>=e?0:NaN}G.prototype={constructor:G,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Z="http://www.w3.org/1999/xhtml";const tt={svg:"http://www.w3.org/2000/svg",xhtml:Z,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function et(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),tt.hasOwnProperty(e)?{space:tt[e],local:t}:t}function nt(t){return function(){this.removeAttribute(t)}}function rt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function it(t,e){return function(){this.setAttribute(t,e)}}function ot(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function st(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function at(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ct(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function lt(t){return function(){this.style.removeProperty(t)}}function ut(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ft(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function ht(t,e){return t.style.getPropertyValue(e)||ct(t).getComputedStyle(t,null).getPropertyValue(e)}function pt(t){return function(){delete this[t]}}function dt(t,e){return function(){this[t]=e}}function mt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function yt(t){return t.trim().split(/^|\s+/)}function vt(t){return t.classList||new gt(t)}function gt(t){this._node=t,this._names=yt(t.getAttribute("class")||"")}function bt(t,e){for(var n=vt(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var qt=[null];function zt(t,e){this._groups=t,this._parents=e}function Wt(){return new zt([[document.documentElement]],qt)}zt.prototype=Wt.prototype={constructor:zt,select:function(t){"function"!=typeof t&&(t=M(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=_&&(_=w+1);!(b=v[_])&&++_=0;)(r=i[o])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Q);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?lt:"function"==typeof e?ft:ut)(t,e,null==n?"":n)):ht(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?pt:"function"==typeof e?mt:dt)(t,e)):this.node()[t]},classed:function(t,e){var n=yt(t+"");if(arguments.length<2){for(var r=vt(this.node()),i=-1,o=n.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),s=o.length;if(!(arguments.length<2)){for(a=e?$t:Ft,r=0;r{}};function Yt(){for(var t,e=0,n=arguments.length,r={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),s=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s0)for(var n,r,i=new Array(n),o=0;o=0&&e._call.call(void 0,t),e=e._next;--ne}()}finally{ne=0,function(){for(var t,e,n=te,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:te=e);ee=t,ve(r)}(),ae=0}}function ye(){var t=le.now(),e=t-se;e>oe&&(ce-=e,se=t)}function ve(t){ne||(re&&(re=clearTimeout(re)),t-ae>24?(t<1/0&&(re=setTimeout(me,t-le.now()-ce)),ie&&(ie=clearInterval(ie))):(ie||(se=le.now(),ie=setInterval(ye,oe)),ne=1,ue(me)))}function ge(t,e,n){var r=new pe;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}pe.prototype=de.prototype={constructor:pe,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?fe():+n)+(null==e?0:+e),this._next||ee===this||(ee?ee._next=this:te=this,ee=this),this._call=t,this._time=n,ve()},stop:function(){this._call&&(this._call=null,this._time=1/0,ve())}};var be=Zt("start","end","cancel","interrupt"),we=[],_e=0,ke=3;function Ee(t,e,n,r,i,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(c){var l,u,f,h;if(1!==n.state)return a();for(l in i)if((h=i[l]).name===n.name){if(h.state===ke)return ge(o);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[l]):+l_e)throw new Error("too late; already scheduled");return n}function Oe(t,e){var n=Se(t,e);if(n.state>ke)throw new Error("too late; already running");return n}function Se(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Te(t,e){var n,r,i,o=t.__transition,s=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):s=!1;s&&delete t.__transition}}function Ae(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Le,Ne=180/Math.PI,Ce={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function je(t,e,n,r,i,o){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Ae(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,s.rotate,a,c),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Ae(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,s.skewX,a,c),function(t,e,n,r,o,s){if(t!==n||e!==r){var a=o.push(i(o)+"scale(",null,",",null,")");s.push({i:a-4,x:Ae(t,n)},{i:a-2,x:Ae(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,c),o=s=null,function(t){for(var e,n=-1,r=c.length;++n>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?sn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?sn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=He.exec(t))?new cn(e[1],e[2],e[3],1):(e=Ye.exec(t))?new cn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Je.exec(t))?sn(e[1],e[2],e[3],e[4]):(e=Xe.exec(t))?sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Qe.exec(t))?dn(e[1],e[2]/100,e[3]/100,1):(e=Ze.exec(t))?dn(e[1],e[2]/100,e[3]/100,e[4]):tn.hasOwnProperty(t)?on(tn[t]):"transparent"===t?new cn(NaN,NaN,NaN,0):null}function on(t){return new cn(t>>16&255,t>>8&255,255&t,1)}function sn(t,e,n,r){return r<=0&&(t=e=n=NaN),new cn(t,e,n,r)}function an(t,e,n,r){return 1===arguments.length?((i=t)instanceof Ke||(i=rn(i)),i?new cn((i=i.rgb()).r,i.g,i.b,i.opacity):new cn):new cn(t,e,n,null==r?1:r);var i}function cn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ln(){return`#${pn(this.r)}${pn(this.g)}${pn(this.b)}`}function un(){const t=fn(this.opacity);return`${1===t?"rgb(":"rgba("}${hn(this.r)}, ${hn(this.g)}, ${hn(this.b)}${1===t?")":`, ${t})`}`}function fn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function hn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function pn(t){return((t=hn(t))<16?"0":"")+t.toString(16)}function dn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new yn(t,e,n,r)}function mn(t){if(t instanceof yn)return new yn(t.h,t.s,t.l,t.opacity);if(t instanceof Ke||(t=rn(t)),!t)return new yn;if(t instanceof yn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(s=e===o?(n-r)/a+6*(n0&&c<1?0:s,new yn(s,a,c,t.opacity)}function yn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function vn(t){return(t=(t||0)%360)<0?t+360:t}function gn(t){return Math.max(0,Math.min(1,t||0))}function bn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function wn(t,e,n,r,i){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*n+(1+3*t+3*o-3*s)*r+s*i)/6}Fe(Ke,rn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:en,formatHex:en,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return mn(this).formatHsl()},formatRgb:nn,toString:nn}),Fe(cn,an,$e(Ke,{brighter(t){return t=null==t?Ue:Math.pow(Ue,t),new cn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ve:Math.pow(Ve,t),new cn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new cn(hn(this.r),hn(this.g),hn(this.b),fn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ln,formatHex:ln,formatHex8:function(){return`#${pn(this.r)}${pn(this.g)}${pn(this.b)}${pn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:un,toString:un})),Fe(yn,(function(t,e,n,r){return 1===arguments.length?mn(t):new yn(t,e,n,null==r?1:r)}),$e(Ke,{brighter(t){return t=null==t?Ue:Math.pow(Ue,t),new yn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ve:Math.pow(Ve,t),new yn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new cn(bn(t>=240?t-240:t+120,i,r),bn(t,i,r),bn(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new yn(vn(this.h),gn(this.s),gn(this.l),fn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=fn(this.opacity);return`${1===t?"hsl(":"hsla("}${vn(this.h)}, ${100*gn(this.s)}%, ${100*gn(this.l)}%${1===t?")":`, ${t})`}`}}));const _n=t=>()=>t;function kn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):_n(isNaN(t)?e:t)}const En=function t(e){var n=function(t){return 1==(t=+t)?kn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):_n(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=an(t)).r,(e=an(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),s=kn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=s(e),t+""}}return r.gamma=t,r}(1);function xn(t){return function(e){var n,r,i=e.length,o=new Array(i),s=new Array(i),a=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=ro&&(i=e.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,c.push({i:s,x:Ae(n,r)})),o=Sn.lastIndex;return o=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?xe:Oe;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}(n,t,e))},attr:function(t,e){var n=et(t),r="transform"===n?Re:An;return this.attrTween(t,"function"==typeof e?(n.local?In:Pn)(n,r,De(this,"attr."+t,e)):null==e?(n.local?Nn:Ln)(n):(n.local?jn:Cn)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=et(t);return this.tween(n,(r.local?Rn:Mn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Ie:An;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=ht(this,t),s=(this.style.removeProperty(t),ht(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}(t,r)).on("end.style."+t,Vn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var s=ht(this,t),a=n(this),c=a+"";return null==a&&(this.style.removeProperty(t),c=a=ht(this,t)),s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a))}}(t,r,De(this,"style."+t,e))).each(function(t,e){var n,r,i,o,s="style."+e,a="end."+s;return function(){var c=Oe(this,t),l=c.on,u=null==c.value[s]?o||(o=Vn(e)):void 0;l===n&&i===u||(r=(n=l).copy()).on(a,i=u),c.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var s=ht(this,t);return s===o?null:s===r?i:i=e(r=s,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(De(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=Se(this.node(),n).tween,o=0,s=i.length;o()=>t;function cr(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}function lr(t){return!t.ctrlKey&&!t.button}function ur(){return this.parentNode}function fr(t,e){return null==e?{x:t.x,y:t.y}:e}function hr(){return navigator.maxTouchPoints||"ontouchstart"in this}function pr(){var t,e,n,r,i=lr,o=ur,s=fr,a=hr,c={},l=Zt("start","drag","end"),u=0,f=0;function h(t){t.on("mousedown.drag",p).filter(a).on("touchstart.drag",y).on("touchmove.drag",v,er).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(s,a){if(!r&&i.call(this,s,a)){var c=b(this,o.call(this,s,a),s,a,"mouse");c&&(Zn(s.view).on("mousemove.drag",d,nr).on("mouseup.drag",m,nr),or(s.view),rr(s),n=!1,t=s.clientX,e=s.clientY,c("start",s))}}function d(r){if(ir(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>f}c.mouse("drag",r)}function m(t){Zn(t.view).on("mousemove.drag mouseup.drag",null),sr(t.view,n),ir(t),c.mouse("end",t)}function y(t,e){if(i.call(this,t,e)){var n,r,s=t.changedTouches,a=o.call(this,t,e),c=s.length;for(n=0;n=0;)e+=n[r].value;else e=1;t.value=e}function mr(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=vr)):void 0===e&&(e=yr);for(var n,r,i,o,s,a=new wr(t),c=[a];n=c.pop();)if((i=e(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)c.push(r=i[o]=new wr(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(br)}function yr(t){return t.children}function vr(t){return Array.isArray(t)?t[1]:null}function gr(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function br(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function wr(t){this.data=t,this.depth=this.height=0,this.parent=null}function _r(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function kr(t,e,n,r,i){for(var o,s=t.children,a=-1,c=s.length,l=t.value&&(r-e)/t.value;++a=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return mr(this).eachBefore(gr)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;nh&&(h=a),y=u*u*m,(p=Math.max(h/y,y/f))>d){u-=a;break}d=p}v.push(s={value:u,dice:c1?e:1)},n}((1+Math.sqrt(5))/2);function Or(){return 0}function Sr(t){return function(){return t}}function Tr(t){return"string"==typeof t?new zt([document.querySelectorAll(t)],[document.documentElement]):new zt([B(t)],qt)}var Ar=Array.prototype.slice;function Lr(t){return function(){return t}}const Nr=Math.PI,Cr=2*Nr,jr=1e-6,Pr=Cr-jr;function Ir(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Ir;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;ejr)if(Math.abs(u*a-c*l)>jr&&i){let h=n-o,p=r-s,d=a*a+c*c,m=h*h+p*p,y=Math.sqrt(d),v=Math.sqrt(f),g=i*Math.tan((Nr-Math.acos((d+f-m)/(2*y*v)))/2),b=g/v,w=g/y;Math.abs(b-1)>jr&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*p)},${this._x1=t+w*a},${this._y1=e+w*c}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(r),a=n*Math.sin(r),c=t+s,l=e+a,u=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>jr||Math.abs(this._y1-l)>jr)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%Cr+Cr),f>Pr?this._append`A${n},${n},0,1,${u},${t-s},${e-a}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>jr&&this._append`A${n},${n},0,${+(f>=Nr)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Mr(t){return t[0]}function Br(t){return t[1]}function Dr(t){return t.source}function Fr(t){return t.target}class $r{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function Kr(t){return new $r(t,!0)}function Vr(t){return new $r(t,!1)}function Ur(t){return((t=Math.exp(t))+1/t)/2}const qr=function t(e,n,r){function i(t,i){var o,s,a=t[0],c=t[1],l=t[2],u=i[0],f=i[1],h=i[2],p=u-a,d=f-c,m=p*p+d*d;if(m<1e-12)s=Math.log(h/l)/e,o=function(t){return[a+t*p,c+t*d,l*Math.exp(e*t*s)]};else{var y=Math.sqrt(m),v=(h*h-l*l+r*m)/(2*l*n*y),g=(h*h-l*l-r*m)/(2*h*n*y),b=Math.log(Math.sqrt(v*v+1)-v),w=Math.log(Math.sqrt(g*g+1)-g);s=(w-b)/e,o=function(t){var r,i=t*s,o=Ur(b),u=l/(n*y)*(o*(r=e*i+b,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[a+u*p,c+u*d,l*o/Ur(e*i+b)]}}return o.duration=1e3*s*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4),zr=t=>()=>t;function Wr(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Gr(t,e,n){this.k=t,this.x=e,this.y=n}Gr.prototype={constructor:Gr,scale:function(t){return 1===t?this:new Gr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Gr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Hr=new Gr(1,0,0);function Yr(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Hr;return t.__zoom}function Jr(t){t.stopImmediatePropagation()}function Xr(t){t.preventDefault(),t.stopImmediatePropagation()}function Qr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Zr(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function ti(){return this.__zoom||Hr}function ei(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function ni(){return navigator.maxTouchPoints||"ontouchstart"in this}function ri(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}Yr.prototype=Gr.prototype;var ii=r(985),oi=r.n(ii);const si='';function ai(t){return ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ai(t)}function ci(t){return function(t){if(Array.isArray(t))return di(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||pi(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function li(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ui(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"root",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pluginData=e,this.rootId=r||"root",this.resources=n,this.minWidth=void 0!==i.minWidth?i.minWidth:230,this.minHeight=void 0!==i.minHeight?i.minHeight:50,this.padding=void 0!==i.padding?i.padding:30,this.margin=void 0!==i.margin?i.margin:6,this.lineLengthPerDepth=void 0!==i.lineLengthPerDepth?i.lineLengthPerDepth:[5,1],this.actionMenuButtonSize=i.actionMenuButtonSize||24,this.actions={selection:{current:null,style:"2px solid hsl(205, 100%, 50%)",offset:"3px"},linkCreation:{source:null,target:null,creating:!1},drag:{offsetX:0,offsetY:0,state:!1,target:null},zoom:{scale:1,translate:{x:0,y:0}}}}var e,n;return e=t,n=[{key:"screenToSVG",value:function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||this.svg.node();return new DOMPoint(t,e).matrixTransform(n.getScreenCTM().inverse())}},{key:"SVGToScreen",value:function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||this.svg.node();return new DOMPoint(t,e).matrixTransform(n.getScreenCTM())}},{key:"__getVerticalCoefficient",value:function(t){var e,n,r,i,o,s,a=this,c=this.getLineLengthForDepth(t.depth,null===(e=t.parent)||void 0===e||null===(n=e.data)||void 0===n||null===(r=n.definition)||void 0===r?void 0:r.childrenPerLine);if((null===(i=t.children)||void 0===i?void 0:i.length)>0){var l,u,f=Math.ceil(t.children.filter((function(t){var e,n;return null==t||null===(e=t.data)||void 0===e||null===(n=e.definition)||void 0===n?void 0:n.isContainer})).reduce((function(t,e){return t+a.__getVerticalCoefficient(e)}),0));return t.children.filter((function(t){var e,n;return!(null!==(e=t.data)&&void 0!==e&&null!==(n=e.definition)&&void 0!==n&&n.isContainer)})).reduce((function(t,e){return t+e.value}),0)/c+f+(null!==(l=t.data)&&void 0!==l&&null!==(u=l.definition)&&void 0!==u&&u.isContainer?1:0)}return(c===1/0?1:t.value/c)+(null!==(o=t.data)&&void 0!==o&&null!==(s=o.definition)&&void 0!==s&&s.isContainer?1:0)}},{key:"getLineLengthForDepth",value:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||this.lineLengthPerDepth[Math.min(t,this.lineLengthPerDepth.length-1)]}},{key:"setDisabledStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".component";Tr("#".concat(this.rootId," ").concat(t||".component")).classed("disabled",!0)}},{key:"unsetAllDisabledStyles",value:function(){Tr("#".concat(this.rootId," .disabled")).classed("disabled",!1)}},{key:"dragHandler",value:function(t,e){this.hideActionMenu();var n=document.elementsFromPoint(e.sourceEvent.x,e.sourceEvent.y).find((function(t){return e.subject.data.id!==t.dataset.parentId&&(t.classList.contains("container-background")||t.classList.contains("container"))})),r=Zn("#".concat(e.subject.data.id)).attr("cursor","grabbing");Zn("#root-components").append((function(){return r.node()}));var i=this.screenToSVG(e.sourceEvent.clientX,e.sourceEvent.clientY,this.svg.select(".container").node());if(Zn(t).attr("transform",e.subject.transform="translate(".concat(i.x-this.actions.drag.offsetX,",\n ").concat(i.y-this.actions.drag.offsetY,")")),e.subject.x=i.x-this.actions.drag.offsetX,e.subject.y=i.y-this.actions.drag.offsetY,e.subject.data.definition){var o=e.subject.data.definition.parentTypes.map((function(t){return":not(.".concat(t,")")})).join("");this.setDisabledStyle(".component:not(#".concat(e.subject.data.id,")").concat(o))}return this.drawLinks(),n}},{key:"setupDragBehavior",value:function(){var t=this,e=null,n=!1,r=this.dragHandler.bind(this);return pr().subject((function(t){return Zn(document.elementsFromPoint(t.sourceEvent.x,t.sourceEvent.y).find((function(t){return t.classList.contains("component-hitbox")}))).datum()})).on("start",(function(e){t.actions.drag.offsetX=e.x-e.subject.x0,t.actions.drag.offsetY=e.y-e.subject.y0})).on("drag",(function(t){e=r(this,t),n=!0})).on("end",(function(r){n&&t.handleDropEvent(r,e)}))}},{key:"__markAsNeedingResize",value:function(t){null!=t&&t.data.drawOption&&(t.data.drawOption.needsResizing=!0),t.parent&&this.__markAsNeedingResize(t.parent)}},{key:"handleDropEvent",value:function(t,e){var n,r,i=this.pluginData.getComponentById(t.subject.parent.data.id),o=e?Zn(e):null;if(o!==i&&((null==i?void 0:i.id)!==(null==o||null===(n=o.datum().data)||void 0===n?void 0:n.id)||null!=i&&null!==(r=i.definition)&&void 0!==r&&r.preventChildrenMovement))t.subject.parent&&this.__markAsNeedingResize(t.subject.parent),t.subject.data.drawOption=null,o?this.changeParent(o,t):(t.subject.data.removeAllReferenceAttributes(),this.pluginData.emitEvent({type:"Drawer",action:"update",status:"success",components:[t.subject.data.id]}));else{var s=t.x,a=t.y;t.subject.data.drawOption.x=s-this.actions.drag.offsetX,t.subject.data.drawOption.y=a-this.actions.drag.offsetY,this.pluginData.emitEvent({type:"Drawer",action:"move",status:"success",components:[t.subject.data.id]})}this.draw(this.rootId)}},{key:"changeParent",value:function(t,e){var n,r=t.attr("data-parentId"),i=this.pluginData.getComponentById(r),o=Zn("#".concat(r)).datum(),s=i.definition.childrenTypes.includes(e.subject.data.definition.type);if(s&&(e.subject.data.setReferenceAttribute(i),this.__markAsNeedingResize(o),"workflow"===(null==i||null===(n=i.definition)||void 0===n?void 0:n.displayType))){var a,c,l=this.findInsertionPosition(o,e);if(l)this.pluginData.insertComponentAfter(e.subject.data.id,null===(c=l.data)||void 0===c?void 0:c.id);else if((null===(a=o.children)||void 0===a?void 0:a.length)>0){var u;this.pluginData.insertComponentBefore(e.subject.data.id,null===(u=o.children[0].data)||void 0===u?void 0:u.id)}}this.pluginData.emitEvent({type:"Drawer",action:s?"update":"move",status:"success",components:[e.subject.data.id]})}},{key:"findInsertionPosition",value:function(t,e){var n=t.x0-e.subject.parent.x0,r=t.y0-e.subject.parent.y0,i=e.x-n,o=e.y-r;if(!t.children)return null;var s=t.children.filter((function(t){var n,r,i;return(null===(n=t.data)||void 0===n?void 0:n.id)!==(null===(r=e.subject)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.id)})).filter((function(t){return t.y0<=o&&t.y1>=o}));if(s.length>0){var a=s.reduce((function(t,e){var n=i-e.x1;return n>0&&n0&&n<=t.distance&&(t={distance:n,component:e}),t}),{distance:1/0,component:null}).component}},{key:"__fillMissingBracket",value:function(t,e,n){var r;if((null===(r=t.children)||void 0===r?void 0:r.length)>1&&!e.componentLeft&&e.componentRight){var i=t.children.findIndex((function(t){var e,r;return(null===(e=t.data)||void 0===e?void 0:e.id)===(null==n||null===(r=n.data)||void 0===r?void 0:r.id)})),o=t.children.findIndex((function(t){var n,r;return(null===(n=t.data)||void 0===n?void 0:n.id)===(null===(r=e.componentRight.data)||void 0===r?void 0:r.id)})),s=i===o-1?o-2:o-1;s>=0&&(e.componentLeft=t.children[s])}}},{key:"__isInverted",value:function(t,e,n){var r=t.children.findIndex((function(t){var n;return t.data.id===(null==e||null===(n=e.data)||void 0===n?void 0:n.id)})),i=t.children.findIndex((function(t){var e;return t.data.id===(null==n||null===(e=n.data)||void 0===e?void 0:e.id)}));return!!(-1===r&&i===t.children.length-1||r>=0&&i>=0&&r>i)}},{key:"createRenderingContext",value:function(){Zn("#".concat(this.rootId,">svg")).empty()?(this.svg=Zn("#".concat(this.rootId)).append("svg").attr("preserveAspectRatio","xMinYMin meet").style("font","10px sans-serif").attr("height","100%").attr("width","100%"),this.svg.append("g").attr("class","container"),this.svg.append("defs"),this.__initializeArrowMarker()):this.svg=Zn("#".concat(this.rootId)).select("svg")}},{key:"draw",value:function(t,e){var n=this,r=this.pluginData.emitEvent({type:"Drawer",action:"write",status:"running",data:{rootId:t}});if(this.rootId=t,this.createRenderingContext(),this.__unselectComponent(),this.drawComponents(e),this.drawLinks(e),this.setViewPortAction(e),Zn("body").on("keyup",(function(t){var e=n.actions.selection.current;"Delete"===t.key&&e&&("Component"===e.__class?n.removeComponentHandler():"Link"===e.__class&&n.removeLinkHandler())})),e){var i=document.querySelector("#".concat(this.rootId," svg")).getBBox(),o=i.width,s=i.height,a=i.x,c=i.y;Zn("#".concat(this.rootId," svg")).attr("viewBox","".concat(a," ").concat(c," ").concat(o," ").concat(s))}this.pluginData.emitEvent({id:r,status:"success"})}},{key:"clickHandler",value:function(t){t.stopPropagation(),this.__selectComponent(Zn(t.currentTarget))}},{key:"drawComponents",value:function(t){var e=this;this.shadowRoot={children:this.pluginData.components,id:"__shadowRoot",name:""};var n=this.buildTree(),r=this.clickHandler.bind(this),i=this.setupDragBehavior(),o=this.svg.select(".container").selectAll("g").data(n,(function(t){return t})).join("g").attr("id",(function(t){return hi(t,1)[0]})).selectAll("g").data((function(t){return hi(t,2)[1]})).join("g").attr("id",(function(t){return t.data.id})).on("click",t?null:r).call(t?function(){}:i).attr("x",(function(t){return t.x0})).attr("y",(function(t){return t.y0})).attr("transform",(function(t){var e=t.x0,n=t.y0;return"translate(".concat(e,",").concat(n,")")}));o.filter((function(t){return"__shadowRoot"!==t.data.id})).attr("class",(function(t){var e=t.data;return"component\n component-".concat(e.definition.model,"\n ").concat(e.definition.type)})).html((function(t){var n=t.data;return oi().renderString(e.resources.models[n.definition.model],ui(ui({},n),{},{hasError:n.hasError(),getAttribute:function(t){return n.attributes.find((function(e){return e.name===t}))}}))})).select("svg").attr("id",(function(t){var e=t.data;return"svg-".concat(e.id)})).attr("height",(function(t){var n=t.data.drawOption,r=n.manuallyResized,i=n.height;return r?i:e.getComponentHeight(t)})).attr("width",(function(t){var n=t.data.drawOption,r=n.manuallyResized,i=n.width;return r?i:e.getComponentWidth(t)})),o.select(".component-icon").html((function(t){var n=t.data;return e.resources.icons[n.definition.icon]})),o.select("rect").filter((function(t){var e,n;return null===(e=t.data)||void 0===e||null===(n=e.definition)||void 0===n?void 0:n.isContainer})).attr("height",(function(t){var n=t.data.drawOption,r=n.manuallyResized,i=n.height;return r?i:e.getComponentHeight(t)})).attr("width",(function(t){var n=t.data.drawOption,r=n.manuallyResized,i=n.width;return r?i:e.getComponentWidth(t)})),o.select(".component-container").attr("height",(function(t){var n=t.data.drawOption,r=n.manuallyResized,i=n.height;return(r?i:e.getComponentHeight(t))-e.minHeight-e.margin})).attr("width",(function(t){var n=t.data.drawOption,r=n.manuallyResized,i=n.width;return(r?i:e.getComponentWidth(t))-2*e.margin})).attr("x",(function(){return e.margin})).filter((function(t){return t.children})).append((function(t){var e=t.data;return Zn("#group-".concat(e.id)).node()})),o.select(".component-container>rect").attr("data-parentId",(function(t){return t.data.id}))}},{key:"initializeComponentDrawOptions",value:function(t){var e,n,r,i,o=Math.min(t.value,this.getLineLengthForDepth(t.depth,null===(e=t.data.definition)||void 0===e?void 0:e.childrenPerLine)),s=Math.ceil(this.__getVerticalCoefficient(t)),a=o*(this.minWidth+2*this.margin)+2*t.height*this.padding+(o-1)*(this.padding+2*this.margin),c=s*this.minHeight+t.height*this.padding+(s-1)*(this.padding+this.margin);!t.data.drawOption||null!==(n=t.parent)&&void 0!==n&&null!==(r=n.data)&&void 0!==r&&null!==(i=r.definition)&&void 0!==i&&i.preventChildrenMovement?t.data.drawOption=new w({needsPositioning:!0,width:a,height:c}):t.data.drawOption.manuallyResized||(t.data.drawOption.width=a,t.data.drawOption.height=c)}},{key:"buildTree",value:function(){var t=this,e=function(){var t=xr,e=!1,n=1,r=1,i=[0],o=Or,s=Or,a=Or,c=Or,l=Or;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(_r),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,h=e.y1-n;f=r.length)return n(i);const s=new C,a=r[o++];let c=-1;for(const t of i){const e=a(t,++c,i),n=s.get(e);n?n.push(t):s.set(e,[t])}for(const[e,n]of s)s.set(e,t(n,o));return e(s)}(t,0)}(t,Array.from,I,e)}(n,(function(t){var e=t.parent;return e&&"__shadowRoot"!==e.data.id?"group-".concat(e.data.id):"root-components"})).filter((function(t){return"root-__shadowRoot"!==hi(t,1)[0]}))}},{key:"getAnchorPoint",value:function(t,e){if(t.empty()||e.empty())return null;var n,r=t.node().getBoundingClientRect(),i=this.getSelectionCenter(t),o=this.getSelectionCenter(e),s=this.getBearing(this.screenToSVG(i.x,i.y,this.svg.select(".container").node()),this.screenToSVG(o.x,o.y,this.svg.select(".container").node())),a={y:r.top,x:r.x+r.width/2},c={y:r.bottom,x:r.x+r.width/2},l={x:r.left,y:r.top+r.height/2},u={x:r.right,y:r.top+r.height/2};n=s<45||s>=315?c:s>=45&&s<135?u:s>=135&&s<225?a:l;var f=this.screenToSVG(n.x,n.y);return[f.x,f.y]}},{key:"__initializeArrowMarker",value:function(){var t=this.pluginData.getUsedLinkDefinitions();this.svg.select("defs").selectAll("arrow").data(t,(function(t){return"".concat(t.attributeRef,"-").concat(t.sourceRef,"-").concat(t.targetRef)})).join("marker").attr("class","arrow").attr("id",(function(t){return"".concat(t.attributeRef,"-").concat(t.sourceRef,"-").concat(t.targetRef,"-arrow")})).attr("refX",(function(t){return t.marker.refX})).attr("refY",(function(t){return t.marker.refY})).attr("markerWidth",(function(t){return t.marker.width})).attr("markerHeight",(function(t){return t.marker.height})).attr("orient",(function(t){return t.marker.orient})).append("path").attr("d",(function(t){return t.marker.path})).attr("fill",(function(t){return t.color}))}},{key:"drawLinks",value:function(t){var e=this,n=this.pluginData.getLinks();if(n){var r=this.svg.selectAll(".link");r.data(n,(function(t){return t})).join("path").filter((function(t){var e=t.source,n=t.target;return!Zn("#".concat(e)).empty()&&!Zn("#".concat(n)).empty()})).classed("link",!0).attr("d",(function(t){return e.getLinkGenerator(t)(t)})).attr("id",(function(t){var e=t.definition,n=t.source,r=t.target;return"link-".concat(e.sourceRef,"-").concat(e.attributeRef,"-").concat(n,"-").concat(r)})).attr("fill","none").attr("stroke",(function(t){return t.definition.color})).attr("stroke-width",(function(t){return t.definition.width*e.actions.zoom.scale})).attr("stroke-dasharray",(function(t){return t.definition.dashStyle?t.definition.dashStyle.map((function(t){return t*e.actions.zoom.scale})):"none"})).attr("marker-start",(function(t){var e=t.definition,n=e.attributeRef,r=e.sourceRef,i=e.targetRef;return"Reverse"===t.definition.type?"url(#".concat(n,"-").concat(r,"-").concat(i,"-arrow)"):"none"})).attr("marker-end",(function(t){var e=t.definition,n=e.attributeRef,r=e.sourceRef,i=e.targetRef;return"Reverse"!==t.definition.type?"url(#".concat(n,"-").concat(r,"-").concat(i,"-arrow)"):"none"})).attr("cursor",t?"default":"pointer").on("click",(function(n){return t?null:e.clickHandler(n)})),r.raise()}}},{key:"getSelectionCenter",value:function(t){var e=t.node().getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height/2}}},{key:"getBearing",value:function(t,e){var n=e.x-t.x,r=e.y-t.y,i=n/Math.sqrt(Math.pow(n,2)+Math.pow(r,2)),o=r/Math.sqrt(Math.pow(n,2)+Math.pow(r,2));return(Math.atan2(i,o)*(180/Math.PI)+360)%360}},{key:"getLinkGenerator",value:function(t){var e=Zn("#".concat(t.source)),n=Zn("#".concat(t.target)),r=this.getAnchorPoint(e,n),i=this.getAnchorPoint(n,e),o=this.getSelectionCenter(e),s=this.getSelectionCenter(n),a=this.getBearing(this.screenToSVG(o.x,o.y,this.svg.select(".container").node()),this.screenToSVG(s.x,s.y,this.svg.select(".container").node()));return function(t){let e=Dr,n=Fr,r=Mr,i=Br,o=null,s=null,a=function(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Rr(e)}(c);function c(){let c;const l=Ar.call(arguments),u=e.apply(this,l),f=n.apply(this,l);if(null==o&&(s=t(c=a())),s.lineStart(),l[0]=u,s.point(+r.apply(this,l),+i.apply(this,l)),l[0]=f,s.point(+r.apply(this,l),+i.apply(this,l)),s.lineEnd(),c)return s=null,c+""||null}return c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(n=t,c):n},c.x=function(t){return arguments.length?(r="function"==typeof t?t:Lr(+t),c):r},c.y=function(t){return arguments.length?(i="function"==typeof t?t:Lr(+t),c):i},c.context=function(e){return arguments.length?(null==e?o=s=null:s=t(o=e),c):o},c}(a<45||a>=315||a>=135&&a<225?Vr:Kr).source((function(){return r})).target((function(){return i}))}},{key:"getComponentHeight",value:function(t){if("__shadowRoot"===t.id)return 0;var e=this.minHeight+this.padding+this.margin,n=t.children?t.children.map((function(t){return t.y1+e})):[0];return t.data.drawOption.height=Math.max.apply(Math,[this.minHeight+t.data.definition.isContainer*e].concat(ci(n))),t.data.drawOption.height}},{key:"getComponentWidth",value:function(t){if("__shadowRoot"===t.id)return 0;var e=t.children?t.children.map((function(t){return t.x1})):[0];return t.data.drawOption.width=Math.max.apply(Math,[this.minWidth].concat(ci(e)))+!!t.children*(this.padding+this.margin),t.data.drawOption.width}},{key:"setupTiles",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={x1:0,y1:0};t.forEach((function(t){t.items=t.items.map((function(t){return t.data.drawOption||(t.data.drawOption=new w({needsPositioning:!0,needsResizing:!0})),t})).map((function(t){return t.data.drawOption.needsResizing&&(e.initializeComponentDrawOptions(t),t.data.drawOption.needsResizing=!1),t})).sort((function(t,e){return t.data.drawOption.needsPositioning&&!e.data.drawOption.needsPositioning?1:t.data.drawOption.needsPositioning||e.data.drawOption.needsPositioning?0:t.data.drawOption.x-e.data.drawOption.x}))}));var i=Math.max.apply(Math,ci(t.map((function(t){return t.items.reduce((function(t,e){return t+e.data.drawOption.width}),0)+(t.items.length+1)*e.padding}))));t.forEach((function(t,o){var s={x1:0,x0:i,y0:t.band+e.padding};if(t.items.forEach((function(t){t.data.drawOption.needsPositioning&&(t.data.drawOption.x=n&&o%2?s.x0-t.data.drawOption.width-e.padding:s.x1+e.padding,t.data.drawOption.y=r.y1+e.padding,t.data.drawOption.needsPositioning=!1),t.x0=t.data.drawOption.x,t.y0=t.data.drawOption.y,s=t,t.x1=t.x0+t.data.drawOption.width,t.y1=t.y0+t.data.drawOption.height})),t.items.length>0){var a=Math.max.apply(Math,ci(t.items.map((function(t){return t.value}))));r=t.items.find((function(t){return t.value===a}))}}))}},{key:"__buildLines",value:function(t,e){var n=this,r=[],i=0,o=r[i];return t.forEach((function(t){if(r=r.sort((function(t,e){return t.band-e.band})),t.data.drawOption&&!t.data.drawOption.needsPositioning)-1===(i=r.findIndex((function(e){return e.band===100*Math.floor(t.data.drawOption.y/100)})))&&(r.push({total:0,band:100*Math.floor(t.data.drawOption.y/100),items:[]}),i=r.length-1);else{for(i=0;i=n.getLineLengthForDepth(e,null===(s=t.parent)||void 0===s||null===(a=s.data)||void 0===a||null===(c=a.definition)||void 0===c?void 0:c.childrenPerLine);){var s,a,c;i+=1}i===r.length&&r.push({total:0,band:i>0?r[i-1].band+100:0,items:[]})}(o=r[i]).total+=t.value,o.items.push(t)})),r.sort((function(t,e){return t.band-e.band}))}},{key:"setViewPortAction",value:function(t){var e=this;if(this.svg.on("click",(function(){e.__unselectComponent(),e.cancelLinkCreationInteraction()})),!t){var n=this.drawLinks.bind(this);this.svg.call(function(){var t,e,n,r=Qr,i=Zr,o=ri,s=ei,a=ni,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,f=qr,h=Zt("start","zoom","end"),p=500,d=150,m=0,y=10;function v(t){t.property("__zoom",ti).on("wheel.zoom",x,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",S).filter(a).on("touchstart.zoom",T).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,e){return(e=Math.max(c[0],Math.min(c[1],e)))===t.k?t:new Gr(e,t.x,t.y)}function b(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new Gr(t.k,r,i)}function w(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function _(t,e,n,r){t.on("start.zoom",(function(){k(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){k(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,s=k(t,o).event(r),a=i.apply(t,o),c=null==n?w(a):"function"==typeof n?n.apply(t,o):n,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=t.__zoom,h="function"==typeof e?e.apply(t,o):e,p=f(u.invert(c).concat(l/u.k),h.invert(c).concat(l/h.k));return function(t){if(1===t)t=h;else{var e=p(t),n=l/e[2];t=new Gr(n,c[0]-e[0]*n,c[1]-e[1]*n)}s.zoom(null,t)}}))}function k(t,e,n){return!n&&t.__zooming||new E(t,e)}function E(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function x(t,...e){if(r.apply(this,arguments)){var n=k(this,e).event(t),i=this.__zoom,a=Math.max(c[0],Math.min(c[1],i.k*Math.pow(2,s.apply(this,arguments)))),u=tr(t);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=i.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(i.k===a)return;n.mouse=[u,i.invert(u)],Te(this),n.start()}Xr(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),d),n.zoom("mouse",o(b(g(i,a),n.mouse[0],n.mouse[1]),n.extent,l))}}function O(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,s=k(this,e,!0).event(t),a=Zn(t.view).on("mousemove.zoom",(function(t){if(Xr(t),!s.moved){var e=t.clientX-u,n=t.clientY-f;s.moved=e*e+n*n>m}s.event(t).zoom("mouse",o(b(s.that.__zoom,s.mouse[0]=tr(t,i),s.mouse[1]),s.extent,l))}),!0).on("mouseup.zoom",(function(t){a.on("mousemove.zoom mouseup.zoom",null),sr(t.view,s.moved),Xr(t),s.event(t).end()}),!0),c=tr(t,i),u=t.clientX,f=t.clientY;or(t.view),Jr(t),s.mouse=[c,this.__zoom.invert(c)],Te(this),s.start()}}function S(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,s=tr(t.changedTouches?t.changedTouches[0]:t,this),a=n.invert(s),c=n.k*(t.shiftKey?.5:2),f=o(b(g(n,c),s,a),i.apply(this,e),l);Xr(t),u>0?Zn(this).transition().duration(u).call(_,f,s,t):Zn(this).call(v.transform,f,s,t)}}function T(n,...i){if(r.apply(this,arguments)){var o,s,a,c,l=n.touches,u=l.length,f=k(this,i,n.changedTouches.length===u).event(n);for(Jr(n),s=0;sr&&(r=t)})),o.attr("width",r+20+15).attr("height",30*t.length).attr("x",(function(){return parseInt(i.getAttribute("x"),10)+i.getBBox().width/2-parseInt(this.getAttribute("width"),10)/2})).attr("y",parseInt(i.getAttribute("y"),10)+i.getBBox().height+10),s.on("mouseenter",(function(){Zn(this).select("rect").attr("fill","grey").attr("cursor","pointer")})).on("mouseleave",(function(){Zn(this).select("rect").attr("fill","lightgrey").attr("cursor","default")})).on("click",(function(t,e){n.actions.linkCreation.source=n.actions.selection.current;var r=n.pluginData.addComponent(e);n.pluginData.getComponentById(r).path=n.actions.linkCreation.source.path,n.draw(n.rootId),n.actions.linkCreation.target=Zn("#".concat(r)).datum().data,n.createLink(r)}))}},{key:"startLinkCreationInteraction",value:function(){if(this.actions.selection.current){var t=this.pluginData.getComponentById(this.actions.selection.current.id),e=t.definition.definedAttributes.filter((function(t){return"Link"===t.type})).map((function(t){return":not(.".concat(t.linkRef,")")})).join("");this.actions.linkCreation.creating=!0,this.actions.linkCreation.source=t,this.setDisabledStyle(".component:not(#".concat(t.id,")").concat(e))}}},{key:"removeComponentHandler",value:function(){this.pluginData.removeComponentById(this.actions.selection.current.id),this.pluginData.emitEvent({type:"Drawer",action:"delete",status:"success",components:[this.actions.selection.current.id]}),this.draw(this.rootId)}},{key:"removeLinkHandler",value:function(){this.pluginData.removeLink(this.actions.selection.current),this.pluginData.emitEvent({type:"Drawer",action:"delete",status:"success",components:[]}),this.draw(this.rootId)}},{key:"getMenuActions",value:function(t){return t.classed("component")?[{id:"create-linkable-component",icon:'',handler:function(){var e,n=null===(e=t.datum().data)||void 0===e?void 0:e.getDefinedAttributesByType("Link").map((function(t){return t.linkRef})),r=this.pluginData.definitions.components.filter((function(t){return n.includes(t.type)}));r.length>0&&this.initializeCreateLinkableComponentMenu(r)}},{id:"create-link",icon:'',handler:function(){this.startLinkCreationInteraction()}},{id:"remove-component",icon:si,handler:this.removeComponentHandler.bind(this)}]:[{id:"remove-link",icon:si,handler:this.removeLinkHandler.bind(this)}]}},{key:"cancelLinkCreationInteraction",value:function(){this.actions.linkCreation.creating=!1,this.actions.linkCreation.source=null,this.actions.linkCreation.target=null,this.unsetAllDisabledStyles()}},{key:"hideActionMenu",value:function(){Zn("#action-menu").remove(),Zn("#linkable-menu").remove()}},{key:"hideResizer",value:function(){Zn("#resizer").remove()}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return t.path}))}},{key:"parseConfiguration",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[e.path],data:{global:!1}});if(null!=e.content){var o=JSON.parse(e.content);o[t.path]?o[t.path][this.pluginData.name]?(Object.keys(o[t.path][this.pluginData.name]).forEach((function(e){var r=n.pluginData.getComponentById(e);r&&o[t.path][n.pluginData.name][e]&&(r.drawOption=new w(o[t.path][n.pluginData.name][e]))})),this.pluginData.emitEvent({id:i,status:"success"})):this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_plugin_content",global:!1}}):this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_diagram_content",global:!1}})}else this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_content",global:!1}})}},{key:"isParsable",value:function(t){return null!=t}}],n&&function(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(t,e){return t[e.path]="",t}),{});return this.renderFiles(t).forEach((function(t){e[t.path]=t.content})),Object.keys(e).map((function(t){return new N({path:t,content:e[t]})}))}},{key:"renderFiles",value:function(){return[]}},{key:"renderConfiguration",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.pluginData.emitEvent({parent:r,type:"Render",action:"write",status:"running",files:[e.path],data:{global:!1}}),o=JSON.parse(e.content)||{};o[t.path]||(o[t.path]={}),o[t.path][this.pluginData.name]={},this.pluginData.components.filter((function(t){return t.drawOption})).forEach((function(e){o[t.path][n.pluginData.name][e.id]=e.drawOption})),e.content=JSON.stringify(o,(function(t,e){return null===e?void 0:e}),2),this.pluginData.emitEvent({id:i,status:"success"})}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"Error happened when trying to parse.",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"Error";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e||"Error happened when trying to parse.")).name="ParseError",t.startLine=n||0,t.startColumn=r||0,t.endLine=s||0,t.endColumn=a||0,t.severity=c||"Error",t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(Ti(Error));var Pi=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:null,parentId:null,files:null,components:null,links:null,type:null,action:null,status:null,data:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.id,r=e.parentId,i=e.files,o=e.components,s=e.links,a=e.type,c=e.action,l=e.status,u=e.data;this.id=n||null,this.parentId=r||null,this.startDate=null,this.endDate=null,this.files=i||null,this.components=o||null,this.links=s||null,this.type=a||null,this.action=c||null,this.status=l||null,this.data=u||null}));const Ii=Pi;function Ri(t){return Ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ri(t)}function Mi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Bi(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{name:null,version:null,components:[],definitions:{components:[],links:[]},parseErrors:[]},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=n.name||null,this.version=n.version||null,this.components=n.components||[],this.definitions={components:[],links:[]},n.definitions&&(this.definitions.components=n.definitions.components||[],this.definitions.links=n.definitions.links||[]),this.parseErrors=n.parseErrors||[],this.__eventIndex=0,this.eventManager=r,this.eventLogs=[],this.configuration=e}var e,n;return e=t,n=[{key:"coreVersion",get:function(){return"0.17.0"}},{key:"getComponentById",value:function(t){return this.components.find((function(e){return e.id===t}))||null}},{key:"getComponentsByType",value:function(t){return this.components.filter((function(e){var n=e.definition;return n&&n.type===t}))}},{key:"addComponent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.configuration.defaultFileName||"",r=this.generateComponentId(t);return this.components.push(new f({id:r,name:r,definition:t,path:"".concat(e).concat(n)})),r}},{key:"generateComponentId",value:function(t){for(var e="".concat(t.type,"_"),n=this.components.map((function(t){return t.id})).filter((function(t){return new RegExp("".concat(e,"\\d+")).test(t)})).map((function(t){return parseInt(t.substring(e.length),10)})),r=1;n.includes(r);)r+=1;return"".concat(e).concat(r)}},{key:"removeComponentById",value:function(t){var e=this;this.getChildren(t).forEach((function(t){return e.removeComponentById(t.id)})),this.components=this.components.filter((function(e){return e.id!==t})),this.components.forEach((function(e){e.removeLinkAttribute(t)}))}},{key:"removeLink",value:function(t){var e=t.source,n=t.target,r=t.definition.attributeRef;this.getComponentById(e).removeLinkAttribute(n,r)}},{key:"getLinks",value:function(){var t=this,e=[];return this.definitions.links.forEach((function(n){t.getComponentsByType(n.sourceRef).forEach((function(t){var r=t.getAttributeByName(n.attributeRef);r&&r.value.forEach((function(r){return e.push(new x({definition:n,source:t.id,target:r}))}))}))})),e.concat(this.getWorkflowLinks())}},{key:"getWorkflowLinks",value:function(){var t=this;return this.components.filter((function(t){var e;return null===(e=t.definition.displayType)||void 0===e?void 0:e.match("workflow")})).reduce((function(e,n){var r=t.getChildren(n.id);if(r.length>1)for(var i=0;in,this.components.splice(i,0,r),this.components.splice(n+(it}))}},{key:"emitEvent",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.id;return r?(e=this.getEventLogById(r),Object.keys(n).forEach((function(t){e[t]=n[t]}))):(this.__eventIndex+=1,r=this.__eventIndex,(e=new Ii(Bi(Bi({},n),{},{id:r}))).startDate=Date.now(),this.eventLogs.push(e)),["success","warning","error"].includes(e.status)&&(e.endDate=Date.now()),null!==(t=this.eventManager)&&void 0!==t&&t.next&&this.eventManager.next({plugin:this.name,event:Bi({},e)}),r}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{editor:{syntax:null},restrictiveFolder:null,defaultFileName:null,defaultFileExtension:null,tags:[]};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.editor=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{event:null,configuration:null,pluginData:null,pluginDrawer:null,pluginMetadata:null,pluginParser:null,pluginRenderer:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.configuration=e.configuration||new Gi,this.data=e.pluginData||new Ki(this.configuration,{},e.event),this.__drawer=e.pluginDrawer||new vi(this.data),this.__metadata=e.pluginMetadata||new bi(this.data),this.__parser=e.pluginParser||new ki(this.data),this.__renderer=e.pluginRenderer||new Oi(this.data)}var e,n;return e=t,n=[{key:"init",value:function(){var t=this.data.emitEvent({type:"Plugin",action:"init",status:"running"});this.__metadata.parse(t),this.data.initLinkDefinitions(t),this.data.emitEvent({id:t,status:"success"})}},{key:"initResources",value:function(t){this.__drawer.resources=t}},{key:"draw",value:function(t,e){this.__drawer.draw(t,e)}},{key:"parse",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.data.emitEvent({type:"Parser",action:"read",status:"running",files:n.map((function(t){return t.path})).concat(null==e?void 0:e.path),data:{global:!0}});this.__parser.parse(t,n,r),this.__parser.parseConfiguration(t,e,r),this.data.emitEvent({id:r,status:"success"})}},{key:"isParsable",value:function(t){return this.__parser.isParsable(t)}},{key:"getModels",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.__parser.getModels(e.filter((function(e){return t.isParsable(e)})))}},{key:"render",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.data.emitEvent({type:"Render",action:"write",status:"running",files:n.map((function(t){return t.path})).concat(e.path),data:{global:!0}});this.__renderer.renderConfiguration(t,e,r);var i=this.__renderer.render(n,r).concat(e);return this.data.emitEvent({id:r,status:"success"}),i}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,value:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.type,r=e.value;this.type=n||null,this.value=r||null}));const Qi=Xi})();var o=e;for(var s in i)o[s]=i[s];i.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})()},985:function(t){var e;"undefined"!=typeof self&&self,e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){"use strict";var r=Array.prototype,i=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},s=/[&"'<>\\]/g;function a(t,e){return i.hasOwnProperty.call(t,e)}function c(t){return o[t]}function l(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,l.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var s=Object.getOwnPropertyDescriptor(i,"stack");(o=s&&(s.get||function(){return s.value}))||(o=function(){return i.stack})}else{var a=new Error(t).stack;o=function(){return a}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function u(t){return"[object Function]"===i.toString.call(t)}function f(t){return"[object Array]"===i.toString.call(t)}function h(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)s=i.slice(0,t.length),i.slice(s.length,l).forEach((function(t,n){n2?i-2:0),s=2;s0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:l,Root:h,NodeList:f,Value:u,Literal:p,Symbol:d,Group:m,Array:y,Pair:v,Dict:g,Output:K,Capture:V,TemplateData:U,If:w,IfAsync:_,InlineIf:k,For:E,AsyncEach:x,AsyncAll:O,Macro:S,Caller:T,Import:A,FromImport:L,FunCall:N,Filter:C,FilterAsync:j,KeywordArgs:P,Block:I,Super:R,Extends:M,Include:B,Set:D,Switch:F,Case:$,LookupVal:b,BinOp:z,In:W,Is:G,Or:H,And:Y,Not:J,Add:X,Concat:Q,Sub:Z,Mul:tt,Div:et,FloorDiv:nt,Mod:rt,Pow:it,Neg:ot,Pos:st,Compare:at,CompareOperand:ct,CallExtension:lt,CallExtensionAsync:ut,printNodes:function t(e,n){if(n=n||0,ft(e.typename+": ",n),e instanceof f)ft("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof lt)ft(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof l?r.push([e,t]):(i=i||{})[e]=t})),i?ft(JSON.stringify(i,null,2)+"\n",null,!0):ft("\n"),r.forEach((function(e){var r=e[0],i=e[1];ft("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),s=n(3),a=n(0).TemplateError,c=n(2).Frame,l=n(1).Obj,u={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},f=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new a(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var c=this._tmpid();this._emitLine(", "+this._makeCallback(c)),this._emitLine(this.buffer+" += runtime.suppressValue("+c+", "+a+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+a+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof s.Symbol?n=new s.Literal(n.lineno,n.colno,n.value):n instanceof s.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+u[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,s.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,s.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof s.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,s){var a=n._tmpid();n._emitLine("var "+a+" = "+o+"["+r+"]["+s+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+s+"]);"),e.set(t.name.children[s].value,a)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var a=t.name.children,c=a[0],l=a[1],u=this._tmpid(),f=this._tmpid();e.set(c.value,u),e.set(l.value,f),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+u+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+f+" = "+o+"["+u+"];"),this._emitLine('frame.set("'+c.value+'", '+u+");"),this._emitLine('frame.set("'+l.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var h=this._tmpid();e.set(t.name.value,h),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+h+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),a=this._tmpid(),c=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+a+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof s.Array){var l=t.name.children.length;this._emit("runtime."+c+"("+a+", "+l+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var u=t.name.value;this._emitLine("runtime."+c+"("+a+", 1, function("+u+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+u+'", '+u+");"),e.set(u,u)}this._emitLoopBindings(t,a,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var f=this._tmpid();this._emitLine("}, "+this._makeCallback(f)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+f+";"),t.else_&&(this._emitLine("if (!"+a+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),a=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof s.Dict?i=e:(n.assertType(e,s.Symbol),r.push(e))}));var l,u=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),f=r.map((function(t){return'"'+t.value+'"'})),h=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));l=a?e.push(!0):new c,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+u.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),l.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,l),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,l)})),this._emitLine("frame = "+(a?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),s=this._makeCallback(i),a=n?"true":"false",c=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+a+", "+o+", "+c+", "+s),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,a=n._tmpid();t instanceof s.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+a+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,a),e.parent?n._emitLine('frame.set("'+o+'", '+a+");"):n._emitLine('context.setVariable("'+o+'", '+a+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof s.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new c,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(s.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new c;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(l);t.exports={compile:function(t,e,n,r,s){void 0===s&&(s={});var a=new f(r,s.throwOnUndefined),c=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return a.compile(o.transform(i.parse(c,n,s),e,r)),a.getCode()},Compiler:f}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var s=o.prototype;return s.resolve=function(t,e){return i.resolve(i.dirname(t),e)},s.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),s=n(15),a=n(0),c=n(5),l=n(18),u=n(10),f=u.FileSystemLoader,h=u.WebLoader,p=u.PrecompiledLoader,d=n(20),m=n(21),y=n(1),v=y.Obj,g=y.EmitterObj,b=n(2),w=b.handleError,_=b.Frame,k=n(22);function E(t,e,n){o((function(){t(e,n)}))}var x={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(w(t,null,null))}}}},O=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=a.isArray(t)?t:[t]:f?this.loaders=[new f("views")]:h&&(this.loaders=[new h("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],a._entries(l).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),a._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=a.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,s=this,c=this,l=null;if(t&&t.raw&&(t=t.raw),a.isFunction(n)&&(i=n,n=null,e=e||!1),a.isFunction(e)&&(i=e,e=!1),t instanceof T)l=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var u=0;u0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var a=this.parsePrimary();if("_"===a.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",a.lineno,a.colno),this.skipSymbol("as")){var c=this.parsePrimary();r.addChild(new o.Pair(a.lineno,a.colno,a,c))}else r.addChild(a);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},c.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},c.parseExtends=function(){var t="extends",e=this.peekToken();this.skipSymbol(t)||this.fail("parseTemplateRef: expected "+t);var n=new o.Extends(e.lineno,e.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(e.value),n},c.parseInclude=function(){var t="include",e=this.peekToken();this.skipSymbol(t)||this.fail("parseInclude: expected "+t);var n=new o.Include(e.lineno,e.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(e.value),n},c.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},c.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},c.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var s=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var a,c=this.peekToken(),l=[];do{this.skipSymbol(n);var u=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);l.push(new o.Case(c.line,c.col,u,f)),c=this.peekToken()}while(c&&c.value===n);switch(c.value){case r:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,s,l,a)},c.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==a.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var c=s[0],l=s[1],u=s[2];u===t?r+=1:u===e&&(r-=1),0===r?(i+=l,this.tokens.backN(c.length-l.length)):i+=c}return new o.Output(a.lineno,a.colno,[new o.TemplateData(a.lineno,a.colno,i)])},c.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},c.parseExpression=function(){return this.parseInlineIf()},c.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},c.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},c.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},c.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},c.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},c.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},c.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},c.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},c.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},c.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},c.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},c.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},c.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},c.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},c.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},c.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},c.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},c.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},c.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},c.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},c.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var s=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,s))}else{var a=this.parseExpression();t.addChild(a)}}return t},c.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),s=new o.KeywordArgs(n.lineno,n.colno),a=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(a&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var c=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?s.addChild(new o.Pair(c.lineno,c.colno,c,this.parseExpression())):r.addChild(c)}a=!0}return s.children.length&&r.addChild(s),r},c.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],B=C+this.current();switch(-1!==r.indexOf(M,B)&&(this.forward(),C=B,-1!==r.indexOf(M,B+this.current())&&(C=B+this.current(),this.forward())),C){case"(":R=d;break;case")":R=m;break;case"[":R=y;break;case"]":R=v;break;case"{":R=g;break;case"}":R=b;break;case",":R=_;break;case":":R=k;break;case"~":R=E;break;case"|":R=x;break;default:R=w}return N(R,C,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var D=this._extract("0123456789");return N(O,t+"."+D,e,n)}return N("int",t,e,n)}if(t.match(/^(true|false)$/))return N(S,t,e,n);if("none"===t)return N(T,t,e,n);if("null"===t)return N(T,t,e,n);if(t)return N(A,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,$=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,N(l,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,N(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil($));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!K){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var V=t.slice(-this.colno);if(/^\s+$/.test(V)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return N(K?p:c,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[t];if(void 0===c)return!1;if("function"==typeof c)o(c,this,e);else{var l=c.length,u=y(c,l);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function s(){return"hole_"+o++}function a(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,s=r.repeat(" ",n/2-n%2),a=r.repeat(" ",n/2);return i.copySafeness(t,s+t+a)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var s in t)o.push([s,t[s]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],s=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(s)&&(s=s.toUpperCase())),o>s?1:o===s?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var s=t.split("\n"),a=r.repeat(" ",e),c=s.map((function(t,e){return 0!==e||n?""+a+t:t})).join("\n");return i.copySafeness(t,c)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=c,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=l(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=l(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var s="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return s=n+t.split("").join(n)+n,i.copySafeness(t,s);var a=t.indexOf(e);if(0===r||-1===a)return t;for(var c=0,l=0;a>-1&&(-1===r||l=i&&u.push(n),o.push(u)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,s=r.map(t,(function(t){return t})),a=r.getAttrGetter(i);return s.sort((function(t,s){var c=i?a(t):t,l=i?a(s):s;if(o.env.opts.throwOnUndefined&&i&&(void 0===c||void 0===l))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(c)&&r.isString(l)&&(c=c.toLowerCase(),l=l.toLowerCase()),cl?e?-1:1:0})),s})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=u((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return a(t)}));return i.copySafeness(t,e.join(" "))},e.trim=u,e.truncate=function(t,e,n,r){var s=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var a=t.lastIndexOf(" ",e);-1===a&&(a=e),t=t.substring(0,a)}return t+=null!=r?r:"...",i.copySafeness(s,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var f=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,h=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){s(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(f),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":h.test(i)?''+i+"":m.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return s(n)?e:n};var y=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return s(r)?e:r}));e.int=y,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return t=Array.prototype.slice.call(arguments),e=-1,{current:null,reset:function(){e=-1,this.current=null},next:function(){return++e>=t.length&&(e=0),this.current=t[e],this.current}};var t,e},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,s=n(5),a=n(7).Environment,c=n(24);function l(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function u(t,e){(e=e||{}).isString=!0;var n=e.env||new a([]),r=e.wrapper||c;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([f(t,e.name,n)],e)}function f(t,e,n){var r,i=(n=n||new a([])).asyncFilters,c=n.extensionsList;e=e.replace(/\\/g,"/");try{r=s.compile(t,i,c,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new a([]),o=e.wrapper||c;if(e.isString)return u(t,e);var s=r.existsSync(t)&&r.statSync(t),h=[],p=[];if(s.isFile())h.push(f(r.readFileSync(t,"utf-8"),e.name||t,n));else if(s.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(s){var a=i.join(o,s),c=a.substr(i.join(t,"/").length),u=r.statSync(a);u&&u.isDirectory()?l(c+="/",e.exclude)||n(a):l(c,e.include)&&p.push(a)}))}(t);for(var d=0;dt.length||i>0&&s>=r||i<0&&s<=r);s+=i)o.push(n.memberLookup(t,s));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{default:()=>Zr});var t=n(181);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e
Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows","childrenTypes":["trigger","job"],"isContainer":true,"available":true,"attributes":[{"name":"name","type":"String","required":true,"description":"The name of the workflow as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows#understanding-the-workflow-file"}]},"trigger":{"type":"trigger","model":"trigger","icon":"DefaultTrigger","available":false,"parentTypes":["workflow"],"attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true}]},"job":{"type":"job","model":"job","displayName":"Job","description":"A workflow run is made up of one or more jobs, which run in parallel by default.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow","icon":"DefaultJob","available":true,"parentTypes":["workflow"],"childrenTypes":["step"],"isContainer":true,"displayType":"workflow","preventChildrenMovement":true,"childrenPerLine":10,"attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true},{"name":"name","type":"String","description":"The name of the job as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"runs-on","type":"String","displayName":"Type of runner","description":"The type of machine to run the job on.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on"},{"name":"needs","displayName":"Previous job(s)","description":"Identify any jobs that must complete successfully before this job will run","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#defining-prerequisite-jobs","type":"Link","linkType":"Reverse","linkRef":"job"}]},"step":{"type":"step","model":"step","icon":"DefaultStep","available":false,"parentTypes":["job"],"description":"Task of the job. Step can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsteps","attributes":[{"name":"job_id","displayName":"Id of job","type":"Reference","containerRef":"job","required":true},{"name":"name","type":"String","description":"The name of the step as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"env","type":"Object","displayName":"Environment variables","description":"Variables for steps to use in the runner environment.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv"}]}}'),trigger:JSON.parse('[{"type":"trigger","icon":"PushTrigger","displayName":"Trigger - push","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push","action":"push","attributes":[{"name":"branches","type":"Array","description":"Select branch name on push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-only-when-a-push-to-specific-branches-occurs"}]},{"type":"trigger","icon":"PullRequestTrigger","displayName":"Trigger - pull request","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a pull request event.","action":"pull_request","attributes":[{"name":"types","type":"Array","displayName":"Activity types","description":"Run your workflow when an activity on a pull request occurs in the workflow\'s repository.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request"}]}]'),step:JSON.parse('[{"type":"step","displayName":"Command step","icon":"CommandStep","name":"command-step","attributes":[{"name":"run","type":"String","required":true}]},{"type":"step","displayName":"Reusable step","icon":"ReusableStep","name":"reusable-step","attributes":[{"name":"uses","type":"String","required":true,"displayName":"External action","description":"Select an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses"},{"name":"with","type":"Object","displayName":"Input parameters","description":"Input parameters of the action defined by \\"uses\\" keyword.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith"}]}]')};function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}const m=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(n);if(r){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===h(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{available:!1};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).available=!!e.available,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(t.ComponentDefinition);function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},g(t)}const b=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=g(n);if(r){var i=g(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{action:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).action=e.action||null,t}return e=o,Object.defineProperty(e,"prototype",{writable:!1}),e}(t.ComponentDefinition);function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n!!t&&"object"==typeof t&&t[K]===R,U=t=>!!t&&"object"==typeof t&&t[K]===M,q=t=>!!t&&"object"==typeof t&&t[K]===B,z=t=>!!t&&"object"==typeof t&&t[K]===D,W=t=>!!t&&"object"==typeof t&&t[K]===F,G=t=>!!t&&"object"==typeof t&&t[K]===$;function H(t){if(t&&"object"==typeof t)switch(t[K]){case B:case $:return!0}return!1}function Y(t){if(t&&"object"==typeof t)switch(t[K]){case R:case B:case F:case $:return!0}return!1}const J=t=>(W(t)||H(t))&&!!t.anchor,X=Symbol("break visit"),Q=Symbol("skip children"),Z=Symbol("remove node");function tt(t,e){const n=it(e);U(t)?et(null,t.contents,n,Object.freeze([t]))===Z&&(t.contents=null):et(null,t,n,Object.freeze([]))}function et(t,e,n,r){const i=ot(t,e,n,r);if(Y(i)||z(i))return st(t,r,i),et(t,i,n,r);if("symbol"!=typeof i)if(H(e)){r=Object.freeze(r.concat(e));for(let t=0;t"!==t[t.length-1]&&e("Verbatim tags must end with a >"),n)}const[,n,r]=t.match(/^(.*!)([^!]*)$/);r||e(`The ${t} tag has no suffix`);const i=this.tags[n];return i?i+decodeURIComponent(r):"!"===n?t:(e(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[e,n]of Object.entries(this.tags))if(t.startsWith(n))return e+t.substring(n.length).replace(/[!,[\]{}]/g,(t=>at[t]));return"!"===t[0]?t:`!<${t}>`}toString(t){const e=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let r;if(t&&n.length>0&&Y(t.contents)){const e={};tt(t.contents,((t,n)=>{Y(n)&&n.tag&&(e[n.tag]=!0)})),r=Object.keys(e)}else r=[];for(const[i,o]of n)"!!"===i&&"tag:yaml.org,2002:"===o||t&&!r.some((t=>t.startsWith(o)))||e.push(`%TAG ${i} ${o}`);return e.join("\n")}}function lt(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const e=JSON.stringify(t);throw new Error(`Anchor must not contain whitespace or control characters: ${e}`)}return!0}function ut(t){const e=new Set;return tt(t,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function ft(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function ht(t,e,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let e=0,n=r.length;ept(t,String(e),n)));if(t&&"function"==typeof t.toJSON){if(!n||!J(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=t=>{r.res=t,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return"bigint"!=typeof t||n?.keep?t:Number(t)}ct.defaultYaml={explicit:!1,version:"1.2"},ct.defaultTags={"!!":"tag:yaml.org,2002:"};class dt{constructor(t){Object.defineProperty(this,K,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:e,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!U(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:!0===e,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},s=pt(this,"",o);if("function"==typeof r)for(const{count:t,res:e}of o.anchors.values())r(e,t);return"function"==typeof i?ht(i,{"":s},"",s):s}}class mt extends dt{constructor(t){super(R),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let e;return tt(t,{Node:(t,n)=>{if(n===this)return tt.BREAK;n.anchor===this.source&&(e=n)}}),e}toJSON(t,e){if(!e)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=e,o=this.resolve(r);if(!o){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(t)}let s=n.get(o);if(s||(pt(o,null,e),s=n.get(o)),!s||void 0===s.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(s.count+=1,0===s.aliasCount&&(s.aliasCount=yt(r,o,n)),s.count*s.aliasCount>i))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return s.res}toString(t,e,n){const r=`*${this.source}`;if(t){if(lt(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(t)}if(t.implicitKey)return`${r} `}return r}}function yt(t,e,n){if(V(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(H(e)){let r=0;for(const i of e.items){const e=yt(t,i,n);e>r&&(r=e)}return r}if(z(e)){const r=yt(t,e.key,n),i=yt(t,e.value,n);return Math.max(r,i)}return 1}const vt=t=>!t||"function"!=typeof t&&"object"!=typeof t;class gt extends dt{constructor(t){super(F),this.value=t}toJSON(t,e){return e?.keep?this.value:pt(this.value,t,e)}toString(){return String(this.value)}}gt.BLOCK_FOLDED="BLOCK_FOLDED",gt.BLOCK_LITERAL="BLOCK_LITERAL",gt.PLAIN="PLAIN",gt.QUOTE_DOUBLE="QUOTE_DOUBLE",gt.QUOTE_SINGLE="QUOTE_SINGLE";const bt="tag:yaml.org,2002:";function wt(t,e,n){if(U(t)&&(t=t.contents),Y(t))return t;if(z(t)){const e=n.schema[B].createNode?.(n.schema,null,n);return e.items.push(t),e}(t instanceof String||t instanceof Number||t instanceof Boolean||"undefined"!=typeof BigInt&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n;let c;if(r&&t&&"object"==typeof t){if(c=a.get(t),c)return c.anchor||(c.anchor=i(t)),new mt(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=bt+e.slice(2));let l=function(t,e,n){if(e){const t=n.filter((t=>t.tag===e)),r=t.find((t=>!t.format))??t[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find((e=>e.identify?.(t)&&!e.format))}(t,e,s.tags);if(!l){if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),!t||"object"!=typeof t){const e=new gt(t);return c&&(c.node=e),e}l=t instanceof Map?s[B]:Symbol.iterator in Object(t)?s[$]:s[B]}o&&(o(l),delete n.onTagObj);const u=l?.createNode?l.createNode(n.schema,t,n):"function"==typeof l?.nodeClass?.from?l.nodeClass.from(n.schema,t,n):new gt(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}function _t(t,e,n){let r=n;for(let t=e.length-1;t>=0;--t){const n=e[t];if("number"==typeof n&&Number.isInteger(n)&&n>=0){const t=[];t[n]=r,r=t}else r=new Map([[n,r]])}return wt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const kt=t=>null==t||"object"==typeof t&&!!t[Symbol.iterator]().next().done;class Et extends dt{constructor(t,e){super(t),Object.defineProperty(this,"schema",{value:e,configurable:!0,enumerable:!1,writable:!0})}clone(t){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(e.schema=t),e.items=e.items.map((e=>Y(e)||z(e)?e.clone(t):e)),this.range&&(e.range=this.range.slice()),e}addIn(t,e){if(kt(t))this.add(e);else{const[n,...r]=t,i=this.get(n,!0);if(H(i))i.addIn(r,e);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,_t(this.schema,r,e))}}}deleteIn(t){const[e,...n]=t;if(0===n.length)return this.delete(e);const r=this.get(e,!0);if(H(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn(t,e){const[n,...r]=t,i=this.get(n,!0);return 0===r.length?!e&&W(i)?i.value:i:H(i)?i.getIn(r,e):void 0}hasAllNullValues(t){return this.items.every((e=>{if(!z(e))return!1;const n=e.value;return null==n||t&&W(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag}))}hasIn(t){const[e,...n]=t;if(0===n.length)return this.has(e);const r=this.get(e,!0);return!!H(r)&&r.hasIn(n)}setIn(t,e){const[n,...r]=t;if(0===r.length)this.set(n,e);else{const t=this.get(n,!0);if(H(t))t.setIn(r,e);else{if(void 0!==t||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,_t(this.schema,r,e))}}}}Et.maxFlowStringSingleLineLength=60;const xt=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Ot(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const St=(t,e,n)=>t.endsWith("\n")?Ot(n,e):n.includes("\n")?"\n"+Ot(n,e):(t.endsWith(" ")?"":" ")+n,Tt="flow",At="block",Lt="quoted";function Nt(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;const c=Math.max(1+o,1+i-e.length);if(t.length<=c)return t;const l=[],u={};let f,h,p=i-e.length;"number"==typeof r&&(r>i-Math.max(2,o)?l.push(0):p=i-r);let d=!1,m=-1,y=-1,v=-1;n===At&&(m=Ct(t,m),-1!==m&&(p=m+c));for(let e;e=t[m+=1];){if(n===Lt&&"\\"===e){switch(y=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}v=m}if("\n"===e)n===At&&(m=Ct(t,m)),p=m+c,f=void 0;else{if(" "===e&&h&&" "!==h&&"\n"!==h&&"\t"!==h){const e=t[m+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(f=m)}if(m>=p)if(f)l.push(f),p=f+c,f=void 0;else if(n===Lt){for(;" "===h||"\t"===h;)h=e,e=t[m+=1],d=!0;const n=m>v+1?m-2:y-1;if(u[n])return t;l.push(n),u[n]=!0,p=n+c,f=void 0}else d=!0}h=e}if(d&&a&&a(),0===l.length)return t;s&&s();let g=t.slice(0,l[0]);for(let r=0;r({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Pt=t=>/^(%|---|\.\.\.)/m.test(t);function It(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Pt(t)?" ":"");let s="",a=0;for(let t=0,e=n[t];e;e=n[++t])if(" "===e&&"\\"===n[t+1]&&"n"===n[t+2]&&(s+=n.slice(a,t)+"\\ ",t+=1,a=t,e="\\"),"\\"===e)switch(n[t+1]){case"u":{s+=n.slice(a,t);const e=n.substr(t+2,4);switch(e){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:"00"===e.substr(0,2)?s+="\\x"+e.substr(2):s+=n.substr(t,6)}t+=5,a=t+1}break;case"n":if(r||'"'===n[t+2]||n.lengthr)return!0;if(n=e+1,i-n<=r)return!1}return!0}(n,c,l.length));if(!n)return u?"|\n":">\n";let f,h;for(h=n.length;h>0;--h){const t=n[h-1];if("\n"!==t&&"\t"!==t&&" "!==t)break}let p=n.substring(h);const d=p.indexOf("\n");-1===d?f="-":n===p||d!==p.length-1?(f="+",o&&o()):f="",p&&(n=n.slice(0,-p.length),"\n"===p[p.length-1]&&(p=p.slice(0,-1)),p=p.replace(Bt,`$&${l}`));let m,y=!1,v=-1;for(m=0;m")+(y?l?"2":"1":"")+f;return t&&(b+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),u?`${b}\n${l}${g}${n=n.replace(/\n+/g,`$&${l}`)}${p}`:`${b}\n${l}${Nt(`${g}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`)}${p}`,l,At,jt(r,!0))}`}function Ft(t,e,n,r){const{implicitKey:i,inFlow:o}=e,s="string"==typeof t.value?t:Object.assign({},t,{value:String(t.value)});let{type:a}=t;a!==gt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=gt.QUOTE_DOUBLE);const c=t=>{switch(t){case gt.BLOCK_FOLDED:case gt.BLOCK_LITERAL:return i||o?Mt(s.value,e):Dt(s,e,n,r);case gt.QUOTE_DOUBLE:return It(s.value,e);case gt.QUOTE_SINGLE:return Rt(s.value,e);case gt.PLAIN:return function(t,e,n,r){const{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&/[\n[\]{},]/.test(o)||u&&/[[\]{},]/.test(o))return Mt(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes("\n")?Mt(o,e):Dt(t,e,n,r);if(!a&&!u&&i!==gt.PLAIN&&o.includes("\n"))return Dt(t,e,n,r);if(Pt(o)){if(""===c)return e.forceBlockIndent=!0,Dt(t,e,n,r);if(a&&c===l)return Mt(o,e)}const f=o.replace(/\n+/g,`$&\n${c}`);if(s){const t=t=>t.default&&"tag:yaml.org,2002:str"!==t.tag&&t.test?.test(f),{compat:n,tags:r}=e.doc.schema;if(r.some(t)||n?.some(t))return Mt(o,e)}return a?f:Nt(f,c,Tt,jt(e,!1))}(s,e,n,r);default:return null}};let l=c(a);if(null===l){const{defaultKeyType:t,defaultStringType:n}=e.options,r=i&&t||n;if(l=c(r),null===l)throw new Error(`Unsupported default string type ${r}`)}return l}function $t(t,e){const n=Object.assign({blockQuote:!0,commentString:xt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Kt(t,e,n,r){if(z(t))return t.toString(e,n,r);if(V(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 i;const o=Y(t)?t:e.doc.createNode(t,{onTagObj:t=>i=t});i||(i=function(t,e){if(e.tag){const n=t.filter((t=>t.tag===e.tag));if(n.length>0)return n.find((t=>t.format===e.format))??n[0]}let n,r;if(W(e)){r=e.value;const i=t.filter((t=>t.identify?.(r)));n=i.find((t=>t.format===e.format))??i.find((t=>!t.format))}else r=e,n=t.find((t=>t.nodeClass&&r instanceof t.nodeClass));if(!n)throw new Error(`Tag not resolved for ${r?.constructor?.name??typeof r} value`);return n}(e.doc.schema.tags,o));const s=function(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],o=(W(t)||H(t))&&t.anchor;o&<(o)&&(n.add(o),i.push(`&${o}`));const s=t.tag?t.tag:e.default?null:e.tag;return s&&i.push(r.directives.tagString(s)),i.join(" ")}(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);const a="function"==typeof i.stringify?i.stringify(o,e,n,r):W(o)?Ft(o,e,n,r):o.toString(e,n,r);return s?W(o)||"{"===a[0]||"["===a[0]?`${s} ${a}`:`${s}\n${e.indent}${a}`:a}function Vt(t,e){"debug"!==t&&"warn"!==t||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(e):console.warn(e))}function Ut(t,e,{key:n,value:r}){if(t?.doc.schema.merge&&qt(n))if(r=V(r)?r.resolve(t.doc):r,G(r))for(const n of r.items)zt(t,e,n);else if(Array.isArray(r))for(const n of r)zt(t,e,n);else zt(t,e,r);else{const i=pt(n,"",t);if(e instanceof Map)e.set(i,pt(r,i,t));else if(e instanceof Set)e.add(i);else{const o=function(t,e,n){if(null===e)return"";if("object"!=typeof e)return String(e);if(Y(t)&&n&&n.doc){const e=$t(n.doc,{});e.anchors=new Set;for(const t of n.anchors.keys())e.anchors.add(t.anchor);e.inFlow=!0,e.inStringifyKey=!0;const r=t.toString(e);if(!n.mapKeyWarned){let t=JSON.stringify(r);t.length>40&&(t=t.substring(0,36)+'..."'),Vt(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${t}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}(n,i,t),s=pt(r,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}const qt=t=>"<<"===t||W(t)&&"<<"===t.value&&(!t.type||t.type===gt.PLAIN);function zt(t,e,n){const r=t&&V(n)?n.resolve(t.doc):n;if(!q(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,t,Map);for(const[t,n]of i)e instanceof Map?e.has(t)||e.set(t,n):e instanceof Set?e.add(t):Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0});return e}function Wt(t,e,n){const r=wt(t,void 0,n),i=wt(e,void 0,n);return new Gt(r,i)}class Gt{constructor(t,e=null){Object.defineProperty(this,K,{value:D}),this.key=t,this.value=e}clone(t){let{key:e,value:n}=this;return Y(e)&&(e=e.clone(t)),Y(n)&&(n=n.clone(t)),new Gt(e,n)}toJSON(t,e){return Ut(e,e?.mapAsMap?new Map:{},this)}toString(t,e,n){return t?.doc?function({key:t,value:e},n,r,i){const{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=n;let h=Y(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(H(t))throw new Error("With simple keys, collection cannot be used as a key value")}let p=!f&&(!t||h&&null==e&&!n.inFlow||H(t)||(W(t)?t.type===gt.BLOCK_FOLDED||t.type===gt.BLOCK_LITERAL:"object"==typeof t));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:a+c});let d,m,y,v=!1,g=!1,b=Kt(t,n,(()=>v=!0),(()=>g=!0));if(!p&&!n.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||null==e)return v&&r&&r(),""===b?"?":p?`? ${b}`:b}else if(o&&!f||null==e&&p)return b=`? ${b}`,h&&!v?b+=St(b,n.indent,l(h)):g&&i&&i(),b;v&&(h=null),p?(h&&(b+=St(b,n.indent,l(h))),b=`? ${b}\n${a}:`):(b=`${b}:`,h&&(b+=St(b,n.indent,l(h)))),Y(e)?(d=!!e.spaceBefore,m=e.commentBefore,y=e.comment):(d=!1,m=null,y=null,e&&"object"==typeof e&&(e=s.createNode(e))),n.implicitKey=!1,p||h||!W(e)||(n.indentAtStart=b.length+1),g=!1,u||!(c.length>=2)||n.inFlow||p||!G(e)||e.flow||e.tag||e.anchor||(n.indent=n.indent.substring(2));let w=!1;const _=Kt(e,n,(()=>w=!0),(()=>g=!0));let k=" ";if(h||d||m)k=d?"\n":"",m&&(k+=`\n${Ot(l(m),n.indent)}`),""!==_||n.inFlow?k+=`\n${n.indent}`:"\n"===k&&(k="\n\n");else if(!p&&H(e)){const t=_[0],r=_.indexOf("\n"),i=-1!==r,o=n.inFlow??e.flow??0===e.items.length;if(i||!o){let e=!1;if(i&&("&"===t||"!"===t)){let n=_.indexOf(" ");"&"===t&&-1!==n&&ns=null),(()=>f=!0));s&&(a+=St(a,o,l(s))),f&&s&&(f=!1),h.push(r+a)}let p;if(0===h.length)p=i.start+i.end;else{p=h[0];for(let t=1;to=null));th||s.includes("\n"))&&(f=!0),p.push(s),h=p.length}let d;const{start:m,end:y}=r;if(0===p.length)d=m+y;else if(f||(f=p.reduce(((t,e)=>t+e.length+2),2)>Et.maxFlowStringSingleLineLength),f){d=m;for(const t of p)d+=t?`\n${a}${s}${t}`:"\n";d+=`\n${s}${y}`}else d=`${m}${c}${p.join(" ")}${c}${y}`;return t&&(d+=St(d,s,l(t)),o&&o()),d}function Xt({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const i=Ot(e(r),t);n.push(i.trimStart())}}function Qt(t,e){const n=W(e)?e.value:e;for(const r of t)if(z(r)){if(r.key===e||r.key===n)return r;if(W(r.key)&&r.key.value===n)return r}}class Zt extends Et{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(B,t),this.items=[]}static from(t,e,n){const{keepUndefined:r,replacer:i}=n,o=new this(t),s=(t,s)=>{if("function"==typeof i)s=i.call(e,t,s);else if(Array.isArray(i)&&!i.includes(t))return;(void 0!==s||r)&&o.items.push(Wt(t,s,n))};if(e instanceof Map)for(const[t,n]of e)s(t,n);else if(e&&"object"==typeof e)for(const t of Object.keys(e))s(t,e[t]);return"function"==typeof t.sortMapEntries&&o.items.sort(t.sortMapEntries),o}add(t,e){let n;n=z(t)?t:t&&"object"==typeof t&&"key"in t?new Gt(t.key,t.value):new Gt(t,t?.value);const r=Qt(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!e)throw new Error(`Key ${n.key} already set`);W(r.value)&&vt(n.value)?r.value.value=n.value:r.value=n.value}else if(i){const t=this.items.findIndex((t=>i(n,t)<0));-1===t?this.items.push(n):this.items.splice(t,0,n)}else this.items.push(n)}delete(t){const e=Qt(this.items,t);return!!e&&this.items.splice(this.items.indexOf(e),1).length>0}get(t,e){const n=Qt(this.items,t),r=n?.value;return(!e&&W(r)?r.value:r)??void 0}has(t){return!!Qt(this.items,t)}set(t,e){this.add(new Gt(t,e),!0)}toJSON(t,e,n){const r=n?new n:e?.mapAsMap?new Map:{};e?.onCreate&&e.onCreate(r);for(const t of this.items)Ut(e,r,t);return r}toString(t,e,n){if(!t)return JSON.stringify(this);for(const t of this.items)if(!z(t))throw new Error(`Map items must all be pairs; found ${JSON.stringify(t)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Ht(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:e})}}const te={collection:"map",default:!0,nodeClass:Zt,tag:"tag:yaml.org,2002:map",resolve:(t,e)=>(q(t)||e("Expected a mapping for this tag"),t),createNode:(t,e,n)=>Zt.from(t,e,n)};class ee extends Et{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super($,t),this.items=[]}add(t){this.items.push(t)}delete(t){const e=ne(t);return"number"==typeof e&&this.items.splice(e,1).length>0}get(t,e){const n=ne(t);if("number"!=typeof n)return;const r=this.items[n];return!e&&W(r)?r.value:r}has(t){const e=ne(t);return"number"==typeof e&&e=0?e:null}const re={collection:"seq",default:!0,nodeClass:ee,tag:"tag:yaml.org,2002:seq",resolve:(t,e)=>(G(t)||e("Expected a sequence for this tag"),t),createNode:(t,e,n)=>ee.from(t,e,n)},ie={identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:(t,e,n,r)=>Ft(t,e=Object.assign({actualString:!0},e),n,r)},oe={identify:t=>null==t,createNode:()=>new gt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new gt(null),stringify:({source:t},e)=>"string"==typeof t&&oe.test.test(t)?t:e.options.nullStr},se={identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new gt("t"===t[0]||"T"===t[0]),stringify:({source:t,value:e},n)=>t&&se.test.test(t)&&e===("t"===t[0]||"T"===t[0])?t:e?n.options.trueStr:n.options.falseStr};function ae({format:t,minFractionDigits:e,tag:n,value:r}){if("bigint"==typeof r)return String(r);const i="number"==typeof r?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=JSON.stringify(r);if(!t&&e&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(o)){let t=o.indexOf(".");t<0&&(t=o.length,o+=".");let n=e-(o.length-t-1);for(;n-- >0;)o+="0"}return o}const ce={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ae},le={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ae(t)}},ue={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new gt(parseFloat(t)),n=t.indexOf(".");return-1!==n&&"0"===t[t.length-1]&&(e.minFractionDigits=t.length-n-1),e},stringify:ae},fe=t=>"bigint"==typeof t||Number.isInteger(t),he=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function pe(t,e,n){const{value:r}=t;return fe(r)&&r>=0?n+r.toString(e):ae(t)}const de={identify:t=>fe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>he(t,2,8,n),stringify:t=>pe(t,8,"0o")},me={identify:fe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>he(t,0,10,n),stringify:ae},ye={identify:t=>fe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>he(t,2,16,n),stringify:t=>pe(t,16,"0x")},ve=[te,re,ie,oe,se,de,me,ye,ce,le,ue];function ge(t){return"bigint"==typeof t||Number.isInteger(t)}const be=({value:t})=>JSON.stringify(t),we=[te,re].concat([{identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:be},{identify:t=>null==t,createNode:()=>new gt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:be},{identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>"true"===t,stringify:be},{identify:ge,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})=>ge(t)?t.toString():JSON.stringify(t)},{identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:be}],{default:!0,tag:"",test:/^/,resolve:(t,e)=>(e(`Unresolved plain scalar ${JSON.stringify(t)}`),t)}),_e={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if("function"==typeof Buffer)return Buffer.from(t,"base64");if("function"==typeof atob){const e=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(e.length);for(let t=0;t1&&e("Each pair must have its own sequence indicator");const t=r.items[0]||new Gt(new gt(null));if(r.commentBefore&&(t.key.commentBefore=t.key.commentBefore?`${r.commentBefore}\n${t.key.commentBefore}`:r.commentBefore),r.comment){const e=t.value??t.key;e.comment=e.comment?`${r.comment}\n${e.comment}`:r.comment}r=t}t.items[n]=z(r)?r:new Gt(r)}}else e("Expected a sequence for this tag");return t}function Ee(t,e,n){const{replacer:r}=n,i=new ee(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let t of e){let s,a;if("function"==typeof r&&(t=r.call(e,String(o++),t)),Array.isArray(t)){if(2!==t.length)throw new TypeError(`Expected [key, value] tuple: ${t}`);s=t[0],a=t[1]}else if(t&&t instanceof Object){const e=Object.keys(t);if(1!==e.length)throw new TypeError(`Expected { key: value } tuple: ${t}`);s=e[0],a=t[s]}else s=t;i.items.push(Wt(s,a,n))}return i}const xe={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ke,createNode:Ee};class Oe extends ee{constructor(){super(),this.add=Zt.prototype.add.bind(this),this.delete=Zt.prototype.delete.bind(this),this.get=Zt.prototype.get.bind(this),this.has=Zt.prototype.has.bind(this),this.set=Zt.prototype.set.bind(this),this.tag=Oe.tag}toJSON(t,e){if(!e)return super.toJSON(t);const n=new Map;e?.onCreate&&e.onCreate(n);for(const t of this.items){let r,i;if(z(t)?(r=pt(t.key,"",e),i=pt(t.value,r,e)):r=pt(t,"",e),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,i)}return n}static from(t,e,n){const r=Ee(t,e,n),i=new this;return i.items=r.items,i}}Oe.tag="tag:yaml.org,2002:omap";const Se={collection:"seq",identify:t=>t instanceof Map,nodeClass:Oe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=ke(t,e),r=[];for(const{key:t}of n.items)W(t)&&(r.includes(t.value)?e(`Ordered maps must not include duplicate keys: ${t.value}`):r.push(t.value));return Object.assign(new Oe,n)},createNode:(t,e,n)=>Oe.from(t,e,n)};function Te({value:t,source:e},n){return e&&(t?Ae:Le).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Ae={identify:t=>!0===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new gt(!0),stringify:Te},Le={identify:t=>!1===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>new gt(!1),stringify:Te},Ne={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ae},Ce={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ae(t)}},je={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new gt(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(-1!==n){const r=t.substring(n+1).replace(/_/g,"");"0"===r[r.length-1]&&(e.minFractionDigits=r.length)}return e},stringify:ae},Pe=t=>"bigint"==typeof t||Number.isInteger(t);function Ie(t,e,n,{intAsBigInt:r}){const i=t[0];if("-"!==i&&"+"!==i||(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`}const e=BigInt(t);return"-"===i?BigInt(-1)*e:e}const o=parseInt(t,n);return"-"===i?-1*o:o}function Re(t,e,n){const{value:r}=t;if(Pe(r)){const t=r.toString(e);return r<0?"-"+n+t.substr(1):n+t}return ae(t)}const Me={identify:Pe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Ie(t,2,2,n),stringify:t=>Re(t,2,"0b")},Be={identify:Pe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Ie(t,1,8,n),stringify:t=>Re(t,8,"0")},De={identify:Pe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Ie(t,0,10,n),stringify:ae},Fe={identify:Pe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Ie(t,2,16,n),stringify:t=>Re(t,16,"0x")};class $e extends Zt{constructor(t){super(t),this.tag=$e.tag}add(t){let e;e=z(t)?t:t&&"object"==typeof t&&"key"in t&&"value"in t&&null===t.value?new Gt(t.key,null):new Gt(t,null),Qt(this.items,e.key)||this.items.push(e)}get(t,e){const n=Qt(this.items,t);return!e&&z(n)?W(n.key)?n.key.value:n.key:n}set(t,e){if("boolean"!=typeof e)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof e);const n=Qt(this.items,t);n&&!e?this.items.splice(this.items.indexOf(n),1):!n&&e&&this.items.push(new Gt(t))}toJSON(t,e){return super.toJSON(t,e,Set)}toString(t,e,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),e,n);throw new Error("Set items must all have null values")}static from(t,e,n){const{replacer:r}=n,i=new this(t);if(e&&Symbol.iterator in Object(e))for(let t of e)"function"==typeof r&&(t=r.call(e,t,t)),i.items.push(Wt(t,null,n));return i}}$e.tag="tag:yaml.org,2002:set";const Ke={collection:"map",identify:t=>t instanceof Set,nodeClass:$e,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>$e.from(t,e,n),resolve(t,e){if(q(t)){if(t.hasAllNullValues(!0))return Object.assign(new $e,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function Ve(t,e){const n=t[0],r="-"===n||"+"===n?t.substring(1):t,i=t=>e?BigInt(t):Number(t),o=r.replace(/_/g,"").split(":").reduce(((t,e)=>t*i(60)+i(e)),i(0));return"-"===n?i(-1)*o:o}function Ue(t){let{value:e}=t,n=t=>t;if("bigint"==typeof e)n=t=>BigInt(t);else if(isNaN(e)||!isFinite(e))return ae(t);let r="";e<0&&(r="-",e*=n(-1));const i=n(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),r+o.map((t=>String(t).padStart(2,"0"))).join(":").replace(/000000\d*$/,"")}const qe={identify:t=>"bigint"==typeof t||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})=>Ve(t,n),stringify:Ue},ze={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Ve(t,!1),stringify:Ue},We={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(We.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0;let l=Date.UTC(n,r-1,i,o||0,s||0,a||0,c);const u=e[8];if(u&&"Z"!==u){let t=Ve(u,!1);Math.abs(t)<30&&(t*=60),l-=6e4*t}return new Date(l)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},Ge=[te,re,ie,oe,Ae,Le,Me,Be,De,Fe,Ne,Ce,je,_e,Se,xe,Ke,qe,ze,We],He=new Map([["core",ve],["failsafe",[te,re,ie]],["json",we],["yaml11",Ge],["yaml-1.1",Ge]]),Ye={binary:_e,bool:se,float:ue,floatExp:le,floatNaN:ce,floatTime:ze,int:me,intHex:ye,intOct:de,intTime:qe,map:te,null:oe,omap:Se,pairs:xe,seq:re,set:Ke,timestamp:We},Je={"tag:yaml.org,2002:binary":_e,"tag:yaml.org,2002:omap":Se,"tag:yaml.org,2002:pairs":xe,"tag:yaml.org,2002:set":Ke,"tag:yaml.org,2002:timestamp":We};function Xe(t,e){let n=He.get(e);if(!n){if(!Array.isArray(t)){const t=Array.from(He.keys()).filter((t=>"yaml11"!==t)).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${t} or define customTags array`)}n=[]}if(Array.isArray(t))for(const e of t)n=n.concat(e);else"function"==typeof t&&(n=t(n.slice()));return n.map((t=>{if("string"!=typeof t)return t;const e=Ye[t];if(e)return e;const n=Object.keys(Ye).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown custom tag "${t}"; use one of ${n}`)}))}const Qe=(t,e)=>t.keye.key?1:0;class Ze{constructor({compat:t,customTags:e,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(t)?Xe(t,"compat"):t?Xe(null,t):null,this.merge=!!n,this.name="string"==typeof i&&i||"core",this.knownTags=r?Je:{},this.tags=Xe(e,this.name),this.toStringOptions=s??null,Object.defineProperty(this,B,{value:te}),Object.defineProperty(this,F,{value:ie}),Object.defineProperty(this,$,{value:re}),this.sortMapEntries="function"==typeof o?o:!0===o?Qe:null}clone(){const t=Object.create(Ze.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}class tn{constructor(t,e,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,K,{value:M});let r=null;"function"==typeof e||Array.isArray(e)?r=e:void 0===n&&e&&(n=e,e=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ct({version:o}),this.setSchema(o,n),this.contents=void 0===t?null:this.createNode(t,r,n)}clone(){const t=Object.create(tn.prototype,{[K]:{value:M}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Y(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){en(this.contents)&&this.contents.add(t)}addIn(t,e){en(this.contents)&&this.contents.addIn(t,e)}createAlias(t,e){if(!t.anchor){const n=ut(this);t.anchor=!e||n.has(e)?ft(e||"a",n):e}return new mt(t.anchor)}createNode(t,e,n){let r;if("function"==typeof e)t=e.call({"":t},"",t),r=e;else if(Array.isArray(e)){const t=t=>"number"==typeof t||t instanceof String||t instanceof Number,n=e.filter(t).map(String);n.length>0&&(e=e.concat(n)),r=e}else void 0===n&&e&&(n=e,e=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:s,keepUndefined:a,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:f,sourceObjects:h}=function(t,e){const n=[],r=new Map;let i=null;return{onAnchor:r=>{n.push(r),i||(i=ut(t));const o=ft(e,i);return i.add(o),o},setAnchors:()=>{for(const t of n){const e=r.get(t);if("object"!=typeof e||!e.anchor||!W(e.node)&&!H(e.node)){const e=new Error("Failed to resolve repeated object (this should not happen)");throw e.source=t,e}e.node.anchor=e.anchor}},sourceObjects:r}}(this,o||"a"),p=wt(t,l,{aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:h});return s&&H(p)&&(p.flow=!0),f(),p}createPair(t,e,n={}){const r=this.createNode(t,null,n),i=this.createNode(e,null,n);return new Gt(r,i)}delete(t){return!!en(this.contents)&&this.contents.delete(t)}deleteIn(t){return kt(t)?null!=this.contents&&(this.contents=null,!0):!!en(this.contents)&&this.contents.deleteIn(t)}get(t,e){return H(this.contents)?this.contents.get(t,e):void 0}getIn(t,e){return kt(t)?!e&&W(this.contents)?this.contents.value:this.contents:H(this.contents)?this.contents.getIn(t,e):void 0}has(t){return!!H(this.contents)&&this.contents.has(t)}hasIn(t){return kt(t)?void 0!==this.contents:!!H(this.contents)&&this.contents.hasIn(t)}set(t,e){null==this.contents?this.contents=_t(this.schema,[t],e):en(this.contents)&&this.contents.set(t,e)}setIn(t,e){kt(t)?this.contents=e:null==this.contents?this.contents=_t(this.schema,Array.from(t),e):en(this.contents)&&this.contents.setIn(t,e)}setSchema(t,e={}){let n;switch("number"==typeof t&&(t=String(t)),t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ct({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new ct({version:t}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const e=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${e}`)}}if(e.schema instanceof Object)this.schema=e.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new Ze(Object.assign(n,e))}}toJS({json:t,jsonArg:e,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){const s={anchors:new Map,doc:this,keep:!t,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},a=pt(this.contents,e??"",s);if("function"==typeof i)for(const{count:t,res:e}of s.anchors.values())i(e,t);return"function"==typeof o?ht(o,{"":a},"",a):a}toJSON(t,e){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:e})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const e=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${e}`)}return function(t,e){const n=[];let r=!0===e.directives;if(!1!==e.directives&&t.directives){const e=t.directives.toString(t);e?(n.push(e),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");const i=$t(t,e),{commentString:o}=i.options;if(t.commentBefore){1!==n.length&&n.unshift("");const e=o(t.commentBefore);n.unshift(Ot(e,""))}let s=!1,a=null;if(t.contents){if(Y(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const e=o(t.contents.commentBefore);n.push(Ot(e,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}const e=a?void 0:()=>s=!0;let c=Kt(t.contents,i,(()=>a=null),e);a&&(c+=St(c,"",o(a))),"|"!==c[0]&&">"!==c[0]||"---"!==n[n.length-1]?n.push(c):n[n.length-1]=`--- ${c}`}else n.push(Kt(t.contents,i));if(t.directives?.docEnd)if(t.comment){const e=o(t.comment);e.includes("\n")?(n.push("..."),n.push(Ot(e,""))):n.push(`... ${e}`)}else n.push("...");else{let e=t.comment;e&&s&&(e=e.replace(/^\n+/,"")),e&&(s&&!a||""===n[n.length-1]||n.push(""),n.push(Ot(o(e),"")))}return n.join("\n")+"\n"}(this,t)}}function en(t){if(H(t))return!0;throw new Error("Expected a YAML collection as document contents")}class nn extends Error{constructor(t,e,n,r){super(),this.name=t,this.code=n,this.message=r,this.pos=e}}class rn extends nn{constructor(t,e,n){super("YAMLParseError",t,e,n)}}class on extends nn{constructor(t,e,n){super("YAMLWarning",t,e,n)}}const sn=(t,e)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map((t=>e.linePos(t)));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){const t=Math.min(o-39,s.length-79);s="…"+s.substring(t),o-=t-1}if(s.length>80&&(s=s.substring(0,79)+"…"),r>1&&/^ *$/.test(s.substring(0,o))){let n=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),s=n+s}if(/[^ ]/.test(s)){let t=1;const e=n.linePos[1];e&&e.line===r&&e.col>i&&(t=Math.max(1,Math.min(e.col-i,80-o)));const a=" ".repeat(o)+"^".repeat(t);n.message+=`:\n\n${s}\n${a}\n`}};function an(t,{flow:e,indicator:n,next:r,offset:i,onError:o,startOnNewline:s}){let a=!1,c=s,l=s,u="",f="",h=!1,p=!1,d=!1,m=null,y=null,v=null,g=null,b=null;for(const r of t)switch(d&&("space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),r.type){case"space":!e&&c&&"doc-start"!==n&&"\t"===r.source[0]&&o(r,"TAB_AS_INDENT","Tabs are not allowed as indentation"),l=!0;break;case"comment":{l||o(r,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=r.source.substring(1)||" ";u?u+=f+t:u=t,f="",c=!1;break}case"newline":c?u?u+=r.source:a=!0:f+=r.source,c=!0,h=!0,(m||y)&&(p=!0),l=!0;break;case"anchor":m&&o(r,"MULTIPLE_ANCHORS","A node can have at most one anchor"),r.source.endsWith(":")&&o(r.offset+r.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=r,null===b&&(b=r.offset),c=!1,l=!1,d=!0;break;case"tag":y&&o(r,"MULTIPLE_TAGS","A node can have at most one tag"),y=r,null===b&&(b=r.offset),c=!1,l=!1,d=!0;break;case n:(m||y)&&o(r,"BAD_PROP_ORDER",`Anchors and tags must be after the ${r.source} indicator`),g&&o(r,"UNEXPECTED_TOKEN",`Unexpected ${r.source} in ${e??"collection"}`),g=r,c=!1,l=!1;break;case"comma":if(e){v&&o(r,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=r,c=!1,l=!1;break}default:o(r,"UNEXPECTED_TOKEN",`Unexpected ${r.type} token`),c=!1,l=!1}const w=t[t.length-1],_=w?w.offset+w.source.length:i;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),{comma:v,found:g,spaceBefore:a,comment:u,hasNewline:h,hasNewlineAfterProp:p,anchor:m,tag:y,end:_,start:b??_}}function cn(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes("\n"))return!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const e of t.items){for(const t of e.start)if("newline"===t.type)return!0;if(e.sep)for(const t of e.sep)if("newline"===t.type)return!0;if(cn(e.key)||cn(e.value))return!0}return!1;default:return!0}}function ln(t,e,n){if("flow-collection"===e?.type){const r=e.end[0];r.indent!==t||"]"!==r.source&&"}"!==r.source||!cn(e)||n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function un(t,e,n){const{uniqueKeys:r}=t.options;if(!1===r)return!1;const i="function"==typeof r?r:(e,n)=>e===n||W(e)&&W(n)&&e.value===n.value&&!("<<"===e.value&&t.schema.merge);return e.some((t=>i(t.key,n)))}const fn="All mapping items must start at the same column";function hn(t,e,n,r){let i="";if(t){let o=!1,s="";for(const a of t){const{source:t,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{n&&!o&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=t.substring(1)||" ";i?i+=s+e:i=e,s="";break}case"newline":i&&(s+=t),o=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=t.length}}return{comment:i,offset:e}}const pn="Block collections are not allowed within flow collections",dn=t=>t&&("block-map"===t.type||"block-seq"===t.type);function mn(t,e,n,r,i,o){const s="block-map"===n.type?function({composeNode:t,composeEmptyNode:e},n,r,i,o){const s=new(o?.nodeClass??Zt)(n.schema);n.atRoot&&(n.atRoot=!1);let a=r.offset,c=null;for(const o of r.items){const{start:l,key:u,sep:f,value:h}=o,p=an(l,{indicator:"explicit-key-ind",next:u??f?.[0],offset:a,onError:i,startOnNewline:!0}),d=!p.found;if(d){if(u&&("block-seq"===u.type?i(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==r.indent&&i(a,"BAD_INDENT",fn)),!p.anchor&&!p.tag&&!f){c=p.end,p.comment&&(s.comment?s.comment+="\n"+p.comment:s.comment=p.comment);continue}(p.hasNewlineAfterProp||cn(u))&&i(u??l[l.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(a,"BAD_INDENT",fn);const m=p.end,y=u?t(n,u,p,i):e(n,m,l,null,p,i);n.schema.compat&&ln(r.indent,u,i),un(n,s.items,y)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const v=an(f??[],{indicator:"map-value-ind",next:h,offset:y.range[2],onError:i,startOnNewline:!u||"block-scalar"===u.type});if(a=v.end,v.found){d&&("block-map"!==h?.type||v.hasNewline||i(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start0){const t=hn(p,d,n.options.strict,i);t.comment&&(c.comment?c.comment+="\n"+t.comment:c.comment=t.comment),c.range=[r.offset,d,t.offset]}else c.range=[r.offset,d,d];return c}(t,e,n,r,o),a=s.constructor;return"!"===i||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function yn(t){let e,n;try{e=new RegExp("(.*?)(?"===i.mode?gt.BLOCK_FOLDED:gt.BLOCK_LITERAL,s=t.source?function(t){const e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let t=1;t=0;--t){const e=s[t][1];if(""!==e&&"\r"!==e)break;a=t}if(0===a){const e="+"===i.chomp&&s.length>0?"\n".repeat(Math.max(1,s.length-1)):"";let n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:o,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;tc&&(c=e.length),l+=e.length+r.length+1}for(let t=s.length-1;t>=a;--t)s[t][0].length>c&&(a=t+1);let f="",h="",p=!1;for(let t=0;tc||"\t"===r[0]?(" "===h?h="\n":p||"\n"!==h||(h="\n\n"),f+=h+e.slice(c)+r,h="\n",p=!0):""===r?"\n"===h?f+="\n":h="\n":(f+=h+r,h=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let t=a;tn(r+t,e,i);switch(i){case"scalar":a=gt.PLAIN,c=function(t,e){let n="";switch(t[0]){case"\t":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]}`}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),yn(t)}(o,l);break;case"single-quoted-scalar":a=gt.QUOTE_SINGLE,c=function(t,e){return"'"===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR","Missing closing 'quote"),yn(t.slice(1,-1)).replace(/''/g,"'")}(o,l);break;case"double-quoted-scalar":a=gt.QUOTE_DOUBLE,c=function(t,e){let n="";for(let r=1;re?t.slice(e,r+1):i)}else n+=i}return'"'===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}(o,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const u=r+o.length,f=hn(s,u,e,n);return{value:c,type:a,comment:f.comment,range:[r,u,f.offset]}}(e,t.options.strict,r),c=n?t.directives.tagName(n.source,(t=>r(n,"TAG_RESOLVE_FAILED",t))):null,l=n&&c?function(t,e,n,r,i){if("!"===n)return t[F];const o=[];for(const e of t.tags)if(!e.collection&&e.tag===n){if(!e.default||!e.test)return e;o.push(e)}for(const t of o)if(t.test?.test(e))return t;const s=t.knownTags[n];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),t[F])}(t.schema,i,c,n,r):"scalar"===e.type?function({directives:t,schema:e},n,r,i){const o=e.tags.find((t=>t.default&&t.test?.test(n)))||e[F];if(e.compat){const s=e.compat.find((t=>t.default&&t.test?.test(n)))??e[F];o.tag!==s.tag&&i(r,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(s.tag)}`,!0)}return o}(t,i,e,r):t.schema[F];let u;try{const o=l.resolve(i,(t=>r(n??e,"TAG_RESOLVE_FAILED",t)),t.options);u=W(o)?o:new gt(o)}catch(t){const o=t instanceof Error?t.message:String(t);r(n??e,"TAG_RESOLVE_FAILED",o),u=new gt(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function _n(t,e,n){if(e){null===n&&(n=e.length);for(let r=n-1;r>=0;--r){let n=e[r];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++r];"space"===n?.type;)t+=n.source.length,n=e[++r];break}}return t}const kn={composeNode:En,composeEmptyNode:xn};function En(t,e,n,r){const{spaceBefore:i,comment:o,anchor:s,tag:a}=n;let c,l=!0;switch(e.type){case"alias":c=function({options:t},{offset:e,source:n,end:r},i){const o=new mt(n.substring(1));""===o.source&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const s=e+n.length,a=hn(r,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}(t,e,r),(s||a)&&r(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=wn(t,e,a,r),s&&(c.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=function(t,e,n,r,i){const o=r?e.directives.tagName(r.source,(t=>i(r,"TAG_RESOLVE_FAILED",t))):null,s="block-map"===n.type?"map":"block-seq"===n.type?"seq":"{"===n.start.source?"map":"seq";if(!r||!o||"!"===o||o===Zt.tagName&&"map"===s||o===ee.tagName&&"seq"===s||!s)return mn(t,e,n,i,o);let a=e.schema.tags.find((t=>t.tag===o&&t.collection===s));if(!a){const c=e.schema.knownTags[o];if(!c||c.collection!==s)return c?.collection?i(r,"BAD_COLLECTION_TYPE",`${c.tag} used for ${s} collection, but expects ${c.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),mn(t,e,n,i,o);e.schema.tags.push(Object.assign({},c,{default:!1})),a=c}const c=mn(t,e,n,i,o,a),l=a.resolve?.(c,(t=>i(r,"TAG_RESOLVE_FAILED",t)),e.options)??c,u=Y(l)?l:new gt(l);return u.range=c.range,u.tag=o,a?.format&&(u.format=a.format),u}(kn,t,e,a,r),s&&(c.anchor=s.source.substring(1));break;default:r(e,"UNEXPECTED_TOKEN","error"===e.type?e.message:`Unsupported token (type: ${e.type})`),c=xn(t,e.offset,void 0,null,n,r),l=!1}return s&&""===c.anchor&&r(s,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(c.spaceBefore=!0),o&&("scalar"===e.type&&""===e.source?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&l&&(c.srcToken=e),c}function xn(t,e,n,r,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){const u=wn(t,{type:"scalar",offset:_n(e,n,r),indent:-1,source:""},a,l);return s&&(u.anchor=s.source.substring(1),""===u.anchor&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),o&&(u.comment=o,u.range[2]=c),u}function On(t){if("number"==typeof t)return[t,t+1];if(Array.isArray(t))return 2===t.length?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+("string"==typeof n?n.length:1)]}function Sn(t){let e="",n=!1,r=!1;for(let i=0;i{const i=On(t);r?this.warnings.push(new on(i,e,n)):this.errors.push(new rn(i,e,n))},this.directives=new ct({version:t.version||"1.2"}),this.options=t}decorate(t,e){const{comment:n,afterEmptyLine:r}=Sn(this.prelude);if(n){const i=t.contents;if(e)t.comment=t.comment?`${t.comment}\n${n}`:n;else if(r||t.directives.docStart||!i)t.commentBefore=n;else if(H(i)&&!i.flow&&i.items.length>0){let t=i.items[0];z(t)&&(t=t.key);const e=t.commentBefore;t.commentBefore=e?`${n}\n${e}`:n}else{const t=i.commentBefore;i.commentBefore=t?`${n}\n${t}`:n}}e?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Sn(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,e=!1,n=-1){for(const e of t)yield*this.next(e);yield*this.end(e,n)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,((e,n,r)=>{const i=On(t);i[0]+=e,this.onError(i,"BAD_DIRECTIVE",n,r)})),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const e=function(t,e,{offset:n,start:r,value:i,end:o},s){const a=Object.assign({_directives:e},t),c=new tn(void 0,a),l={atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=an(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:s,startOnNewline:!0});u.found&&(c.directives.docStart=!0,!i||"block-map"!==i.type&&"block-seq"!==i.type||u.hasNewline||s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?En(l,i,u,s):xn(l,u.end,r,null,u,s);const f=c.contents.range[2],h=hn(o,f,!1,s);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new rn(On(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const e="Unexpected doc-end without preceding document";this.errors.push(new rn(On(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=hn(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),e.comment){const t=this.doc.comment;this.doc.comment=t?`${t}\n${e.comment}`:e.comment}this.doc.range[2]=e.offset;break}default:this.errors.push(new rn(On(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,e=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const t=Object.assign({_directives:this.directives},this.options),n=new tn(void 0,t);this.atDirectives&&this.onError(e,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,e,e],this.decorate(n,!1),yield n}}}const An=Symbol("break visit"),Ln=Symbol("skip children"),Nn=Symbol("remove item");function Cn(t,e){"type"in t&&"document"===t.type&&(t={start:t.start,value:t.value}),jn(Object.freeze([]),t,e)}function jn(t,e,n){let r=n(e,t);if("symbol"==typeof r)return r;for(const i of["key","value"]){const o=e[i];if(o&&"items"in o){for(let e=0;e{let n=t;for(const[t,r]of e){const e=n?.[t];if(!e||!("items"in e))return;n=e.items[r]}return n},Cn.parentCollection=(t,e)=>{const n=Cn.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Pn(t){switch(t){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const In="0123456789ABCDEFabcdef".split(""),Rn="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""),Mn=",[]{}".split(""),Bn=" ,[]{}\n\r\t".split(""),Dn=t=>!t||Bn.includes(t);class Fn{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,e=!1){t&&(this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null),this.atEnd=!e;let n=this.next??"stream";for(;n&&(e||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let t=this.pos,e=this.buffer[t];for(;" "===e||"\t"===e;)e=this.buffer[++t];return!e||"#"===e||"\n"===e||"\r"===e&&"\n"===this.buffer[t+1]}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let e=this.buffer[t];if(this.indentNext>0){let n=0;for(;" "===e;)e=this.buffer[++n+t];if("\r"===e){const e=this.buffer[n+t+1];if("\n"===e||!e&&!this.atEnd)return t+n+1}return"\n"===e||n>=this.indentNext||!e&&!this.atEnd?t+n:-1}if("-"===e||"."===e){const e=this.buffer.substr(t,3);if(("---"===e||"..."===e)&&Pn(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return("number"!=typeof t||-1!==t&&tthis.indentValue&&!Pn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,e]=this.peek(2);if(!e&&!this.atEnd)return this.setNext("block-start");if(("-"===t||"?"===t||":"===t)&&Pn(e)){const t=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=t,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(null===t)return this.setNext("doc");let e=yield*this.pushIndicators();switch(t[e]){case"#":yield*this.pushCount(t.length-e);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(Dn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return e+=(yield*this.parseBlockScalarHeader()),e+=(yield*this.pushSpaces(!0)),yield*this.pushCount(t.length-e),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,e,n=-1;do{t=yield*this.pushNewline(),t>0?(e=yield*this.pushSpaces(!1),this.indentValue=n=e):e=0,e+=(yield*this.pushSpaces(!0))}while(t+e>0);const r=this.getLine();if(null===r)return this.setNext("flow");if((-1!==n&&n"0"&&e<="9")this.blockScalarIndent=Number(e)-1;else if("-"!==e)break}return yield*this.pushUntil((t=>Pn(t)||"#"===t))}*parseBlockScalar(){let t,e=this.pos-1,n=0;t:for(let r=this.pos;t=this.buffer[r];++r)switch(t){case" ":n+=1;break;case"\n":e=r,n=0;break;case"\r":{const t=this.buffer[r+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break t}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext+=this.blockScalarIndent;do{const t=this.continueScalar(e+1);if(-1===t)break;e=this.buffer.indexOf("\n",t)}while(-1!==e);if(-1===e){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}if(!this.blockScalarKeep)for(;;){let t=e-1,r=this.buffer[t];"\r"===r&&(r=this.buffer[--t]);const i=t;for(;" "===r||"\t"===r;)r=this.buffer[--t];if(!("\n"===r&&t>=this.pos&&t+1+n>i))break;e=t}return yield"",yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let e,n=this.pos-1,r=this.pos-1;for(;e=this.buffer[++r];)if(":"===e){const e=this.buffer[r+1];if(Pn(e)||t&&","===e)break;n=r}else if(Pn(e)){let i=this.buffer[r+1];if("\r"===e&&("\n"===i?(r+=1,e="\n",i=this.buffer[r+1]):n=r),"#"===i||t&&Mn.includes(i))break;if("\n"===e){const t=this.continueScalar(r+1);if(-1===t)break;r=Math.max(r,t-2)}}else{if(t&&Mn.includes(e))break;n=r}return e||this.atEnd?(yield"",yield*this.pushToIndex(n+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,e){const n=this.buffer.slice(this.pos,t);return n?(yield n,this.pos+=n.length,n.length):(e&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Dn))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,e=this.charAt(1);if(Pn(e)||t&&Mn.includes(e))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let t=this.pos+2,e=this.buffer[t];for(;!Pn(e)&&">"!==e;)e=this.buffer[++t];return yield*this.pushToIndex(">"===e?t+1:t,!1)}{let t=this.pos+1,e=this.buffer[t];for(;e;)if(Rn.includes(e))e=this.buffer[++t];else{if("%"!==e||!In.includes(this.buffer[t+1])||!In.includes(this.buffer[t+2]))break;e=this.buffer[t+=3]}return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return"\n"===t?yield*this.pushCount(1):"\r"===t&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(t){let e,n=this.pos-1;do{e=this.buffer[++n]}while(" "===e||t&&"\t"===e);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let e=this.pos,n=this.buffer[e];for(;!t(n);)n=this.buffer[++e];return yield*this.pushToIndex(e,!1)}}class $n{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let e=0,n=this.lineStarts.length;for(;e>1;this.lineStarts[r]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break t}for(;"space"===t[++e]?.type;);return t.splice(e,t.length)}function Wn(t){if("flow-seq-start"===t.start.type)for(const e of t.items)!e.sep||e.value||Kn(e.start,"explicit-key-ind")||Kn(e.sep,"map-value-ind")||(e.key&&(e.value=e.key),delete e.key,Un(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Gn{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Fn,this.onNewLine=t}*parse(t,e=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(t,e))yield*this.next(n);e||(yield*this.end())}*next(t){if(this.source=t,this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=t.length);const e=function(t){switch(t){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":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"\t":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}(t);if(e)if("scalar"===e)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=e,yield*this.step(),e){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&" "===t[0]&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const e=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:t}),this.offset+=t.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(){const t=this.peek(1);if("doc-end"!==this.type||t&&"doc-end"===t.type){if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(t){return this.stack[this.stack.length-t]}*pop(t){const e=t??this.stack.pop();if(e)if(0===this.stack.length)yield e;else{const t=this.peek(1);switch("block-scalar"===e.type?e.indent="indent"in t?t.indent:0:"flow-collection"===e.type&&"document"===t.type&&(e.indent=0),"flow-collection"===e.type&&Wn(e),t.type){case"document":t.value=e;break;case"block-scalar":t.props.push(e);break;case"block-map":{const n=t.items[t.items.length-1];if(n.value)return t.items.push({start:[],key:e,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:e,sep:[]}),void(this.onKeyLine=!Kn(n.start,"explicit-key-ind"));n.value=e;break}case"block-seq":{const n=t.items[t.items.length-1];n.value?t.items.push({start:[],value:e}):n.value=e;break}case"flow-collection":{const n=t.items[t.items.length-1];return void(!n||n.value?t.items.push({start:[],key:e,sep:[]}):n.sep?n.value=e:Object.assign(n,{key:e,sep:[]}))}default:yield*this.pop(),yield*this.pop(e)}if(!("document"!==t.type&&"block-map"!==t.type&&"block-seq"!==t.type||"block-map"!==e.type&&"block-seq"!==e.type)){const n=e.items[e.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===Vn(n.start)&&(0===e.indent||n.start.every((t=>"comment"!==t.type||t.indent=t.indent){const n=!this.onKeyLine&&this.indent===t.indent&&e.sep;let r=[];if(n&&e.sep&&!e.value){const n=[];for(let r=0;rt.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(r=e.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(n||e.value?(r.push(this.sourceToken),t.items.push({start:r}),this.onKeyLine=!0):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"explicit-key-ind":return e.sep||Kn(e.start,"explicit-key-ind")?n||e.value?(r.push(this.sourceToken),t.items.push({start:r})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}):e.start.push(this.sourceToken),void(this.onKeyLine=!0);case"map-value-ind":if(Kn(e.start,"explicit-key-ind"))if(e.sep)if(e.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Kn(e.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Un(e.key)&&!Kn(e.sep,"newline")){const t=zn(e.start),n=e.key,r=e.sep;r.push(this.sourceToken),delete e.key,delete e.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:n,sep:r}]})}else r.length>0?e.sep=e.sep.concat(r,this.sourceToken):e.sep.push(this.sourceToken);else if(Kn(e.start,"newline"))Object.assign(e,{key:null,sep:[this.sourceToken]});else{const t=zn(e.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]})}else e.sep?e.value||n?t.items.push({start:r,key:null,sep:[this.sourceToken]}):Kn(e.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);return void(n||e.value?(t.items.push({start:r,key:i,sep:[]}),this.onKeyLine=!0):e.sep?this.stack.push(i):(Object.assign(e,{key:i,sep:[]}),this.onKeyLine=!0))}default:{const i=this.startBlockValue(t);if(i)return n&&"block-seq"!==i.type&&Kn(e.start,"explicit-key-ind")&&t.items.push({start:r}),void this.stack.push(i)}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const e=t.items[t.items.length-1];switch(this.type){case"newline":if(e.value){const n="end"in e.value?e.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else e.start.push(this.sourceToken);return;case"space":case"comment":if(e.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(e.start,t.indent)){const n=t.items[t.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,e.start),r.push(this.sourceToken),void t.items.pop()}e.start.push(this.sourceToken)}return;case"anchor":case"tag":if(e.value||this.indent<=t.indent)break;return void e.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==t.indent)break;return void(e.value||Kn(e.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken))}if(this.indent>t.indent){const e=this.startBlockValue(t);if(e)return void this.stack.push(e)}yield*this.pop(),yield*this.step()}*flowCollection(t){const e=t.items[t.items.length-1];if("flow-error-end"===this.type){let t;do{yield*this.pop(),t=this.peek(1)}while(t&&"flow-collection"===t.type)}else if(0===t.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!e||e.sep?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken));case"map-value-ind":return void(!e||e.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!e||e.value?t.items.push({start:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!e||e.value?t.items.push({start:[],key:n,sep:[]}):e.sep?this.stack.push(n):Object.assign(e,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void t.end.push(this.sourceToken)}const n=this.startBlockValue(t);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const e=this.peek(2);if("block-map"===e.type&&("map-value-ind"===this.type&&e.indent===t.indent||"newline"===this.type&&!e.items[e.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==e.type){const n=zn(qn(e));Wn(t);const r=t.end.splice(1,t.end.length);r.push(this.sourceToken);const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let t=this.source.indexOf("\n")+1;for(;0!==t;)this.onNewLine(this.offset+t),t=this.source.indexOf("\n",t)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const e=zn(qn(t));return e.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e}]}}case"map-value-ind":{this.onKeyLine=!0;const e=zn(qn(t));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,e){return"comment"===this.type&&!(this.indent<=e)&&t.every((t=>"newline"===t.type||"space"===t.type))}*documentEnd(t){"doc-mode"!==this.type&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function Hn(t,e={}){const{lineCounter:n,prettyErrors:r}=function(t){const e=!1!==t.prettyErrors;return{lineCounter:t.lineCounter||e&&new $n||null,prettyErrors:e}}(e),i=new Gn(n?.addNewLine),o=new Tn(e);let s=null;for(const e of o.compose(i.parse(t),!0,t.length))if(s){if("silent"!==s.options.logLevel){s.errors.push(new rn(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else s=e;return r&&n&&(s.errors.forEach(sn(t,n)),s.warnings.forEach(sn(t,n))),s}class Yn extends nn{constructor(t,e,n){super(t,e,"IMPOSSIBLE",n),this.name=t}pretty(t){this.linePos=t.lineCounter.linePos(this.pos);const{line:e,col:n}=this.linePos;this.message+=` at line ${e}, column ${n} ${t.file?" @"+t.file:""}`}}class Jn{constructor(){this.lineCounter=new $n,this.src="",this.txt="",this.errors=[],this.warnings=[],this.yaml_ok=!1,this.contents=null,this.listener=null,this.prog={}}errors(t){this.errors=this.errors.concat(t)}warnings(t){this.warnings=this.warnings.concat(t)}fileError(t){let e=new Yn("FILE_ERROR",0,`FileError : ${t}`);return this.errors.push(e),e}syntaxError(t,e){let n=new Yn("SYNTAX_ERROR",t.range?t.range[0]:0,`SyntaxError : ${e}`);return this.errors.push(n),n}syntaxWarning(t,e){let n=new Yn("SYNTAX_WARNING",t.range?t.range[0]:0,`SyntaxWarning : ${e}`);return this.warnings.push(n),n}typeError(t,e){let n=new Yn("TYPE_ERROR",t.range?t.range[0]:0,`TypeError : ${e}`);return this.errors.push(n),n}grammarError(t){let e=new Yn("GRAMMAR_ERROR",0,`GrammarError : ${t}`);this.errors.push(e)}grammarWarning(t){let e=new Yn("GRAMMAR_WARNING",0,`GrammarWarning : ${t}`);return this.warnings.push(e),e}fails(){return this.errors.length>0}success(){return 0==this.errors.length&&0==this.warnings.length}result(){return this.contents}}class Xn{constructor(t,e,n){this.ctx=t,this.type=e,this.current=n,this.start=n.range[0],this.end=n.range[1],this.childs=[]}getChild(t){return this.childs[t]}getChildCount(){return this.childs.length}getValue(){return this.value}toString(){return this.value}}class Qn extends Xn{constructor(t,e,n){super(t,e,n)}equals(t){if(t instanceof Qn)return this.value==t.value;this.ctx.syntaxError(this.current,`Error can not compare values '${this.value}' and '${t.value}'`)}}class Zn extends Qn{constructor(t,e){if(super(t,"string",e),!Zn.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a string`);this.value=e.value}static checkCurrent(t){return W(t)&&"string"==typeof t.value}static parse(t,e){try{return new Zn(t,e)}catch(t){return null}}}class tr extends Qn{constructor(t,e){if(super(t,"binary",e),!tr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a base64 string`);this.value=e.value}static checkCurrent(t){return W(t)&&"string"==typeof t.value&&/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(t.value)}static parse(t,e){try{return new tr(t,e)}catch(t){return null}}}class er extends Qn{constructor(t,e){if(super(t,"int",e),!er.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not an integer`);this.value=e.value}static checkCurrent(t){return W(t)&&"number"==typeof t.value&&t.value==Math.floor(t.value)}static parse(t,e){try{return new er(t,e)}catch(t){return null}}}class nr extends Qn{constructor(t,e){if(super(t,"float",e),!nr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a number`);this.value=e.value}static checkCurrent(t){return W(t)&&"number"==typeof t.value}static parse(t,e){try{return new nr(t,e)}catch(t){return null}}}class rr extends Qn{constructor(t,e){if(super(t,"boolean",e),this.value=null,!rr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e.value}' is not a boolean`);this.value=e.value}static checkCurrent(t){return W(t)&&"boolean"==typeof t.value}static parse(t,e){try{return new rr(t,e)}catch(t){return null}}}class ir extends Qn{constructor(t,e){if(super(t,"null",e),this.value=null,!ir.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not the null value`)}static checkCurrent(t){return W(t)&&(null==t.value||["Null","NULL","null","~"].includes(t.value))}static parse(t,e){try{return new ir(t,e)}catch(t){return null}}}class or extends Qn{constructor(t,e,n){if(super(t,"timestamp",e),!or.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a timestamp in ISO9601 format`);this.value=new Date(e.value)}static checkCurrent(t){let e=W(t)&&"string"==typeof t.value&&/\d{4}-\d{2}-\d{2}|\d{4}-\d{2}?-\d{2}?([Tt]|[ \t]+)\d{2}?:\d{2}:\d{2}(\.\d*)?(([ \t]*)Z|[-+]\d\d?(:\d{2})?)?/.test(t.value);if(1==e)try{new Date(t.value)}catch(t){e=!1}return e}static parse(t,e){try{return new or(t,e)}catch(t){return null}}equals(t){return t instanceof or?this.value.getTime()==t.value.getTime():this.ctx.syntaxError("Error : can not compare a timestamp with something else")}}class sr extends Xn{constructor(t,e,n){super(t,e,n)}length(){return this.childs.length}isEmpty(){return 0==this.length()}}class ar extends sr{constructor(t,e,n){if(super(t,"map",e),"object"!=typeof n||n instanceof Array)throw t.syntaxError(e,"Erorr : MapNode must be initialized with a parsed map. This should not happen.");this.value=n;for(const t in n)this.childs.push(n[t])}static checkCurrent(t){return q(t)&&t.items.every((t=>t.key&&W(t.key)&&"string"==typeof t.key.value))}}class cr{static parse(t,e,n){"object"!=typeof e&&t.grammarError("Error: oneof rule can not be parsed'");let r=e._oneOf;if(r instanceof Array){let e=[].concat(t.errors),i=[].concat(t.warnings),o=t.errors.length;for(let s of r){let r=wr(t,null,s,n);if(o==t.errors.length)return t.errors=e,t.warnings=i,r;o=t.errors.length}return t.syntaxError(n,"Syntax Error : no valid alternative found during parsing"),null}t.grammarError("Error: _oneof rules expects a sequence of alternatives")}}var lr="undefined"!=typeof Symbol;function ur(t){var e=typeof t;return"string"===e||"number"===e||"boolean"===e||!0===lr&&"symbol"===e||null==t||!0===lr&&t instanceof Symbol||t instanceof String||t instanceof Number||t instanceof Boolean}class fr{static parse(t,e){if("object"==typeof e){if(e._oneOf){let n;!e._oneOf instanceof Array&&t.grammarError("Error : _oneof value have to be a list"),e._oneOf=e._oneOf.map((e=>fr.parse(t,e)));do{if(n=e._oneOf.findIndex((t=>t._oneOf)),n>=0){let t=e._oneOf[n]._oneOf;(e={_oneOf:[].concat(e._oneOf)})._oneOf.splice(n,1),e._oneOf=e._oneOf.concat(t)}}while(n>=0);return e}if(e._merge){if(!(e._merge instanceof Array))return t.grammarError("Error : _merge value have to be a map"),null;const{_merge:n,...r}=e;let i;e={_merge:e._merge},Object.keys(r).length&&e._merge.push(r),e._merge=e._merge.map((e=>ur(e)&&t.rules[e]?t.rules[e]:e)),e._merge=e._merge.map((e=>fr.parse(t,e)));do{if(i=e._merge.findIndex((t=>t._merge)),i>=0){let t=e.one._merge;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),e._merge=e._merge.concat(t)}}while(i>=0);let o={_oneOf:[]};do{if(i=(e={_merge:[].concat(e._merge)})._merge.findIndex((t=>t._oneOf)),i>=0){let t=e._merge[i]._oneOf;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),t.forEach((t=>{let n={_merge:[t].concat(e._merge)};o._oneOf.push(n)}))}}while(i>=0);if(o._oneOf.length>=1)return fr.parse(t,o);e._merge.some((t=>t._merge||t._oneOf))&&t.grammarError("Error : merge has not been processed successfully. This error should not occur.");let s={},a={},c=null,l=-1,u=-1,f=-1;e._merge.forEach((e=>{if(e._map){s={...s};for(let n in e._map)s.key&&t.grammarError("Error : can not merge two maps with some identical keys"),s[n]=e._map[n]}if(e._mapFacultative){a={...a};for(let n in e._mapFacultative)a.key&&t.grammarError("Error : can not merge two maps with some identical keys"),a[n]=e._mapFacultative[n]}if(e._mapOf){if(null!=c)return t.grammarError("Error : only one '_mapOf' is allowed in a '_merge' clause"),null;c=e._mapOf}e._nb&&(l<0||l==e._nb?l=e._nb:t.grammarError("Contradictory sizing in merge clause")),e._min&&(u=Math.max(e._min,u)),e._max&&(nax=l>0?Math.min(e._max,f):e._max)}));let h={};return l>=0&&(h._nb=l),u>=0&&(h._min=u),f>=0&&(h._max=f),Object.keys(s).length>0&&(h._map=s),Object.keys(a).length>0&&(h._mapFacultative=a),null!=c&&(h._mapOf=c),h}if(e._map){let n={};for(const r in e._map)n[r]=fr.parse(t,e._map[r]);e._map=n}if(e._mapFacultative){let n={};for(const r in e._mapFacultative)n[r]=fr.parse(t,e._mapFacultative[r]);e._mapFacultative=n}if(e._mapOf){let n={};for(const r in e._mapOf){let i=fr.parse(t,r),o=fr.parse(t,e._mapOf[r]);n[i]=o}e._mapOf=n}e._list&&(e._list=e._list.map((e=>fr.parse(t,e)))),e._listFacultative&&(e._listFacultative=e._listFacultative.map((e=>fr.parse(t,e)))),e._listOf&&(e._listOf=fr.parse(t,e._listOf))}return e}}class hr{static isPositiveInt(t){return"number"==typeof t&&t==Math.floor(t)&&t>0}static sizeChecker(t,e,n,r){if(hr.isPositiveInt(n))if(q(r)||G(r))switch(e){case"eq":return r.items.length==n;case"min":return r.items.length>=n;case"max":return r.items.length<=n}else t.syntaxError(r,"Error : a map is expected");else t.grammarError(`Error: the map checker '${e}' does not have a positive integer as value`);return!1}static sizeCheckers(t,e,n){return null==e._nb||hr.sizeChecker(t,"eq",e._nb,n)?null==e._min||hr.sizeChecker(t,"min",e._min,n)?!(null!=e._max&&!hr.sizeChecker(t,"max",e._max,n)&&(t.syntaxError(n,`Error : map expected with more than ${e._max} elements but ${n.items.length} are provided`),1)):(t.syntaxError(n,`Error : map expected with more than ${e._min} elements but ${n.items.length} are provided`),!1):(t.syntaxError(n,`Error : map expected with ${e._nb} elements but ${n.items.length} are provided`),!1)}}class pr{static parse(t,e,n){if(!ar.checkCurrent(n))return t.syntaxError(n,"Error : a map whose keys are strings is expected "),null;if(e._merge&&(e=fr.parse(t,e))._oneOf)return cr.parse(t,e,n);let r=e._map,i=e._mapOf,o=e._mapFacultative;if(null!=i&&"object"!=typeof i||null!=o&&"object"!=typeof o)return t.grammarError("Error : error in map value definition"),null;if(!hr.sizeCheckers(t,e,n))return null;if(null!=r)for(let e in r){if("string"!=typeof e)return t.grammarError("Error : error in map definition"),null;if(!n.has(e))return t.syntaxError(n,`Error : key '${e}' not found in current value`),null}let s,a=null;if(i){let t=Object.entries(i);1==t.length&&([[s,a]]=t)}let c={};for(let i of n.items){let n=i.key.value,l=i.value,u=null;if(r&&r[n])u=wr(t,null,r[n],l);else if(o&&o[n])u=wr(t,null,o[n],l);else{if(!s||!a)return t.syntaxError(l,`Error : '${n}' is not a valid key (in rule : ${JSON.stringify(e)})`),null;{let e=wr(t,null,s,i.key);if(u=wr(t,null,a,l),e.value!=n)return t.syntaxError(n,`Error : '${n}' does not match expected '${s}' type`),null}}if(null==u)return t.syntaxError(l,`Error : bad value '${l}'found for '${n}' (mapparser.parse)`),null;let f=new Zn(t,i.key);if(u.key=f,null!=c[n])return t.syntaxError(l,`Error : more than one value provided in the map for the key '${n}'`),null;c[n]=u}return new ar(t,n,c)}static parse_any(t,e){if(!ar.checkCurrent(e))return t.syntaxError(e,"Error : a map whose keys are strings is expected "),null;let n={};return e.items.forEach((e=>{let r=e.key.value,i=e.value,o=yr.parse_any(t,i);if(null==o)return t.syntaxError(i,`Error : bad value '${i}' found for '${r}' (mapparser.parse_any)`),null;let s=new Zn(t,e.key);o.key=s,null!=n[r]&&t.syntaxError(i,`Error : more than one value provided in the map for the key '${r}'`),n[r]=o})),new ar(t,e,n)}}class dr extends sr{constructor(t,e,n){if(super(t,"list",e),!n instanceof Array)throw t.syntaxError(e,"Erorr : ListNode must be initialized with an array. This should not happen.");this.value=n,this.childs=this.value}static checkCurrent(t){return G(t)}}class mr{static parse(t,e,n){if(!dr.checkCurrent(n))return t.syntaxError(n,"Error : a list is expected "),null;if(!hr.sizeCheckers(t,e,n))return null;let r=e._list,i=e._listOf,o=e._listFacultative;if(null!=r&&!(r instanceof Array)||null!=o&&!(o instanceof Array))return t.grammarError("Error : error in list value definition"),null;let s=0,a=n.items.length,c=[];r&&r.forEach((e=>{if(!(s{if(s{let r=yr.parse_any(t,e);if(null==r)return t.SyntaxError(value,`Error : bad value '${value}' found for '${key}' (listparser.parse_any)`),null;n.push(r)})),new dr(t,e,n)}}class yr{static parse(t,e,n){switch(e){case"string":return Zn.parse(t,n);case"binary":return tr.parse(t,n);case"timestamp":return or.parse(t,n);case"int":return er.parse(t,n);case"float":return nr.parse(t,n);case"boolean":return rr.parse(t,n);case"null":return ir.parse(t,n);case"any":return yr.parse_any(t,n);default:return _r(t,e,n)}}static parse_any(t,e){if(W(e)){switch(typeof e.value){case"number":return er.checkCurrent(e)?er.parse(t,e):nr.parse(t,e);case"boolean":return rr.parse(t,e);case"string":return Zn.parse(t,e);case"object":if(null==e.value)return ir.parse(t,e);t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`);default:t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`)}return null}return q(e)?pr.parse_any(t,e):G(e)?mr.parse_any(t,e):null}}class vr{static parse(t,e,n){"object"==typeof e&&e._in||t.grammarError("Error: can not parse _in rule'");let r=e._in;if(!(r instanceof Array))return t.grammarError("Error: _in rules expects a sequence of alternatives"),null;for(let e of r)if(!ur(e))return t.grammarError("Error: _in rules expects each alternative to be a scalar"),null;if(!W(n))return t.syntaxError(n,"Syntax Error : scalar value expected by rule '_in'"),null;let i=yr.parse_any(t,n);if(i){let e=[].concat(t.errors),n=[].concat(t.warnings),o=t.errors.length,s=i.value;for(let a of r)if(a){let r=a==s?i:null;if(null!=r)return t.errors=e,t.warnings=n,r;o=t.errors.length}}return t.syntaxError(n,"Syntax Error : no valid alternative for '_in' rule found during parsing"),null}}class gr{static parse(t,e,n){if(!Zn.checkCurrent(n))return t.syntaxError(n,`Error: regular expressions match only strings, '${n?n.value:""}' is not a string`),null;let r=e._regex;if(null==r)return t.grammarError("Error : regep rule must have a value for key '_regex'"),null;let i=null;try{i=new RegExp(r)}catch(t){}return null==i?(t.grammarError(`Error: value '${i}' is not a valid regular expression`),null):i.test(n.value)?new Zn(t,n):(t.syntaxError(n,`Error: value '${n.value}' does not match the regular expression '${i}'`),null)}}class br{static scalartypes=["string","int","float","null","boolean","binary","timestamp"];static keywords=["_map","_mapOf","_mapFacultative","_list","_listOf","_listFacultative","_oneOf","_regex","_nb","_min","_max","_in"];static parse(t,e,n,r){if(null==r)return t.fileError("No source to parse"),null;if(br.scalartypes.includes(e)||br.keywords.includes(e))return t.syntaxError(r,`'${e}' is not allowed as rule_name in Lidy Grammar (reserved keyword)`),null;let i="enter_"+e;r.ctx=t,t.listener&&t.listener[i]&&t.listener[i](r);let o=wr(t,null,n,r),s="exit_"+e;return"node_template"==e&&console.log("Sortie de node_template"),t.listener&&t.listener[s]&&t.listener[s](o),o}}function wr(t,e,n,r){if(e)return br.parse(t,e,n,r);if(ur(n))return yr.parse(t,n,r);if("object"==typeof n){if(n._map||n._mapOf||n._mapFacultative||n._merge)return pr.parse(t,n,r);if(n._list||n._listOf||n._listFacultative)return mr.parse(t,n,r);if(n._oneOf)return cr.parse(t,n,r);if(n._regex)return gr.parse(t,n,r);if(n._in)return vr.parse(t,n,r)}return t.grammarError("Error : grammar error : no valid keyword found"),null}function _r(t,e,n){let r=t.rules[e];return void 0!==r?wr(t,e,r,n):(t.grammarError(`no rule named ${e} found.`),null)}function kr(t){t.keyword||(t.keyword="main");let e=new Jn;return e.prog=t.prog,t.rules?e.rules=t.rules:function(t,e,n){try{t.rules=function(t,e,n){let r;const i=Hn(t,n);if(!i)return null;if(i.warnings.forEach((t=>Vt(i.options.logLevel,t))),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}(e)}catch(e){throw t.errors.push(e),t.grammarError("ERROR : can not parse dsl ")}if("object"==(t.rules,!1))throw t.grammarError("ERROR : can not parse dsl ");if(!t.rules[n])throw Error("ERROR : no rule labeled '"+n+"' in the grammar")}(e,t.dsl_data,t.keyword),e.listener=t.listener,function(t,e){t.lineCounter=new $n;let n=Hn(e,{lineCounter:t.lineCounter});n||t.fileError("can not parse the provided source code."),t.src=n.contents,t.txt=e,t.errors=n.errors,t.warnings=n.warnings,t.yaml_ok=0==t.errors.length&&0==t.warnings.length}(e,t.src_data),function(t,e,n){let r=_r(t,e,n);return t.errors.filter((t=>t instanceof Yn)).forEach((e=>e.pretty(t))),t.warnings.filter((t=>t instanceof Yn)).forEach((e=>e.pretty(t))),t.contents=r,t}(e,t.keyword,e.src)}var Er={main:"workflow",workflow:{_mapFacultative:{name:"WorkflowName",on:{_mapFacultative:{push:"PushTrigger",pull_request:"PullRequestTrigger"}},jobs:{_mapOf:{JobId:"Job"}}}},WorkflowName:"string",PushTrigger:{_map:{branches:"PushTriggerBranches"}},PushTriggerBranches:{_listOf:"string"},PullRequestTrigger:{_map:{types:"PullRequestTriggerTypes"}},PullRequestTriggerTypes:{_listOf:"string"},Job:{_mapFacultative:{name:"JobName","runs-on":"JobRunsOn",needs:"JobNeeds",steps:{_listOf:"Step"}}},JobId:"string",JobName:"string",JobRunsOn:"string",JobNeeds:{_listOf:"string"},Step:{_oneOf:["CommandStep","ReusableStep"]},ReusableStep:{_map:{uses:"StepUses"},_mapFacultative:{name:"StepName",with:"StepWith",env:"StepEnv"}},CommandStep:{_map:{run:"StepRun"},_mapFacultative:{name:"StepName",env:"StepEnv"}},StepUses:"string",StepName:"string",StepRun:"string",StepWith:{_mapOf:{StepMapKey:"StepMapValue"}},StepEnv:{_mapOf:{StepMapKey:"StepMapValue"}},StepMapKey:"string",StepMapValue:{_oneOf:["int","float","string"]}};function xr(t){return xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xr(t)}function Or(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.pluginData.components=[],this.pluginData.parseErrors=[],n.filter((function(e){var n=e.path;return t.path===n})).filter((function(t){var n=t.path,i=t.content;return!(!i||""===i.trim())||(e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"warning",files:[n],data:{code:"no_content",global:!1}}),!1)})).forEach((function(t,n){var i=e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[t.path],data:{global:!1}}),o=new I(t,e.pluginData.definitions.components,"workflow_".concat(n+1));!function(t){t.rules=Er,kr(t)}({src_data:t.content,listener:o,path:t.path,prog:{errors:[],warnings:[],imports:[],alreadyImported:[],root:[]}}),o.components.forEach((function(t){return e.pluginData.components.push(t)})),e.pluginData.emitEvent({id:i,status:"success"})}))}}],n&&Or(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(t.DefaultParser);var Nr=n(985),Cr=n.n(Nr);const jr={root:"name: {{ workflowName.value }}\n\n{% if triggers.length > 0 %}\non:\n{% for trigger in triggers %}\n{% if trigger.definition.action === 'push' %}{% set branches = getTriggerAttribute(trigger, 'branches').value %}\n push:\n branches: [{% if branches.length > 0 %}{{ branches.join(', ') }}{% endif %}]\n{% else %}{% set types = getTriggerAttribute(trigger, 'types').value %}\n pull_request:\n types: [{% if types.length > 0 %}{{ types.join(', ') }}{% endif %}]\n{% endif %}\n{% endfor %}\n{% endif %}\n\njobs:\n{% for job in jobs %}\n {{ job.id }}:\n{% for attribute in getAttributes(job) %}\n {% if attribute.type === 'Array' %}\n {{attribute.name}}: [{{ attribute.value.join(', ')}}]\n {% else %}\n {{attribute.name}}: {{attribute.value }}\n {% endif %}\n{% endfor %}\n{% if getSteps(job.id).length > 0 %}\n steps:\n{% for step in getSteps(job.id) %}\n{% for attribute in getAttributes(step) %}\n{% if attribute.type === 'Array' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: [{{ attribute.value.join(', ')}}]\n{% elif attribute.type === 'Object' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}:\n{% for value in attribute.value %}\n{{value.name | indent(10,true)}}: {% if value.type == 'Number' and value.value == null %}0{% else %}{{ value.value }}{% endif %}\n\n{% endfor %}\n{% else %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: {{ attribute.value }}\n{% endif %}\n{% endfor %}\n{% endfor %}\n\n{% endif %}\n{% endfor %}"};function Pr(t){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(t)}function Ir(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,i=[];return e.forEach((function(e,o){var s=n.pluginData.emitEvent({parent:r,type:"Render",action:"write",status:"running",files:[o],data:{global:!1}}),a=e.find((function(t){return"workflow"===t.definition.type})),c=e.filter((function(t){return"trigger"===t.definition.type})),l=e.filter((function(t){return"step"===t.definition.type})),u="".concat(n.template.render({workflow:a,workflowName:null==a?void 0:a.attributes.find((function(t){return"name"===t.name})),triggers:c,jobs:e.filter((function(t){return"job"===t.definition.type})),getAttributes:function(t){return t.attributes.filter((function(t){var e=t.name;return"workflow_id"!==e&&"job_id"!==e}))},getTriggerAttribute:function(t,e){return t.attributes.find((function(t){return t.name===e}))},getSteps:function(t){return l.filter((function(e){return e.attributes.some((function(e){var n=e.name,r=e.value;return"job_id"===n&&r===t}))}))}}).trim(),"\n");i.push(new t.FileInput({path:o,content:u})),n.pluginData.emitEvent({id:s,status:"success"})})),i}}],r&&Ir(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),a}(t.DefaultRender);const Fr=Dr,$r=JSON.parse('{"u2":"githubator-plugin","i8":"0.2.1"}'),Kr={name:"githubAction",languageSettings:{id:"githubAction",extensions:[".yml",".yaml"],aliases:["githubaction","Githubaction","githubAction","GithubAction"],mimetypes:["string"]},languageConfiguration:{comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],colorizedBracketPairs:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"(",close:")"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"'",close:"'",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{offSide:!0}},tokenProvider:{tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?\d+)/,numberFloat:/(?:0|[+-]?\d+)(?:\.\d+)?(?:e[-+][1-9]\d*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,{[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|]\d*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]}])/,"number"],[/@numberFloat(?=[ \t]*[,\]}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]}])/,"number.date"]],tagHandle:[[/![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}}};function Vr(t){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vr(t)}function Ur(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qr(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{event:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var n=new Yr({defaultFileName:"new_workflow.yml",defaultFileExtension:"yml"}),r=new t.DefaultData(n,{name:$r.u2,version:$r.i8},e.event);return o.call(this,{configuration:n,pluginData:r,pluginDrawer:new u(r),pluginMetadata:new N(r),pluginParser:new Lr(r),pluginRenderer:new Fr(r)})}return n=s,Object.defineProperty(n,"prototype",{writable:!1}),n}(t.DefaultPlugin)})();var i=exports;for(var o in r)i[o]=r[o];r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9d67dae..236b75a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "githubator-plugin", - "version": "0.2.0", + "version": "0.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "githubator-plugin", - "version": "0.2.0", + "version": "0.2.1", "license": "Mozilla Public License 2.0", "dependencies": { "leto-modelizer-plugin-core": "github:ditrit/leto-modelizer-plugin-core#0.17.0", diff --git a/package.json b/package.json index 2a5f0b0..add29d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "githubator-plugin", - "version": "0.2.0", + "version": "0.2.1", "description": "Github action plugin for Leto modelizer.", "main": "dist/githubator-plugin.js", "exports": "./dist/githubator-plugin.js",