fjall 27.0.0 → 27.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __fjcreateRequire } from "module";
2
2
  const require = __fjcreateRequire(import.meta.url);
3
3
 
4
- var Uz=Object.create;var yd=Object.defineProperty;var zz=Object.getOwnPropertyDescriptor;var Bz=Object.getOwnPropertyNames;var Gz=Object.getPrototypeOf,Vz=Object.prototype.hasOwnProperty;var UC=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var zC=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var H=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Lr=(e,t)=>{for(var r in t)yd(e,r,{get:t[r],enumerable:!0})},BC=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Bz(t))!Vz.call(e,n)&&n!==r&&yd(e,n,{get:()=>t[n],enumerable:!(i=zz(t,n))||i.enumerable});return e};var lc=(e,t,r)=>(r=e!=null?Uz(Gz(e)):{},BC(t||!e||!e.__esModule?yd(r,"default",{value:e,enumerable:!0}):r,e)),Q=e=>BC(yd({},"__esModule",{value:!0}),e);var ij=H((xue,Uf)=>{var N$,w$,P$,R$,O$,$$,j$,M$,L$,F$,U$,z$,B$,Lf,__,G$,V$,W$,ds,K$,Z$,H$,J$,X$,q$,Y$,Q$,ej,Ff,tj,rj,nj;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){e(r(t,r(i)))}):typeof Uf=="object"&&typeof Uf.exports=="object"?e(r(t,r(Uf.exports))):e(r(t));function r(i,n){return i!==t&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(a,o){return i[a]=n?n(a,o):o}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(a[s]=o[s])};N$=function(a,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(a,o);function s(){this.constructor=a}a.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)},w$=Object.assign||function(a){for(var o,s=1,l=arguments.length;s<l;s++){o=arguments[s];for(var m in o)Object.prototype.hasOwnProperty.call(o,m)&&(a[m]=o[m])}return a},P$=function(a,o){var s={};for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&o.indexOf(l)<0&&(s[l]=a[l]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var m=0,l=Object.getOwnPropertySymbols(a);m<l.length;m++)o.indexOf(l[m])<0&&Object.prototype.propertyIsEnumerable.call(a,l[m])&&(s[l[m]]=a[l[m]]);return s},R$=function(a,o,s,l){var m=arguments.length,d=m<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(a,o,s,l);else for(var g=a.length-1;g>=0;g--)(h=a[g])&&(d=(m<3?h(d):m>3?h(o,s,d):h(o,s))||d);return m>3&&d&&Object.defineProperty(o,s,d),d},O$=function(a,o){return function(s,l){o(s,l,a)}},$$=function(a,o,s,l,m,d){function h(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var g=l.kind,u=g==="getter"?"get":g==="setter"?"set":"value",p=!o&&a?l.static?a:a.prototype:null,f=o||(p?Object.getOwnPropertyDescriptor(p,l.name):{}),y,v=!1,b=s.length-1;b>=0;b--){var _={};for(var A in l)_[A]=A==="access"?{}:l[A];for(var A in l.access)_.access[A]=l.access[A];_.addInitializer=function(C){if(v)throw new TypeError("Cannot add initializers after decoration has completed");d.push(h(C||null))};var x=(0,s[b])(g==="accessor"?{get:f.get,set:f.set}:f[u],_);if(g==="accessor"){if(x===void 0)continue;if(x===null||typeof x!="object")throw new TypeError("Object expected");(y=h(x.get))&&(f.get=y),(y=h(x.set))&&(f.set=y),(y=h(x.init))&&m.unshift(y)}else(y=h(x))&&(g==="field"?m.unshift(y):f[u]=y)}p&&Object.defineProperty(p,l.name,f),v=!0},j$=function(a,o,s){for(var l=arguments.length>2,m=0;m<o.length;m++)s=l?o[m].call(a,s):o[m].call(a);return l?s:void 0},M$=function(a){return typeof a=="symbol"?a:"".concat(a)},L$=function(a,o,s){return typeof o=="symbol"&&(o=o.description?"[".concat(o.description,"]"):""),Object.defineProperty(a,"name",{configurable:!0,value:s?"".concat(s," ",o):o})},F$=function(a,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,o)},U$=function(a,o,s,l){function m(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function g(f){try{p(l.next(f))}catch(y){h(y)}}function u(f){try{p(l.throw(f))}catch(y){h(y)}}function p(f){f.done?d(f.value):m(f.value).then(g,u)}p((l=l.apply(a,o||[])).next())})},z$=function(a,o){var s={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},l,m,d,h=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return h.next=g(0),h.throw=g(1),h.return=g(2),typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function g(p){return function(f){return u([p,f])}}function u(p){if(l)throw new TypeError("Generator is already executing.");for(;h&&(h=0,p[0]&&(s=0)),s;)try{if(l=1,m&&(d=p[0]&2?m.return:p[0]?m.throw||((d=m.return)&&d.call(m),0):m.next)&&!(d=d.call(m,p[1])).done)return d;switch(m=0,d&&(p=[p[0]&2,d.value]),p[0]){case 0:case 1:d=p;break;case 4:return s.label++,{value:p[1],done:!1};case 5:s.label++,m=p[1],p=[0];continue;case 7:p=s.ops.pop(),s.trys.pop();continue;default:if(d=s.trys,!(d=d.length>0&&d[d.length-1])&&(p[0]===6||p[0]===2)){s=0;continue}if(p[0]===3&&(!d||p[1]>d[0]&&p[1]<d[3])){s.label=p[1];break}if(p[0]===6&&s.label<d[1]){s.label=d[1],d=p;break}if(d&&s.label<d[2]){s.label=d[2],s.ops.push(p);break}d[2]&&s.ops.pop(),s.trys.pop();continue}p=o.call(a,s)}catch(f){p=[6,f],m=0}finally{l=d=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},B$=function(a,o){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&Ff(o,a,s)},Ff=Object.create?(function(a,o,s,l){l===void 0&&(l=s);var m=Object.getOwnPropertyDescriptor(o,s);(!m||("get"in m?!o.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(a,l,m)}):(function(a,o,s,l){l===void 0&&(l=s),a[l]=o[s]}),Lf=function(a){var o=typeof Symbol=="function"&&Symbol.iterator,s=o&&a[o],l=0;if(s)return s.call(a);if(a&&typeof a.length=="number")return{next:function(){return a&&l>=a.length&&(a=void 0),{value:a&&a[l++],done:!a}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},__=function(a,o){var s=typeof Symbol=="function"&&a[Symbol.iterator];if(!s)return a;var l=s.call(a),m,d=[],h;try{for(;(o===void 0||o-- >0)&&!(m=l.next()).done;)d.push(m.value)}catch(g){h={error:g}}finally{try{m&&!m.done&&(s=l.return)&&s.call(l)}finally{if(h)throw h.error}}return d},G$=function(){for(var a=[],o=0;o<arguments.length;o++)a=a.concat(__(arguments[o]));return a},V$=function(){for(var a=0,o=0,s=arguments.length;o<s;o++)a+=arguments[o].length;for(var l=Array(a),m=0,o=0;o<s;o++)for(var d=arguments[o],h=0,g=d.length;h<g;h++,m++)l[m]=d[h];return l},W$=function(a,o,s){if(s||arguments.length===2)for(var l=0,m=o.length,d;l<m;l++)(d||!(l in o))&&(d||(d=Array.prototype.slice.call(o,0,l)),d[l]=o[l]);return a.concat(d||Array.prototype.slice.call(o))},ds=function(a){return this instanceof ds?(this.v=a,this):new ds(a)},K$=function(a,o,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=s.apply(a,o||[]),m,d=[];return m=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),g("next"),g("throw"),g("return",h),m[Symbol.asyncIterator]=function(){return this},m;function h(b){return function(_){return Promise.resolve(_).then(b,y)}}function g(b,_){l[b]&&(m[b]=function(A){return new Promise(function(x,C){d.push([b,A,x,C])>1||u(b,A)})},_&&(m[b]=_(m[b])))}function u(b,_){try{p(l[b](_))}catch(A){v(d[0][3],A)}}function p(b){b.value instanceof ds?Promise.resolve(b.value.v).then(f,y):v(d[0][2],b)}function f(b){u("next",b)}function y(b){u("throw",b)}function v(b,_){b(_),d.shift(),d.length&&u(d[0][0],d[0][1])}},Z$=function(a){var o,s;return o={},l("next"),l("throw",function(m){throw m}),l("return"),o[Symbol.iterator]=function(){return this},o;function l(m,d){o[m]=a[m]?function(h){return(s=!s)?{value:ds(a[m](h)),done:!1}:d?d(h):h}:d}},H$=function(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=a[Symbol.asyncIterator],s;return o?o.call(a):(a=typeof Lf=="function"?Lf(a):a[Symbol.iterator](),s={},l("next"),l("throw"),l("return"),s[Symbol.asyncIterator]=function(){return this},s);function l(d){s[d]=a[d]&&function(h){return new Promise(function(g,u){h=a[d](h),m(g,u,h.done,h.value)})}}function m(d,h,g,u){Promise.resolve(u).then(function(p){d({value:p,done:g})},h)}},J$=function(a,o){return Object.defineProperty?Object.defineProperty(a,"raw",{value:o}):a.raw=o,a};var r=Object.create?(function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}):function(a,o){a.default=o},i=function(a){return i=Object.getOwnPropertyNames||function(o){var s=[];for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(s[s.length]=l);return s},i(a)};X$=function(a){if(a&&a.__esModule)return a;var o={};if(a!=null)for(var s=i(a),l=0;l<s.length;l++)s[l]!=="default"&&Ff(o,a,s[l]);return r(o,a),o},q$=function(a){return a&&a.__esModule?a:{default:a}},Y$=function(a,o,s,l){if(s==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?a!==o||!l:!o.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?l:s==="a"?l.call(a):l?l.value:o.get(a)},Q$=function(a,o,s,l,m){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!m)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?a!==o||!m:!o.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?m.call(a,s):m?m.value=s:o.set(a,s),s},ej=function(a,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof a=="function"?o===a:a.has(o)},tj=function(a,o,s){if(o!=null){if(typeof o!="object"&&typeof o!="function")throw new TypeError("Object expected.");var l,m;if(s){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");l=o[Symbol.asyncDispose]}if(l===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");l=o[Symbol.dispose],s&&(m=l)}if(typeof l!="function")throw new TypeError("Object not disposable.");m&&(l=function(){try{m.call(this)}catch(d){return Promise.reject(d)}}),a.stack.push({value:o,dispose:l,async:s})}else s&&a.stack.push({async:!0});return o};var n=typeof SuppressedError=="function"?SuppressedError:function(a,o,s){var l=new Error(s);return l.name="SuppressedError",l.error=a,l.suppressed=o,l};rj=function(a){function o(d){a.error=a.hasError?new n(d,a.error,"An error was suppressed during disposal."):d,a.hasError=!0}var s,l=0;function m(){for(;s=a.stack.pop();)try{if(!s.async&&l===1)return l=0,a.stack.push(s),Promise.resolve().then(m);if(s.dispose){var d=s.dispose.call(s.value);if(s.async)return l|=2,Promise.resolve(d).then(m,function(h){return o(h),m()})}else l|=1}catch(h){o(h)}if(l===1)return a.hasError?Promise.reject(a.error):Promise.resolve();if(a.hasError)throw a.error}return m()},nj=function(a,o){return typeof a=="string"&&/^\.\.?\//.test(a)?a.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(s,l,m,d,h){return l?o?".jsx":".js":m&&(!d||!h)?s:m+d+"."+h.toLowerCase()+"js"}):a},e("__extends",N$),e("__assign",w$),e("__rest",P$),e("__decorate",R$),e("__param",O$),e("__esDecorate",$$),e("__runInitializers",j$),e("__propKey",M$),e("__setFunctionName",L$),e("__metadata",F$),e("__awaiter",U$),e("__generator",z$),e("__exportStar",B$),e("__createBinding",Ff),e("__values",Lf),e("__read",__),e("__spread",G$),e("__spreadArrays",V$),e("__spreadArray",W$),e("__await",ds),e("__asyncGenerator",K$),e("__asyncDelegator",Z$),e("__asyncValues",H$),e("__makeTemplateObject",J$),e("__importStar",X$),e("__importDefault",q$),e("__classPrivateFieldGet",Y$),e("__classPrivateFieldSet",Q$),e("__classPrivateFieldIn",ej),e("__addDisposableResource",tj),e("__disposeResources",rj),e("__rewriteRelativeImportExtension",nj)})});var le={};Lr(le,{__addDisposableResource:()=>GH,__assign:()=>hH,__asyncDelegator:()=>$H,__asyncGenerator:()=>OH,__asyncValues:()=>jH,__await:()=>RH,__awaiter:()=>_H,__classPrivateFieldGet:()=>UH,__classPrivateFieldIn:()=>BH,__classPrivateFieldSet:()=>zH,__createBinding:()=>DH,__decorate:()=>yH,__disposeResources:()=>VH,__esDecorate:()=>bH,__exportStar:()=>CH,__extends:()=>fH,__generator:()=>TH,__importDefault:()=>FH,__importStar:()=>LH,__makeTemplateObject:()=>MH,__metadata:()=>xH,__param:()=>vH,__propKey:()=>EH,__read:()=>kH,__rest:()=>gH,__rewriteRelativeImportExtension:()=>WH,__runInitializers:()=>SH,__setFunctionName:()=>AH,__spread:()=>NH,__spreadArray:()=>PH,__spreadArrays:()=>wH,__values:()=>IH,default:()=>KH});var T_,fH,hH,gH,yH,vH,bH,SH,EH,AH,xH,_H,TH,CH,DH,IH,kH,NH,wH,PH,RH,OH,$H,jH,MH,LH,FH,UH,zH,BH,GH,VH,WH,KH,ue=zC(()=>{T_=lc(ij(),1),{__extends:fH,__assign:hH,__rest:gH,__decorate:yH,__param:vH,__esDecorate:bH,__runInitializers:SH,__propKey:EH,__setFunctionName:AH,__metadata:xH,__awaiter:_H,__generator:TH,__exportStar:CH,__createBinding:DH,__values:IH,__read:kH,__spread:NH,__spreadArrays:wH,__spreadArray:PH,__await:RH,__asyncGenerator:OH,__asyncDelegator:$H,__asyncValues:jH,__makeTemplateObject:MH,__importStar:LH,__importDefault:FH,__classPrivateFieldGet:UH,__classPrivateFieldSet:zH,__classPrivateFieldIn:BH,__addDisposableResource:GH,__disposeResources:VH,__rewriteRelativeImportExtension:WH}=T_.default,KH=T_.default});var _e=H(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.maybeSetModuleExports=void 0;var ZH=(ue(),Q(le)),HH=ZH.__importDefault(Be());function JH(e){var t=e.use(HH.default),r=t.Type,i=t.builtInTypes,n=i.number;function a(m){return r.from(function(d){return n.check(d)&&d>=m},n+" >= "+m)}var o={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}},s=r.or(i.string,i.number,i.boolean,i.null,i.undefined),l=r.from(function(m){if(m===null)return!0;var d=typeof m;return!(d==="object"||d==="function")},s.toString());return{geq:a,defaults:o,isPrimitive:l}}Wl.default=JH;function XH(e){try{var t=e(),r=t.exports,i=r.default}catch{return}i&&i!==r&&typeof r=="object"&&(Object.assign(i,r,{default:i}),r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0}),t.exports=i)}Wl.maybeSetModuleExports=XH});var Be=H((Hl,uj)=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.Def=void 0;var ps=(ue(),Q(le)),qH=_e(),lj=Object.prototype,Bf=lj.toString,Er=lj.hasOwnProperty,Zl=(function(){function e(){}return e.prototype.assert=function(t,r){if(!this.check(t,r)){var i=D_(t);throw new Error(i+" does not match type "+this)}return!0},e.prototype.arrayOf=function(){var t=this;return new C_(t)},e})(),C_=(function(e){ps.__extends(t,e);function t(r){var i=e.call(this)||this;return i.elemType=r,i.kind="ArrayType",i}return t.prototype.toString=function(){return"["+this.elemType+"]"},t.prototype.check=function(r,i){var n=this;return Array.isArray(r)&&r.every(function(a){return n.elemType.check(a,i)})},t})(Zl),aj=(function(e){ps.__extends(t,e);function t(r){var i=e.call(this)||this;return i.value=r,i.kind="IdentityType",i}return t.prototype.toString=function(){return String(this.value)},t.prototype.check=function(r,i){var n=r===this.value;return!n&&typeof i=="function"&&i(this,r),n},t})(Zl),oj=(function(e){ps.__extends(t,e);function t(r){var i=e.call(this)||this;return i.fields=r,i.kind="ObjectType",i}return t.prototype.toString=function(){return"{ "+this.fields.join(", ")+" }"},t.prototype.check=function(r,i){return Bf.call(r)===Bf.call({})&&this.fields.every(function(n){return n.type.check(r[n.name],i)})},t})(Zl),sj=(function(e){ps.__extends(t,e);function t(r){var i=e.call(this)||this;return i.types=r,i.kind="OrType",i}return t.prototype.toString=function(){return this.types.join(" | ")},t.prototype.check=function(r,i){return this.types.some(function(n){return n.check(r,!!i)})?!0:(typeof i=="function"&&i(this,r),!1)},t})(Zl),Kl=(function(e){ps.__extends(t,e);function t(r,i){var n=e.call(this)||this;return n.name=r,n.predicate=i,n.kind="PredicateType",n}return t.prototype.toString=function(){return this.name},t.prototype.check=function(r,i){var n=this.predicate(r,i);return!n&&typeof i=="function"&&i(this,r),n},t})(Zl),zf=(function(){function e(t,r){this.type=t,this.typeName=r,this.baseNames=[],this.ownFields=Object.create(null),this.allSupertypes=Object.create(null),this.supertypeList=[],this.allFields=Object.create(null),this.fieldNames=[],this.finalized=!1,this.buildable=!1,this.buildParams=[]}return e.prototype.isSupertypeOf=function(t){if(t instanceof e){if(this.finalized!==!0||t.finalized!==!0)throw new Error("");return Er.call(t.allSupertypes,this.typeName)}else throw new Error(t+" is not a Def")},e.prototype.checkAllFields=function(t,r){var i=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function n(a){var o=i[a],s=o.type,l=o.getValue(t);return s.check(l,r)}return t!==null&&typeof t=="object"&&Object.keys(i).every(n)},e.prototype.bases=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this.baseNames;if(this.finalized){if(t.length!==i.length)throw new Error("");for(var n=0;n<t.length;n++)if(t[n]!==i[n])throw new Error("");return this}return t.forEach(function(a){i.indexOf(a)<0&&i.push(a)}),this},e})();Hl.Def=zf;var cj=(function(){function e(t,r,i,n){this.name=t,this.type=r,this.defaultFn=i,this.hidden=!!n}return e.prototype.toString=function(){return JSON.stringify(this.name)+": "+this.type},e.prototype.getValue=function(t){var r=t[this.name];return typeof r<"u"||typeof this.defaultFn=="function"&&(r=this.defaultFn.call(t)),r},e})();function D_(e){return Array.isArray(e)?"["+e.map(D_).join(", ")+"]":e&&typeof e=="object"?"{ "+Object.keys(e).map(function(t){return t+": "+e[t]}).join(", ")+" }":JSON.stringify(e)}function YH(e){var t={or:function(){for(var F=[],B=0;B<arguments.length;B++)F[B]=arguments[B];return new sj(F.map(function(z){return t.from(z)}))},from:function(F,B){if(F instanceof C_||F instanceof aj||F instanceof oj||F instanceof sj||F instanceof Kl)return F;if(F instanceof zf)return F.type;if(s.check(F)){if(F.length!==1)throw new Error("only one element type is permitted for typed arrays");return new C_(t.from(F[0]))}if(l.check(F))return new oj(Object.keys(F).map(function(X){return new cj(X,t.from(F[X],X))}));if(typeof F=="function"){var z=r.indexOf(F);if(z>=0)return i[z];if(typeof B!="string")throw new Error("missing name");return new Kl(B,F)}return new aj(F)},def:function(F){return Er.call(v,F)?v[F]:v[F]=new _(F)},hasDef:function(F){return Er.call(v,F)}},r=[],i=[];function n(F,B){var z=Bf.call(B),X=new Kl(F,function(me){return Bf.call(me)===z});return B&&typeof B.constructor=="function"&&(r.push(B.constructor),i.push(X)),X}var a=n("string","truthy"),o=n("function",function(){}),s=n("array",[]),l=n("object",{}),m=n("RegExp",/./),d=n("Date",new Date),h=n("number",3),g=n("boolean",!0),u=n("null",null),p=n("undefined",void 0),f=typeof BigInt=="function"?n("BigInt",BigInt(1234)):new Kl("BigInt",function(){return!1}),y={string:a,function:o,array:s,object:l,RegExp:m,Date:d,number:h,boolean:g,null:u,undefined:p,BigInt:f},v=Object.create(null);function b(F){if(F&&typeof F=="object"){var B=F.type;if(typeof B=="string"&&Er.call(v,B)){var z=v[B];if(z.finalized)return z}}return null}var _=(function(F){ps.__extends(B,F);function B(z){var X=F.call(this,new Kl(z,function(me,he){return X.check(me,he)}),z)||this;return X}return B.prototype.check=function(z,X){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(z===null||typeof z!="object")return!1;var me=b(z);return me?X&&me===this?this.checkAllFields(z,X):this.isSupertypeOf(me)?X?me.checkAllFields(z,X)&&this.checkAllFields(z,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(z,X):!1},B.prototype.build=function(){for(var z=this,X=[],me=0;me<arguments.length;me++)X[me]=arguments[me];if(this.buildParams=X,this.buildable)return this;this.field("type",String,function(){return z.typeName}),this.buildable=!0;var he=function(Ie,Re,lr,ur){if(!Er.call(Ie,Re)){var $t=z.allFields;if(!Er.call($t,Re))throw new Error(""+Re);var dr=$t[Re],cc=dr.type,Tn;if(ur)Tn=lr;else if(dr.defaultFn)Tn=dr.defaultFn.call(Ie);else{var qa="no value or default function given for field "+JSON.stringify(Re)+" of "+z.typeName+"("+z.buildParams.map(function(Cn){return $t[Cn]}).join(", ")+")";throw new Error(qa)}if(!cc.check(Tn))throw new Error(D_(Tn)+" does not match field "+dr+" of type "+z.typeName);Ie[Re]=Tn}},et=function(){for(var Ie=[],Re=0;Re<arguments.length;Re++)Ie[Re]=arguments[Re];var lr=Ie.length;if(!z.finalized)throw new Error("attempting to instantiate unfinalized type "+z.typeName);var ur=Object.create(P);if(z.buildParams.forEach(function($t,dr){dr<lr?he(ur,$t,Ie[dr],!0):he(ur,$t,null,!1)}),Object.keys(z.allFields).forEach(function($t){he(ur,$t,null,!1)}),ur.type!==z.typeName)throw new Error("");return ur};return et.from=function(Ie){if(!z.finalized)throw new Error("attempting to instantiate unfinalized type "+z.typeName);var Re=Object.create(P);if(Object.keys(z.allFields).forEach(function(lr){Er.call(Ie,lr)?he(Re,lr,Ie[lr],!0):he(Re,lr,null,!1)}),Re.type!==z.typeName)throw new Error("");return Re},Object.defineProperty(C,Y(this.typeName),{enumerable:!0,value:et}),this},B.prototype.field=function(z,X,me,he){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(z)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[z]=new cj(z,t.from(X),me,he),this)},B.prototype.finalize=function(){var z=this;if(!this.finalized){var X=this.allFields,me=this.allSupertypes;this.baseNames.forEach(function(et){var Ie=v[et];if(Ie instanceof zf)Ie.finalize(),_n(X,Ie.allFields),_n(me,Ie.allSupertypes);else{var Re="unknown supertype name "+JSON.stringify(et)+" for subtype "+JSON.stringify(z.typeName);throw new Error(Re)}}),_n(X,this.ownFields),me[this.typeName]=this,this.fieldNames.length=0;for(var he in X)Er.call(X,he)&&!X[he].hidden&&this.fieldNames.push(he);Object.defineProperty(Me,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,sc(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&xn(this.typeName)}},B})(zf);function A(F){if(!Er.call(v,F))throw new Error("");var B=v[F];if(B.finalized!==!0)throw new Error("");return B.supertypeList.slice(1)}function x(F){for(var B={},z=Object.keys(v),X=z.length,me=0;me<X;++me){var he=z[me],et=v[he];if(et.finalized!==!0)throw new Error(""+he);for(var Ie=0;Ie<et.supertypeList.length;++Ie){var Re=et.supertypeList[Ie];if(Er.call(F,Re)){B[he]=Re;break}}}return B}var C=Object.create(null),P={};function G(F,B){var z=P[F];return p.check(B)?delete P[F]:(o.assert(B),Object.defineProperty(P,F,{enumerable:!0,configurable:!0,value:B})),z}function Y(F){return F.replace(/^[A-Z]+/,function(B){var z=B.length;switch(z){case 0:return"";case 1:return B.toLowerCase();default:return B.slice(0,z-1).toLowerCase()+B.charAt(z-1)}})}function ve(F){return F=Y(F),F.replace(/(Expression)?$/,"Statement")}var Me={};function cr(F){var B=b(F);if(B)return B.fieldNames.slice(0);if("type"in F)throw new Error("did not recognize object of type "+JSON.stringify(F.type));return Object.keys(F)}function An(F,B){var z=b(F);if(z){var X=z.allFields[B];if(X)return X.getValue(F)}return F&&F[B]}function Xa(F,B,z){cr(F).forEach(function(X){B.call(this,X,An(F,X))},z)}function Fi(F,B,z){return cr(F).some(function(X){return B.call(this,X,An(F,X))},z)}function xn(F){var B=ve(F);if(!C[B]){var z=C[Y(F)];if(z){var X=function(){for(var me=[],he=0;he<arguments.length;he++)me[he]=arguments[he];return C.expressionStatement(z.apply(C,me))};X.from=function(){for(var me=[],he=0;he<arguments.length;he++)me[he]=arguments[he];return C.expressionStatement(z.from.apply(C,me))},C[B]=X}}}function sc(F,B){B.length=0,B.push(F);for(var z=Object.create(null),X=0;X<B.length;++X){F=B[X];var me=v[F];if(me.finalized!==!0)throw new Error("");Er.call(z,F)&&delete B[z[F]],z[F]=X,B.push.apply(B,me.baseNames)}for(var he=0,et=he,Ie=B.length;et<Ie;++et)Er.call(B,et)&&(B[he++]=B[et]);B.length=he}function _n(F,B){return Object.keys(B).forEach(function(z){F[z]=B[z]}),F}function ni(){Object.keys(v).forEach(function(F){v[F].finalize()})}return{Type:t,builtInTypes:y,getSupertypeNames:A,computeSupertypeLookupTable:x,builders:C,defineMethod:G,getBuilderName:Y,getStatementBuilderName:ve,namedTypes:Me,getFieldNames:cr,getFieldValue:An,eachField:Xa,someField:Fi,finalize:ni}}Hl.default=YH;(0,qH.maybeSetModuleExports)(function(){return uj})});var k_=H((I_,dj)=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});var QH=(ue(),Q(le)),eJ=_e(),tJ=QH.__importDefault(Be()),rJ=Object.prototype,Gf=rJ.hasOwnProperty;function nJ(e){var t=e.use(tJ.default),r=t.builtInTypes.array,i=t.builtInTypes.number,n=function h(g,u,p){if(!(this instanceof h))throw new Error("Path constructor cannot be invoked without 'new'");if(u){if(!(u instanceof h))throw new Error("")}else u=null,p=null;this.value=g,this.parentPath=u,this.name=p,this.__childCache=null},a=n.prototype;function o(h){return h.__childCache||(h.__childCache=Object.create(null))}function s(h,g){var u=o(h),p=h.getValueProperty(g),f=u[g];return(!Gf.call(u,g)||f.value!==p)&&(f=u[g]=new h.constructor(p,h,g)),f}a.getValueProperty=function(g){return this.value[g]},a.get=function(){for(var g=[],u=0;u<arguments.length;u++)g[u]=arguments[u];for(var p=this,f=g.length,y=0;y<f;++y)p=s(p,g[y]);return p},a.each=function(g,u){for(var p=[],f=this.value.length,y=0,y=0;y<f;++y)Gf.call(this.value,y)&&(p[y]=this.get(y));for(u=u||this,y=0;y<f;++y)Gf.call(p,y)&&g.call(u,p[y])},a.map=function(g,u){var p=[];return this.each(function(f){p.push(g.call(this,f))},u),p},a.filter=function(g,u){var p=[];return this.each(function(f){g.call(this,f)&&p.push(f)},u),p};function l(){}function m(h,g,u,p){if(r.assert(h.value),g===0)return l;var f=h.value.length;if(f<1)return l;var y=arguments.length;y===2?(u=0,p=f):y===3?(u=Math.max(u,0),p=f):(u=Math.max(u,0),p=Math.min(p,f)),i.assert(u),i.assert(p);for(var v=Object.create(null),b=o(h),_=u;_<p;++_)if(Gf.call(h.value,_)){var A=h.get(_);if(A.name!==_)throw new Error("");var x=_+g;A.name=x,v[x]=A,delete b[_]}return delete b.length,function(){for(var C in v){var P=v[C];if(P.name!==+C)throw new Error("");b[C]=P,h.value[C]=P.value}}}a.shift=function(){var g=m(this,-1),u=this.value.shift();return g(),u},a.unshift=function(){for(var g=[],u=0;u<arguments.length;u++)g[u]=arguments[u];var p=m(this,g.length),f=this.value.unshift.apply(this.value,g);return p(),f},a.push=function(){for(var g=[],u=0;u<arguments.length;u++)g[u]=arguments[u];return r.assert(this.value),delete o(this).length,this.value.push.apply(this.value,g)},a.pop=function(){r.assert(this.value);var g=o(this);return delete g[this.value.length-1],delete g.length,this.value.pop()},a.insertAt=function(g){var u=arguments.length,p=m(this,u-1,g);if(p===l&&u<=1)return this;g=Math.max(g,0);for(var f=1;f<u;++f)this.value[g+f-1]=arguments[f];return p(),this},a.insertBefore=function(){for(var g=[],u=0;u<arguments.length;u++)g[u]=arguments[u];for(var p=this.parentPath,f=g.length,y=[this.name],v=0;v<f;++v)y.push(g[v]);return p.insertAt.apply(p,y)},a.insertAfter=function(){for(var g=[],u=0;u<arguments.length;u++)g[u]=arguments[u];for(var p=this.parentPath,f=g.length,y=[this.name+1],v=0;v<f;++v)y.push(g[v]);return p.insertAt.apply(p,y)};function d(h){if(!(h instanceof n))throw new Error("");var g=h.parentPath;if(!g)return h;var u=g.value,p=o(g);if(u[h.name]===h.value)p[h.name]=h;else if(r.check(u)){var f=u.indexOf(h.value);f>=0&&(p[h.name=f]=h)}else u[h.name]=h.value,p[h.name]=h;if(u[h.name]!==h.value)throw new Error("");if(h.parentPath.get(h.name)!==h)throw new Error("");return h}return a.replace=function(g){var u=[],p=this.parentPath.value,f=o(this.parentPath),y=arguments.length;if(d(this),r.check(p)){for(var v=p.length,b=m(this.parentPath,y-1,this.name+1),_=[this.name,1],A=0;A<y;++A)_.push(arguments[A]);var x=p.splice.apply(p,_);if(x[0]!==this.value)throw new Error("");if(p.length!==v-1+y)throw new Error("");if(b(),y===0)delete this.value,delete f[this.name],this.__childCache=null;else{if(p[this.name]!==g)throw new Error("");for(this.value!==g&&(this.value=g,this.__childCache=null),A=0;A<y;++A)u.push(this.parentPath.get(this.name+A));if(u[0]!==this)throw new Error("")}}else if(y===1)this.value!==g&&(this.__childCache=null),this.value=p[this.name]=g,u.push(this);else if(y===0)delete p[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return u},n}I_.default=nJ;(0,eJ.maybeSetModuleExports)(function(){return dj})});var mj=H((N_,pj)=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});var iJ=(ue(),Q(le)),aJ=_e(),oJ=iJ.__importDefault(Be()),ms=Object.prototype.hasOwnProperty;function sJ(e){var t=e.use(oJ.default),r=t.Type,i=t.namedTypes,n=i.Node,a=i.Expression,o=t.builtInTypes.array,s=t.builders,l=function A(x,C){if(!(this instanceof A))throw new Error("Scope constructor cannot be invoked without 'new'");d.check(x.value)||m.assert(x.value);var P;if(C){if(!(C instanceof A))throw new Error("");P=C.depth+1}else C=null,P=0;Object.defineProperties(this,{path:{value:x},node:{value:x.value},isGlobal:{value:!C,enumerable:!0},depth:{value:P},parent:{value:C},bindings:{value:{}},types:{value:{}}})},m=r.or(i.Program,i.Function,i.CatchClause),d=r.or(i.Function,i.ClassDeclaration,i.ClassExpression,i.InterfaceDeclaration,i.TSInterfaceDeclaration,i.TypeAlias,i.TSTypeAliasDeclaration),h=r.or(i.TypeParameter,i.TSTypeParameter);l.isEstablishedBy=function(A){return m.check(A)||d.check(A)};var g=l.prototype;g.didScan=!1,g.declares=function(A){return this.scan(),ms.call(this.bindings,A)},g.declaresType=function(A){return this.scan(),ms.call(this.types,A)},g.declareTemporary=function(A){if(A){if(!/^[a-z$_]/i.test(A))throw new Error("")}else A="t$";A+=this.depth.toString(36)+"$",this.scan();for(var x=0;this.declares(A+x);)++x;var C=A+x;return this.bindings[C]=t.builders.identifier(C)},g.injectTemporary=function(A,x){A||(A=this.declareTemporary());var C=this.path.get("body");return i.BlockStatement.check(C.value)&&(C=C.get("body")),C.unshift(s.variableDeclaration("var",[s.variableDeclarator(A,x||null)])),A},g.scan=function(A){if(A||!this.didScan){for(var x in this.bindings)delete this.bindings[x];for(var x in this.types)delete this.types[x];u(this.path,this.bindings,this.types),this.didScan=!0}},g.getBindings=function(){return this.scan(),this.bindings},g.getTypes=function(){return this.scan(),this.types};function u(A,x,C){var P=A.value;if(d.check(P)){var G=A.get("typeParameters","params");o.check(G.value)&&G.each(function(Y){_(Y,C)})}m.check(P)&&(i.CatchClause.check(P)?v(A.get("param"),x):p(A,x,C))}function p(A,x,C){var P=A.value;A.parent&&i.FunctionExpression.check(A.parent.node)&&A.parent.node.id&&v(A.parent.get("id"),x),P&&(o.check(P)?A.each(function(G){y(G,x,C)}):i.Function.check(P)?(A.get("params").each(function(G){v(G,x)}),y(A.get("body"),x,C),p(A.get("typeParameters"),x,C)):i.TypeAlias&&i.TypeAlias.check(P)||i.InterfaceDeclaration&&i.InterfaceDeclaration.check(P)||i.TSTypeAliasDeclaration&&i.TSTypeAliasDeclaration.check(P)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(P)?b(A.get("id"),C):i.VariableDeclarator.check(P)?(v(A.get("id"),x),y(A.get("init"),x,C)):P.type==="ImportSpecifier"||P.type==="ImportNamespaceSpecifier"||P.type==="ImportDefaultSpecifier"?v(A.get(P.local?"local":P.name?"name":"id"),x):n.check(P)&&!a.check(P)&&t.eachField(P,function(G,Y){var ve=A.get(G);if(!f(ve,Y))throw new Error("");y(ve,x,C)}))}function f(A,x){return!!(A.value===x||Array.isArray(A.value)&&A.value.length===0&&Array.isArray(x)&&x.length===0)}function y(A,x,C){var P=A.value;if(!(!P||a.check(P)))if(i.FunctionDeclaration.check(P)&&P.id!==null)v(A.get("id"),x);else if(i.ClassDeclaration&&i.ClassDeclaration.check(P)&&P.id!==null)v(A.get("id"),x),p(A.get("typeParameters"),x,C);else if(i.InterfaceDeclaration&&i.InterfaceDeclaration.check(P)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(P))b(A.get("id"),C);else if(m.check(P)){if(i.CatchClause.check(P)&&i.Identifier.check(P.param)){var G=P.param.name,Y=ms.call(x,G);p(A.get("body"),x,C),Y||delete x[G]}}else p(A,x,C)}function v(A,x){var C=A.value;i.Pattern.assert(C),i.Identifier.check(C)?ms.call(x,C.name)?x[C.name].push(A):x[C.name]=[A]:i.AssignmentPattern&&i.AssignmentPattern.check(C)?v(A.get("left"),x):i.ObjectPattern&&i.ObjectPattern.check(C)?A.get("properties").each(function(P){var G=P.value;i.Pattern.check(G)?v(P,x):i.Property.check(G)||i.ObjectProperty&&i.ObjectProperty.check(G)?v(P.get("value"),x):i.SpreadProperty&&i.SpreadProperty.check(G)&&v(P.get("argument"),x)}):i.ArrayPattern&&i.ArrayPattern.check(C)?A.get("elements").each(function(P){var G=P.value;i.Pattern.check(G)?v(P,x):i.SpreadElement&&i.SpreadElement.check(G)&&v(P.get("argument"),x)}):i.PropertyPattern&&i.PropertyPattern.check(C)?v(A.get("pattern"),x):(i.SpreadElementPattern&&i.SpreadElementPattern.check(C)||i.RestElement&&i.RestElement.check(C)||i.SpreadPropertyPattern&&i.SpreadPropertyPattern.check(C))&&v(A.get("argument"),x)}function b(A,x){var C=A.value;i.Pattern.assert(C),i.Identifier.check(C)&&(ms.call(x,C.name)?x[C.name].push(A):x[C.name]=[A])}function _(A,x){var C=A.value;h.assert(C),ms.call(x,C.name)?x[C.name].push(A):x[C.name]=[A]}return g.lookup=function(A){for(var x=this;x&&!x.declares(A);x=x.parent);return x},g.lookupType=function(A){for(var x=this;x&&!x.declaresType(A);x=x.parent);return x},g.getGlobalScope=function(){for(var A=this;!A.isGlobal;)A=A.parent;return A},l}N_.default=sJ;(0,aJ.maybeSetModuleExports)(function(){return pj})});var R_=H((P_,fj)=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var w_=(ue(),Q(le)),cJ=w_.__importDefault(Be()),lJ=w_.__importDefault(k_()),uJ=w_.__importDefault(mj()),dJ=_e();function pJ(e){var t=e.use(cJ.default),r=t.namedTypes,i=t.builders,n=t.builtInTypes.number,a=t.builtInTypes.array,o=e.use(lJ.default),s=e.use(uJ.default),l=function v(b,_,A){if(!(this instanceof v))throw new Error("NodePath constructor cannot be invoked without 'new'");o.call(this,b,_,A)},m=l.prototype=Object.create(o.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(m,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),m.replace=function(){return delete this.node,delete this.parent,delete this.scope,o.prototype.replace.apply(this,arguments)},m.prune=function(){var v=this.parent;return this.replace(),f(v)},m._computeNode=function(){var v=this.value;if(r.Node.check(v))return v;var b=this.parentPath;return b&&b.node||null},m._computeParent=function(){var v=this.value,b=this.parentPath;if(!r.Node.check(v)){for(;b&&!r.Node.check(b.value);)b=b.parentPath;b&&(b=b.parentPath)}for(;b&&!r.Node.check(b.value);)b=b.parentPath;return b||null},m._computeScope=function(){var v=this.value,b=this.parentPath,_=b&&b.scope;return r.Node.check(v)&&s.isEstablishedBy(v)&&(_=new s(this,_)),_||null},m.getValueProperty=function(v){return t.getFieldValue(this.value,v)},m.needsParens=function(v){var b=this.parentPath;if(!b)return!1;var _=this.value;if(!r.Expression.check(_)||_.type==="Identifier")return!1;for(;!r.Node.check(b.value);)if(b=b.parentPath,!b)return!1;var A=b.value;switch(_.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return A.type==="MemberExpression"&&this.name==="object"&&A.object===_;case"BinaryExpression":case"LogicalExpression":switch(A.type){case"CallExpression":return this.name==="callee"&&A.callee===_;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&A.object===_;case"BinaryExpression":case"LogicalExpression":{var x=_,C=A.operator,P=g[C],G=x.operator,Y=g[G];if(P>Y)return!0;if(P===Y&&this.name==="right"){if(A.right!==x)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(A.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(A.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return A.type==="MemberExpression"&&n.check(_.value)&&this.name==="object"&&A.object===_;case"AssignmentExpression":case"ConditionalExpression":switch(A.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&A.callee===_;case"ConditionalExpression":return this.name==="test"&&A.test===_;case"MemberExpression":return this.name==="object"&&A.object===_;default:return!1}default:if(A.type==="NewExpression"&&this.name==="callee"&&A.callee===_)return u(_)}return!!(v!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function d(v){return r.BinaryExpression.check(v)||r.LogicalExpression.check(v)}function h(v){return r.UnaryExpression.check(v)||r.SpreadElement&&r.SpreadElement.check(v)||r.SpreadProperty&&r.SpreadProperty.check(v)}var g={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(v,b){v.forEach(function(_){g[_]=b})});function u(v){return r.CallExpression.check(v)?!0:a.check(v)?v.some(u):r.Node.check(v)?t.someField(v,function(b,_){return u(_)}):!1}m.canBeFirstInStatement=function(){var v=this.node;return!r.FunctionExpression.check(v)&&!r.ObjectExpression.check(v)},m.firstInStatement=function(){return p(this)};function p(v){for(var b,_;v.parent;v=v.parent){if(b=v.node,_=v.parent.node,r.BlockStatement.check(_)&&v.parent.name==="body"&&v.name===0){if(_.body[0]!==b)throw new Error("Nodes must be equal");return!0}if(r.ExpressionStatement.check(_)&&v.name==="expression"){if(_.expression!==b)throw new Error("Nodes must be equal");return!0}if(r.SequenceExpression.check(_)&&v.parent.name==="expressions"&&v.name===0){if(_.expressions[0]!==b)throw new Error("Nodes must be equal");continue}if(r.CallExpression.check(_)&&v.name==="callee"){if(_.callee!==b)throw new Error("Nodes must be equal");continue}if(r.MemberExpression.check(_)&&v.name==="object"){if(_.object!==b)throw new Error("Nodes must be equal");continue}if(r.ConditionalExpression.check(_)&&v.name==="test"){if(_.test!==b)throw new Error("Nodes must be equal");continue}if(d(_)&&v.name==="left"){if(_.left!==b)throw new Error("Nodes must be equal");continue}if(r.UnaryExpression.check(_)&&!_.prefix&&v.name==="argument"){if(_.argument!==b)throw new Error("Nodes must be equal");continue}return!1}return!0}function f(v){if(r.VariableDeclaration.check(v.node)){var b=v.get("declarations").value;if(!b||b.length===0)return v.prune()}else if(r.ExpressionStatement.check(v.node)){if(!v.get("expression").value)return v.prune()}else r.IfStatement.check(v.node)&&y(v);return v}function y(v){var b=v.get("test").value,_=v.get("alternate").value,A=v.get("consequent").value;if(!A&&!_){var x=i.expressionStatement(b);v.replace(x)}else if(!A&&_){var C=i.unaryExpression("!",b,!0);r.UnaryExpression.check(b)&&b.operator==="!"&&(C=b.argument),v.get("test").replace(C),v.get("consequent").replace(_),v.get("alternate").replace()}}return l}P_.default=pJ;(0,dJ.maybeSetModuleExports)(function(){return fj})});var yj=H((O_,gj)=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});var hj=(ue(),Q(le)),mJ=hj.__importDefault(Be()),fJ=hj.__importDefault(R_()),hJ=_e(),Vf=Object.prototype.hasOwnProperty;function gJ(e){var t=e.use(mJ.default),r=e.use(fJ.default),i=t.builtInTypes.array,n=t.builtInTypes.object,a=t.builtInTypes.function,o,s=function p(){if(!(this instanceof p))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=l(this),this._shouldVisitComments=Vf.call(this._methodNameTable,"Block")||Vf.call(this._methodNameTable,"Line"),this.Context=g(this),this._visiting=!1,this._changeReported=!1};function l(p){var f=Object.create(null);for(var y in p)/^visit[A-Z]/.test(y)&&(f[y.slice(5)]=!0);for(var v=t.computeSupertypeLookupTable(f),b=Object.create(null),_=Object.keys(v),A=_.length,x=0;x<A;++x){var C=_[x];y="visit"+v[C],a.check(p[y])&&(b[C]=y)}return b}s.fromMethodsObject=function(f){if(f instanceof s)return f;if(!n.check(f))return new s;var y=function b(){if(!(this instanceof b))throw new Error("Visitor constructor cannot be invoked without 'new'");s.call(this)},v=y.prototype=Object.create(d);return v.constructor=y,m(v,f),m(y,s),a.assert(y.fromMethodsObject),a.assert(y.visit),new y};function m(p,f){for(var y in f)Vf.call(f,y)&&(p[y]=f[y]);return p}s.visit=function(f,y){return s.fromMethodsObject(y).visit(f)};var d=s.prototype;d.visit=function(){if(this._visiting)throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var p=arguments.length,f=new Array(p),y=0;y<p;++y)f[y]=arguments[y];f[0]instanceof r||(f[0]=new r({root:f[0]}).get("root")),this.reset.apply(this,f);var v;try{var b=this.visitWithoutReset(f[0]);v=!0}finally{if(this._visiting=!1,!v&&this._abortRequested)return f[0].value}return b},d.AbortRequest=function(){},d.abort=function(){var p=this;p._abortRequested=!0;var f=new p.AbortRequest;throw f.cancel=function(){p._abortRequested=!1},f},d.reset=function(p){},d.visitWithoutReset=function(p){if(this instanceof this.Context)return this.visitor.visitWithoutReset(p);if(!(p instanceof r))throw new Error("");var f=p.value,y=f&&typeof f=="object"&&typeof f.type=="string"&&this._methodNameTable[f.type];if(y){var v=this.acquireContext(p);try{return v.invokeVisitorMethod(y)}finally{this.releaseContext(v)}}else return h(p,this)};function h(p,f){if(!(p instanceof r))throw new Error("");if(!(f instanceof s))throw new Error("");var y=p.value;if(i.check(y))p.each(f.visitWithoutReset,f);else if(n.check(y)){var v=t.getFieldNames(y);f._shouldVisitComments&&y.comments&&v.indexOf("comments")<0&&v.push("comments");for(var b=v.length,_=[],A=0;A<b;++A){var x=v[A];Vf.call(y,x)||(y[x]=t.getFieldValue(y,x)),_.push(p.get(x))}for(var A=0;A<b;++A)f.visitWithoutReset(_[A])}return p.value}d.acquireContext=function(p){return this._reusableContextStack.length===0?new this.Context(p):this._reusableContextStack.pop().reset(p)},d.releaseContext=function(p){if(!(p instanceof this.Context))throw new Error("");this._reusableContextStack.push(p),p.currentPath=null},d.reportChanged=function(){this._changeReported=!0},d.wasChangeReported=function(){return this._changeReported};function g(p){function f(v){if(!(this instanceof f))throw new Error("");if(!(this instanceof s))throw new Error("");if(!(v instanceof r))throw new Error("");Object.defineProperty(this,"visitor",{value:p,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=v,this.needToCallTraverse=!0,Object.seal(this)}if(!(p instanceof s))throw new Error("");var y=f.prototype=Object.create(p);return y.constructor=f,m(y,u),f}var u=Object.create(null);return u.reset=function(f){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");return this.currentPath=f,this.needToCallTraverse=!0,this},u.invokeVisitorMethod=function(f){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");var y=this.visitor[f].call(this,this.currentPath);if(y===!1?this.needToCallTraverse=!1:y!==o&&(this.currentPath=this.currentPath.replace(y)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+f);var v=this.currentPath;return v&&v.value},u.traverse=function(f,y){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");return this.needToCallTraverse=!1,h(f,s.fromMethodsObject(y||this.visitor))},u.visit=function(f,y){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");return this.needToCallTraverse=!1,s.fromMethodsObject(y||this.visitor).visitWithoutReset(f)},u.reportChanged=function(){this.visitor.reportChanged()},u.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},s}O_.default=gJ;(0,hJ.maybeSetModuleExports)(function(){return gj})});var bj=H(($_,vj)=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var yJ=(ue(),Q(le)),vJ=_e(),bJ=yJ.__importDefault(Be());function SJ(e){var t=e.use(bJ.default),r=t.getFieldNames,i=t.getFieldValue,n=t.builtInTypes.array,a=t.builtInTypes.object,o=t.builtInTypes.Date,s=t.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function m(p,f,y){return n.check(y)?y.length=0:y=null,h(p,f,y)}m.assert=function(p,f){var y=[];if(!m(p,f,y))if(y.length===0){if(p!==f)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+y.map(d).join(""))};function d(p){return/[_$a-z][_$a-z0-9]*/i.test(p)?"."+p:"["+JSON.stringify(p)+"]"}function h(p,f,y){return p===f?!0:n.check(p)?g(p,f,y):a.check(p)?u(p,f,y):o.check(p)?o.check(f)&&+p==+f:s.check(p)?s.check(f)&&p.source===f.source&&p.global===f.global&&p.multiline===f.multiline&&p.ignoreCase===f.ignoreCase:p==f}function g(p,f,y){n.assert(p);var v=p.length;if(!n.check(f)||f.length!==v)return y&&y.push("length"),!1;for(var b=0;b<v;++b){if(y&&y.push(b),b in p!=b in f||!h(p[b],f[b],y))return!1;if(y){var _=y.pop();if(_!==b)throw new Error(""+_)}}return!0}function u(p,f,y){if(a.assert(p),!a.check(f))return!1;if(p.type!==f.type)return y&&y.push("type"),!1;var v=r(p),b=v.length,_=r(f),A=_.length;if(b===A){for(var x=0;x<b;++x){var C=v[x],P=i(p,C),G=i(f,C);if(y&&y.push(C),!h(P,G,y))return!1;if(y){var Y=y.pop();if(Y!==C)throw new Error(""+Y)}}return!0}if(!y)return!1;var ve=Object.create(null);for(x=0;x<b;++x)ve[v[x]]=!0;for(x=0;x<A;++x){if(C=_[x],!l.call(ve,C))return y.push(C),!1;delete ve[C]}for(C in ve){y.push(C);break}return!1}return m}$_.default=SJ;(0,vJ.maybeSetModuleExports)(function(){return vj})});var Ej=H((j_,Sj)=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});var Jl=(ue(),Q(le)),EJ=Jl.__importDefault(Be()),AJ=Jl.__importDefault(yj()),xJ=Jl.__importDefault(bj()),_J=Jl.__importDefault(k_()),TJ=Jl.__importDefault(R_()),CJ=_e();function DJ(e){var t=IJ(),r=t.use(EJ.default);e.forEach(t.use),r.finalize();var i=t.use(AJ.default);return{Type:r.Type,builtInTypes:r.builtInTypes,namedTypes:r.namedTypes,builders:r.builders,defineMethod:r.defineMethod,getFieldNames:r.getFieldNames,getFieldValue:r.getFieldValue,eachField:r.eachField,someField:r.someField,getSupertypeNames:r.getSupertypeNames,getBuilderName:r.getBuilderName,astNodesAreEquivalent:t.use(xJ.default),finalize:r.finalize,Path:t.use(_J.default),NodePath:t.use(TJ.default),PathVisitor:i,use:t.use,visit:i.visit}}j_.default=DJ;function IJ(){var e=[],t=[];function r(n){var a=e.indexOf(n);return a===-1&&(a=e.length,e.push(n),t[a]=n(i)),t[a]}var i={use:r};return i}(0,CJ.maybeSetModuleExports)(function(){return Sj})});var L_=H((M_,Aj)=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});var kJ=_e();function NJ(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}M_.default=NJ;(0,kJ.maybeSetModuleExports)(function(){return Aj})});var U_=H((F_,xj)=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});var wJ=(ue(),Q(le)),PJ=_e(),RJ=wJ.__importDefault(L_());function OJ(e){var t=e.use(RJ.default);return t.BinaryOperators.indexOf("**")<0&&t.BinaryOperators.push("**"),t.AssignmentOperators.indexOf("**=")<0&&t.AssignmentOperators.push("**="),t}F_.default=OJ;(0,PJ.maybeSetModuleExports)(function(){return xj})});var B_=H((z_,_j)=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var $J=(ue(),Q(le)),jJ=_e(),MJ=$J.__importDefault(U_());function LJ(e){var t=e.use(MJ.default);return t.LogicalOperators.indexOf("??")<0&&t.LogicalOperators.push("??"),t}z_.default=LJ;(0,jJ.maybeSetModuleExports)(function(){return _j})});var Cj=H((G_,Tj)=>{"use strict";Object.defineProperty(G_,"__esModule",{value:!0});var FJ=(ue(),Q(le)),UJ=_e(),zJ=FJ.__importDefault(B_());function BJ(e){var t=e.use(zJ.default);return t.LogicalOperators.forEach(function(r){var i=r+"=";t.AssignmentOperators.indexOf(i)<0&&t.AssignmentOperators.push(i)}),t}G_.default=BJ;(0,UJ.maybeSetModuleExports)(function(){return Tj})});var kj=H((W_,Ij)=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});var V_=(ue(),Q(le)),GJ=V_.__importDefault(L_()),VJ=V_.__importDefault(Be()),Dj=V_.__importStar(_e());function WJ(e){var t=e.use(VJ.default),r=t.Type,i=r.def,n=r.or,a=e.use(Dj.default),o=a.defaults,s=a.geq,l=e.use(GJ.default),m=l.BinaryOperators,d=l.AssignmentOperators,h=l.LogicalOperators;i("Printable").field("loc",n(i("SourceLocation"),null),o.null,!0),i("Node").bases("Printable").field("type",String).field("comments",n([i("Comment")],null),o.null,!0),i("SourceLocation").field("start",i("Position")).field("end",i("Position")).field("source",n(String,null),o.null),i("Position").field("line",s(1)).field("column",s(0)),i("File").bases("Node").build("program","name").field("program",i("Program")).field("name",n(String,null),o.null),i("Program").bases("Node").build("body").field("body",[i("Statement")]),i("Function").bases("Node").field("id",n(i("Identifier"),null),o.null).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("generator",Boolean,o.false).field("async",Boolean,o.false),i("Statement").bases("Node"),i("EmptyStatement").bases("Statement").build(),i("BlockStatement").bases("Statement").build("body").field("body",[i("Statement")]),i("ExpressionStatement").bases("Statement").build("expression").field("expression",i("Expression")),i("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Statement")).field("alternate",n(i("Statement"),null),o.null),i("LabeledStatement").bases("Statement").build("label","body").field("label",i("Identifier")).field("body",i("Statement")),i("BreakStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("ContinueStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("WithStatement").bases("Statement").build("object","body").field("object",i("Expression")).field("body",i("Statement")),i("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",i("Expression")).field("cases",[i("SwitchCase")]).field("lexical",Boolean,o.false),i("ReturnStatement").bases("Statement").build("argument").field("argument",n(i("Expression"),null)),i("ThrowStatement").bases("Statement").build("argument").field("argument",i("Expression")),i("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",i("BlockStatement")).field("handler",n(i("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[i("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[i("CatchClause")],o.emptyArray).field("finalizer",n(i("BlockStatement"),null),o.null),i("CatchClause").bases("Node").build("param","guard","body").field("param",i("Pattern")).field("guard",n(i("Expression"),null),o.null).field("body",i("BlockStatement")),i("WhileStatement").bases("Statement").build("test","body").field("test",i("Expression")).field("body",i("Statement")),i("DoWhileStatement").bases("Statement").build("body","test").field("body",i("Statement")).field("test",i("Expression")),i("ForStatement").bases("Statement").build("init","test","update","body").field("init",n(i("VariableDeclaration"),i("Expression"),null)).field("test",n(i("Expression"),null)).field("update",n(i("Expression"),null)).field("body",i("Statement")),i("ForInStatement").bases("Statement").build("left","right","body").field("left",n(i("VariableDeclaration"),i("Expression"))).field("right",i("Expression")).field("body",i("Statement")),i("DebuggerStatement").bases("Statement").build(),i("Declaration").bases("Statement"),i("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",i("Identifier")),i("FunctionExpression").bases("Function","Expression").build("id","params","body"),i("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",n("var","let","const")).field("declarations",[i("VariableDeclarator")]),i("VariableDeclarator").bases("Node").build("id","init").field("id",i("Pattern")).field("init",n(i("Expression"),null),o.null),i("Expression").bases("Node"),i("ThisExpression").bases("Expression").build(),i("ArrayExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),null)]),i("ObjectExpression").bases("Expression").build("properties").field("properties",[i("Property")]),i("Property").bases("Node").build("kind","key","value").field("kind",n("init","get","set")).field("key",n(i("Literal"),i("Identifier"))).field("value",i("Expression")),i("SequenceExpression").bases("Expression").build("expressions").field("expressions",[i("Expression")]);var g=n("-","+","!","~","typeof","void","delete");i("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",g).field("argument",i("Expression")).field("prefix",Boolean,o.true);var u=n.apply(void 0,m);i("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",u).field("left",i("Expression")).field("right",i("Expression"));var p=n.apply(void 0,d);i("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",p).field("left",n(i("Pattern"),i("MemberExpression"))).field("right",i("Expression"));var f=n("++","--");i("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",f).field("argument",i("Expression")).field("prefix",Boolean);var y=n.apply(void 0,h);i("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",y).field("left",i("Expression")).field("right",i("Expression")),i("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Expression")).field("alternate",i("Expression")),i("NewExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("CallExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("MemberExpression").bases("Expression").build("object","property","computed").field("object",i("Expression")).field("property",n(i("Identifier"),i("Expression"))).field("computed",Boolean,function(){var v=this.property.type;return v==="Literal"||v==="MemberExpression"||v==="BinaryExpression"}),i("Pattern").bases("Node"),i("SwitchCase").bases("Node").build("test","consequent").field("test",n(i("Expression"),null)).field("consequent",[i("Statement")]),i("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,o.false),i("Literal").bases("Expression").build("value").field("value",n(String,Boolean,null,Number,RegExp,BigInt)),i("Comment").bases("Printable").field("value",String).field("leading",Boolean,o.true).field("trailing",Boolean,o.false)}W_.default=WJ;(0,Dj.maybeSetModuleExports)(function(){return Ij})});var Pj=H((Z_,wj)=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});var K_=(ue(),Q(le)),KJ=K_.__importDefault(kj()),ZJ=K_.__importDefault(Be()),Nj=K_.__importStar(_e());function HJ(e){e.use(KJ.default);var t=e.use(ZJ.default),r=t.Type.def,i=t.Type.or,n=e.use(Nj.default).defaults;r("Function").field("generator",Boolean,n.false).field("expression",Boolean,n.false).field("defaults",[i(r("Expression"),null)],n.emptyArray).field("rest",i(r("Identifier"),null),n.null),r("RestElement").bases("Pattern").build("argument").field("argument",r("Pattern")).field("typeAnnotation",i(r("TypeAnnotation"),r("TSTypeAnnotation"),null),n.null),r("SpreadElementPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("FunctionDeclaration").build("id","params","body","generator","expression").field("id",i(r("Identifier"),null)),r("FunctionExpression").build("id","params","body","generator","expression"),r("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,n.null).field("body",i(r("BlockStatement"),r("Expression"))).field("generator",!1,n.false),r("ForOfStatement").bases("Statement").build("left","right","body").field("left",i(r("VariableDeclaration"),r("Pattern"))).field("right",r("Expression")).field("body",r("Statement")),r("YieldExpression").bases("Expression").build("argument","delegate").field("argument",i(r("Expression"),null)).field("delegate",Boolean,n.false),r("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",i(r("Expression"),null)),r("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",i(r("Expression"),null)),r("ComprehensionBlock").bases("Node").build("left","right","each").field("left",r("Pattern")).field("right",r("Expression")).field("each",Boolean),r("Property").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("value",i(r("Expression"),r("Pattern"))).field("method",Boolean,n.false).field("shorthand",Boolean,n.false).field("computed",Boolean,n.false),r("ObjectProperty").field("shorthand",Boolean,n.false),r("PropertyPattern").bases("Pattern").build("key","pattern").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("pattern",r("Pattern")).field("computed",Boolean,n.false),r("ObjectPattern").bases("Pattern").build("properties").field("properties",[i(r("PropertyPattern"),r("Property"))]),r("ArrayPattern").bases("Pattern").build("elements").field("elements",[i(r("Pattern"),null)]),r("SpreadElement").bases("Node").build("argument").field("argument",r("Expression")),r("ArrayExpression").field("elements",[i(r("Expression"),r("SpreadElement"),r("RestElement"),null)]),r("NewExpression").field("arguments",[i(r("Expression"),r("SpreadElement"))]),r("CallExpression").field("arguments",[i(r("Expression"),r("SpreadElement"))]),r("AssignmentPattern").bases("Pattern").build("left","right").field("left",r("Pattern")).field("right",r("Expression")),r("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",i("constructor","method","get","set")).field("key",r("Expression")).field("value",r("Function")).field("computed",Boolean,n.false).field("static",Boolean,n.false);var a=i(r("MethodDefinition"),r("VariableDeclarator"),r("ClassPropertyDefinition"),r("ClassProperty"),r("StaticBlock"));r("ClassProperty").bases("Declaration").build("key").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("computed",Boolean,n.false),r("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",a),r("ClassBody").bases("Declaration").build("body").field("body",[a]),r("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",i(r("Identifier"),null)).field("body",r("ClassBody")).field("superClass",i(r("Expression"),null),n.null),r("ClassExpression").bases("Expression").build("id","body","superClass").field("id",i(r("Identifier"),null),n.null).field("body",r("ClassBody")).field("superClass",i(r("Expression"),null),n.null),r("Super").bases("Expression").build(),r("Specifier").bases("Node"),r("ModuleSpecifier").bases("Specifier").field("local",i(r("Identifier"),null),n.null).field("id",i(r("Identifier"),null),n.null).field("name",i(r("Identifier"),null),n.null),r("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",r("Identifier")),r("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),r("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),r("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[i(r("ImportSpecifier"),r("ImportNamespaceSpecifier"),r("ImportDefaultSpecifier"))],n.emptyArray).field("source",r("Literal")).field("importKind",i("value","type"),function(){return"value"}),r("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",i(r("Declaration"),null)).field("specifiers",[r("ExportSpecifier")],n.emptyArray).field("source",i(r("Literal"),null),n.null),r("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",r("Identifier")),r("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",i(r("Declaration"),r("Expression"))),r("ExportAllDeclaration").bases("Declaration").build("source").field("source",r("Literal")),r("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",r("Expression")).field("quasi",r("TemplateLiteral")),r("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[r("TemplateElement")]).field("expressions",[r("Expression")]),r("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),r("MetaProperty").bases("Expression").build("meta","property").field("meta",r("Identifier")).field("property",r("Identifier"))}Z_.default=HJ;(0,Nj.maybeSetModuleExports)(function(){return wj})});var $j=H((H_,Oj)=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});var Rj=(ue(),Q(le)),JJ=Rj.__importDefault(U_()),XJ=Rj.__importDefault(Pj()),qJ=_e();function YJ(e){e.use(JJ.default),e.use(XJ.default)}H_.default=YJ;(0,qJ.maybeSetModuleExports)(function(){return Oj})});var Lj=H((X_,Mj)=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});var J_=(ue(),Q(le)),QJ=J_.__importDefault($j()),eX=J_.__importDefault(Be()),jj=J_.__importStar(_e());function tX(e){e.use(QJ.default);var t=e.use(eX.default),r=t.Type.def,i=e.use(jj.default).defaults;r("Function").field("async",Boolean,i.false),r("AwaitExpression").bases("Expression").build("argument").field("argument",r("Expression"))}X_.default=tX;(0,jj.maybeSetModuleExports)(function(){return Mj})});var zj=H((Y_,Uj)=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});var q_=(ue(),Q(le)),rX=q_.__importDefault(Lj()),nX=q_.__importDefault(Be()),Fj=q_.__importStar(_e());function iX(e){e.use(rX.default);var t=e.use(nX.default),r=t.Type.def,i=t.Type.or,n=e.use(Fj.default).defaults;r("ForOfStatement").field("await",Boolean,n.false),r("SpreadProperty").bases("Node").build("argument").field("argument",r("Expression")),r("ObjectExpression").field("properties",[i(r("Property"),r("SpreadProperty"),r("SpreadElement"))]),r("TemplateElement").field("value",{cooked:i(String,null),raw:String}),r("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("ObjectPattern").field("properties",[i(r("PropertyPattern"),r("Property"),r("RestElement"),r("SpreadPropertyPattern"))])}Y_.default=iX;(0,Fj.maybeSetModuleExports)(function(){return Uj})});var Vj=H((e0,Gj)=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var Q_=(ue(),Q(le)),aX=Q_.__importDefault(zj()),oX=Q_.__importDefault(Be()),Bj=Q_.__importStar(_e());function sX(e){e.use(aX.default);var t=e.use(oX.default),r=t.Type.def,i=t.Type.or,n=e.use(Bj.default).defaults;r("CatchClause").field("param",i(r("Pattern"),null),n.null)}e0.default=sX;(0,Bj.maybeSetModuleExports)(function(){return Gj})});var Zj=H((t0,Kj)=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var Wf=(ue(),Q(le)),cX=Wf.__importDefault(B_()),lX=Wf.__importDefault(Vj()),uX=Wf.__importDefault(Be()),Wj=Wf.__importStar(_e());function dX(e){e.use(cX.default),e.use(lX.default);var t=e.use(uX.default),r=t.Type.def,i=t.Type.or,n=e.use(Wj.default),a=n.defaults;r("ImportExpression").bases("Expression").build("source").field("source",r("Expression")),r("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",r("Literal")).field("exported",i(r("Identifier"),null,void 0),a.null),r("ChainElement").bases("Node").field("optional",Boolean,a.false),r("CallExpression").bases("Expression","ChainElement"),r("MemberExpression").bases("Expression","ChainElement"),r("ChainExpression").bases("Expression").build("expression").field("expression",r("ChainElement")),r("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,a.true),r("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,a.true)}t0.default=dX;(0,Wj.maybeSetModuleExports)(function(){return Kj})});var Xj=H((r0,Jj)=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var Hj=(ue(),Q(le)),pX=Hj.__importDefault(Cj()),mX=Hj.__importDefault(Zj()),fX=_e();function hX(e){e.use(pX.default),e.use(mX.default)}r0.default=hX;(0,fX.maybeSetModuleExports)(function(){return Jj})});var Qj=H((n0,Yj)=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});var qj=(ue(),Q(le)),gX=qj.__importDefault(Xj()),yX=qj.__importDefault(Be()),vX=_e();function bX(e){e.use(gX.default);var t=e.use(yX.default),r=t.Type.def;r("StaticBlock").bases("Declaration").build("body").field("body",[r("Statement")])}n0.default=bX;(0,vX.maybeSetModuleExports)(function(){return Yj})});var fs=H((a0,t1)=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});var i0=(ue(),Q(le)),SX=i0.__importDefault(Be()),e1=i0.__importStar(_e()),EX=i0.__importDefault(Qj());function AX(e){e.use(EX.default);var t=e.use(SX.default),r=t.Type,i=t.Type.def,n=r.or,a=e.use(e1.default),o=a.defaults;i("AwaitExpression").build("argument","all").field("argument",n(i("Expression"),null)).field("all",Boolean,o.false),i("Decorator").bases("Node").build("expression").field("expression",i("Expression")),i("Property").field("decorators",n([i("Decorator")],null),o.null),i("MethodDefinition").field("decorators",n([i("Decorator")],null),o.null),i("PrivateName").bases("Expression","Pattern").build("id").field("id",i("Identifier")),i("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",i("PrivateName")).field("value",n(i("Expression"),null),o.null),i("ImportAttribute").bases("Node").build("key","value").field("key",n(i("Identifier"),i("Literal"))).field("value",i("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(function(s){i(s).field("assertions",[i("ImportAttribute")],o.emptyArray)}),i("RecordExpression").bases("Expression").build("properties").field("properties",[n(i("ObjectProperty"),i("ObjectMethod"),i("SpreadElement"))]),i("TupleExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),i("SpreadElement"),null)]),i("ModuleExpression").bases("Node").build("body").field("body",i("Program"))}a0.default=AX;(0,e1.maybeSetModuleExports)(function(){return t1})});var i1=H((s0,n1)=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});var o0=(ue(),Q(le)),xX=o0.__importDefault(fs()),_X=o0.__importDefault(Be()),r1=o0.__importStar(_e());function TX(e){e.use(xX.default);var t=e.use(_X.default),r=t.Type.def,i=t.Type.or,n=e.use(r1.default).defaults;r("JSXAttribute").bases("Node").build("name","value").field("name",i(r("JSXIdentifier"),r("JSXNamespacedName"))).field("value",i(r("Literal"),r("JSXExpressionContainer"),r("JSXElement"),r("JSXFragment"),null),n.null),r("JSXIdentifier").bases("Identifier").build("name").field("name",String),r("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",r("JSXIdentifier")).field("name",r("JSXIdentifier")),r("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",i(r("JSXIdentifier"),r("JSXMemberExpression"))).field("property",r("JSXIdentifier")).field("computed",Boolean,n.false);var a=i(r("JSXIdentifier"),r("JSXNamespacedName"),r("JSXMemberExpression"));r("JSXSpreadAttribute").bases("Node").build("argument").field("argument",r("Expression"));var o=[i(r("JSXAttribute"),r("JSXSpreadAttribute"))];r("JSXExpressionContainer").bases("Expression").build("expression").field("expression",i(r("Expression"),r("JSXEmptyExpression")));var s=[i(r("JSXText"),r("JSXExpressionContainer"),r("JSXSpreadChild"),r("JSXElement"),r("JSXFragment"),r("Literal"))];r("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",r("JSXOpeningElement")).field("closingElement",i(r("JSXClosingElement"),null),n.null).field("children",s,n.emptyArray).field("name",a,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",o,function(){return this.openingElement.attributes},!0),r("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",a).field("attributes",o,n.emptyArray).field("selfClosing",Boolean,n.false),r("JSXClosingElement").bases("Node").build("name").field("name",a),r("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",r("JSXOpeningFragment")).field("closingFragment",r("JSXClosingFragment")).field("children",s,n.emptyArray),r("JSXOpeningFragment").bases("Node").build(),r("JSXClosingFragment").bases("Node").build(),r("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),r("JSXEmptyExpression").bases("Node").build(),r("JSXSpreadChild").bases("Node").build("expression").field("expression",r("Expression"))}s0.default=TX;(0,r1.maybeSetModuleExports)(function(){return n1})});var l0=H((c0,s1)=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});var a1=(ue(),Q(le)),CX=a1.__importDefault(Be()),o1=a1.__importStar(_e());function DX(e){var t=e.use(CX.default),r=t.Type.def,i=t.Type.or,n=e.use(o1.default).defaults,a=i(r("TypeAnnotation"),r("TSTypeAnnotation"),null),o=i(r("TypeParameterDeclaration"),r("TSTypeParameterDeclaration"),null);r("Identifier").field("typeAnnotation",a,n.null),r("ObjectPattern").field("typeAnnotation",a,n.null),r("Function").field("returnType",a,n.null).field("typeParameters",o,n.null),r("ClassProperty").build("key","value","typeAnnotation","static").field("value",i(r("Expression"),null)).field("static",Boolean,n.false).field("typeAnnotation",a,n.null),["ClassDeclaration","ClassExpression"].forEach(function(s){r(s).field("typeParameters",o,n.null).field("superTypeParameters",i(r("TypeParameterInstantiation"),r("TSTypeParameterInstantiation"),null),n.null).field("implements",i([r("ClassImplements")],[r("TSExpressionWithTypeArguments")]),n.emptyArray)})}c0.default=DX;(0,o1.maybeSetModuleExports)(function(){return s1})});var d0=H((u0,l1)=>{"use strict";Object.defineProperty(u0,"__esModule",{value:!0});var Kf=(ue(),Q(le)),IX=Kf.__importDefault(fs()),kX=Kf.__importDefault(l0()),NX=Kf.__importDefault(Be()),c1=Kf.__importStar(_e());function wX(e){e.use(IX.default),e.use(kX.default);var t=e.use(NX.default),r=t.Type.def,i=t.Type.or,n=e.use(c1.default).defaults;r("Flow").bases("Node"),r("FlowType").bases("Flow"),r("AnyTypeAnnotation").bases("FlowType").build(),r("EmptyTypeAnnotation").bases("FlowType").build(),r("MixedTypeAnnotation").bases("FlowType").build(),r("VoidTypeAnnotation").bases("FlowType").build(),r("SymbolTypeAnnotation").bases("FlowType").build(),r("NumberTypeAnnotation").bases("FlowType").build(),r("BigIntTypeAnnotation").bases("FlowType").build(),r("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),r("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),r("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),r("StringTypeAnnotation").bases("FlowType").build(),r("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),r("BooleanTypeAnnotation").bases("FlowType").build(),r("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),r("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",r("FlowType")),r("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",r("FlowType")),r("NullLiteralTypeAnnotation").bases("FlowType").build(),r("NullTypeAnnotation").bases("FlowType").build(),r("ThisTypeAnnotation").bases("FlowType").build(),r("ExistsTypeAnnotation").bases("FlowType").build(),r("ExistentialTypeParam").bases("FlowType").build(),r("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[r("FunctionTypeParam")]).field("returnType",r("FlowType")).field("rest",i(r("FunctionTypeParam"),null)).field("typeParameters",i(r("TypeParameterDeclaration"),null)),r("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",i(r("Identifier"),null)).field("typeAnnotation",r("FlowType")).field("optional",Boolean),r("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",r("FlowType")),r("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[i(r("ObjectTypeProperty"),r("ObjectTypeSpreadProperty"))]).field("indexers",[r("ObjectTypeIndexer")],n.emptyArray).field("callProperties",[r("ObjectTypeCallProperty")],n.emptyArray).field("inexact",i(Boolean,void 0),n.undefined).field("exact",Boolean,n.false).field("internalSlots",[r("ObjectTypeInternalSlot")],n.emptyArray),r("Variance").bases("Node").build("kind").field("kind",i("plus","minus"));var a=i(r("Variance"),"plus","minus",null);r("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",i(r("Literal"),r("Identifier"))).field("value",r("FlowType")).field("optional",Boolean).field("variance",a,n.null),r("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",r("Identifier")).field("key",r("FlowType")).field("value",r("FlowType")).field("variance",a,n.null).field("static",Boolean,n.false),r("ObjectTypeCallProperty").bases("Node").build("value").field("value",r("FunctionTypeAnnotation")).field("static",Boolean,n.false),r("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",i(r("Identifier"),r("QualifiedTypeIdentifier"))).field("id",r("Identifier")),r("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",i(r("Identifier"),r("QualifiedTypeIdentifier"))).field("typeParameters",i(r("TypeParameterInstantiation"),null)),r("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",r("Identifier")).field("property",i(r("MemberTypeAnnotation"),r("GenericTypeAnnotation"))),r("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",r("FlowType")).field("indexType",r("FlowType")),r("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",r("FlowType")).field("indexType",r("FlowType")).field("optional",Boolean),r("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",r("FlowType")),r("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",r("FlowType")),r("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",r("Identifier")).field("value",r("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),r("TypeParameterDeclaration").bases("Node").build("params").field("params",[r("TypeParameter")]),r("TypeParameterInstantiation").bases("Node").build("params").field("params",[r("FlowType")]),r("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",a,n.null).field("bound",i(r("TypeAnnotation"),null),n.null).field("default",i(r("FlowType"),null),n.null),r("ClassProperty").field("variance",a,n.null),r("ClassImplements").bases("Node").build("id").field("id",r("Identifier")).field("superClass",i(r("Expression"),null),n.null).field("typeParameters",i(r("TypeParameterInstantiation"),null),n.null),r("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",r("ObjectTypeAnnotation")).field("extends",i([r("InterfaceExtends")],null),n.null),r("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null),n.null).field("body",r("ObjectTypeAnnotation")).field("extends",[r("InterfaceExtends")]),r("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),r("InterfaceExtends").bases("Node").build("id").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterInstantiation"),null),n.null),r("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null)).field("right",r("FlowType")),r("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),r("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null)).field("impltype",r("FlowType")).field("supertype",i(r("FlowType"),null)),r("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",i(r("FlowType"),null)),r("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",r("Expression")).field("typeAnnotation",r("TypeAnnotation")),r("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("DeclareVariable").bases("Statement").build("id").field("id",r("Identifier")),r("DeclareFunction").bases("Statement").build("id").field("id",r("Identifier")).field("predicate",i(r("FlowPredicate"),null),n.null),r("DeclareClass").bases("InterfaceDeclaration").build("id"),r("DeclareModule").bases("Statement").build("id","body").field("id",i(r("Identifier"),r("Literal"))).field("body",r("BlockStatement")),r("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",r("TypeAnnotation")),r("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",i(r("DeclareVariable"),r("DeclareFunction"),r("DeclareClass"),r("FlowType"),r("TypeAlias"),r("DeclareOpaqueType"),r("InterfaceDeclaration"),null)).field("specifiers",[i(r("ExportSpecifier"),r("ExportBatchSpecifier"))],n.emptyArray).field("source",i(r("Literal"),null),n.null),r("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",i(r("Literal"),null),n.null),r("ImportDeclaration").field("importKind",i("value","type","typeof"),function(){return"value"}),r("FlowPredicate").bases("Flow"),r("InferredPredicate").bases("FlowPredicate").build(),r("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",r("Expression")),r("Function").field("predicate",i(r("FlowPredicate"),null),n.null),r("CallExpression").field("typeArguments",i(null,r("TypeParameterInstantiation")),n.null),r("NewExpression").field("typeArguments",i(null,r("TypeParameterInstantiation")),n.null),r("EnumDeclaration").bases("Declaration").build("id","body").field("id",r("Identifier")).field("body",i(r("EnumBooleanBody"),r("EnumNumberBody"),r("EnumStringBody"),r("EnumSymbolBody"))),r("EnumBooleanBody").build("members","explicitType").field("members",[r("EnumBooleanMember")]).field("explicitType",Boolean),r("EnumNumberBody").build("members","explicitType").field("members",[r("EnumNumberMember")]).field("explicitType",Boolean),r("EnumStringBody").build("members","explicitType").field("members",i([r("EnumStringMember")],[r("EnumDefaultedMember")])).field("explicitType",Boolean),r("EnumSymbolBody").build("members").field("members",[r("EnumDefaultedMember")]),r("EnumBooleanMember").build("id","init").field("id",r("Identifier")).field("init",i(r("Literal"),Boolean)),r("EnumNumberMember").build("id","init").field("id",r("Identifier")).field("init",r("Literal")),r("EnumStringMember").build("id","init").field("id",r("Identifier")).field("init",r("Literal")),r("EnumDefaultedMember").build("id").field("id",r("Identifier"))}u0.default=wX;(0,c1.maybeSetModuleExports)(function(){return l1})});var p1=H((m0,d1)=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var p0=(ue(),Q(le)),PX=p0.__importDefault(fs()),RX=p0.__importDefault(Be()),u1=p0.__importStar(_e());function OX(e){e.use(PX.default);var t=e.use(RX.default),r=e.use(u1.default).defaults,i=t.Type.def,n=t.Type.or;i("VariableDeclaration").field("declarations",[n(i("VariableDeclarator"),i("Identifier"))]),i("Property").field("value",n(i("Expression"),i("Pattern"))),i("ArrayPattern").field("elements",[n(i("Pattern"),i("SpreadElement"),null)]),i("ObjectPattern").field("properties",[n(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"))]),i("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ExportBatchSpecifier").bases("Specifier").build(),i("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",n(i("Declaration"),i("Expression"),null)).field("specifiers",[n(i("ExportSpecifier"),i("ExportBatchSpecifier"))],r.emptyArray).field("source",n(i("Literal"),null),r.null),i("Block").bases("Comment").build("value","leading","trailing"),i("Line").bases("Comment").build("value","leading","trailing")}m0.default=OX;(0,u1.maybeSetModuleExports)(function(){return d1})});var g0=H((h0,f1)=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var f0=(ue(),Q(le)),$X=f0.__importDefault(fs()),jX=f0.__importDefault(Be()),m1=f0.__importStar(_e());function MX(e){var t,r,i,n,a;e.use($X.default);var o=e.use(jX.default),s=e.use(m1.default).defaults,l=o.Type.def,m=o.Type.or,d=o.builtInTypes.undefined;l("Noop").bases("Statement").build(),l("DoExpression").bases("Expression").build("body").field("body",[l("Statement")]),l("BindExpression").bases("Expression").build("object","callee").field("object",m(l("Expression"),null)).field("callee",l("Expression")),l("ParenthesizedExpression").bases("Expression").build("expression").field("expression",l("Expression")),l("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",l("Identifier")),l("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",l("Identifier")),l("CommentBlock").bases("Comment").build("value","leading","trailing"),l("CommentLine").bases("Comment").build("value","leading","trailing"),l("Directive").bases("Node").build("value").field("value",l("DirectiveLiteral")),l("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,s["use strict"]),l("InterpreterDirective").bases("Node").build("value").field("value",String),l("BlockStatement").bases("Statement").build("body").field("body",[l("Statement")]).field("directives",[l("Directive")],s.emptyArray),l("Program").bases("Node").build("body").field("body",[l("Statement")]).field("directives",[l("Directive")],s.emptyArray).field("interpreter",m(l("InterpreterDirective"),null),s.null);function h(f,y){return f===void 0&&(f=String),["extra",{rawValue:f,raw:String},function(){var b=o.getFieldValue(this,"value");return{rawValue:b,raw:y?y(b):String(b)}}]}(t=l("StringLiteral").bases("Literal").build("value").field("value",String)).field.apply(t,h(String,function(f){return JSON.stringify(f)})),(r=l("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",m(String,null),s.null)).field.apply(r,h(Number)),(i=l("BigIntLiteral").bases("Literal").build("value").field("value",m(String,Number))).field.apply(i,h(String,function(f){return f+"n"})),(n=l("DecimalLiteral").bases("Literal").build("value").field("value",String)).field.apply(n,h(String,function(f){return f+"m"})),l("NullLiteral").bases("Literal").build().field("value",null,s.null),l("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),(a=l("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)})).field.apply(a,h(m(RegExp,d),function(f){return"/".concat(f.pattern,"/").concat(f.flags||"")})).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var g=m(l("Property"),l("ObjectMethod"),l("ObjectProperty"),l("SpreadProperty"),l("SpreadElement"));l("ObjectExpression").bases("Expression").build("properties").field("properties",[g]),l("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",m("method","get","set")).field("key",m(l("Literal"),l("Identifier"),l("Expression"))).field("params",[l("Pattern")]).field("body",l("BlockStatement")).field("computed",Boolean,s.false).field("generator",Boolean,s.false).field("async",Boolean,s.false).field("accessibility",m(l("Literal"),null),s.null).field("decorators",m([l("Decorator")],null),s.null),l("ObjectProperty").bases("Node").build("key","value").field("key",m(l("Literal"),l("Identifier"),l("Expression"))).field("value",m(l("Expression"),l("Pattern"))).field("accessibility",m(l("Literal"),null),s.null).field("computed",Boolean,s.false);var u=m(l("MethodDefinition"),l("VariableDeclarator"),l("ClassPropertyDefinition"),l("ClassProperty"),l("ClassPrivateProperty"),l("ClassMethod"),l("ClassPrivateMethod"),l("ClassAccessorProperty"),l("StaticBlock"));l("ClassBody").bases("Declaration").build("body").field("body",[u]),l("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",m(l("Literal"),l("Identifier"),l("Expression"))),l("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",l("PrivateName")),l("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",m(l("Literal"),l("Identifier"),l("PrivateName"),l("Expression"))).field("value",m(l("Expression"),null),s.null),["ClassMethod","ClassPrivateMethod"].forEach(function(f){l(f).field("kind",m("get","set","method","constructor"),function(){return"method"}).field("body",l("BlockStatement")).field("access",m("public","private","protected",null),s.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(function(f){l(f).field("computed",Boolean,s.false).field("static",Boolean,s.false).field("abstract",Boolean,s.false).field("accessibility",m("public","private","protected",null),s.null).field("decorators",m([l("Decorator")],null),s.null).field("definite",Boolean,s.false).field("optional",Boolean,s.false).field("override",Boolean,s.false).field("readonly",Boolean,s.false)});var p=m(l("Property"),l("PropertyPattern"),l("SpreadPropertyPattern"),l("SpreadProperty"),l("ObjectProperty"),l("RestProperty"),l("RestElement"));l("ObjectPattern").bases("Pattern").build("properties").field("properties",[p]).field("decorators",m([l("Decorator")],null),s.null),l("SpreadProperty").bases("Node").build("argument").field("argument",l("Expression")),l("RestProperty").bases("Node").build("argument").field("argument",l("Expression")),l("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",m(l("VariableDeclaration"),l("Expression"))).field("right",l("Expression")).field("body",l("Statement")),l("Import").bases("Expression").build()}h0.default=MX;(0,m1.maybeSetModuleExports)(function(){return f1})});var g1=H((v0,h1)=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});var y0=(ue(),Q(le)),LX=y0.__importDefault(Be()),FX=y0.__importDefault(g0()),UX=y0.__importDefault(d0()),zX=_e();function BX(e){var t=e.use(LX.default),r=t.Type.def;e.use(FX.default),e.use(UX.default),r("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),r("TopicReference").bases("Expression").build()}v0.default=BX;(0,zX.maybeSetModuleExports)(function(){return h1})});var b1=H((b0,v1)=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var Zf=(ue(),Q(le)),GX=Zf.__importDefault(g0()),VX=Zf.__importDefault(l0()),WX=Zf.__importDefault(Be()),y1=Zf.__importStar(_e());function KX(e){e.use(GX.default),e.use(VX.default);var t=e.use(WX.default),r=t.namedTypes,i=t.Type.def,n=t.Type.or,a=e.use(y1.default).defaults,o=t.Type.from(function(d,h){return!!(r.StringLiteral&&r.StringLiteral.check(d,h)||r.Literal&&r.Literal.check(d,h)&&typeof d.value=="string")},"StringLiteral");i("TSType").bases("Node");var s=n(i("Identifier"),i("TSQualifiedName"));i("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",s),i("TSHasOptionalTypeParameterInstantiation").field("typeParameters",n(i("TSTypeParameterInstantiation"),null),a.null),i("TSHasOptionalTypeParameters").field("typeParameters",n(i("TSTypeParameterDeclaration"),null,void 0),a.null),i("TSHasOptionalTypeAnnotation").field("typeAnnotation",n(i("TSTypeAnnotation"),null),a.null),i("TSQualifiedName").bases("Node").build("left","right").field("left",s).field("right",s),i("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")).field("extra",n({parenthesized:Boolean},null),a.null),i("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",i("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(function(d){i(d).bases("TSType").build()}),i("TSArrayType").bases("TSType").build("elementType").field("elementType",i("TSType")),i("TSLiteralType").bases("TSType").build("literal").field("literal",n(i("NumericLiteral"),i("StringLiteral"),i("BooleanLiteral"),i("TemplateLiteral"),i("UnaryExpression"),i("BigIntLiteral"))),i("TemplateLiteral").field("expressions",n([i("Expression")],[i("TSType")])),["TSUnionType","TSIntersectionType"].forEach(function(d){i(d).bases("TSType").build("types").field("types",[i("TSType")])}),i("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",i("TSType")).field("extendsType",i("TSType")).field("trueType",i("TSType")).field("falseType",i("TSType")),i("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",i("TSTypeParameter")),i("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType"));var l=[n(i("Identifier"),i("RestElement"),i("ArrayPattern"),i("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(function(d){i(d).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",l)}),i("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,a.false).field("async",Boolean,a.false).field("generator",Boolean,a.false).field("id",n(i("Identifier"),null),a.null).field("params",[i("Pattern")]).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),a.null),i("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,a.false).field("generator",Boolean,a.false).field("params",[i("Pattern")]).field("abstract",Boolean,a.false).field("accessibility",n("public","private","protected",void 0),a.undefined).field("static",Boolean,a.false).field("computed",Boolean,a.false).field("optional",Boolean,a.false).field("key",n(i("Identifier"),i("StringLiteral"),i("NumericLiteral"),i("Expression"))).field("kind",n("get","set","method","constructor"),function(){return"method"}).field("access",n("public","private","protected",void 0),a.undefined).field("decorators",n([i("Decorator")],null),a.null).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),a.null),i("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",n(Boolean,"+","-"),a.false).field("typeParameter",i("TSTypeParameter")).field("optional",n(Boolean,"+","-"),a.false).field("typeAnnotation",n(i("TSType"),null),a.null),i("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[n(i("TSType"),i("TSNamedTupleMember"))]),i("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",i("Identifier")).field("optional",Boolean,a.false).field("elementType",i("TSType")),i("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",i("TSType")).field("indexType",i("TSType")),i("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",i("TSType")),i("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",n(i("TSType"),i("TSTypeAnnotation"))),i("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[i("Identifier")]).field("readonly",Boolean,a.false),i("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",i("Expression")).field("computed",Boolean,a.false).field("readonly",Boolean,a.false).field("optional",Boolean,a.false).field("initializer",n(i("Expression"),null),a.null),i("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",i("Expression")).field("computed",Boolean,a.false).field("optional",Boolean,a.false).field("parameters",l),i("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",n(i("Identifier"),i("TSThisType"))).field("typeAnnotation",n(i("TSTypeAnnotation"),null),a.null).field("asserts",Boolean,a.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(function(d){i(d).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",l)}),i("TSEnumMember").bases("Node").build("id","initializer").field("id",n(i("Identifier"),o)).field("initializer",n(i("Expression"),null),a.null),i("TSTypeQuery").bases("TSType").build("exprName").field("exprName",n(s,i("TSImportType")));var m=n(i("TSCallSignatureDeclaration"),i("TSConstructSignatureDeclaration"),i("TSIndexSignature"),i("TSMethodSignature"),i("TSPropertySignature"));i("TSTypeLiteral").bases("TSType").build("members").field("members",[m]),i("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",n(i("Identifier"),String)).field("constraint",n(i("TSType"),void 0),a.undefined).field("default",n(i("TSType"),void 0),a.undefined),i("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",i("TSType")).field("expression",i("Expression")).field("extra",n({parenthesized:Boolean},null),a.null),i("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[i("TSTypeParameter")]),i("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",i("Expression")),i("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[i("TSType")]),i("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",i("Identifier")).field("const",Boolean,a.false).field("declare",Boolean,a.false).field("members",[i("TSEnumMember")]).field("initializer",n(i("Expression"),null),a.null),i("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",i("Identifier")).field("declare",Boolean,a.false).field("typeAnnotation",i("TSType")),i("TSModuleBlock").bases("Node").build("body").field("body",[i("Statement")]),i("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",n(o,s)).field("declare",Boolean,a.false).field("global",Boolean,a.false).field("body",n(i("TSModuleBlock"),i("TSModuleDeclaration"),null),a.null),i("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",o).field("qualifier",n(s,void 0),a.undefined),i("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",i("Identifier")).field("isExport",Boolean,a.false).field("moduleReference",n(s,i("TSExternalModuleReference"))),i("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",o),i("TSExportAssignment").bases("Statement").build("expression").field("expression",i("Expression")),i("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",i("Identifier")),i("TSInterfaceBody").bases("Node").build("body").field("body",[m]),i("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",s),i("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",s).field("declare",Boolean,a.false).field("extends",n([i("TSExpressionWithTypeArguments")],null),a.null).field("body",i("TSInterfaceBody")),i("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",n("public","private","protected",void 0),a.undefined).field("readonly",Boolean,a.false).field("parameter",n(i("Identifier"),i("AssignmentPattern"))),i("ClassProperty").field("access",n("public","private","protected",void 0),a.undefined),i("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),i("ClassBody").field("body",[n(i("MethodDefinition"),i("VariableDeclarator"),i("ClassPropertyDefinition"),i("ClassProperty"),i("ClassPrivateProperty"),i("ClassAccessorProperty"),i("ClassMethod"),i("ClassPrivateMethod"),i("StaticBlock"),i("TSDeclareMethod"),m)])}b0.default=KX;(0,y1.maybeSetModuleExports)(function(){return v1})});var S1=H(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.namedTypes=void 0;var ZX;ZX=Xl.namedTypes||(Xl.namedTypes={})});var Ar=H(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.visit=de.use=de.Type=de.someField=de.PathVisitor=de.Path=de.NodePath=de.namedTypes=de.getSupertypeNames=de.getFieldValue=de.getFieldNames=de.getBuilderName=de.finalize=de.eachField=de.defineMethod=de.builtInTypes=de.builders=de.astNodesAreEquivalent=void 0;var Sa=(ue(),Q(le)),HX=Sa.__importDefault(Ej()),JX=Sa.__importDefault(fs()),XX=Sa.__importDefault(i1()),qX=Sa.__importDefault(d0()),YX=Sa.__importDefault(p1()),QX=Sa.__importDefault(g1()),e9=Sa.__importDefault(b1()),E1=S1();Object.defineProperty(de,"namedTypes",{enumerable:!0,get:function(){return E1.namedTypes}});var dt=(0,HX.default)([JX.default,XX.default,qX.default,YX.default,QX.default,e9.default]),t9=dt.astNodesAreEquivalent,r9=dt.builders,n9=dt.builtInTypes,i9=dt.defineMethod,a9=dt.eachField,o9=dt.finalize,s9=dt.getBuilderName,c9=dt.getFieldNames,l9=dt.getFieldValue,u9=dt.getSupertypeNames,d9=dt.namedTypes,p9=dt.NodePath,m9=dt.Path,f9=dt.PathVisitor,h9=dt.someField,g9=dt.Type,y9=dt.use,v9=dt.visit;de.astNodesAreEquivalent=t9;de.builders=r9;de.builtInTypes=n9;de.defineMethod=i9;de.eachField=a9;de.finalize=o9;de.getBuilderName=s9;de.getFieldNames=c9;de.getFieldValue=l9;de.getSupertypeNames=u9;de.NodePath=p9;de.Path=m9;de.PathVisitor=f9;de.someField=h9;de.Type=g9;de.use=y9;de.visit=v9;Object.assign(E1.namedTypes,d9)});var Xn={};Lr(Xn,{default:()=>D5});function D5(e,t){if(!e){if(C5)throw new Error($T);var r=typeof t=="function"?t():t,i=r?"".concat($T,": ").concat(r):$T;throw new Error(i)}}var C5,$T,qn=zC(()=>{C5=process.env.NODE_ENV==="production",$T="Invariant failed"});var oF=H(jT=>{var aF="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");jT.encode=function(e){if(0<=e&&e<aF.length)return aF[e];throw new TypeError("Must be between 0 and 63: "+e)};jT.decode=function(e){var t=65,r=90,i=97,n=122,a=48,o=57,s=43,l=47,m=26,d=52;return t<=e&&e<=r?e-t:i<=e&&e<=n?e-i+m:a<=e&&e<=o?e-a+d:e==s?62:e==l?63:-1}});var FT=H(LT=>{var sF=oF(),MT=5,cF=1<<MT,lF=cF-1,uF=cF;function I5(e){return e<0?(-e<<1)+1:(e<<1)+0}function k5(e){var t=(e&1)===1,r=e>>1;return t?-r:r}LT.encode=function(t){var r="",i,n=I5(t);do i=n&lF,n>>>=MT,n>0&&(i|=uF),r+=sF.encode(i);while(n>0);return r};LT.decode=function(t,r,i){var n=t.length,a=0,o=0,s,l;do{if(r>=n)throw new Error("Expected more digits in base 64 VLQ value.");if(l=sF.decode(t.charCodeAt(r++)),l===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));s=!!(l&uF),l&=lF,a=a+(l<<o),o+=MT}while(s);i.value=k5(a),i.rest=r}});var Ks=H(xt=>{function N5(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}xt.getArg=N5;var dF=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,w5=/^data:.+\,.+$/;function zu(e){var t=e.match(dF);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}xt.urlParse=zu;function Vs(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}xt.urlGenerate=Vs;function UT(e){var t=e,r=zu(e);if(r){if(!r.path)return e;t=r.path}for(var i=xt.isAbsolute(t),n=t.split(/\/+/),a,o=0,s=n.length-1;s>=0;s--)a=n[s],a==="."?n.splice(s,1):a===".."?o++:o>0&&(a===""?(n.splice(s+1,o),o=0):(n.splice(s,2),o--));return t=n.join("/"),t===""&&(t=i?"/":"."),r?(r.path=t,Vs(r)):t}xt.normalize=UT;function pF(e,t){e===""&&(e="."),t===""&&(t=".");var r=zu(t),i=zu(e);if(i&&(e=i.path||"/"),r&&!r.scheme)return i&&(r.scheme=i.scheme),Vs(r);if(r||t.match(w5))return t;if(i&&!i.host&&!i.path)return i.host=t,Vs(i);var n=t.charAt(0)==="/"?t:UT(e.replace(/\/+$/,"")+"/"+t);return i?(i.path=n,Vs(i)):n}xt.join=pF;xt.isAbsolute=function(e){return e.charAt(0)==="/"||dF.test(e)};function P5(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var i=e.lastIndexOf("/");if(i<0||(e=e.slice(0,i),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}xt.relative=P5;var mF=(function(){var e=Object.create(null);return!("__proto__"in e)})();function fF(e){return e}function R5(e){return hF(e)?"$"+e:e}xt.toSetString=mF?fF:R5;function O5(e){return hF(e)?e.slice(1):e}xt.fromSetString=mF?fF:O5;function hF(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function $5(e,t,r){var i=Ws(e.source,t.source);return i!==0||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0||r)||(i=e.generatedColumn-t.generatedColumn,i!==0)||(i=e.generatedLine-t.generatedLine,i!==0)?i:Ws(e.name,t.name)}xt.compareByOriginalPositions=$5;function j5(e,t,r){var i=e.generatedLine-t.generatedLine;return i!==0||(i=e.generatedColumn-t.generatedColumn,i!==0||r)||(i=Ws(e.source,t.source),i!==0)||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0)?i:Ws(e.name,t.name)}xt.compareByGeneratedPositionsDeflated=j5;function Ws(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function M5(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=Ws(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:Ws(e.name,t.name)}xt.compareByGeneratedPositionsInflated=M5;function L5(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}xt.parseSourceMapInput=L5;function F5(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var i=zu(r);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var n=i.path.lastIndexOf("/");n>=0&&(i.path=i.path.substring(0,n+1))}t=pF(Vs(i),t)}return UT(t)}xt.computeSourceURL=F5});var GT=H(gF=>{var zT=Ks(),BT=Object.prototype.hasOwnProperty,Fa=typeof Map<"u";function Yn(){this._array=[],this._set=Fa?new Map:Object.create(null)}Yn.fromArray=function(t,r){for(var i=new Yn,n=0,a=t.length;n<a;n++)i.add(t[n],r);return i};Yn.prototype.size=function(){return Fa?this._set.size:Object.getOwnPropertyNames(this._set).length};Yn.prototype.add=function(t,r){var i=Fa?t:zT.toSetString(t),n=Fa?this.has(t):BT.call(this._set,i),a=this._array.length;(!n||r)&&this._array.push(t),n||(Fa?this._set.set(t,a):this._set[i]=a)};Yn.prototype.has=function(t){if(Fa)return this._set.has(t);var r=zT.toSetString(t);return BT.call(this._set,r)};Yn.prototype.indexOf=function(t){if(Fa){var r=this._set.get(t);if(r>=0)return r}else{var i=zT.toSetString(t);if(BT.call(this._set,i))return this._set[i]}throw new Error('"'+t+'" is not in the set.')};Yn.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};Yn.prototype.toArray=function(){return this._array.slice()};gF.ArraySet=Yn});var bF=H(vF=>{var yF=Ks();function U5(e,t){var r=e.generatedLine,i=t.generatedLine,n=e.generatedColumn,a=t.generatedColumn;return i>r||i==r&&a>=n||yF.compareByGeneratedPositionsInflated(e,t)<=0}function Kh(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Kh.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};Kh.prototype.add=function(t){U5(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Kh.prototype.toArray=function(){return this._sorted||(this._array.sort(yF.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};vF.MappingList=Kh});var VT=H(SF=>{var Bu=FT(),Ye=Ks(),Zh=GT().ArraySet,z5=bF().MappingList;function Rr(e){e||(e={}),this._file=Ye.getArg(e,"file",null),this._sourceRoot=Ye.getArg(e,"sourceRoot",null),this._skipValidation=Ye.getArg(e,"skipValidation",!1),this._sources=new Zh,this._names=new Zh,this._mappings=new z5,this._sourcesContents=null}Rr.prototype._version=3;Rr.fromSourceMap=function(t){var r=t.sourceRoot,i=new Rr({file:t.file,sourceRoot:r});return t.eachMapping(function(n){var a={generated:{line:n.generatedLine,column:n.generatedColumn}};n.source!=null&&(a.source=n.source,r!=null&&(a.source=Ye.relative(r,a.source)),a.original={line:n.originalLine,column:n.originalColumn},n.name!=null&&(a.name=n.name)),i.addMapping(a)}),t.sources.forEach(function(n){var a=n;r!==null&&(a=Ye.relative(r,n)),i._sources.has(a)||i._sources.add(a);var o=t.sourceContentFor(n);o!=null&&i.setSourceContent(n,o)}),i};Rr.prototype.addMapping=function(t){var r=Ye.getArg(t,"generated"),i=Ye.getArg(t,"original",null),n=Ye.getArg(t,"source",null),a=Ye.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,i,n,a),n!=null&&(n=String(n),this._sources.has(n)||this._sources.add(n)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:i!=null&&i.line,originalColumn:i!=null&&i.column,source:n,name:a})};Rr.prototype.setSourceContent=function(t,r){var i=t;this._sourceRoot!=null&&(i=Ye.relative(this._sourceRoot,i)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Ye.toSetString(i)]=r):this._sourcesContents&&(delete this._sourcesContents[Ye.toSetString(i)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Rr.prototype.applySourceMap=function(t,r,i){var n=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);n=t.file}var a=this._sourceRoot;a!=null&&(n=Ye.relative(a,n));var o=new Zh,s=new Zh;this._mappings.unsortedForEach(function(l){if(l.source===n&&l.originalLine!=null){var m=t.originalPositionFor({line:l.originalLine,column:l.originalColumn});m.source!=null&&(l.source=m.source,i!=null&&(l.source=Ye.join(i,l.source)),a!=null&&(l.source=Ye.relative(a,l.source)),l.originalLine=m.line,l.originalColumn=m.column,m.name!=null&&(l.name=m.name))}var d=l.source;d!=null&&!o.has(d)&&o.add(d);var h=l.name;h!=null&&!s.has(h)&&s.add(h)},this),this._sources=o,this._names=s,t.sources.forEach(function(l){var m=t.sourceContentFor(l);m!=null&&(i!=null&&(l=Ye.join(i,l)),a!=null&&(l=Ye.relative(a,l)),this.setSourceContent(l,m))},this)};Rr.prototype._validateMapping=function(t,r,i,n){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!i&&!n)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&i)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:i,original:r,name:n}))}};Rr.prototype._serializeMappings=function(){for(var t=0,r=1,i=0,n=0,a=0,o=0,s="",l,m,d,h,g=this._mappings.toArray(),u=0,p=g.length;u<p;u++){if(m=g[u],l="",m.generatedLine!==r)for(t=0;m.generatedLine!==r;)l+=";",r++;else if(u>0){if(!Ye.compareByGeneratedPositionsInflated(m,g[u-1]))continue;l+=","}l+=Bu.encode(m.generatedColumn-t),t=m.generatedColumn,m.source!=null&&(h=this._sources.indexOf(m.source),l+=Bu.encode(h-o),o=h,l+=Bu.encode(m.originalLine-1-n),n=m.originalLine-1,l+=Bu.encode(m.originalColumn-i),i=m.originalColumn,m.name!=null&&(d=this._names.indexOf(m.name),l+=Bu.encode(d-a),a=d)),s+=l}return s};Rr.prototype._generateSourcesContent=function(t,r){return t.map(function(i){if(!this._sourcesContents)return null;r!=null&&(i=Ye.relative(r,i));var n=Ye.toSetString(i);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};Rr.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};Rr.prototype.toString=function(){return JSON.stringify(this.toJSON())};SF.SourceMapGenerator=Rr});var EF=H(Ua=>{Ua.GREATEST_LOWER_BOUND=1;Ua.LEAST_UPPER_BOUND=2;function WT(e,t,r,i,n,a){var o=Math.floor((t-e)/2)+e,s=n(r,i[o],!0);return s===0?o:s>0?t-o>1?WT(o,t,r,i,n,a):a==Ua.LEAST_UPPER_BOUND?t<i.length?t:-1:o:o-e>1?WT(e,o,r,i,n,a):a==Ua.LEAST_UPPER_BOUND?o:e<0?-1:e}Ua.search=function(t,r,i,n){if(r.length===0)return-1;var a=WT(-1,r.length,t,r,i,n||Ua.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&i(r[a],r[a-1],!0)===0;)--a;return a}});var xF=H(AF=>{function KT(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function B5(e,t){return Math.round(e+Math.random()*(t-e))}function ZT(e,t,r,i){if(r<i){var n=B5(r,i),a=r-1;KT(e,n,i);for(var o=e[i],s=r;s<i;s++)t(e[s],o)<=0&&(a+=1,KT(e,a,s));KT(e,a+1,s);var l=a+1;ZT(e,t,r,l-1),ZT(e,t,l+1,i)}}AF.quickSort=function(e,t){ZT(e,t,0,e.length-1)}});var TF=H(Hh=>{var V=Ks(),HT=EF(),Zs=GT().ArraySet,G5=FT(),Gu=xF().quickSort;function Fe(e,t){var r=e;return typeof e=="string"&&(r=V.parseSourceMapInput(e)),r.sections!=null?new Hr(r,t):new gt(r,t)}Fe.fromSourceMap=function(e,t){return gt.fromSourceMap(e,t)};Fe.prototype._version=3;Fe.prototype.__generatedMappings=null;Object.defineProperty(Fe.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Fe.prototype.__originalMappings=null;Object.defineProperty(Fe.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Fe.prototype._charIsMappingSeparator=function(t,r){var i=t.charAt(r);return i===";"||i===","};Fe.prototype._parseMappings=function(t,r){throw new Error("Subclasses must implement _parseMappings")};Fe.GENERATED_ORDER=1;Fe.ORIGINAL_ORDER=2;Fe.GREATEST_LOWER_BOUND=1;Fe.LEAST_UPPER_BOUND=2;Fe.prototype.eachMapping=function(t,r,i){var n=r||null,a=i||Fe.GENERATED_ORDER,o;switch(a){case Fe.GENERATED_ORDER:o=this._generatedMappings;break;case Fe.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;o.map(function(l){var m=l.source===null?null:this._sources.at(l.source);return m=V.computeSourceURL(s,m,this._sourceMapURL),{source:m,generatedLine:l.generatedLine,generatedColumn:l.generatedColumn,originalLine:l.originalLine,originalColumn:l.originalColumn,name:l.name===null?null:this._names.at(l.name)}},this).forEach(t,n)};Fe.prototype.allGeneratedPositionsFor=function(t){var r=V.getArg(t,"line"),i={source:V.getArg(t,"source"),originalLine:r,originalColumn:V.getArg(t,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var n=[],a=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",V.compareByOriginalPositions,HT.LEAST_UPPER_BOUND);if(a>=0){var o=this._originalMappings[a];if(t.column===void 0)for(var s=o.originalLine;o&&o.originalLine===s;)n.push({line:V.getArg(o,"generatedLine",null),column:V.getArg(o,"generatedColumn",null),lastColumn:V.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++a];else for(var l=o.originalColumn;o&&o.originalLine===r&&o.originalColumn==l;)n.push({line:V.getArg(o,"generatedLine",null),column:V.getArg(o,"generatedColumn",null),lastColumn:V.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++a]}return n};Hh.SourceMapConsumer=Fe;function gt(e,t){var r=e;typeof e=="string"&&(r=V.parseSourceMapInput(e));var i=V.getArg(r,"version"),n=V.getArg(r,"sources"),a=V.getArg(r,"names",[]),o=V.getArg(r,"sourceRoot",null),s=V.getArg(r,"sourcesContent",null),l=V.getArg(r,"mappings"),m=V.getArg(r,"file",null);if(i!=this._version)throw new Error("Unsupported version: "+i);o&&(o=V.normalize(o)),n=n.map(String).map(V.normalize).map(function(d){return o&&V.isAbsolute(o)&&V.isAbsolute(d)?V.relative(o,d):d}),this._names=Zs.fromArray(a.map(String),!0),this._sources=Zs.fromArray(n,!0),this._absoluteSources=this._sources.toArray().map(function(d){return V.computeSourceURL(o,d,t)}),this.sourceRoot=o,this.sourcesContent=s,this._mappings=l,this._sourceMapURL=t,this.file=m}gt.prototype=Object.create(Fe.prototype);gt.prototype.consumer=Fe;gt.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=V.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1};gt.fromSourceMap=function(t,r){var i=Object.create(gt.prototype),n=i._names=Zs.fromArray(t._names.toArray(),!0),a=i._sources=Zs.fromArray(t._sources.toArray(),!0);i.sourceRoot=t._sourceRoot,i.sourcesContent=t._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=t._file,i._sourceMapURL=r,i._absoluteSources=i._sources.toArray().map(function(u){return V.computeSourceURL(i.sourceRoot,u,r)});for(var o=t._mappings.toArray().slice(),s=i.__generatedMappings=[],l=i.__originalMappings=[],m=0,d=o.length;m<d;m++){var h=o[m],g=new _F;g.generatedLine=h.generatedLine,g.generatedColumn=h.generatedColumn,h.source&&(g.source=a.indexOf(h.source),g.originalLine=h.originalLine,g.originalColumn=h.originalColumn,h.name&&(g.name=n.indexOf(h.name)),l.push(g)),s.push(g)}return Gu(i.__originalMappings,V.compareByOriginalPositions),i};gt.prototype._version=3;Object.defineProperty(gt.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function _F(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}gt.prototype._parseMappings=function(t,r){for(var i=1,n=0,a=0,o=0,s=0,l=0,m=t.length,d=0,h={},g={},u=[],p=[],f,y,v,b,_;d<m;)if(t.charAt(d)===";")i++,d++,n=0;else if(t.charAt(d)===",")d++;else{for(f=new _F,f.generatedLine=i,b=d;b<m&&!this._charIsMappingSeparator(t,b);b++);if(y=t.slice(d,b),v=h[y],v)d+=y.length;else{for(v=[];d<b;)G5.decode(t,d,g),_=g.value,d=g.rest,v.push(_);if(v.length===2)throw new Error("Found a source, but no line and column");if(v.length===3)throw new Error("Found a source and line, but no column");h[y]=v}f.generatedColumn=n+v[0],n=f.generatedColumn,v.length>1&&(f.source=s+v[1],s+=v[1],f.originalLine=a+v[2],a=f.originalLine,f.originalLine+=1,f.originalColumn=o+v[3],o=f.originalColumn,v.length>4&&(f.name=l+v[4],l+=v[4])),p.push(f),typeof f.originalLine=="number"&&u.push(f)}Gu(p,V.compareByGeneratedPositionsDeflated),this.__generatedMappings=p,Gu(u,V.compareByOriginalPositions),this.__originalMappings=u};gt.prototype._findMapping=function(t,r,i,n,a,o){if(t[i]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[i]);if(t[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[n]);return HT.search(t,r,a,o)};gt.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var i=this._generatedMappings[t+1];if(r.generatedLine===i.generatedLine){r.lastGeneratedColumn=i.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};gt.prototype.originalPositionFor=function(t){var r={generatedLine:V.getArg(t,"line"),generatedColumn:V.getArg(t,"column")},i=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",V.compareByGeneratedPositionsDeflated,V.getArg(t,"bias",Fe.GREATEST_LOWER_BOUND));if(i>=0){var n=this._generatedMappings[i];if(n.generatedLine===r.generatedLine){var a=V.getArg(n,"source",null);a!==null&&(a=this._sources.at(a),a=V.computeSourceURL(this.sourceRoot,a,this._sourceMapURL));var o=V.getArg(n,"name",null);return o!==null&&(o=this._names.at(o)),{source:a,line:V.getArg(n,"originalLine",null),column:V.getArg(n,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};gt.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};gt.prototype.sourceContentFor=function(t,r){if(!this.sourcesContent)return null;var i=this._findSourceIndex(t);if(i>=0)return this.sourcesContent[i];var n=t;this.sourceRoot!=null&&(n=V.relative(this.sourceRoot,n));var a;if(this.sourceRoot!=null&&(a=V.urlParse(this.sourceRoot))){var o=n.replace(/^file:\/\//,"");if(a.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!a.path||a.path=="/")&&this._sources.has("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(r)return null;throw new Error('"'+n+'" is not in the SourceMap.')};gt.prototype.generatedPositionFor=function(t){var r=V.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var i={source:r,originalLine:V.getArg(t,"line"),originalColumn:V.getArg(t,"column")},n=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",V.compareByOriginalPositions,V.getArg(t,"bias",Fe.GREATEST_LOWER_BOUND));if(n>=0){var a=this._originalMappings[n];if(a.source===i.source)return{line:V.getArg(a,"generatedLine",null),column:V.getArg(a,"generatedColumn",null),lastColumn:V.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Hh.BasicSourceMapConsumer=gt;function Hr(e,t){var r=e;typeof e=="string"&&(r=V.parseSourceMapInput(e));var i=V.getArg(r,"version"),n=V.getArg(r,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new Zs,this._names=new Zs;var a={line:-1,column:0};this._sections=n.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var s=V.getArg(o,"offset"),l=V.getArg(s,"line"),m=V.getArg(s,"column");if(l<a.line||l===a.line&&m<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=s,{generatedOffset:{generatedLine:l+1,generatedColumn:m+1},consumer:new Fe(V.getArg(o,"map"),t)}})}Hr.prototype=Object.create(Fe.prototype);Hr.prototype.constructor=Fe;Hr.prototype._version=3;Object.defineProperty(Hr.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}});Hr.prototype.originalPositionFor=function(t){var r={generatedLine:V.getArg(t,"line"),generatedColumn:V.getArg(t,"column")},i=HT.search(r,this._sections,function(a,o){var s=a.generatedLine-o.generatedOffset.generatedLine;return s||a.generatedColumn-o.generatedOffset.generatedColumn}),n=this._sections[i];return n?n.consumer.originalPositionFor({line:r.generatedLine-(n.generatedOffset.generatedLine-1),column:r.generatedColumn-(n.generatedOffset.generatedLine===r.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}};Hr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};Hr.prototype.sourceContentFor=function(t,r){for(var i=0;i<this._sections.length;i++){var n=this._sections[i],a=n.consumer.sourceContentFor(t,!0);if(a)return a}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')};Hr.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var i=this._sections[r];if(i.consumer._findSourceIndex(V.getArg(t,"source"))!==-1){var n=i.consumer.generatedPositionFor(t);if(n){var a={line:n.line+(i.generatedOffset.generatedLine-1),column:n.column+(i.generatedOffset.generatedLine===n.line?i.generatedOffset.generatedColumn-1:0)};return a}}}return{line:null,column:null}};Hr.prototype._parseMappings=function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var i=0;i<this._sections.length;i++)for(var n=this._sections[i],a=n.consumer._generatedMappings,o=0;o<a.length;o++){var s=a[o],l=n.consumer._sources.at(s.source);l=V.computeSourceURL(n.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var m=null;s.name&&(m=n.consumer._names.at(s.name),this._names.add(m),m=this._names.indexOf(m));var d={source:l,generatedLine:s.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(n.generatedOffset.generatedLine===s.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:m};this.__generatedMappings.push(d),typeof d.originalLine=="number"&&this.__originalMappings.push(d)}Gu(this.__generatedMappings,V.compareByGeneratedPositionsDeflated),Gu(this.__originalMappings,V.compareByOriginalPositions)};Hh.IndexedSourceMapConsumer=Hr});var DF=H(CF=>{var V5=VT().SourceMapGenerator,Jh=Ks(),W5=/(\r?\n)/,K5=10,Hs="$$$isSourceNode$$$";function sr(e,t,r,i,n){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=r??null,this.name=n??null,this[Hs]=!0,i!=null&&this.add(i)}sr.fromStringWithSourceMap=function(t,r,i){var n=new sr,a=t.split(W5),o=0,s=function(){var g=p(),u=p()||"";return g+u;function p(){return o<a.length?a[o++]:void 0}},l=1,m=0,d=null;return r.eachMapping(function(g){if(d!==null)if(l<g.generatedLine)h(d,s()),l++,m=0;else{var u=a[o]||"",p=u.substr(0,g.generatedColumn-m);a[o]=u.substr(g.generatedColumn-m),m=g.generatedColumn,h(d,p),d=g;return}for(;l<g.generatedLine;)n.add(s()),l++;if(m<g.generatedColumn){var u=a[o]||"";n.add(u.substr(0,g.generatedColumn)),a[o]=u.substr(g.generatedColumn),m=g.generatedColumn}d=g},this),o<a.length&&(d&&h(d,s()),n.add(a.splice(o).join(""))),r.sources.forEach(function(g){var u=r.sourceContentFor(g);u!=null&&(i!=null&&(g=Jh.join(i,g)),n.setSourceContent(g,u))}),n;function h(g,u){if(g===null||g.source===void 0)n.add(u);else{var p=i?Jh.join(i,g.source):g.source;n.add(new sr(g.originalLine,g.originalColumn,p,u,g.name))}}};sr.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[Hs]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};sr.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[Hs]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};sr.prototype.walk=function(t){for(var r,i=0,n=this.children.length;i<n;i++)r=this.children[i],r[Hs]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})};sr.prototype.join=function(t){var r,i,n=this.children.length;if(n>0){for(r=[],i=0;i<n-1;i++)r.push(this.children[i]),r.push(t);r.push(this.children[i]),this.children=r}return this};sr.prototype.replaceRight=function(t,r){var i=this.children[this.children.length-1];return i[Hs]?i.replaceRight(t,r):typeof i=="string"?this.children[this.children.length-1]=i.replace(t,r):this.children.push("".replace(t,r)),this};sr.prototype.setSourceContent=function(t,r){this.sourceContents[Jh.toSetString(t)]=r};sr.prototype.walkSourceContents=function(t){for(var r=0,i=this.children.length;r<i;r++)this.children[r][Hs]&&this.children[r].walkSourceContents(t);for(var n=Object.keys(this.sourceContents),r=0,i=n.length;r<i;r++)t(Jh.fromSetString(n[r]),this.sourceContents[n[r]])};sr.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t};sr.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},i=new V5(t),n=!1,a=null,o=null,s=null,l=null;return this.walk(function(m,d){r.code+=m,d.source!==null&&d.line!==null&&d.column!==null?((a!==d.source||o!==d.line||s!==d.column||l!==d.name)&&i.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name}),a=d.source,o=d.line,s=d.column,l=d.name,n=!0):n&&(i.addMapping({generated:{line:r.line,column:r.column}}),a=null,n=!1);for(var h=0,g=m.length;h<g;h++)m.charCodeAt(h)===K5?(r.line++,r.column=0,h+1===g?(a=null,n=!1):n&&i.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name})):r.column++}),this.walkSourceContents(function(m,d){i.setSourceContent(m,d)}),{code:r.code,map:i}};CF.SourceNode=sr});var JT=H(Xh=>{Xh.SourceMapGenerator=VT().SourceMapGenerator;Xh.SourceMapConsumer=TF().SourceMapConsumer;Xh.SourceNode=DF().SourceNode});var vn=H(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.isTrailingCommaEnabled=je.getParentExportDeclaration=je.isExportDeclaration=je.fixFaultyLocations=je.getTrueLoc=je.composeSourceMaps=je.copyPos=je.comparePos=je.getUnionOfKeys=je.getOption=je.isBrowser=je.getLineTerminator=void 0;var qT=(ue(),Q(le)),Vu=qT.__importDefault((qn(),Q(Xn))),Z5=qT.__importStar(Ar()),qh=Z5.namedTypes,kF=qT.__importDefault(JT()),IF=kF.default.SourceMapConsumer,H5=kF.default.SourceMapGenerator,NF=Object.prototype.hasOwnProperty;function J5(){return wF()?`
4
+ var Uz=Object.create;var yd=Object.defineProperty;var zz=Object.getOwnPropertyDescriptor;var Bz=Object.getOwnPropertyNames;var Gz=Object.getPrototypeOf,Vz=Object.prototype.hasOwnProperty;var UC=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var zC=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var H=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Lr=(e,t)=>{for(var r in t)yd(e,r,{get:t[r],enumerable:!0})},BC=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Bz(t))!Vz.call(e,n)&&n!==r&&yd(e,n,{get:()=>t[n],enumerable:!(i=zz(t,n))||i.enumerable});return e};var lc=(e,t,r)=>(r=e!=null?Uz(Gz(e)):{},BC(t||!e||!e.__esModule?yd(r,"default",{value:e,enumerable:!0}):r,e)),Q=e=>BC(yd({},"__esModule",{value:!0}),e);var i1=H((_ue,Uf)=>{var N$,w$,P$,R$,O$,$$,j$,M$,L$,F$,U$,z$,B$,Lf,__,G$,V$,W$,ds,K$,Z$,H$,J$,X$,q$,Y$,Q$,e1,Ff,t1,r1,n1;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){e(r(t,r(i)))}):typeof Uf=="object"&&typeof Uf.exports=="object"?e(r(t,r(Uf.exports))):e(r(t));function r(i,n){return i!==t&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(a,o){return i[a]=n?n(a,o):o}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(a[s]=o[s])};N$=function(a,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(a,o);function s(){this.constructor=a}a.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)},w$=Object.assign||function(a){for(var o,s=1,l=arguments.length;s<l;s++){o=arguments[s];for(var m in o)Object.prototype.hasOwnProperty.call(o,m)&&(a[m]=o[m])}return a},P$=function(a,o){var s={};for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&o.indexOf(l)<0&&(s[l]=a[l]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var m=0,l=Object.getOwnPropertySymbols(a);m<l.length;m++)o.indexOf(l[m])<0&&Object.prototype.propertyIsEnumerable.call(a,l[m])&&(s[l[m]]=a[l[m]]);return s},R$=function(a,o,s,l){var m=arguments.length,d=m<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(a,o,s,l);else for(var g=a.length-1;g>=0;g--)(h=a[g])&&(d=(m<3?h(d):m>3?h(o,s,d):h(o,s))||d);return m>3&&d&&Object.defineProperty(o,s,d),d},O$=function(a,o){return function(s,l){o(s,l,a)}},$$=function(a,o,s,l,m,d){function h(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var g=l.kind,u=g==="getter"?"get":g==="setter"?"set":"value",p=!o&&a?l.static?a:a.prototype:null,f=o||(p?Object.getOwnPropertyDescriptor(p,l.name):{}),y,v=!1,b=s.length-1;b>=0;b--){var _={};for(var A in l)_[A]=A==="access"?{}:l[A];for(var A in l.access)_.access[A]=l.access[A];_.addInitializer=function(C){if(v)throw new TypeError("Cannot add initializers after decoration has completed");d.push(h(C||null))};var x=(0,s[b])(g==="accessor"?{get:f.get,set:f.set}:f[u],_);if(g==="accessor"){if(x===void 0)continue;if(x===null||typeof x!="object")throw new TypeError("Object expected");(y=h(x.get))&&(f.get=y),(y=h(x.set))&&(f.set=y),(y=h(x.init))&&m.unshift(y)}else(y=h(x))&&(g==="field"?m.unshift(y):f[u]=y)}p&&Object.defineProperty(p,l.name,f),v=!0},j$=function(a,o,s){for(var l=arguments.length>2,m=0;m<o.length;m++)s=l?o[m].call(a,s):o[m].call(a);return l?s:void 0},M$=function(a){return typeof a=="symbol"?a:"".concat(a)},L$=function(a,o,s){return typeof o=="symbol"&&(o=o.description?"[".concat(o.description,"]"):""),Object.defineProperty(a,"name",{configurable:!0,value:s?"".concat(s," ",o):o})},F$=function(a,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,o)},U$=function(a,o,s,l){function m(d){return d instanceof s?d:new s(function(h){h(d)})}return new(s||(s=Promise))(function(d,h){function g(f){try{p(l.next(f))}catch(y){h(y)}}function u(f){try{p(l.throw(f))}catch(y){h(y)}}function p(f){f.done?d(f.value):m(f.value).then(g,u)}p((l=l.apply(a,o||[])).next())})},z$=function(a,o){var s={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},l,m,d,h=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return h.next=g(0),h.throw=g(1),h.return=g(2),typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function g(p){return function(f){return u([p,f])}}function u(p){if(l)throw new TypeError("Generator is already executing.");for(;h&&(h=0,p[0]&&(s=0)),s;)try{if(l=1,m&&(d=p[0]&2?m.return:p[0]?m.throw||((d=m.return)&&d.call(m),0):m.next)&&!(d=d.call(m,p[1])).done)return d;switch(m=0,d&&(p=[p[0]&2,d.value]),p[0]){case 0:case 1:d=p;break;case 4:return s.label++,{value:p[1],done:!1};case 5:s.label++,m=p[1],p=[0];continue;case 7:p=s.ops.pop(),s.trys.pop();continue;default:if(d=s.trys,!(d=d.length>0&&d[d.length-1])&&(p[0]===6||p[0]===2)){s=0;continue}if(p[0]===3&&(!d||p[1]>d[0]&&p[1]<d[3])){s.label=p[1];break}if(p[0]===6&&s.label<d[1]){s.label=d[1],d=p;break}if(d&&s.label<d[2]){s.label=d[2],s.ops.push(p);break}d[2]&&s.ops.pop(),s.trys.pop();continue}p=o.call(a,s)}catch(f){p=[6,f],m=0}finally{l=d=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},B$=function(a,o){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&Ff(o,a,s)},Ff=Object.create?(function(a,o,s,l){l===void 0&&(l=s);var m=Object.getOwnPropertyDescriptor(o,s);(!m||("get"in m?!o.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(a,l,m)}):(function(a,o,s,l){l===void 0&&(l=s),a[l]=o[s]}),Lf=function(a){var o=typeof Symbol=="function"&&Symbol.iterator,s=o&&a[o],l=0;if(s)return s.call(a);if(a&&typeof a.length=="number")return{next:function(){return a&&l>=a.length&&(a=void 0),{value:a&&a[l++],done:!a}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},__=function(a,o){var s=typeof Symbol=="function"&&a[Symbol.iterator];if(!s)return a;var l=s.call(a),m,d=[],h;try{for(;(o===void 0||o-- >0)&&!(m=l.next()).done;)d.push(m.value)}catch(g){h={error:g}}finally{try{m&&!m.done&&(s=l.return)&&s.call(l)}finally{if(h)throw h.error}}return d},G$=function(){for(var a=[],o=0;o<arguments.length;o++)a=a.concat(__(arguments[o]));return a},V$=function(){for(var a=0,o=0,s=arguments.length;o<s;o++)a+=arguments[o].length;for(var l=Array(a),m=0,o=0;o<s;o++)for(var d=arguments[o],h=0,g=d.length;h<g;h++,m++)l[m]=d[h];return l},W$=function(a,o,s){if(s||arguments.length===2)for(var l=0,m=o.length,d;l<m;l++)(d||!(l in o))&&(d||(d=Array.prototype.slice.call(o,0,l)),d[l]=o[l]);return a.concat(d||Array.prototype.slice.call(o))},ds=function(a){return this instanceof ds?(this.v=a,this):new ds(a)},K$=function(a,o,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=s.apply(a,o||[]),m,d=[];return m=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),g("next"),g("throw"),g("return",h),m[Symbol.asyncIterator]=function(){return this},m;function h(b){return function(_){return Promise.resolve(_).then(b,y)}}function g(b,_){l[b]&&(m[b]=function(A){return new Promise(function(x,C){d.push([b,A,x,C])>1||u(b,A)})},_&&(m[b]=_(m[b])))}function u(b,_){try{p(l[b](_))}catch(A){v(d[0][3],A)}}function p(b){b.value instanceof ds?Promise.resolve(b.value.v).then(f,y):v(d[0][2],b)}function f(b){u("next",b)}function y(b){u("throw",b)}function v(b,_){b(_),d.shift(),d.length&&u(d[0][0],d[0][1])}},Z$=function(a){var o,s;return o={},l("next"),l("throw",function(m){throw m}),l("return"),o[Symbol.iterator]=function(){return this},o;function l(m,d){o[m]=a[m]?function(h){return(s=!s)?{value:ds(a[m](h)),done:!1}:d?d(h):h}:d}},H$=function(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=a[Symbol.asyncIterator],s;return o?o.call(a):(a=typeof Lf=="function"?Lf(a):a[Symbol.iterator](),s={},l("next"),l("throw"),l("return"),s[Symbol.asyncIterator]=function(){return this},s);function l(d){s[d]=a[d]&&function(h){return new Promise(function(g,u){h=a[d](h),m(g,u,h.done,h.value)})}}function m(d,h,g,u){Promise.resolve(u).then(function(p){d({value:p,done:g})},h)}},J$=function(a,o){return Object.defineProperty?Object.defineProperty(a,"raw",{value:o}):a.raw=o,a};var r=Object.create?(function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}):function(a,o){a.default=o},i=function(a){return i=Object.getOwnPropertyNames||function(o){var s=[];for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(s[s.length]=l);return s},i(a)};X$=function(a){if(a&&a.__esModule)return a;var o={};if(a!=null)for(var s=i(a),l=0;l<s.length;l++)s[l]!=="default"&&Ff(o,a,s[l]);return r(o,a),o},q$=function(a){return a&&a.__esModule?a:{default:a}},Y$=function(a,o,s,l){if(s==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?a!==o||!l:!o.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?l:s==="a"?l.call(a):l?l.value:o.get(a)},Q$=function(a,o,s,l,m){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!m)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?a!==o||!m:!o.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?m.call(a,s):m?m.value=s:o.set(a,s),s},e1=function(a,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof a=="function"?o===a:a.has(o)},t1=function(a,o,s){if(o!=null){if(typeof o!="object"&&typeof o!="function")throw new TypeError("Object expected.");var l,m;if(s){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");l=o[Symbol.asyncDispose]}if(l===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");l=o[Symbol.dispose],s&&(m=l)}if(typeof l!="function")throw new TypeError("Object not disposable.");m&&(l=function(){try{m.call(this)}catch(d){return Promise.reject(d)}}),a.stack.push({value:o,dispose:l,async:s})}else s&&a.stack.push({async:!0});return o};var n=typeof SuppressedError=="function"?SuppressedError:function(a,o,s){var l=new Error(s);return l.name="SuppressedError",l.error=a,l.suppressed=o,l};r1=function(a){function o(d){a.error=a.hasError?new n(d,a.error,"An error was suppressed during disposal."):d,a.hasError=!0}var s,l=0;function m(){for(;s=a.stack.pop();)try{if(!s.async&&l===1)return l=0,a.stack.push(s),Promise.resolve().then(m);if(s.dispose){var d=s.dispose.call(s.value);if(s.async)return l|=2,Promise.resolve(d).then(m,function(h){return o(h),m()})}else l|=1}catch(h){o(h)}if(l===1)return a.hasError?Promise.reject(a.error):Promise.resolve();if(a.hasError)throw a.error}return m()},n1=function(a,o){return typeof a=="string"&&/^\.\.?\//.test(a)?a.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(s,l,m,d,h){return l?o?".jsx":".js":m&&(!d||!h)?s:m+d+"."+h.toLowerCase()+"js"}):a},e("__extends",N$),e("__assign",w$),e("__rest",P$),e("__decorate",R$),e("__param",O$),e("__esDecorate",$$),e("__runInitializers",j$),e("__propKey",M$),e("__setFunctionName",L$),e("__metadata",F$),e("__awaiter",U$),e("__generator",z$),e("__exportStar",B$),e("__createBinding",Ff),e("__values",Lf),e("__read",__),e("__spread",G$),e("__spreadArrays",V$),e("__spreadArray",W$),e("__await",ds),e("__asyncGenerator",K$),e("__asyncDelegator",Z$),e("__asyncValues",H$),e("__makeTemplateObject",J$),e("__importStar",X$),e("__importDefault",q$),e("__classPrivateFieldGet",Y$),e("__classPrivateFieldSet",Q$),e("__classPrivateFieldIn",e1),e("__addDisposableResource",t1),e("__disposeResources",r1),e("__rewriteRelativeImportExtension",n1)})});var le={};Lr(le,{__addDisposableResource:()=>GH,__assign:()=>hH,__asyncDelegator:()=>$H,__asyncGenerator:()=>OH,__asyncValues:()=>jH,__await:()=>RH,__awaiter:()=>_H,__classPrivateFieldGet:()=>UH,__classPrivateFieldIn:()=>BH,__classPrivateFieldSet:()=>zH,__createBinding:()=>DH,__decorate:()=>yH,__disposeResources:()=>VH,__esDecorate:()=>bH,__exportStar:()=>CH,__extends:()=>fH,__generator:()=>TH,__importDefault:()=>FH,__importStar:()=>LH,__makeTemplateObject:()=>MH,__metadata:()=>xH,__param:()=>vH,__propKey:()=>EH,__read:()=>kH,__rest:()=>gH,__rewriteRelativeImportExtension:()=>WH,__runInitializers:()=>SH,__setFunctionName:()=>AH,__spread:()=>NH,__spreadArray:()=>PH,__spreadArrays:()=>wH,__values:()=>IH,default:()=>KH});var T_,fH,hH,gH,yH,vH,bH,SH,EH,AH,xH,_H,TH,CH,DH,IH,kH,NH,wH,PH,RH,OH,$H,jH,MH,LH,FH,UH,zH,BH,GH,VH,WH,KH,ue=zC(()=>{T_=lc(i1(),1),{__extends:fH,__assign:hH,__rest:gH,__decorate:yH,__param:vH,__esDecorate:bH,__runInitializers:SH,__propKey:EH,__setFunctionName:AH,__metadata:xH,__awaiter:_H,__generator:TH,__exportStar:CH,__createBinding:DH,__values:IH,__read:kH,__spread:NH,__spreadArrays:wH,__spreadArray:PH,__await:RH,__asyncGenerator:OH,__asyncDelegator:$H,__asyncValues:jH,__makeTemplateObject:MH,__importStar:LH,__importDefault:FH,__classPrivateFieldGet:UH,__classPrivateFieldSet:zH,__classPrivateFieldIn:BH,__addDisposableResource:GH,__disposeResources:VH,__rewriteRelativeImportExtension:WH}=T_.default,KH=T_.default});var _e=H(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.maybeSetModuleExports=void 0;var ZH=(ue(),Q(le)),HH=ZH.__importDefault(Be());function JH(e){var t=e.use(HH.default),r=t.Type,i=t.builtInTypes,n=i.number;function a(m){return r.from(function(d){return n.check(d)&&d>=m},n+" >= "+m)}var o={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}},s=r.or(i.string,i.number,i.boolean,i.null,i.undefined),l=r.from(function(m){if(m===null)return!0;var d=typeof m;return!(d==="object"||d==="function")},s.toString());return{geq:a,defaults:o,isPrimitive:l}}Wl.default=JH;function XH(e){try{var t=e(),r=t.exports,i=r.default}catch{return}i&&i!==r&&typeof r=="object"&&(Object.assign(i,r,{default:i}),r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0}),t.exports=i)}Wl.maybeSetModuleExports=XH});var Be=H((Hl,u1)=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.Def=void 0;var ps=(ue(),Q(le)),qH=_e(),l1=Object.prototype,Bf=l1.toString,Er=l1.hasOwnProperty,Zl=(function(){function e(){}return e.prototype.assert=function(t,r){if(!this.check(t,r)){var i=D_(t);throw new Error(i+" does not match type "+this)}return!0},e.prototype.arrayOf=function(){var t=this;return new C_(t)},e})(),C_=(function(e){ps.__extends(t,e);function t(r){var i=e.call(this)||this;return i.elemType=r,i.kind="ArrayType",i}return t.prototype.toString=function(){return"["+this.elemType+"]"},t.prototype.check=function(r,i){var n=this;return Array.isArray(r)&&r.every(function(a){return n.elemType.check(a,i)})},t})(Zl),a1=(function(e){ps.__extends(t,e);function t(r){var i=e.call(this)||this;return i.value=r,i.kind="IdentityType",i}return t.prototype.toString=function(){return String(this.value)},t.prototype.check=function(r,i){var n=r===this.value;return!n&&typeof i=="function"&&i(this,r),n},t})(Zl),o1=(function(e){ps.__extends(t,e);function t(r){var i=e.call(this)||this;return i.fields=r,i.kind="ObjectType",i}return t.prototype.toString=function(){return"{ "+this.fields.join(", ")+" }"},t.prototype.check=function(r,i){return Bf.call(r)===Bf.call({})&&this.fields.every(function(n){return n.type.check(r[n.name],i)})},t})(Zl),s1=(function(e){ps.__extends(t,e);function t(r){var i=e.call(this)||this;return i.types=r,i.kind="OrType",i}return t.prototype.toString=function(){return this.types.join(" | ")},t.prototype.check=function(r,i){return this.types.some(function(n){return n.check(r,!!i)})?!0:(typeof i=="function"&&i(this,r),!1)},t})(Zl),Kl=(function(e){ps.__extends(t,e);function t(r,i){var n=e.call(this)||this;return n.name=r,n.predicate=i,n.kind="PredicateType",n}return t.prototype.toString=function(){return this.name},t.prototype.check=function(r,i){var n=this.predicate(r,i);return!n&&typeof i=="function"&&i(this,r),n},t})(Zl),zf=(function(){function e(t,r){this.type=t,this.typeName=r,this.baseNames=[],this.ownFields=Object.create(null),this.allSupertypes=Object.create(null),this.supertypeList=[],this.allFields=Object.create(null),this.fieldNames=[],this.finalized=!1,this.buildable=!1,this.buildParams=[]}return e.prototype.isSupertypeOf=function(t){if(t instanceof e){if(this.finalized!==!0||t.finalized!==!0)throw new Error("");return Er.call(t.allSupertypes,this.typeName)}else throw new Error(t+" is not a Def")},e.prototype.checkAllFields=function(t,r){var i=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function n(a){var o=i[a],s=o.type,l=o.getValue(t);return s.check(l,r)}return t!==null&&typeof t=="object"&&Object.keys(i).every(n)},e.prototype.bases=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this.baseNames;if(this.finalized){if(t.length!==i.length)throw new Error("");for(var n=0;n<t.length;n++)if(t[n]!==i[n])throw new Error("");return this}return t.forEach(function(a){i.indexOf(a)<0&&i.push(a)}),this},e})();Hl.Def=zf;var c1=(function(){function e(t,r,i,n){this.name=t,this.type=r,this.defaultFn=i,this.hidden=!!n}return e.prototype.toString=function(){return JSON.stringify(this.name)+": "+this.type},e.prototype.getValue=function(t){var r=t[this.name];return typeof r<"u"||typeof this.defaultFn=="function"&&(r=this.defaultFn.call(t)),r},e})();function D_(e){return Array.isArray(e)?"["+e.map(D_).join(", ")+"]":e&&typeof e=="object"?"{ "+Object.keys(e).map(function(t){return t+": "+e[t]}).join(", ")+" }":JSON.stringify(e)}function YH(e){var t={or:function(){for(var F=[],B=0;B<arguments.length;B++)F[B]=arguments[B];return new s1(F.map(function(z){return t.from(z)}))},from:function(F,B){if(F instanceof C_||F instanceof a1||F instanceof o1||F instanceof s1||F instanceof Kl)return F;if(F instanceof zf)return F.type;if(s.check(F)){if(F.length!==1)throw new Error("only one element type is permitted for typed arrays");return new C_(t.from(F[0]))}if(l.check(F))return new o1(Object.keys(F).map(function(X){return new c1(X,t.from(F[X],X))}));if(typeof F=="function"){var z=r.indexOf(F);if(z>=0)return i[z];if(typeof B!="string")throw new Error("missing name");return new Kl(B,F)}return new a1(F)},def:function(F){return Er.call(v,F)?v[F]:v[F]=new _(F)},hasDef:function(F){return Er.call(v,F)}},r=[],i=[];function n(F,B){var z=Bf.call(B),X=new Kl(F,function(me){return Bf.call(me)===z});return B&&typeof B.constructor=="function"&&(r.push(B.constructor),i.push(X)),X}var a=n("string","truthy"),o=n("function",function(){}),s=n("array",[]),l=n("object",{}),m=n("RegExp",/./),d=n("Date",new Date),h=n("number",3),g=n("boolean",!0),u=n("null",null),p=n("undefined",void 0),f=typeof BigInt=="function"?n("BigInt",BigInt(1234)):new Kl("BigInt",function(){return!1}),y={string:a,function:o,array:s,object:l,RegExp:m,Date:d,number:h,boolean:g,null:u,undefined:p,BigInt:f},v=Object.create(null);function b(F){if(F&&typeof F=="object"){var B=F.type;if(typeof B=="string"&&Er.call(v,B)){var z=v[B];if(z.finalized)return z}}return null}var _=(function(F){ps.__extends(B,F);function B(z){var X=F.call(this,new Kl(z,function(me,he){return X.check(me,he)}),z)||this;return X}return B.prototype.check=function(z,X){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(z===null||typeof z!="object")return!1;var me=b(z);return me?X&&me===this?this.checkAllFields(z,X):this.isSupertypeOf(me)?X?me.checkAllFields(z,X)&&this.checkAllFields(z,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(z,X):!1},B.prototype.build=function(){for(var z=this,X=[],me=0;me<arguments.length;me++)X[me]=arguments[me];if(this.buildParams=X,this.buildable)return this;this.field("type",String,function(){return z.typeName}),this.buildable=!0;var he=function(Ie,Re,lr,ur){if(!Er.call(Ie,Re)){var $t=z.allFields;if(!Er.call($t,Re))throw new Error(""+Re);var dr=$t[Re],cc=dr.type,Tn;if(ur)Tn=lr;else if(dr.defaultFn)Tn=dr.defaultFn.call(Ie);else{var qa="no value or default function given for field "+JSON.stringify(Re)+" of "+z.typeName+"("+z.buildParams.map(function(Cn){return $t[Cn]}).join(", ")+")";throw new Error(qa)}if(!cc.check(Tn))throw new Error(D_(Tn)+" does not match field "+dr+" of type "+z.typeName);Ie[Re]=Tn}},et=function(){for(var Ie=[],Re=0;Re<arguments.length;Re++)Ie[Re]=arguments[Re];var lr=Ie.length;if(!z.finalized)throw new Error("attempting to instantiate unfinalized type "+z.typeName);var ur=Object.create(P);if(z.buildParams.forEach(function($t,dr){dr<lr?he(ur,$t,Ie[dr],!0):he(ur,$t,null,!1)}),Object.keys(z.allFields).forEach(function($t){he(ur,$t,null,!1)}),ur.type!==z.typeName)throw new Error("");return ur};return et.from=function(Ie){if(!z.finalized)throw new Error("attempting to instantiate unfinalized type "+z.typeName);var Re=Object.create(P);if(Object.keys(z.allFields).forEach(function(lr){Er.call(Ie,lr)?he(Re,lr,Ie[lr],!0):he(Re,lr,null,!1)}),Re.type!==z.typeName)throw new Error("");return Re},Object.defineProperty(C,Y(this.typeName),{enumerable:!0,value:et}),this},B.prototype.field=function(z,X,me,he){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(z)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[z]=new c1(z,t.from(X),me,he),this)},B.prototype.finalize=function(){var z=this;if(!this.finalized){var X=this.allFields,me=this.allSupertypes;this.baseNames.forEach(function(et){var Ie=v[et];if(Ie instanceof zf)Ie.finalize(),_n(X,Ie.allFields),_n(me,Ie.allSupertypes);else{var Re="unknown supertype name "+JSON.stringify(et)+" for subtype "+JSON.stringify(z.typeName);throw new Error(Re)}}),_n(X,this.ownFields),me[this.typeName]=this,this.fieldNames.length=0;for(var he in X)Er.call(X,he)&&!X[he].hidden&&this.fieldNames.push(he);Object.defineProperty(Me,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,sc(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&xn(this.typeName)}},B})(zf);function A(F){if(!Er.call(v,F))throw new Error("");var B=v[F];if(B.finalized!==!0)throw new Error("");return B.supertypeList.slice(1)}function x(F){for(var B={},z=Object.keys(v),X=z.length,me=0;me<X;++me){var he=z[me],et=v[he];if(et.finalized!==!0)throw new Error(""+he);for(var Ie=0;Ie<et.supertypeList.length;++Ie){var Re=et.supertypeList[Ie];if(Er.call(F,Re)){B[he]=Re;break}}}return B}var C=Object.create(null),P={};function G(F,B){var z=P[F];return p.check(B)?delete P[F]:(o.assert(B),Object.defineProperty(P,F,{enumerable:!0,configurable:!0,value:B})),z}function Y(F){return F.replace(/^[A-Z]+/,function(B){var z=B.length;switch(z){case 0:return"";case 1:return B.toLowerCase();default:return B.slice(0,z-1).toLowerCase()+B.charAt(z-1)}})}function ve(F){return F=Y(F),F.replace(/(Expression)?$/,"Statement")}var Me={};function cr(F){var B=b(F);if(B)return B.fieldNames.slice(0);if("type"in F)throw new Error("did not recognize object of type "+JSON.stringify(F.type));return Object.keys(F)}function An(F,B){var z=b(F);if(z){var X=z.allFields[B];if(X)return X.getValue(F)}return F&&F[B]}function Xa(F,B,z){cr(F).forEach(function(X){B.call(this,X,An(F,X))},z)}function Fi(F,B,z){return cr(F).some(function(X){return B.call(this,X,An(F,X))},z)}function xn(F){var B=ve(F);if(!C[B]){var z=C[Y(F)];if(z){var X=function(){for(var me=[],he=0;he<arguments.length;he++)me[he]=arguments[he];return C.expressionStatement(z.apply(C,me))};X.from=function(){for(var me=[],he=0;he<arguments.length;he++)me[he]=arguments[he];return C.expressionStatement(z.from.apply(C,me))},C[B]=X}}}function sc(F,B){B.length=0,B.push(F);for(var z=Object.create(null),X=0;X<B.length;++X){F=B[X];var me=v[F];if(me.finalized!==!0)throw new Error("");Er.call(z,F)&&delete B[z[F]],z[F]=X,B.push.apply(B,me.baseNames)}for(var he=0,et=he,Ie=B.length;et<Ie;++et)Er.call(B,et)&&(B[he++]=B[et]);B.length=he}function _n(F,B){return Object.keys(B).forEach(function(z){F[z]=B[z]}),F}function ni(){Object.keys(v).forEach(function(F){v[F].finalize()})}return{Type:t,builtInTypes:y,getSupertypeNames:A,computeSupertypeLookupTable:x,builders:C,defineMethod:G,getBuilderName:Y,getStatementBuilderName:ve,namedTypes:Me,getFieldNames:cr,getFieldValue:An,eachField:Xa,someField:Fi,finalize:ni}}Hl.default=YH;(0,qH.maybeSetModuleExports)(function(){return u1})});var k_=H((I_,d1)=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});var QH=(ue(),Q(le)),eJ=_e(),tJ=QH.__importDefault(Be()),rJ=Object.prototype,Gf=rJ.hasOwnProperty;function nJ(e){var t=e.use(tJ.default),r=t.builtInTypes.array,i=t.builtInTypes.number,n=function h(g,u,p){if(!(this instanceof h))throw new Error("Path constructor cannot be invoked without 'new'");if(u){if(!(u instanceof h))throw new Error("")}else u=null,p=null;this.value=g,this.parentPath=u,this.name=p,this.__childCache=null},a=n.prototype;function o(h){return h.__childCache||(h.__childCache=Object.create(null))}function s(h,g){var u=o(h),p=h.getValueProperty(g),f=u[g];return(!Gf.call(u,g)||f.value!==p)&&(f=u[g]=new h.constructor(p,h,g)),f}a.getValueProperty=function(g){return this.value[g]},a.get=function(){for(var g=[],u=0;u<arguments.length;u++)g[u]=arguments[u];for(var p=this,f=g.length,y=0;y<f;++y)p=s(p,g[y]);return p},a.each=function(g,u){for(var p=[],f=this.value.length,y=0,y=0;y<f;++y)Gf.call(this.value,y)&&(p[y]=this.get(y));for(u=u||this,y=0;y<f;++y)Gf.call(p,y)&&g.call(u,p[y])},a.map=function(g,u){var p=[];return this.each(function(f){p.push(g.call(this,f))},u),p},a.filter=function(g,u){var p=[];return this.each(function(f){g.call(this,f)&&p.push(f)},u),p};function l(){}function m(h,g,u,p){if(r.assert(h.value),g===0)return l;var f=h.value.length;if(f<1)return l;var y=arguments.length;y===2?(u=0,p=f):y===3?(u=Math.max(u,0),p=f):(u=Math.max(u,0),p=Math.min(p,f)),i.assert(u),i.assert(p);for(var v=Object.create(null),b=o(h),_=u;_<p;++_)if(Gf.call(h.value,_)){var A=h.get(_);if(A.name!==_)throw new Error("");var x=_+g;A.name=x,v[x]=A,delete b[_]}return delete b.length,function(){for(var C in v){var P=v[C];if(P.name!==+C)throw new Error("");b[C]=P,h.value[C]=P.value}}}a.shift=function(){var g=m(this,-1),u=this.value.shift();return g(),u},a.unshift=function(){for(var g=[],u=0;u<arguments.length;u++)g[u]=arguments[u];var p=m(this,g.length),f=this.value.unshift.apply(this.value,g);return p(),f},a.push=function(){for(var g=[],u=0;u<arguments.length;u++)g[u]=arguments[u];return r.assert(this.value),delete o(this).length,this.value.push.apply(this.value,g)},a.pop=function(){r.assert(this.value);var g=o(this);return delete g[this.value.length-1],delete g.length,this.value.pop()},a.insertAt=function(g){var u=arguments.length,p=m(this,u-1,g);if(p===l&&u<=1)return this;g=Math.max(g,0);for(var f=1;f<u;++f)this.value[g+f-1]=arguments[f];return p(),this},a.insertBefore=function(){for(var g=[],u=0;u<arguments.length;u++)g[u]=arguments[u];for(var p=this.parentPath,f=g.length,y=[this.name],v=0;v<f;++v)y.push(g[v]);return p.insertAt.apply(p,y)},a.insertAfter=function(){for(var g=[],u=0;u<arguments.length;u++)g[u]=arguments[u];for(var p=this.parentPath,f=g.length,y=[this.name+1],v=0;v<f;++v)y.push(g[v]);return p.insertAt.apply(p,y)};function d(h){if(!(h instanceof n))throw new Error("");var g=h.parentPath;if(!g)return h;var u=g.value,p=o(g);if(u[h.name]===h.value)p[h.name]=h;else if(r.check(u)){var f=u.indexOf(h.value);f>=0&&(p[h.name=f]=h)}else u[h.name]=h.value,p[h.name]=h;if(u[h.name]!==h.value)throw new Error("");if(h.parentPath.get(h.name)!==h)throw new Error("");return h}return a.replace=function(g){var u=[],p=this.parentPath.value,f=o(this.parentPath),y=arguments.length;if(d(this),r.check(p)){for(var v=p.length,b=m(this.parentPath,y-1,this.name+1),_=[this.name,1],A=0;A<y;++A)_.push(arguments[A]);var x=p.splice.apply(p,_);if(x[0]!==this.value)throw new Error("");if(p.length!==v-1+y)throw new Error("");if(b(),y===0)delete this.value,delete f[this.name],this.__childCache=null;else{if(p[this.name]!==g)throw new Error("");for(this.value!==g&&(this.value=g,this.__childCache=null),A=0;A<y;++A)u.push(this.parentPath.get(this.name+A));if(u[0]!==this)throw new Error("")}}else if(y===1)this.value!==g&&(this.__childCache=null),this.value=p[this.name]=g,u.push(this);else if(y===0)delete p[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return u},n}I_.default=nJ;(0,eJ.maybeSetModuleExports)(function(){return d1})});var m1=H((N_,p1)=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});var iJ=(ue(),Q(le)),aJ=_e(),oJ=iJ.__importDefault(Be()),ms=Object.prototype.hasOwnProperty;function sJ(e){var t=e.use(oJ.default),r=t.Type,i=t.namedTypes,n=i.Node,a=i.Expression,o=t.builtInTypes.array,s=t.builders,l=function A(x,C){if(!(this instanceof A))throw new Error("Scope constructor cannot be invoked without 'new'");d.check(x.value)||m.assert(x.value);var P;if(C){if(!(C instanceof A))throw new Error("");P=C.depth+1}else C=null,P=0;Object.defineProperties(this,{path:{value:x},node:{value:x.value},isGlobal:{value:!C,enumerable:!0},depth:{value:P},parent:{value:C},bindings:{value:{}},types:{value:{}}})},m=r.or(i.Program,i.Function,i.CatchClause),d=r.or(i.Function,i.ClassDeclaration,i.ClassExpression,i.InterfaceDeclaration,i.TSInterfaceDeclaration,i.TypeAlias,i.TSTypeAliasDeclaration),h=r.or(i.TypeParameter,i.TSTypeParameter);l.isEstablishedBy=function(A){return m.check(A)||d.check(A)};var g=l.prototype;g.didScan=!1,g.declares=function(A){return this.scan(),ms.call(this.bindings,A)},g.declaresType=function(A){return this.scan(),ms.call(this.types,A)},g.declareTemporary=function(A){if(A){if(!/^[a-z$_]/i.test(A))throw new Error("")}else A="t$";A+=this.depth.toString(36)+"$",this.scan();for(var x=0;this.declares(A+x);)++x;var C=A+x;return this.bindings[C]=t.builders.identifier(C)},g.injectTemporary=function(A,x){A||(A=this.declareTemporary());var C=this.path.get("body");return i.BlockStatement.check(C.value)&&(C=C.get("body")),C.unshift(s.variableDeclaration("var",[s.variableDeclarator(A,x||null)])),A},g.scan=function(A){if(A||!this.didScan){for(var x in this.bindings)delete this.bindings[x];for(var x in this.types)delete this.types[x];u(this.path,this.bindings,this.types),this.didScan=!0}},g.getBindings=function(){return this.scan(),this.bindings},g.getTypes=function(){return this.scan(),this.types};function u(A,x,C){var P=A.value;if(d.check(P)){var G=A.get("typeParameters","params");o.check(G.value)&&G.each(function(Y){_(Y,C)})}m.check(P)&&(i.CatchClause.check(P)?v(A.get("param"),x):p(A,x,C))}function p(A,x,C){var P=A.value;A.parent&&i.FunctionExpression.check(A.parent.node)&&A.parent.node.id&&v(A.parent.get("id"),x),P&&(o.check(P)?A.each(function(G){y(G,x,C)}):i.Function.check(P)?(A.get("params").each(function(G){v(G,x)}),y(A.get("body"),x,C),p(A.get("typeParameters"),x,C)):i.TypeAlias&&i.TypeAlias.check(P)||i.InterfaceDeclaration&&i.InterfaceDeclaration.check(P)||i.TSTypeAliasDeclaration&&i.TSTypeAliasDeclaration.check(P)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(P)?b(A.get("id"),C):i.VariableDeclarator.check(P)?(v(A.get("id"),x),y(A.get("init"),x,C)):P.type==="ImportSpecifier"||P.type==="ImportNamespaceSpecifier"||P.type==="ImportDefaultSpecifier"?v(A.get(P.local?"local":P.name?"name":"id"),x):n.check(P)&&!a.check(P)&&t.eachField(P,function(G,Y){var ve=A.get(G);if(!f(ve,Y))throw new Error("");y(ve,x,C)}))}function f(A,x){return!!(A.value===x||Array.isArray(A.value)&&A.value.length===0&&Array.isArray(x)&&x.length===0)}function y(A,x,C){var P=A.value;if(!(!P||a.check(P)))if(i.FunctionDeclaration.check(P)&&P.id!==null)v(A.get("id"),x);else if(i.ClassDeclaration&&i.ClassDeclaration.check(P)&&P.id!==null)v(A.get("id"),x),p(A.get("typeParameters"),x,C);else if(i.InterfaceDeclaration&&i.InterfaceDeclaration.check(P)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(P))b(A.get("id"),C);else if(m.check(P)){if(i.CatchClause.check(P)&&i.Identifier.check(P.param)){var G=P.param.name,Y=ms.call(x,G);p(A.get("body"),x,C),Y||delete x[G]}}else p(A,x,C)}function v(A,x){var C=A.value;i.Pattern.assert(C),i.Identifier.check(C)?ms.call(x,C.name)?x[C.name].push(A):x[C.name]=[A]:i.AssignmentPattern&&i.AssignmentPattern.check(C)?v(A.get("left"),x):i.ObjectPattern&&i.ObjectPattern.check(C)?A.get("properties").each(function(P){var G=P.value;i.Pattern.check(G)?v(P,x):i.Property.check(G)||i.ObjectProperty&&i.ObjectProperty.check(G)?v(P.get("value"),x):i.SpreadProperty&&i.SpreadProperty.check(G)&&v(P.get("argument"),x)}):i.ArrayPattern&&i.ArrayPattern.check(C)?A.get("elements").each(function(P){var G=P.value;i.Pattern.check(G)?v(P,x):i.SpreadElement&&i.SpreadElement.check(G)&&v(P.get("argument"),x)}):i.PropertyPattern&&i.PropertyPattern.check(C)?v(A.get("pattern"),x):(i.SpreadElementPattern&&i.SpreadElementPattern.check(C)||i.RestElement&&i.RestElement.check(C)||i.SpreadPropertyPattern&&i.SpreadPropertyPattern.check(C))&&v(A.get("argument"),x)}function b(A,x){var C=A.value;i.Pattern.assert(C),i.Identifier.check(C)&&(ms.call(x,C.name)?x[C.name].push(A):x[C.name]=[A])}function _(A,x){var C=A.value;h.assert(C),ms.call(x,C.name)?x[C.name].push(A):x[C.name]=[A]}return g.lookup=function(A){for(var x=this;x&&!x.declares(A);x=x.parent);return x},g.lookupType=function(A){for(var x=this;x&&!x.declaresType(A);x=x.parent);return x},g.getGlobalScope=function(){for(var A=this;!A.isGlobal;)A=A.parent;return A},l}N_.default=sJ;(0,aJ.maybeSetModuleExports)(function(){return p1})});var R_=H((P_,f1)=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var w_=(ue(),Q(le)),cJ=w_.__importDefault(Be()),lJ=w_.__importDefault(k_()),uJ=w_.__importDefault(m1()),dJ=_e();function pJ(e){var t=e.use(cJ.default),r=t.namedTypes,i=t.builders,n=t.builtInTypes.number,a=t.builtInTypes.array,o=e.use(lJ.default),s=e.use(uJ.default),l=function v(b,_,A){if(!(this instanceof v))throw new Error("NodePath constructor cannot be invoked without 'new'");o.call(this,b,_,A)},m=l.prototype=Object.create(o.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(m,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),m.replace=function(){return delete this.node,delete this.parent,delete this.scope,o.prototype.replace.apply(this,arguments)},m.prune=function(){var v=this.parent;return this.replace(),f(v)},m._computeNode=function(){var v=this.value;if(r.Node.check(v))return v;var b=this.parentPath;return b&&b.node||null},m._computeParent=function(){var v=this.value,b=this.parentPath;if(!r.Node.check(v)){for(;b&&!r.Node.check(b.value);)b=b.parentPath;b&&(b=b.parentPath)}for(;b&&!r.Node.check(b.value);)b=b.parentPath;return b||null},m._computeScope=function(){var v=this.value,b=this.parentPath,_=b&&b.scope;return r.Node.check(v)&&s.isEstablishedBy(v)&&(_=new s(this,_)),_||null},m.getValueProperty=function(v){return t.getFieldValue(this.value,v)},m.needsParens=function(v){var b=this.parentPath;if(!b)return!1;var _=this.value;if(!r.Expression.check(_)||_.type==="Identifier")return!1;for(;!r.Node.check(b.value);)if(b=b.parentPath,!b)return!1;var A=b.value;switch(_.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return A.type==="MemberExpression"&&this.name==="object"&&A.object===_;case"BinaryExpression":case"LogicalExpression":switch(A.type){case"CallExpression":return this.name==="callee"&&A.callee===_;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&A.object===_;case"BinaryExpression":case"LogicalExpression":{var x=_,C=A.operator,P=g[C],G=x.operator,Y=g[G];if(P>Y)return!0;if(P===Y&&this.name==="right"){if(A.right!==x)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(A.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(A.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return A.type==="MemberExpression"&&n.check(_.value)&&this.name==="object"&&A.object===_;case"AssignmentExpression":case"ConditionalExpression":switch(A.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&A.callee===_;case"ConditionalExpression":return this.name==="test"&&A.test===_;case"MemberExpression":return this.name==="object"&&A.object===_;default:return!1}default:if(A.type==="NewExpression"&&this.name==="callee"&&A.callee===_)return u(_)}return!!(v!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function d(v){return r.BinaryExpression.check(v)||r.LogicalExpression.check(v)}function h(v){return r.UnaryExpression.check(v)||r.SpreadElement&&r.SpreadElement.check(v)||r.SpreadProperty&&r.SpreadProperty.check(v)}var g={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(v,b){v.forEach(function(_){g[_]=b})});function u(v){return r.CallExpression.check(v)?!0:a.check(v)?v.some(u):r.Node.check(v)?t.someField(v,function(b,_){return u(_)}):!1}m.canBeFirstInStatement=function(){var v=this.node;return!r.FunctionExpression.check(v)&&!r.ObjectExpression.check(v)},m.firstInStatement=function(){return p(this)};function p(v){for(var b,_;v.parent;v=v.parent){if(b=v.node,_=v.parent.node,r.BlockStatement.check(_)&&v.parent.name==="body"&&v.name===0){if(_.body[0]!==b)throw new Error("Nodes must be equal");return!0}if(r.ExpressionStatement.check(_)&&v.name==="expression"){if(_.expression!==b)throw new Error("Nodes must be equal");return!0}if(r.SequenceExpression.check(_)&&v.parent.name==="expressions"&&v.name===0){if(_.expressions[0]!==b)throw new Error("Nodes must be equal");continue}if(r.CallExpression.check(_)&&v.name==="callee"){if(_.callee!==b)throw new Error("Nodes must be equal");continue}if(r.MemberExpression.check(_)&&v.name==="object"){if(_.object!==b)throw new Error("Nodes must be equal");continue}if(r.ConditionalExpression.check(_)&&v.name==="test"){if(_.test!==b)throw new Error("Nodes must be equal");continue}if(d(_)&&v.name==="left"){if(_.left!==b)throw new Error("Nodes must be equal");continue}if(r.UnaryExpression.check(_)&&!_.prefix&&v.name==="argument"){if(_.argument!==b)throw new Error("Nodes must be equal");continue}return!1}return!0}function f(v){if(r.VariableDeclaration.check(v.node)){var b=v.get("declarations").value;if(!b||b.length===0)return v.prune()}else if(r.ExpressionStatement.check(v.node)){if(!v.get("expression").value)return v.prune()}else r.IfStatement.check(v.node)&&y(v);return v}function y(v){var b=v.get("test").value,_=v.get("alternate").value,A=v.get("consequent").value;if(!A&&!_){var x=i.expressionStatement(b);v.replace(x)}else if(!A&&_){var C=i.unaryExpression("!",b,!0);r.UnaryExpression.check(b)&&b.operator==="!"&&(C=b.argument),v.get("test").replace(C),v.get("consequent").replace(_),v.get("alternate").replace()}}return l}P_.default=pJ;(0,dJ.maybeSetModuleExports)(function(){return f1})});var y1=H((O_,g1)=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});var h1=(ue(),Q(le)),mJ=h1.__importDefault(Be()),fJ=h1.__importDefault(R_()),hJ=_e(),Vf=Object.prototype.hasOwnProperty;function gJ(e){var t=e.use(mJ.default),r=e.use(fJ.default),i=t.builtInTypes.array,n=t.builtInTypes.object,a=t.builtInTypes.function,o,s=function p(){if(!(this instanceof p))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=l(this),this._shouldVisitComments=Vf.call(this._methodNameTable,"Block")||Vf.call(this._methodNameTable,"Line"),this.Context=g(this),this._visiting=!1,this._changeReported=!1};function l(p){var f=Object.create(null);for(var y in p)/^visit[A-Z]/.test(y)&&(f[y.slice(5)]=!0);for(var v=t.computeSupertypeLookupTable(f),b=Object.create(null),_=Object.keys(v),A=_.length,x=0;x<A;++x){var C=_[x];y="visit"+v[C],a.check(p[y])&&(b[C]=y)}return b}s.fromMethodsObject=function(f){if(f instanceof s)return f;if(!n.check(f))return new s;var y=function b(){if(!(this instanceof b))throw new Error("Visitor constructor cannot be invoked without 'new'");s.call(this)},v=y.prototype=Object.create(d);return v.constructor=y,m(v,f),m(y,s),a.assert(y.fromMethodsObject),a.assert(y.visit),new y};function m(p,f){for(var y in f)Vf.call(f,y)&&(p[y]=f[y]);return p}s.visit=function(f,y){return s.fromMethodsObject(y).visit(f)};var d=s.prototype;d.visit=function(){if(this._visiting)throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var p=arguments.length,f=new Array(p),y=0;y<p;++y)f[y]=arguments[y];f[0]instanceof r||(f[0]=new r({root:f[0]}).get("root")),this.reset.apply(this,f);var v;try{var b=this.visitWithoutReset(f[0]);v=!0}finally{if(this._visiting=!1,!v&&this._abortRequested)return f[0].value}return b},d.AbortRequest=function(){},d.abort=function(){var p=this;p._abortRequested=!0;var f=new p.AbortRequest;throw f.cancel=function(){p._abortRequested=!1},f},d.reset=function(p){},d.visitWithoutReset=function(p){if(this instanceof this.Context)return this.visitor.visitWithoutReset(p);if(!(p instanceof r))throw new Error("");var f=p.value,y=f&&typeof f=="object"&&typeof f.type=="string"&&this._methodNameTable[f.type];if(y){var v=this.acquireContext(p);try{return v.invokeVisitorMethod(y)}finally{this.releaseContext(v)}}else return h(p,this)};function h(p,f){if(!(p instanceof r))throw new Error("");if(!(f instanceof s))throw new Error("");var y=p.value;if(i.check(y))p.each(f.visitWithoutReset,f);else if(n.check(y)){var v=t.getFieldNames(y);f._shouldVisitComments&&y.comments&&v.indexOf("comments")<0&&v.push("comments");for(var b=v.length,_=[],A=0;A<b;++A){var x=v[A];Vf.call(y,x)||(y[x]=t.getFieldValue(y,x)),_.push(p.get(x))}for(var A=0;A<b;++A)f.visitWithoutReset(_[A])}return p.value}d.acquireContext=function(p){return this._reusableContextStack.length===0?new this.Context(p):this._reusableContextStack.pop().reset(p)},d.releaseContext=function(p){if(!(p instanceof this.Context))throw new Error("");this._reusableContextStack.push(p),p.currentPath=null},d.reportChanged=function(){this._changeReported=!0},d.wasChangeReported=function(){return this._changeReported};function g(p){function f(v){if(!(this instanceof f))throw new Error("");if(!(this instanceof s))throw new Error("");if(!(v instanceof r))throw new Error("");Object.defineProperty(this,"visitor",{value:p,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=v,this.needToCallTraverse=!0,Object.seal(this)}if(!(p instanceof s))throw new Error("");var y=f.prototype=Object.create(p);return y.constructor=f,m(y,u),f}var u=Object.create(null);return u.reset=function(f){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");return this.currentPath=f,this.needToCallTraverse=!0,this},u.invokeVisitorMethod=function(f){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");var y=this.visitor[f].call(this,this.currentPath);if(y===!1?this.needToCallTraverse=!1:y!==o&&(this.currentPath=this.currentPath.replace(y)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+f);var v=this.currentPath;return v&&v.value},u.traverse=function(f,y){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");return this.needToCallTraverse=!1,h(f,s.fromMethodsObject(y||this.visitor))},u.visit=function(f,y){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");return this.needToCallTraverse=!1,s.fromMethodsObject(y||this.visitor).visitWithoutReset(f)},u.reportChanged=function(){this.visitor.reportChanged()},u.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},s}O_.default=gJ;(0,hJ.maybeSetModuleExports)(function(){return g1})});var b1=H(($_,v1)=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var yJ=(ue(),Q(le)),vJ=_e(),bJ=yJ.__importDefault(Be());function SJ(e){var t=e.use(bJ.default),r=t.getFieldNames,i=t.getFieldValue,n=t.builtInTypes.array,a=t.builtInTypes.object,o=t.builtInTypes.Date,s=t.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function m(p,f,y){return n.check(y)?y.length=0:y=null,h(p,f,y)}m.assert=function(p,f){var y=[];if(!m(p,f,y))if(y.length===0){if(p!==f)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+y.map(d).join(""))};function d(p){return/[_$a-z][_$a-z0-9]*/i.test(p)?"."+p:"["+JSON.stringify(p)+"]"}function h(p,f,y){return p===f?!0:n.check(p)?g(p,f,y):a.check(p)?u(p,f,y):o.check(p)?o.check(f)&&+p==+f:s.check(p)?s.check(f)&&p.source===f.source&&p.global===f.global&&p.multiline===f.multiline&&p.ignoreCase===f.ignoreCase:p==f}function g(p,f,y){n.assert(p);var v=p.length;if(!n.check(f)||f.length!==v)return y&&y.push("length"),!1;for(var b=0;b<v;++b){if(y&&y.push(b),b in p!=b in f||!h(p[b],f[b],y))return!1;if(y){var _=y.pop();if(_!==b)throw new Error(""+_)}}return!0}function u(p,f,y){if(a.assert(p),!a.check(f))return!1;if(p.type!==f.type)return y&&y.push("type"),!1;var v=r(p),b=v.length,_=r(f),A=_.length;if(b===A){for(var x=0;x<b;++x){var C=v[x],P=i(p,C),G=i(f,C);if(y&&y.push(C),!h(P,G,y))return!1;if(y){var Y=y.pop();if(Y!==C)throw new Error(""+Y)}}return!0}if(!y)return!1;var ve=Object.create(null);for(x=0;x<b;++x)ve[v[x]]=!0;for(x=0;x<A;++x){if(C=_[x],!l.call(ve,C))return y.push(C),!1;delete ve[C]}for(C in ve){y.push(C);break}return!1}return m}$_.default=SJ;(0,vJ.maybeSetModuleExports)(function(){return v1})});var E1=H((j_,S1)=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});var Jl=(ue(),Q(le)),EJ=Jl.__importDefault(Be()),AJ=Jl.__importDefault(y1()),xJ=Jl.__importDefault(b1()),_J=Jl.__importDefault(k_()),TJ=Jl.__importDefault(R_()),CJ=_e();function DJ(e){var t=IJ(),r=t.use(EJ.default);e.forEach(t.use),r.finalize();var i=t.use(AJ.default);return{Type:r.Type,builtInTypes:r.builtInTypes,namedTypes:r.namedTypes,builders:r.builders,defineMethod:r.defineMethod,getFieldNames:r.getFieldNames,getFieldValue:r.getFieldValue,eachField:r.eachField,someField:r.someField,getSupertypeNames:r.getSupertypeNames,getBuilderName:r.getBuilderName,astNodesAreEquivalent:t.use(xJ.default),finalize:r.finalize,Path:t.use(_J.default),NodePath:t.use(TJ.default),PathVisitor:i,use:t.use,visit:i.visit}}j_.default=DJ;function IJ(){var e=[],t=[];function r(n){var a=e.indexOf(n);return a===-1&&(a=e.length,e.push(n),t[a]=n(i)),t[a]}var i={use:r};return i}(0,CJ.maybeSetModuleExports)(function(){return S1})});var L_=H((M_,A1)=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});var kJ=_e();function NJ(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}M_.default=NJ;(0,kJ.maybeSetModuleExports)(function(){return A1})});var U_=H((F_,x1)=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});var wJ=(ue(),Q(le)),PJ=_e(),RJ=wJ.__importDefault(L_());function OJ(e){var t=e.use(RJ.default);return t.BinaryOperators.indexOf("**")<0&&t.BinaryOperators.push("**"),t.AssignmentOperators.indexOf("**=")<0&&t.AssignmentOperators.push("**="),t}F_.default=OJ;(0,PJ.maybeSetModuleExports)(function(){return x1})});var B_=H((z_,_1)=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var $J=(ue(),Q(le)),jJ=_e(),MJ=$J.__importDefault(U_());function LJ(e){var t=e.use(MJ.default);return t.LogicalOperators.indexOf("??")<0&&t.LogicalOperators.push("??"),t}z_.default=LJ;(0,jJ.maybeSetModuleExports)(function(){return _1})});var C1=H((G_,T1)=>{"use strict";Object.defineProperty(G_,"__esModule",{value:!0});var FJ=(ue(),Q(le)),UJ=_e(),zJ=FJ.__importDefault(B_());function BJ(e){var t=e.use(zJ.default);return t.LogicalOperators.forEach(function(r){var i=r+"=";t.AssignmentOperators.indexOf(i)<0&&t.AssignmentOperators.push(i)}),t}G_.default=BJ;(0,UJ.maybeSetModuleExports)(function(){return T1})});var k1=H((W_,I1)=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});var V_=(ue(),Q(le)),GJ=V_.__importDefault(L_()),VJ=V_.__importDefault(Be()),D1=V_.__importStar(_e());function WJ(e){var t=e.use(VJ.default),r=t.Type,i=r.def,n=r.or,a=e.use(D1.default),o=a.defaults,s=a.geq,l=e.use(GJ.default),m=l.BinaryOperators,d=l.AssignmentOperators,h=l.LogicalOperators;i("Printable").field("loc",n(i("SourceLocation"),null),o.null,!0),i("Node").bases("Printable").field("type",String).field("comments",n([i("Comment")],null),o.null,!0),i("SourceLocation").field("start",i("Position")).field("end",i("Position")).field("source",n(String,null),o.null),i("Position").field("line",s(1)).field("column",s(0)),i("File").bases("Node").build("program","name").field("program",i("Program")).field("name",n(String,null),o.null),i("Program").bases("Node").build("body").field("body",[i("Statement")]),i("Function").bases("Node").field("id",n(i("Identifier"),null),o.null).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("generator",Boolean,o.false).field("async",Boolean,o.false),i("Statement").bases("Node"),i("EmptyStatement").bases("Statement").build(),i("BlockStatement").bases("Statement").build("body").field("body",[i("Statement")]),i("ExpressionStatement").bases("Statement").build("expression").field("expression",i("Expression")),i("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Statement")).field("alternate",n(i("Statement"),null),o.null),i("LabeledStatement").bases("Statement").build("label","body").field("label",i("Identifier")).field("body",i("Statement")),i("BreakStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("ContinueStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("WithStatement").bases("Statement").build("object","body").field("object",i("Expression")).field("body",i("Statement")),i("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",i("Expression")).field("cases",[i("SwitchCase")]).field("lexical",Boolean,o.false),i("ReturnStatement").bases("Statement").build("argument").field("argument",n(i("Expression"),null)),i("ThrowStatement").bases("Statement").build("argument").field("argument",i("Expression")),i("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",i("BlockStatement")).field("handler",n(i("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[i("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[i("CatchClause")],o.emptyArray).field("finalizer",n(i("BlockStatement"),null),o.null),i("CatchClause").bases("Node").build("param","guard","body").field("param",i("Pattern")).field("guard",n(i("Expression"),null),o.null).field("body",i("BlockStatement")),i("WhileStatement").bases("Statement").build("test","body").field("test",i("Expression")).field("body",i("Statement")),i("DoWhileStatement").bases("Statement").build("body","test").field("body",i("Statement")).field("test",i("Expression")),i("ForStatement").bases("Statement").build("init","test","update","body").field("init",n(i("VariableDeclaration"),i("Expression"),null)).field("test",n(i("Expression"),null)).field("update",n(i("Expression"),null)).field("body",i("Statement")),i("ForInStatement").bases("Statement").build("left","right","body").field("left",n(i("VariableDeclaration"),i("Expression"))).field("right",i("Expression")).field("body",i("Statement")),i("DebuggerStatement").bases("Statement").build(),i("Declaration").bases("Statement"),i("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",i("Identifier")),i("FunctionExpression").bases("Function","Expression").build("id","params","body"),i("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",n("var","let","const")).field("declarations",[i("VariableDeclarator")]),i("VariableDeclarator").bases("Node").build("id","init").field("id",i("Pattern")).field("init",n(i("Expression"),null),o.null),i("Expression").bases("Node"),i("ThisExpression").bases("Expression").build(),i("ArrayExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),null)]),i("ObjectExpression").bases("Expression").build("properties").field("properties",[i("Property")]),i("Property").bases("Node").build("kind","key","value").field("kind",n("init","get","set")).field("key",n(i("Literal"),i("Identifier"))).field("value",i("Expression")),i("SequenceExpression").bases("Expression").build("expressions").field("expressions",[i("Expression")]);var g=n("-","+","!","~","typeof","void","delete");i("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",g).field("argument",i("Expression")).field("prefix",Boolean,o.true);var u=n.apply(void 0,m);i("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",u).field("left",i("Expression")).field("right",i("Expression"));var p=n.apply(void 0,d);i("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",p).field("left",n(i("Pattern"),i("MemberExpression"))).field("right",i("Expression"));var f=n("++","--");i("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",f).field("argument",i("Expression")).field("prefix",Boolean);var y=n.apply(void 0,h);i("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",y).field("left",i("Expression")).field("right",i("Expression")),i("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Expression")).field("alternate",i("Expression")),i("NewExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("CallExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("MemberExpression").bases("Expression").build("object","property","computed").field("object",i("Expression")).field("property",n(i("Identifier"),i("Expression"))).field("computed",Boolean,function(){var v=this.property.type;return v==="Literal"||v==="MemberExpression"||v==="BinaryExpression"}),i("Pattern").bases("Node"),i("SwitchCase").bases("Node").build("test","consequent").field("test",n(i("Expression"),null)).field("consequent",[i("Statement")]),i("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,o.false),i("Literal").bases("Expression").build("value").field("value",n(String,Boolean,null,Number,RegExp,BigInt)),i("Comment").bases("Printable").field("value",String).field("leading",Boolean,o.true).field("trailing",Boolean,o.false)}W_.default=WJ;(0,D1.maybeSetModuleExports)(function(){return I1})});var P1=H((Z_,w1)=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});var K_=(ue(),Q(le)),KJ=K_.__importDefault(k1()),ZJ=K_.__importDefault(Be()),N1=K_.__importStar(_e());function HJ(e){e.use(KJ.default);var t=e.use(ZJ.default),r=t.Type.def,i=t.Type.or,n=e.use(N1.default).defaults;r("Function").field("generator",Boolean,n.false).field("expression",Boolean,n.false).field("defaults",[i(r("Expression"),null)],n.emptyArray).field("rest",i(r("Identifier"),null),n.null),r("RestElement").bases("Pattern").build("argument").field("argument",r("Pattern")).field("typeAnnotation",i(r("TypeAnnotation"),r("TSTypeAnnotation"),null),n.null),r("SpreadElementPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("FunctionDeclaration").build("id","params","body","generator","expression").field("id",i(r("Identifier"),null)),r("FunctionExpression").build("id","params","body","generator","expression"),r("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,n.null).field("body",i(r("BlockStatement"),r("Expression"))).field("generator",!1,n.false),r("ForOfStatement").bases("Statement").build("left","right","body").field("left",i(r("VariableDeclaration"),r("Pattern"))).field("right",r("Expression")).field("body",r("Statement")),r("YieldExpression").bases("Expression").build("argument","delegate").field("argument",i(r("Expression"),null)).field("delegate",Boolean,n.false),r("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",i(r("Expression"),null)),r("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",i(r("Expression"),null)),r("ComprehensionBlock").bases("Node").build("left","right","each").field("left",r("Pattern")).field("right",r("Expression")).field("each",Boolean),r("Property").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("value",i(r("Expression"),r("Pattern"))).field("method",Boolean,n.false).field("shorthand",Boolean,n.false).field("computed",Boolean,n.false),r("ObjectProperty").field("shorthand",Boolean,n.false),r("PropertyPattern").bases("Pattern").build("key","pattern").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("pattern",r("Pattern")).field("computed",Boolean,n.false),r("ObjectPattern").bases("Pattern").build("properties").field("properties",[i(r("PropertyPattern"),r("Property"))]),r("ArrayPattern").bases("Pattern").build("elements").field("elements",[i(r("Pattern"),null)]),r("SpreadElement").bases("Node").build("argument").field("argument",r("Expression")),r("ArrayExpression").field("elements",[i(r("Expression"),r("SpreadElement"),r("RestElement"),null)]),r("NewExpression").field("arguments",[i(r("Expression"),r("SpreadElement"))]),r("CallExpression").field("arguments",[i(r("Expression"),r("SpreadElement"))]),r("AssignmentPattern").bases("Pattern").build("left","right").field("left",r("Pattern")).field("right",r("Expression")),r("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",i("constructor","method","get","set")).field("key",r("Expression")).field("value",r("Function")).field("computed",Boolean,n.false).field("static",Boolean,n.false);var a=i(r("MethodDefinition"),r("VariableDeclarator"),r("ClassPropertyDefinition"),r("ClassProperty"),r("StaticBlock"));r("ClassProperty").bases("Declaration").build("key").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("computed",Boolean,n.false),r("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",a),r("ClassBody").bases("Declaration").build("body").field("body",[a]),r("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",i(r("Identifier"),null)).field("body",r("ClassBody")).field("superClass",i(r("Expression"),null),n.null),r("ClassExpression").bases("Expression").build("id","body","superClass").field("id",i(r("Identifier"),null),n.null).field("body",r("ClassBody")).field("superClass",i(r("Expression"),null),n.null),r("Super").bases("Expression").build(),r("Specifier").bases("Node"),r("ModuleSpecifier").bases("Specifier").field("local",i(r("Identifier"),null),n.null).field("id",i(r("Identifier"),null),n.null).field("name",i(r("Identifier"),null),n.null),r("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",r("Identifier")),r("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),r("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),r("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[i(r("ImportSpecifier"),r("ImportNamespaceSpecifier"),r("ImportDefaultSpecifier"))],n.emptyArray).field("source",r("Literal")).field("importKind",i("value","type"),function(){return"value"}),r("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",i(r("Declaration"),null)).field("specifiers",[r("ExportSpecifier")],n.emptyArray).field("source",i(r("Literal"),null),n.null),r("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",r("Identifier")),r("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",i(r("Declaration"),r("Expression"))),r("ExportAllDeclaration").bases("Declaration").build("source").field("source",r("Literal")),r("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",r("Expression")).field("quasi",r("TemplateLiteral")),r("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[r("TemplateElement")]).field("expressions",[r("Expression")]),r("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),r("MetaProperty").bases("Expression").build("meta","property").field("meta",r("Identifier")).field("property",r("Identifier"))}Z_.default=HJ;(0,N1.maybeSetModuleExports)(function(){return w1})});var $1=H((H_,O1)=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});var R1=(ue(),Q(le)),JJ=R1.__importDefault(U_()),XJ=R1.__importDefault(P1()),qJ=_e();function YJ(e){e.use(JJ.default),e.use(XJ.default)}H_.default=YJ;(0,qJ.maybeSetModuleExports)(function(){return O1})});var L1=H((X_,M1)=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});var J_=(ue(),Q(le)),QJ=J_.__importDefault($1()),eX=J_.__importDefault(Be()),j1=J_.__importStar(_e());function tX(e){e.use(QJ.default);var t=e.use(eX.default),r=t.Type.def,i=e.use(j1.default).defaults;r("Function").field("async",Boolean,i.false),r("AwaitExpression").bases("Expression").build("argument").field("argument",r("Expression"))}X_.default=tX;(0,j1.maybeSetModuleExports)(function(){return M1})});var z1=H((Y_,U1)=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});var q_=(ue(),Q(le)),rX=q_.__importDefault(L1()),nX=q_.__importDefault(Be()),F1=q_.__importStar(_e());function iX(e){e.use(rX.default);var t=e.use(nX.default),r=t.Type.def,i=t.Type.or,n=e.use(F1.default).defaults;r("ForOfStatement").field("await",Boolean,n.false),r("SpreadProperty").bases("Node").build("argument").field("argument",r("Expression")),r("ObjectExpression").field("properties",[i(r("Property"),r("SpreadProperty"),r("SpreadElement"))]),r("TemplateElement").field("value",{cooked:i(String,null),raw:String}),r("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("ObjectPattern").field("properties",[i(r("PropertyPattern"),r("Property"),r("RestElement"),r("SpreadPropertyPattern"))])}Y_.default=iX;(0,F1.maybeSetModuleExports)(function(){return U1})});var V1=H((e0,G1)=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var Q_=(ue(),Q(le)),aX=Q_.__importDefault(z1()),oX=Q_.__importDefault(Be()),B1=Q_.__importStar(_e());function sX(e){e.use(aX.default);var t=e.use(oX.default),r=t.Type.def,i=t.Type.or,n=e.use(B1.default).defaults;r("CatchClause").field("param",i(r("Pattern"),null),n.null)}e0.default=sX;(0,B1.maybeSetModuleExports)(function(){return G1})});var Z1=H((t0,K1)=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var Wf=(ue(),Q(le)),cX=Wf.__importDefault(B_()),lX=Wf.__importDefault(V1()),uX=Wf.__importDefault(Be()),W1=Wf.__importStar(_e());function dX(e){e.use(cX.default),e.use(lX.default);var t=e.use(uX.default),r=t.Type.def,i=t.Type.or,n=e.use(W1.default),a=n.defaults;r("ImportExpression").bases("Expression").build("source").field("source",r("Expression")),r("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",r("Literal")).field("exported",i(r("Identifier"),null,void 0),a.null),r("ChainElement").bases("Node").field("optional",Boolean,a.false),r("CallExpression").bases("Expression","ChainElement"),r("MemberExpression").bases("Expression","ChainElement"),r("ChainExpression").bases("Expression").build("expression").field("expression",r("ChainElement")),r("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,a.true),r("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,a.true)}t0.default=dX;(0,W1.maybeSetModuleExports)(function(){return K1})});var X1=H((r0,J1)=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var H1=(ue(),Q(le)),pX=H1.__importDefault(C1()),mX=H1.__importDefault(Z1()),fX=_e();function hX(e){e.use(pX.default),e.use(mX.default)}r0.default=hX;(0,fX.maybeSetModuleExports)(function(){return J1})});var Q1=H((n0,Y1)=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});var q1=(ue(),Q(le)),gX=q1.__importDefault(X1()),yX=q1.__importDefault(Be()),vX=_e();function bX(e){e.use(gX.default);var t=e.use(yX.default),r=t.Type.def;r("StaticBlock").bases("Declaration").build("body").field("body",[r("Statement")])}n0.default=bX;(0,vX.maybeSetModuleExports)(function(){return Y1})});var fs=H((a0,tj)=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});var i0=(ue(),Q(le)),SX=i0.__importDefault(Be()),ej=i0.__importStar(_e()),EX=i0.__importDefault(Q1());function AX(e){e.use(EX.default);var t=e.use(SX.default),r=t.Type,i=t.Type.def,n=r.or,a=e.use(ej.default),o=a.defaults;i("AwaitExpression").build("argument","all").field("argument",n(i("Expression"),null)).field("all",Boolean,o.false),i("Decorator").bases("Node").build("expression").field("expression",i("Expression")),i("Property").field("decorators",n([i("Decorator")],null),o.null),i("MethodDefinition").field("decorators",n([i("Decorator")],null),o.null),i("PrivateName").bases("Expression","Pattern").build("id").field("id",i("Identifier")),i("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",i("PrivateName")).field("value",n(i("Expression"),null),o.null),i("ImportAttribute").bases("Node").build("key","value").field("key",n(i("Identifier"),i("Literal"))).field("value",i("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(function(s){i(s).field("assertions",[i("ImportAttribute")],o.emptyArray)}),i("RecordExpression").bases("Expression").build("properties").field("properties",[n(i("ObjectProperty"),i("ObjectMethod"),i("SpreadElement"))]),i("TupleExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),i("SpreadElement"),null)]),i("ModuleExpression").bases("Node").build("body").field("body",i("Program"))}a0.default=AX;(0,ej.maybeSetModuleExports)(function(){return tj})});var ij=H((s0,nj)=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});var o0=(ue(),Q(le)),xX=o0.__importDefault(fs()),_X=o0.__importDefault(Be()),rj=o0.__importStar(_e());function TX(e){e.use(xX.default);var t=e.use(_X.default),r=t.Type.def,i=t.Type.or,n=e.use(rj.default).defaults;r("JSXAttribute").bases("Node").build("name","value").field("name",i(r("JSXIdentifier"),r("JSXNamespacedName"))).field("value",i(r("Literal"),r("JSXExpressionContainer"),r("JSXElement"),r("JSXFragment"),null),n.null),r("JSXIdentifier").bases("Identifier").build("name").field("name",String),r("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",r("JSXIdentifier")).field("name",r("JSXIdentifier")),r("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",i(r("JSXIdentifier"),r("JSXMemberExpression"))).field("property",r("JSXIdentifier")).field("computed",Boolean,n.false);var a=i(r("JSXIdentifier"),r("JSXNamespacedName"),r("JSXMemberExpression"));r("JSXSpreadAttribute").bases("Node").build("argument").field("argument",r("Expression"));var o=[i(r("JSXAttribute"),r("JSXSpreadAttribute"))];r("JSXExpressionContainer").bases("Expression").build("expression").field("expression",i(r("Expression"),r("JSXEmptyExpression")));var s=[i(r("JSXText"),r("JSXExpressionContainer"),r("JSXSpreadChild"),r("JSXElement"),r("JSXFragment"),r("Literal"))];r("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",r("JSXOpeningElement")).field("closingElement",i(r("JSXClosingElement"),null),n.null).field("children",s,n.emptyArray).field("name",a,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",o,function(){return this.openingElement.attributes},!0),r("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",a).field("attributes",o,n.emptyArray).field("selfClosing",Boolean,n.false),r("JSXClosingElement").bases("Node").build("name").field("name",a),r("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",r("JSXOpeningFragment")).field("closingFragment",r("JSXClosingFragment")).field("children",s,n.emptyArray),r("JSXOpeningFragment").bases("Node").build(),r("JSXClosingFragment").bases("Node").build(),r("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),r("JSXEmptyExpression").bases("Node").build(),r("JSXSpreadChild").bases("Node").build("expression").field("expression",r("Expression"))}s0.default=TX;(0,rj.maybeSetModuleExports)(function(){return nj})});var l0=H((c0,sj)=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});var aj=(ue(),Q(le)),CX=aj.__importDefault(Be()),oj=aj.__importStar(_e());function DX(e){var t=e.use(CX.default),r=t.Type.def,i=t.Type.or,n=e.use(oj.default).defaults,a=i(r("TypeAnnotation"),r("TSTypeAnnotation"),null),o=i(r("TypeParameterDeclaration"),r("TSTypeParameterDeclaration"),null);r("Identifier").field("typeAnnotation",a,n.null),r("ObjectPattern").field("typeAnnotation",a,n.null),r("Function").field("returnType",a,n.null).field("typeParameters",o,n.null),r("ClassProperty").build("key","value","typeAnnotation","static").field("value",i(r("Expression"),null)).field("static",Boolean,n.false).field("typeAnnotation",a,n.null),["ClassDeclaration","ClassExpression"].forEach(function(s){r(s).field("typeParameters",o,n.null).field("superTypeParameters",i(r("TypeParameterInstantiation"),r("TSTypeParameterInstantiation"),null),n.null).field("implements",i([r("ClassImplements")],[r("TSExpressionWithTypeArguments")]),n.emptyArray)})}c0.default=DX;(0,oj.maybeSetModuleExports)(function(){return sj})});var d0=H((u0,lj)=>{"use strict";Object.defineProperty(u0,"__esModule",{value:!0});var Kf=(ue(),Q(le)),IX=Kf.__importDefault(fs()),kX=Kf.__importDefault(l0()),NX=Kf.__importDefault(Be()),cj=Kf.__importStar(_e());function wX(e){e.use(IX.default),e.use(kX.default);var t=e.use(NX.default),r=t.Type.def,i=t.Type.or,n=e.use(cj.default).defaults;r("Flow").bases("Node"),r("FlowType").bases("Flow"),r("AnyTypeAnnotation").bases("FlowType").build(),r("EmptyTypeAnnotation").bases("FlowType").build(),r("MixedTypeAnnotation").bases("FlowType").build(),r("VoidTypeAnnotation").bases("FlowType").build(),r("SymbolTypeAnnotation").bases("FlowType").build(),r("NumberTypeAnnotation").bases("FlowType").build(),r("BigIntTypeAnnotation").bases("FlowType").build(),r("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),r("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),r("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),r("StringTypeAnnotation").bases("FlowType").build(),r("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),r("BooleanTypeAnnotation").bases("FlowType").build(),r("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),r("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",r("FlowType")),r("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",r("FlowType")),r("NullLiteralTypeAnnotation").bases("FlowType").build(),r("NullTypeAnnotation").bases("FlowType").build(),r("ThisTypeAnnotation").bases("FlowType").build(),r("ExistsTypeAnnotation").bases("FlowType").build(),r("ExistentialTypeParam").bases("FlowType").build(),r("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[r("FunctionTypeParam")]).field("returnType",r("FlowType")).field("rest",i(r("FunctionTypeParam"),null)).field("typeParameters",i(r("TypeParameterDeclaration"),null)),r("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",i(r("Identifier"),null)).field("typeAnnotation",r("FlowType")).field("optional",Boolean),r("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",r("FlowType")),r("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[i(r("ObjectTypeProperty"),r("ObjectTypeSpreadProperty"))]).field("indexers",[r("ObjectTypeIndexer")],n.emptyArray).field("callProperties",[r("ObjectTypeCallProperty")],n.emptyArray).field("inexact",i(Boolean,void 0),n.undefined).field("exact",Boolean,n.false).field("internalSlots",[r("ObjectTypeInternalSlot")],n.emptyArray),r("Variance").bases("Node").build("kind").field("kind",i("plus","minus"));var a=i(r("Variance"),"plus","minus",null);r("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",i(r("Literal"),r("Identifier"))).field("value",r("FlowType")).field("optional",Boolean).field("variance",a,n.null),r("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",r("Identifier")).field("key",r("FlowType")).field("value",r("FlowType")).field("variance",a,n.null).field("static",Boolean,n.false),r("ObjectTypeCallProperty").bases("Node").build("value").field("value",r("FunctionTypeAnnotation")).field("static",Boolean,n.false),r("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",i(r("Identifier"),r("QualifiedTypeIdentifier"))).field("id",r("Identifier")),r("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",i(r("Identifier"),r("QualifiedTypeIdentifier"))).field("typeParameters",i(r("TypeParameterInstantiation"),null)),r("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",r("Identifier")).field("property",i(r("MemberTypeAnnotation"),r("GenericTypeAnnotation"))),r("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",r("FlowType")).field("indexType",r("FlowType")),r("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",r("FlowType")).field("indexType",r("FlowType")).field("optional",Boolean),r("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",r("FlowType")),r("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",r("FlowType")),r("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",r("Identifier")).field("value",r("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),r("TypeParameterDeclaration").bases("Node").build("params").field("params",[r("TypeParameter")]),r("TypeParameterInstantiation").bases("Node").build("params").field("params",[r("FlowType")]),r("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",a,n.null).field("bound",i(r("TypeAnnotation"),null),n.null).field("default",i(r("FlowType"),null),n.null),r("ClassProperty").field("variance",a,n.null),r("ClassImplements").bases("Node").build("id").field("id",r("Identifier")).field("superClass",i(r("Expression"),null),n.null).field("typeParameters",i(r("TypeParameterInstantiation"),null),n.null),r("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",r("ObjectTypeAnnotation")).field("extends",i([r("InterfaceExtends")],null),n.null),r("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null),n.null).field("body",r("ObjectTypeAnnotation")).field("extends",[r("InterfaceExtends")]),r("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),r("InterfaceExtends").bases("Node").build("id").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterInstantiation"),null),n.null),r("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null)).field("right",r("FlowType")),r("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),r("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null)).field("impltype",r("FlowType")).field("supertype",i(r("FlowType"),null)),r("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",i(r("FlowType"),null)),r("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",r("Expression")).field("typeAnnotation",r("TypeAnnotation")),r("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("DeclareVariable").bases("Statement").build("id").field("id",r("Identifier")),r("DeclareFunction").bases("Statement").build("id").field("id",r("Identifier")).field("predicate",i(r("FlowPredicate"),null),n.null),r("DeclareClass").bases("InterfaceDeclaration").build("id"),r("DeclareModule").bases("Statement").build("id","body").field("id",i(r("Identifier"),r("Literal"))).field("body",r("BlockStatement")),r("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",r("TypeAnnotation")),r("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",i(r("DeclareVariable"),r("DeclareFunction"),r("DeclareClass"),r("FlowType"),r("TypeAlias"),r("DeclareOpaqueType"),r("InterfaceDeclaration"),null)).field("specifiers",[i(r("ExportSpecifier"),r("ExportBatchSpecifier"))],n.emptyArray).field("source",i(r("Literal"),null),n.null),r("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",i(r("Literal"),null),n.null),r("ImportDeclaration").field("importKind",i("value","type","typeof"),function(){return"value"}),r("FlowPredicate").bases("Flow"),r("InferredPredicate").bases("FlowPredicate").build(),r("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",r("Expression")),r("Function").field("predicate",i(r("FlowPredicate"),null),n.null),r("CallExpression").field("typeArguments",i(null,r("TypeParameterInstantiation")),n.null),r("NewExpression").field("typeArguments",i(null,r("TypeParameterInstantiation")),n.null),r("EnumDeclaration").bases("Declaration").build("id","body").field("id",r("Identifier")).field("body",i(r("EnumBooleanBody"),r("EnumNumberBody"),r("EnumStringBody"),r("EnumSymbolBody"))),r("EnumBooleanBody").build("members","explicitType").field("members",[r("EnumBooleanMember")]).field("explicitType",Boolean),r("EnumNumberBody").build("members","explicitType").field("members",[r("EnumNumberMember")]).field("explicitType",Boolean),r("EnumStringBody").build("members","explicitType").field("members",i([r("EnumStringMember")],[r("EnumDefaultedMember")])).field("explicitType",Boolean),r("EnumSymbolBody").build("members").field("members",[r("EnumDefaultedMember")]),r("EnumBooleanMember").build("id","init").field("id",r("Identifier")).field("init",i(r("Literal"),Boolean)),r("EnumNumberMember").build("id","init").field("id",r("Identifier")).field("init",r("Literal")),r("EnumStringMember").build("id","init").field("id",r("Identifier")).field("init",r("Literal")),r("EnumDefaultedMember").build("id").field("id",r("Identifier"))}u0.default=wX;(0,cj.maybeSetModuleExports)(function(){return lj})});var pj=H((m0,dj)=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var p0=(ue(),Q(le)),PX=p0.__importDefault(fs()),RX=p0.__importDefault(Be()),uj=p0.__importStar(_e());function OX(e){e.use(PX.default);var t=e.use(RX.default),r=e.use(uj.default).defaults,i=t.Type.def,n=t.Type.or;i("VariableDeclaration").field("declarations",[n(i("VariableDeclarator"),i("Identifier"))]),i("Property").field("value",n(i("Expression"),i("Pattern"))),i("ArrayPattern").field("elements",[n(i("Pattern"),i("SpreadElement"),null)]),i("ObjectPattern").field("properties",[n(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"))]),i("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ExportBatchSpecifier").bases("Specifier").build(),i("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",n(i("Declaration"),i("Expression"),null)).field("specifiers",[n(i("ExportSpecifier"),i("ExportBatchSpecifier"))],r.emptyArray).field("source",n(i("Literal"),null),r.null),i("Block").bases("Comment").build("value","leading","trailing"),i("Line").bases("Comment").build("value","leading","trailing")}m0.default=OX;(0,uj.maybeSetModuleExports)(function(){return dj})});var g0=H((h0,fj)=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var f0=(ue(),Q(le)),$X=f0.__importDefault(fs()),jX=f0.__importDefault(Be()),mj=f0.__importStar(_e());function MX(e){var t,r,i,n,a;e.use($X.default);var o=e.use(jX.default),s=e.use(mj.default).defaults,l=o.Type.def,m=o.Type.or,d=o.builtInTypes.undefined;l("Noop").bases("Statement").build(),l("DoExpression").bases("Expression").build("body").field("body",[l("Statement")]),l("BindExpression").bases("Expression").build("object","callee").field("object",m(l("Expression"),null)).field("callee",l("Expression")),l("ParenthesizedExpression").bases("Expression").build("expression").field("expression",l("Expression")),l("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",l("Identifier")),l("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",l("Identifier")),l("CommentBlock").bases("Comment").build("value","leading","trailing"),l("CommentLine").bases("Comment").build("value","leading","trailing"),l("Directive").bases("Node").build("value").field("value",l("DirectiveLiteral")),l("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,s["use strict"]),l("InterpreterDirective").bases("Node").build("value").field("value",String),l("BlockStatement").bases("Statement").build("body").field("body",[l("Statement")]).field("directives",[l("Directive")],s.emptyArray),l("Program").bases("Node").build("body").field("body",[l("Statement")]).field("directives",[l("Directive")],s.emptyArray).field("interpreter",m(l("InterpreterDirective"),null),s.null);function h(f,y){return f===void 0&&(f=String),["extra",{rawValue:f,raw:String},function(){var b=o.getFieldValue(this,"value");return{rawValue:b,raw:y?y(b):String(b)}}]}(t=l("StringLiteral").bases("Literal").build("value").field("value",String)).field.apply(t,h(String,function(f){return JSON.stringify(f)})),(r=l("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",m(String,null),s.null)).field.apply(r,h(Number)),(i=l("BigIntLiteral").bases("Literal").build("value").field("value",m(String,Number))).field.apply(i,h(String,function(f){return f+"n"})),(n=l("DecimalLiteral").bases("Literal").build("value").field("value",String)).field.apply(n,h(String,function(f){return f+"m"})),l("NullLiteral").bases("Literal").build().field("value",null,s.null),l("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),(a=l("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)})).field.apply(a,h(m(RegExp,d),function(f){return"/".concat(f.pattern,"/").concat(f.flags||"")})).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var g=m(l("Property"),l("ObjectMethod"),l("ObjectProperty"),l("SpreadProperty"),l("SpreadElement"));l("ObjectExpression").bases("Expression").build("properties").field("properties",[g]),l("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",m("method","get","set")).field("key",m(l("Literal"),l("Identifier"),l("Expression"))).field("params",[l("Pattern")]).field("body",l("BlockStatement")).field("computed",Boolean,s.false).field("generator",Boolean,s.false).field("async",Boolean,s.false).field("accessibility",m(l("Literal"),null),s.null).field("decorators",m([l("Decorator")],null),s.null),l("ObjectProperty").bases("Node").build("key","value").field("key",m(l("Literal"),l("Identifier"),l("Expression"))).field("value",m(l("Expression"),l("Pattern"))).field("accessibility",m(l("Literal"),null),s.null).field("computed",Boolean,s.false);var u=m(l("MethodDefinition"),l("VariableDeclarator"),l("ClassPropertyDefinition"),l("ClassProperty"),l("ClassPrivateProperty"),l("ClassMethod"),l("ClassPrivateMethod"),l("ClassAccessorProperty"),l("StaticBlock"));l("ClassBody").bases("Declaration").build("body").field("body",[u]),l("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",m(l("Literal"),l("Identifier"),l("Expression"))),l("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",l("PrivateName")),l("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",m(l("Literal"),l("Identifier"),l("PrivateName"),l("Expression"))).field("value",m(l("Expression"),null),s.null),["ClassMethod","ClassPrivateMethod"].forEach(function(f){l(f).field("kind",m("get","set","method","constructor"),function(){return"method"}).field("body",l("BlockStatement")).field("access",m("public","private","protected",null),s.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(function(f){l(f).field("computed",Boolean,s.false).field("static",Boolean,s.false).field("abstract",Boolean,s.false).field("accessibility",m("public","private","protected",null),s.null).field("decorators",m([l("Decorator")],null),s.null).field("definite",Boolean,s.false).field("optional",Boolean,s.false).field("override",Boolean,s.false).field("readonly",Boolean,s.false)});var p=m(l("Property"),l("PropertyPattern"),l("SpreadPropertyPattern"),l("SpreadProperty"),l("ObjectProperty"),l("RestProperty"),l("RestElement"));l("ObjectPattern").bases("Pattern").build("properties").field("properties",[p]).field("decorators",m([l("Decorator")],null),s.null),l("SpreadProperty").bases("Node").build("argument").field("argument",l("Expression")),l("RestProperty").bases("Node").build("argument").field("argument",l("Expression")),l("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",m(l("VariableDeclaration"),l("Expression"))).field("right",l("Expression")).field("body",l("Statement")),l("Import").bases("Expression").build()}h0.default=MX;(0,mj.maybeSetModuleExports)(function(){return fj})});var gj=H((v0,hj)=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});var y0=(ue(),Q(le)),LX=y0.__importDefault(Be()),FX=y0.__importDefault(g0()),UX=y0.__importDefault(d0()),zX=_e();function BX(e){var t=e.use(LX.default),r=t.Type.def;e.use(FX.default),e.use(UX.default),r("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),r("TopicReference").bases("Expression").build()}v0.default=BX;(0,zX.maybeSetModuleExports)(function(){return hj})});var bj=H((b0,vj)=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var Zf=(ue(),Q(le)),GX=Zf.__importDefault(g0()),VX=Zf.__importDefault(l0()),WX=Zf.__importDefault(Be()),yj=Zf.__importStar(_e());function KX(e){e.use(GX.default),e.use(VX.default);var t=e.use(WX.default),r=t.namedTypes,i=t.Type.def,n=t.Type.or,a=e.use(yj.default).defaults,o=t.Type.from(function(d,h){return!!(r.StringLiteral&&r.StringLiteral.check(d,h)||r.Literal&&r.Literal.check(d,h)&&typeof d.value=="string")},"StringLiteral");i("TSType").bases("Node");var s=n(i("Identifier"),i("TSQualifiedName"));i("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",s),i("TSHasOptionalTypeParameterInstantiation").field("typeParameters",n(i("TSTypeParameterInstantiation"),null),a.null),i("TSHasOptionalTypeParameters").field("typeParameters",n(i("TSTypeParameterDeclaration"),null,void 0),a.null),i("TSHasOptionalTypeAnnotation").field("typeAnnotation",n(i("TSTypeAnnotation"),null),a.null),i("TSQualifiedName").bases("Node").build("left","right").field("left",s).field("right",s),i("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")).field("extra",n({parenthesized:Boolean},null),a.null),i("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",i("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(function(d){i(d).bases("TSType").build()}),i("TSArrayType").bases("TSType").build("elementType").field("elementType",i("TSType")),i("TSLiteralType").bases("TSType").build("literal").field("literal",n(i("NumericLiteral"),i("StringLiteral"),i("BooleanLiteral"),i("TemplateLiteral"),i("UnaryExpression"),i("BigIntLiteral"))),i("TemplateLiteral").field("expressions",n([i("Expression")],[i("TSType")])),["TSUnionType","TSIntersectionType"].forEach(function(d){i(d).bases("TSType").build("types").field("types",[i("TSType")])}),i("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",i("TSType")).field("extendsType",i("TSType")).field("trueType",i("TSType")).field("falseType",i("TSType")),i("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",i("TSTypeParameter")),i("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType"));var l=[n(i("Identifier"),i("RestElement"),i("ArrayPattern"),i("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(function(d){i(d).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",l)}),i("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,a.false).field("async",Boolean,a.false).field("generator",Boolean,a.false).field("id",n(i("Identifier"),null),a.null).field("params",[i("Pattern")]).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),a.null),i("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,a.false).field("generator",Boolean,a.false).field("params",[i("Pattern")]).field("abstract",Boolean,a.false).field("accessibility",n("public","private","protected",void 0),a.undefined).field("static",Boolean,a.false).field("computed",Boolean,a.false).field("optional",Boolean,a.false).field("key",n(i("Identifier"),i("StringLiteral"),i("NumericLiteral"),i("Expression"))).field("kind",n("get","set","method","constructor"),function(){return"method"}).field("access",n("public","private","protected",void 0),a.undefined).field("decorators",n([i("Decorator")],null),a.null).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),a.null),i("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",n(Boolean,"+","-"),a.false).field("typeParameter",i("TSTypeParameter")).field("optional",n(Boolean,"+","-"),a.false).field("typeAnnotation",n(i("TSType"),null),a.null),i("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[n(i("TSType"),i("TSNamedTupleMember"))]),i("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",i("Identifier")).field("optional",Boolean,a.false).field("elementType",i("TSType")),i("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",i("TSType")).field("indexType",i("TSType")),i("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",i("TSType")),i("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",n(i("TSType"),i("TSTypeAnnotation"))),i("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[i("Identifier")]).field("readonly",Boolean,a.false),i("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",i("Expression")).field("computed",Boolean,a.false).field("readonly",Boolean,a.false).field("optional",Boolean,a.false).field("initializer",n(i("Expression"),null),a.null),i("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",i("Expression")).field("computed",Boolean,a.false).field("optional",Boolean,a.false).field("parameters",l),i("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",n(i("Identifier"),i("TSThisType"))).field("typeAnnotation",n(i("TSTypeAnnotation"),null),a.null).field("asserts",Boolean,a.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(function(d){i(d).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",l)}),i("TSEnumMember").bases("Node").build("id","initializer").field("id",n(i("Identifier"),o)).field("initializer",n(i("Expression"),null),a.null),i("TSTypeQuery").bases("TSType").build("exprName").field("exprName",n(s,i("TSImportType")));var m=n(i("TSCallSignatureDeclaration"),i("TSConstructSignatureDeclaration"),i("TSIndexSignature"),i("TSMethodSignature"),i("TSPropertySignature"));i("TSTypeLiteral").bases("TSType").build("members").field("members",[m]),i("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",n(i("Identifier"),String)).field("constraint",n(i("TSType"),void 0),a.undefined).field("default",n(i("TSType"),void 0),a.undefined),i("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",i("TSType")).field("expression",i("Expression")).field("extra",n({parenthesized:Boolean},null),a.null),i("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[i("TSTypeParameter")]),i("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",i("Expression")),i("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[i("TSType")]),i("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",i("Identifier")).field("const",Boolean,a.false).field("declare",Boolean,a.false).field("members",[i("TSEnumMember")]).field("initializer",n(i("Expression"),null),a.null),i("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",i("Identifier")).field("declare",Boolean,a.false).field("typeAnnotation",i("TSType")),i("TSModuleBlock").bases("Node").build("body").field("body",[i("Statement")]),i("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",n(o,s)).field("declare",Boolean,a.false).field("global",Boolean,a.false).field("body",n(i("TSModuleBlock"),i("TSModuleDeclaration"),null),a.null),i("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",o).field("qualifier",n(s,void 0),a.undefined),i("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",i("Identifier")).field("isExport",Boolean,a.false).field("moduleReference",n(s,i("TSExternalModuleReference"))),i("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",o),i("TSExportAssignment").bases("Statement").build("expression").field("expression",i("Expression")),i("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",i("Identifier")),i("TSInterfaceBody").bases("Node").build("body").field("body",[m]),i("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",s),i("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",s).field("declare",Boolean,a.false).field("extends",n([i("TSExpressionWithTypeArguments")],null),a.null).field("body",i("TSInterfaceBody")),i("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",n("public","private","protected",void 0),a.undefined).field("readonly",Boolean,a.false).field("parameter",n(i("Identifier"),i("AssignmentPattern"))),i("ClassProperty").field("access",n("public","private","protected",void 0),a.undefined),i("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),i("ClassBody").field("body",[n(i("MethodDefinition"),i("VariableDeclarator"),i("ClassPropertyDefinition"),i("ClassProperty"),i("ClassPrivateProperty"),i("ClassAccessorProperty"),i("ClassMethod"),i("ClassPrivateMethod"),i("StaticBlock"),i("TSDeclareMethod"),m)])}b0.default=KX;(0,yj.maybeSetModuleExports)(function(){return vj})});var Sj=H(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.namedTypes=void 0;var ZX;ZX=Xl.namedTypes||(Xl.namedTypes={})});var Ar=H(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.visit=de.use=de.Type=de.someField=de.PathVisitor=de.Path=de.NodePath=de.namedTypes=de.getSupertypeNames=de.getFieldValue=de.getFieldNames=de.getBuilderName=de.finalize=de.eachField=de.defineMethod=de.builtInTypes=de.builders=de.astNodesAreEquivalent=void 0;var Sa=(ue(),Q(le)),HX=Sa.__importDefault(E1()),JX=Sa.__importDefault(fs()),XX=Sa.__importDefault(ij()),qX=Sa.__importDefault(d0()),YX=Sa.__importDefault(pj()),QX=Sa.__importDefault(gj()),e9=Sa.__importDefault(bj()),Ej=Sj();Object.defineProperty(de,"namedTypes",{enumerable:!0,get:function(){return Ej.namedTypes}});var dt=(0,HX.default)([JX.default,XX.default,qX.default,YX.default,QX.default,e9.default]),t9=dt.astNodesAreEquivalent,r9=dt.builders,n9=dt.builtInTypes,i9=dt.defineMethod,a9=dt.eachField,o9=dt.finalize,s9=dt.getBuilderName,c9=dt.getFieldNames,l9=dt.getFieldValue,u9=dt.getSupertypeNames,d9=dt.namedTypes,p9=dt.NodePath,m9=dt.Path,f9=dt.PathVisitor,h9=dt.someField,g9=dt.Type,y9=dt.use,v9=dt.visit;de.astNodesAreEquivalent=t9;de.builders=r9;de.builtInTypes=n9;de.defineMethod=i9;de.eachField=a9;de.finalize=o9;de.getBuilderName=s9;de.getFieldNames=c9;de.getFieldValue=l9;de.getSupertypeNames=u9;de.NodePath=p9;de.Path=m9;de.PathVisitor=f9;de.someField=h9;de.Type=g9;de.use=y9;de.visit=v9;Object.assign(Ej.namedTypes,d9)});var Xn={};Lr(Xn,{default:()=>D5});function D5(e,t){if(!e){if(C5)throw new Error($T);var r=typeof t=="function"?t():t,i=r?"".concat($T,": ").concat(r):$T;throw new Error(i)}}var C5,$T,qn=zC(()=>{C5=process.env.NODE_ENV==="production",$T="Invariant failed"});var oF=H(jT=>{var aF="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");jT.encode=function(e){if(0<=e&&e<aF.length)return aF[e];throw new TypeError("Must be between 0 and 63: "+e)};jT.decode=function(e){var t=65,r=90,i=97,n=122,a=48,o=57,s=43,l=47,m=26,d=52;return t<=e&&e<=r?e-t:i<=e&&e<=n?e-i+m:a<=e&&e<=o?e-a+d:e==s?62:e==l?63:-1}});var FT=H(LT=>{var sF=oF(),MT=5,cF=1<<MT,lF=cF-1,uF=cF;function I5(e){return e<0?(-e<<1)+1:(e<<1)+0}function k5(e){var t=(e&1)===1,r=e>>1;return t?-r:r}LT.encode=function(t){var r="",i,n=I5(t);do i=n&lF,n>>>=MT,n>0&&(i|=uF),r+=sF.encode(i);while(n>0);return r};LT.decode=function(t,r,i){var n=t.length,a=0,o=0,s,l;do{if(r>=n)throw new Error("Expected more digits in base 64 VLQ value.");if(l=sF.decode(t.charCodeAt(r++)),l===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));s=!!(l&uF),l&=lF,a=a+(l<<o),o+=MT}while(s);i.value=k5(a),i.rest=r}});var Ks=H(xt=>{function N5(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}xt.getArg=N5;var dF=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,w5=/^data:.+\,.+$/;function zu(e){var t=e.match(dF);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}xt.urlParse=zu;function Vs(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}xt.urlGenerate=Vs;function UT(e){var t=e,r=zu(e);if(r){if(!r.path)return e;t=r.path}for(var i=xt.isAbsolute(t),n=t.split(/\/+/),a,o=0,s=n.length-1;s>=0;s--)a=n[s],a==="."?n.splice(s,1):a===".."?o++:o>0&&(a===""?(n.splice(s+1,o),o=0):(n.splice(s,2),o--));return t=n.join("/"),t===""&&(t=i?"/":"."),r?(r.path=t,Vs(r)):t}xt.normalize=UT;function pF(e,t){e===""&&(e="."),t===""&&(t=".");var r=zu(t),i=zu(e);if(i&&(e=i.path||"/"),r&&!r.scheme)return i&&(r.scheme=i.scheme),Vs(r);if(r||t.match(w5))return t;if(i&&!i.host&&!i.path)return i.host=t,Vs(i);var n=t.charAt(0)==="/"?t:UT(e.replace(/\/+$/,"")+"/"+t);return i?(i.path=n,Vs(i)):n}xt.join=pF;xt.isAbsolute=function(e){return e.charAt(0)==="/"||dF.test(e)};function P5(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var i=e.lastIndexOf("/");if(i<0||(e=e.slice(0,i),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}xt.relative=P5;var mF=(function(){var e=Object.create(null);return!("__proto__"in e)})();function fF(e){return e}function R5(e){return hF(e)?"$"+e:e}xt.toSetString=mF?fF:R5;function O5(e){return hF(e)?e.slice(1):e}xt.fromSetString=mF?fF:O5;function hF(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function $5(e,t,r){var i=Ws(e.source,t.source);return i!==0||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0||r)||(i=e.generatedColumn-t.generatedColumn,i!==0)||(i=e.generatedLine-t.generatedLine,i!==0)?i:Ws(e.name,t.name)}xt.compareByOriginalPositions=$5;function j5(e,t,r){var i=e.generatedLine-t.generatedLine;return i!==0||(i=e.generatedColumn-t.generatedColumn,i!==0||r)||(i=Ws(e.source,t.source),i!==0)||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0)?i:Ws(e.name,t.name)}xt.compareByGeneratedPositionsDeflated=j5;function Ws(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function M5(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=Ws(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:Ws(e.name,t.name)}xt.compareByGeneratedPositionsInflated=M5;function L5(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}xt.parseSourceMapInput=L5;function F5(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var i=zu(r);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var n=i.path.lastIndexOf("/");n>=0&&(i.path=i.path.substring(0,n+1))}t=pF(Vs(i),t)}return UT(t)}xt.computeSourceURL=F5});var GT=H(gF=>{var zT=Ks(),BT=Object.prototype.hasOwnProperty,Fa=typeof Map<"u";function Yn(){this._array=[],this._set=Fa?new Map:Object.create(null)}Yn.fromArray=function(t,r){for(var i=new Yn,n=0,a=t.length;n<a;n++)i.add(t[n],r);return i};Yn.prototype.size=function(){return Fa?this._set.size:Object.getOwnPropertyNames(this._set).length};Yn.prototype.add=function(t,r){var i=Fa?t:zT.toSetString(t),n=Fa?this.has(t):BT.call(this._set,i),a=this._array.length;(!n||r)&&this._array.push(t),n||(Fa?this._set.set(t,a):this._set[i]=a)};Yn.prototype.has=function(t){if(Fa)return this._set.has(t);var r=zT.toSetString(t);return BT.call(this._set,r)};Yn.prototype.indexOf=function(t){if(Fa){var r=this._set.get(t);if(r>=0)return r}else{var i=zT.toSetString(t);if(BT.call(this._set,i))return this._set[i]}throw new Error('"'+t+'" is not in the set.')};Yn.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};Yn.prototype.toArray=function(){return this._array.slice()};gF.ArraySet=Yn});var bF=H(vF=>{var yF=Ks();function U5(e,t){var r=e.generatedLine,i=t.generatedLine,n=e.generatedColumn,a=t.generatedColumn;return i>r||i==r&&a>=n||yF.compareByGeneratedPositionsInflated(e,t)<=0}function Kh(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Kh.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};Kh.prototype.add=function(t){U5(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Kh.prototype.toArray=function(){return this._sorted||(this._array.sort(yF.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};vF.MappingList=Kh});var VT=H(SF=>{var Bu=FT(),Ye=Ks(),Zh=GT().ArraySet,z5=bF().MappingList;function Rr(e){e||(e={}),this._file=Ye.getArg(e,"file",null),this._sourceRoot=Ye.getArg(e,"sourceRoot",null),this._skipValidation=Ye.getArg(e,"skipValidation",!1),this._sources=new Zh,this._names=new Zh,this._mappings=new z5,this._sourcesContents=null}Rr.prototype._version=3;Rr.fromSourceMap=function(t){var r=t.sourceRoot,i=new Rr({file:t.file,sourceRoot:r});return t.eachMapping(function(n){var a={generated:{line:n.generatedLine,column:n.generatedColumn}};n.source!=null&&(a.source=n.source,r!=null&&(a.source=Ye.relative(r,a.source)),a.original={line:n.originalLine,column:n.originalColumn},n.name!=null&&(a.name=n.name)),i.addMapping(a)}),t.sources.forEach(function(n){var a=n;r!==null&&(a=Ye.relative(r,n)),i._sources.has(a)||i._sources.add(a);var o=t.sourceContentFor(n);o!=null&&i.setSourceContent(n,o)}),i};Rr.prototype.addMapping=function(t){var r=Ye.getArg(t,"generated"),i=Ye.getArg(t,"original",null),n=Ye.getArg(t,"source",null),a=Ye.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,i,n,a),n!=null&&(n=String(n),this._sources.has(n)||this._sources.add(n)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:i!=null&&i.line,originalColumn:i!=null&&i.column,source:n,name:a})};Rr.prototype.setSourceContent=function(t,r){var i=t;this._sourceRoot!=null&&(i=Ye.relative(this._sourceRoot,i)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Ye.toSetString(i)]=r):this._sourcesContents&&(delete this._sourcesContents[Ye.toSetString(i)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Rr.prototype.applySourceMap=function(t,r,i){var n=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);n=t.file}var a=this._sourceRoot;a!=null&&(n=Ye.relative(a,n));var o=new Zh,s=new Zh;this._mappings.unsortedForEach(function(l){if(l.source===n&&l.originalLine!=null){var m=t.originalPositionFor({line:l.originalLine,column:l.originalColumn});m.source!=null&&(l.source=m.source,i!=null&&(l.source=Ye.join(i,l.source)),a!=null&&(l.source=Ye.relative(a,l.source)),l.originalLine=m.line,l.originalColumn=m.column,m.name!=null&&(l.name=m.name))}var d=l.source;d!=null&&!o.has(d)&&o.add(d);var h=l.name;h!=null&&!s.has(h)&&s.add(h)},this),this._sources=o,this._names=s,t.sources.forEach(function(l){var m=t.sourceContentFor(l);m!=null&&(i!=null&&(l=Ye.join(i,l)),a!=null&&(l=Ye.relative(a,l)),this.setSourceContent(l,m))},this)};Rr.prototype._validateMapping=function(t,r,i,n){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!i&&!n)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&i)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:i,original:r,name:n}))}};Rr.prototype._serializeMappings=function(){for(var t=0,r=1,i=0,n=0,a=0,o=0,s="",l,m,d,h,g=this._mappings.toArray(),u=0,p=g.length;u<p;u++){if(m=g[u],l="",m.generatedLine!==r)for(t=0;m.generatedLine!==r;)l+=";",r++;else if(u>0){if(!Ye.compareByGeneratedPositionsInflated(m,g[u-1]))continue;l+=","}l+=Bu.encode(m.generatedColumn-t),t=m.generatedColumn,m.source!=null&&(h=this._sources.indexOf(m.source),l+=Bu.encode(h-o),o=h,l+=Bu.encode(m.originalLine-1-n),n=m.originalLine-1,l+=Bu.encode(m.originalColumn-i),i=m.originalColumn,m.name!=null&&(d=this._names.indexOf(m.name),l+=Bu.encode(d-a),a=d)),s+=l}return s};Rr.prototype._generateSourcesContent=function(t,r){return t.map(function(i){if(!this._sourcesContents)return null;r!=null&&(i=Ye.relative(r,i));var n=Ye.toSetString(i);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};Rr.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};Rr.prototype.toString=function(){return JSON.stringify(this.toJSON())};SF.SourceMapGenerator=Rr});var EF=H(Ua=>{Ua.GREATEST_LOWER_BOUND=1;Ua.LEAST_UPPER_BOUND=2;function WT(e,t,r,i,n,a){var o=Math.floor((t-e)/2)+e,s=n(r,i[o],!0);return s===0?o:s>0?t-o>1?WT(o,t,r,i,n,a):a==Ua.LEAST_UPPER_BOUND?t<i.length?t:-1:o:o-e>1?WT(e,o,r,i,n,a):a==Ua.LEAST_UPPER_BOUND?o:e<0?-1:e}Ua.search=function(t,r,i,n){if(r.length===0)return-1;var a=WT(-1,r.length,t,r,i,n||Ua.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&i(r[a],r[a-1],!0)===0;)--a;return a}});var xF=H(AF=>{function KT(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function B5(e,t){return Math.round(e+Math.random()*(t-e))}function ZT(e,t,r,i){if(r<i){var n=B5(r,i),a=r-1;KT(e,n,i);for(var o=e[i],s=r;s<i;s++)t(e[s],o)<=0&&(a+=1,KT(e,a,s));KT(e,a+1,s);var l=a+1;ZT(e,t,r,l-1),ZT(e,t,l+1,i)}}AF.quickSort=function(e,t){ZT(e,t,0,e.length-1)}});var TF=H(Hh=>{var V=Ks(),HT=EF(),Zs=GT().ArraySet,G5=FT(),Gu=xF().quickSort;function Fe(e,t){var r=e;return typeof e=="string"&&(r=V.parseSourceMapInput(e)),r.sections!=null?new Hr(r,t):new gt(r,t)}Fe.fromSourceMap=function(e,t){return gt.fromSourceMap(e,t)};Fe.prototype._version=3;Fe.prototype.__generatedMappings=null;Object.defineProperty(Fe.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Fe.prototype.__originalMappings=null;Object.defineProperty(Fe.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Fe.prototype._charIsMappingSeparator=function(t,r){var i=t.charAt(r);return i===";"||i===","};Fe.prototype._parseMappings=function(t,r){throw new Error("Subclasses must implement _parseMappings")};Fe.GENERATED_ORDER=1;Fe.ORIGINAL_ORDER=2;Fe.GREATEST_LOWER_BOUND=1;Fe.LEAST_UPPER_BOUND=2;Fe.prototype.eachMapping=function(t,r,i){var n=r||null,a=i||Fe.GENERATED_ORDER,o;switch(a){case Fe.GENERATED_ORDER:o=this._generatedMappings;break;case Fe.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;o.map(function(l){var m=l.source===null?null:this._sources.at(l.source);return m=V.computeSourceURL(s,m,this._sourceMapURL),{source:m,generatedLine:l.generatedLine,generatedColumn:l.generatedColumn,originalLine:l.originalLine,originalColumn:l.originalColumn,name:l.name===null?null:this._names.at(l.name)}},this).forEach(t,n)};Fe.prototype.allGeneratedPositionsFor=function(t){var r=V.getArg(t,"line"),i={source:V.getArg(t,"source"),originalLine:r,originalColumn:V.getArg(t,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var n=[],a=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",V.compareByOriginalPositions,HT.LEAST_UPPER_BOUND);if(a>=0){var o=this._originalMappings[a];if(t.column===void 0)for(var s=o.originalLine;o&&o.originalLine===s;)n.push({line:V.getArg(o,"generatedLine",null),column:V.getArg(o,"generatedColumn",null),lastColumn:V.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++a];else for(var l=o.originalColumn;o&&o.originalLine===r&&o.originalColumn==l;)n.push({line:V.getArg(o,"generatedLine",null),column:V.getArg(o,"generatedColumn",null),lastColumn:V.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++a]}return n};Hh.SourceMapConsumer=Fe;function gt(e,t){var r=e;typeof e=="string"&&(r=V.parseSourceMapInput(e));var i=V.getArg(r,"version"),n=V.getArg(r,"sources"),a=V.getArg(r,"names",[]),o=V.getArg(r,"sourceRoot",null),s=V.getArg(r,"sourcesContent",null),l=V.getArg(r,"mappings"),m=V.getArg(r,"file",null);if(i!=this._version)throw new Error("Unsupported version: "+i);o&&(o=V.normalize(o)),n=n.map(String).map(V.normalize).map(function(d){return o&&V.isAbsolute(o)&&V.isAbsolute(d)?V.relative(o,d):d}),this._names=Zs.fromArray(a.map(String),!0),this._sources=Zs.fromArray(n,!0),this._absoluteSources=this._sources.toArray().map(function(d){return V.computeSourceURL(o,d,t)}),this.sourceRoot=o,this.sourcesContent=s,this._mappings=l,this._sourceMapURL=t,this.file=m}gt.prototype=Object.create(Fe.prototype);gt.prototype.consumer=Fe;gt.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=V.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1};gt.fromSourceMap=function(t,r){var i=Object.create(gt.prototype),n=i._names=Zs.fromArray(t._names.toArray(),!0),a=i._sources=Zs.fromArray(t._sources.toArray(),!0);i.sourceRoot=t._sourceRoot,i.sourcesContent=t._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=t._file,i._sourceMapURL=r,i._absoluteSources=i._sources.toArray().map(function(u){return V.computeSourceURL(i.sourceRoot,u,r)});for(var o=t._mappings.toArray().slice(),s=i.__generatedMappings=[],l=i.__originalMappings=[],m=0,d=o.length;m<d;m++){var h=o[m],g=new _F;g.generatedLine=h.generatedLine,g.generatedColumn=h.generatedColumn,h.source&&(g.source=a.indexOf(h.source),g.originalLine=h.originalLine,g.originalColumn=h.originalColumn,h.name&&(g.name=n.indexOf(h.name)),l.push(g)),s.push(g)}return Gu(i.__originalMappings,V.compareByOriginalPositions),i};gt.prototype._version=3;Object.defineProperty(gt.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function _F(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}gt.prototype._parseMappings=function(t,r){for(var i=1,n=0,a=0,o=0,s=0,l=0,m=t.length,d=0,h={},g={},u=[],p=[],f,y,v,b,_;d<m;)if(t.charAt(d)===";")i++,d++,n=0;else if(t.charAt(d)===",")d++;else{for(f=new _F,f.generatedLine=i,b=d;b<m&&!this._charIsMappingSeparator(t,b);b++);if(y=t.slice(d,b),v=h[y],v)d+=y.length;else{for(v=[];d<b;)G5.decode(t,d,g),_=g.value,d=g.rest,v.push(_);if(v.length===2)throw new Error("Found a source, but no line and column");if(v.length===3)throw new Error("Found a source and line, but no column");h[y]=v}f.generatedColumn=n+v[0],n=f.generatedColumn,v.length>1&&(f.source=s+v[1],s+=v[1],f.originalLine=a+v[2],a=f.originalLine,f.originalLine+=1,f.originalColumn=o+v[3],o=f.originalColumn,v.length>4&&(f.name=l+v[4],l+=v[4])),p.push(f),typeof f.originalLine=="number"&&u.push(f)}Gu(p,V.compareByGeneratedPositionsDeflated),this.__generatedMappings=p,Gu(u,V.compareByOriginalPositions),this.__originalMappings=u};gt.prototype._findMapping=function(t,r,i,n,a,o){if(t[i]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[i]);if(t[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[n]);return HT.search(t,r,a,o)};gt.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var i=this._generatedMappings[t+1];if(r.generatedLine===i.generatedLine){r.lastGeneratedColumn=i.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};gt.prototype.originalPositionFor=function(t){var r={generatedLine:V.getArg(t,"line"),generatedColumn:V.getArg(t,"column")},i=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",V.compareByGeneratedPositionsDeflated,V.getArg(t,"bias",Fe.GREATEST_LOWER_BOUND));if(i>=0){var n=this._generatedMappings[i];if(n.generatedLine===r.generatedLine){var a=V.getArg(n,"source",null);a!==null&&(a=this._sources.at(a),a=V.computeSourceURL(this.sourceRoot,a,this._sourceMapURL));var o=V.getArg(n,"name",null);return o!==null&&(o=this._names.at(o)),{source:a,line:V.getArg(n,"originalLine",null),column:V.getArg(n,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};gt.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};gt.prototype.sourceContentFor=function(t,r){if(!this.sourcesContent)return null;var i=this._findSourceIndex(t);if(i>=0)return this.sourcesContent[i];var n=t;this.sourceRoot!=null&&(n=V.relative(this.sourceRoot,n));var a;if(this.sourceRoot!=null&&(a=V.urlParse(this.sourceRoot))){var o=n.replace(/^file:\/\//,"");if(a.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!a.path||a.path=="/")&&this._sources.has("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(r)return null;throw new Error('"'+n+'" is not in the SourceMap.')};gt.prototype.generatedPositionFor=function(t){var r=V.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var i={source:r,originalLine:V.getArg(t,"line"),originalColumn:V.getArg(t,"column")},n=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",V.compareByOriginalPositions,V.getArg(t,"bias",Fe.GREATEST_LOWER_BOUND));if(n>=0){var a=this._originalMappings[n];if(a.source===i.source)return{line:V.getArg(a,"generatedLine",null),column:V.getArg(a,"generatedColumn",null),lastColumn:V.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Hh.BasicSourceMapConsumer=gt;function Hr(e,t){var r=e;typeof e=="string"&&(r=V.parseSourceMapInput(e));var i=V.getArg(r,"version"),n=V.getArg(r,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new Zs,this._names=new Zs;var a={line:-1,column:0};this._sections=n.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var s=V.getArg(o,"offset"),l=V.getArg(s,"line"),m=V.getArg(s,"column");if(l<a.line||l===a.line&&m<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=s,{generatedOffset:{generatedLine:l+1,generatedColumn:m+1},consumer:new Fe(V.getArg(o,"map"),t)}})}Hr.prototype=Object.create(Fe.prototype);Hr.prototype.constructor=Fe;Hr.prototype._version=3;Object.defineProperty(Hr.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}});Hr.prototype.originalPositionFor=function(t){var r={generatedLine:V.getArg(t,"line"),generatedColumn:V.getArg(t,"column")},i=HT.search(r,this._sections,function(a,o){var s=a.generatedLine-o.generatedOffset.generatedLine;return s||a.generatedColumn-o.generatedOffset.generatedColumn}),n=this._sections[i];return n?n.consumer.originalPositionFor({line:r.generatedLine-(n.generatedOffset.generatedLine-1),column:r.generatedColumn-(n.generatedOffset.generatedLine===r.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}};Hr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};Hr.prototype.sourceContentFor=function(t,r){for(var i=0;i<this._sections.length;i++){var n=this._sections[i],a=n.consumer.sourceContentFor(t,!0);if(a)return a}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')};Hr.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var i=this._sections[r];if(i.consumer._findSourceIndex(V.getArg(t,"source"))!==-1){var n=i.consumer.generatedPositionFor(t);if(n){var a={line:n.line+(i.generatedOffset.generatedLine-1),column:n.column+(i.generatedOffset.generatedLine===n.line?i.generatedOffset.generatedColumn-1:0)};return a}}}return{line:null,column:null}};Hr.prototype._parseMappings=function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var i=0;i<this._sections.length;i++)for(var n=this._sections[i],a=n.consumer._generatedMappings,o=0;o<a.length;o++){var s=a[o],l=n.consumer._sources.at(s.source);l=V.computeSourceURL(n.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var m=null;s.name&&(m=n.consumer._names.at(s.name),this._names.add(m),m=this._names.indexOf(m));var d={source:l,generatedLine:s.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(n.generatedOffset.generatedLine===s.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:m};this.__generatedMappings.push(d),typeof d.originalLine=="number"&&this.__originalMappings.push(d)}Gu(this.__generatedMappings,V.compareByGeneratedPositionsDeflated),Gu(this.__originalMappings,V.compareByOriginalPositions)};Hh.IndexedSourceMapConsumer=Hr});var DF=H(CF=>{var V5=VT().SourceMapGenerator,Jh=Ks(),W5=/(\r?\n)/,K5=10,Hs="$$$isSourceNode$$$";function sr(e,t,r,i,n){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=r??null,this.name=n??null,this[Hs]=!0,i!=null&&this.add(i)}sr.fromStringWithSourceMap=function(t,r,i){var n=new sr,a=t.split(W5),o=0,s=function(){var g=p(),u=p()||"";return g+u;function p(){return o<a.length?a[o++]:void 0}},l=1,m=0,d=null;return r.eachMapping(function(g){if(d!==null)if(l<g.generatedLine)h(d,s()),l++,m=0;else{var u=a[o]||"",p=u.substr(0,g.generatedColumn-m);a[o]=u.substr(g.generatedColumn-m),m=g.generatedColumn,h(d,p),d=g;return}for(;l<g.generatedLine;)n.add(s()),l++;if(m<g.generatedColumn){var u=a[o]||"";n.add(u.substr(0,g.generatedColumn)),a[o]=u.substr(g.generatedColumn),m=g.generatedColumn}d=g},this),o<a.length&&(d&&h(d,s()),n.add(a.splice(o).join(""))),r.sources.forEach(function(g){var u=r.sourceContentFor(g);u!=null&&(i!=null&&(g=Jh.join(i,g)),n.setSourceContent(g,u))}),n;function h(g,u){if(g===null||g.source===void 0)n.add(u);else{var p=i?Jh.join(i,g.source):g.source;n.add(new sr(g.originalLine,g.originalColumn,p,u,g.name))}}};sr.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[Hs]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};sr.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[Hs]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};sr.prototype.walk=function(t){for(var r,i=0,n=this.children.length;i<n;i++)r=this.children[i],r[Hs]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})};sr.prototype.join=function(t){var r,i,n=this.children.length;if(n>0){for(r=[],i=0;i<n-1;i++)r.push(this.children[i]),r.push(t);r.push(this.children[i]),this.children=r}return this};sr.prototype.replaceRight=function(t,r){var i=this.children[this.children.length-1];return i[Hs]?i.replaceRight(t,r):typeof i=="string"?this.children[this.children.length-1]=i.replace(t,r):this.children.push("".replace(t,r)),this};sr.prototype.setSourceContent=function(t,r){this.sourceContents[Jh.toSetString(t)]=r};sr.prototype.walkSourceContents=function(t){for(var r=0,i=this.children.length;r<i;r++)this.children[r][Hs]&&this.children[r].walkSourceContents(t);for(var n=Object.keys(this.sourceContents),r=0,i=n.length;r<i;r++)t(Jh.fromSetString(n[r]),this.sourceContents[n[r]])};sr.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t};sr.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},i=new V5(t),n=!1,a=null,o=null,s=null,l=null;return this.walk(function(m,d){r.code+=m,d.source!==null&&d.line!==null&&d.column!==null?((a!==d.source||o!==d.line||s!==d.column||l!==d.name)&&i.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name}),a=d.source,o=d.line,s=d.column,l=d.name,n=!0):n&&(i.addMapping({generated:{line:r.line,column:r.column}}),a=null,n=!1);for(var h=0,g=m.length;h<g;h++)m.charCodeAt(h)===K5?(r.line++,r.column=0,h+1===g?(a=null,n=!1):n&&i.addMapping({source:d.source,original:{line:d.line,column:d.column},generated:{line:r.line,column:r.column},name:d.name})):r.column++}),this.walkSourceContents(function(m,d){i.setSourceContent(m,d)}),{code:r.code,map:i}};CF.SourceNode=sr});var JT=H(Xh=>{Xh.SourceMapGenerator=VT().SourceMapGenerator;Xh.SourceMapConsumer=TF().SourceMapConsumer;Xh.SourceNode=DF().SourceNode});var vn=H(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.isTrailingCommaEnabled=je.getParentExportDeclaration=je.isExportDeclaration=je.fixFaultyLocations=je.getTrueLoc=je.composeSourceMaps=je.copyPos=je.comparePos=je.getUnionOfKeys=je.getOption=je.isBrowser=je.getLineTerminator=void 0;var qT=(ue(),Q(le)),Vu=qT.__importDefault((qn(),Q(Xn))),Z5=qT.__importStar(Ar()),qh=Z5.namedTypes,kF=qT.__importDefault(JT()),IF=kF.default.SourceMapConsumer,H5=kF.default.SourceMapGenerator,NF=Object.prototype.hasOwnProperty;function J5(){return wF()?`
5
5
  `:UC("os").EOL||`
6
6
  `}je.getLineTerminator=J5;function wF(){return typeof window<"u"&&typeof window.document<"u"}je.isBrowser=wF;function X5(e,t,r){return e&&NF.call(e,t)?e[t]:r}je.getOption=X5;function q5(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r={},i=e.length,n=0;n<i;++n)for(var a=Object.keys(e[n]),o=a.length,s=0;s<o;++s)r[a[s]]=!0;return r}je.getUnionOfKeys=q5;function yn(e,t){return e.line-t.line||e.column-t.column}je.comparePos=yn;function $i(e){return{line:e.line,column:e.column}}je.copyPos=$i;function Y5(e,t){if(e){if(!t)return e}else return t||null;var r=new IF(e),i=new IF(t),n=new H5({file:t.file,sourceRoot:t.sourceRoot}),a={};return i.eachMapping(function(o){var s=r.originalPositionFor({line:o.originalLine,column:o.originalColumn}),l=s.source;if(l!==null){n.addMapping({source:l,original:$i(s),generated:{line:o.generatedLine,column:o.generatedColumn},name:o.name});var m=r.sourceContentFor(l);m&&!NF.call(a,l)&&(a[l]=m,n.setSourceContent(l,m))}}),n.toJSON()}je.composeSourceMaps=Y5;function Q5(e,t){if(!e.loc)return null;var r={start:e.loc.start,end:e.loc.end};function i(n){XT(r,n.loc)}return e.declaration&&e.declaration.decorators&&Yh(e)&&e.declaration.decorators.forEach(i),yn(r.start,r.end)<0&&(r.start=$i(r.start),t.skipSpaces(r.start,!1,!0),yn(r.start,r.end)<0&&(r.end=$i(r.end),t.skipSpaces(r.end,!0,!0))),e.comments&&e.comments.forEach(i),r}je.getTrueLoc=Q5;function XT(e,t){e&&t&&(yn(t.start,e.start)<0&&(e.start=t.start),yn(e.end,t.end)<0&&(e.end=t.end))}function eq(e,t){var r=e.loc;if(r&&(r.start.line<1&&(r.start.line=1),r.end.line<1&&(r.end.line=1)),e.type==="File"&&(r.start=t.firstPos(),r.end=t.lastPos()),tq(e,t),rq(e,t),r&&e.decorators)e.decorators.forEach(function(o){XT(r,o.loc)});else if(e.declaration&&Yh(e)){e.declaration.loc=null;var i=e.declaration.decorators;i&&i.forEach(function(o){XT(r,o.loc)})}else if(qh.MethodDefinition&&qh.MethodDefinition.check(e)||qh.Property.check(e)&&(e.method||e.shorthand))e.value.loc=null,qh.FunctionExpression.check(e.value)&&(e.value.id=null);else if(e.type==="ObjectTypeProperty"){var n=e.loc,a=n&&n.end;a&&(a=$i(a),t.prevPos(a)&&t.charAt(a)===","&&(a=t.skipSpaces(a,!0,!0))&&(n.end=a))}}je.fixFaultyLocations=eq;function tq(e,t){if(e.type!=="ForStatement")return;function r(i){for(var n=i&&i.loc,a=n&&n.start,o=n&&$i(n.end);a&&o&&yn(a,o)<0&&(t.prevPos(o),t.charAt(o)===";");)n.end.line=o.line,n.end.column=o.column}r(e.init),r(e.test),r(e.update)}function rq(e,t){if(e.type==="TemplateLiteral"&&e.quasis.length!==0){if(e.loc){var r=$i(e.loc.start);(0,Vu.default)(t.charAt(r)==="`"),(0,Vu.default)(t.nextPos(r));var i=e.quasis[0];yn(i.loc.start,r)<0&&(i.loc.start=r);var n=$i(e.loc.end);(0,Vu.default)(t.prevPos(n)),(0,Vu.default)(t.charAt(n)==="`");var a=e.quasis[e.quasis.length-1];yn(n,a.loc.end)<0&&(a.loc.end=n)}e.expressions.forEach(function(o,s){var l=t.skipSpaces(o.loc.start,!0,!1);if(t.prevPos(l)&&t.charAt(l)==="{"&&t.prevPos(l)&&t.charAt(l)==="$"){var m=e.quasis[s];yn(l,m.loc.end)<0&&(m.loc.end=l)}var d=t.skipSpaces(o.loc.end,!1,!1);if(t.charAt(d)==="}"){(0,Vu.default)(t.nextPos(d));var h=e.quasis[s+1];yn(h.loc.start,d)<0&&(h.loc.start=d)}})}}function Yh(e){if(e)switch(e.type){case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}je.isExportDeclaration=Yh;function nq(e){var t=e.getParentNode();return e.getName()==="declaration"&&Yh(t)?t:null}je.getParentExportDeclaration=nq;function iq(e,t){var r=e.trailingComma;return typeof r=="object"?!!r[t]:!!r}je.isTrailingCommaEnabled=iq});var QT=H((Wu,YT)=>{(function(t,r){typeof Wu=="object"&&typeof YT=="object"?YT.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Wu=="object"?Wu.esprima=r():t.esprima=r()})(Wu,function(){return(function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}return r.m=e,r.c=t,r.p="",r(0)})([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=r(3),a=r(8),o=r(15);function s(g,u,p){var f=null,y=function(G,Y){p&&p(G,Y),f&&f.visit(G,Y)},v=typeof p=="function"?y:null,b=!1;if(u){b=typeof u.comment=="boolean"&&u.comment;var _=typeof u.attachComment=="boolean"&&u.attachComment;(b||_)&&(f=new i.CommentHandler,f.attach=_,u.comment=!0,v=y)}var A=!1;u&&typeof u.sourceType=="string"&&(A=u.sourceType==="module");var x;u&&typeof u.jsx=="boolean"&&u.jsx?x=new n.JSXParser(g,u,v):x=new a.Parser(g,u,v);var C=A?x.parseModule():x.parseScript(),P=C;return b&&f&&(P.comments=f.comments),x.config.tokens&&(P.tokens=x.tokens),x.config.tolerant&&(P.errors=x.errorHandler.errors),P}t.parse=s;function l(g,u,p){var f=u||{};return f.sourceType="module",s(g,f,p)}t.parseModule=l;function m(g,u,p){var f=u||{};return f.sourceType="script",s(g,f,p)}t.parseScript=m;function d(g,u,p){var f=new o.Tokenizer(g,u),y;y=[];try{for(;;){var v=f.getNextToken();if(!v)break;p&&(v=p(v)),y.push(v)}}catch(b){f.errorHandler.tolerate(b)}return f.errorHandler.tolerant&&(y.errors=f.errors()),y}t.tokenize=d;var h=r(2);t.Syntax=h.Syntax,t.version="4.0.1"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),n=(function(){function a(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return a.prototype.insertInnerComments=function(o,s){if(o.type===i.Syntax.BlockStatement&&o.body.length===0){for(var l=[],m=this.leading.length-1;m>=0;--m){var d=this.leading[m];s.end.offset>=d.start&&(l.unshift(d.comment),this.leading.splice(m,1),this.trailing.splice(m,1))}l.length&&(o.innerComments=l)}},a.prototype.findTrailingComments=function(o){var s=[];if(this.trailing.length>0){for(var l=this.trailing.length-1;l>=0;--l){var m=this.trailing[l];m.start>=o.end.offset&&s.unshift(m.comment)}return this.trailing.length=0,s}var d=this.stack[this.stack.length-1];if(d&&d.node.trailingComments){var h=d.node.trailingComments[0];h&&h.range[0]>=o.end.offset&&(s=d.node.trailingComments,delete d.node.trailingComments)}return s},a.prototype.findLeadingComments=function(o){for(var s=[],l;this.stack.length>0;){var m=this.stack[this.stack.length-1];if(m&&m.start>=o.start.offset)l=m.node,this.stack.pop();else break}if(l){for(var d=l.leadingComments?l.leadingComments.length:0,h=d-1;h>=0;--h){var g=l.leadingComments[h];g.range[1]<=o.start.offset&&(s.unshift(g),l.leadingComments.splice(h,1))}return l.leadingComments&&l.leadingComments.length===0&&delete l.leadingComments,s}for(var h=this.leading.length-1;h>=0;--h){var m=this.leading[h];m.start<=o.start.offset&&(s.unshift(m.comment),this.leading.splice(h,1))}return s},a.prototype.visitNode=function(o,s){if(!(o.type===i.Syntax.Program&&o.body.length>0)){this.insertInnerComments(o,s);var l=this.findTrailingComments(s),m=this.findLeadingComments(s);m.length>0&&(o.leadingComments=m),l.length>0&&(o.trailingComments=l),this.stack.push({node:o,start:s.start.offset})}},a.prototype.visitComment=function(o,s){var l=o.type[0]==="L"?"Line":"Block",m={type:l,value:o.value};if(o.range&&(m.range=o.range),o.loc&&(m.loc=o.loc),this.comments.push(m),this.attach){var d={comment:{type:l,value:o.value,range:[s.start.offset,s.end.offset]},start:s.start.offset};o.loc&&(d.comment.loc=o.loc),o.type=l,this.leading.push(d),this.trailing.push(d)}},a.prototype.visit=function(o,s){o.type==="LineComment"?this.visitComment(o,s):o.type==="BlockComment"?this.visitComment(o,s):this.attach&&this.visitNode(o,s)},a})();t.CommentHandler=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,r){"use strict";var i=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,f){p.__proto__=f}||function(p,f){for(var y in f)f.hasOwnProperty(y)&&(p[y]=f[y])};return function(p,f){u(p,f);function y(){this.constructor=p}p.prototype=f===null?Object.create(f):(y.prototype=f.prototype,new y)}})();Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),a=r(5),o=r(6),s=r(7),l=r(8),m=r(13),d=r(14);m.TokenName[100]="JSXIdentifier",m.TokenName[101]="JSXText";function h(u){var p;switch(u.type){case o.JSXSyntax.JSXIdentifier:var f=u;p=f.name;break;case o.JSXSyntax.JSXNamespacedName:var y=u;p=h(y.namespace)+":"+h(y.name);break;case o.JSXSyntax.JSXMemberExpression:var v=u;p=h(v.object)+"."+h(v.property);break;default:break}return p}var g=(function(u){i(p,u);function p(f,y,v){return u.call(this,f,y,v)||this}return p.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():u.prototype.parsePrimaryExpression.call(this)},p.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},p.prototype.finishJSX=function(){this.nextToken()},p.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},p.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},p.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},p.prototype.scanXHTMLEntity=function(f){for(var y="&",v=!0,b=!1,_=!1,A=!1;!this.scanner.eof()&&v&&!b;){var x=this.scanner.source[this.scanner.index];if(x===f)break;if(b=x===";",y+=x,++this.scanner.index,!b)switch(y.length){case 2:_=x==="#";break;case 3:_&&(A=x==="x",v=A||n.Character.isDecimalDigit(x.charCodeAt(0)),_=_&&!A);break;default:v=v&&!(_&&!n.Character.isDecimalDigit(x.charCodeAt(0))),v=v&&!(A&&!n.Character.isHexDigit(x.charCodeAt(0)));break}}if(v&&b&&y.length>2){var C=y.substr(1,y.length-2);_&&C.length>1?y=String.fromCharCode(parseInt(C.substr(1),10)):A&&C.length>2?y=String.fromCharCode(parseInt("0"+C.substr(1),16)):!_&&!A&&d.XHTMLEntities[C]&&(y=d.XHTMLEntities[C])}return y},p.prototype.lexJSX=function(){var f=this.scanner.source.charCodeAt(this.scanner.index);if(f===60||f===62||f===47||f===58||f===61||f===123||f===125){var y=this.scanner.source[this.scanner.index++];return{type:7,value:y,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(f===34||f===39){for(var v=this.scanner.index,b=this.scanner.source[this.scanner.index++],_="";!this.scanner.eof();){var A=this.scanner.source[this.scanner.index++];if(A===b)break;A==="&"?_+=this.scanXHTMLEntity(b):_+=A}return{type:8,value:_,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:v,end:this.scanner.index}}if(f===46){var x=this.scanner.source.charCodeAt(this.scanner.index+1),C=this.scanner.source.charCodeAt(this.scanner.index+2),y=x===46&&C===46?"...":".",v=this.scanner.index;return this.scanner.index+=y.length,{type:7,value:y,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:v,end:this.scanner.index}}if(f===96)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(n.Character.isIdentifierStart(f)&&f!==92){var v=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var A=this.scanner.source.charCodeAt(this.scanner.index);if(n.Character.isIdentifierPart(A)&&A!==92)++this.scanner.index;else if(A===45)++this.scanner.index;else break}var P=this.scanner.source.slice(v,this.scanner.index);return{type:100,value:P,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:v,end:this.scanner.index}}return this.scanner.lex()},p.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var f=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(f)),f},p.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var f=this.scanner.index,y="";!this.scanner.eof();){var v=this.scanner.source[this.scanner.index];if(v==="{"||v==="<")break;++this.scanner.index,y+=v,n.Character.isLineTerminator(v.charCodeAt(0))&&(++this.scanner.lineNumber,v==="\r"&&this.scanner.source[this.scanner.index]===`
7
7
  `&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var b={type:101,value:y,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:f,end:this.scanner.index};return y.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(b)),b},p.prototype.peekJSXToken=function(){var f=this.scanner.saveState();this.scanner.scanComments();var y=this.lexJSX();return this.scanner.restoreState(f),y},p.prototype.expectJSX=function(f){var y=this.nextJSXToken();(y.type!==7||y.value!==f)&&this.throwUnexpectedToken(y)},p.prototype.matchJSX=function(f){var y=this.peekJSXToken();return y.type===7&&y.value===f},p.prototype.parseJSXIdentifier=function(){var f=this.createJSXNode(),y=this.nextJSXToken();return y.type!==100&&this.throwUnexpectedToken(y),this.finalize(f,new a.JSXIdentifier(y.value))},p.prototype.parseJSXElementName=function(){var f=this.createJSXNode(),y=this.parseJSXIdentifier();if(this.matchJSX(":")){var v=y;this.expectJSX(":");var b=this.parseJSXIdentifier();y=this.finalize(f,new a.JSXNamespacedName(v,b))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var _=y;this.expectJSX(".");var A=this.parseJSXIdentifier();y=this.finalize(f,new a.JSXMemberExpression(_,A))}return y},p.prototype.parseJSXAttributeName=function(){var f=this.createJSXNode(),y,v=this.parseJSXIdentifier();if(this.matchJSX(":")){var b=v;this.expectJSX(":");var _=this.parseJSXIdentifier();y=this.finalize(f,new a.JSXNamespacedName(b,_))}else y=v;return y},p.prototype.parseJSXStringLiteralAttribute=function(){var f=this.createJSXNode(),y=this.nextJSXToken();y.type!==8&&this.throwUnexpectedToken(y);var v=this.getTokenRaw(y);return this.finalize(f,new s.Literal(y.value,v))},p.prototype.parseJSXExpressionAttribute=function(){var f=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var y=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(f,new a.JSXExpressionContainer(y))},p.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},p.prototype.parseJSXNameValueAttribute=function(){var f=this.createJSXNode(),y=this.parseJSXAttributeName(),v=null;return this.matchJSX("=")&&(this.expectJSX("="),v=this.parseJSXAttributeValue()),this.finalize(f,new a.JSXAttribute(y,v))},p.prototype.parseJSXSpreadAttribute=function(){var f=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var y=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(f,new a.JSXSpreadAttribute(y))},p.prototype.parseJSXAttributes=function(){for(var f=[];!this.matchJSX("/")&&!this.matchJSX(">");){var y=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();f.push(y)}return f},p.prototype.parseJSXOpeningElement=function(){var f=this.createJSXNode();this.expectJSX("<");var y=this.parseJSXElementName(),v=this.parseJSXAttributes(),b=this.matchJSX("/");return b&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(f,new a.JSXOpeningElement(y,b,v))},p.prototype.parseJSXBoundaryElement=function(){var f=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var y=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(f,new a.JSXClosingElement(y))}var v=this.parseJSXElementName(),b=this.parseJSXAttributes(),_=this.matchJSX("/");return _&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(f,new a.JSXOpeningElement(v,_,b))},p.prototype.parseJSXEmptyExpression=function(){var f=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(f,new a.JSXEmptyExpression)},p.prototype.parseJSXExpressionContainer=function(){var f=this.createJSXNode();this.expectJSX("{");var y;return this.matchJSX("}")?(y=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),y=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(f,new a.JSXExpressionContainer(y))},p.prototype.parseJSXChildren=function(){for(var f=[];!this.scanner.eof();){var y=this.createJSXChildNode(),v=this.nextJSXText();if(v.start<v.end){var b=this.getTokenRaw(v),_=this.finalize(y,new a.JSXText(v.value,b));f.push(_)}if(this.scanner.source[this.scanner.index]==="{"){var A=this.parseJSXExpressionContainer();f.push(A)}else break}return f},p.prototype.parseComplexJSXElement=function(f){for(var y=[];!this.scanner.eof();){f.children=f.children.concat(this.parseJSXChildren());var v=this.createJSXChildNode(),b=this.parseJSXBoundaryElement();if(b.type===o.JSXSyntax.JSXOpeningElement){var _=b;if(_.selfClosing){var A=this.finalize(v,new a.JSXElement(_,[],null));f.children.push(A)}else y.push(f),f={node:v,opening:_,closing:null,children:[]}}if(b.type===o.JSXSyntax.JSXClosingElement){f.closing=b;var x=h(f.opening.name),C=h(f.closing.name);if(x!==C&&this.tolerateError("Expected corresponding JSX closing tag for %0",x),y.length>0){var A=this.finalize(f.node,new a.JSXElement(f.opening,f.children,f.closing));f=y[y.length-1],f.children.push(A),y.pop()}else break}}return f},p.prototype.parseJSXElement=function(){var f=this.createJSXNode(),y=this.parseJSXOpeningElement(),v=[],b=null;if(!y.selfClosing){var _=this.parseComplexJSXElement({node:f,opening:y,closing:b,children:v});v=_.children,b=_.closing}return this.finalize(f,new a.JSXElement(y,v,b))},p.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var f=this.parseJSXElement();return this.finishJSX(),f},p.prototype.isStartOfExpression=function(){return u.prototype.isStartOfExpression.call(this)||this.match("<")},p})(l.Parser);t.JSXParser=g},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(i){return i<65536?String.fromCharCode(i):String.fromCharCode(55296+(i-65536>>10))+String.fromCharCode(56320+(i-65536&1023))},isWhiteSpace:function(i){return i===32||i===9||i===11||i===12||i===160||i>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(i)>=0},isLineTerminator:function(i){return i===10||i===13||i===8232||i===8233},isIdentifierStart:function(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i===92||i>=128&&r.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(i))},isIdentifierPart:function(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||i===92||i>=128&&r.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(i))},isDecimalDigit:function(i){return i>=48&&i<=57},isHexDigit:function(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102},isOctalDigit:function(i){return i>=48&&i<=55}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(6),n=(function(){function f(y){this.type=i.JSXSyntax.JSXClosingElement,this.name=y}return f})();t.JSXClosingElement=n;var a=(function(){function f(y,v,b){this.type=i.JSXSyntax.JSXElement,this.openingElement=y,this.children=v,this.closingElement=b}return f})();t.JSXElement=a;var o=(function(){function f(){this.type=i.JSXSyntax.JSXEmptyExpression}return f})();t.JSXEmptyExpression=o;var s=(function(){function f(y){this.type=i.JSXSyntax.JSXExpressionContainer,this.expression=y}return f})();t.JSXExpressionContainer=s;var l=(function(){function f(y){this.type=i.JSXSyntax.JSXIdentifier,this.name=y}return f})();t.JSXIdentifier=l;var m=(function(){function f(y,v){this.type=i.JSXSyntax.JSXMemberExpression,this.object=y,this.property=v}return f})();t.JSXMemberExpression=m;var d=(function(){function f(y,v){this.type=i.JSXSyntax.JSXAttribute,this.name=y,this.value=v}return f})();t.JSXAttribute=d;var h=(function(){function f(y,v){this.type=i.JSXSyntax.JSXNamespacedName,this.namespace=y,this.name=v}return f})();t.JSXNamespacedName=h;var g=(function(){function f(y,v,b){this.type=i.JSXSyntax.JSXOpeningElement,this.name=y,this.selfClosing=v,this.attributes=b}return f})();t.JSXOpeningElement=g;var u=(function(){function f(y){this.type=i.JSXSyntax.JSXSpreadAttribute,this.argument=y}return f})();t.JSXSpreadAttribute=u;var p=(function(){function f(y,v){this.type=i.JSXSyntax.JSXText,this.value=y,this.raw=v}return f})();t.JSXText=p},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),n=(function(){function D(N){this.type=i.Syntax.ArrayExpression,this.elements=N}return D})();t.ArrayExpression=n;var a=(function(){function D(N){this.type=i.Syntax.ArrayPattern,this.elements=N}return D})();t.ArrayPattern=a;var o=(function(){function D(N,M,ne){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=N,this.body=M,this.generator=!1,this.expression=ne,this.async=!1}return D})();t.ArrowFunctionExpression=o;var s=(function(){function D(N,M,ne){this.type=i.Syntax.AssignmentExpression,this.operator=N,this.left=M,this.right=ne}return D})();t.AssignmentExpression=s;var l=(function(){function D(N,M){this.type=i.Syntax.AssignmentPattern,this.left=N,this.right=M}return D})();t.AssignmentPattern=l;var m=(function(){function D(N,M,ne){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=N,this.body=M,this.generator=!1,this.expression=ne,this.async=!0}return D})();t.AsyncArrowFunctionExpression=m;var d=(function(){function D(N,M,ne){this.type=i.Syntax.FunctionDeclaration,this.id=N,this.params=M,this.body=ne,this.generator=!1,this.expression=!1,this.async=!0}return D})();t.AsyncFunctionDeclaration=d;var h=(function(){function D(N,M,ne){this.type=i.Syntax.FunctionExpression,this.id=N,this.params=M,this.body=ne,this.generator=!1,this.expression=!1,this.async=!0}return D})();t.AsyncFunctionExpression=h;var g=(function(){function D(N){this.type=i.Syntax.AwaitExpression,this.argument=N}return D})();t.AwaitExpression=g;var u=(function(){function D(N,M,ne){var Ht=N==="||"||N==="&&";this.type=Ht?i.Syntax.LogicalExpression:i.Syntax.BinaryExpression,this.operator=N,this.left=M,this.right=ne}return D})();t.BinaryExpression=u;var p=(function(){function D(N){this.type=i.Syntax.BlockStatement,this.body=N}return D})();t.BlockStatement=p;var f=(function(){function D(N){this.type=i.Syntax.BreakStatement,this.label=N}return D})();t.BreakStatement=f;var y=(function(){function D(N,M){this.type=i.Syntax.CallExpression,this.callee=N,this.arguments=M}return D})();t.CallExpression=y;var v=(function(){function D(N,M){this.type=i.Syntax.CatchClause,this.param=N,this.body=M}return D})();t.CatchClause=v;var b=(function(){function D(N){this.type=i.Syntax.ClassBody,this.body=N}return D})();t.ClassBody=b;var _=(function(){function D(N,M,ne){this.type=i.Syntax.ClassDeclaration,this.id=N,this.superClass=M,this.body=ne}return D})();t.ClassDeclaration=_;var A=(function(){function D(N,M,ne){this.type=i.Syntax.ClassExpression,this.id=N,this.superClass=M,this.body=ne}return D})();t.ClassExpression=A;var x=(function(){function D(N,M){this.type=i.Syntax.MemberExpression,this.computed=!0,this.object=N,this.property=M}return D})();t.ComputedMemberExpression=x;var C=(function(){function D(N,M,ne){this.type=i.Syntax.ConditionalExpression,this.test=N,this.consequent=M,this.alternate=ne}return D})();t.ConditionalExpression=C;var P=(function(){function D(N){this.type=i.Syntax.ContinueStatement,this.label=N}return D})();t.ContinueStatement=P;var G=(function(){function D(){this.type=i.Syntax.DebuggerStatement}return D})();t.DebuggerStatement=G;var Y=(function(){function D(N,M){this.type=i.Syntax.ExpressionStatement,this.expression=N,this.directive=M}return D})();t.Directive=Y;var ve=(function(){function D(N,M){this.type=i.Syntax.DoWhileStatement,this.body=N,this.test=M}return D})();t.DoWhileStatement=ve;var Me=(function(){function D(){this.type=i.Syntax.EmptyStatement}return D})();t.EmptyStatement=Me;var cr=(function(){function D(N){this.type=i.Syntax.ExportAllDeclaration,this.source=N}return D})();t.ExportAllDeclaration=cr;var An=(function(){function D(N){this.type=i.Syntax.ExportDefaultDeclaration,this.declaration=N}return D})();t.ExportDefaultDeclaration=An;var Xa=(function(){function D(N,M,ne){this.type=i.Syntax.ExportNamedDeclaration,this.declaration=N,this.specifiers=M,this.source=ne}return D})();t.ExportNamedDeclaration=Xa;var Fi=(function(){function D(N,M){this.type=i.Syntax.ExportSpecifier,this.exported=M,this.local=N}return D})();t.ExportSpecifier=Fi;var xn=(function(){function D(N){this.type=i.Syntax.ExpressionStatement,this.expression=N}return D})();t.ExpressionStatement=xn;var sc=(function(){function D(N,M,ne){this.type=i.Syntax.ForInStatement,this.left=N,this.right=M,this.body=ne,this.each=!1}return D})();t.ForInStatement=sc;var _n=(function(){function D(N,M,ne){this.type=i.Syntax.ForOfStatement,this.left=N,this.right=M,this.body=ne}return D})();t.ForOfStatement=_n;var ni=(function(){function D(N,M,ne,Ht){this.type=i.Syntax.ForStatement,this.init=N,this.test=M,this.update=ne,this.body=Ht}return D})();t.ForStatement=ni;var F=(function(){function D(N,M,ne,Ht){this.type=i.Syntax.FunctionDeclaration,this.id=N,this.params=M,this.body=ne,this.generator=Ht,this.expression=!1,this.async=!1}return D})();t.FunctionDeclaration=F;var B=(function(){function D(N,M,ne,Ht){this.type=i.Syntax.FunctionExpression,this.id=N,this.params=M,this.body=ne,this.generator=Ht,this.expression=!1,this.async=!1}return D})();t.FunctionExpression=B;var z=(function(){function D(N){this.type=i.Syntax.Identifier,this.name=N}return D})();t.Identifier=z;var X=(function(){function D(N,M,ne){this.type=i.Syntax.IfStatement,this.test=N,this.consequent=M,this.alternate=ne}return D})();t.IfStatement=X;var me=(function(){function D(N,M){this.type=i.Syntax.ImportDeclaration,this.specifiers=N,this.source=M}return D})();t.ImportDeclaration=me;var he=(function(){function D(N){this.type=i.Syntax.ImportDefaultSpecifier,this.local=N}return D})();t.ImportDefaultSpecifier=he;var et=(function(){function D(N){this.type=i.Syntax.ImportNamespaceSpecifier,this.local=N}return D})();t.ImportNamespaceSpecifier=et;var Ie=(function(){function D(N,M){this.type=i.Syntax.ImportSpecifier,this.local=N,this.imported=M}return D})();t.ImportSpecifier=Ie;var Re=(function(){function D(N,M){this.type=i.Syntax.LabeledStatement,this.label=N,this.body=M}return D})();t.LabeledStatement=Re;var lr=(function(){function D(N,M){this.type=i.Syntax.Literal,this.value=N,this.raw=M}return D})();t.Literal=lr;var ur=(function(){function D(N,M){this.type=i.Syntax.MetaProperty,this.meta=N,this.property=M}return D})();t.MetaProperty=ur;var $t=(function(){function D(N,M,ne,Ht,Og){this.type=i.Syntax.MethodDefinition,this.key=N,this.computed=M,this.value=ne,this.kind=Ht,this.static=Og}return D})();t.MethodDefinition=$t;var dr=(function(){function D(N){this.type=i.Syntax.Program,this.body=N,this.sourceType="module"}return D})();t.Module=dr;var cc=(function(){function D(N,M){this.type=i.Syntax.NewExpression,this.callee=N,this.arguments=M}return D})();t.NewExpression=cc;var Tn=(function(){function D(N){this.type=i.Syntax.ObjectExpression,this.properties=N}return D})();t.ObjectExpression=Tn;var qa=(function(){function D(N){this.type=i.Syntax.ObjectPattern,this.properties=N}return D})();t.ObjectPattern=qa;var Cn=(function(){function D(N,M,ne,Ht,Og,Fz){this.type=i.Syntax.Property,this.key=M,this.computed=ne,this.value=Ht,this.kind=N,this.method=Og,this.shorthand=Fz}return D})();t.Property=Cn;var Ya=(function(){function D(N,M,ne,Ht){this.type=i.Syntax.Literal,this.value=N,this.raw=M,this.regex={pattern:ne,flags:Ht}}return D})();t.RegexLiteral=Ya;var Dg=(function(){function D(N){this.type=i.Syntax.RestElement,this.argument=N}return D})();t.RestElement=Dg;var sd=(function(){function D(N){this.type=i.Syntax.ReturnStatement,this.argument=N}return D})();t.ReturnStatement=sd;var cd=(function(){function D(N){this.type=i.Syntax.Program,this.body=N,this.sourceType="script"}return D})();t.Script=cd;var ld=(function(){function D(N){this.type=i.Syntax.SequenceExpression,this.expressions=N}return D})();t.SequenceExpression=ld;var Ui=(function(){function D(N){this.type=i.Syntax.SpreadElement,this.argument=N}return D})();t.SpreadElement=Ui;var Mr=(function(){function D(N,M){this.type=i.Syntax.MemberExpression,this.computed=!1,this.object=N,this.property=M}return D})();t.StaticMemberExpression=Mr;var ud=(function(){function D(){this.type=i.Syntax.Super}return D})();t.Super=ud;var Ig=(function(){function D(N,M){this.type=i.Syntax.SwitchCase,this.test=N,this.consequent=M}return D})();t.SwitchCase=Ig;var dd=(function(){function D(N,M){this.type=i.Syntax.SwitchStatement,this.discriminant=N,this.cases=M}return D})();t.SwitchStatement=dd;var pd=(function(){function D(N,M){this.type=i.Syntax.TaggedTemplateExpression,this.tag=N,this.quasi=M}return D})();t.TaggedTemplateExpression=pd;var md=(function(){function D(N,M){this.type=i.Syntax.TemplateElement,this.value=N,this.tail=M}return D})();t.TemplateElement=md;var kg=(function(){function D(N,M){this.type=i.Syntax.TemplateLiteral,this.quasis=N,this.expressions=M}return D})();t.TemplateLiteral=kg;var fd=(function(){function D(){this.type=i.Syntax.ThisExpression}return D})();t.ThisExpression=fd;var Ng=(function(){function D(N){this.type=i.Syntax.ThrowStatement,this.argument=N}return D})();t.ThrowStatement=Ng;var wg=(function(){function D(N,M,ne){this.type=i.Syntax.TryStatement,this.block=N,this.handler=M,this.finalizer=ne}return D})();t.TryStatement=wg;var hd=(function(){function D(N,M){this.type=i.Syntax.UnaryExpression,this.operator=N,this.argument=M,this.prefix=!0}return D})();t.UnaryExpression=hd;var Pg=(function(){function D(N,M,ne){this.type=i.Syntax.UpdateExpression,this.operator=N,this.argument=M,this.prefix=ne}return D})();t.UpdateExpression=Pg;var Rg=(function(){function D(N,M){this.type=i.Syntax.VariableDeclaration,this.declarations=N,this.kind=M}return D})();t.VariableDeclaration=Rg;var gd=(function(){function D(N,M){this.type=i.Syntax.VariableDeclarator,this.id=N,this.init=M}return D})();t.VariableDeclarator=gd;var q=(function(){function D(N,M){this.type=i.Syntax.WhileStatement,this.test=N,this.body=M}return D})();t.WhileStatement=q;var pe=(function(){function D(N,M){this.type=i.Syntax.WithStatement,this.object=N,this.body=M}return D})();t.WithStatement=pe;var pr=(function(){function D(N,M){this.type=i.Syntax.YieldExpression,this.argument=N,this.delegate=M}return D})();t.YieldExpression=pr},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),n=r(10),a=r(11),o=r(7),s=r(12),l=r(2),m=r(13),d="ArrowParameterPlaceHolder",h=(function(){function g(u,p,f){p===void 0&&(p={}),this.config={range:typeof p.range=="boolean"&&p.range,loc:typeof p.loc=="boolean"&&p.loc,source:null,tokens:typeof p.tokens=="boolean"&&p.tokens,comment:typeof p.comment=="boolean"&&p.comment,tolerant:typeof p.tolerant=="boolean"&&p.tolerant},this.config.loc&&p.source&&p.source!==null&&(this.config.source=String(p.source)),this.delegate=f,this.errorHandler=new n.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new s.Scanner(u,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return g.prototype.throwError=function(u){for(var p=[],f=1;f<arguments.length;f++)p[f-1]=arguments[f];var y=Array.prototype.slice.call(arguments,1),v=u.replace(/%(\d)/g,function(x,C){return i.assert(C<y.length,"Message reference must be in range"),y[C]}),b=this.lastMarker.index,_=this.lastMarker.line,A=this.lastMarker.column+1;throw this.errorHandler.createError(b,_,A,v)},g.prototype.tolerateError=function(u){for(var p=[],f=1;f<arguments.length;f++)p[f-1]=arguments[f];var y=Array.prototype.slice.call(arguments,1),v=u.replace(/%(\d)/g,function(x,C){return i.assert(C<y.length,"Message reference must be in range"),y[C]}),b=this.lastMarker.index,_=this.scanner.lineNumber,A=this.lastMarker.column+1;this.errorHandler.tolerateError(b,_,A,v)},g.prototype.unexpectedTokenError=function(u,p){var f=p||a.Messages.UnexpectedToken,y;if(u?(p||(f=u.type===2?a.Messages.UnexpectedEOS:u.type===3?a.Messages.UnexpectedIdentifier:u.type===6?a.Messages.UnexpectedNumber:u.type===8?a.Messages.UnexpectedString:u.type===10?a.Messages.UnexpectedTemplate:a.Messages.UnexpectedToken,u.type===4&&(this.scanner.isFutureReservedWord(u.value)?f=a.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(u.value)&&(f=a.Messages.StrictReservedWord))),y=u.value):y="ILLEGAL",f=f.replace("%0",y),u&&typeof u.lineNumber=="number"){var v=u.start,b=u.lineNumber,_=this.lastMarker.index-this.lastMarker.column,A=u.start-_+1;return this.errorHandler.createError(v,b,A,f)}else{var v=this.lastMarker.index,b=this.lastMarker.line,A=this.lastMarker.column+1;return this.errorHandler.createError(v,b,A,f)}},g.prototype.throwUnexpectedToken=function(u,p){throw this.unexpectedTokenError(u,p)},g.prototype.tolerateUnexpectedToken=function(u,p){this.errorHandler.tolerate(this.unexpectedTokenError(u,p))},g.prototype.collectComments=function(){if(!this.config.comment)this.scanner.scanComments();else{var u=this.scanner.scanComments();if(u.length>0&&this.delegate)for(var p=0;p<u.length;++p){var f=u[p],y=void 0;y={type:f.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(f.slice[0],f.slice[1])},this.config.range&&(y.range=f.range),this.config.loc&&(y.loc=f.loc);var v={start:{line:f.loc.start.line,column:f.loc.start.column,offset:f.range[0]},end:{line:f.loc.end.line,column:f.loc.end.column,offset:f.range[1]}};this.delegate(y,v)}}},g.prototype.getTokenRaw=function(u){return this.scanner.source.slice(u.start,u.end)},g.prototype.convertToken=function(u){var p={type:m.TokenName[u.type],value:this.getTokenRaw(u)};if(this.config.range&&(p.range=[u.start,u.end]),this.config.loc&&(p.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),u.type===9){var f=u.pattern,y=u.flags;p.regex={pattern:f,flags:y}}return p},g.prototype.nextToken=function(){var u=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var p=this.scanner.lex();return this.hasLineTerminator=u.lineNumber!==p.lineNumber,p&&this.context.strict&&p.type===3&&this.scanner.isStrictModeReservedWord(p.value)&&(p.type=4),this.lookahead=p,this.config.tokens&&p.type!==2&&this.tokens.push(this.convertToken(p)),u},g.prototype.nextRegexToken=function(){this.collectComments();var u=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(u))),this.lookahead=u,this.nextToken(),u},g.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},g.prototype.startNode=function(u,p){p===void 0&&(p=0);var f=u.start-u.lineStart,y=u.lineNumber;return f<0&&(f+=p,y--),{index:u.start,line:y,column:f}},g.prototype.finalize=function(u,p){if(this.config.range&&(p.range=[u.index,this.lastMarker.index]),this.config.loc&&(p.loc={start:{line:u.line,column:u.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(p.loc.source=this.config.source)),this.delegate){var f={start:{line:u.line,column:u.column,offset:u.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(p,f)}return p},g.prototype.expect=function(u){var p=this.nextToken();(p.type!==7||p.value!==u)&&this.throwUnexpectedToken(p)},g.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var u=this.lookahead;u.type===7&&u.value===","?this.nextToken():u.type===7&&u.value===";"?(this.nextToken(),this.tolerateUnexpectedToken(u)):this.tolerateUnexpectedToken(u,a.Messages.UnexpectedToken)}else this.expect(",")},g.prototype.expectKeyword=function(u){var p=this.nextToken();(p.type!==4||p.value!==u)&&this.throwUnexpectedToken(p)},g.prototype.match=function(u){return this.lookahead.type===7&&this.lookahead.value===u},g.prototype.matchKeyword=function(u){return this.lookahead.type===4&&this.lookahead.value===u},g.prototype.matchContextualKeyword=function(u){return this.lookahead.type===3&&this.lookahead.value===u},g.prototype.matchAssign=function(){if(this.lookahead.type!==7)return!1;var u=this.lookahead.value;return u==="="||u==="*="||u==="**="||u==="/="||u==="%="||u==="+="||u==="-="||u==="<<="||u===">>="||u===">>>="||u==="&="||u==="^="||u==="|="},g.prototype.isolateCoverGrammar=function(u){var p=this.context.isBindingElement,f=this.context.isAssignmentTarget,y=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var v=u.call(this);return this.context.firstCoverInitializedNameError!==null&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=p,this.context.isAssignmentTarget=f,this.context.firstCoverInitializedNameError=y,v},g.prototype.inheritCoverGrammar=function(u){var p=this.context.isBindingElement,f=this.context.isAssignmentTarget,y=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var v=u.call(this);return this.context.isBindingElement=this.context.isBindingElement&&p,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&f,this.context.firstCoverInitializedNameError=y||this.context.firstCoverInitializedNameError,v},g.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(this.lookahead.type!==2&&!this.match("}")&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},g.prototype.parsePrimaryExpression=function(){var u=this.createNode(),p,f,y;switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&this.lookahead.value==="await"&&this.tolerateUnexpectedToken(this.lookahead),p=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(u,new o.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,a.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,f=this.nextToken(),y=this.getTokenRaw(f),p=this.finalize(u,new o.Literal(f.value,y));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,f=this.nextToken(),y=this.getTokenRaw(f),p=this.finalize(u,new o.Literal(f.value==="true",y));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,f=this.nextToken(),y=this.getTokenRaw(f),p=this.finalize(u,new o.Literal(null,y));break;case 10:p=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,p=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":p=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":p=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,f=this.nextRegexToken(),y=this.getTokenRaw(f),p=this.finalize(u,new o.RegexLiteral(f.regex,y,f.pattern,f.flags));break;default:p=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?p=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?p=this.finalize(u,new o.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?p=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),p=this.finalize(u,new o.ThisExpression)):this.matchKeyword("class")?p=this.parseClassExpression():p=this.throwUnexpectedToken(this.nextToken()));break;default:p=this.throwUnexpectedToken(this.nextToken())}return p},g.prototype.parseSpreadElement=function(){var u=this.createNode();this.expect("...");var p=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(u,new o.SpreadElement(p))},g.prototype.parseArrayInitializer=function(){var u=this.createNode(),p=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),p.push(null);else if(this.match("...")){var f=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),p.push(f)}else p.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(u,new o.ArrayExpression(p))},g.prototype.parsePropertyMethod=function(u){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var p=this.context.strict,f=this.context.allowStrictDirective;this.context.allowStrictDirective=u.simple;var y=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&u.firstRestricted&&this.tolerateUnexpectedToken(u.firstRestricted,u.message),this.context.strict&&u.stricted&&this.tolerateUnexpectedToken(u.stricted,u.message),this.context.strict=p,this.context.allowStrictDirective=f,y},g.prototype.parsePropertyMethodFunction=function(){var u=!1,p=this.createNode(),f=this.context.allowYield;this.context.allowYield=!0;var y=this.parseFormalParameters(),v=this.parsePropertyMethod(y);return this.context.allowYield=f,this.finalize(p,new o.FunctionExpression(null,y.params,v,u))},g.prototype.parsePropertyMethodAsyncFunction=function(){var u=this.createNode(),p=this.context.allowYield,f=this.context.await;this.context.allowYield=!1,this.context.await=!0;var y=this.parseFormalParameters(),v=this.parsePropertyMethod(y);return this.context.allowYield=p,this.context.await=f,this.finalize(u,new o.AsyncFunctionExpression(null,y.params,v))},g.prototype.parseObjectPropertyKey=function(){var u=this.createNode(),p=this.nextToken(),f;switch(p.type){case 8:case 6:this.context.strict&&p.octal&&this.tolerateUnexpectedToken(p,a.Messages.StrictOctalLiteral);var y=this.getTokenRaw(p);f=this.finalize(u,new o.Literal(p.value,y));break;case 3:case 1:case 5:case 4:f=this.finalize(u,new o.Identifier(p.value));break;case 7:p.value==="["?(f=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):f=this.throwUnexpectedToken(p);break;default:f=this.throwUnexpectedToken(p)}return f},g.prototype.isPropertyKey=function(u,p){return u.type===l.Syntax.Identifier&&u.name===p||u.type===l.Syntax.Literal&&u.value===p},g.prototype.parseObjectProperty=function(u){var p=this.createNode(),f=this.lookahead,y,v=null,b=null,_=!1,A=!1,x=!1,C=!1;if(f.type===3){var P=f.value;this.nextToken(),_=this.match("["),C=!this.hasLineTerminator&&P==="async"&&!this.match(":")&&!this.match("(")&&!this.match("*")&&!this.match(","),v=C?this.parseObjectPropertyKey():this.finalize(p,new o.Identifier(P))}else this.match("*")?this.nextToken():(_=this.match("["),v=this.parseObjectPropertyKey());var G=this.qualifiedPropertyName(this.lookahead);if(f.type===3&&!C&&f.value==="get"&&G)y="get",_=this.match("["),v=this.parseObjectPropertyKey(),this.context.allowYield=!1,b=this.parseGetterMethod();else if(f.type===3&&!C&&f.value==="set"&&G)y="set",_=this.match("["),v=this.parseObjectPropertyKey(),b=this.parseSetterMethod();else if(f.type===7&&f.value==="*"&&G)y="init",_=this.match("["),v=this.parseObjectPropertyKey(),b=this.parseGeneratorMethod(),A=!0;else if(v||this.throwUnexpectedToken(this.lookahead),y="init",this.match(":")&&!C)!_&&this.isPropertyKey(v,"__proto__")&&(u.value&&this.tolerateError(a.Messages.DuplicateProtoProperty),u.value=!0),this.nextToken(),b=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))b=C?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),A=!0;else if(f.type===3){var P=this.finalize(p,new o.Identifier(f.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),x=!0;var Y=this.isolateCoverGrammar(this.parseAssignmentExpression);b=this.finalize(p,new o.AssignmentPattern(P,Y))}else x=!0,b=P}else this.throwUnexpectedToken(this.nextToken());return this.finalize(p,new o.Property(y,v,_,b,A,x))},g.prototype.parseObjectInitializer=function(){var u=this.createNode();this.expect("{");for(var p=[],f={value:!1};!this.match("}");)p.push(this.parseObjectProperty(f)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(u,new o.ObjectExpression(p))},g.prototype.parseTemplateHead=function(){i.assert(this.lookahead.head,"Template literal must start with a template head");var u=this.createNode(),p=this.nextToken(),f=p.value,y=p.cooked;return this.finalize(u,new o.TemplateElement({raw:f,cooked:y},p.tail))},g.prototype.parseTemplateElement=function(){this.lookahead.type!==10&&this.throwUnexpectedToken();var u=this.createNode(),p=this.nextToken(),f=p.value,y=p.cooked;return this.finalize(u,new o.TemplateElement({raw:f,cooked:y},p.tail))},g.prototype.parseTemplateLiteral=function(){var u=this.createNode(),p=[],f=[],y=this.parseTemplateHead();for(f.push(y);!y.tail;)p.push(this.parseExpression()),y=this.parseTemplateElement(),f.push(y);return this.finalize(u,new o.TemplateLiteral(f,p))},g.prototype.reinterpretExpressionAsPattern=function(u){switch(u.type){case l.Syntax.Identifier:case l.Syntax.MemberExpression:case l.Syntax.RestElement:case l.Syntax.AssignmentPattern:break;case l.Syntax.SpreadElement:u.type=l.Syntax.RestElement,this.reinterpretExpressionAsPattern(u.argument);break;case l.Syntax.ArrayExpression:u.type=l.Syntax.ArrayPattern;for(var p=0;p<u.elements.length;p++)u.elements[p]!==null&&this.reinterpretExpressionAsPattern(u.elements[p]);break;case l.Syntax.ObjectExpression:u.type=l.Syntax.ObjectPattern;for(var p=0;p<u.properties.length;p++)this.reinterpretExpressionAsPattern(u.properties[p].value);break;case l.Syntax.AssignmentExpression:u.type=l.Syntax.AssignmentPattern,delete u.operator,this.reinterpretExpressionAsPattern(u.left);break;default:break}},g.prototype.parseGroupExpression=function(){var u;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),u={type:d,params:[],async:!1};else{var p=this.lookahead,f=[];if(this.match("..."))u=this.parseRestElement(f),this.expect(")"),this.match("=>")||this.expect("=>"),u={type:d,params:[u],async:!1};else{var y=!1;if(this.context.isBindingElement=!0,u=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var v=[];for(this.context.isAssignmentTarget=!1,v.push(u);this.lookahead.type!==2&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var b=0;b<v.length;b++)this.reinterpretExpressionAsPattern(v[b]);y=!0,u={type:d,params:v,async:!1}}else if(this.match("...")){this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),v.push(this.parseRestElement(f)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1;for(var b=0;b<v.length;b++)this.reinterpretExpressionAsPattern(v[b]);y=!0,u={type:d,params:v,async:!1}}else v.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(y)break}y||(u=this.finalize(this.startNode(p),new o.SequenceExpression(v)))}if(!y){if(this.expect(")"),this.match("=>")&&(u.type===l.Syntax.Identifier&&u.name==="yield"&&(y=!0,u={type:d,params:[u],async:!1}),!y)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),u.type===l.Syntax.SequenceExpression)for(var b=0;b<u.expressions.length;b++)this.reinterpretExpressionAsPattern(u.expressions[b]);else this.reinterpretExpressionAsPattern(u);var _=u.type===l.Syntax.SequenceExpression?u.expressions:[u];u={type:d,params:_,async:!1}}this.context.isBindingElement=!1}}}return u},g.prototype.parseArguments=function(){this.expect("(");var u=[];if(!this.match(")"))for(;;){var p=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(u.push(p),this.match(")")||(this.expectCommaSeparator(),this.match(")")))break}return this.expect(")"),u},g.prototype.isIdentifierName=function(u){return u.type===3||u.type===4||u.type===1||u.type===5},g.prototype.parseIdentifierName=function(){var u=this.createNode(),p=this.nextToken();return this.isIdentifierName(p)||this.throwUnexpectedToken(p),this.finalize(u,new o.Identifier(p.value))},g.prototype.parseNewExpression=function(){var u=this.createNode(),p=this.parseIdentifierName();i.assert(p.name==="new","New expression must start with `new`");var f;if(this.match("."))if(this.nextToken(),this.lookahead.type===3&&this.context.inFunctionBody&&this.lookahead.value==="target"){var y=this.parseIdentifierName();f=new o.MetaProperty(p,y)}else this.throwUnexpectedToken(this.lookahead);else{var v=this.isolateCoverGrammar(this.parseLeftHandSideExpression),b=this.match("(")?this.parseArguments():[];f=new o.NewExpression(v,b),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(u,f)},g.prototype.parseAsyncArgument=function(){var u=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,u},g.prototype.parseAsyncArguments=function(){this.expect("(");var u=[];if(!this.match(")"))for(;;){var p=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(u.push(p),this.match(")")||(this.expectCommaSeparator(),this.match(")")))break}return this.expect(")"),u},g.prototype.parseLeftHandSideExpressionAllowCall=function(){var u=this.lookahead,p=this.matchContextualKeyword("async"),f=this.context.allowIn;this.context.allowIn=!0;var y;for(this.matchKeyword("super")&&this.context.inFunctionBody?(y=this.createNode(),this.nextToken(),y=this.finalize(y,new o.Super),!this.match("(")&&!this.match(".")&&!this.match("[")&&this.throwUnexpectedToken(this.lookahead)):y=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var v=this.parseIdentifierName();y=this.finalize(this.startNode(u),new o.StaticMemberExpression(y,v))}else if(this.match("(")){var b=p&&u.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var _=b?this.parseAsyncArguments():this.parseArguments();if(y=this.finalize(this.startNode(u),new o.CallExpression(y,_)),b&&this.match("=>")){for(var A=0;A<_.length;++A)this.reinterpretExpressionAsPattern(_[A]);y={type:d,params:_,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var v=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),y=this.finalize(this.startNode(u),new o.ComputedMemberExpression(y,v))}else if(this.lookahead.type===10&&this.lookahead.head){var x=this.parseTemplateLiteral();y=this.finalize(this.startNode(u),new o.TaggedTemplateExpression(y,x))}else break;return this.context.allowIn=f,y},g.prototype.parseSuper=function(){var u=this.createNode();return this.expectKeyword("super"),!this.match("[")&&!this.match(".")&&this.throwUnexpectedToken(this.lookahead),this.finalize(u,new o.Super)},g.prototype.parseLeftHandSideExpression=function(){i.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var u=this.startNode(this.lookahead),p=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var f=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),p=this.finalize(u,new o.ComputedMemberExpression(p,f))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var f=this.parseIdentifierName();p=this.finalize(u,new o.StaticMemberExpression(p,f))}else if(this.lookahead.type===10&&this.lookahead.head){var y=this.parseTemplateLiteral();p=this.finalize(u,new o.TaggedTemplateExpression(p,y))}else break;return p},g.prototype.parseUpdateExpression=function(){var u,p=this.lookahead;if(this.match("++")||this.match("--")){var f=this.startNode(p),y=this.nextToken();u=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&u.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(u.name)&&this.tolerateError(a.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(a.Messages.InvalidLHSInAssignment);var v=!0;u=this.finalize(f,new o.UpdateExpression(y.value,u,v)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(u=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&this.lookahead.type===7&&(this.match("++")||this.match("--"))){this.context.strict&&u.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(u.name)&&this.tolerateError(a.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(a.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var b=this.nextToken().value,v=!1;u=this.finalize(this.startNode(p),new o.UpdateExpression(b,u,v))}return u},g.prototype.parseAwaitExpression=function(){var u=this.createNode();this.nextToken();var p=this.parseUnaryExpression();return this.finalize(u,new o.AwaitExpression(p))},g.prototype.parseUnaryExpression=function(){var u;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var p=this.startNode(this.lookahead),f=this.nextToken();u=this.inheritCoverGrammar(this.parseUnaryExpression),u=this.finalize(p,new o.UnaryExpression(f.value,u)),this.context.strict&&u.operator==="delete"&&u.argument.type===l.Syntax.Identifier&&this.tolerateError(a.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else this.context.await&&this.matchContextualKeyword("await")?u=this.parseAwaitExpression():u=this.parseUpdateExpression();return u},g.prototype.parseExponentiationExpression=function(){var u=this.lookahead,p=this.inheritCoverGrammar(this.parseUnaryExpression);if(p.type!==l.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var f=p,y=this.isolateCoverGrammar(this.parseExponentiationExpression);p=this.finalize(this.startNode(u),new o.BinaryExpression("**",f,y))}return p},g.prototype.binaryPrecedence=function(u){var p=u.value,f;return u.type===7?f=this.operatorPrecedence[p]||0:u.type===4?f=p==="instanceof"||this.context.allowIn&&p==="in"?7:0:f=0,f},g.prototype.parseBinaryExpression=function(){var u=this.lookahead,p=this.inheritCoverGrammar(this.parseExponentiationExpression),f=this.lookahead,y=this.binaryPrecedence(f);if(y>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var v=[u,this.lookahead],b=p,_=this.isolateCoverGrammar(this.parseExponentiationExpression),A=[b,f.value,_],x=[y];y=this.binaryPrecedence(this.lookahead),!(y<=0);){for(;A.length>2&&y<=x[x.length-1];){_=A.pop();var C=A.pop();x.pop(),b=A.pop(),v.pop();var P=this.startNode(v[v.length-1]);A.push(this.finalize(P,new o.BinaryExpression(C,b,_)))}A.push(this.nextToken().value),x.push(y),v.push(this.lookahead),A.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var G=A.length-1;p=A[G];for(var Y=v.pop();G>1;){var ve=v.pop(),Me=Y&&Y.lineStart,P=this.startNode(ve,Me),C=A[G-1];p=this.finalize(P,new o.BinaryExpression(C,A[G-2],p)),G-=2,Y=ve}}return p},g.prototype.parseConditionalExpression=function(){var u=this.lookahead,p=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var f=this.context.allowIn;this.context.allowIn=!0;var y=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=f,this.expect(":");var v=this.isolateCoverGrammar(this.parseAssignmentExpression);p=this.finalize(this.startNode(u),new o.ConditionalExpression(p,y,v)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return p},g.prototype.checkPatternParam=function(u,p){switch(p.type){case l.Syntax.Identifier:this.validateParam(u,p,p.name);break;case l.Syntax.RestElement:this.checkPatternParam(u,p.argument);break;case l.Syntax.AssignmentPattern:this.checkPatternParam(u,p.left);break;case l.Syntax.ArrayPattern:for(var f=0;f<p.elements.length;f++)p.elements[f]!==null&&this.checkPatternParam(u,p.elements[f]);break;case l.Syntax.ObjectPattern:for(var f=0;f<p.properties.length;f++)this.checkPatternParam(u,p.properties[f].value);break;default:break}u.simple=u.simple&&p instanceof o.Identifier},g.prototype.reinterpretAsCoverFormalsList=function(u){var p=[u],f,y=!1;switch(u.type){case l.Syntax.Identifier:break;case d:p=u.params,y=u.async;break;default:return null}f={simple:!0,paramSet:{}};for(var v=0;v<p.length;++v){var b=p[v];b.type===l.Syntax.AssignmentPattern?b.right.type===l.Syntax.YieldExpression&&(b.right.argument&&this.throwUnexpectedToken(this.lookahead),b.right.type=l.Syntax.Identifier,b.right.name="yield",delete b.right.argument,delete b.right.delegate):y&&b.type===l.Syntax.Identifier&&b.name==="await"&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(f,b),p[v]=b}if(this.context.strict||!this.context.allowYield)for(var v=0;v<p.length;++v){var b=p[v];b.type===l.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(f.message===a.Messages.StrictParamDupe){var _=this.context.strict?f.stricted:f.firstRestricted;this.throwUnexpectedToken(_,f.message)}return{simple:f.simple,params:p,stricted:f.stricted,firstRestricted:f.firstRestricted,message:f.message}},g.prototype.parseAssignmentExpression=function(){var u;if(!this.context.allowYield&&this.matchKeyword("yield"))u=this.parseYieldExpression();else{var p=this.lookahead,f=p;if(u=this.parseConditionalExpression(),f.type===3&&f.lineNumber===this.lookahead.lineNumber&&f.value==="async"&&(this.lookahead.type===3||this.matchKeyword("yield"))){var y=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(y),u={type:d,params:[y],async:!0}}if(u.type===d||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var v=u.async,b=this.reinterpretAsCoverFormalsList(u);if(b){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var _=this.context.strict,A=this.context.allowStrictDirective;this.context.allowStrictDirective=b.simple;var x=this.context.allowYield,C=this.context.await;this.context.allowYield=!0,this.context.await=v;var P=this.startNode(p);this.expect("=>");var G=void 0;if(this.match("{")){var Y=this.context.allowIn;this.context.allowIn=!0,G=this.parseFunctionSourceElements(),this.context.allowIn=Y}else G=this.isolateCoverGrammar(this.parseAssignmentExpression);var ve=G.type!==l.Syntax.BlockStatement;this.context.strict&&b.firstRestricted&&this.throwUnexpectedToken(b.firstRestricted,b.message),this.context.strict&&b.stricted&&this.tolerateUnexpectedToken(b.stricted,b.message),u=v?this.finalize(P,new o.AsyncArrowFunctionExpression(b.params,G,ve)):this.finalize(P,new o.ArrowFunctionExpression(b.params,G,ve)),this.context.strict=_,this.context.allowStrictDirective=A,this.context.allowYield=x,this.context.await=C}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(a.Messages.InvalidLHSInAssignment),this.context.strict&&u.type===l.Syntax.Identifier){var Me=u;this.scanner.isRestrictedWord(Me.name)&&this.tolerateUnexpectedToken(f,a.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(Me.name)&&this.tolerateUnexpectedToken(f,a.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(u):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),f=this.nextToken();var cr=f.value,An=this.isolateCoverGrammar(this.parseAssignmentExpression);u=this.finalize(this.startNode(p),new o.AssignmentExpression(cr,u,An)),this.context.firstCoverInitializedNameError=null}}return u},g.prototype.parseExpression=function(){var u=this.lookahead,p=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var f=[];for(f.push(p);this.lookahead.type!==2&&this.match(",");)this.nextToken(),f.push(this.isolateCoverGrammar(this.parseAssignmentExpression));p=this.finalize(this.startNode(u),new o.SequenceExpression(f))}return p},g.prototype.parseStatementListItem=function(){var u;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,this.lookahead.type===4)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,a.Messages.IllegalExportDeclaration),u=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,a.Messages.IllegalImportDeclaration),u=this.parseImportDeclaration();break;case"const":u=this.parseLexicalDeclaration({inFor:!1});break;case"function":u=this.parseFunctionDeclaration();break;case"class":u=this.parseClassDeclaration();break;case"let":u=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:u=this.parseStatement();break}else u=this.parseStatement();return u},g.prototype.parseBlock=function(){var u=this.createNode();this.expect("{");for(var p=[];!this.match("}");)p.push(this.parseStatementListItem());return this.expect("}"),this.finalize(u,new o.BlockStatement(p))},g.prototype.parseLexicalBinding=function(u,p){var f=this.createNode(),y=[],v=this.parsePattern(y,u);this.context.strict&&v.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(v.name)&&this.tolerateError(a.Messages.StrictVarName);var b=null;return u==="const"?!this.matchKeyword("in")&&!this.matchContextualKeyword("of")&&(this.match("=")?(this.nextToken(),b=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(a.Messages.DeclarationMissingInitializer,"const")):(!p.inFor&&v.type!==l.Syntax.Identifier||this.match("="))&&(this.expect("="),b=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(f,new o.VariableDeclarator(v,b))},g.prototype.parseBindingList=function(u,p){for(var f=[this.parseLexicalBinding(u,p)];this.match(",");)this.nextToken(),f.push(this.parseLexicalBinding(u,p));return f},g.prototype.isLexicalDeclaration=function(){var u=this.scanner.saveState();this.scanner.scanComments();var p=this.scanner.lex();return this.scanner.restoreState(u),p.type===3||p.type===7&&p.value==="["||p.type===7&&p.value==="{"||p.type===4&&p.value==="let"||p.type===4&&p.value==="yield"},g.prototype.parseLexicalDeclaration=function(u){var p=this.createNode(),f=this.nextToken().value;i.assert(f==="let"||f==="const","Lexical declaration must be either let or const");var y=this.parseBindingList(f,u);return this.consumeSemicolon(),this.finalize(p,new o.VariableDeclaration(y,f))},g.prototype.parseBindingRestElement=function(u,p){var f=this.createNode();this.expect("...");var y=this.parsePattern(u,p);return this.finalize(f,new o.RestElement(y))},g.prototype.parseArrayPattern=function(u,p){var f=this.createNode();this.expect("[");for(var y=[];!this.match("]");)if(this.match(","))this.nextToken(),y.push(null);else{if(this.match("...")){y.push(this.parseBindingRestElement(u,p));break}else y.push(this.parsePatternWithDefault(u,p));this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(f,new o.ArrayPattern(y))},g.prototype.parsePropertyPattern=function(u,p){var f=this.createNode(),y=!1,v=!1,b=!1,_,A;if(this.lookahead.type===3){var x=this.lookahead;_=this.parseVariableIdentifier();var C=this.finalize(f,new o.Identifier(x.value));if(this.match("=")){u.push(x),v=!0,this.nextToken();var P=this.parseAssignmentExpression();A=this.finalize(this.startNode(x),new o.AssignmentPattern(C,P))}else this.match(":")?(this.expect(":"),A=this.parsePatternWithDefault(u,p)):(u.push(x),v=!0,A=C)}else y=this.match("["),_=this.parseObjectPropertyKey(),this.expect(":"),A=this.parsePatternWithDefault(u,p);return this.finalize(f,new o.Property("init",_,y,A,b,v))},g.prototype.parseObjectPattern=function(u,p){var f=this.createNode(),y=[];for(this.expect("{");!this.match("}");)y.push(this.parsePropertyPattern(u,p)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(f,new o.ObjectPattern(y))},g.prototype.parsePattern=function(u,p){var f;return this.match("[")?f=this.parseArrayPattern(u,p):this.match("{")?f=this.parseObjectPattern(u,p):(this.matchKeyword("let")&&(p==="const"||p==="let")&&this.tolerateUnexpectedToken(this.lookahead,a.Messages.LetInLexicalBinding),u.push(this.lookahead),f=this.parseVariableIdentifier(p)),f},g.prototype.parsePatternWithDefault=function(u,p){var f=this.lookahead,y=this.parsePattern(u,p);if(this.match("=")){this.nextToken();var v=this.context.allowYield;this.context.allowYield=!0;var b=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=v,y=this.finalize(this.startNode(f),new o.AssignmentPattern(y,b))}return y},g.prototype.parseVariableIdentifier=function(u){var p=this.createNode(),f=this.nextToken();return f.type===4&&f.value==="yield"?this.context.strict?this.tolerateUnexpectedToken(f,a.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(f):f.type!==3?this.context.strict&&f.type===4&&this.scanner.isStrictModeReservedWord(f.value)?this.tolerateUnexpectedToken(f,a.Messages.StrictReservedWord):(this.context.strict||f.value!=="let"||u!=="var")&&this.throwUnexpectedToken(f):(this.context.isModule||this.context.await)&&f.type===3&&f.value==="await"&&this.tolerateUnexpectedToken(f),this.finalize(p,new o.Identifier(f.value))},g.prototype.parseVariableDeclaration=function(u){var p=this.createNode(),f=[],y=this.parsePattern(f,"var");this.context.strict&&y.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(y.name)&&this.tolerateError(a.Messages.StrictVarName);var v=null;return this.match("=")?(this.nextToken(),v=this.isolateCoverGrammar(this.parseAssignmentExpression)):y.type!==l.Syntax.Identifier&&!u.inFor&&this.expect("="),this.finalize(p,new o.VariableDeclarator(y,v))},g.prototype.parseVariableDeclarationList=function(u){var p={inFor:u.inFor},f=[];for(f.push(this.parseVariableDeclaration(p));this.match(",");)this.nextToken(),f.push(this.parseVariableDeclaration(p));return f},g.prototype.parseVariableStatement=function(){var u=this.createNode();this.expectKeyword("var");var p=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(u,new o.VariableDeclaration(p,"var"))},g.prototype.parseEmptyStatement=function(){var u=this.createNode();return this.expect(";"),this.finalize(u,new o.EmptyStatement)},g.prototype.parseExpressionStatement=function(){var u=this.createNode(),p=this.parseExpression();return this.consumeSemicolon(),this.finalize(u,new o.ExpressionStatement(p))},g.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(a.Messages.StrictFunction),this.parseStatement()},g.prototype.parseIfStatement=function(){var u=this.createNode(),p,f=null;this.expectKeyword("if"),this.expect("(");var y=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),p=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),p=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),f=this.parseIfClause())),this.finalize(u,new o.IfStatement(y,p,f))},g.prototype.parseDoWhileStatement=function(){var u=this.createNode();this.expectKeyword("do");var p=this.context.inIteration;this.context.inIteration=!0;var f=this.parseStatement();this.context.inIteration=p,this.expectKeyword("while"),this.expect("(");var y=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(u,new o.DoWhileStatement(f,y))},g.prototype.parseWhileStatement=function(){var u=this.createNode(),p;this.expectKeyword("while"),this.expect("(");var f=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),p=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var y=this.context.inIteration;this.context.inIteration=!0,p=this.parseStatement(),this.context.inIteration=y}return this.finalize(u,new o.WhileStatement(f,p))},g.prototype.parseForStatement=function(){var u=null,p=null,f=null,y=!0,v,b,_=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){u=this.createNode(),this.nextToken();var A=this.context.allowIn;this.context.allowIn=!1;var x=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=A,x.length===1&&this.matchKeyword("in")){var C=x[0];C.init&&(C.id.type===l.Syntax.ArrayPattern||C.id.type===l.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(a.Messages.ForInOfLoopInitializer,"for-in"),u=this.finalize(u,new o.VariableDeclaration(x,"var")),this.nextToken(),v=u,b=this.parseExpression(),u=null}else x.length===1&&x[0].init===null&&this.matchContextualKeyword("of")?(u=this.finalize(u,new o.VariableDeclaration(x,"var")),this.nextToken(),v=u,b=this.parseAssignmentExpression(),u=null,y=!1):(u=this.finalize(u,new o.VariableDeclaration(x,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){u=this.createNode();var P=this.nextToken().value;if(!this.context.strict&&this.lookahead.value==="in")u=this.finalize(u,new o.Identifier(P)),this.nextToken(),v=u,b=this.parseExpression(),u=null;else{var A=this.context.allowIn;this.context.allowIn=!1;var x=this.parseBindingList(P,{inFor:!0});this.context.allowIn=A,x.length===1&&x[0].init===null&&this.matchKeyword("in")?(u=this.finalize(u,new o.VariableDeclaration(x,P)),this.nextToken(),v=u,b=this.parseExpression(),u=null):x.length===1&&x[0].init===null&&this.matchContextualKeyword("of")?(u=this.finalize(u,new o.VariableDeclaration(x,P)),this.nextToken(),v=u,b=this.parseAssignmentExpression(),u=null,y=!1):(this.consumeSemicolon(),u=this.finalize(u,new o.VariableDeclaration(x,P)))}}else{var G=this.lookahead,A=this.context.allowIn;if(this.context.allowIn=!1,u=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=A,this.matchKeyword("in"))(!this.context.isAssignmentTarget||u.type===l.Syntax.AssignmentExpression)&&this.tolerateError(a.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(u),v=u,b=this.parseExpression(),u=null;else if(this.matchContextualKeyword("of"))(!this.context.isAssignmentTarget||u.type===l.Syntax.AssignmentExpression)&&this.tolerateError(a.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(u),v=u,b=this.parseAssignmentExpression(),u=null,y=!1;else{if(this.match(",")){for(var Y=[u];this.match(",");)this.nextToken(),Y.push(this.isolateCoverGrammar(this.parseAssignmentExpression));u=this.finalize(this.startNode(G),new o.SequenceExpression(Y))}this.expect(";")}}typeof v>"u"&&(this.match(";")||(p=this.parseExpression()),this.expect(";"),this.match(")")||(f=this.parseExpression()));var ve;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),ve=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var Me=this.context.inIteration;this.context.inIteration=!0,ve=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=Me}return typeof v>"u"?this.finalize(_,new o.ForStatement(u,p,f,ve)):y?this.finalize(_,new o.ForInStatement(v,b,ve)):this.finalize(_,new o.ForOfStatement(v,b,ve))},g.prototype.parseContinueStatement=function(){var u=this.createNode();this.expectKeyword("continue");var p=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var f=this.parseVariableIdentifier();p=f;var y="$"+f.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,y)||this.throwError(a.Messages.UnknownLabel,f.name)}return this.consumeSemicolon(),p===null&&!this.context.inIteration&&this.throwError(a.Messages.IllegalContinue),this.finalize(u,new o.ContinueStatement(p))},g.prototype.parseBreakStatement=function(){var u=this.createNode();this.expectKeyword("break");var p=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var f=this.parseVariableIdentifier(),y="$"+f.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,y)||this.throwError(a.Messages.UnknownLabel,f.name),p=f}return this.consumeSemicolon(),p===null&&!this.context.inIteration&&!this.context.inSwitch&&this.throwError(a.Messages.IllegalBreak),this.finalize(u,new o.BreakStatement(p))},g.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(a.Messages.IllegalReturn);var u=this.createNode();this.expectKeyword("return");var p=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&this.lookahead.type!==2||this.lookahead.type===8||this.lookahead.type===10,f=p?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(u,new o.ReturnStatement(f))},g.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(a.Messages.StrictModeWith);var u=this.createNode(),p;this.expectKeyword("with"),this.expect("(");var f=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),p=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),p=this.parseStatement()),this.finalize(u,new o.WithStatement(f,p))},g.prototype.parseSwitchCase=function(){var u=this.createNode(),p;this.matchKeyword("default")?(this.nextToken(),p=null):(this.expectKeyword("case"),p=this.parseExpression()),this.expect(":");for(var f=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)f.push(this.parseStatementListItem());return this.finalize(u,new o.SwitchCase(p,f))},g.prototype.parseSwitchStatement=function(){var u=this.createNode();this.expectKeyword("switch"),this.expect("(");var p=this.parseExpression();this.expect(")");var f=this.context.inSwitch;this.context.inSwitch=!0;var y=[],v=!1;for(this.expect("{");!this.match("}");){var b=this.parseSwitchCase();b.test===null&&(v&&this.throwError(a.Messages.MultipleDefaultsInSwitch),v=!0),y.push(b)}return this.expect("}"),this.context.inSwitch=f,this.finalize(u,new o.SwitchStatement(p,y))},g.prototype.parseLabelledStatement=function(){var u=this.createNode(),p=this.parseExpression(),f;if(p.type===l.Syntax.Identifier&&this.match(":")){this.nextToken();var y=p,v="$"+y.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,v)&&this.throwError(a.Messages.Redeclaration,"Label",y.name),this.context.labelSet[v]=!0;var b=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),b=this.parseClassDeclaration();else if(this.matchKeyword("function")){var _=this.lookahead,A=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(_,a.Messages.StrictFunction):A.generator&&this.tolerateUnexpectedToken(_,a.Messages.GeneratorInLegacyContext),b=A}else b=this.parseStatement();delete this.context.labelSet[v],f=new o.LabeledStatement(y,b)}else this.consumeSemicolon(),f=new o.ExpressionStatement(p);return this.finalize(u,f)},g.prototype.parseThrowStatement=function(){var u=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(a.Messages.NewlineAfterThrow);var p=this.parseExpression();return this.consumeSemicolon(),this.finalize(u,new o.ThrowStatement(p))},g.prototype.parseCatchClause=function(){var u=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var p=[],f=this.parsePattern(p),y={},v=0;v<p.length;v++){var b="$"+p[v].value;Object.prototype.hasOwnProperty.call(y,b)&&this.tolerateError(a.Messages.DuplicateBinding,p[v].value),y[b]=!0}this.context.strict&&f.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(f.name)&&this.tolerateError(a.Messages.StrictCatchVariable),this.expect(")");var _=this.parseBlock();return this.finalize(u,new o.CatchClause(f,_))},g.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},g.prototype.parseTryStatement=function(){var u=this.createNode();this.expectKeyword("try");var p=this.parseBlock(),f=this.matchKeyword("catch")?this.parseCatchClause():null,y=this.matchKeyword("finally")?this.parseFinallyClause():null;return!f&&!y&&this.throwError(a.Messages.NoCatchOrFinally),this.finalize(u,new o.TryStatement(p,f,y))},g.prototype.parseDebuggerStatement=function(){var u=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(u,new o.DebuggerStatement)},g.prototype.parseStatement=function(){var u;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:u=this.parseExpressionStatement();break;case 7:var p=this.lookahead.value;p==="{"?u=this.parseBlock():p==="("?u=this.parseExpressionStatement():p===";"?u=this.parseEmptyStatement():u=this.parseExpressionStatement();break;case 3:u=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":u=this.parseBreakStatement();break;case"continue":u=this.parseContinueStatement();break;case"debugger":u=this.parseDebuggerStatement();break;case"do":u=this.parseDoWhileStatement();break;case"for":u=this.parseForStatement();break;case"function":u=this.parseFunctionDeclaration();break;case"if":u=this.parseIfStatement();break;case"return":u=this.parseReturnStatement();break;case"switch":u=this.parseSwitchStatement();break;case"throw":u=this.parseThrowStatement();break;case"try":u=this.parseTryStatement();break;case"var":u=this.parseVariableStatement();break;case"while":u=this.parseWhileStatement();break;case"with":u=this.parseWithStatement();break;default:u=this.parseExpressionStatement();break}break;default:u=this.throwUnexpectedToken(this.lookahead)}return u},g.prototype.parseFunctionSourceElements=function(){var u=this.createNode();this.expect("{");var p=this.parseDirectivePrologues(),f=this.context.labelSet,y=this.context.inIteration,v=this.context.inSwitch,b=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;this.lookahead.type!==2&&!this.match("}");)p.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=f,this.context.inIteration=y,this.context.inSwitch=v,this.context.inFunctionBody=b,this.finalize(u,new o.BlockStatement(p))},g.prototype.validateParam=function(u,p,f){var y="$"+f;this.context.strict?(this.scanner.isRestrictedWord(f)&&(u.stricted=p,u.message=a.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(u.paramSet,y)&&(u.stricted=p,u.message=a.Messages.StrictParamDupe)):u.firstRestricted||(this.scanner.isRestrictedWord(f)?(u.firstRestricted=p,u.message=a.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(f)?(u.firstRestricted=p,u.message=a.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(u.paramSet,y)&&(u.stricted=p,u.message=a.Messages.StrictParamDupe)),typeof Object.defineProperty=="function"?Object.defineProperty(u.paramSet,y,{value:!0,enumerable:!0,writable:!0,configurable:!0}):u.paramSet[y]=!0},g.prototype.parseRestElement=function(u){var p=this.createNode();this.expect("...");var f=this.parsePattern(u);return this.match("=")&&this.throwError(a.Messages.DefaultRestParameter),this.match(")")||this.throwError(a.Messages.ParameterAfterRestParameter),this.finalize(p,new o.RestElement(f))},g.prototype.parseFormalParameter=function(u){for(var p=[],f=this.match("...")?this.parseRestElement(p):this.parsePatternWithDefault(p),y=0;y<p.length;y++)this.validateParam(u,p[y],p[y].value);u.simple=u.simple&&f instanceof o.Identifier,u.params.push(f)},g.prototype.parseFormalParameters=function(u){var p;if(p={simple:!0,params:[],firstRestricted:u},this.expect("("),!this.match(")"))for(p.paramSet={};this.lookahead.type!==2&&(this.parseFormalParameter(p),!(this.match(")")||(this.expect(","),this.match(")")))););return this.expect(")"),{simple:p.simple,params:p.params,stricted:p.stricted,firstRestricted:p.firstRestricted,message:p.message}},g.prototype.matchAsyncFunction=function(){var u=this.matchContextualKeyword("async");if(u){var p=this.scanner.saveState();this.scanner.scanComments();var f=this.scanner.lex();this.scanner.restoreState(p),u=p.lineNumber===f.lineNumber&&f.type===4&&f.value==="function"}return u},g.prototype.parseFunctionDeclaration=function(u){var p=this.createNode(),f=this.matchContextualKeyword("async");f&&this.nextToken(),this.expectKeyword("function");var y=f?!1:this.match("*");y&&this.nextToken();var v,b=null,_=null;if(!u||!this.match("(")){var A=this.lookahead;b=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(A.value)&&this.tolerateUnexpectedToken(A,a.Messages.StrictFunctionName):this.scanner.isRestrictedWord(A.value)?(_=A,v=a.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(A.value)&&(_=A,v=a.Messages.StrictReservedWord)}var x=this.context.await,C=this.context.allowYield;this.context.await=f,this.context.allowYield=!y;var P=this.parseFormalParameters(_),G=P.params,Y=P.stricted;_=P.firstRestricted,P.message&&(v=P.message);var ve=this.context.strict,Me=this.context.allowStrictDirective;this.context.allowStrictDirective=P.simple;var cr=this.parseFunctionSourceElements();return this.context.strict&&_&&this.throwUnexpectedToken(_,v),this.context.strict&&Y&&this.tolerateUnexpectedToken(Y,v),this.context.strict=ve,this.context.allowStrictDirective=Me,this.context.await=x,this.context.allowYield=C,f?this.finalize(p,new o.AsyncFunctionDeclaration(b,G,cr)):this.finalize(p,new o.FunctionDeclaration(b,G,cr,y))},g.prototype.parseFunctionExpression=function(){var u=this.createNode(),p=this.matchContextualKeyword("async");p&&this.nextToken(),this.expectKeyword("function");var f=p?!1:this.match("*");f&&this.nextToken();var y,v=null,b,_=this.context.await,A=this.context.allowYield;if(this.context.await=p,this.context.allowYield=!f,!this.match("(")){var x=this.lookahead;v=!this.context.strict&&!f&&this.matchKeyword("yield")?this.parseIdentifierName():this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(x.value)&&this.tolerateUnexpectedToken(x,a.Messages.StrictFunctionName):this.scanner.isRestrictedWord(x.value)?(b=x,y=a.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(x.value)&&(b=x,y=a.Messages.StrictReservedWord)}var C=this.parseFormalParameters(b),P=C.params,G=C.stricted;b=C.firstRestricted,C.message&&(y=C.message);var Y=this.context.strict,ve=this.context.allowStrictDirective;this.context.allowStrictDirective=C.simple;var Me=this.parseFunctionSourceElements();return this.context.strict&&b&&this.throwUnexpectedToken(b,y),this.context.strict&&G&&this.tolerateUnexpectedToken(G,y),this.context.strict=Y,this.context.allowStrictDirective=ve,this.context.await=_,this.context.allowYield=A,p?this.finalize(u,new o.AsyncFunctionExpression(v,P,Me)):this.finalize(u,new o.FunctionExpression(v,P,Me,f))},g.prototype.parseDirective=function(){var u=this.lookahead,p=this.createNode(),f=this.parseExpression(),y=f.type===l.Syntax.Literal?this.getTokenRaw(u).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(p,y?new o.Directive(f,y):new o.ExpressionStatement(f))},g.prototype.parseDirectivePrologues=function(){for(var u=null,p=[];;){var f=this.lookahead;if(f.type!==8)break;var y=this.parseDirective();p.push(y);var v=y.directive;if(typeof v!="string")break;v==="use strict"?(this.context.strict=!0,u&&this.tolerateUnexpectedToken(u,a.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(f,a.Messages.IllegalLanguageModeDirective)):!u&&f.octal&&(u=f)}return p},g.prototype.qualifiedPropertyName=function(u){switch(u.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return u.value==="[";default:break}return!1},g.prototype.parseGetterMethod=function(){var u=this.createNode(),p=!1,f=this.context.allowYield;this.context.allowYield=!p;var y=this.parseFormalParameters();y.params.length>0&&this.tolerateError(a.Messages.BadGetterArity);var v=this.parsePropertyMethod(y);return this.context.allowYield=f,this.finalize(u,new o.FunctionExpression(null,y.params,v,p))},g.prototype.parseSetterMethod=function(){var u=this.createNode(),p=!1,f=this.context.allowYield;this.context.allowYield=!p;var y=this.parseFormalParameters();y.params.length!==1?this.tolerateError(a.Messages.BadSetterArity):y.params[0]instanceof o.RestElement&&this.tolerateError(a.Messages.BadSetterRestParameter);var v=this.parsePropertyMethod(y);return this.context.allowYield=f,this.finalize(u,new o.FunctionExpression(null,y.params,v,p))},g.prototype.parseGeneratorMethod=function(){var u=this.createNode(),p=!0,f=this.context.allowYield;this.context.allowYield=!0;var y=this.parseFormalParameters();this.context.allowYield=!1;var v=this.parsePropertyMethod(y);return this.context.allowYield=f,this.finalize(u,new o.FunctionExpression(null,y.params,v,p))},g.prototype.isStartOfExpression=function(){var u=!0,p=this.lookahead.value;switch(this.lookahead.type){case 7:u=p==="["||p==="("||p==="{"||p==="+"||p==="-"||p==="!"||p==="~"||p==="++"||p==="--"||p==="/"||p==="/=";break;case 4:u=p==="class"||p==="delete"||p==="function"||p==="let"||p==="new"||p==="super"||p==="this"||p==="typeof"||p==="void"||p==="yield";break;default:break}return u},g.prototype.parseYieldExpression=function(){var u=this.createNode();this.expectKeyword("yield");var p=null,f=!1;if(!this.hasLineTerminator){var y=this.context.allowYield;this.context.allowYield=!1,f=this.match("*"),f?(this.nextToken(),p=this.parseAssignmentExpression()):this.isStartOfExpression()&&(p=this.parseAssignmentExpression()),this.context.allowYield=y}return this.finalize(u,new o.YieldExpression(p,f))},g.prototype.parseClassElement=function(u){var p=this.lookahead,f=this.createNode(),y="",v=null,b=null,_=!1,A=!1,x=!1,C=!1;if(this.match("*"))this.nextToken();else{_=this.match("["),v=this.parseObjectPropertyKey();var P=v;if(P.name==="static"&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(p=this.lookahead,x=!0,_=this.match("["),this.match("*")?this.nextToken():v=this.parseObjectPropertyKey()),p.type===3&&!this.hasLineTerminator&&p.value==="async"){var G=this.lookahead.value;G!==":"&&G!=="("&&G!=="*"&&(C=!0,p=this.lookahead,v=this.parseObjectPropertyKey(),p.type===3&&p.value==="constructor"&&this.tolerateUnexpectedToken(p,a.Messages.ConstructorIsAsync))}}var Y=this.qualifiedPropertyName(this.lookahead);return p.type===3?p.value==="get"&&Y?(y="get",_=this.match("["),v=this.parseObjectPropertyKey(),this.context.allowYield=!1,b=this.parseGetterMethod()):p.value==="set"&&Y&&(y="set",_=this.match("["),v=this.parseObjectPropertyKey(),b=this.parseSetterMethod()):p.type===7&&p.value==="*"&&Y&&(y="init",_=this.match("["),v=this.parseObjectPropertyKey(),b=this.parseGeneratorMethod(),A=!0),!y&&v&&this.match("(")&&(y="init",b=C?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),A=!0),y||this.throwUnexpectedToken(this.lookahead),y==="init"&&(y="method"),_||(x&&this.isPropertyKey(v,"prototype")&&this.throwUnexpectedToken(p,a.Messages.StaticPrototype),!x&&this.isPropertyKey(v,"constructor")&&((y!=="method"||!A||b&&b.generator)&&this.throwUnexpectedToken(p,a.Messages.ConstructorSpecialMethod),u.value?this.throwUnexpectedToken(p,a.Messages.DuplicateConstructor):u.value=!0,y="constructor")),this.finalize(f,new o.MethodDefinition(v,_,b,y,x))},g.prototype.parseClassElementList=function(){var u=[],p={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():u.push(this.parseClassElement(p));return this.expect("}"),u},g.prototype.parseClassBody=function(){var u=this.createNode(),p=this.parseClassElementList();return this.finalize(u,new o.ClassBody(p))},g.prototype.parseClassDeclaration=function(u){var p=this.createNode(),f=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var y=u&&this.lookahead.type!==3?null:this.parseVariableIdentifier(),v=null;this.matchKeyword("extends")&&(this.nextToken(),v=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var b=this.parseClassBody();return this.context.strict=f,this.finalize(p,new o.ClassDeclaration(y,v,b))},g.prototype.parseClassExpression=function(){var u=this.createNode(),p=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var f=this.lookahead.type===3?this.parseVariableIdentifier():null,y=null;this.matchKeyword("extends")&&(this.nextToken(),y=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var v=this.parseClassBody();return this.context.strict=p,this.finalize(u,new o.ClassExpression(f,y,v))},g.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var u=this.createNode(),p=this.parseDirectivePrologues();this.lookahead.type!==2;)p.push(this.parseStatementListItem());return this.finalize(u,new o.Module(p))},g.prototype.parseScript=function(){for(var u=this.createNode(),p=this.parseDirectivePrologues();this.lookahead.type!==2;)p.push(this.parseStatementListItem());return this.finalize(u,new o.Script(p))},g.prototype.parseModuleSpecifier=function(){var u=this.createNode();this.lookahead.type!==8&&this.throwError(a.Messages.InvalidModuleSpecifier);var p=this.nextToken(),f=this.getTokenRaw(p);return this.finalize(u,new o.Literal(p.value,f))},g.prototype.parseImportSpecifier=function(){var u=this.createNode(),p,f;return this.lookahead.type===3?(p=this.parseVariableIdentifier(),f=p,this.matchContextualKeyword("as")&&(this.nextToken(),f=this.parseVariableIdentifier())):(p=this.parseIdentifierName(),f=p,this.matchContextualKeyword("as")?(this.nextToken(),f=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(u,new o.ImportSpecifier(f,p))},g.prototype.parseNamedImports=function(){this.expect("{");for(var u=[];!this.match("}");)u.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),u},g.prototype.parseImportDefaultSpecifier=function(){var u=this.createNode(),p=this.parseIdentifierName();return this.finalize(u,new o.ImportDefaultSpecifier(p))},g.prototype.parseImportNamespaceSpecifier=function(){var u=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(a.Messages.NoAsAfterImportNamespace),this.nextToken();var p=this.parseIdentifierName();return this.finalize(u,new o.ImportNamespaceSpecifier(p))},g.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(a.Messages.IllegalImportDeclaration);var u=this.createNode();this.expectKeyword("import");var p,f=[];if(this.lookahead.type===8)p=this.parseModuleSpecifier();else{if(this.match("{")?f=f.concat(this.parseNamedImports()):this.match("*")?f.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(f.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?f.push(this.parseImportNamespaceSpecifier()):this.match("{")?f=f.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var y=this.lookahead.value?a.Messages.UnexpectedToken:a.Messages.MissingFromClause;this.throwError(y,this.lookahead.value)}this.nextToken(),p=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(u,new o.ImportDeclaration(f,p))},g.prototype.parseExportSpecifier=function(){var u=this.createNode(),p=this.parseIdentifierName(),f=p;return this.matchContextualKeyword("as")&&(this.nextToken(),f=this.parseIdentifierName()),this.finalize(u,new o.ExportSpecifier(p,f))},g.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(a.Messages.IllegalExportDeclaration);var u=this.createNode();this.expectKeyword("export");var p;if(this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var f=this.parseFunctionDeclaration(!0);p=this.finalize(u,new o.ExportDefaultDeclaration(f))}else if(this.matchKeyword("class")){var f=this.parseClassDeclaration(!0);p=this.finalize(u,new o.ExportDefaultDeclaration(f))}else if(this.matchContextualKeyword("async")){var f=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();p=this.finalize(u,new o.ExportDefaultDeclaration(f))}else{this.matchContextualKeyword("from")&&this.throwError(a.Messages.UnexpectedToken,this.lookahead.value);var f=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),p=this.finalize(u,new o.ExportDefaultDeclaration(f))}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var y=this.lookahead.value?a.Messages.UnexpectedToken:a.Messages.MissingFromClause;this.throwError(y,this.lookahead.value)}this.nextToken();var v=this.parseModuleSpecifier();this.consumeSemicolon(),p=this.finalize(u,new o.ExportAllDeclaration(v))}else if(this.lookahead.type===4){var f=void 0;switch(this.lookahead.value){case"let":case"const":f=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":f=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}p=this.finalize(u,new o.ExportNamedDeclaration(f,[],null))}else if(this.matchAsyncFunction()){var f=this.parseFunctionDeclaration();p=this.finalize(u,new o.ExportNamedDeclaration(f,[],null))}else{var b=[],_=null,A=!1;for(this.expect("{");!this.match("}");)A=A||this.matchKeyword("default"),b.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),_=this.parseModuleSpecifier(),this.consumeSemicolon();else if(A){var y=this.lookahead.value?a.Messages.UnexpectedToken:a.Messages.MissingFromClause;this.throwError(y,this.lookahead.value)}else this.consumeSemicolon();p=this.finalize(u,new o.ExportNamedDeclaration(null,b,_))}return p},g})();t.Parser=h},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function r(i,n){if(!i)throw new Error("ASSERT: "+n)}t.assert=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(function(){function i(){this.errors=[],this.tolerant=!1}return i.prototype.recordError=function(n){this.errors.push(n)},i.prototype.tolerate=function(n){if(this.tolerant)this.recordError(n);else throw n},i.prototype.constructError=function(n,a){var o=new Error(n);try{throw o}catch(s){Object.create&&Object.defineProperty&&(o=Object.create(s),Object.defineProperty(o,"column",{value:a}))}return o},i.prototype.createError=function(n,a,o,s){var l="Line "+a+": "+s,m=this.constructError(l,o);return m.index=n,m.lineNumber=a,m.description=s,m},i.prototype.throwError=function(n,a,o,s){throw this.createError(n,a,o,s)},i.prototype.tolerateError=function(n,a,o,s){var l=this.createError(n,a,o,s);if(this.tolerant)this.recordError(l);else throw l},i})();t.ErrorHandler=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),n=r(4),a=r(11);function o(m){return"0123456789abcdef".indexOf(m.toLowerCase())}function s(m){return"01234567".indexOf(m)}var l=(function(){function m(d,h){this.source=d,this.errorHandler=h,this.trackComment=!1,this.isModule=!1,this.length=d.length,this.index=0,this.lineNumber=d.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return m.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},m.prototype.restoreState=function(d){this.index=d.index,this.lineNumber=d.lineNumber,this.lineStart=d.lineStart},m.prototype.eof=function(){return this.index>=this.length},m.prototype.throwUnexpectedToken=function(d){return d===void 0&&(d=a.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,d)},m.prototype.tolerateUnexpectedToken=function(d){d===void 0&&(d=a.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,d)},m.prototype.skipSingleLineComment=function(d){var h=[],g,u;for(this.trackComment&&(h=[],g=this.index-d,u={start:{line:this.lineNumber,column:this.index-this.lineStart-d},end:{}});!this.eof();){var p=this.source.charCodeAt(this.index);if(++this.index,n.Character.isLineTerminator(p)){if(this.trackComment){u.end={line:this.lineNumber,column:this.index-this.lineStart-1};var f={multiLine:!1,slice:[g+d,this.index-1],range:[g,this.index-1],loc:u};h.push(f)}return p===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,h}}if(this.trackComment){u.end={line:this.lineNumber,column:this.index-this.lineStart};var f={multiLine:!1,slice:[g+d,this.index],range:[g,this.index],loc:u};h.push(f)}return h},m.prototype.skipMultiLineComment=function(){var d=[],h,g;for(this.trackComment&&(d=[],h=this.index-2,g={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var u=this.source.charCodeAt(this.index);if(n.Character.isLineTerminator(u))u===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(u===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,this.trackComment){g.end={line:this.lineNumber,column:this.index-this.lineStart};var p={multiLine:!0,slice:[h+2,this.index-2],range:[h,this.index],loc:g};d.push(p)}return d}++this.index}else++this.index}if(this.trackComment){g.end={line:this.lineNumber,column:this.index-this.lineStart};var p={multiLine:!0,slice:[h+2,this.index],range:[h,this.index],loc:g};d.push(p)}return this.tolerateUnexpectedToken(),d},m.prototype.scanComments=function(){var d;this.trackComment&&(d=[]);for(var h=this.index===0;!this.eof();){var g=this.source.charCodeAt(this.index);if(n.Character.isWhiteSpace(g))++this.index;else if(n.Character.isLineTerminator(g))++this.index,g===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,h=!0;else if(g===47)if(g=this.source.charCodeAt(this.index+1),g===47){this.index+=2;var u=this.skipSingleLineComment(2);this.trackComment&&(d=d.concat(u)),h=!0}else if(g===42){this.index+=2;var u=this.skipMultiLineComment();this.trackComment&&(d=d.concat(u))}else break;else if(h&&g===45)if(this.source.charCodeAt(this.index+1)===45&&this.source.charCodeAt(this.index+2)===62){this.index+=3;var u=this.skipSingleLineComment(3);this.trackComment&&(d=d.concat(u))}else break;else if(g===60&&!this.isModule)if(this.source.slice(this.index+1,this.index+4)==="!--"){this.index+=4;var u=this.skipSingleLineComment(4);this.trackComment&&(d=d.concat(u))}else break;else break}return d},m.prototype.isFutureReservedWord=function(d){switch(d){case"enum":case"export":case"import":case"super":return!0;default:return!1}},m.prototype.isStrictModeReservedWord=function(d){switch(d){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},m.prototype.isRestrictedWord=function(d){return d==="eval"||d==="arguments"},m.prototype.isKeyword=function(d){switch(d.length){case 2:return d==="if"||d==="in"||d==="do";case 3:return d==="var"||d==="for"||d==="new"||d==="try"||d==="let";case 4:return d==="this"||d==="else"||d==="case"||d==="void"||d==="with"||d==="enum";case 5:return d==="while"||d==="break"||d==="catch"||d==="throw"||d==="const"||d==="yield"||d==="class"||d==="super";case 6:return d==="return"||d==="typeof"||d==="delete"||d==="switch"||d==="export"||d==="import";case 7:return d==="default"||d==="finally"||d==="extends";case 8:return d==="function"||d==="continue"||d==="debugger";case 10:return d==="instanceof";default:return!1}},m.prototype.codePointAt=function(d){var h=this.source.charCodeAt(d);if(h>=55296&&h<=56319){var g=this.source.charCodeAt(d+1);if(g>=56320&&g<=57343){var u=h;h=(u-55296)*1024+g-56320+65536}}return h},m.prototype.scanHexEscape=function(d){for(var h=d==="u"?4:2,g=0,u=0;u<h;++u)if(!this.eof()&&n.Character.isHexDigit(this.source.charCodeAt(this.index)))g=g*16+o(this.source[this.index++]);else return null;return String.fromCharCode(g)},m.prototype.scanUnicodeCodePointEscape=function(){var d=this.source[this.index],h=0;for(d==="}"&&this.throwUnexpectedToken();!this.eof()&&(d=this.source[this.index++],!!n.Character.isHexDigit(d.charCodeAt(0)));)h=h*16+o(d);return(h>1114111||d!=="}")&&this.throwUnexpectedToken(),n.Character.fromCodePoint(h)},m.prototype.getIdentifier=function(){for(var d=this.index++;!this.eof();){var h=this.source.charCodeAt(this.index);if(h===92)return this.index=d,this.getComplexIdentifier();if(h>=55296&&h<57343)return this.index=d,this.getComplexIdentifier();if(n.Character.isIdentifierPart(h))++this.index;else break}return this.source.slice(d,this.index)},m.prototype.getComplexIdentifier=function(){var d=this.codePointAt(this.index),h=n.Character.fromCodePoint(d);this.index+=h.length;var g;for(d===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,g=this.scanUnicodeCodePointEscape()):(g=this.scanHexEscape("u"),(g===null||g==="\\"||!n.Character.isIdentifierStart(g.charCodeAt(0)))&&this.throwUnexpectedToken()),h=g);!this.eof()&&(d=this.codePointAt(this.index),!!n.Character.isIdentifierPart(d));)g=n.Character.fromCodePoint(d),h+=g,this.index+=g.length,d===92&&(h=h.substr(0,h.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,g=this.scanUnicodeCodePointEscape()):(g=this.scanHexEscape("u"),(g===null||g==="\\"||!n.Character.isIdentifierPart(g.charCodeAt(0)))&&this.throwUnexpectedToken()),h+=g);return h},m.prototype.octalToDecimal=function(d){var h=d!=="0",g=s(d);return!this.eof()&&n.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(h=!0,g=g*8+s(this.source[this.index++]),"0123".indexOf(d)>=0&&!this.eof()&&n.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(g=g*8+s(this.source[this.index++]))),{code:g,octal:h}},m.prototype.scanIdentifier=function(){var d,h=this.index,g=this.source.charCodeAt(h)===92?this.getComplexIdentifier():this.getIdentifier();if(g.length===1?d=3:this.isKeyword(g)?d=4:g==="null"?d=5:g==="true"||g==="false"?d=1:d=3,d!==3&&h+g.length!==this.index){var u=this.index;this.index=h,this.tolerateUnexpectedToken(a.Messages.InvalidEscapedReservedWord),this.index=u}return{type:d,value:g,lineNumber:this.lineNumber,lineStart:this.lineStart,start:h,end:this.index}},m.prototype.scanPunctuator=function(){var d=this.index,h=this.source[this.index];switch(h){case"(":case"{":h==="{"&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,this.source[this.index]==="."&&this.source[this.index+1]==="."&&(this.index+=2,h="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:h=this.source.substr(this.index,4),h===">>>="?this.index+=4:(h=h.substr(0,3),h==="==="||h==="!=="||h===">>>"||h==="<<="||h===">>="||h==="**="?this.index+=3:(h=h.substr(0,2),h==="&&"||h==="||"||h==="=="||h==="!="||h==="+="||h==="-="||h==="*="||h==="/="||h==="++"||h==="--"||h==="<<"||h===">>"||h==="&="||h==="|="||h==="^="||h==="%="||h==="<="||h===">="||h==="=>"||h==="**"?this.index+=2:(h=this.source[this.index],"<>=!+-*%&|^/".indexOf(h)>=0&&++this.index)))}return this.index===d&&this.throwUnexpectedToken(),{type:7,value:h,lineNumber:this.lineNumber,lineStart:this.lineStart,start:d,end:this.index}},m.prototype.scanHexLiteral=function(d){for(var h="";!this.eof()&&n.Character.isHexDigit(this.source.charCodeAt(this.index));)h+=this.source[this.index++];return h.length===0&&this.throwUnexpectedToken(),n.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+h,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:d,end:this.index}},m.prototype.scanBinaryLiteral=function(d){for(var h="",g;!this.eof()&&(g=this.source[this.index],!(g!=="0"&&g!=="1"));)h+=this.source[this.index++];return h.length===0&&this.throwUnexpectedToken(),this.eof()||(g=this.source.charCodeAt(this.index),(n.Character.isIdentifierStart(g)||n.Character.isDecimalDigit(g))&&this.throwUnexpectedToken()),{type:6,value:parseInt(h,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:d,end:this.index}},m.prototype.scanOctalLiteral=function(d,h){var g="",u=!1;for(n.Character.isOctalDigit(d.charCodeAt(0))?(u=!0,g="0"+this.source[this.index++]):++this.index;!this.eof()&&n.Character.isOctalDigit(this.source.charCodeAt(this.index));)g+=this.source[this.index++];return!u&&g.length===0&&this.throwUnexpectedToken(),(n.Character.isIdentifierStart(this.source.charCodeAt(this.index))||n.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(g,8),octal:u,lineNumber:this.lineNumber,lineStart:this.lineStart,start:h,end:this.index}},m.prototype.isImplicitOctalLiteral=function(){for(var d=this.index+1;d<this.length;++d){var h=this.source[d];if(h==="8"||h==="9")return!1;if(!n.Character.isOctalDigit(h.charCodeAt(0)))return!0}return!0},m.prototype.scanNumericLiteral=function(){var d=this.index,h=this.source[d];i.assert(n.Character.isDecimalDigit(h.charCodeAt(0))||h===".","Numeric literal must start with a decimal digit or a decimal point");var g="";if(h!=="."){if(g=this.source[this.index++],h=this.source[this.index],g==="0"){if(h==="x"||h==="X")return++this.index,this.scanHexLiteral(d);if(h==="b"||h==="B")return++this.index,this.scanBinaryLiteral(d);if(h==="o"||h==="O")return this.scanOctalLiteral(h,d);if(h&&n.Character.isOctalDigit(h.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(h,d)}for(;n.Character.isDecimalDigit(this.source.charCodeAt(this.index));)g+=this.source[this.index++];h=this.source[this.index]}if(h==="."){for(g+=this.source[this.index++];n.Character.isDecimalDigit(this.source.charCodeAt(this.index));)g+=this.source[this.index++];h=this.source[this.index]}if(h==="e"||h==="E")if(g+=this.source[this.index++],h=this.source[this.index],(h==="+"||h==="-")&&(g+=this.source[this.index++]),n.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;n.Character.isDecimalDigit(this.source.charCodeAt(this.index));)g+=this.source[this.index++];else this.throwUnexpectedToken();return n.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(g),lineNumber:this.lineNumber,lineStart:this.lineStart,start:d,end:this.index}},m.prototype.scanStringLiteral=function(){var d=this.index,h=this.source[d];i.assert(h==="'"||h==='"',"String literal must starts with a quote"),++this.index;for(var g=!1,u="";!this.eof();){var p=this.source[this.index++];if(p===h){h="";break}else if(p==="\\")if(p=this.source[this.index++],!p||!n.Character.isLineTerminator(p.charCodeAt(0)))switch(p){case"u":if(this.source[this.index]==="{")++this.index,u+=this.scanUnicodeCodePointEscape();else{var f=this.scanHexEscape(p);f===null&&this.throwUnexpectedToken(),u+=f}break;case"x":var y=this.scanHexEscape(p);y===null&&this.throwUnexpectedToken(a.Messages.InvalidHexEscapeSequence),u+=y;break;case"n":u+=`
@@ -294,9 +294,9 @@ ${FA}
294
294
  `).replace(/^\n+/,"").replace(/\n+$/,`
295
295
  `)}Br(aa,"collapseBlankLines");function Bm(e,t){if(t===void 0)return e;if(t==="minimal")return UP(e);if(t==="compact")return zP(e);let r=parseInt(t,10);return Number.isNaN(r)||r<=0?e:BP(e,r)}Br(Bm,"applyBudget");var YV=Object.defineProperty,YA=(e,t)=>YV(e,"name",{value:t,configurable:!0}),QA=!1;function ex(){QA=!0}YA(ex,"markAgentFailureRendered");function QV(){return QA}YA(QV,"agentFailureRendered");function e3(){QA=!1}YA(e3,"resetAgentFailureLatch");var t3=Object.defineProperty,Ei=(e,t)=>t3(e,"name",{value:t,configurable:!0});function GP(e,t){switch(e.state){case"unstamped":case"incomplete":return!0;case"installed":return e.version!==t;case"missing":case"unreadable":return!1}}Ei(GP,"isSkillStale");function r3(e){return`${e.current} -> ${e.latest}`}Ei(r3,"formatUpdateAvailable");function n3(e){let t=GP(e.skill,e.current);if(!(e.update===null&&!t))return{...e.update!==null?{updateAvailable:{current:e.current,latest:e.update.latest,installSource:e.update.installSource}}:{},...t?{skillStale:!0}:{}}}Ei(n3,"buildUpdateEnvelope");function VP(e){let t=[];if(e.updateAvailable!==void 0){let{current:r,latest:i,installSource:n}=e.updateAvailable;t.push(`updateAvailable: ${r} -> ${i}`),t.push(`upgrade: ${_m(n)}`)}return e.skillStale===!0&&t.push("skillStale: true"),t.length===0?"":`${t.join(`
296
296
  `)}
297
- `}Ei(VP,"renderUpdateEnvelope");var Gm,Vm=!1;function i3(e){Gm=e,Vm=!1}Ei(i3,"armUpdateEnvelope");function a3(){Gm=void 0,Vm=!1}Ei(a3,"disarmUpdateEnvelope");function WP(){if(!(Vm||Gm===void 0)){Vm=!0;try{return Gm()}catch(e){Si.debug("UpdateEnvelope","Envelope source failed",{error:ge(e instanceof Error?e.message:String(e))});return}}}Ei(WP,"takeUpdateEnvelope");function Xo(){let e=WP();return e===void 0?"":VP(e)}Ei(Xo,"takeUpdateEnvelopeTail");var o3=Object.defineProperty,oa=(e,t)=>o3(e,"name",{value:t,configurable:!0}),k={success:oa(e=>e.outcome==="success","success"),error:oa(e=>e.outcome==="error","error"),empty:oa(e=>e.outcome==="empty","empty"),unsupported:oa(e=>e.outcome==="unsupported","unsupported"),successDryRun:oa(e=>e.outcome==="success"&&e.dryRun==="true","successDryRun"),successOffline:oa(e=>e.outcome==="success"&&e.offline==="true","successOffline"),errorWithCode:oa(e=>t=>t.outcome==="error"&&t.errorCode===e,"errorWithCode")};var s3=Object.defineProperty,c3=(e,t)=>s3(e,"name",{value:t,configurable:!0}),l3=["account deploy","add","agent install-skill","agent session-context","apps create","apps describe","apps detect","apps list","assets compliance","assets list","assets show","assets summary","aws exec","build","ci run","ci setup","ci status","ci token create","ci token list","ci token revoke","ci verify","compliance fix","compliance fix --execute","connect","connect status","costs show","create account","create app","create domain","create org","deploy","deploy diff","deploy logs","deployments cancel","deployments force-release","deployments list","destroy","dev down","dev list","dev substrate down","dev up","domain","domain create","domain delegate","domain deploy","domain destroy","domain eject","domain export","domain import","domain list","domain records list","domain sync","domain verify","drift detect","drift repair","drift resume","fjall","history","home","import","list","login","metrics show","migrate identity","modify","org bind","org deploy","org get","org identity setup-google","platform deploy","remove","restore","secrets delete","secrets exec","secrets export","secrets get","secrets import","secrets list","secrets set","services","status","target get","target list","target set","token create","token list","token revoke","token show","tunnel","undo","unlock bucket","user add","user list","user rebind","user remove","validate"],u3=new Set(l3);function Wm(e){return typeof e=="string"&&u3.has(e)}c3(Wm,"isAgentWriterSurface");var gl="fjall";var d3=Object.defineProperty,p3=(e,t)=>d3(e,"name",{value:t,configurable:!0}),KP=[{command:gl,match:k.error,templates:["Run `fjall --help` to list the available commands"]},{command:"home",match:k.success,templates:["Run `fjall apps describe <name>` to see app details","Run `fjall deploy <name>` to deploy","Run `fjall status <name>` to check a specific app"]},{command:"home",match:k.empty,templates:[`Run \`${te.createApplicationAgent} --name "<name>"\` to create your first app`,`Run \`${te.connect}\` to connect an AWS account`]},{command:"apps list",match:k.success,templates:["Run `fjall apps describe <name>` to see app details","Run `fjall deploy <name>` to deploy",`Run \`${te.createApplicationAgent} --name "<name>"\` to create a new app`]},{command:"apps list",match:k.empty,templates:[`Run \`${te.createApplicationAgent} --name "<name>"\` to create your first app`,`Run \`${te.connect}\` to connect an AWS account first`]},{command:"apps describe",match:k.success,templates:["Run `fjall deploy <app>` to deploy","Run `fjall secrets list --app <app>` to list secrets","Run `fjall status <app>` to check health"]},{command:"apps detect",match:k.empty,templates:["Run `fjall apps detect <path> --agent` against the directory holding the application, if this was the repository root","Pass `--pattern staticsite` with `--source`, `--build-command` and `--output-dir` explicitly if the app has no recognised framework dependency"]},{command:"apps detect",match:k.success,templates:[`Run \`${te.createApplicationAgent} --name <name> --pattern <pattern>\` using the \`pattern\` column \u2014 never the \`framework\` column`,"Skip any row whose `role` is `library` \u2014 those are not deployable applications","Confirm `outputDir` exists after building: it is a framework convention, not a verified path"]},{command:"apps create",match:k.successOffline,templates:["Run `npm install` in the app directory \u2014 `--offline` skipped it",`Re-run \`${te.createApplicationAgent}\` without \`--offline\` once you have credentials, to register the app`,"Run `fjall deploy <app>` only after both of the above"]},{command:"apps create",match:k.success,templates:["Run `fjall deploy <app>` to deploy your new app","Run `fjall secrets set --app <app> DB_URL=<url>` to configure secrets"]},{command:"status",match:k.success,templates:["Run `fjall deploy <app>` to deploy","Run `fjall apps describe <app>` for details"]},{command:"deploy",match:k.success,templates:["Run `fjall status <app>` to check health","Run `fjall apps describe <app>` for full details"]},{command:"deploy",match:k.error,templates:["Run `fjall deploy <app>` to retry","Run `fjall status <app>` to check current state"]},{command:"destroy",match:k.success,templates:["Run `fjall list` to see remaining resources","Run `fjall apps list` to see remaining apps"]},{command:"destroy",match:k.error,templates:["Run `fjall destroy <app> --skip-confirmation` to force destroy","Run `fjall status <app>` to check current state"]},{command:"build",match:k.success,templates:["Run `fjall deploy <app> --image-tag <tag>` with a tag from `artefacts` to roll out this build","Run `fjall status <app>` to check health"]},{command:"connect",match:p3(e=>e.outcome==="success"&&e.pending==="true","match"),templates:["Run `fjall connect status --external-id <externalId> --wait` to block until the stack completes"]},{command:"connect",match:k.success,templates:[`Run \`${te.accountDeploy}\` or \`${te.organisationDeploy}\` to deploy infrastructure`,`Run \`${te.createApplicationAgent} --name "<name>"\` to create an app`]},{command:"connect status",match:k.success,templates:["Run `fjall connect status --external-id <id> --wait` to block until a pending stack completes",`Run \`${te.accountDeploy}\` or \`${te.organisationDeploy}\` to deploy infrastructure`]},{command:"connect status",match:k.empty,templates:[`Run \`${te.connect}\` to connect an AWS account`]},{command:"login",match:k.success,templates:["Run `fjall apps list` to see your applications",`Run \`${te.connect}\` to connect an AWS account`]},{command:"list",match:k.success,templates:["Run `fjall apps describe <name>` for app details","Run `fjall deploy <name>` to deploy"]},{command:"add",match:k.success,templates:["Run `fjall deploy <app>` to deploy the change","Run `fjall apps describe <app>` to see updated resources"]},{command:"modify",match:k.success,templates:["Run `fjall validate --deep --app <app>` to typecheck the edited infrastructure.ts","Run `fjall deploy <app>` to deploy the change","Run `fjall undo --app <app>` to restore the .bak sidecar if the edit was wrong"]},{command:"remove",match:k.success,templates:["Run `fjall validate --deep --app <app>` to confirm nothing still references the removed resource","Run `fjall deploy <app>` to deploy the change","Run `fjall undo --app <app>` to restore the .bak sidecar if the removal was wrong"]},{command:"validate",match:k.success,templates:["Run `fjall deploy <app>` to deploy the validated infrastructure"]},{command:"validate",match:k.error,templates:["Run `fjall undo --app <app>` to restore the most recent .bak sidecar","Run `fjall history --app <app>` to list older snapshots to restore from"]},{command:"undo",match:k.success,templates:["Run `fjall validate --deep --app <app>` to confirm the restored infrastructure.ts typechecks","Run `fjall history --app <app>` to restore an older snapshot instead"]},{command:"history",match:k.success,templates:["Run `fjall history --restore <timestamp> --app <app>` to restore a specific snapshot","Run `fjall undo --app <app>` to restore the most recent .bak sidecar instead"]},{command:"history",match:k.empty,templates:["No snapshots yet \u2014 `fjall add`, `fjall modify` and `fjall remove` each write one before editing infrastructure.ts"]},{command:"tunnel",match:k.success,templates:["Run `fjall tunnel <app> --background` to run in the background"]}];var ZP=[{command:"secrets list",match:k.success,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to set a secret","Run `fjall rollout <app>` to restart running services with the latest values"]},{command:"secrets list",match:k.empty,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to add a secret","Run `fjall secrets import --app <app> <file>` to bulk import"]},{command:"secrets get",match:k.success,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to update","Run `fjall secrets list --app <app>` to see all secrets"]},{command:"secrets set",match:k.success,templates:["Run `fjall rollout <app>` to restart running services with the new value","New key? Run a full `fjall deploy <app>` so the task definition gains the reference","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets delete",match:k.success,templates:["Declared for a service? Re-run with `--remove-declaration` (or edit infrastructure.ts ssmSecrets), then `fjall deploy <app>` \u2014 a stale declaration breaks task launches","Not declared anywhere? Run `fjall rollout <app>` so running services drop the previous value","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets import",match:k.success,templates:["Run `fjall rollout <app>` to restart running services with the imported values","New keys? Run a full `fjall deploy <app>` so task definitions gain the references","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets export",match:k.success,templates:["Run `fjall secrets list --app <app>` to see all secret names","Run `fjall secrets import --app <app> <file>` to restore"]},{command:"secrets exec",match:k.success,templates:["Run `fjall secrets list --app <app>` to see available secrets"]}];var m3=Object.defineProperty,f3=(e,t)=>m3(e,"name",{value:t,configurable:!0});var HP="identity-only organisation deploys typically take 2-5 minutes",tx=`Run \`${te.organisationDeploy}\` to apply the change (${HP}).`,zie=`Deploy the organisation now to apply this change? (${HP})`,h3="Groups have no members",qo="fjall user add <email> --group <group>",g3=qo,Bie=`${h3} \u2014 run \`${g3}\` to declare access.`;function y3(e,t){return`Declared identity (source "${e}"): ${String(t)} user${t===1?"":"s"}`}f3(y3,"formatUserListHeading");var Gie=`No users or memberships declared. Run \`${qo}\` to add one.`;var JP=[{command:"user list",match:k.success,templates:[`Run \`${qo}\` to grant access`,`Run \`${te.organisationDeploy}\` to apply declared changes`]},{command:"user list",match:k.empty,templates:[`Run \`${qo}\` to declare the first membership`]},{command:"user add",match:k.success,templates:[tx,"Run `fjall user list` to review the declared users"]},{command:"user remove",match:k.success,templates:[tx,"Run `fjall user list` to see the remaining users"]},{command:"user rebind",match:k.success,templates:[`Run \`${te.organisationDeploy}\` to re-resolve external users against the identity store`]},{command:"org identity setup-google",match:k.success,templates:[`Run \`${qo} --live\` to declare access for a synced user`,"Run `fjall user list --live` to compare declared memberships against the identity store"]},{command:"token create",match:k.success,templates:["Run `fjall token list` to see all tokens","Save the token now \u2014 it cannot be retrieved again"]},{command:"token list",match:k.success,templates:["Run `fjall token create --name <name> --scope <scope> --expires <duration>` to create a token","Run `fjall token revoke <id>` to revoke a token"]},{command:"token show",match:k.success,templates:["Run `fjall token revoke <id>` to revoke this token","Run `fjall token list` to see all tokens"]},{command:"token revoke",match:k.success,templates:["Run `fjall token list` to see remaining tokens"]},{command:"target list",match:k.success,templates:["Run `fjall target set <name>` to change active target","Run `fjall deploy <app>` to deploy to the active target","Run `fjall apps list` to see applications"]},{command:"target list",match:k.empty,templates:[`Run \`${te.connect}\` to connect an AWS account`,`Run \`${te.login}\` to authenticate if not logged in`]},{command:"org bind",match:k.success,templates:["Run `fjall org get` to confirm the organisation's regions and accounts","Commit fjall-config.json so every checkout of this project carries the binding"]},{command:"org get",match:k.success,templates:["Run `fjall target list` to see which account/region pairs are deployable","Run `fjall accounts list` to see application-hosting accounts only"]},{command:"target get",match:k.success,templates:["Run `fjall target set <name>` to change active target","Run `fjall target list` to see all targets"]},{command:"target get",match:k.empty,templates:["Run `fjall target set <name>` to set a target","Run `fjall target list` to see available targets"]},{command:"target set",match:k.success,templates:["Run `fjall deploy <app>` to deploy to this target","Run `fjall target get` to verify the active target"]},{command:"target set",match:k.errorWithCode("NOT_FOUND"),templates:["Run `fjall target list` to see available targets",`Run \`${te.connect}\` to connect an AWS account if none available`]}];import{platform as L3,arch as F3}from"os";import*as Oe from"fs";import*as Nt from"path";var v3=Object.defineProperty,Km=(e,t)=>v3(e,"name",{value:t,configurable:!0});function b3(e){return e.success===!0}Km(b3,"isSuccess");function S3(e){return e.success===!1}Km(S3,"isFailure");function sa(e){return{success:!0,data:e}}Km(sa,"success");function rn(e){return{success:!1,error:e}}Km(rn,"failure");var E3=Object.defineProperty,Zm=(e,t)=>E3(e,"name",{value:t,configurable:!0}),A3=Zm(e=>{try{return JSON.stringify(e)}catch{return"[unserializable]"}},"safeStringify"),XP=Zm((e,t,r,i)=>{let n=new Date().toISOString(),a=e.toUpperCase(),o=i?` ${A3(i)}`:"";process.stderr.write(`[${n}] [${a}] [${t}] ${r}${o}
297
+ `}Ei(VP,"renderUpdateEnvelope");var Gm,Vm=!1;function i3(e){Gm=e,Vm=!1}Ei(i3,"armUpdateEnvelope");function a3(){Gm=void 0,Vm=!1}Ei(a3,"disarmUpdateEnvelope");function WP(){if(!(Vm||Gm===void 0)){Vm=!0;try{return Gm()}catch(e){Si.debug("UpdateEnvelope","Envelope source failed",{error:ge(e instanceof Error?e.message:String(e))});return}}}Ei(WP,"takeUpdateEnvelope");function Xo(){let e=WP();return e===void 0?"":VP(e)}Ei(Xo,"takeUpdateEnvelopeTail");var o3=Object.defineProperty,oa=(e,t)=>o3(e,"name",{value:t,configurable:!0}),k={success:oa(e=>e.outcome==="success","success"),error:oa(e=>e.outcome==="error","error"),empty:oa(e=>e.outcome==="empty","empty"),unsupported:oa(e=>e.outcome==="unsupported","unsupported"),successDryRun:oa(e=>e.outcome==="success"&&e.dryRun==="true","successDryRun"),successOffline:oa(e=>e.outcome==="success"&&e.offline==="true","successOffline"),errorWithCode:oa(e=>t=>t.outcome==="error"&&t.errorCode===e,"errorWithCode")};var s3=Object.defineProperty,c3=(e,t)=>s3(e,"name",{value:t,configurable:!0}),l3=["account deploy","add","agent install-skill","agent session-context","apps create","apps describe","apps detect","apps list","assets compliance","assets list","assets show","assets summary","aws exec","build","ci run","ci setup","ci status","ci token create","ci token list","ci token revoke","ci verify","compliance fix","compliance fix --execute","connect","connect status","costs show","create account","create app","create domain","create org","deploy","deploy diff","deploy logs","deployments cancel","deployments force-release","deployments list","destroy","dev down","dev list","dev substrate down","dev up","domain","domain create","domain delegate","domain deploy","domain destroy","domain eject","domain export","domain import","domain list","domain records list","domain sync","domain verify","drift detect","drift repair","drift resume","fjall","history","home","import","list","login","metrics show","migrate identity","modify","org bind","org deploy","org get","org identity setup-google","platform deploy","remove","restore","secrets delete","secrets exec","secrets export","secrets get","secrets import","secrets list","secrets set","services","status","target get","target list","target set","token create","token list","token revoke","token show","tunnel","undo","unlock bucket","user add","user list","user rebind","user remove","validate"],u3=new Set(l3);function Wm(e){return typeof e=="string"&&u3.has(e)}c3(Wm,"isAgentWriterSurface");var gl="fjall";var d3=Object.defineProperty,p3=(e,t)=>d3(e,"name",{value:t,configurable:!0}),KP=[{command:gl,match:k.error,templates:["Run `fjall --help` to list the available commands"]},{command:"home",match:k.success,templates:["Run `fjall apps describe <name>` to see app details","Run `fjall deploy <name>` to deploy","Run `fjall status <name>` to check a specific app"]},{command:"home",match:k.empty,templates:[`Run \`${te.createApplicationAgent} --name "<name>"\` to create your first app`,`Run \`${te.connect}\` to connect an AWS account`]},{command:"apps list",match:k.success,templates:["Run `fjall apps describe <name>` to see app details","Run `fjall deploy <name>` to deploy",`Run \`${te.createApplicationAgent} --name "<name>"\` to create a new app`]},{command:"apps list",match:k.empty,templates:[`Run \`${te.createApplicationAgent} --name "<name>"\` to create your first app`,`Run \`${te.connect}\` to connect an AWS account first`]},{command:"apps describe",match:k.success,templates:["Run `fjall deploy <app>` to deploy","Run `fjall secrets list --app <app>` to list secrets","Run `fjall status <app>` to check health"]},{command:"apps detect",match:k.empty,templates:["Run `fjall apps detect <path> --agent` against the directory holding the application, if this was the repository root","Pass `--pattern staticsite` with `--source`, `--build-command` and `--output-dir` explicitly if the app has no recognised framework dependency"]},{command:"apps detect",match:k.success,templates:[`Run \`${te.createApplicationAgent} --name <name> --pattern <pattern>\` using the \`pattern\` column \u2014 never the \`framework\` column`,"Skip any row whose `role` is `library` \u2014 those are not deployable applications","Confirm `outputDir` exists after building: it is a framework convention, not a verified path"]},{command:"apps create",match:k.successOffline,templates:["Run `npm install` in the app directory \u2014 `--offline` skipped it",`Re-run \`${te.createApplicationAgent}\` without \`--offline\` once you have credentials, to register the app`,"Run `fjall deploy <app>` only after both of the above"]},{command:"apps create",match:k.success,templates:["Run `fjall deploy <app>` to deploy your new app","Run `fjall secrets set --app <app> DB_URL=<url>` to configure secrets"]},{command:"status",match:k.success,templates:["Run `fjall deploy <app>` to deploy","Run `fjall apps describe <app>` for details"]},{command:"deploy",match:k.success,templates:["Run `fjall status <app>` to check health","Run `fjall apps describe <app>` for full details"]},{command:"deploy",match:k.error,templates:["Run `fjall deploy <app>` to retry","Run `fjall status <app>` to check current state"]},{command:"destroy",match:k.success,templates:["Run `fjall list` to see remaining resources","Run `fjall apps list` to see remaining apps"]},{command:"destroy",match:k.error,templates:["Run `fjall destroy <app> --skip-confirmation` to force destroy","Run `fjall status <app>` to check current state"]},{command:"build",match:k.success,templates:["Run `fjall deploy <app> --image-tag <tag>` with a tag from `artefacts` to roll out this build","Run `fjall status <app>` to check health"]},{command:"connect",match:p3(e=>e.outcome==="success"&&e.pending==="true","match"),templates:["Run `fjall connect status --external-id <externalId> --wait` to block until the stack completes"]},{command:"connect",match:k.success,templates:[`Run \`${te.accountDeploy}\` or \`${te.organisationDeploy}\` to deploy infrastructure`,`Run \`${te.createApplicationAgent} --name "<name>"\` to create an app`]},{command:"connect status",match:k.success,templates:["Run `fjall connect status --external-id <id> --wait` to block until a pending stack completes",`Run \`${te.accountDeploy}\` or \`${te.organisationDeploy}\` to deploy infrastructure`]},{command:"connect status",match:k.empty,templates:[`Run \`${te.connect}\` to connect an AWS account`]},{command:"login",match:k.success,templates:["Run `fjall apps list` to see your applications",`Run \`${te.connect}\` to connect an AWS account`]},{command:"list",match:k.success,templates:["Run `fjall apps describe <name>` for app details","Run `fjall deploy <name>` to deploy"]},{command:"add",match:k.success,templates:["Run `fjall deploy <app>` to deploy the change","Run `fjall apps describe <app>` to see updated resources"]},{command:"modify",match:k.success,templates:["Run `fjall validate --deep --app <app>` to typecheck the edited infrastructure.ts","Run `fjall deploy <app>` to deploy the change","Run `fjall undo --app <app>` to restore the .bak sidecar if the edit was wrong"]},{command:"remove",match:k.success,templates:["Run `fjall validate --deep --app <app>` to confirm nothing still references the removed resource","Run `fjall deploy <app>` to deploy the change","Run `fjall undo --app <app>` to restore the .bak sidecar if the removal was wrong"]},{command:"validate",match:k.success,templates:["Run `fjall deploy <app>` to deploy the validated infrastructure"]},{command:"validate",match:k.error,templates:["Run `fjall undo --app <app>` to restore the most recent .bak sidecar","Run `fjall history --app <app>` to list older snapshots to restore from"]},{command:"undo",match:k.success,templates:["Run `fjall validate --deep --app <app>` to confirm the restored infrastructure.ts typechecks","Run `fjall history --app <app>` to restore an older snapshot instead"]},{command:"history",match:k.success,templates:["Run `fjall history --restore <timestamp> --app <app>` to restore a specific snapshot","Run `fjall undo --app <app>` to restore the most recent .bak sidecar instead"]},{command:"history",match:k.empty,templates:["No snapshots yet \u2014 `fjall add`, `fjall modify` and `fjall remove` each write one before editing infrastructure.ts"]},{command:"tunnel",match:k.success,templates:["Run `fjall tunnel <app> --background` to run in the background"]}];var ZP=[{command:"secrets list",match:k.success,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to set a secret","Run `fjall rollout <app>` to restart running services with the latest values"]},{command:"secrets list",match:k.empty,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to add a secret","Run `fjall secrets import --app <app> <file>` to bulk import"]},{command:"secrets get",match:k.success,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to update","Run `fjall secrets list --app <app>` to see all secrets"]},{command:"secrets set",match:k.success,templates:["Run `fjall rollout <app>` to restart running services with the new value","New key? Run a full `fjall deploy <app>` so the task definition gains the reference","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets delete",match:k.success,templates:["Declared for a service? Re-run with `--remove-declaration` (or edit infrastructure.ts ssmSecrets), then `fjall deploy <app>` \u2014 a stale declaration breaks task launches","Not declared anywhere? Run `fjall rollout <app>` so running services drop the previous value","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets import",match:k.success,templates:["Run `fjall rollout <app>` to restart running services with the imported values","New keys? Run a full `fjall deploy <app>` so task definitions gain the references","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets export",match:k.success,templates:["Run `fjall secrets list --app <app>` to see all secret names","Run `fjall secrets import --app <app> <file>` to restore"]},{command:"secrets exec",match:k.success,templates:["Run `fjall secrets list --app <app>` to see available secrets"]}];var m3=Object.defineProperty,f3=(e,t)=>m3(e,"name",{value:t,configurable:!0});var HP="identity-only organisation deploys typically take 2-5 minutes",tx=`Run \`${te.organisationDeploy}\` to apply the change (${HP}).`,Bie=`Deploy the organisation now to apply this change? (${HP})`,h3="Groups have no members",qo="fjall user add <email> --group <group>",g3=qo,Gie=`${h3} \u2014 run \`${g3}\` to declare access.`;function y3(e,t){return`Declared identity (source "${e}"): ${String(t)} user${t===1?"":"s"}`}f3(y3,"formatUserListHeading");var Vie=`No users or memberships declared. Run \`${qo}\` to add one.`;var JP=[{command:"user list",match:k.success,templates:[`Run \`${qo}\` to grant access`,`Run \`${te.organisationDeploy}\` to apply declared changes`]},{command:"user list",match:k.empty,templates:[`Run \`${qo}\` to declare the first membership`]},{command:"user add",match:k.success,templates:[tx,"Run `fjall user list` to review the declared users"]},{command:"user remove",match:k.success,templates:[tx,"Run `fjall user list` to see the remaining users"]},{command:"user rebind",match:k.success,templates:[`Run \`${te.organisationDeploy}\` to re-resolve external users against the identity store`]},{command:"org identity setup-google",match:k.success,templates:[`Run \`${qo} --live\` to declare access for a synced user`,"Run `fjall user list --live` to compare declared memberships against the identity store"]},{command:"token create",match:k.success,templates:["Run `fjall token list` to see all tokens","Save the token now \u2014 it cannot be retrieved again"]},{command:"token list",match:k.success,templates:["Run `fjall token create --name <name> --scope <scope> --expires <duration>` to create a token","Run `fjall token revoke <id>` to revoke a token"]},{command:"token show",match:k.success,templates:["Run `fjall token revoke <id>` to revoke this token","Run `fjall token list` to see all tokens"]},{command:"token revoke",match:k.success,templates:["Run `fjall token list` to see remaining tokens"]},{command:"target list",match:k.success,templates:["Run `fjall target set <name>` to change active target","Run `fjall deploy <app>` to deploy to the active target","Run `fjall apps list` to see applications"]},{command:"target list",match:k.empty,templates:[`Run \`${te.connect}\` to connect an AWS account`,`Run \`${te.login}\` to authenticate if not logged in`]},{command:"org bind",match:k.success,templates:["Run `fjall org get` to confirm the organisation's regions and accounts","Commit fjall-config.json so every checkout of this project carries the binding"]},{command:"org get",match:k.success,templates:["Run `fjall target list` to see which account/region pairs are deployable","Run `fjall accounts list` to see application-hosting accounts only"]},{command:"target get",match:k.success,templates:["Run `fjall target set <name>` to change active target","Run `fjall target list` to see all targets"]},{command:"target get",match:k.empty,templates:["Run `fjall target set <name>` to set a target","Run `fjall target list` to see available targets"]},{command:"target set",match:k.success,templates:["Run `fjall deploy <app>` to deploy to this target","Run `fjall target get` to verify the active target"]},{command:"target set",match:k.errorWithCode("NOT_FOUND"),templates:["Run `fjall target list` to see available targets",`Run \`${te.connect}\` to connect an AWS account if none available`]}];import{platform as L3,arch as F3}from"os";import*as Oe from"fs";import*as Nt from"path";var v3=Object.defineProperty,Km=(e,t)=>v3(e,"name",{value:t,configurable:!0});function b3(e){return e.success===!0}Km(b3,"isSuccess");function S3(e){return e.success===!1}Km(S3,"isFailure");function sa(e){return{success:!0,data:e}}Km(sa,"success");function rn(e){return{success:!1,error:e}}Km(rn,"failure");var E3=Object.defineProperty,Zm=(e,t)=>E3(e,"name",{value:t,configurable:!0}),A3=Zm(e=>{try{return JSON.stringify(e)}catch{return"[unserializable]"}},"safeStringify"),XP=Zm((e,t,r,i)=>{let n=new Date().toISOString(),a=e.toUpperCase(),o=i?` ${A3(i)}`:"";process.stderr.write(`[${n}] [${a}] [${t}] ${r}${o}
298
298
  `)},"defaultWriter"),ca=XP;function x3(e){ca=e}Zm(x3,"configureLogWriter");function _3(){ca=XP}Zm(_3,"resetLogWriter");var la={info(e,t,r){ca("info",e,t,r)},warn(e,t,r){ca("warn",e,t,r)},error(e,t,r){ca("error",e,t,r)},debug(e,t,r){process.env.FJALL_DEBUG==="true"&&ca("debug",e,t,r)},trace(e,t,r){process.env.FJALL_TRACE==="true"&&ca("trace",e,t,r)},isDebugEnabled(){return process.env.FJALL_DEBUG==="true"}};var T3=Object.defineProperty,yl=(e,t)=>T3(e,"name",{value:t,configurable:!0}),C3=10;var QP=c.object({name:c.string(),type:c.enum(["apex","delegated"]),parentDomain:c.string().optional(),account:c.string().optional(),region:c.string().optional()}).strict(),eR=c.object({id:c.string().min(1),name:c.string().min(1).optional()}).strict(),tR=c.object({activeTarget:c.string().optional(),domains:c.array(QP).optional(),capacityIdentity:im.optional(),organisation:eR.optional()}).strict(),qP=c.object({activeTarget:c.string().optional(),domains:c.array(QP).optional(),capacityIdentity:im.optional(),organisation:eR.optional()}),D3=c.object({activeTarget:c.string().optional()});function rR(e={}){return JSON.stringify(e,null,2)}yl(rR,"serialiseRootConfig");var YP=tR.keyof().options;function nR(e,t,r){let i=t[r];i!==void 0&&(e[r]=i)}yl(nR,"copyDefinedKey");function rx(e,t){if(t===void 0)return!1;let r=new Set([...Object.keys(e),...Object.keys(t)]);for(let i of r)if(e[i]!==t[i])return!1;return!0}yl(rx,"domainEntriesEqual");var Hm=class e{static{yl(this,"Config")}rootConfig;configPath=null;loadFailed=!1;parseDegraded=!1;loadedSnapshot={};constructor(t,r){this.rootConfig=t??{},this.configPath=r??null}static findConfigDirectory(t){let r=t!==void 0&&t!==""?t:process.cwd();for(let i=0;i<C3;i++){let n=Nt.join(r,"fjall"),a=Nt.join(n,Pn);if(Oe.existsSync(a))return n;let o=Nt.join(r,Pn);if(Oe.existsSync(o))return r;let s=Nt.dirname(r);if(s===r)break;r=s}return null}static loadConfigFile(t){try{return Oe.accessSync(t,Oe.constants.R_OK),Oe.readFileSync(t,{encoding:"utf8"})}catch(r){return la.warn("Config",`Config file at ${t} could not be read; using defaults`,{file:t,error:ge(Ke(r))}),null}}static loadConfig(t){let r=e.findConfigDirectory(t);if(!r)return new e;let i=Nt.join(r,Pn),n=e.loadConfigFile(i);if(n===null){let l=new e(void 0,i);return l.loadFailed=!0,l}let a,o=!1;if(n!==""){let l;try{l=JSON.parse(n)}catch(d){throw e.formatZodError(d,Pn)}let m=tR.safeParse(l);if(m.success)a=m.data;else{let d=qP.safeParse(l);a=d.success?d.data:{},o=!d.success,d.success?la.warn("Config","fjall-config.json contains keys this version does not recognise (only activeTarget, domains, capacityIdentity and organisation are read). They were most likely written by a newer fjall version \u2014 leave them in place; saves preserve them verbatim.",{file:i}):la.warn("Config","fjall-config.json has a malformed activeTarget, domains or capacityIdentity value, so its contents were ignored for this run \u2014 any capacity-identity pins it holds will NOT apply (a pinned stack deploys unpinned and is blocked by the rename gate). Fix the file by hand; do NOT regenerate it, which would discard the pins.",{file:i})}}let s=new e(a,i);return s.parseDegraded=o,s.loadedSnapshot=structuredClone(s.rootConfig),s}static formatZodError(t,r){if(t instanceof c.ZodError&&t.issues.length>0){let n=t.issues.map(a=>`${a.path.join(".")}: ${a.message}`).join("; ");return new Error(`Failed to parse ${r}: ${n}`)}let i=(t instanceof Error?t.message:String(t)).replace(/\n/g," ").substring(0,500);return new Error(`Failed to parse ${r}: ${i}`)}saveConfig(){let t=Nt.join(this.resolveProjectDirectory()??Nt.join(process.cwd(),"fjall"),Pn);if(this.loadFailed)return rn(new Error(`Refusing to save ${t}: the file exists but could not be read when this config loaded, so saving would replace its contents with state that never included them. Fix the file permissions (e.g. chmod u+rw ${t}) and retry.`));let r=Nt.dirname(t);try{Oe.mkdirSync(r,{recursive:!0})}catch(s){return rn(new Error(`Cannot create config directory ${r}: ${ge(Ke(s))}`))}let i=e.assertWritable(t,r);if(!i.success)return i;let n=this.mergeWithDisk(t);if(!n.success)return n;let a=rR(n.data),o=`${t}.tmp-${process.pid}`;try{Oe.writeFileSync(o,a,{mode:384}),Oe.renameSync(o,t)}catch(s){return rn(new Error(`Failed to save ${t}: ${ge(Ke(s))}`))}return this.configPath=t,sa(void 0)}static assertWritable(t,r){if(Oe.existsSync(t))try{Oe.accessSync(t,Oe.constants.W_OK)}catch{return rn(new Error(`Cannot save ${t}: the file is read-only. Make it writable (e.g. chmod u+w ${t}) and retry.`))}try{Oe.accessSync(r,Oe.constants.W_OK)}catch{return rn(new Error(`Cannot save ${t}: the directory ${r} is not writable. Make it writable (e.g. chmod u+w ${r}) and retry.`))}return sa(void 0)}mergeWithDisk(t){let r=e.readDiskConfigForMerge(t);if(r.kind==="unmergeable")return rn(new Error(`Refusing to save ${t}: ${r.reason}. Writing now would keep only this session's state and drop everything else the file carries (including keys written by other fjall versions). Fix or remove the file and retry.`));if(r.kind==="absent")return sa(this.rootConfig);let i=r.disk,n={...i.foreign,...i.known};for(let o of YP)o!=="domains"&&this.sessionChangedKey(o)&&(this.rootConfig[o]===void 0?delete n[o]:nR(n,this.rootConfig,o));let a=this.mergeDomains(i.known.domains);return a!==void 0?n.domains=a:delete n.domains,sa(n)}sessionChangedKey(t){return JSON.stringify(this.rootConfig[t])!==JSON.stringify(this.loadedSnapshot[t])}mergeDomains(t){let r=this.rootConfig.domains,i=this.loadedSnapshot.domains??[];if(r===void 0&&i.length===0)return t;let n=yl(d=>d.toLowerCase(),"norm"),a=r??[],o=new Map(i.map(d=>[n(d.name),d])),s=new Map(a.map(d=>[n(d.name),d])),l=[],m=new Set;for(let d of t??[]){let h=n(d.name);m.add(h);let g=s.get(h),u=o.get(h);if(g!==void 0&&!rx(g,u)){l.push(g);continue}g===void 0&&u!==void 0||l.push(d)}for(let d of a){let h=n(d.name);m.has(h)||rx(d,o.get(h))||l.push(d)}return l}static readDiskConfigForMerge(t){if(!Oe.existsSync(t))return{kind:"absent"};let r;try{let a=Oe.readFileSync(t,{encoding:"utf8"});if(a==="")return{kind:"absent"};r=JSON.parse(a)}catch(a){return{kind:"unmergeable",reason:`the existing file could not be read or parsed as JSON (${ge(Ke(a))})`}}let i=qP.safeParse(r);if(!i.success){let a=i.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`).join("; ");return{kind:"unmergeable",reason:`a recognised key in the existing file is malformed (${ge(a)})`}}let n={};if(typeof r=="object"&&r!==null){let a=YP;for(let[o,s]of Object.entries(r))a.includes(o)||(n[o]=s)}return{kind:"ok",disk:{known:i.data,foreign:n}}}static getConfigDirectory(t){return e.findConfigDirectory(t)}getConfigPath(){return this.configPath}isContentUnavailable(){return this.loadFailed||this.parseDegraded}static warnedLegacyActiveTarget=!1;localConfigCache;resolveProjectDirectory(){return this.configPath!==null?Nt.dirname(this.configPath):e.findConfigDirectory()}localConfigFile(){let t=this.resolveProjectDirectory();return t===null?null:Nt.join(t,bi,nl)}loadLocalConfig(){if(this.localConfigCache===void 0){let t=this.localConfigFile();if(t===null)return this.localConfigCache={};try{let r=Oe.readFileSync(t,{encoding:"utf8"}),i=D3.safeParse(JSON.parse(r));this.localConfigCache=i.success?i.data:{}}catch{this.localConfigCache={}}}return this.localConfigCache}writeLocalConfig(t){let r=this.localConfigFile();if(r===null)return rn(new Error("Cannot persist local state: no fjall-config.json was found from this directory, so there is no project to anchor `.fjall/local.json` to. Run this from inside a fjall project, or run `fjall create account` / `fjall create app` first."));try{Oe.mkdirSync(Nt.dirname(r),{recursive:!0});let i=`${r}.tmp-${process.pid}`;Oe.writeFileSync(i,JSON.stringify(t,null,2)+`
299
- `,{encoding:"utf8"}),Oe.renameSync(i,r),Rm(Nt.dirname(Nt.dirname(r)),[wm,...il],{header:wA,marker:mP})}catch(i){return rn(new Error(`Failed to write ${r}: ${ge(Ke(i))}`))}return this.localConfigCache=t,sa(void 0)}static warnLegacyActiveTargetOnce(){e.warnedLegacyActiveTarget||(e.warnedLegacyActiveTarget=!0,la.warn("Config","`activeTarget` in fjall-config.json is deprecated and ignored: a committed target must never re-aim a deploy or CI pipeline. Run `fjall target set <name>` to store it locally in .fjall/local.json, then remove `activeTarget` from the committed fjall-config.json."))}getActiveTarget(){let t=this.loadLocalConfig().activeTarget;if(t!==void 0)return t;this.rootConfig.activeTarget!==void 0&&e.warnLegacyActiveTargetOnce()}setActiveTarget(t){let r=this.loadLocalConfig();return r.activeTarget=t,this.writeLocalConfig(r)}clearActiveTarget(){let t=this.loadLocalConfig();return delete t.activeTarget,this.writeLocalConfig(t)}getDomains(){return this.rootConfig.domains??[]}setDomains(t){this.rootConfig.domains=t}addDomain(t){this.rootConfig.domains||(this.rootConfig.domains=[]),this.rootConfig.domains.push(t)}getDomain(t){return this.rootConfig.domains?.find(r=>r.name.toLowerCase()===t.toLowerCase())}removeDomain(t){if(!this.rootConfig.domains)return!1;let r=this.rootConfig.domains.findIndex(i=>i.name.toLowerCase()===t.toLowerCase());return r===-1?!1:(this.rootConfig.domains.splice(r,1),!0)}getOrganisation(){return this.rootConfig.organisation}setOrganisation(t){this.rootConfig.organisation=t}clearOrganisation(){delete this.rootConfig.organisation}};var I3=Object.defineProperty,Ai=(e,t)=>I3(e,"name",{value:t,configurable:!0});function nx(e){let t;try{t=Hm.loadConfig(e)}catch(i){return{kind:"unreadable",reason:ge(Ke(i))}}if(t.isContentUnavailable())return{kind:"unreadable",reason:"fjall-config.json exists but its contents could not be loaded (the preceding warning names the problem)"};let r=t.getOrganisation();return r!==void 0?{kind:"bound",bound:r}:t.getConfigPath()===null?{kind:"no_project"}:{kind:"unbound"}}Ai(nx,"readProjectBinding");function ix(e,t,r){switch(e.kind){case"unreadable":return e;case"no_project":return{kind:"unbound",projectFound:!1,identity:t};case"unbound":return{kind:"unbound",projectFound:!0,identity:t};case"bound":return t===null?{kind:"unverifiable",bound:e.bound,reason:r??"the organisation could not be resolved"}:e.bound.id===t.id?{kind:"matched",bound:e.bound}:{kind:"mismatched",bound:e.bound,actual:t}}}Ai(ix,"resolveBindingVerdict");function iR(e,t={}){return ix(nx(t.startDir),e,t.unresolvedReason)}Ai(iR,"checkProjectOrganisation");function ua(e){return e.name!==void 0&&e.name!==""?`${e.name} (${e.id})`:e.id}Ai(ua,"describeOrganisation");function aR(e,t,r){return`Refusing to ${e}: this project's fjall-config.json records organisation ${ua(t)} as its home, but the credential in use belongs to ${ua(r)}. Nothing was created, synthesised or deployed. Cure: authenticate as ${ua(t)} ('fjall login', or set FJALL_API_KEY to a key for that organisation), or \u2014 if this project really is moving \u2014 run 'fjall org bind --org ${r.id} --force' to re-bind it.`}Ai(aR,"buildWrongOrganisationMessage");function oR(e,t){return`Refusing to ${e}: ${t}, so this project's organisation binding cannot be checked. Nothing was created, synthesised or deployed. Cure: fix fjall-config.json (permissions or contents), then re-run.`}Ai(oR,"buildUnreadableConfigMessage");function sR(e,t){return`Could not confirm which organisation your credential belongs to (${t}). Proceeding \u2014 this project is bound to ${ua(e)}, and a mismatch would not have been caught.`}Ai(sR,"buildUnverifiableNotice");function cR(e){return`This project is not bound to an organisation. Run 'fjall org bind' to pin it to ${ua(e)} \u2014 afterwards, any command run here with another organisation's credential is refused instead of silently landing there.`}Ai(cR,"buildUnboundNotice");import{createHash as w3}from"node:crypto";var k3=Object.defineProperty,N3=(e,t)=>k3(e,"name",{value:t,configurable:!0});function lR(e,t){return w3("sha256").update(`${e}${t}`).digest("hex")}N3(lR,"credentialFingerprint");import*as Xm from"node:fs";var P3=Object.defineProperty,Jm=(e,t)=>P3(e,"name",{value:t,configurable:!0}),uR="org-config-cache.json";function ax(){return Uo(uR)}Jm(ax,"orgConfigCachePath");function ox(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}Jm(ox,"isObject");function sx(e){return ox(e)&&typeof e.organisationId=="string"&&e.organisationId!==""&&typeof e.organisationName=="string"}Jm(sx,"isCachedCredentialIdentity");function dR(e){try{let t=ax();if(!Xm.existsSync(t))return null;let r=JSON.parse(Xm.readFileSync(t,"utf-8"));return!ox(r)||r.credentialFingerprint!==e?null:sx(r.identity)?r.identity:null}catch(t){return la.debug("cachedCredentialIdentity","Cache read failed, treating as a miss",{error:ge(Ke(t))}),null}}Jm(dR,"readCachedCredentialIdentity");var R3=Object.defineProperty,O3=(e,t)=>R3(e,"name",{value:t,configurable:!0}),pR="https://fjall.io";function qm(){let e=process.env.FJALL_API_URL;return e!==void 0&&e!==""?e:pR}O3(qm,"resolveApiBaseUrl");var mR={name:"@fjall/cli",version:"27.0.0",repository:{type:"git",url:"git+https://github.com/fjall-tech/fjall.git",directory:"cli"},description:"Fjall CLI helper",private:!0,type:"module",bin:{fjall:"dist/src/cli.js"},files:["dist/"],scripts:{clean:"rm -rf ./dist ./dist.next ./sourcemaps","clean:node":"rm -rf ./node_modules","copy-files":'DEST="${DEST:-dist}"; find generators -type d -name files | while read dir; do mkdir -p "$DEST/$dir" && cp -R "$dir/." "$DEST/$dir/"; done && cp -R src/proto "./$DEST/src/proto"',build:"rm -rf ./dist.next ./sourcemaps && npx tsc --outDir dist.next && DEST=dist.next npm run copy-files && node ../scripts/minify-dist.mjs dist.next && chmod +x ./dist.next/src/cli.js && rm -rf ./dist && mv ./dist.next ./dist && node ../scripts/stamp-build.mjs",watch:"npm run build && npx tsc-watch","watch:only":'npx tsc-watch --onSuccess "npm run copy-files"',"fjall-cli":"node ./dist/src/cli.js",version:"npx tsx scripts/updateTemplateVersions.ts && node ../scripts/sync-ci-plugin-major.mjs",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',"format:check":'prettier --check "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',lint:"eslint src/ generators/","lint:fix":"eslint src/ generators/ --fix",typecheck:"tsc --noEmit","typecheck:tests":"tsc --noEmit --project tsconfig.test.json","typecheck:scripts":"tsc --noEmit --project tsconfig.scripts.json","typecheck:all":"npm run typecheck && npm run typecheck:tests && npm run typecheck:scripts",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:integration":"vitest run --config vitest.config.integration.ts","test:integration:watch":"vitest --config vitest.config.integration.ts","test:e2e":"vitest run --config vitest.e2e.config.ts","test:all":"npm run test && npm run test:integration && npm run test:e2e","test:setup":"node scripts/setupTestFixtures.mjs","test:payload-compat":"npx tsx scripts/testPayloadCompatibility.ts","test:payload-compat:e2e":"npx tsx scripts/testPayloadCompatibility.ts --e2e"},engines:{node:">=22.0.0"},author:"",license:"SEE LICENSE IN LICENSE",devDependencies:{"@eslint/js":"^10.0.1","@playwright/test":"^1.62.0","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/ejs":"^3.1.5","@types/prompts":"^2.4.9","@types/proper-lockfile":"^4.1.4","@types/react":"^19.2.17","@typescript-eslint/parser":"^8.65.0","@vitest/coverage-v8":"^4.1.10","aws-cdk-lib":"^2.265.0",constructs:"^10.7.2",eslint:"^10.8.0","ink-testing-library":"^4.0.0",jsdom:"^30.0.1",prettier:"^3.9.6","react-dom":"^19.2.8","strip-ansi":"^6.0.1","tsc-watch":"^7.2.1",tsx:"^4.23.1","typescript-eslint":"^8.65.0",vitest:"4.1.10"},dependencies:{"@anthropic-ai/sdk":"^0.115.0","@aws-sdk/client-acm":"^3.1098.0","@aws-sdk/client-auto-scaling":"^3.1098.0","@aws-sdk/client-backup":"^3.1098.0","@aws-sdk/client-cloudformation":"^3.1098.0","@aws-sdk/client-cost-explorer":"^3.1098.0","@aws-sdk/client-ec2":"^3.1098.0","@aws-sdk/client-ecr":"^3.1098.0","@aws-sdk/client-ecs":"^3.1098.0","@aws-sdk/client-elasticache":"^3.1098.0","@aws-sdk/client-iam":"^3.1098.0","@aws-sdk/client-identitystore":"^3.1098.0","@aws-sdk/client-lambda":"^3.1098.0","@aws-sdk/client-organizations":"^3.1098.0","@aws-sdk/client-ram":"^3.1098.0","@aws-sdk/client-rds":"^3.1098.0","@aws-sdk/client-route-53":"^3.1098.0","@aws-sdk/client-s3":"^3.1098.0","@aws-sdk/client-secrets-manager":"^3.1098.0","@aws-sdk/client-ssm":"^3.1098.0","@aws-sdk/client-sso":"^3.1098.0","@aws-sdk/client-sso-admin":"^3.1098.0","@aws-sdk/client-sso-oidc":"^3.1098.0","@aws-sdk/client-sts":"^3.1098.0","@fjall/deploy-core":"^27.0.0","@fjall/generator":"^27.0.0","@fjall/util":"^27.0.0","@nx/devkit":"^23.1.0","@opennextjs/aws":"^4.1.0","@smithy/node-http-handler":"^4.9.13","@toon-format/toon":"^4.1.0","aws-cdk":"^2.1134.0",axios:"^1.19.0",chalk:"^6.0.0","cli-cursor":"^5.0.0",commander:"^15.0.0",ejs:"^6.0.1",ink:"^7.1.1","js-yaml":"^5.2.2",open:"^11.0.0",ora:"^9.4.1",prompts:"^2.4.2","proper-lockfile":"^4.1.2",protobufjs:"^8.7.1",react:"^19.2.8",typescript:"^6.0.3","update-check":"^1.5.4",zod:"^4.4.3"}};var j3=Object.defineProperty,M3=(e,t)=>j3(e,"name",{value:t,configurable:!0}),wae=`fjall-cli/${mR.version} node/${process.versions.node} ${L3()}/${F3()}`;var fR=qm(),Pae=c.looseObject({deviceCode:c.string(),userCode:c.string(),verificationUri:c.string(),expiresIn:c.number(),interval:c.number()}),Rae=c.looseObject({status:c.string(),apiKey:c.string().optional(),organisationId:c.string().optional(),organisationName:c.string().optional(),email:c.string().optional()}),Oae=c.looseObject({application:c.looseObject({id:c.string()})}),cx=c.looseObject({id:c.string(),name:c.string(),vpcCidr:c.string().nullable(),connectedAwsAccountId:c.string().nullable()}),$ae=c.looseObject({applications:c.array(cx),nextCursor:c.string().optional()}),jae=c.looseObject({application:cx}),Mae=c.looseObject({applications:c.array(cx)}),Lae=c.looseObject({application:c.looseObject({id:c.string(),name:c.string()})}),Fae=c.looseObject({primaryRegion:c.string().nullish(),secondaryRegions:c.array(c.string()).optional(),disasterRecoveryRegion:c.string().nullish(),providerAccounts:c.custom(e=>Array.isArray(e)),ssoSessions:c.record(c.string(),c.looseObject({ssoRegion:c.string(),ssoStartUrl:c.string()})).optional(),rootOidcRoleArn:c.string().nullish(),allowCodemodLlmFallback:c.boolean().optional(),rootAccessManagement:c.custom(e=>typeof e=="string").optional(),requireTrackedDeploys:c.boolean().optional().catch(void 0)}),Uae=c.looseObject({id:c.string(),token:c.string(),tokenPrefix:c.string(),name:c.string(),scopes:c.array(c.string())}),U3=c.looseObject({id:c.string(),name:c.string(),tokenPrefix:c.string(),scopes:c.array(c.string()),resourceConstraints:c.record(c.string(),c.unknown()),sourceTag:c.string().nullable(),expiresAt:c.string(),createdAt:c.string(),revokedAt:c.string().nullable(),revokedReason:c.string().nullable(),lastUsedAt:c.string().nullable(),usageCount:c.number(),deniedCount:c.number()}),zae=c.looseObject({tokens:c.array(U3)}),Bae=c.looseObject({scopes:c.array(c.string()),expiresAt:c.string().optional()}),z3=c.looseObject({id:c.string(),awsAccountId:c.string(),accountName:c.string().nullable(),environment:c.string().nullable()}),Gae=c.looseObject({accounts:c.array(z3)}),B3=c.looseObject({id:c.string(),assetIdentifier:c.string(),name:c.string(),type:c.string(),status:c.string(),region:c.string().nullish(),_count:c.looseObject({complianceIssues:c.number()}).optional()}),G3=c.looseObject({id:c.string(),name:c.string(),assetIdentifier:c.string(),provider:c.string(),type:c.string(),status:c.string(),region:c.string().nullish(),iacStatus:c.string().nullish(),accountId:c.string().nullish(),estimatedMonthlyCost:c.string().nullish(),lastSeenAt:c.string().nullish(),createdAt:c.string().nullish(),updatedAt:c.string().nullish()}),Vae=c.looseObject({assets:c.array(B3),nextCursor:c.string().optional()}),Wae=c.looseObject({asset:G3}),V3=c.looseObject({id:c.string(),ruleId:c.string(),title:c.string(),severity:c.string(),status:c.string()}),Kae=c.looseObject({issues:c.array(V3)}),Zae=c.record(c.string(),c.unknown()),Hae=c.union([c.array(c.record(c.string(),c.unknown())),c.record(c.string(),c.unknown())]),Jae=c.record(c.string(),c.unknown()),Xae=c.record(c.string(),c.unknown()),qae=c.record(c.string(),c.unknown()),Yae=c.record(c.string(),c.unknown()),Qae=c.looseObject({deployment:c.looseObject({id:c.string()}),minCliVersion:c.string().optional()});var W3=c.object({id:c.string(),releaseNumber:c.number().int(),status:c.string(),commitSha:c.string().nullable(),branch:c.string().nullable(),createdAt:c.string(),assemblyDigest:c.string().nullable(),createdByDeploymentId:c.string().nullable(),rollbackOfReleaseId:c.string().nullable(),services:c.array(Cm.strip())}),eoe=c.object({releases:c.array(W3),currentReleaseId:c.string().nullable(),nextCursor:c.number().int().optional()}),K3=c.object({id:c.string(),status:c.string(),target:c.string().nullish(),applicationId:c.string().nullish(),applicationName:c.string().nullish(),connectedAwsAccountId:c.string().nullish(),source:c.string().nullish(),startedAt:c.string().nullish(),triggeredByName:c.string().nullish(),machineLabel:c.string().nullish()}),toe=c.object({deployments:c.array(K3)}),roe=c.object({cancelled:c.boolean(),message:c.string().nullish(),declined:c.boolean().nullish()}),noe=c.object({released:c.literal(!0),id:c.string().nullish()}),ioe=c.looseObject({organisationId:c.string(),organisationName:c.string(),organisationSlug:c.string().min(1).optional()}),aoe=c.looseObject({status:c.string(),roleArn:c.string().optional(),accountId:c.string().optional(),phase:c.string().optional(),reason:c.string().optional()}),ooe=c.looseObject({token:c.string()}),Z3=c.looseObject({quickCreateUrl:c.string(),externalId:c.string()}),H3=c.looseObject({alreadyConnected:c.literal(!0),account:c.looseObject({awsAccountId:c.string(),accountName:c.string().nullable(),status:c.string()})}),soe=c.union([H3,Z3]);function J3(e){return"alreadyConnected"in e&&e.alreadyConnected===!0}M3(J3,"isAlreadyConnected");var coe=c.looseObject({registered:c.boolean(),repository:c.looseObject({id:c.string()}).optional()});var X3=Object.defineProperty,q3=(e,t)=>X3(e,"name",{value:t,configurable:!0});function vl(e=fR){return`Deploy tokens are minted from a signed-in browser session by an owner or admin: open ${e}/settings/ci (Settings \u2192 CI/CD Tokens).`}q3(vl,"deployTokenMintGuidance");var hR=[{command:"ci status",match:k.success,templates:["Run `fjall ci verify` to check the rest of the wiring \u2014 an active deploy token is necessary, not sufficient","Run `fjall ci token list` to see which applications, environments and accounts each active token may deploy to"]},{command:"ci status",match:k.empty,templates:[vl(),"Run `fjall ci setup --plan --app <app>` to learn where the workflow file will go and which secret name it will read (`workflowPath`, `secretName`) \u2014 the two things needed to stage the secret before minting. `--plan` mints nothing and writes nothing, and the workflow BODY is printed on the human surface only: it is not a field of the agent payload"]},{command:"ci token list",match:k.success,templates:["Run `fjall token show <id>` to inspect one token's stored constraints","Run `fjall ci token revoke <id> --reason <text>` to revoke a listed token"]},{command:"ci token list",match:k.empty,templates:[vl(),"Run `fjall ci status` to re-check readiness once a token exists"]},{command:"ci token revoke",match:k.success,templates:["Run `fjall ci token list` to confirm the token now lists as revoked \u2014 a revoked token stays listed, it does not disappear",`Any CI job still holding this token now fails to authenticate. ${vl()}`]}];var Ym="Do not retry or vary flags: `supported: false` is the server's capability verdict, not an input error \u2014 every invocation answers the same until the Fjall server is updated to a version that ships this API (the `message` field names the upgrade)",gR=[{command:"deployments list",match:k.unsupported,templates:[Ym]},{command:"deployments cancel",match:k.unsupported,templates:[Ym]},{command:"deployments force-release",match:k.unsupported,templates:[Ym]},{command:"dev list",match:k.unsupported,templates:[Ym]},{command:"deployments list",match:k.success,templates:["Run `fjall deployments cancel <id>` to request co-operative cancellation of a listed deployment","Run `fjall deploy logs --deployment-id <id>` to read one deployment's logs"]},{command:"deployments cancel",match:k.success,templates:["Run `fjall deployments list` to confirm whether the slot is free, and read `cancelled` and `declined` before assuming it is: `cancelled: false` means the request was refused, `declined: true` is an already-terminal reject, and a plain granted cancel is co-operative \u2014 the deployment has to acknowledge it","Run `fjall deployments force-release <id> --confirm <id>` to clear a slot that stays occupied (organisation admin, audited \u2014 retype the id in `--confirm`)"]},{command:"deployments force-release",match:k.success,templates:["Run `fjall deployments list` to confirm the slot is free","Run `fjall deploy <app>` to retry the deployment the wedged slot was blocking"]},{command:"dev up",match:k.success,templates:["Run `fjall dev list <app>` to see every slot for this app with its `host` \u2014 rows carry `host`, not a full URL, and it is empty until the slot leaves `creating`","Run `fjall dev down <app> --branch <branch>` to tear this slot down"]},{command:"dev list",match:k.success,templates:["Run `fjall dev down <app> --branch <branch>` to tear one listed slot down \u2014 every row carries the `branch` to name here","Run `fjall dev up <app> --branch <branch>` to bring another branch up"]},{command:"dev down",match:k.success,templates:["Run `fjall dev list <app>` to see which slots remain","Run `fjall dev up <app> --branch <branch>` to bring the branch back up"]},{command:"dev substrate down",match:k.success,templates:["Run `fjall dev list <app>` to confirm no slot survives \u2014 the substrate will not tear down under live slots, and `--force` takes them with it","Any `residuals` row survives the teardown and can still cost: its `cleanupHint` names the manual step"]}];var yR=["Run `fjall domain deploy <name>` to deploy the domain","Run `fjall domain verify <name>` to check DNS delegation once it is deployed","Run `fjall domain export <name>` to export the live zone records"],vR=[{command:"org deploy",match:k.success,templates:["Run `fjall org get` to review the deployed organisation topology and accounts",`Run \`${te.accountDeploy}\` to deploy the account tier if you passed \`--no-cascade\``,`Run \`${te.createApplicationAgent} --name "<name>"\` to create an application to deploy into it`]},{command:"org deploy",match:k.error,templates:["Run `fjall org get` to see which tier of the cascade is already deployed",`Run \`${te.organisationDeploy} --no-cascade\` to retry the organisation stack alone`]},{command:"platform deploy",match:k.success,templates:[`Run \`${te.accountDeploy}\` to deploy the account tier on top of it`]},{command:"platform deploy",match:k.error,templates:["Run `fjall org get` to check the organisation tier is deployed first"]},{command:"account deploy",match:k.success,templates:["Run `fjall apps list` to see which applications are registered","Run `fjall deploy <application>` to deploy one into this account"]},{command:"account deploy",match:k.error,templates:["Run `fjall org get` to confirm the account is registered in the organisation",`Run \`${te.accountDeploy} --target <target>\` to select a specific member account`]},{command:"domain list",match:k.success,templates:["Run `fjall domain verify <name>` to check DNS delegation","Run `fjall domain export <name>` to export zone file","Run `fjall create domain --name <name>` to create a new domain"]},{command:"domain list",match:k.empty,templates:['Run `fjall create domain --name "<name>"` to create a domain',"Run `fjall domain import <name>` to import from Route53"]},{command:"domain verify",match:k.success,templates:["Run `fjall domain export <name>` to export zone file","Run `fjall domain deploy <name>` to deploy domain infrastructure"]},{command:"domain verify",match:k.error,templates:["Run `fjall domain verify <name>` to retry","Run `fjall domain list` to see existing domains"]},{command:"domain export",match:k.success,templates:["Run `fjall domain verify <name>` to check delegation","Run `fjall domain import <name>` to re-import from Route53"]},{command:"domain import",match:k.success,templates:["Run `fjall domain verify <name>` to check delegation","Run `fjall domain export <name>` to see the zone file","Run `fjall domain deploy <name>` to deploy domain infrastructure"]},{command:"domain import",match:k.error,templates:["Run `fjall domain import --hosted-zone-id <id>` to import by zone ID","Run `fjall domain list` to see existing domains"]},{command:"domain records list",match:k.success,templates:["Run `fjall domain sync <domain>` for the full zone-hygiene report","Run `fjall domain sync <domain> --fix` to remediate residue records via the destruction ceremony"]},{command:"domain records list",match:k.empty,templates:["Run `fjall domain deploy <domain>` to deploy the domain's declared records","Run `fjall domain list` to see existing domains"]},{command:"domain records list",match:k.error,templates:["Run `fjall domain records list <domain> --hosted-zone-id <id>` when the zone is not resolvable by name",`Run \`${te.connect}\` if AWS credentials are missing`]},{command:"domain sync",match:k.success,templates:["Run `fjall domain sync <domain> --fix` to remediate residue records (ceremony-gated)","Run `fjall domain records list <domain>` to see every record with its owner"]},{command:"domain sync",match:k.error,templates:["Run `fjall domain sync <domain> --hosted-zone-id <id>` when the zone is not resolvable by name","Run `fjall domain list` to see existing domains"]},{command:"domain delegate",match:k.success,templates:["Run `fjall domain verify <domain>` to confirm public DNS resolution","Run `fjall domain deploy <domain>` to continue a two-phase deploy after delegation"]},{command:"domain delegate",match:k.error,templates:["Run `fjall domain deploy <parent-domain>` so the parent publishes its DelegationRole","Run `fjall domain verify <domain> --show-delegation` for registrar instructions"]},{command:"domain destroy",match:k.success,templates:["Run `fjall domain list` to see remaining domains","Run `fjall domain sync <parent-domain>` to confirm no delegation residue remains"]},{command:"domain destroy",match:k.error,templates:["Run `fjall domain destroy <domain> --remediate '<name>'=recreate` with the exact consent the ticket names","Run `fjall domain list` to see existing domains"]},{command:"domain deploy",match:k.success,templates:["Run `fjall domain verify <domain>` to check DNS propagation","Run `fjall domain delegate <domain>` to write the NS delegation for a delegated child"]},{command:"domain deploy",match:k.error,templates:["Run `fjall domain deploy <domain>` to resume \u2014 the zone phase is retained and skipped on re-run","Run `fjall domain verify <domain> --show-delegation` for registrar delegation instructions"]},{command:"domain eject",match:k.success,templates:["Review the ejected infrastructure.ts \u2014 it is now vanilla CDK owned by you","Run `fjall domain list` to see remaining managed domains"]},{command:"create domain",match:k.success,templates:yR},{command:"domain create",match:k.success,templates:yR},{command:"create domain",match:k.error,templates:["Run `fjall domain list` to see existing domains",'Run `fjall create domain --name "<name>"` to retry with a different name']},{command:"create account",match:k.success,templates:[`Run \`${te.connect} --environment production\` to link your AWS account`,`Run \`${te.accountDeploy}\` to deploy account infrastructure (after connecting)`]},{command:"create account",match:k.error,templates:[`Run \`${te.createAccount} --primary-region <region>\` to retry`,`Run \`${te.createAccount} --help\` for usage information`]},{command:"create org",match:k.success,templates:[`Run \`${te.connect} --name "<account-name>" --region <region>\` to link the AWS Organizations management account \u2014 omit \`--environment\` so it registers at the organisation tier`,`Run \`${te.organisationDeploy}\` to deploy all infrastructure (after connecting)`]},{command:"create org",match:k.error,templates:[`Run \`${te.createOrganisation} --email "<email>"\` to retry (add \`--name "<name>"\` only for a brand-new organisation)`,`Run \`${te.createOrganisation} --help\` for all options`]},{command:"restore",match:k.successDryRun,templates:["Run `fjall restore <resourceType> --recovery-point <recoveryPointArn> --yes` to initiate restore","Run `fjall apps list` to see existing applications"]},{command:"restore",match:k.success,templates:["Open the AWS Console URL above to monitor restore progress","Run `fjall import` to import the restored resource after completion"]},{command:"restore",match:k.errorWithCode("NOT_FOUND"),templates:["Verify the recovery point ARN is correct and exists in the current region","Run `fjall restore <resourceType> --recovery-point <arn>` to retry"]},{command:"restore",match:k.errorWithCode("FORBIDDEN"),templates:["Ensure the IAM role has backup:StartRestoreJob and iam:PassRole permissions","Run `fjall restore` interactively to configure with guided setup"]},{command:"import",match:k.successDryRun,templates:["Run `fjall import --app <app> --resource-id <resourceId> --yes` to import a specific resource","Run `fjall import --app <app> --yes` to import all discovered resources"]},{command:"import",match:k.success,templates:["Run `fjall deploy <app>` to deploy with the imported resource","Run `fjall apps describe <app>` to see updated resources"]},{command:"import",match:k.errorWithCode("NOT_FOUND"),templates:[`Run \`${te.createApplicationAgent} --name "<app>"\` to create the application`,"Run `fjall apps list` to see existing applications"]},{command:"import",match:k.errorWithCode("VALIDATION_ERROR"),templates:["Run `fjall import --app <app> --resource-id <resourceId>` to import a specific resource","Run `fjall import --app <app> --resource-id <resourceId> --yes` to import immediately"]},{command:"aws exec",match:k.success,templates:["Run `fjall aws exec -- <command...>` to run another AWS CLI command","Run `fjall status` to check application health"]},{command:"aws exec",match:k.error,templates:["Retry the command \u2014 OIDC token mints can fail transiently",`Run \`${te.login}\` if the retry also fails with an authentication error`]},{command:"unlock bucket",match:k.success,templates:["Re-put sane bucket policy statements (enforceSSL deny, access grants) \u2014 the unlock deleted the ENTIRE policy","Run `fjall destroy <app>` to retry the blocked stack cleanup"]},{command:"unlock bucket",match:k.error,templates:["Ensure your credentials belong to the organisation's management account \u2014 STS AssumeRoot is rejected elsewhere","Run `fjall unlock bucket <name> --account <id> --acknowledge-root-session` to retry"]}];var Y3=Object.defineProperty,AR=(e,t)=>Y3(e,"name",{value:t,configurable:!0}),bR="Run `fjall connect status` to check that an AWS account is connected: asset discovery only inventories connected accounts, so an organisation with none has nothing to inventory",SR=["Run `fjall assets show <asset>` to read one asset in full \u2014 pass its `assetIdentifier`","Run `fjall assets compliance <asset>` to list an asset's recorded posture issues \u2014 pass its `assetIdentifier`, the address every server version accepts"],ER=AR(e=>e.outcome==="success"&&e.nextCursor!==void 0,"isTruncatedPage"),xR=[{command:"assets list",match:AR(e=>ER(e)&&e.fields!==void 0&&e.fields!=="","match"),templates:["This window is truncated \u2014 more assets exist beyond these rows. Run `fjall assets list --cursor <nextCursor> --fields <fields>` to fetch the next page with the same projection; `total` counts this window only, and `fjall assets summary` reports the estate-wide tally, split active/deleted",...SR]},{command:"assets list",match:ER,templates:["This window is truncated \u2014 more assets exist beyond these rows. Run `fjall assets list --cursor <nextCursor>` to fetch the next page; `total` counts this window only, and `fjall assets summary` reports the estate-wide tally, split active/deleted",...SR]},{command:"assets list",match:k.success,templates:["The `total` aggregate counts the rows in this response, not the estate: `--take` bounds the window (default 50). No `nextCursor` aggregate here means the estate ends with these rows; `fjall assets summary` reports the estate-wide tally, split active/deleted","Run `fjall assets show <asset>` to read one asset in full","Run `fjall assets compliance <asset>` to list an asset's recorded posture issues \u2014 pass its `assetIdentifier`, the address every server version accepts (row `id`s are only accepted by newer servers)"]},{command:"assets list",match:k.empty,templates:["Run `fjall assets list --status deleted` to include assets discovery has since marked deleted \u2014 the default listing hides them",bR]},{command:"assets show",match:k.success,templates:["Run `fjall assets compliance <asset>` to list the posture issues recorded against this asset","Run `fjall assets show <asset> --fields id,accountId,iacStatus,estimatedMonthlyCost,lastSeenAt` to read the fields the default projection omits"]},{command:"assets compliance",match:k.success,templates:["Read the `status` column before acting: this listing returns every issue recorded against the asset, `resolved` and `suppressed` included, where the `openIssues` count on `fjall assets list` counts only the open ones","Run `fjall compliance fix --domain compliance --issue-id <issueId>` to read this issue in full alongside the organisation's other open issues. `--domain` is the producer's category \u2014 one of `compliance`, `cost`, `performance` \u2014 not a framework name, and the response is context to reason from, not a remediation step: use `--execute` to run one","Run `fjall assets show <asset>` to read the asset these issues were raised against"]},{command:"assets compliance",match:k.empty,templates:["No issue of ANY status has been recorded against this asset \u2014 an empty listing here is not the same as issues that were resolved, which would still appear with `status: resolved`","Run `fjall assets list --fields name,assetIdentifier,openIssues` to find the assets that do carry open issues"]},{command:"assets summary",match:k.success,templates:["Run `fjall assets list --fields name,assetIdentifier,openIssues` to see which assets sit behind `withIssues` \u2014 `withIssues` counts the assets carrying at least one open issue, `openIssues` counts those issues per asset","Run `fjall assets list --take <n>` to read the rows behind these totals \u2014 page onwards with `--cursor` when the listing reports a `nextCursor`, and pass `--status deleted` to include the `deleted` rows in the listing (interleaved with active \u2014 read the `status` column). These totals are estate-wide (the summary pages the listing to exhaustion, deleted assets included): `total` counts the whole estate, `active` and `deleted` split it"]},{command:"assets summary",match:k.empty,templates:[bR]},{command:"costs show",match:k.success,templates:["Run `fjall costs --mode forecast` to see forecasted spend","Run `fjall costs --mode breakdown` to see service-level breakdown"]},{command:"costs show",match:k.error,templates:["Run `fjall costs --app <app>` to filter by application","Run `fjall costs --help` for usage information"]},{command:"metrics show",match:k.success,templates:["Run `fjall metrics --mode latency` to see latency percentiles","Run `fjall metrics --mode errors` to see error trends"]},{command:"metrics show",match:k.error,templates:["Run `fjall metrics --app <app>` to filter by application","Run `fjall metrics --help` for usage information"]},{command:"compliance fix",match:k.success,templates:["Run `fjall compliance fix --domain <domain> --issue-id <id>` to narrow the suggestions to one issue","Run `fjall deploy <app>` to apply remediation changes"]},{command:"compliance fix",match:k.error,templates:["Run `fjall compliance fix --domain <domain>` to name the compliance domain","Run `fjall compliance --help` for usage information"]},{command:"compliance fix --execute",match:k.success,templates:["Read the result's `kind` before treating the issue as fixed: `auto-pr` opened a pull request that still has to be merged, `imperative` rewrote the live policy, and `manual-hint` changed nothing \u2014 its `awsCliHint` carries the manual step, and that field is absent for rules that supply no hint (`message` is a fixed string either way)","Do not re-read the issue to confirm the cure: nothing on the remediation path writes to the issue record, so `status` stays `open` until the next discovery scan re-evaluates the asset. Verify at the thing that changed \u2014 the pull request, or the live resource","Run `fjall deploy <app>` to roll out an `auto-pr` remediation once its pull request is merged"]},{command:"deploy diff",match:k.success,templates:["Run `fjall deploy logs --deployment-id <id>` to analyse deployment logs","Run `fjall status <app>` to check current deployment health"]},{command:"deploy diff",match:k.error,templates:["Run `fjall list deployments` to see recent deployment IDs","Run `fjall deploy diff --help` for usage information"]},{command:"deploy logs",match:k.success,templates:["Run `fjall deploy diff <idA> <idB>` to compare two deployments","Run `fjall status <app>` to check current deployment health"]},{command:"deploy logs",match:k.error,templates:["Run `fjall deploy logs --deployment-id <id>` with a valid deployment ID","Run `fjall list deployments` to find a deployment ID"]}];var Q3={command:"*",match:k.error,templates:["Run `fjall <command> --help` for usage information"]},_R=[...KP,...ZP,...JP,...hR,...gR,...vR,...xR,Q3];var eW=Object.defineProperty,tW=(e,t)=>eW(e,"name",{value:t,configurable:!0}),TR=["app","environment","region","profile","target","cluster","service","lambda","status","type"],da=["app","cluster","service","lambda"],rW=["status","type","region"],lx={deploy:["environment","region","target"],"deploy diff":[],"deploy logs":[],destroy:["target"],"org deploy":["target"],"org destroy":["target"],"platform deploy":["target"],"platform destroy":["target"],"account deploy":["target"],"account destroy":["target"],status:[],rollout:[],list:["app"],apps:["target"],connect:["environment","region"],"connect status":[],import:["app","region"],costs:["app"],metrics:["app"],compliance:["app"],"token create":["app","environment"],"unlock bucket":["region"],"aws exec":["app","region","target"],"secrets set":da,"secrets get":da,"secrets list":da,"secrets delete":da,"secrets export":da,"secrets import":da,"secrets exec":da,"assets list":rW},nW=Math.max(...Object.keys(lx).map(e=>e.split(" ").length));function ux(e){let t=e.trim().split(/\s+/).slice(1);for(let r=nW;r>=1;r--){let i=t.slice(0,r).join(" ");if(Object.hasOwn(lx,i))return lx[i]}return[]}tW(ux,"resolvePreservableFlags");var iW=Object.defineProperty,ef=(e,t)=>iW(e,"name",{value:t,configurable:!0});function dx(e){let t=e.replace(/[\u0000-\u001f\u007f`]/g,"");return/[^\w@%+=:,./-]/.test(t)?`'${t.replace(/'/g,"'\\''")}'`:t}ef(dx,"shellEscape");function CR(e,t,r){let i=new Set,n=e.replace(/<(\w+)>/g,(a,o)=>{let s=t[o];return s===void 0||s===""?`<${o}>`:(i.add(o),o==="command"?s:dx(s))});return DR(n,r,i)}ef(CR,"interpolateTemplate");var Qm=class{static{ef(this,"SuggestionResolver")}command;flags;constructor(t,r){this.command=t,this.flags=r}resolve(t){let r=_R.find(i=>(i.command===this.command||i.command==="*")&&i.match(t));return r===void 0?[]:r.templates.map(i=>CR(i,t,this.flags))}};function DR(e,t,r=new Set){let i=/`(fjall[^`]*)`/.exec(e),n=i?.[1];if(i===null||n===void 0)return e;let a=ux(n),o=[];for(let d of TR){if(!a.includes(d))continue;let h=t[d];h!==void 0&&h!==""&&!r.has(d)&&!n.includes(`--${d}`)&&o.push(`--${d} ${dx(h)}`)}if(o.length===0)return e;let s=` ${o.join(" ")}`,l=n.indexOf(" -- "),m=l===-1?`${n}${s}`:`${n.slice(0,l)}${s}${n.slice(l)}`;return e.slice(0,i.index)+`\`${m}\``+e.slice(i.index+i[0].length)}ef(DR,"applyPreservedFlags");var aW=Object.defineProperty,Ln=(e,t)=>aW(e,"name",{value:t,configurable:!0});function nn(e,t){if(t!==void 0&&Yo(e)){let i={};for(let[n,a]of Object.entries(e))i[n]=t.has(n)?a:nn(a);return i}if(typeof e=="string")return ge(e);if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(i=>nn(i));if(e instanceof Date||e instanceof RegExp)return e;let r={};for(let[i,n]of Object.entries(e))r[i]=nn(n);return r}Ln(nn,"maskTree");function tf(e){if(Array.isArray(e))return e.map(tf);if(!Yo(e))return e;let t={};for(let[r,i]of Object.entries(e))i!==void 0&&(t[r]=tf(i));return t}Ln(tf,"stripAbsent");function Yo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof Date)&&!(e instanceof RegExp)}Ln(Yo,"isPlainRecord");function IR(e){let t=e?.verbatimFields;return t!==void 0&&t.length>0?new Set(t):void 0}Ln(IR,"toVerbatimKeys");function kR(e,t){return t===void 0||!Yo(e)?!1:Object.keys(e).some(r=>t.has(r))}Ln(kR,"carriesVerbatimField");function NR(e,t){let r=e;for(let i of t.split(".")){if(!Yo(r))return;r=r[i]}return r}Ln(NR,"resolveDotPath");function wR(e,t,r){let i=e.project(t),n={};for(let a of r)a in i&&(n[a]=i[a]);return n}Ln(wR,"projectSelectedFields");var bl=class{static{Ln(this,"AgentOutputWriter")}write;hasWrittenBlock=!1;resolver;flags;full;budget;requestedFields;constructor(t){this.write=t.writeFn??(r=>{process.stdout.write(r)}),this.resolver=new Qm(t.command,t.flags),this.flags=t.flags,this.full=t.full??!1,this.budget=t.budget,this.requestedFields=t.fields??[]}get isFullOutput(){return this.full}writeBlock(t){t!==""&&(this.hasWrittenBlock&&this.write(FA+`
299
+ `,{encoding:"utf8"}),Oe.renameSync(i,r),Rm(Nt.dirname(Nt.dirname(r)),[wm,...il],{header:wA,marker:mP})}catch(i){return rn(new Error(`Failed to write ${r}: ${ge(Ke(i))}`))}return this.localConfigCache=t,sa(void 0)}static warnLegacyActiveTargetOnce(){e.warnedLegacyActiveTarget||(e.warnedLegacyActiveTarget=!0,la.warn("Config","`activeTarget` in fjall-config.json is deprecated and ignored: a committed target must never re-aim a deploy or CI pipeline. Run `fjall target set <name>` to store it locally in .fjall/local.json, then remove `activeTarget` from the committed fjall-config.json."))}getActiveTarget(){let t=this.loadLocalConfig().activeTarget;if(t!==void 0)return t;this.rootConfig.activeTarget!==void 0&&e.warnLegacyActiveTargetOnce()}setActiveTarget(t){let r=this.loadLocalConfig();return r.activeTarget=t,this.writeLocalConfig(r)}clearActiveTarget(){let t=this.loadLocalConfig();return delete t.activeTarget,this.writeLocalConfig(t)}getDomains(){return this.rootConfig.domains??[]}setDomains(t){this.rootConfig.domains=t}addDomain(t){this.rootConfig.domains||(this.rootConfig.domains=[]),this.rootConfig.domains.push(t)}getDomain(t){return this.rootConfig.domains?.find(r=>r.name.toLowerCase()===t.toLowerCase())}removeDomain(t){if(!this.rootConfig.domains)return!1;let r=this.rootConfig.domains.findIndex(i=>i.name.toLowerCase()===t.toLowerCase());return r===-1?!1:(this.rootConfig.domains.splice(r,1),!0)}getOrganisation(){return this.rootConfig.organisation}setOrganisation(t){this.rootConfig.organisation=t}clearOrganisation(){delete this.rootConfig.organisation}};var I3=Object.defineProperty,Ai=(e,t)=>I3(e,"name",{value:t,configurable:!0});function nx(e){let t;try{t=Hm.loadConfig(e)}catch(i){return{kind:"unreadable",reason:ge(Ke(i))}}if(t.isContentUnavailable())return{kind:"unreadable",reason:"fjall-config.json exists but its contents could not be loaded (the preceding warning names the problem)"};let r=t.getOrganisation();return r!==void 0?{kind:"bound",bound:r}:t.getConfigPath()===null?{kind:"no_project"}:{kind:"unbound"}}Ai(nx,"readProjectBinding");function ix(e,t,r){switch(e.kind){case"unreadable":return e;case"no_project":return{kind:"unbound",projectFound:!1,identity:t};case"unbound":return{kind:"unbound",projectFound:!0,identity:t};case"bound":return t===null?{kind:"unverifiable",bound:e.bound,reason:r??"the organisation could not be resolved"}:e.bound.id===t.id?{kind:"matched",bound:e.bound}:{kind:"mismatched",bound:e.bound,actual:t}}}Ai(ix,"resolveBindingVerdict");function iR(e,t={}){return ix(nx(t.startDir),e,t.unresolvedReason)}Ai(iR,"checkProjectOrganisation");function ua(e){return e.name!==void 0&&e.name!==""?`${e.name} (${e.id})`:e.id}Ai(ua,"describeOrganisation");function aR(e,t,r){return`Refusing to ${e}: this project's fjall-config.json records organisation ${ua(t)} as its home, but the credential in use belongs to ${ua(r)}. Nothing was created, synthesised or deployed. Cure: authenticate as ${ua(t)} ('fjall login', or set FJALL_API_KEY to a key for that organisation), or \u2014 if this project really is moving \u2014 run 'fjall org bind --org ${r.id} --force' to re-bind it.`}Ai(aR,"buildWrongOrganisationMessage");function oR(e,t){return`Refusing to ${e}: ${t}, so this project's organisation binding cannot be checked. Nothing was created, synthesised or deployed. Cure: fix fjall-config.json (permissions or contents), then re-run.`}Ai(oR,"buildUnreadableConfigMessage");function sR(e,t){return`Could not confirm which organisation your credential belongs to (${t}). Proceeding \u2014 this project is bound to ${ua(e)}, and a mismatch would not have been caught.`}Ai(sR,"buildUnverifiableNotice");function cR(e){return`This project is not bound to an organisation. Run 'fjall org bind' to pin it to ${ua(e)} \u2014 afterwards, any command run here with another organisation's credential is refused instead of silently landing there.`}Ai(cR,"buildUnboundNotice");import{createHash as w3}from"node:crypto";var k3=Object.defineProperty,N3=(e,t)=>k3(e,"name",{value:t,configurable:!0});function lR(e,t){return w3("sha256").update(`${e}${t}`).digest("hex")}N3(lR,"credentialFingerprint");import*as Xm from"node:fs";var P3=Object.defineProperty,Jm=(e,t)=>P3(e,"name",{value:t,configurable:!0}),uR="org-config-cache.json";function ax(){return Uo(uR)}Jm(ax,"orgConfigCachePath");function ox(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}Jm(ox,"isObject");function sx(e){return ox(e)&&typeof e.organisationId=="string"&&e.organisationId!==""&&typeof e.organisationName=="string"}Jm(sx,"isCachedCredentialIdentity");function dR(e){try{let t=ax();if(!Xm.existsSync(t))return null;let r=JSON.parse(Xm.readFileSync(t,"utf-8"));return!ox(r)||r.credentialFingerprint!==e?null:sx(r.identity)?r.identity:null}catch(t){return la.debug("cachedCredentialIdentity","Cache read failed, treating as a miss",{error:ge(Ke(t))}),null}}Jm(dR,"readCachedCredentialIdentity");var R3=Object.defineProperty,O3=(e,t)=>R3(e,"name",{value:t,configurable:!0}),pR="https://fjall.io";function qm(){let e=process.env.FJALL_API_URL;return e!==void 0&&e!==""?e:pR}O3(qm,"resolveApiBaseUrl");var mR={name:"@fjall/cli",version:"27.1.0",repository:{type:"git",url:"git+https://github.com/fjall-tech/fjall.git",directory:"cli"},description:"Fjall CLI helper",private:!0,type:"module",bin:{fjall:"dist/src/cli.js"},files:["dist/"],scripts:{clean:"rm -rf ./dist ./dist.next ./sourcemaps","clean:node":"rm -rf ./node_modules","copy-files":'DEST="${DEST:-dist}"; find generators -type d -name files | while read dir; do mkdir -p "$DEST/$dir" && cp -R "$dir/." "$DEST/$dir/"; done && cp -R src/proto "./$DEST/src/proto"',build:"rm -rf ./dist.next ./sourcemaps && npx tsc --outDir dist.next && DEST=dist.next npm run copy-files && node ../scripts/minify-dist.mjs dist.next && chmod +x ./dist.next/src/cli.js && rm -rf ./dist && mv ./dist.next ./dist && node ../scripts/stamp-build.mjs",watch:"npm run build && npx tsc-watch","watch:only":'npx tsc-watch --onSuccess "npm run copy-files"',"fjall-cli":"node ./dist/src/cli.js",version:"npx tsx scripts/updateTemplateVersions.ts && node ../scripts/sync-ci-plugin-major.mjs",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',"format:check":'prettier --check "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',lint:"eslint src/ generators/","lint:fix":"eslint src/ generators/ --fix",typecheck:"tsc --noEmit","typecheck:tests":"tsc --noEmit --project tsconfig.test.json","typecheck:scripts":"tsc --noEmit --project tsconfig.scripts.json","typecheck:all":"npm run typecheck && npm run typecheck:tests && npm run typecheck:scripts",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:integration":"vitest run --config vitest.config.integration.ts","test:integration:watch":"vitest --config vitest.config.integration.ts","test:e2e":"vitest run --config vitest.e2e.config.ts","test:all":"npm run test && npm run test:integration && npm run test:e2e","test:setup":"node scripts/setupTestFixtures.mjs","test:payload-compat":"npx tsx scripts/testPayloadCompatibility.ts","test:payload-compat:e2e":"npx tsx scripts/testPayloadCompatibility.ts --e2e"},engines:{node:">=22.0.0"},author:"",license:"SEE LICENSE IN LICENSE",devDependencies:{"@eslint/js":"^10.0.1","@playwright/test":"^1.62.0","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/ejs":"^3.1.5","@types/prompts":"^2.4.9","@types/proper-lockfile":"^4.1.4","@types/react":"^19.2.17","@typescript-eslint/parser":"^8.65.0","@vitest/coverage-v8":"^4.1.10","aws-cdk-lib":"^2.265.0",constructs:"^10.7.2",eslint:"^10.8.0","ink-testing-library":"^4.0.0",jsdom:"^30.0.1",prettier:"^3.9.6","react-dom":"^19.2.8","strip-ansi":"^6.0.1","tsc-watch":"^7.2.1",tsx:"^4.23.1","typescript-eslint":"^8.65.0",vitest:"4.1.10"},dependencies:{"@anthropic-ai/sdk":"^0.115.0","@aws-sdk/client-acm":"^3.1098.0","@aws-sdk/client-auto-scaling":"^3.1098.0","@aws-sdk/client-backup":"^3.1098.0","@aws-sdk/client-cloudformation":"^3.1098.0","@aws-sdk/client-cost-explorer":"^3.1098.0","@aws-sdk/client-ec2":"^3.1098.0","@aws-sdk/client-ecr":"^3.1098.0","@aws-sdk/client-ecs":"^3.1098.0","@aws-sdk/client-elasticache":"^3.1098.0","@aws-sdk/client-iam":"^3.1098.0","@aws-sdk/client-identitystore":"^3.1098.0","@aws-sdk/client-lambda":"^3.1098.0","@aws-sdk/client-organizations":"^3.1098.0","@aws-sdk/client-ram":"^3.1098.0","@aws-sdk/client-rds":"^3.1098.0","@aws-sdk/client-route-53":"^3.1098.0","@aws-sdk/client-s3":"^3.1098.0","@aws-sdk/client-secrets-manager":"^3.1098.0","@aws-sdk/client-ssm":"^3.1098.0","@aws-sdk/client-sso":"^3.1098.0","@aws-sdk/client-sso-admin":"^3.1098.0","@aws-sdk/client-sso-oidc":"^3.1098.0","@aws-sdk/client-sts":"^3.1098.0","@fjall/deploy-core":"^27.1.0","@fjall/generator":"^27.1.0","@fjall/util":"^27.1.0","@nx/devkit":"^23.1.0","@opennextjs/aws":"^4.1.0","@smithy/node-http-handler":"^4.9.13","@toon-format/toon":"^4.1.0","aws-cdk":"^2.1134.0",axios:"^1.19.0",chalk:"^6.0.0","cli-cursor":"^5.0.0",commander:"^15.0.0",ejs:"^6.0.1",ink:"^7.1.1","js-yaml":"^5.2.2",open:"^11.0.0",ora:"^9.4.1",prompts:"^2.4.2","proper-lockfile":"^4.1.2",protobufjs:"^8.7.1",react:"^19.2.8",typescript:"^6.0.3","update-check":"^1.5.4",zod:"^4.4.3"}};var j3=Object.defineProperty,M3=(e,t)=>j3(e,"name",{value:t,configurable:!0}),Pae=`fjall-cli/${mR.version} node/${process.versions.node} ${L3()}/${F3()}`;var fR=qm(),Rae=c.looseObject({deviceCode:c.string(),userCode:c.string(),verificationUri:c.string(),expiresIn:c.number(),interval:c.number()}),Oae=c.looseObject({status:c.string(),apiKey:c.string().optional(),organisationId:c.string().optional(),organisationName:c.string().optional(),email:c.string().optional()}),$ae=c.looseObject({application:c.looseObject({id:c.string()})}),cx=c.looseObject({id:c.string(),name:c.string(),vpcCidr:c.string().nullable(),connectedAwsAccountId:c.string().nullable()}),jae=c.looseObject({applications:c.array(cx),nextCursor:c.string().optional()}),Mae=c.looseObject({application:cx}),Lae=c.looseObject({applications:c.array(cx)}),Fae=c.looseObject({application:c.looseObject({id:c.string(),name:c.string()})}),Uae=c.looseObject({primaryRegion:c.string().nullish(),secondaryRegions:c.array(c.string()).optional(),disasterRecoveryRegion:c.string().nullish(),providerAccounts:c.custom(e=>Array.isArray(e)),ssoSessions:c.record(c.string(),c.looseObject({ssoRegion:c.string(),ssoStartUrl:c.string()})).optional(),rootOidcRoleArn:c.string().nullish(),allowCodemodLlmFallback:c.boolean().optional(),rootAccessManagement:c.custom(e=>typeof e=="string").optional(),requireTrackedDeploys:c.boolean().optional().catch(void 0)}),zae=c.looseObject({id:c.string(),token:c.string(),tokenPrefix:c.string(),name:c.string(),scopes:c.array(c.string())}),U3=c.looseObject({id:c.string(),name:c.string(),tokenPrefix:c.string(),scopes:c.array(c.string()),resourceConstraints:c.record(c.string(),c.unknown()),sourceTag:c.string().nullable(),expiresAt:c.string(),createdAt:c.string(),revokedAt:c.string().nullable(),revokedReason:c.string().nullable(),lastUsedAt:c.string().nullable(),usageCount:c.number(),deniedCount:c.number()}),Bae=c.looseObject({tokens:c.array(U3)}),Gae=c.looseObject({scopes:c.array(c.string()),expiresAt:c.string().optional()}),z3=c.looseObject({id:c.string(),awsAccountId:c.string(),accountName:c.string().nullable(),environment:c.string().nullable()}),Vae=c.looseObject({accounts:c.array(z3)}),B3=c.looseObject({id:c.string(),assetIdentifier:c.string(),name:c.string(),type:c.string(),status:c.string(),region:c.string().nullish(),_count:c.looseObject({complianceIssues:c.number()}).optional()}),G3=c.looseObject({id:c.string(),name:c.string(),assetIdentifier:c.string(),provider:c.string(),type:c.string(),status:c.string(),region:c.string().nullish(),iacStatus:c.string().nullish(),accountId:c.string().nullish(),estimatedMonthlyCost:c.string().nullish(),lastSeenAt:c.string().nullish(),createdAt:c.string().nullish(),updatedAt:c.string().nullish()}),Wae=c.looseObject({assets:c.array(B3),nextCursor:c.string().optional()}),Kae=c.looseObject({asset:G3}),V3=c.looseObject({id:c.string(),ruleId:c.string(),title:c.string(),severity:c.string(),status:c.string()}),Zae=c.looseObject({issues:c.array(V3)}),Hae=c.record(c.string(),c.unknown()),Jae=c.union([c.array(c.record(c.string(),c.unknown())),c.record(c.string(),c.unknown())]),Xae=c.record(c.string(),c.unknown()),qae=c.record(c.string(),c.unknown()),Yae=c.record(c.string(),c.unknown()),Qae=c.record(c.string(),c.unknown()),eoe=c.looseObject({deployment:c.looseObject({id:c.string()}),minCliVersion:c.string().optional()});var W3=c.object({id:c.string(),releaseNumber:c.number().int(),status:c.string(),commitSha:c.string().nullable(),branch:c.string().nullable(),createdAt:c.string(),assemblyDigest:c.string().nullable(),createdByDeploymentId:c.string().nullable(),rollbackOfReleaseId:c.string().nullable(),services:c.array(Cm.strip())}),toe=c.object({releases:c.array(W3),currentReleaseId:c.string().nullable(),nextCursor:c.number().int().optional()}),K3=c.object({id:c.string(),status:c.string(),target:c.string().nullish(),applicationId:c.string().nullish(),applicationName:c.string().nullish(),connectedAwsAccountId:c.string().nullish(),source:c.string().nullish(),startedAt:c.string().nullish(),triggeredByName:c.string().nullish(),machineLabel:c.string().nullish()}),roe=c.object({deployments:c.array(K3)}),noe=c.object({cancelled:c.boolean(),message:c.string().nullish(),declined:c.boolean().nullish()}),ioe=c.object({released:c.literal(!0),id:c.string().nullish()}),aoe=c.looseObject({organisationId:c.string(),organisationName:c.string(),organisationSlug:c.string().min(1).optional()}),ooe=c.looseObject({status:c.string(),roleArn:c.string().optional(),accountId:c.string().optional(),phase:c.string().optional(),reason:c.string().optional()}),soe=c.looseObject({token:c.string()}),Z3=c.looseObject({quickCreateUrl:c.string(),externalId:c.string()}),H3=c.looseObject({alreadyConnected:c.literal(!0),account:c.looseObject({awsAccountId:c.string(),accountName:c.string().nullable(),status:c.string()})}),coe=c.union([H3,Z3]);function J3(e){return"alreadyConnected"in e&&e.alreadyConnected===!0}M3(J3,"isAlreadyConnected");var loe=c.looseObject({registered:c.boolean(),repository:c.looseObject({id:c.string()}).optional()});var X3=Object.defineProperty,q3=(e,t)=>X3(e,"name",{value:t,configurable:!0});function vl(e=fR){return`Deploy tokens are minted from a signed-in browser session by an owner or admin: open ${e}/settings/ci (Settings \u2192 CI/CD Tokens).`}q3(vl,"deployTokenMintGuidance");var hR=[{command:"ci status",match:k.success,templates:["Run `fjall ci verify` to check the rest of the wiring \u2014 an active deploy token is necessary, not sufficient","Run `fjall ci token list` to see which applications, environments and accounts each active token may deploy to"]},{command:"ci status",match:k.empty,templates:[vl(),"Run `fjall ci setup --plan --app <app>` to learn where the workflow file will go and which secret name it will read (`workflowPath`, `secretName`) \u2014 the two things needed to stage the secret before minting. `--plan` mints nothing and writes nothing, and the workflow BODY is printed on the human surface only: it is not a field of the agent payload"]},{command:"ci token list",match:k.success,templates:["Run `fjall token show <id>` to inspect one token's stored constraints","Run `fjall ci token revoke <id> --reason <text>` to revoke a listed token"]},{command:"ci token list",match:k.empty,templates:[vl(),"Run `fjall ci status` to re-check readiness once a token exists"]},{command:"ci token revoke",match:k.success,templates:["Run `fjall ci token list` to confirm the token now lists as revoked \u2014 a revoked token stays listed, it does not disappear",`Any CI job still holding this token now fails to authenticate. ${vl()}`]}];var Ym="Do not retry or vary flags: `supported: false` is the server's capability verdict, not an input error \u2014 every invocation answers the same until the Fjall server is updated to a version that ships this API (the `message` field names the upgrade)",gR=[{command:"deployments list",match:k.unsupported,templates:[Ym]},{command:"deployments cancel",match:k.unsupported,templates:[Ym]},{command:"deployments force-release",match:k.unsupported,templates:[Ym]},{command:"dev list",match:k.unsupported,templates:[Ym]},{command:"deployments list",match:k.success,templates:["Run `fjall deployments cancel <id>` to request co-operative cancellation of a listed deployment","Run `fjall deploy logs --deployment-id <id>` to read one deployment's logs"]},{command:"deployments cancel",match:k.success,templates:["Run `fjall deployments list` to confirm whether the slot is free, and read `cancelled` and `declined` before assuming it is: `cancelled: false` means the request was refused, `declined: true` is an already-terminal reject, and a plain granted cancel is co-operative \u2014 the deployment has to acknowledge it","Run `fjall deployments force-release <id> --confirm <id>` to clear a slot that stays occupied (organisation admin, audited \u2014 retype the id in `--confirm`)"]},{command:"deployments force-release",match:k.success,templates:["Run `fjall deployments list` to confirm the slot is free","Run `fjall deploy <app>` to retry the deployment the wedged slot was blocking"]},{command:"dev up",match:k.success,templates:["Run `fjall dev list <app>` to see every slot for this app with its `host` \u2014 rows carry `host`, not a full URL, and it is empty until the slot leaves `creating`","Run `fjall dev down <app> --branch <branch>` to tear this slot down"]},{command:"dev list",match:k.success,templates:["Run `fjall dev down <app> --branch <branch>` to tear one listed slot down \u2014 every row carries the `branch` to name here","Run `fjall dev up <app> --branch <branch>` to bring another branch up"]},{command:"dev down",match:k.success,templates:["Run `fjall dev list <app>` to see which slots remain","Run `fjall dev up <app> --branch <branch>` to bring the branch back up"]},{command:"dev substrate down",match:k.success,templates:["Run `fjall dev list <app>` to confirm no slot survives \u2014 the substrate will not tear down under live slots, and `--force` takes them with it","Any `residuals` row survives the teardown and can still cost: its `cleanupHint` names the manual step"]}];var yR=["Run `fjall domain deploy <name>` to deploy the domain","Run `fjall domain verify <name>` to check DNS delegation once it is deployed","Run `fjall domain export <name>` to export the live zone records"],vR=[{command:"org deploy",match:k.success,templates:["Run `fjall org get` to review the deployed organisation topology and accounts",`Run \`${te.accountDeploy}\` to deploy the account tier if you passed \`--no-cascade\``,`Run \`${te.createApplicationAgent} --name "<name>"\` to create an application to deploy into it`]},{command:"org deploy",match:k.error,templates:["Run `fjall org get` to see which tier of the cascade is already deployed",`Run \`${te.organisationDeploy} --no-cascade\` to retry the organisation stack alone`]},{command:"platform deploy",match:k.success,templates:[`Run \`${te.accountDeploy}\` to deploy the account tier on top of it`]},{command:"platform deploy",match:k.error,templates:["Run `fjall org get` to check the organisation tier is deployed first"]},{command:"account deploy",match:k.success,templates:["Run `fjall apps list` to see which applications are registered","Run `fjall deploy <application>` to deploy one into this account"]},{command:"account deploy",match:k.error,templates:["Run `fjall org get` to confirm the account is registered in the organisation",`Run \`${te.accountDeploy} --target <target>\` to select a specific member account`]},{command:"domain list",match:k.success,templates:["Run `fjall domain verify <name>` to check DNS delegation","Run `fjall domain export <name>` to export zone file","Run `fjall create domain --name <name>` to create a new domain"]},{command:"domain list",match:k.empty,templates:['Run `fjall create domain --name "<name>"` to create a domain',"Run `fjall domain import <name>` to import from Route53"]},{command:"domain verify",match:k.success,templates:["Run `fjall domain export <name>` to export zone file","Run `fjall domain deploy <name>` to deploy domain infrastructure"]},{command:"domain verify",match:k.error,templates:["Run `fjall domain verify <name>` to retry","Run `fjall domain list` to see existing domains"]},{command:"domain export",match:k.success,templates:["Run `fjall domain verify <name>` to check delegation","Run `fjall domain import <name>` to re-import from Route53"]},{command:"domain import",match:k.success,templates:["Run `fjall domain verify <name>` to check delegation","Run `fjall domain export <name>` to see the zone file","Run `fjall domain deploy <name>` to deploy domain infrastructure"]},{command:"domain import",match:k.error,templates:["Run `fjall domain import --hosted-zone-id <id>` to import by zone ID","Run `fjall domain list` to see existing domains"]},{command:"domain records list",match:k.success,templates:["Run `fjall domain sync <domain>` for the full zone-hygiene report","Run `fjall domain sync <domain> --fix` to remediate residue records via the destruction ceremony"]},{command:"domain records list",match:k.empty,templates:["Run `fjall domain deploy <domain>` to deploy the domain's declared records","Run `fjall domain list` to see existing domains"]},{command:"domain records list",match:k.error,templates:["Run `fjall domain records list <domain> --hosted-zone-id <id>` when the zone is not resolvable by name",`Run \`${te.connect}\` if AWS credentials are missing`]},{command:"domain sync",match:k.success,templates:["Run `fjall domain sync <domain> --fix` to remediate residue records (ceremony-gated)","Run `fjall domain records list <domain>` to see every record with its owner"]},{command:"domain sync",match:k.error,templates:["Run `fjall domain sync <domain> --hosted-zone-id <id>` when the zone is not resolvable by name","Run `fjall domain list` to see existing domains"]},{command:"domain delegate",match:k.success,templates:["Run `fjall domain verify <domain>` to confirm public DNS resolution","Run `fjall domain deploy <domain>` to continue a two-phase deploy after delegation"]},{command:"domain delegate",match:k.error,templates:["Run `fjall domain deploy <parent-domain>` so the parent publishes its DelegationRole","Run `fjall domain verify <domain> --show-delegation` for registrar instructions"]},{command:"domain destroy",match:k.success,templates:["Run `fjall domain list` to see remaining domains","Run `fjall domain sync <parent-domain>` to confirm no delegation residue remains"]},{command:"domain destroy",match:k.error,templates:["Run `fjall domain destroy <domain> --remediate '<name>'=recreate` with the exact consent the ticket names","Run `fjall domain list` to see existing domains"]},{command:"domain deploy",match:k.success,templates:["Run `fjall domain verify <domain>` to check DNS propagation","Run `fjall domain delegate <domain>` to write the NS delegation for a delegated child"]},{command:"domain deploy",match:k.error,templates:["Run `fjall domain deploy <domain>` to resume \u2014 the zone phase is retained and skipped on re-run","Run `fjall domain verify <domain> --show-delegation` for registrar delegation instructions"]},{command:"domain eject",match:k.success,templates:["Review the ejected infrastructure.ts \u2014 it is now vanilla CDK owned by you","Run `fjall domain list` to see remaining managed domains"]},{command:"create domain",match:k.success,templates:yR},{command:"domain create",match:k.success,templates:yR},{command:"create domain",match:k.error,templates:["Run `fjall domain list` to see existing domains",'Run `fjall create domain --name "<name>"` to retry with a different name']},{command:"create account",match:k.success,templates:[`Run \`${te.connect} --environment production\` to link your AWS account`,`Run \`${te.accountDeploy}\` to deploy account infrastructure (after connecting)`]},{command:"create account",match:k.error,templates:[`Run \`${te.createAccount} --primary-region <region>\` to retry`,`Run \`${te.createAccount} --help\` for usage information`]},{command:"create org",match:k.success,templates:[`Run \`${te.connect} --name "<account-name>" --region <region>\` to link the AWS Organizations management account \u2014 omit \`--environment\` so it registers at the organisation tier`,`Run \`${te.organisationDeploy}\` to deploy all infrastructure (after connecting)`]},{command:"create org",match:k.error,templates:[`Run \`${te.createOrganisation} --email "<email>"\` to retry (add \`--name "<name>"\` only for a brand-new organisation)`,`Run \`${te.createOrganisation} --help\` for all options`]},{command:"restore",match:k.successDryRun,templates:["Run `fjall restore <resourceType> --recovery-point <recoveryPointArn> --yes` to initiate restore","Run `fjall apps list` to see existing applications"]},{command:"restore",match:k.success,templates:["Open the AWS Console URL above to monitor restore progress","Run `fjall import` to import the restored resource after completion"]},{command:"restore",match:k.errorWithCode("NOT_FOUND"),templates:["Verify the recovery point ARN is correct and exists in the current region","Run `fjall restore <resourceType> --recovery-point <arn>` to retry"]},{command:"restore",match:k.errorWithCode("FORBIDDEN"),templates:["Ensure the IAM role has backup:StartRestoreJob and iam:PassRole permissions","Run `fjall restore` interactively to configure with guided setup"]},{command:"import",match:k.successDryRun,templates:["Run `fjall import --app <app> --resource-id <resourceId> --yes` to import a specific resource","Run `fjall import --app <app> --yes` to import all discovered resources"]},{command:"import",match:k.success,templates:["Run `fjall deploy <app>` to deploy with the imported resource","Run `fjall apps describe <app>` to see updated resources"]},{command:"import",match:k.errorWithCode("NOT_FOUND"),templates:[`Run \`${te.createApplicationAgent} --name "<app>"\` to create the application`,"Run `fjall apps list` to see existing applications"]},{command:"import",match:k.errorWithCode("VALIDATION_ERROR"),templates:["Run `fjall import --app <app> --resource-id <resourceId>` to import a specific resource","Run `fjall import --app <app> --resource-id <resourceId> --yes` to import immediately"]},{command:"aws exec",match:k.success,templates:["Run `fjall aws exec -- <command...>` to run another AWS CLI command","Run `fjall status` to check application health"]},{command:"aws exec",match:k.error,templates:["Retry the command \u2014 OIDC token mints can fail transiently",`Run \`${te.login}\` if the retry also fails with an authentication error`]},{command:"unlock bucket",match:k.success,templates:["Re-put sane bucket policy statements (enforceSSL deny, access grants) \u2014 the unlock deleted the ENTIRE policy","Run `fjall destroy <app>` to retry the blocked stack cleanup"]},{command:"unlock bucket",match:k.error,templates:["Ensure your credentials belong to the organisation's management account \u2014 STS AssumeRoot is rejected elsewhere","Run `fjall unlock bucket <name> --account <id> --acknowledge-root-session` to retry"]}];var Y3=Object.defineProperty,AR=(e,t)=>Y3(e,"name",{value:t,configurable:!0}),bR="Run `fjall connect status` to check that an AWS account is connected: asset discovery only inventories connected accounts, so an organisation with none has nothing to inventory",SR=["Run `fjall assets show <asset>` to read one asset in full \u2014 pass its `assetIdentifier`","Run `fjall assets compliance <asset>` to list an asset's recorded posture issues \u2014 pass its `assetIdentifier`, the address every server version accepts"],ER=AR(e=>e.outcome==="success"&&e.nextCursor!==void 0,"isTruncatedPage"),xR=[{command:"assets list",match:AR(e=>ER(e)&&e.fields!==void 0&&e.fields!=="","match"),templates:["This window is truncated \u2014 more assets exist beyond these rows. Run `fjall assets list --cursor <nextCursor> --fields <fields>` to fetch the next page with the same projection; `total` counts this window only, and `fjall assets summary` reports the estate-wide tally, split active/deleted",...SR]},{command:"assets list",match:ER,templates:["This window is truncated \u2014 more assets exist beyond these rows. Run `fjall assets list --cursor <nextCursor>` to fetch the next page; `total` counts this window only, and `fjall assets summary` reports the estate-wide tally, split active/deleted",...SR]},{command:"assets list",match:k.success,templates:["The `total` aggregate counts the rows in this response, not the estate: `--take` bounds the window (default 50). No `nextCursor` aggregate here means the estate ends with these rows; `fjall assets summary` reports the estate-wide tally, split active/deleted","Run `fjall assets show <asset>` to read one asset in full","Run `fjall assets compliance <asset>` to list an asset's recorded posture issues \u2014 pass its `assetIdentifier`, the address every server version accepts (row `id`s are only accepted by newer servers)"]},{command:"assets list",match:k.empty,templates:["Run `fjall assets list --status deleted` to include assets discovery has since marked deleted \u2014 the default listing hides them",bR]},{command:"assets show",match:k.success,templates:["Run `fjall assets compliance <asset>` to list the posture issues recorded against this asset","Run `fjall assets show <asset> --fields id,accountId,iacStatus,estimatedMonthlyCost,lastSeenAt` to read the fields the default projection omits"]},{command:"assets compliance",match:k.success,templates:["Read the `status` column before acting: this listing returns every issue recorded against the asset, `resolved` and `suppressed` included, where the `openIssues` count on `fjall assets list` counts only the open ones","Run `fjall compliance fix --domain compliance --issue-id <issueId>` to read this issue in full alongside the organisation's other open issues. `--domain` is the producer's category \u2014 one of `compliance`, `cost`, `performance` \u2014 not a framework name, and the response is context to reason from, not a remediation step: use `--execute` to run one","Run `fjall assets show <asset>` to read the asset these issues were raised against"]},{command:"assets compliance",match:k.empty,templates:["No issue of ANY status has been recorded against this asset \u2014 an empty listing here is not the same as issues that were resolved, which would still appear with `status: resolved`","Run `fjall assets list --fields name,assetIdentifier,openIssues` to find the assets that do carry open issues"]},{command:"assets summary",match:k.success,templates:["Run `fjall assets list --fields name,assetIdentifier,openIssues` to see which assets sit behind `withIssues` \u2014 `withIssues` counts the assets carrying at least one open issue, `openIssues` counts those issues per asset","Run `fjall assets list --take <n>` to read the rows behind these totals \u2014 page onwards with `--cursor` when the listing reports a `nextCursor`, and pass `--status deleted` to include the `deleted` rows in the listing (interleaved with active \u2014 read the `status` column). These totals are estate-wide (the summary pages the listing to exhaustion, deleted assets included): `total` counts the whole estate, `active` and `deleted` split it"]},{command:"assets summary",match:k.empty,templates:[bR]},{command:"costs show",match:k.success,templates:["Run `fjall costs --mode forecast` to see forecasted spend","Run `fjall costs --mode breakdown` to see service-level breakdown"]},{command:"costs show",match:k.error,templates:["Run `fjall costs --app <app>` to filter by application","Run `fjall costs --help` for usage information"]},{command:"metrics show",match:k.success,templates:["Run `fjall metrics --mode latency` to see latency percentiles","Run `fjall metrics --mode errors` to see error trends"]},{command:"metrics show",match:k.error,templates:["Run `fjall metrics --app <app>` to filter by application","Run `fjall metrics --help` for usage information"]},{command:"compliance fix",match:k.success,templates:["Run `fjall compliance fix --domain <domain> --issue-id <id>` to narrow the suggestions to one issue","Run `fjall deploy <app>` to apply remediation changes"]},{command:"compliance fix",match:k.error,templates:["Run `fjall compliance fix --domain <domain>` to name the compliance domain","Run `fjall compliance --help` for usage information"]},{command:"compliance fix --execute",match:k.success,templates:["Read the result's `kind` before treating the issue as fixed: `auto-pr` opened a pull request that still has to be merged, `imperative` rewrote the live policy, and `manual-hint` changed nothing \u2014 its `awsCliHint` carries the manual step, and that field is absent for rules that supply no hint (`message` is a fixed string either way)","Do not re-read the issue to confirm the cure: nothing on the remediation path writes to the issue record, so `status` stays `open` until the next discovery scan re-evaluates the asset. Verify at the thing that changed \u2014 the pull request, or the live resource","Run `fjall deploy <app>` to roll out an `auto-pr` remediation once its pull request is merged"]},{command:"deploy diff",match:k.success,templates:["Run `fjall deploy logs --deployment-id <id>` to analyse deployment logs","Run `fjall status <app>` to check current deployment health"]},{command:"deploy diff",match:k.error,templates:["Run `fjall list deployments` to see recent deployment IDs","Run `fjall deploy diff --help` for usage information"]},{command:"deploy logs",match:k.success,templates:["Run `fjall deploy diff <idA> <idB>` to compare two deployments","Run `fjall status <app>` to check current deployment health"]},{command:"deploy logs",match:k.error,templates:["Run `fjall deploy logs --deployment-id <id>` with a valid deployment ID","Run `fjall list deployments` to find a deployment ID"]}];var Q3={command:"*",match:k.error,templates:["Run `fjall <command> --help` for usage information"]},_R=[...KP,...ZP,...JP,...hR,...gR,...vR,...xR,Q3];var eW=Object.defineProperty,tW=(e,t)=>eW(e,"name",{value:t,configurable:!0}),TR=["app","environment","region","profile","target","cluster","service","lambda","status","type"],da=["app","cluster","service","lambda"],rW=["status","type","region"],lx={deploy:["environment","region","target"],"deploy diff":[],"deploy logs":[],destroy:["target"],"org deploy":["target"],"org destroy":["target"],"platform deploy":["target"],"platform destroy":["target"],"account deploy":["target"],"account destroy":["target"],status:[],rollout:[],list:["app"],apps:["target"],connect:["environment","region"],"connect status":[],import:["app","region"],costs:["app"],metrics:["app"],compliance:["app"],"token create":["app","environment"],"unlock bucket":["region"],"aws exec":["app","region","target"],"secrets set":da,"secrets get":da,"secrets list":da,"secrets delete":da,"secrets export":da,"secrets import":da,"secrets exec":da,"assets list":rW},nW=Math.max(...Object.keys(lx).map(e=>e.split(" ").length));function ux(e){let t=e.trim().split(/\s+/).slice(1);for(let r=nW;r>=1;r--){let i=t.slice(0,r).join(" ");if(Object.hasOwn(lx,i))return lx[i]}return[]}tW(ux,"resolvePreservableFlags");var iW=Object.defineProperty,ef=(e,t)=>iW(e,"name",{value:t,configurable:!0});function dx(e){let t=e.replace(/[\u0000-\u001f\u007f`]/g,"");return/[^\w@%+=:,./-]/.test(t)?`'${t.replace(/'/g,"'\\''")}'`:t}ef(dx,"shellEscape");function CR(e,t,r){let i=new Set,n=e.replace(/<(\w+)>/g,(a,o)=>{let s=t[o];return s===void 0||s===""?`<${o}>`:(i.add(o),o==="command"?s:dx(s))});return DR(n,r,i)}ef(CR,"interpolateTemplate");var Qm=class{static{ef(this,"SuggestionResolver")}command;flags;constructor(t,r){this.command=t,this.flags=r}resolve(t){let r=_R.find(i=>(i.command===this.command||i.command==="*")&&i.match(t));return r===void 0?[]:r.templates.map(i=>CR(i,t,this.flags))}};function DR(e,t,r=new Set){let i=/`(fjall[^`]*)`/.exec(e),n=i?.[1];if(i===null||n===void 0)return e;let a=ux(n),o=[];for(let d of TR){if(!a.includes(d))continue;let h=t[d];h!==void 0&&h!==""&&!r.has(d)&&!n.includes(`--${d}`)&&o.push(`--${d} ${dx(h)}`)}if(o.length===0)return e;let s=` ${o.join(" ")}`,l=n.indexOf(" -- "),m=l===-1?`${n}${s}`:`${n.slice(0,l)}${s}${n.slice(l)}`;return e.slice(0,i.index)+`\`${m}\``+e.slice(i.index+i[0].length)}ef(DR,"applyPreservedFlags");var aW=Object.defineProperty,Ln=(e,t)=>aW(e,"name",{value:t,configurable:!0});function nn(e,t){if(t!==void 0&&Yo(e)){let i={};for(let[n,a]of Object.entries(e))i[n]=t.has(n)?a:nn(a);return i}if(typeof e=="string")return ge(e);if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(i=>nn(i));if(e instanceof Date||e instanceof RegExp)return e;let r={};for(let[i,n]of Object.entries(e))r[i]=nn(n);return r}Ln(nn,"maskTree");function tf(e){if(Array.isArray(e))return e.map(tf);if(!Yo(e))return e;let t={};for(let[r,i]of Object.entries(e))i!==void 0&&(t[r]=tf(i));return t}Ln(tf,"stripAbsent");function Yo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof Date)&&!(e instanceof RegExp)}Ln(Yo,"isPlainRecord");function IR(e){let t=e?.verbatimFields;return t!==void 0&&t.length>0?new Set(t):void 0}Ln(IR,"toVerbatimKeys");function kR(e,t){return t===void 0||!Yo(e)?!1:Object.keys(e).some(r=>t.has(r))}Ln(kR,"carriesVerbatimField");function NR(e,t){let r=e;for(let i of t.split(".")){if(!Yo(r))return;r=r[i]}return r}Ln(NR,"resolveDotPath");function wR(e,t,r){let i=e.project(t),n={};for(let a of r)a in i&&(n[a]=i[a]);return n}Ln(wR,"projectSelectedFields");var bl=class{static{Ln(this,"AgentOutputWriter")}write;hasWrittenBlock=!1;resolver;flags;full;budget;requestedFields;constructor(t){this.write=t.writeFn??(r=>{process.stdout.write(r)}),this.resolver=new Qm(t.command,t.flags),this.flags=t.flags,this.full=t.full??!1,this.budget=t.budget,this.requestedFields=t.fields??[]}get isFullOutput(){return this.full}writeBlock(t){t!==""&&(this.hasWrittenBlock&&this.write(FA+`
300
300
  `),this.hasWrittenBlock=!0,this.write(t))}renderResult(t,r){let i=IR(r?.schema),n=nn(t,i),a=r?.schema!==void 0&&Yo(n)?this.applySchema(n,r.schema):n,o=zA(a),s=this.resolveHelp(r?.suggestionContext),l=o+s+`
301
301
  `;this.writeBlock((kR(a,i)?l:Bm(l,this.budget))+Xo())}renderListResult(t,r,i){let n=t.map(m=>nn(m)),a=i.fields,o=a!==void 0&&a.length>0?a:r.fields,s=BA(n,{fields:o,project:Ln(m=>wR(r,m,o),"project")},{entity:i.entity,aggregates:i.aggregates}),l=this.resolveHelp(i.suggestionContext);this.writeBlock(Bm(s+l+`
302
302
  `,this.budget)+Xo())}renderEvent(t){let r=nn(t),i=WA({...r,value:tf(r.value)});this.writeBlock(i)}renderError(t,r){let i={...t,message:ge(t.message),...t.details!==void 0?{details:nn(t.details)}:{}},n=GA(i),a=this.resolveHelp(r);this.writeBlock(n+a+`
@@ -309,32 +309,32 @@ ${FA}
309
309
  `)}}setDebugEnabled(t){this.debugEnabled=t}write(t,r){this.isClosing||(this.initialised||this.initialise(),this.buffer.push(t),this.debugEnabled&&r&&this.debugBuffer.push(t),this.buffer.length>=this.config.maxBufferSize&&this.flush())}flushBuffer(t,r,i){if(t.length===0||!r)return{buffer:t,stream:r};let n=r;this.fileRotator.needsRotation(i,this.config.maxFileSize)&&(n.end(),this.fileRotator.rotate(i),n=this.openStream(i));for(let a of t)n.write(JSON.stringify(a)+`
310
310
  `);return{buffer:[],stream:n}}flush(){let t=this.flushBuffer(this.buffer,this.mainLogStream,this.mainLogPath);this.buffer=t.buffer,this.mainLogStream=t.stream;let r=this.flushBuffer(this.debugBuffer,this.debugLogStream,this.debugLogPath);this.debugBuffer=r.buffer,this.debugLogStream=r.stream}close(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.mainLogStream&&(this.mainLogStream.end(),this.mainLogStream=null),this.debugLogStream&&(this.debugLogStream.end(),this.debugLogStream=null),this.buffer=[],this.debugBuffer=[],this.initialised=!1,this.isClosing=!1}async closeAndFlush(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null);let t=[];this.mainLogStream&&(t.push(this.mainLogStream),this.mainLogStream=null),this.debugLogStream&&(t.push(this.debugLogStream),this.debugLogStream=null),this.buffer=[],this.debugBuffer=[],this.initialised=!1,await Promise.all(t.map(r=>new Promise(i=>{r.end(()=>i())}))),this.isClosing=!1}};import{createWriteStream as kW,existsSync as NW,mkdirSync as wW,readdirSync as PW,statSync as RW,unlinkSync as OW}from"fs";import{join as Ex}from"path";var Fn={trace:0,debug:1,info:2,warn:3,error:4},an={MAX_FILE_SIZE:Al.MAX_FILE_SIZE,MAX_FILES:Al.MAX_FILES,MAX_BUFFER_SIZE:100,MAX_DEPLOYMENT_LOGS_PER_APP:100,MAX_DEPLOYMENT_LOG_BYTES_PER_APP:256*1024*1024,FLUSH_INTERVAL_MS:500,LOG_FILENAME:"fjall.jsonl",DEBUG_LOG_FILENAME:"fjall-debug.jsonl"};var CW=Object.defineProperty,DW=(e,t)=>CW(e,"name",{value:t,configurable:!0});function rs(){return pm()}DW(rs,"getDefaultLogDir");var IW=Object.defineProperty,VR=(e,t)=>IW(e,"name",{value:t,configurable:!0}),$W=/^[a-zA-Z0-9_-]+-\d{4}-\d{2}-\d{2}T[\d-]+Z\.jsonl$/,jW=6e4;function WR(e,t,r){try{let i=Date.now(),n=PW(e).filter(s=>$W.test(s)).map(s=>{let l=Ex(e,s);try{let m=RW(l);return{path:l,mtimeMs:m.mtimeMs,size:m.size}}catch{return}}).filter(s=>s!==void 0&&i-s.mtimeMs>=jW);n.sort((s,l)=>l.mtimeMs-s.mtimeMs);let a=0,o=0;for(let s of n){if(a===0||a<t&&o+s.size<=r){a+=1,o+=s.size;continue}try{OW(s.path)}catch{}}}catch{}}VR(WR,"pruneOldDeploymentLogs");var xl=class{static{VR(this,"DeploymentLoggerImpl")}mainLogger;appName;operationType;logStream=null;logPath;deploymentId;buffer=[];flushInterval=null;isClosing=!1;maxBufferSize=an.MAX_BUFFER_SIZE;constructor(t,r,i){this.mainLogger=t,this.appName=r,this.operationType=i,this.deploymentId=`${i}-${Date.now()}`;let n=rs(),a=Ex(n,"deployments",r);NW(a)||wW(a,{recursive:!0}),WR(a,an.MAX_DEPLOYMENT_LOGS_PER_APP,an.MAX_DEPLOYMENT_LOG_BYTES_PER_APP);let o=new Date().toISOString().replace(/[:.]/g,"-"),s=`${i}-${o}.jsonl`;this.logPath=Ex(a,s);try{this.logStream=kW(this.logPath,{flags:"a"}),this.flushInterval=setInterval(()=>this.flush(),an.FLUSH_INTERVAL_MS),this.info("DeploymentLogger","Deployment logging initialised",{appName:r,operationType:i,deploymentId:this.deploymentId,logPath:this.logPath})}catch{}}log(t,r,i,n,a,o){if(this.isClosing)return;let s={timestamp:new Date().toISOString(),level:t,component:r,message:i,correlationId:this.deploymentId,...n&&Object.keys(n).length>0&&{data:n},...a&&{stackName:a},...o&&{phase:o}};this.buffer.push(s),this.mainLogger.logWithCorrelation(t,r,i,this.deploymentId,n,a,o),this.buffer.length>=this.maxBufferSize&&this.flush()}flush(){if(!(this.buffer.length===0||!this.logStream)){for(let t of this.buffer)this.logStream.write(JSON.stringify(t)+`
311
311
  `);this.buffer=[]}}info(t,r,i){this.log("info",t,r,i)}warn(t,r,i){this.log("warn",t,r,i)}error(t,r,i){this.log("error",t,r,i)}debug(t,r,i){this.log("debug",t,r,i)}stackEvent(t,r,i,n){this.log("info","StackDeployment",i,n,t,r)}dockerEvent(t,r){this.log("info","DockerOperation",t,{percentage:r})}ecsEvent(t,r,i){this.log("info","ECSDeployment",t,{percentage:r,taskCount:i})}close(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.logStream&&(this.logStream.end(),this.logStream=null),this.buffer=[],this.isClosing=!1}getLogPath(){return this.logPath}getDeploymentId(){return this.deploymentId}};var MW=Object.defineProperty,_x=(e,t)=>MW(e,"name",{value:t,configurable:!0});function xx(){let e=yx();return e==="agent"||e==="mcp"}_x(xx,"isStructuredOutputMode");function KR(){return Ko.isUIMode||Ko.isNonInteractive}_x(KR,"surfaceOwnsConsole");var of=class e{static{_x(this,"Logger")}static instance=null;config;debugEnabled;traceEnabled;minLevel;fileWriter;mainLogPath;debugLogPath;constructor(){let t=rs(),r=Ax(t,"debug"),{maxFileSize:i,maxFiles:n}=Sx();this.config={logDir:t,debugLogDir:r,maxFileSize:i,maxFiles:n,maxBufferSize:an.MAX_BUFFER_SIZE,flushIntervalMs:an.FLUSH_INTERVAL_MS},this.mainLogPath=Ax(t,an.LOG_FILENAME),this.debugLogPath=Ax(r,an.DEBUG_LOG_FILENAME),this.debugEnabled=process.env.FJALL_DEBUG==="true"||process.env.FJALL_TRACE==="true"||process.argv.includes("--verbose")||process.argv.includes("-v"),this.traceEnabled=process.env.FJALL_TRACE==="true";let a=process.env.FJALL_LOG_LEVEL?.toLowerCase();a&&a in Fn?this.minLevel=a:this.traceEnabled?this.minLevel="trace":this.debugEnabled?this.minLevel="debug":this.minLevel="info",this.fileWriter=new af(this.config,this.mainLogPath,this.debugLogPath,this.debugEnabled)}static getInstance(){return e.instance||(e.instance=new e),e.instance}shouldLog(t){return Fn[t]>=Fn[this.minLevel]}createEntry(t,r,i,n,a,o,s){return{timestamp:new Date().toISOString(),level:t,component:r,message:i,...a&&{correlationId:a},...n&&Object.keys(n).length>0&&{data:n},...o&&{stackName:o},...s&&{phase:s}}}log(t,r,i,n,a,o,s){if(!this.shouldLog(t))return;let l=this.createEntry(t,r,i,n,a,o,s),m=t==="debug"||t==="trace";this.fileWriter.write(l,m),this.writeConsole(l)}writeConsole(t){if(xx()||KR()){this.debugEnabled&&this.writeStderrLine(t);return}let r=this.getConsolePrefix(t.level),i=`[${t.component}]`,n=`${r} ${i} ${t.message}`;t.level==="error"?console.error(n):t.level==="warn"?console.warn(n):console.log(n)}writeStderrLine(t){let r=this.getConsolePrefix(t.level),i=`[${t.component}]`,n="";if(t.data&&Object.keys(t.data).length>0)try{n=` ${JSON.stringify(t.data)}`}catch{n=" [unserialisable data]"}let a=`${r} ${i} ${t.message}${n}`;process.stderr.write(`${ge(a)}
312
- `)}getConsolePrefix(t){switch(t){case"error":return"[ERROR]";case"warn":return"[WARN]";case"info":return"[INFO]";case"debug":return"[DEBUG]";case"trace":return"[TRACE]"}}error(t,r,i){this.log("error",t,r,i)}warn(t,r,i){this.log("warn",t,r,i)}info(t,r,i){this.log("info",t,r,i)}debug(t,r,i){this.log("debug",t,r,i)}trace(t,r,i){this.log("trace",t,r,i)}diagnostic(t,r,i,n){this.log(t,r,i,n),!this.debugEnabled&&xx()&&(Fn[t]<Fn.info||this.writeStderrLine(this.createEntry(t,r,i,n)))}isDebugEnabled(){return this.debugEnabled}isTraceEnabled(){return this.traceEnabled}enableDebug(){this.debugEnabled=!0,Fn[this.minLevel]>Fn.debug&&(this.minLevel="debug"),this.fileWriter.setDebugEnabled(!0),this.fileWriter.isInitialised&&this.fileWriter.initialiseDebugStream()}withCorrelation(t){return new es(this,t)}forDeployment(t,r="deploy"){return new xl(this,t,r)}close(){this.fileWriter.close()}async flushAndClose(){await this.fileWriter.closeAndFlush()}getLogPath(){return this.mainLogPath}getDebugLogPath(){return this.debugLogPath}getLogDir(){return this.config.logDir}logWithCorrelation(t,r,i,n,a,o,s){this.log(t,r,i,a,n,o,s)}static reset(){e.instance&&(e.instance.close(),e.instance=null)}};var Si=of.getInstance();var LW=Object.defineProperty,ct=(e,t)=>LW(e,"name",{value:t,configurable:!0}),ns="fjall";function ma(e,t){let r=FW(e);if(r.includes("..")||r.startsWith("/"))throw new Error(`Invalid ${t}: path traversal is not allowed`)}ct(ma,"assertNoTraversal");function UW(){return ns}ct(UW,"getFjallPath");function zW(e){let t=ZR(e);return ZR(t)||"."}ct(zW,"getProjectRoot");function XR(e){if(!JR(e))throw new Error(`Infrastructure file not found: ${e}`);let t=HR(e,"utf-8"),r=qR(t);if(r===void 0)throw new Error(`Could not find appName in infrastructure file: ${e}. Expected format: const appName = "yourAppName";`);return r}ct(XR,"getAppNameFromInfrastructure");function qR(e){return e.match(/const\s+appName\s*=\s*["']([^"']+)["']/)?.[1]}ct(qR,"parseAppNameFromInfrastructureContent");function BW(e){if(!JR(e))return;let t;try{t=HR(e,"utf-8")}catch(r){Si.debug("PathHelpers","Could not read organisation infrastructure",{error:ge(Ke(r))});return}return t.match(/organisationName:\s*(["'])(.+?)\1/)?.[2]}ct(BW,"readOrganisationNameFromInfrastructure");function GW(e){let t=vr(e,Dx);return XR(t)}ct(GW,"getAppName");function VW(e){return ma(e,"app name"),vr(ns,e,Dx)}ct(VW,"getInfrastructurePath");function sf(e){return ma(e,"app name"),vr(ns,e)}ct(sf,"getAppPath");function YR(e,t){let r=e??process.cwd();return t===void 0?r:(ma(t,"container"),vr(r,t))}ct(YR,"resolveScaffoldRootDir");function WW(e,t,r){return vr(YR(t,r),sf(e))}ct(WW,"resolveAppScaffoldPath");function Tx(e){return ma(e,"component name"),vr(ns,e)}ct(Tx,"getOrganisationComponentPath");function KW(e){return ma(e,"deployment type"),vr(ns,e,"logs")}ct(KW,"getDeploymentLogsPath");function QR(){return vr(ns,"domains")}ct(QR,"getDomainsDir");function Cx(e){return ma(e,"domain name"),vr(QR(),e)}ct(Cx,"getDomainComponentPath");function ZW(e){return vr(Cx(e),Dx)}ct(ZW,"getDomainInfrastructurePath");function HW(e){return vr(Cx(e),JW)}ct(HW,"getDomainZoneFilePath");var Dx="infrastructure.ts",JW="zone.bind",XW="cdk.out";function qW(e){return vr(e,XW)}ct(qW,"getCdkOutPath");var YW=Object.defineProperty,QW=(e,t)=>YW(e,"name",{value:t,configurable:!0}),eK=import.meta.dirname;function Ix(e,t,r,i){let n=eO(eK,"..","shared","files"),a=t.includes("/")?t:sf(t);mc(e,n,a,r,i),pc(e,eO(a,".gitignore"),al,i)}QW(Ix,"copySharedCdkFiles");var tK=Object.defineProperty,is=(e,t)=>tK(e,"name",{value:t,configurable:!0});function tO(e){return e.success===!0}is(tO,"isSuccess");function rO(e){return e.success===!1}is(rO,"isFailure");function K(e){return{success:!0,data:e}}is(K,"success");function j(e){return{success:!1,error:e}}is(j,"failure");async function nO(e){try{let t=await e();return K(t)}catch(t){return j(gi(t))}}is(nO,"tryAsync");function iO(e){try{let t=e();return K(t)}catch(t){return j(gi(t))}}is(iO,"trySync");var rK=Object.defineProperty,nK=(e,t)=>rK(e,"name",{value:t,configurable:!0}),aO=/^[a-zA-Z][a-zA-Z0-9-]*$/,iK=Yc.source.replace(/^\^|\$$/g,""),fe=Object.freeze({IDENTIFIER:aO,NEW_APP_NAME:/^[a-z][a-z0-9-]*$/,RESOURCE_NAME:/^[a-zA-Z][a-zA-Z0-9]*$/,ECS_SERVICE_NAME:aO,BUCKET_NAME:/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z][a-z0-9]*$/,DATABASE_NAME:/^[a-zA-Z][a-zA-Z0-9_]*$/,RESOURCE_TYPE:/^[a-z]+(:[a-z]+)?$/,SSM_PATH:new RegExp(`^(?:/${iK})+$`),SECRET_NAME:Sm,SSM_COMPONENT:Yc,EMAIL:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,DOCKER_IMAGE:/^[a-z0-9][a-z0-9._-]*[a-z0-9](:[a-z0-9._-]+)?$/,DOMAIN:/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i,HTTP_ORIGIN:/^https?:\/\/[a-z0-9.-]+(:\d+)?$/i,PASCAL_CASE:/^[A-Z][A-Za-z0-9]*$/,AWS_ACCOUNT_ID:/^\d{12}$/,VPC_ID:/^vpc-[a-z0-9]+$/,ROLE_ARN:/^arn:aws[a-zA-Z-]*:iam::\d{12}:role\/.+$/,CIDR:/^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\/(3[0-2]|[12]?\d)$/,SCHEDULE_EXPRESSION:/^(rate\(1 (?:minute|hour|day)\)|rate\((?:[2-9]|[1-9]\d+) (?:minutes|hours|days)\)|cron\([^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+\))$/,LAMBDA_RUNTIME_IDENTIFIER:/^[A-Za-z0-9._-]+$/,ENV_VAR_NAME:/^[A-Za-z_][A-Za-z0-9_]*$/});function kx(e){let t=/^rate\((\d+) (minute|minutes|hour|hours|day|days)\)$/.exec(e);if(!t)return;let r=t[1],i=t[2];if(r===void 0||i===void 0)return;let n=parseInt(r,10);if(!Number.isFinite(n)||n<1)return;let a=i==="minute"||i==="hour"||i==="day";if(!(a&&n!==1)&&!(!a&&n===1))return i==="minute"||i==="minutes"?{everyMs:n*6e4}:i==="hour"||i==="hours"?{everyMs:n*60*6e4}:{everyMs:n*24*60*6e4}}nK(kx,"parseRateExpression");var oO=["t4g.medium","m7g.medium","m8g.medium","r7g.medium","r8g.medium","m7g.large","m8g.large","r7g.large","r8g.large","m7g.xlarge","m8g.xlarge","r7g.xlarge","r8g.xlarge"];var E=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",NEW_APP_NAME:"Must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:tA,SSM_COMPONENT:Em,EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",SOURCE:"Source directory is required",BUILD_COMMAND:"Build command is required",OUTPUT_DIR:"Output directory is required",FORMS_TO:"Forms recipient address is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required",CONNECTED_RESOURCE_NAME:"Connected resource names must not be empty"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"},RUNTIME:"Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')"},ENV_VAR_NAME:"Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores",PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name must be 63 characters or less"}},CLICKHOUSE_STORAGE:{INTEGER:"ClickHouse storage must be a whole number of GiB",MIN:`ClickHouse storage must be at least ${100} GiB`,MAX:`ClickHouse storage cannot exceed ${16384} GiB (the gp3 ceiling)`},CLICKHOUSE_IOPS:{INTEGER:"ClickHouse iops must be a whole number",MIN:`ClickHouse iops must be at least ${3e3} (the gp3 baseline)`,MAX:`ClickHouse iops cannot exceed ${8e4} (the gp3 ceiling)`},CLICKHOUSE_THROUGHPUT:{INTEGER:"ClickHouse throughputMbps must be a whole number of MiB/s",MIN:`ClickHouse throughputMbps must be at least ${125} MiB/s (the gp3 baseline)`,MAX:`ClickHouse throughputMbps cannot exceed ${2e3} MiB/s (the gp3 ceiling)`},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days (the RDS automated-backup ceiling)"},CLICKHOUSE_BACKUP_RETENTION:{INTEGER:"ClickHouse backup retention must be an integer number of days",MIN:`ClickHouse backup retention must be at least ${1} day`,MAX:`ClickHouse backup retention cannot exceed ${3650} days`},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"},RESPONSE_TIME_MS:{MIN:"Response-time threshold must be at least 1 ms"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",IMAGE_DOCKER_MUTEX:"image and docker are mutually exclusive",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"},SCHEDULE_EXPRESSION:"Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'"});var aK=Object.defineProperty,br=(e,t)=>aK(e,"name",{value:t,configurable:!0}),oK=["us-east-2","us-west-2","us-east-1","eu-west-1","eu-central-1","ap-southeast-1"],sK=Object.freeze(oK.flatMap(e=>{let t=jo(e);return t?[t]:[]})),Lx=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","ap-southeast-1"]);function cf(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}br(cf,"parseRegionList");function Fx(e){return wn.includes(e)}br(Fx,"isValidRegion");function Ux(e){return/^[a-z]{2}-[a-z]+-[1-9]$/.test(e)}br(Ux,"isValidRegionFormat");function zx(e){if(!e)return Lx.slice(0,3);let t=e.toLowerCase().split("-"),r=t[0],i=t.length>1?t[1]:"",n=[];return r&&i&&(n=wn.filter(a=>a.startsWith(`${r}-${i}`))),n.length===0&&r&&(n=wn.filter(a=>a.startsWith(`${r}-`))),n.length>0?n.slice(0,3):Lx.slice(0,3)}br(zx,"getSuggestions");function Bx(e){if(Fx(e))return!0;let t=zx(e);return Ux(e)?`Unknown region. Try: ${t.join(", ")}`:`Invalid format. Try: ${t.join(", ")}`}br(Bx,"validateRegion");function sO(e){if(!e||e.trim()==="")return!0;let t=cf(e);for(let r of t){let i=Bx(r);if(i!==!0)return i}return!0}br(sO,"validateRegionList");function Gx(e,t){return e.filter(r=>r!==t)}br(Gx,"filterDuplicateRegions");function Vx(e){return{label:e.city,value:e.code,description:e.optIn?`${e.code} \u2014 opt-in required`:e.code}}br(Vx,"toRegionOption");function cO(){return hr.map(Vx)}br(cO,"getRegionOptions");function lO(e){return hr.filter(t=>t.code!==e).map(Vx)}br(lO,"getRegionOptionsExcluding");function uO(e){let t=hr.find(r=>r.code===e);return t?t.city:e}br(uO,"getRegionName");function dO(e){return t=>{let r=cf(t);return Gx(r,e)}}br(dO,"createRegionFormatter");var lf="27.0.0";var uf=["Aurora","Instance","GlobalAurora","ClickHouse"],as=["FARGATE","FARGATE_SPOT","EC2"],Gr=["standard","resilient","enterprise"],df=["tinkerer","lightweight","standard","resilient","enterprise"],Wx="custom",_l=[...df,Wx];var cK=Object.defineProperty,lK=(e,t)=>cK(e,"name",{value:t,configurable:!0}),dce=Object.freeze({RESOURCE_SUFFIXES:Object.freeze({storage:"Storage",database:"Database",cluster:"Cluster",function:"Function",instance:"Instance",compute:"Compute"})}),Tl=["ecs","lambda","ec2"],Cl=Object.freeze({ECS:"ecs",LAMBDA:"lambda",EC2:"ec2"}),pf=["code","container"],mf=Object.freeze({CODE:"code",CONTAINER:"container"}),ff=["ARM_64","X86_64"],pO="ARM_64",Dl=["NONE","AWS_IAM"],hf=["public","internal"],gf=["CPU","MEMORY"],fa=["messaging","compute"],yf=["ARM","STANDARD"],Kx=["Instance","Aurora"],os=["postgresql","mysql"],Il=["web","worker"],mO=["foundation","compliance","hardened"];var vf=["t3.nano","t3.micro","t3.small","t3.medium","t3.large","t3.xlarge","t3.2xlarge","t3a.nano","t3a.micro","t3a.small","t3a.medium","t3a.large","t3a.xlarge","t3a.2xlarge","t4g.nano","t4g.micro","t4g.small","t4g.medium","t4g.large","t4g.xlarge","t4g.2xlarge","c5.large","c5.xlarge","c5.2xlarge","c5.4xlarge","c5.9xlarge","c5.12xlarge","c5.18xlarge","c5.24xlarge","c5a.large","c5a.xlarge","c5a.2xlarge","c5a.4xlarge","c5a.8xlarge","c5a.12xlarge","c5a.16xlarge","c5a.24xlarge","c6g.medium","c6g.large","c6g.xlarge","c6g.2xlarge","c6g.4xlarge","c6g.8xlarge","c6g.12xlarge","c6g.16xlarge","r5.large","r5.xlarge","r5.2xlarge","r5.4xlarge","r5.8xlarge","r5.12xlarge","r5.16xlarge","r5.24xlarge","r5a.large","r5a.xlarge","r5a.2xlarge","r5a.4xlarge","r5a.8xlarge","r5a.12xlarge","r5a.16xlarge","r5a.24xlarge","r6g.medium","r6g.large","r6g.xlarge","r6g.2xlarge","r6g.4xlarge","r6g.8xlarge","r6g.12xlarge","r6g.16xlarge","i3.large","i3.xlarge","i3.2xlarge","i3.4xlarge","i3.8xlarge","i3.16xlarge","p3.2xlarge","p3.8xlarge","p3.16xlarge","g4dn.xlarge","g4dn.2xlarge","g4dn.4xlarge","g4dn.8xlarge","g4dn.12xlarge","g4dn.16xlarge","m5.large","m5.xlarge","m5.2xlarge","m5.4xlarge","m5.8xlarge","m5.12xlarge","m5.16xlarge","m5.24xlarge","m5a.large","m5a.xlarge","m5a.2xlarge","m5a.4xlarge","m5a.8xlarge","m5a.12xlarge","m5a.16xlarge","m5a.24xlarge"],fO=[0,1,5,10,15,30,60];function Ft(e,t){return e.includes(t)}lK(Ft,"constIncludes");var hO=1,gO=65535,gce=Object.freeze({postgresql:5432,mysql:3306}),yO=128,vO=10240,bf=1,Sf=900,Zx=1,Hx=1e3,ss=100,bO=100;var SO=3e3;var EO=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"],AO=["standard","assets","upload","website"],cs=["AES256","KMS"];var uK=Object.defineProperty,kl=(e,t)=>uK(e,"name",{value:t,configurable:!0}),Ut=kl(e=>c.union([c.literal(!1),e]),"optionalOrDisabled"),ha={check:kl(e=>e.minCapacity!==void 0&&e.maxCapacity!==void 0?e.minCapacity<=e.maxCapacity:!0,"check"),params:{message:E.CAPACITY_CONSTRAINT.MIN_LTE_MAX,path:["maxCapacity"]}},Nl=kl(e=>c.number().int(E.MEMORY_LIMIT.INTEGER).min(e,e===128?E.MEMORY_LIMIT.MIN_128:E.MEMORY_LIMIT.MIN_512).max(30720,E.MEMORY_LIMIT.MAX),"memoryLimitMiBSchema"),be=c.string().min(1,E.REQUIRED.RESOURCE_NAME).max(63,E.MAX_LENGTH.RESOURCE_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),_O=c.string().min(1,E.REQUIRED.BUCKET_NAME).max(63,E.MAX_LENGTH.BUCKET_NAME).regex(fe.BUCKET_NAME,E.BUCKET_NAME),TO=c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME);function Ef(e,t=fe.IDENTIFIER,r=E.IDENTIFIER){return c.string().min(2,E.IDENTIFIER_MIN_LENGTH).max(50,e).regex(t,r).refine(i=>!i.endsWith("-"),{message:E.IDENTIFIER_NO_TRAILING_HYPHEN}).refine(i=>!i.includes("--"),{message:E.IDENTIFIER_NO_CONSECUTIVE_HYPHENS})}kl(Ef,"identifierSchema");var lt=Ef(E.MAX_LENGTH.APP_NAME),xce=Ef(E.MAX_LENGTH.APP_NAME,fe.NEW_APP_NAME,E.NEW_APP_NAME),ga=c.number().int(E.PORT.INTEGER).min(hO,E.PORT.MIN).max(gO,E.PORT.MAX),bt=c.object({key:c.string(),sourceText:c.string()}).strict(),dK=c.object({__identifier:c.string()}).strict(),pK=c.object({__expression:c.string()}).strict(),mK=c.object({__call:c.string()}).strict(),fK=c.union([dK,pK,mK]),hK=c.union([c.string(),c.number(),c.boolean(),fK]),ls=c.record(c.string().regex(fe.ENV_VAR_NAME,E.ENV_VAR_NAME),hK),gK=c.object({id:c.string(),name:c.string().optional(),arn:c.string().optional(),field:c.string().optional()}).strict().refine(e=>e.name!==void 0!=(e.arn!==void 0),{message:"secretsImport requires exactly one of `name` or `arn`."}),CO=c.record(c.string(),gK),_ce=c.record(c.string(),c.unknown()),Jx=c.enum(_l).describe(`Application type must be one of: ${_l.join(", ")}`),Xx=c.enum(gr).describe(`OpenNext deployment pattern: ${gr.join(", ")}`),yK=c.enum(["before-imports","after-imports","after-app-init","after-tags","after-resource","end-of-file"]),vK=c.enum(["import","app-init","tags","database","compute","storage","network","messaging","cdn","pattern","vpc-peer","vpc-peer-accepter","cross-plan-connection","custom"]),DO=c.object({sourceText:c.string(),position:yK,afterManagedResource:c.object({type:vK,name:c.string().optional()}).strict().optional(),originalLine:c.number().int().optional(),leadingComments:c.array(c.string()).optional(),orphaned:c.boolean().optional(),orphanedComment:c.string().optional()}).strict(),IO=c.union([c.object({tier:c.enum(Gr)}).strict(),c.literal(!1)]),kO=c.union([c.object({instanceType:c.string().optional()}).strict(),c.literal(!1)]),bK=Ef(E.MAX_LENGTH.ORGANISATION_NAME),SK=c.string().regex(fe.EMAIL,E.EMAIL),xO=c.string().refine(e=>wn.includes(e),{message:E.REGION}),Tce=c.object({name:bK,email:SK,accountName:c.string().optional(),primaryRegion:xO.optional().default(hi),secondaryRegions:c.array(xO).optional(),security:c.enum(mO).optional(),force:c.boolean().optional()}).strict();function wl(e){return e.issues.map(t=>`${t.path.length>0?`${t.path.join(".")}: `:""}${t.message}`).join(`
313
- `)}kl(wl,"getZodErrorMessage");var Af=c.number().min(1,E.ALARM.PERCENTAGE.MIN).max(100,E.ALARM.PERCENTAGE.MAX),qx=c.union([Af,c.literal(!1)]),EK=c.union([c.number().min(1,E.ALARM.RESPONSE_TIME_MS.MIN),c.literal(!1)]),AK=c.number().min(1,E.ALARM.FREE_STORAGE_GIB.MIN),NO=c.union([c.literal(!1),c.object({cpuThreshold:qx.optional(),memoryThreshold:qx.optional(),runningTasksMinimum:c.number().int().min(0).optional(),http5xxThreshold:qx.optional(),p99ResponseTimeThresholdMs:EK.optional()}).strict()]),wO=c.union([c.literal(!1),c.object({cpuThreshold:Af.optional(),freeStorageThresholdGiB:AK.optional(),connectionsThreshold:c.number().int().min(1).optional()}).strict()]),PO=c.union([c.literal(!1),c.object({errorRateThreshold:Af.optional(),durationThresholdPercent:Af.optional()}).strict()]);var ya=c.number().int(E.BACKUP_RETENTION.INTEGER).min(1,E.BACKUP_RETENTION.MIN).max(35,E.BACKUP_RETENTION.MAX),RO=c.number().int(E.CLICKHOUSE_STORAGE.INTEGER).min(100,E.CLICKHOUSE_STORAGE.MIN).max(16384,E.CLICKHOUSE_STORAGE.MAX),OO=c.number().int(E.CLICKHOUSE_IOPS.INTEGER).min(3e3,E.CLICKHOUSE_IOPS.MIN).max(8e4,E.CLICKHOUSE_IOPS.MAX),$O=c.number().int(E.CLICKHOUSE_THROUGHPUT.INTEGER).min(125,E.CLICKHOUSE_THROUGHPUT.MIN).max(2e3,E.CLICKHOUSE_THROUGHPUT.MAX),xK=c.enum(oO),jO=c.number().int(E.CLICKHOUSE_BACKUP_RETENTION.INTEGER).min(1,E.CLICKHOUSE_BACKUP_RETENTION.MIN).max(3650,E.CLICKHOUSE_BACKUP_RETENTION.MAX),Pl=c.number().int(E.MONITORING_INTERVAL.INTEGER).refine(e=>Ft(fO,e),{message:E.MONITORING_INTERVAL.VALUES}),_f=c.number().int(E.DATABASE.PORT.INTEGER).min(1024,E.DATABASE.PORT.MIN).max(65535,E.DATABASE.PORT.MAX),_K=c.enum(uf).describe(`Database type must be one of: ${uf.join(", ")}`),TK=c.object({maxConnections:c.number().int(E.MAX_CONNECTIONS.INTEGER).min(1,E.MAX_CONNECTIONS.MIN).max(100,E.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:c.number().int(E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:c.number().int(E.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,E.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,E.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:c.boolean().optional()}).strict().describe("RDS Proxy configuration"),CK=c.object({instanceType:c.string().optional(),availabilityZone:c.string().optional()}).strict().describe("Read replica configuration"),DK=c.object({automaticallyAfterDays:c.number().int(E.ROTATION.INTEGER).min(1,E.ROTATION.MIN).max(365,E.ROTATION.MAX).optional()}).strict().describe("Secret rotation configuration"),Tf=c.object({username:c.string().min(1,E.REQUIRED.USERNAME).max(63,E.USERNAME.MAX_LENGTH).optional(),secretRotation:DK.optional()}).strict().describe("Database credentials configuration"),Cf=Ut(TK),Df=Ut(CK),IK=c.object({scaleWithWriter:c.boolean().optional(),enableDatabaseInsights:c.boolean().optional(),identifierSuffix:c.string().min(1,E.IDENTIFIER_SUFFIX.REQUIRED).max(50,E.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:c.string().optional()}).strict().describe("Configuration for a single Aurora reader instance"),Rl=c.object({enableDatabaseInsights:c.boolean().optional(),identifierSuffix:c.string().min(1,E.IDENTIFIER_SUFFIX.REQUIRED).max(50,E.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:c.string().optional()}).strict().describe("Configuration for Aurora writer instance"),kK=c.object({count:c.number().int(E.READER.COUNT.INTEGER).min(0,E.READER.COUNT.MIN).max(15,E.READER.COUNT.MAX).optional(),instances:c.array(IK).max(15,E.READER_INSTANCES.MAX).optional(),defaultEnableDatabaseInsights:c.boolean().optional()}).strict().refine(e=>!(e.count!==void 0&&e.instances!==void 0),{message:E.READER_INSTANCES.COUNT_OR_INSTANCES,path:["count"]}).describe("Aurora readers configuration"),Ol=Ut(kK),NK=c.object({awsManaged:c.literal(!0)}).strict(),wK=c.object({useCMK:c.literal(!0)}).strict(),MO=c.union([NK,wK]),PK=c.object({mode:c.enum(["standard","advanced"]).optional(),encryptionKey:MO.optional()}).strict().describe("Database Insights configuration"),If=Ut(PK),kf=c.object({storageKey:MO.optional()}).strict().describe("Encryption configuration (DESTRUCTIVE to change storageKey)"),$l=c.object({name:be,type:_K,databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME),instanceType:c.string().optional(),allocatedStorage:c.number().optional(),multiAz:c.boolean().optional(),publiclyAccessible:c.boolean().optional(),databaseInsights:If.optional(),port:_f.optional(),deletionProtection:c.boolean().optional(),proxy:Cf.optional(),credentials:Tf.optional(),readReplica:Df.optional(),encryption:kf.optional(),writer:Rl.optional(),readers:Ol.optional(),backupRetention:ya.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:Pl.optional(),primaryRegion:c.string().optional(),secondaryRegions:c.array(c.string()).optional(),globalClusterIdentifier:c.string().optional(),enableGlobalWriteForwarding:c.boolean().optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional(),databaseEngine:c.enum(os).optional(),engineExpression:c.string().optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional(),alarms:wO.optional()}).strict(),Nf=c.object({appName:lt,nameProvidedByFlag:c.boolean().optional(),databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME),resourceName:be.optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional(),databaseInsights:If.optional(),port:_f.optional(),proxy:Cf.optional(),credentials:Tf.optional(),encryption:kf.optional(),deletionProtection:c.boolean().optional()}).strict(),LO={databaseType:c.literal("Instance"),instanceType:c.string().optional(),multiAz:c.boolean().optional(),readReplica:Df.optional(),publiclyAccessible:c.boolean().optional(),backupRetention:ya.optional(),allocatedStorage:c.number().optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},FO={databaseType:c.literal("Aurora"),writer:Rl.optional(),readers:Ol.optional(),backupRetention:ya.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:Pl.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},UO={databaseType:c.literal("GlobalAurora"),primaryRegion:c.string().min(1,E.GLOBAL_AURORA.PRIMARY_REGION_REQUIRED),secondaryRegions:c.array(c.string()).optional(),globalClusterIdentifier:c.string().optional(),enableGlobalWriteForwarding:c.boolean().optional(),writer:Rl.optional(),readers:Ol.optional(),backupRetention:ya.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:Pl.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},zO=c.object({appName:lt,nameProvidedByFlag:c.boolean().optional(),databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME),resourceName:be.optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional()}).strict(),BO={databaseType:c.literal("ClickHouse"),instanceType:xK.optional(),storageGb:RO.optional(),iops:OO.optional(),throughputMbps:$O.optional(),coldTier:c.union([c.object({mode:c.literal("s3")}).strict(),c.literal(!1)]).optional(),optimiseSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupVerify:c.literal(!1).optional(),backupRetentionDays:jO.optional()},RK=Nf.extend(LO).strict(),OK=Nf.extend(FO).strict(),$K=Nf.extend(UO).strict(),jK=zO.extend(BO).strict(),jce=c.discriminatedUnion("databaseType",[RK,OK,$K,jK]),Yx=Nf.extend({resourceName:be}).strict(),MK=Yx.extend(LO).strict(),LK=Yx.extend(FO).strict(),FK=Yx.extend(UO).strict(),UK=zO.extend({resourceName:be}).strict(),zK=UK.extend(BO).strict(),Mce=c.discriminatedUnion("databaseType",[MK,LK,FK,zK]),Lce=c.object({appName:lt,databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME),maxConnections:c.number().int(E.MAX_CONNECTIONS.INTEGER).min(1,E.MAX_CONNECTIONS.MIN).max(100,E.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:c.number().int(E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:c.number().int(E.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,E.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,E.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:c.boolean().optional(),nameProvidedByFlag:c.boolean().optional()}).strict(),BK=["S","N","B"],xf=c.object({name:c.string(),type:c.enum(BK)}).strict(),GO=c.object({name:be,partitionKey:xf,sortKey:xf.optional(),globalSecondaryIndexes:c.array(c.object({indexName:c.string(),partitionKey:xf,sortKey:xf.optional()}).strict()).optional(),ttlAttribute:c.string().optional(),stream:c.boolean().optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional()}).strict(),GK=c.object({mode:c.literal("s3")}).strict(),VO=c.object({name:be,type:c.literal("ClickHouse"),databaseName:TO,instanceType:c.string().optional(),storageGb:RO.optional(),iops:OO.optional(),throughputMbps:$O.optional(),coldTier:c.union([GK,c.literal(!1)]).optional(),optimiseSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupVerify:c.literal(!1).optional(),backupRetentionDays:jO.optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional()}).strict();var VK=c.object({count:c.number().int(E.NAT_GATEWAY.INTEGER).min(0,E.NAT_GATEWAY.MIN).max(3,E.NAT_GATEWAY.MAX).optional()}).strict().describe("NAT gateway configuration"),WO=Ut(VK),Qx=c.enum(["cloudwatch","s3"]),WK=c.object({destination:Qx.optional(),retentionDays:c.number().int(E.RETENTION_DAYS.INTEGER).min(1,E.RETENTION_DAYS.MIN).max(365,E.RETENTION_DAYS.MAX).optional(),trafficType:c.enum(["ALL","ACCEPT","REJECT"]).optional()}).strict().describe("VPC flow log configuration"),KO=Ut(WK),KK=c.object({s3:c.boolean().optional(),dynamodb:c.boolean().optional()}).strict().describe("Gateway VPC endpoints (FREE)"),ZK=Ut(KK),HK=c.object({ecr:c.boolean().optional(),secretsManager:c.boolean().optional(),kms:c.boolean().optional(),cloudwatchLogs:c.boolean().optional(),ssm:c.boolean().optional(),sts:c.boolean().optional()}).strict().describe("Interface VPC endpoints (cost per hour)"),JK=Ut(HK),XK=c.object({gateway:ZK.optional(),interface:JK.optional()}).strict().describe("VPC endpoints configuration"),ZO=Ut(XK),va=c.object({maxAzs:c.number().int(E.MAX_AZS.INTEGER).min(1,E.MAX_AZS.MIN).max(3,E.MAX_AZS.MAX).optional(),natGateways:WO.optional(),flowLogs:KO.optional(),vpcEndpoints:ZO.optional(),cidrMask:c.number().int(E.CIDR_MASK.INTEGER).min(16,E.CIDR_MASK.MIN).max(28,E.CIDR_MASK.MAX).optional()}).strict(),HO=c.string().min(1,E.REQUIRED.NETWORK_NAME).max(50,E.MAX_LENGTH.NETWORK_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),JO=va.extend({name:HO}).strict(),XO=Ut(va),Gce=c.object({appName:lt,networkName:HO.optional(),maxAzs:c.number().int(E.MAX_AZS.INTEGER).min(1,E.MAX_AZS.MIN).max(3,E.MAX_AZS.MAX).optional(),natGateways:WO.optional(),flowLogs:KO.optional(),vpcEndpoints:ZO.optional()}).strict(),qK=fe.CIDR,e_=c.string().regex(qK,E.CIDR),YK=c.object({kind:c.literal("database"),resource:c.string().min(1,E.REQUIRED.RESOURCE_REFERENCE),name:be,allowedFromCidrs:c.array(e_),access:c.enum(["read","write","readWrite"]).optional()}).strict(),QK=c.object({kind:c.literal("ecsService"),resource:c.string().min(1,E.REQUIRED.RESOURCE_REFERENCE),serviceName:c.string().min(1,E.REQUIRED.SERVICE_NAME),name:be,allowedFromCidrs:c.array(e_),port:ga.optional()}).strict(),eZ=c.discriminatedUnion("kind",[YK,QK]),qO=c.object({name:be,peerAppName:c.string().min(1,E.REQUIRED.APP_NAME),peerAccountId:c.string().regex(fe.AWS_ACCOUNT_ID,E.AWS_ACCOUNT_ID),peerRegion:c.string().min(1,E.VPC_PEER.REGION_REQUIRED).optional(),peerVpcId:c.string().regex(fe.VPC_ID,E.VPC_ID).optional(),peerVpcCidr:e_.optional(),peerRoleArn:c.string().regex(fe.ROLE_ARN,E.ROLE_ARN).optional(),peerRouteTableIds:c.array(c.string().min(1,E.VPC_PEER.ROUTE_TABLE_ID_REQUIRED)).optional(),localVpcName:c.string().min(1,E.REQUIRED.NETWORK_NAME).optional(),enableDnsResolution:c.boolean().optional()}).strict(),t_=c.object({name:be,requesterAccountIds:c.array(c.string().regex(fe.AWS_ACCOUNT_ID,E.AWS_ACCOUNT_ID)).min(1,E.VPC_PEER.MIN_REQUESTER_ACCOUNTS),localVpcName:c.string().min(1,E.REQUIRED.NETWORK_NAME).optional(),publishToSsm:c.boolean().optional(),exposedResources:c.array(eZ).optional()}).strict();var wf=["storage","cdn","compute"],tZ=c.object({sid:c.string().optional(),effect:c.enum(["Allow","Deny"]),principals:c.array(c.string()),actions:c.array(c.string()),resources:c.array(c.string()).optional(),conditions:c.record(c.string(),c.record(c.string(),c.union([c.string(),c.array(c.string())]))).optional()}).strict(),jl=c.object({name:be,bucketName:c.string().optional(),publicReadAccess:c.boolean().optional(),websiteHosting:c.object({indexDocument:c.string(),errorDocument:c.string().optional()}).strict().optional(),backupVaultTier:c.enum(Gr).optional(),versioned:c.boolean().optional(),encryption:c.enum(cs).optional(),kmsKeyArn:c.string().optional(),cors:c.array(c.object({allowedOrigins:c.array(c.string()),allowedMethods:c.array(c.string()),allowedHeaders:c.array(c.string()).optional(),exposedHeaders:c.array(c.string()).optional(),maxAge:c.number().optional()}).strict()).optional(),deployment:c.object({source:c.string(),prune:c.boolean().optional(),cacheControl:c.object({maxAge:c.number().optional(),immutable:c.boolean().optional()}).strict().optional()}).strict().optional(),retain:c.boolean().optional(),resourcePolicyStatements:c.array(tZ).optional(),stackPlacement:c.enum(wf).optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional()}).strict().refine(e=>e.encryption!=="KMS"||!!e.kmsKeyArn,{message:E.KMS.KEY_REQUIRED}),Jce=c.object({appName:lt,bucketName:_O,nameProvidedByFlag:c.boolean().optional(),storagePreset:c.enum(AO).optional(),publicReadAccess:c.boolean().optional(),websiteHosting:c.object({indexDocument:c.string(),errorDocument:c.string().optional()}).strict().optional(),backupVaultTier:c.enum(Gr).optional(),versioned:c.boolean().optional(),encryption:c.enum(cs).optional(),kmsKeyArn:c.string().optional(),cors:c.array(c.object({allowedOrigins:c.array(c.string()),allowedMethods:c.array(c.string()),allowedHeaders:c.array(c.string()).optional(),exposedHeaders:c.array(c.string()).optional(),maxAge:c.number().optional()}).strict()).optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional()}).strict().refine(e=>e.encryption!=="KMS"||!!e.kmsKeyArn,{message:E.KMS.KEY_REQUIRED,path:["kmsKeyArn"]});var r_=c.enum(["DESTROY","RETAIN"]),Ml=c.object({name:be,queueType:c.enum(["standard","fifo"]).default("standard"),visibilityTimeout:c.number().int(E.SQS.VISIBILITY_TIMEOUT.INTEGER).min(0,E.SQS.VISIBILITY_TIMEOUT.MIN).max(43200,E.SQS.VISIBILITY_TIMEOUT.MAX).optional(),retentionPeriod:c.number().int(E.SQS.RETENTION_PERIOD.INTEGER).min(60,E.SQS.RETENTION_PERIOD.MIN).max(1209600,E.SQS.RETENTION_PERIOD.MAX).optional(),contentBasedDeduplication:c.boolean().optional(),removalPolicy:r_.optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional()}).strict();var YO=c.object({type:c.literal("basic-auth"),username:c.string().min(1),password:c.string().min(1)}).strict(),Ll=c.object({name:be,defaultOriginRef:c.string(),behaviours:c.array(c.object({pathPattern:c.string(),originRef:c.string(),cachePolicy:c.enum(["CACHING_OPTIMIZED","CACHING_DISABLED"]).optional()}).strict()).optional(),customDomain:c.string().optional(),certificateArn:c.string().optional(),domain:c.string().optional(),originHostname:c.string().optional(),accessGate:c.union([c.literal(!1),YO]).optional(),extraProperties:c.array(bt).optional()}).strict(),nle=c.object({appName:c.string(),name:be.optional(),defaultOriginRef:c.string(),behaviours:c.array(c.object({pathPattern:c.string(),originRef:c.string(),cachePolicy:c.enum(["CACHING_OPTIMIZED","CACHING_DISABLED"]).optional()}).strict()).optional(),customDomain:c.string().optional(),certificateArn:c.string().optional(),domain:c.string().optional(),originHostname:c.string().optional(),accessGate:c.union([c.literal(!1),YO]).optional(),nameProvidedByFlag:c.boolean().optional()}).strict();var rZ=Object.defineProperty,n_=(e,t)=>rZ(e,"name",{value:t,configurable:!0}),nZ=new Set(["t4g","c6g","c6gd","c6gn","c7g","c7gd","c7gn","r6g","r6gd","r7g","r7gd","r8g","r8gd","c8g","c8gd","c8gn","m6g","m6gd","m7g","m7gd","m8g","m8gd","x8g","i8g","a1","x2gd","im4gn","is4gen","i4g","hpc7g"]);function xi(e){let t=e.split(".")[0]??"";return nZ.has(t)?"ARM":"STANDARD"}n_(xi,"getArchitectureForInstanceType");function Pf(e,t){let r=xi(e);return r!==t?{valid:!1,message:`Instance type '${e}' requires ${r} architecture, but '${t}' AMI was specified. Use a ${r==="ARM"?"Graviton instance (t4g, c6g, r6g, m6g, etc.)":"Intel/AMD instance (t3, c5, r5, m5, etc.)"} instead.`}:{valid:!0}}n_(Pf,"validateArchitectureMatch");function QO(e,t){return xi(e)===t}n_(QO,"isArchitectureCompatible");var iZ=Object.defineProperty,Rf=(e,t)=>iZ(e,"name",{value:t,configurable:!0});var aZ=1;var oZ=/^[A-Za-z0-9_.-]+$/,sZ=c.object({id:c.string().min(1,"buildSecret id cannot be empty").regex(oZ,"buildSecret id may contain only letters, digits, '_', '.', and '-' (no comma, '=', or whitespace, which would break the buildx --secret argv)"),ssm:c.string().min(1,"ssm parameter name cannot be empty").optional(),secretsManager:c.object({name:c.string().min(1,"secret name cannot be empty").optional(),arn:c.string().min(1,"secret arn cannot be empty").optional(),field:c.string().min(1,"secret field cannot be empty").optional()}).strict().refine(e=>e.name===void 0!=(e.arn===void 0),"secretsManager requires exactly one of name or arn").optional(),env:c.string().min(1,"env variable name cannot be empty").optional()}).strict().superRefine((e,t)=>{[e.ssm,e.secretsManager,e.env].filter(r=>r!==void 0).length!==1&&t.addIssue({code:c.ZodIssueCode.custom,message:"buildSecret requires exactly one source (ssm, secretsManager, or env)"})}),cZ=c.union([c.string(),c.object({ssm:c.string().min(1,"ssm parameter name cannot be empty").optional(),secretsManager:c.object({name:c.string().min(1,"secret name cannot be empty").optional(),arn:c.string().min(1,"secret arn cannot be empty").optional(),field:c.string().min(1,"secret field cannot be empty").optional()}).strict().refine(e=>e.name===void 0!=(e.arn===void 0),"secretsManager requires exactly one of name or arn").optional(),env:c.string().min(1,"env variable name cannot be empty").optional(),acknowledgePublic:c.boolean().optional()}).strict().superRefine((e,t)=>{[e.ssm,e.secretsManager,e.env].filter(r=>r!==void 0).length!==1&&t.addIssue({code:c.ZodIssueCode.custom,message:"buildArg value requires exactly one source (ssm, secretsManager, or env)"})})]),on=c.object({path:c.string(),context:c.string().min(1,"context cannot be empty").optional(),target:c.string().min(1,"target cannot be empty").optional(),buildArgs:c.record(c.string(),cZ).optional(),buildSecrets:c.array(sZ).optional()}).strict(),cle=on.partial();function lZ(e,t){if(t===void 0)return e;let r=t.context??e.context,i=t.target??e.target,n=t.buildArgs??e.buildArgs,a=t.buildSecrets??e.buildSecrets;return{path:t.path??e.path,...r!==void 0&&{context:r},...i!==void 0&&{target:i},...n!==void 0&&{buildArgs:n},...a!==void 0&&{buildSecrets:a}}}Rf(lZ,"mergeDockerBuild");function i_(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}Rf(i_,"isRecord");function e$(e){if(!i_(e)||typeof e.path!="string"||e.path.length===0)return;let t=typeof e.context=="string"&&e.context.length>0?e.context:void 0,r=typeof e.target=="string"&&e.target.length>0?e.target:void 0,i=i_(e.buildArgs)&&Object.keys(e.buildArgs).length>0?e.buildArgs:void 0,n=Array.isArray(e.buildSecrets)&&e.buildSecrets.length>0?e.buildSecrets:void 0,a={path:e.path,...t!==void 0&&{context:t},...r!==void 0&&{target:r},...i!==void 0&&{buildArgs:i},...n!==void 0&&{buildSecrets:n}},o=on.safeParse(a);return o.success?o.data:void 0}Rf(e$,"normaliseDockerBuild");function uZ(e){if(e===void 0)return;let t=e$(e);return t===void 0?void 0:JSON.stringify(t)}Rf(uZ,"dockerBuildFingerprint");var dZ=c.object({name:c.string(),clusterName:c.string().optional(),docker:on.optional(),containerPort:c.number().optional(),secrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),importedSecretNames:c.array(c.string()).optional(),schemaGateImageTag:c.string().optional()}).strict(),pZ=c.object({type:c.enum(gr),name:c.string(),source:c.string()}).strict(),mZ=c.object({repositoryName:c.string()}).strict(),fZ=["x86_64","arm64"],hZ=c.object({name:c.string(),secrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),importedSecretNames:c.array(c.string()).optional(),docker:on.optional(),imageKey:c.string().optional(),architecture:c.enum(fZ).optional()}).strict(),gZ=c.object({templateHash:c.string(),synthTimestamp:c.string()}).strict(),yZ=c.object({constructPath:c.string().max(512),group:c.string().max(128),resourceType:c.string().max(256)}).strict(),vZ=c.object({synthesisedBy:c.string().min(1).max(128),minimumEngineVersion:c.string().min(1).max(32),maximumEngineMajor:c.number().int().min(0).optional(),minimumAwsCdkCli:c.string().min(1).max(32).optional()}).strict(),bZ=c.object({appName:c.string().min(1).max(128),slot:c.string().min(1).max(64),clusterName:c.string().min(1).max(128),anchor:c.string().min(1).max(128),pinned:c.boolean(),currentServiceName:c.string().min(1).max(256),legacyKey:c.string().min(1).max(256),legacyAnchor:c.string().min(1).max(256),legacyServiceName:c.string().min(1).max(512),legacyKeyFields:c.array(c.string().max(64)).max(32)}).strict(),SZ=c.object({constructPath:c.string().min(1).max(512),resourceType:c.string().min(1).max(256),physicalNameHint:c.string().min(1).max(512),policy:c.enum(["retain","snapshot","adopted"]),destroyDisposition:c.enum(["survives","deleted-on-explicit-destroy"]),reason:c.string().min(1).max(1024),costClass:c.enum(["none","storage","fixed-monthly"]),cleanupHint:c.string().min(1).max(1024)}).strict(),lle=c.object({version:c.literal(aZ),generatedAt:c.string(),appName:c.string(),services:c.array(dZ),lambdas:c.array(hZ),pattern:pZ.optional(),ecr:mZ.optional(),stacks:c.record(c.string(),gZ),resourceMap:c.record(c.string(),yZ).optional(),engineCompat:vZ.optional(),identityAliases:c.array(bZ).optional(),residuals:c.array(SZ).optional()}).strict();var EZ=Object.defineProperty,AZ=(e,t)=>EZ(e,"name",{value:t,configurable:!0});function r$(e){return!(e.image!==void 0&&e.docker!==void 0)}AZ(r$,"imageDockerMutexCheck");var n$=c.number().int(E.CAPACITY.MIN.INTEGER).min(Zx,E.GENERATOR_CAPACITY.MIN.MIN).max(Hx,E.GENERATOR_CAPACITY.MIN.MAX),i$=c.number().int(E.CAPACITY.MAX.INTEGER).min(Zx,E.GENERATOR_CAPACITY.MAX.MIN).max(Hx,E.GENERATOR_CAPACITY.MAX.MAX),us=c.number().int(E.LAMBDA.MEMORY.INTEGER).min(yO,E.LAMBDA.MEMORY.MIN).max(vO,E.LAMBDA.MEMORY.MAX).refine(e=>e===128||e%64===0,E.LAMBDA.MEMORY.MULTIPLE),a$=c.string().regex(fe.LAMBDA_RUNTIME_IDENTIFIER,E.LAMBDA.RUNTIME),a_=c.number().int(E.CPU.INTEGER).min(256,E.CPU.MIN).max(4096,E.CPU.MAX),$f=c.number().int(E.CAPACITY.DESIRED.INTEGER).min(0,E.CAPACITY.DESIRED.MIN).max(ss,E.CAPACITY.DESIRED.MAX),Fl=c.object({connectToDatabase:c.array(c.string()).optional()}).strict(),xZ=c.object({minSize:c.number().int(E.CAPACITY.WARM_POOL.MIN_SIZE.INTEGER).min(0,E.CAPACITY.WARM_POOL.MIN_SIZE.MIN).max(bO,E.CAPACITY.WARM_POOL.MIN_SIZE.MAX).optional(),reuseOnScaleIn:c.boolean().optional()}).strict(),o_=c.object({instanceType:c.string().optional(),amiHardwareType:c.enum(yf).optional(),minCapacity:c.number().int(E.CAPACITY.MIN.INTEGER).min(0,E.CAPACITY.MIN.MIN_0).max(ss,E.CAPACITY.MIN.MAX).optional(),maxCapacity:c.number().int(E.CAPACITY.MAX.INTEGER).min(1,E.CAPACITY.MAX.MIN_1).max(ss,E.CAPACITY.MAX.MAX).optional(),memoryLimitMiB:Nl(128).optional(),warmPool:xZ.optional(),extraProperties:c.array(bt).optional()}).strict().superRefine((e,t)=>{if(!e.instanceType||!e.amiHardwareType)return;let r=Pf(e.instanceType,e.amiHardwareType);r.valid||t.addIssue({code:"custom",message:r.message??E.ARCHITECTURE_MISMATCH,path:["instanceType"]})}).superRefine((e,t)=>{e.minCapacity===0&&!e.warmPool&&t.addIssue({code:"custom",message:E.CAPACITY.WARM_POOL_REQUIRED,path:["minCapacity"]}),e.warmPool?.minSize!==void 0&&e.maxCapacity!==void 0&&e.warmPool.minSize>e.maxCapacity&&t.addIssue({code:"custom",message:E.CAPACITY.WARM_POOL.MIN_SIZE_EXCEEDS_MAX_CAPACITY,path:["warmPool","minSize"]})}),_Z=c.enum(Tl).describe(`Compute type must be one of: ${Tl.join(", ")}`),s_=c.enum(as).describe(`ECS capacity provider must be one of: ${as.join(", ")}`),c_=c.string().refine(e=>Ft(vf,e),{message:E.INSTANCE_TYPE}),o$=c.object({sourceType:c.enum(["sqs","dynamodb","eventbridge"]),sourceRef:c.string().describe("Name of the source resource"),batchSize:c.number().int(E.BATCH_SIZE.INTEGER).min(1,E.BATCH_SIZE.MIN).max(1e4,E.BATCH_SIZE.MAX).optional(),startingPosition:c.enum(["TRIM_HORIZON","LATEST"]).optional(),maxBatchingWindow:c.number().int(E.BATCHING_WINDOW.INTEGER).min(0,E.BATCHING_WINDOW.MIN).max(300,E.BATCHING_WINDOW.MAX).optional(),reportBatchItemFailures:c.boolean().optional()}).strict(),TZ=c.object({name:c.string().min(1,E.REQUIRED.CONTAINER_NAME).optional(),image:c.string().optional(),port:ga.optional(),environment:ls.optional(),secretsImport:CO.optional(),command:c.array(c.string()).optional(),entryPoint:c.array(c.string()).optional(),essential:c.boolean().optional(),healthCheck:c.object({command:c.array(c.string()),interval:c.number().int(E.HEALTH_CHECK.INTERVAL.INTEGER).min(5,E.HEALTH_CHECK.INTERVAL.MIN).max(300,E.HEALTH_CHECK.INTERVAL.MAX).optional(),timeout:c.number().int(E.HEALTH_CHECK.TIMEOUT.INTEGER).min(2,E.HEALTH_CHECK.TIMEOUT.MIN).max(60,E.HEALTH_CHECK.TIMEOUT.MAX).optional(),retries:c.number().int(E.HEALTH_CHECK.RETRIES.INTEGER).min(1,E.HEALTH_CHECK.RETRIES.MIN).max(10,E.HEALTH_CHECK.RETRIES.MAX).optional(),startPeriod:c.number().int(E.HEALTH_CHECK.START_PERIOD.INTEGER).min(0,E.HEALTH_CHECK.START_PERIOD.MIN).max(300,E.HEALTH_CHECK.START_PERIOD.MAX).optional()}).strict().optional(),ssmSecrets:c.array(c.string().regex(fe.SECRET_NAME,E.SECRET_NAME)).optional(),extraProperties:c.array(bt).optional()}).strict(),s$=c.string().min(1,E.REQUIRED.SERVICE_NAME).max(255,E.MAX_LENGTH.SERVICE_NAME).regex(fe.ECS_SERVICE_NAME,E.ECS_SERVICE_NAME),c$=c.object({domain:c.string().optional(),loadBalancer:c.union([c.literal(!1),c.enum(hf)]).optional(),directAccess:c.boolean().optional(),extraProperties:c.array(bt).optional()}).strict().refine(e=>!(e.directAccess&&e.domain),{message:E.DIRECT_ACCESS.NO_DOMAIN,path:["directAccess"]}).refine(e=>!(e.directAccess&&typeof e.loadBalancer=="string"),{message:E.DIRECT_ACCESS.NO_LOAD_BALANCER}).describe("Cluster-level configuration"),Of=c.object({path:c.string().optional(),host:c.string().optional(),priority:c.number().int(E.PRIORITY.INTEGER).min(1,E.PRIORITY.MIN).max(5e4,E.PRIORITY.MAX).optional(),healthCheckPath:c.string().optional()}).strict().describe("Path/host-based routing configuration"),CZ=c.object({desiredCount:$f.optional(),minCapacity:c.number().int(E.CAPACITY.MIN.INTEGER).min(0,E.CAPACITY.MIN.MIN_0).max(ss,E.CAPACITY.MIN.MAX).optional(),maxCapacity:c.number().int(E.CAPACITY.MAX.INTEGER).min(1,E.CAPACITY.MAX.MIN_1).max(ss,E.CAPACITY.MAX.MAX).optional(),scalingType:c.enum(gf).optional()}).strict().refine(ha.check,ha.params).describe("ECS service scaling configuration"),l$=c.object({name:s$,docker:on.optional(),needsDatabaseConnection:c.boolean().optional(),needsStorageConnection:c.boolean().optional(),needsMessagingConnection:c.boolean().optional(),image:c.string().optional(),containers:c.array(TZ).optional(),routing:c.union([Of,c.array(Of).min(1)]).optional(),serviceType:c.enum(Il).optional(),cpu:a_.optional(),memoryLimitMiB:Nl(512).optional(),desiredCount:$f.optional(),scaling:Ut(CZ).optional(),capacityProvider:s_,ec2Config:o_.optional(),ssmSecretsPath:c.string().regex(fe.SSM_PATH,E.SSM_PATH).optional(),extraProperties:c.array(bt).optional(),alarms:NO.optional()}).strict().superRefine((e,t)=>{r$(e)||t.addIssue({code:"custom",path:["docker"],message:E.IMAGE_DOCKER_MUTEX})}).describe("Configuration for a service in an ECS cluster"),Ul=c.object({name:be,type:_Z,needsConnection:c.boolean(),connectedDatabase:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),connectedStorage:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),connectedMessaging:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),cluster:c$.optional(),services:c.array(l$).optional(),docker:on.partial().optional(),deployment:c.enum(pf).optional(),codePath:c.string().optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(bf,E.LAMBDA.TIMEOUT.MIN).max(Sf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:us.optional(),handler:c.string().optional(),runtime:a$.optional(),environment:ls.optional(),secrets:ls.optional(),eventSources:c.array(o$).optional(),functionUrl:c.object({authType:c.enum(Dl)}).strict().optional(),description:c.string().optional(),scheduleExpression:c.string().optional(),scheduleStackPlacement:c.enum(fa).optional(),architecture:c.enum(ff).optional(),ephemeralStorageSize:c.number().int(E.EPHEMERAL_STORAGE.INTEGER).min(512,E.EPHEMERAL_STORAGE.MIN).max(10240,E.EPHEMERAL_STORAGE.MAX).optional(),functionName:c.string().optional(),ssmSecrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),alarms:PO.optional(),instanceType:c_.optional(),enableSSH:c.boolean().optional(),keyName:c.string().optional(),userData:c.string().optional(),securityGroups:c.array(c.string()).optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional()}).strict().superRefine((e,t)=>{if(e.type==="ecs"&&e.services)for(let r=0;r<e.services.length;r++){let i=e.services[r];i?.ec2Config?.instanceType&&!i.ec2Config.amiHardwareType&&xi(i.ec2Config.instanceType)!=="ARM"&&t.addIssue({code:"custom",message:`Service '${i.name??r}' uses instance type '${i.ec2Config.instanceType}' (x86), which requires Docker images built for linux/amd64. The default build targets linux/arm64 (Graviton). Use a Graviton instance type (t4g, c6g, r6g, m6g, etc.) or set amiHardwareType: "STANDARD" to acknowledge x86.`,path:["services",r,"ec2Config","instanceType"]})}e.type==="lambda"&&e.deployment==="container"&&e.architecture==="X86_64"&&t.addIssue({code:"custom",message:"Lambda architecture 'X86_64' requires Docker images built for linux/amd64, but the default build targets linux/arm64. Use 'ARM_64' for Graviton Lambdas (recommended) or ensure your build pipeline targets linux/amd64.",path:["architecture"]})}),vle=c.object({appName:lt,clusterName:be,containerPort:ga,nameProvidedByFlag:c.boolean().optional(),ecrRepository:c.string().optional(),capacityProvider:s_.optional(),useAppEcr:c.boolean().optional(),desiredCount:$f.optional(),cpu:a_.optional(),memoryLimitMiB:Nl(512).optional(),minCapacity:n$.optional(),maxCapacity:i$.optional(),ec2Config:o_.optional(),connectionConfig:Fl.optional()}).strict().refine(ha.check,ha.params),ble=c.object({appName:lt,functionName:be,nameProvidedByFlag:c.boolean().optional(),lambdaType:c.enum(["basic","web","custom"]).optional(),ecrRepository:c.string().optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(bf,E.LAMBDA.TIMEOUT.MIN).max(Sf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:us.optional(),enableFunctionUrl:c.boolean().optional(),description:c.string().optional(),enableCors:c.boolean().optional(),corsOrigins:c.string().optional(),corsHeaders:c.string().optional(),corsMethods:c.array(c.enum(EO)).optional(),corsCredentials:c.boolean().optional(),connectionConfig:Fl.optional()}).strict(),Sle=c.object({appName:lt,instanceName:be,nameProvidedByFlag:c.boolean().optional(),instanceType:c_.optional(),enableSSH:c.boolean().optional(),minCapacity:n$.optional(),maxCapacity:i$.optional(),connectionConfig:Fl.optional()}).strict().refine(ha.check,ha.params),Ele=c.object({appName:lt,clusterName:be,serviceName:s$,capacityProvider:s_,containerPort:ga.optional(),cpu:a_.optional(),memoryLimitMiB:Nl(512).optional(),desiredCount:$f.optional(),ec2Config:o_.optional(),routing:c.union([Of,c.array(Of).min(1)]).optional(),docker:on.partial().optional(),nameProvidedByFlag:c.boolean().optional(),connectionConfig:Fl.optional()}).strict(),l_=c.object({appName:lt,computeName:be,nameProvidedByFlag:c.boolean().optional(),connectionConfig:Fl.optional()}).strict(),DZ=l_.extend({type:c.literal("ecs"),cluster:c$.optional(),services:c.array(l$).min(1,E.SERVICE.MIN_REQUIRED),docker:on.partial().optional()}).strict().refine(e=>{let t=e.services.filter(r=>r.containers?.some(i=>i.port));return t.length>1?t.every(r=>(Array.isArray(r.routing)?r.routing:r.routing?[r.routing]:[]).some(i=>i.path||i.host)):!0},{message:E.SERVICE.ROUTING_REQUIRED}).refine(e=>{let t=e.services.map(r=>r.name);return new Set(t).size===t.length},{message:E.SERVICE.UNIQUE_WITHIN_CLUSTER}),IZ=l_.extend({type:c.literal("lambda"),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(bf,E.LAMBDA.TIMEOUT.MIN).max(Sf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:us.optional(),handler:c.string().optional(),runtime:a$.optional(),environment:ls.optional(),secrets:ls.optional(),description:c.string().optional(),functionUrl:c.union([c.object({authType:c.enum(Dl).optional()}).strict(),c.literal(!1)]).optional(),eventSources:c.array(o$).optional()}).strict(),kZ=l_.extend({type:c.literal("ec2"),instanceType:c_.optional(),enableSSH:c.boolean().optional(),keyName:c.string().optional(),userData:c.string().optional(),securityGroups:c.array(c.string()).optional()}).strict(),Ale=c.discriminatedUnion("type",[DZ,IZ,kZ]),t$=c.object({path:c.string().min(1,E.REQUIRED.ROUTING_PATH),priority:c.number().int(E.PRIORITY.INTEGER).min(1,E.PRIORITY.MIN).max(5e4,E.PRIORITY.MAX).optional()}).strict(),u$=c.object({name:c.string().min(1,E.REQUIRED.SERVICE_NAME).max(255,E.MAX_LENGTH.SERVICE_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),serviceType:c.enum(Il).optional(),docker:on.partial().optional(),containerPort:ga.optional(),needsDatabaseConnection:c.boolean().optional(),routing:c.union([t$,c.array(t$).min(1)]).optional()}).strict().superRefine((e,t)=>{e.serviceType==="worker"&&(e.containerPort!==void 0&&t.addIssue({code:"custom",path:["containerPort"],message:"Worker services are not reachable inbound; remove containerPort."}),e.routing!==void 0&&t.addIssue({code:"custom",path:["routing"],message:"Worker services have no ALB route; remove routing."}))}),xle=c.object({appName:lt,instanceType:c.string().optional()}).strict();var u_=c.object({memorySize:us.optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(1,E.LAMBDA.TIMEOUT.MIN).max(900,E.LAMBDA.TIMEOUT.MAX).optional(),ephemeralStorageSize:c.number().int(E.EPHEMERAL_STORAGE.INTEGER).min(512,E.EPHEMERAL_STORAGE.MIN).max(10240,E.EPHEMERAL_STORAGE.MAX).optional()}).strict(),d$=c.object({type:c.enum(Kx).optional(),databaseName:c.string().optional(),databaseEngine:c.enum(os).optional(),deletionProtection:c.boolean().optional(),backupRetention:ya.optional(),port:_f.optional(),publiclyAccessible:c.boolean().optional(),allowedIpCidr:c.string().optional(),instanceType:c.string().optional(),allocatedStorage:c.number().int(E.ALLOCATED_STORAGE.INTEGER).min(20,E.ALLOCATED_STORAGE.MIN).max(65536,E.ALLOCATED_STORAGE.MAX).optional(),multiAz:c.boolean().optional(),readReplica:Df.optional(),writer:Rl.optional(),readers:Ol.optional(),allowVpcAccess:c.boolean().optional(),monitoringInterval:Pl.optional(),preferredMaintenanceWindow:c.string().optional(),databaseInsights:If.optional(),proxy:Cf.optional(),credentials:Tf.optional(),encryption:kf.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()}).strict(),p$=c.object({server:u_.optional(),imageOptimisation:u_.optional(),revalidation:u_.optional()}).strict(),d_=c.object({versioned:c.boolean().optional()}).strict(),m$=c.object({assets:d_.optional(),cache:d_.optional(),media:d_.optional()}).strict(),NZ=c.object({visibilityTimeout:c.number().int(E.SQS.VISIBILITY_TIMEOUT.INTEGER).min(0,E.SQS.VISIBILITY_TIMEOUT.MIN).max(43200,E.SQS.VISIBILITY_TIMEOUT.MAX).optional(),messageRetentionPeriod:c.number().int(E.SQS.RETENTION_PERIOD.INTEGER).min(60,E.SQS.RETENTION_PERIOD.MIN).max(1209600,E.SQS.RETENTION_PERIOD.MAX).optional(),maxMessageSize:c.number().int(E.MAX_MESSAGE_SIZE.INTEGER).min(1024,E.MAX_MESSAGE_SIZE.MIN).max(262144,E.MAX_MESSAGE_SIZE.MAX).optional(),deadLetterQueue:c.union([c.literal(!1),c.object({enabled:c.boolean().optional(),maxReceiveCount:c.number().int(E.DLQ.MAX_RECEIVE_COUNT.INTEGER).min(1,E.DLQ.MAX_RECEIVE_COUNT.MIN).max(1e3,E.DLQ.MAX_RECEIVE_COUNT.MAX).optional()}).strict()]).optional()}).strict(),f$=c.object({revalidationQueue:NZ.optional()}).strict(),h$=c.object({domainNames:c.array(c.string()).optional(),certificateArn:c.string().optional()}).strict(),g$=c.record(c.string().regex(fe.ENV_VAR_NAME,E.ENV_VAR_NAME),c.string()).optional(),p_=c.object({type:c.literal("payload"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),domain:c.string().optional(),database:d$.optional(),compute:p$.optional(),storage:m$.optional(),messaging:f$.optional(),cdn:h$.optional(),environment:g$}).strict(),m_=c.object({type:c.literal("nextjs"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),domain:c.string().optional(),database:d$.optional(),compute:p$.optional(),storage:m$.optional(),messaging:f$.optional(),cdn:h$.optional(),environment:g$}).strict(),f_=c.enum(tl),wZ=c.object({command:c.string().min(1,E.REQUIRED.BUILD_COMMAND),outputDir:c.string().min(1,E.REQUIRED.OUTPUT_DIR)}).strict(),PZ=c.object({maxAgeDays:c.number().optional(),includeSubdomains:c.boolean().optional(),preload:c.boolean().optional()}).strict(),RZ=c.object({headers:c.boolean().optional(),contentSecurityPolicy:c.string().optional(),hsts:c.union([c.literal(!1),PZ]).optional()}).strict(),OZ=c.object({to:c.string().min(1,E.REQUIRED.FORMS_TO).regex(fe.EMAIL,E.EMAIL),from:c.string().regex(fe.EMAIL,E.EMAIL).optional(),corsOrigin:c.string().regex(fe.HTTP_ORIGIN,"corsOrigin must be an exact origin such as https://example.com (no path, no trailing slash)").optional(),maxConcurrency:c.number().int().min(1).max(100).optional()}).strict(),$Z=c.object({behaviours:c.array(c.unknown()).optional(),priceClass:c.enum(rl).optional(),invalidateOnDeploy:c.boolean().optional()}).strict(),jZ=c.object({type:c.literal("basic-auth"),username:c.string().min(1,"accessGate.username must not be empty"),password:c.string().min(1,"accessGate.password must not be empty")}).strict(),zl=c.object({type:c.literal("staticsite"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),source:c.string().min(1,E.REQUIRED.SOURCE),build:wZ,routing:f_.optional(),security:RZ.optional(),domain:c.string().optional(),zoneName:c.string().optional(),hostedZoneId:c.string().optional(),forms:OZ.optional(),cdn:$Z.optional(),accessGate:jZ.optional()}).strict().superRefine((e,t)=>{if(e.forms===void 0)return;let r=e.domain;if(r===void 0||r===""){t.addIssue({code:"custom",path:["domain"],message:"A domain is required when forms are enabled: SES sends only from a verified identity, and the site's domain is the identity the pattern verifies"});return}let i=e.forms.from;i!==void 0&&!km(i,r)&&t.addIssue({code:"custom",path:["forms","from"],message:`forms.from must be an address at ${r} (the verified SES identity) \u2014 for example noreply@${r}. Use forms.to for the recipient.`})}),Bl=c.discriminatedUnion("type",[p_,m_,zl]),y$=c.enum(["lightweight","standard","resilient","custom"]),v$=c.object({type:c.enum(Kx),instanceType:c.string().optional(),backupRetention:ya.optional(),deletionProtection:c.boolean().optional(),encryption:c.union([c.object({useCMK:c.literal(!0)}).strict(),c.literal(!1)]).optional()}).strict(),b$=c.object({memorySize:us.optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(1,E.LAMBDA.TIMEOUT.MIN).max(900,E.LAMBDA.TIMEOUT.MAX).optional()}).strict();var S$=c.object({appName:lt,type:Jx,pattern:Xx.optional(),patternConfig:Bl.optional(),owner:c.string().optional(),tags:c.record(c.string(),c.string()).optional(),vpcId:c.string().optional(),network:va.optional(),backup:IO.optional(),tunnel:kO.optional(),additionalNetworks:c.array(JO).optional(),database:c.array($l),s3:c.array(jl),compute:c.array(Ul),dynamodb:c.array(GO).optional(),clickhouse:c.array(VO).optional(),sqs:c.array(Ml).optional(),cdn:Ll.optional(),customCodeBlocks:c.array(DO).optional(),additionalManagedImports:c.array(c.object({moduleSpecifier:c.string(),namedImports:c.array(c.string()),defaultImport:c.string().optional()}).strict()).optional()}).strict(),Gle=c.object({name:lt,type:Jx,pattern:Xx.optional(),patternTier:y$.optional(),patternDomain:c.string().optional(),source:c.string().min(1,E.REQUIRED.SOURCE).optional(),buildCommand:c.string().min(1,E.REQUIRED.BUILD_COMMAND).optional(),outputDir:c.string().min(1,E.REQUIRED.OUTPUT_DIR).optional(),routing:f_.optional(),formsTo:c.string().min(1,E.REQUIRED.FORMS_TO).regex(fe.EMAIL,E.EMAIL).optional(),corsOrigin:c.string().regex(fe.HTTP_ORIGIN,"corsOrigin must be an exact origin such as https://example.com (no path, no trailing slash)").optional(),customDatabase:v$.optional(),customCompute:b$.optional(),region:c.string().optional(),owner:c.string().optional(),includeDatabase:c.boolean().optional(),databaseName:c.string().min(1,E.DATABASE.NAME.REQUIRED).max(63,E.DATABASE.NAME.MAX_LENGTH).optional(),vpcId:c.string().optional(),network:XO.optional(),services:c.array(u$).optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()}).strict().superRefine((e,t)=>{e.formsTo!==void 0&&(e.patternDomain!==void 0&&e.patternDomain!==""||t.addIssue({code:"custom",path:["patternDomain"],message:"A domain is required when forms are enabled: SES sends only from a verified identity, and the site's domain is the identity the pattern verifies"}))}),h_=c.object({name:be,localResource:c.string().min(1),remoteApp:c.string().min(1),remoteResource:c.string().min(1),permission:c.enum(["read","write","read-write"]),remoteArn:c.string().optional()}).strict();var MZ=["fjall-managed","external","external-manual"],Hle=c.enum(MZ);var E$=c.object({givenName:c.string().min(1),familyName:c.string().min(1),displayName:c.string().min(1).optional(),expires:c.string().min(1).optional()}).strict(),A$=c.object({name:c.string().min(1),path:c.string().min(1).optional()}).strict(),LZ=c.union([c.object({managedPolicyArn:c.string().min(1)}).strict(),c.object({customerManagedPolicy:A$}).strict()]),FZ=c.object({managedPolicies:c.array(c.string().min(1)).optional(),inlinePolicy:c.record(c.string(),c.unknown()).optional(),customerManagedPolicies:c.array(A$).optional(),permissionsBoundary:LZ.optional(),sessionDuration:c.string().min(1).optional(),description:c.string().optional(),accounts:c.union([c.array(c.string().min(1)),c.literal("all")]).optional(),includeManagementAccount:c.boolean().optional(),groups:c.array(c.string().min(1)).optional()}).strict(),UZ=c.object({description:c.string().optional()}).strict(),jf=c.string().regex(fe.EMAIL,E.EMAIL),g_={groups:c.record(c.string(),UZ).optional(),permissionSets:c.record(c.string(),FZ).optional(),memberships:c.record(c.string(),c.array(jf)).optional(),resolutionVersion:c.number().int().min(1).optional(),defaultPermissionSets:c.boolean().optional()},zZ=c.discriminatedUnion("source",[c.object({...g_,source:c.literal("fjall-managed"),users:c.record(jf,E$)}).strict(),c.object({...g_,source:c.literal("external")}).strict(),c.object({...g_,source:c.literal("external-manual"),users:c.record(jf,E$).optional()}).strict()]),y_=c.object({name:be,type:c.literal("organisation").optional(),organisationName:c.string().min(1).optional(),orgEmail:jf.optional(),accounts:c.unknown().optional(),accountIds:c.record(c.string(),c.string()).optional(),identityCentre:c.union([zZ,c.literal(!1)]).optional(),allowedRegions:c.array(c.string().min(1)).optional()}).strict();var BZ=Object.defineProperty,GZ=(e,t)=>BZ(e,"name",{value:t,configurable:!0}),VZ=[1,3,5,7,14,30,60,90,120,150,180,365,400,545,731,1827,3653],Mf=c.object({buildkiteQueue:c.string().min(1,"buildkiteQueue cannot be empty").max(100).regex(/^[a-zA-Z0-9-_]+$/,"buildkiteQueue must be alphanumeric with hyphens/underscores"),buildkiteOrgSlug:c.string().min(1,"buildkiteOrgSlug cannot be empty").max(100).regex(/^[a-z0-9-]+$/,"buildkiteOrgSlug must be a lowercase Buildkite organisation slug"),agentTokenSsmParameterName:c.string().min(2).regex(/^\//,"agentTokenSsmParameterName must be a full path (leading /)").optional(),agentTokenKmsKeyArn:c.string().min(1).optional(),fjallApiKeySsmParameterName:c.string().min(2).regex(/^\//,"fjallApiKeySsmParameterName must be a full path (leading /)").optional(),instanceType:c.string().min(1).default("c8g.xlarge"),agentVolumeSizeGib:c.number().int().min(20).max(1e3).default(250),agentMinInstances:c.number().int().min(0).default(0),agentMaxInstances:c.number().int().min(1).default(2),agentsPerInstance:c.number().int().min(1).default(1),spotCapacityPercentage:c.number().int().min(0).max(100).default(0),scaleInIdlePeriodSeconds:c.number().int().min(60).default(600),disconnectAfterUptimeSeconds:c.number().int().min(3600).default(86400),maxInstanceLifetimeDays:c.number().int().min(1).max(365).default(7),terminateInstanceAfterJob:c.boolean().default(!1),purgeBuildsOnDiskFull:c.boolean().default(!0),terminateInstanceOnDiskFull:c.boolean().default(!1),logRetentionDays:c.number().int().min(1).default(30),agentLogRetentionDays:c.literal(VZ).default(7),buildkiteAgentRelease:c.enum(["stable","beta","edge"]).default("stable"),buildkiteAgentTags:c.string().default(""),buildkiteAgentTimestampLines:c.boolean().default(!1),buildkiteAgentExperiments:c.string().default(""),buildkiteAgentTracingBackend:c.enum(["","datadog","opentelemetry"]).default(""),buildkiteAgentCancelGracePeriodSeconds:c.number().int().min(10).default(60),enableSecretsPlugin:c.boolean().default(!0),enableEcrPlugin:c.boolean().default(!1),enableDockerLoginPlugin:c.boolean().default(!1),enableDockerUserNamespaceRemap:c.boolean().default(!0),enableDockerExperimental:c.boolean().default(!1),dockerNetworkingProtocol:c.enum(["ipv4","dualstack"]).default("ipv4"),enableInstanceStorage:c.boolean().default(!1),mountTmpfsAtTmp:c.boolean().default(!0),buildkiteAgentEnableGitMirrors:c.boolean().default(!1),bootstrapScriptUrl:c.string().default(""),agentEnvFileUrl:c.string().default(""),scalerEventSchedulePeriod:c.string().min(1).default("1 minute"),scalerMinPollInterval:c.string().min(1).default("10s"),scaleOutFactor:c.string().min(1).default("1.0"),scaleOutWaitingForJobs:c.boolean().default(!1),rolePermissionsBoundaryArn:c.string().min(1).optional(),alarmSnsTopicArn:c.string().min(1).optional(),applicationId:c.string().min(1).optional(),costAllocationEnvironment:c.string().min(1).optional(),costAllocationOwner:c.string().min(1).optional()}).strict(),WZ=Mf.refine(e=>e.agentMinInstances<=e.agentMaxInstances,{message:"agentMinInstances must be <= agentMaxInstances"});function KZ(e){let t=WZ.safeParse(e);if(!t.success){let r=t.error.issues.map(i=>` - ${i.path.join(".")||"(root)"}: ${i.message}`).join(`
312
+ `)}getConsolePrefix(t){switch(t){case"error":return"[ERROR]";case"warn":return"[WARN]";case"info":return"[INFO]";case"debug":return"[DEBUG]";case"trace":return"[TRACE]"}}error(t,r,i){this.log("error",t,r,i)}warn(t,r,i){this.log("warn",t,r,i)}info(t,r,i){this.log("info",t,r,i)}debug(t,r,i){this.log("debug",t,r,i)}trace(t,r,i){this.log("trace",t,r,i)}diagnostic(t,r,i,n){this.log(t,r,i,n),!this.debugEnabled&&xx()&&(Fn[t]<Fn.info||this.writeStderrLine(this.createEntry(t,r,i,n)))}isDebugEnabled(){return this.debugEnabled}isTraceEnabled(){return this.traceEnabled}enableDebug(){this.debugEnabled=!0,Fn[this.minLevel]>Fn.debug&&(this.minLevel="debug"),this.fileWriter.setDebugEnabled(!0),this.fileWriter.isInitialised&&this.fileWriter.initialiseDebugStream()}withCorrelation(t){return new es(this,t)}forDeployment(t,r="deploy"){return new xl(this,t,r)}close(){this.fileWriter.close()}async flushAndClose(){await this.fileWriter.closeAndFlush()}getLogPath(){return this.mainLogPath}getDebugLogPath(){return this.debugLogPath}getLogDir(){return this.config.logDir}logWithCorrelation(t,r,i,n,a,o,s){this.log(t,r,i,a,n,o,s)}static reset(){e.instance&&(e.instance.close(),e.instance=null)}};var Si=of.getInstance();var LW=Object.defineProperty,ct=(e,t)=>LW(e,"name",{value:t,configurable:!0}),ns="fjall";function ma(e,t){let r=FW(e);if(r.includes("..")||r.startsWith("/"))throw new Error(`Invalid ${t}: path traversal is not allowed`)}ct(ma,"assertNoTraversal");function UW(){return ns}ct(UW,"getFjallPath");function zW(e){let t=ZR(e);return ZR(t)||"."}ct(zW,"getProjectRoot");function XR(e){if(!JR(e))throw new Error(`Infrastructure file not found: ${e}`);let t=HR(e,"utf-8"),r=qR(t);if(r===void 0)throw new Error(`Could not find appName in infrastructure file: ${e}. Expected format: const appName = "yourAppName";`);return r}ct(XR,"getAppNameFromInfrastructure");function qR(e){return e.match(/const\s+appName\s*=\s*["']([^"']+)["']/)?.[1]}ct(qR,"parseAppNameFromInfrastructureContent");function BW(e){if(!JR(e))return;let t;try{t=HR(e,"utf-8")}catch(r){Si.debug("PathHelpers","Could not read organisation infrastructure",{error:ge(Ke(r))});return}return t.match(/organisationName:\s*(["'])(.+?)\1/)?.[2]}ct(BW,"readOrganisationNameFromInfrastructure");function GW(e){let t=vr(e,Dx);return XR(t)}ct(GW,"getAppName");function VW(e){return ma(e,"app name"),vr(ns,e,Dx)}ct(VW,"getInfrastructurePath");function sf(e){return ma(e,"app name"),vr(ns,e)}ct(sf,"getAppPath");function YR(e,t){let r=e??process.cwd();return t===void 0?r:(ma(t,"container"),vr(r,t))}ct(YR,"resolveScaffoldRootDir");function WW(e,t,r){return vr(YR(t,r),sf(e))}ct(WW,"resolveAppScaffoldPath");function Tx(e){return ma(e,"component name"),vr(ns,e)}ct(Tx,"getOrganisationComponentPath");function KW(e){return ma(e,"deployment type"),vr(ns,e,"logs")}ct(KW,"getDeploymentLogsPath");function QR(){return vr(ns,"domains")}ct(QR,"getDomainsDir");function Cx(e){return ma(e,"domain name"),vr(QR(),e)}ct(Cx,"getDomainComponentPath");function ZW(e){return vr(Cx(e),Dx)}ct(ZW,"getDomainInfrastructurePath");function HW(e){return vr(Cx(e),JW)}ct(HW,"getDomainZoneFilePath");var Dx="infrastructure.ts",JW="zone.bind",XW="cdk.out";function qW(e){return vr(e,XW)}ct(qW,"getCdkOutPath");var YW=Object.defineProperty,QW=(e,t)=>YW(e,"name",{value:t,configurable:!0}),eK=import.meta.dirname;function Ix(e,t,r,i){let n=eO(eK,"..","shared","files"),a=t.includes("/")?t:sf(t);mc(e,n,a,r,i),pc(e,eO(a,".gitignore"),al,i)}QW(Ix,"copySharedCdkFiles");var tK=Object.defineProperty,is=(e,t)=>tK(e,"name",{value:t,configurable:!0});function tO(e){return e.success===!0}is(tO,"isSuccess");function rO(e){return e.success===!1}is(rO,"isFailure");function K(e){return{success:!0,data:e}}is(K,"success");function j(e){return{success:!1,error:e}}is(j,"failure");async function nO(e){try{let t=await e();return K(t)}catch(t){return j(gi(t))}}is(nO,"tryAsync");function iO(e){try{let t=e();return K(t)}catch(t){return j(gi(t))}}is(iO,"trySync");var rK=Object.defineProperty,nK=(e,t)=>rK(e,"name",{value:t,configurable:!0}),aO=/^[a-zA-Z][a-zA-Z0-9-]*$/,iK=Yc.source.replace(/^\^|\$$/g,""),fe=Object.freeze({IDENTIFIER:aO,NEW_APP_NAME:/^[a-z][a-z0-9-]*$/,RESOURCE_NAME:/^[a-zA-Z][a-zA-Z0-9]*$/,ECS_SERVICE_NAME:aO,BUCKET_NAME:/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z][a-z0-9]*$/,DATABASE_NAME:/^[a-zA-Z][a-zA-Z0-9_]*$/,RESOURCE_TYPE:/^[a-z]+(:[a-z]+)?$/,SSM_PATH:new RegExp(`^(?:/${iK})+$`),SECRET_NAME:Sm,SSM_COMPONENT:Yc,EMAIL:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,DOCKER_IMAGE:/^[a-z0-9][a-z0-9._-]*[a-z0-9](:[a-z0-9._-]+)?$/,DOMAIN:/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i,HTTP_ORIGIN:/^https?:\/\/[a-z0-9.-]+(:\d+)?$/i,PASCAL_CASE:/^[A-Z][A-Za-z0-9]*$/,AWS_ACCOUNT_ID:/^\d{12}$/,VPC_ID:/^vpc-[a-z0-9]+$/,ROLE_ARN:/^arn:aws[a-zA-Z-]*:iam::\d{12}:role\/.+$/,CIDR:/^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\/(3[0-2]|[12]?\d)$/,SCHEDULE_EXPRESSION:/^(rate\(1 (?:minute|hour|day)\)|rate\((?:[2-9]|[1-9]\d+) (?:minutes|hours|days)\)|cron\([^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+\))$/,LAMBDA_RUNTIME_IDENTIFIER:/^[A-Za-z0-9._-]+$/,ENV_VAR_NAME:/^[A-Za-z_][A-Za-z0-9_]*$/});function kx(e){let t=/^rate\((\d+) (minute|minutes|hour|hours|day|days)\)$/.exec(e);if(!t)return;let r=t[1],i=t[2];if(r===void 0||i===void 0)return;let n=parseInt(r,10);if(!Number.isFinite(n)||n<1)return;let a=i==="minute"||i==="hour"||i==="day";if(!(a&&n!==1)&&!(!a&&n===1))return i==="minute"||i==="minutes"?{everyMs:n*6e4}:i==="hour"||i==="hours"?{everyMs:n*60*6e4}:{everyMs:n*24*60*6e4}}nK(kx,"parseRateExpression");var oO=["t4g.medium","m7g.medium","m8g.medium","r7g.medium","r8g.medium","m7g.large","m8g.large","r7g.large","r8g.large","m7g.xlarge","m8g.xlarge","r7g.xlarge","r8g.xlarge"];var E=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",NEW_APP_NAME:"Must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:tA,SSM_COMPONENT:Em,EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",SOURCE:"Source directory is required",BUILD_COMMAND:"Build command is required",OUTPUT_DIR:"Output directory is required",FORMS_TO:"Forms recipient address is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required",CONNECTED_RESOURCE_NAME:"Connected resource names must not be empty"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"},RUNTIME:"Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')"},ENV_VAR_NAME:"Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores",PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name must be 63 characters or less"}},CLICKHOUSE_STORAGE:{INTEGER:"ClickHouse storage must be a whole number of GiB",MIN:`ClickHouse storage must be at least ${100} GiB`,MAX:`ClickHouse storage cannot exceed ${16384} GiB (the gp3 ceiling)`},CLICKHOUSE_IOPS:{INTEGER:"ClickHouse iops must be a whole number",MIN:`ClickHouse iops must be at least ${3e3} (the gp3 baseline)`,MAX:`ClickHouse iops cannot exceed ${8e4} (the gp3 ceiling)`},CLICKHOUSE_THROUGHPUT:{INTEGER:"ClickHouse throughputMbps must be a whole number of MiB/s",MIN:`ClickHouse throughputMbps must be at least ${125} MiB/s (the gp3 baseline)`,MAX:`ClickHouse throughputMbps cannot exceed ${2e3} MiB/s (the gp3 ceiling)`},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days (the RDS automated-backup ceiling)"},CLICKHOUSE_BACKUP_RETENTION:{INTEGER:"ClickHouse backup retention must be an integer number of days",MIN:`ClickHouse backup retention must be at least ${1} day`,MAX:`ClickHouse backup retention cannot exceed ${3650} days`},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"},RESPONSE_TIME_MS:{MIN:"Response-time threshold must be at least 1 ms"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",IMAGE_DOCKER_MUTEX:"image and docker are mutually exclusive",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"},SCHEDULE_EXPRESSION:"Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'"});var aK=Object.defineProperty,br=(e,t)=>aK(e,"name",{value:t,configurable:!0}),oK=["us-east-2","us-west-2","us-east-1","eu-west-1","eu-central-1","ap-southeast-1"],sK=Object.freeze(oK.flatMap(e=>{let t=jo(e);return t?[t]:[]})),Lx=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","ap-southeast-1"]);function cf(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}br(cf,"parseRegionList");function Fx(e){return wn.includes(e)}br(Fx,"isValidRegion");function Ux(e){return/^[a-z]{2}-[a-z]+-[1-9]$/.test(e)}br(Ux,"isValidRegionFormat");function zx(e){if(!e)return Lx.slice(0,3);let t=e.toLowerCase().split("-"),r=t[0],i=t.length>1?t[1]:"",n=[];return r&&i&&(n=wn.filter(a=>a.startsWith(`${r}-${i}`))),n.length===0&&r&&(n=wn.filter(a=>a.startsWith(`${r}-`))),n.length>0?n.slice(0,3):Lx.slice(0,3)}br(zx,"getSuggestions");function Bx(e){if(Fx(e))return!0;let t=zx(e);return Ux(e)?`Unknown region. Try: ${t.join(", ")}`:`Invalid format. Try: ${t.join(", ")}`}br(Bx,"validateRegion");function sO(e){if(!e||e.trim()==="")return!0;let t=cf(e);for(let r of t){let i=Bx(r);if(i!==!0)return i}return!0}br(sO,"validateRegionList");function Gx(e,t){return e.filter(r=>r!==t)}br(Gx,"filterDuplicateRegions");function Vx(e){return{label:e.city,value:e.code,description:e.optIn?`${e.code} \u2014 opt-in required`:e.code}}br(Vx,"toRegionOption");function cO(){return hr.map(Vx)}br(cO,"getRegionOptions");function lO(e){return hr.filter(t=>t.code!==e).map(Vx)}br(lO,"getRegionOptionsExcluding");function uO(e){let t=hr.find(r=>r.code===e);return t?t.city:e}br(uO,"getRegionName");function dO(e){return t=>{let r=cf(t);return Gx(r,e)}}br(dO,"createRegionFormatter");var lf="27.1.0";var uf=["Aurora","Instance","GlobalAurora","ClickHouse"],as=["FARGATE","FARGATE_SPOT","EC2"],Gr=["standard","resilient","enterprise"],df=["tinkerer","lightweight","standard","resilient","enterprise"],Wx="custom",_l=[...df,Wx];var cK=Object.defineProperty,lK=(e,t)=>cK(e,"name",{value:t,configurable:!0}),pce=Object.freeze({RESOURCE_SUFFIXES:Object.freeze({storage:"Storage",database:"Database",cluster:"Cluster",function:"Function",instance:"Instance",compute:"Compute"})}),Tl=["ecs","lambda","ec2"],Cl=Object.freeze({ECS:"ecs",LAMBDA:"lambda",EC2:"ec2"}),pf=["code","container"],mf=Object.freeze({CODE:"code",CONTAINER:"container"}),ff=["ARM_64","X86_64"],pO="ARM_64",Dl=["NONE","AWS_IAM"],hf=["public","internal"],gf=["CPU","MEMORY"],fa=["messaging","compute"],yf=["ARM","STANDARD"],Kx=["Instance","Aurora"],os=["postgresql","mysql"],Il=["web","worker"],mO=["foundation","compliance","hardened"];var vf=["t3.nano","t3.micro","t3.small","t3.medium","t3.large","t3.xlarge","t3.2xlarge","t3a.nano","t3a.micro","t3a.small","t3a.medium","t3a.large","t3a.xlarge","t3a.2xlarge","t4g.nano","t4g.micro","t4g.small","t4g.medium","t4g.large","t4g.xlarge","t4g.2xlarge","c5.large","c5.xlarge","c5.2xlarge","c5.4xlarge","c5.9xlarge","c5.12xlarge","c5.18xlarge","c5.24xlarge","c5a.large","c5a.xlarge","c5a.2xlarge","c5a.4xlarge","c5a.8xlarge","c5a.12xlarge","c5a.16xlarge","c5a.24xlarge","c6g.medium","c6g.large","c6g.xlarge","c6g.2xlarge","c6g.4xlarge","c6g.8xlarge","c6g.12xlarge","c6g.16xlarge","r5.large","r5.xlarge","r5.2xlarge","r5.4xlarge","r5.8xlarge","r5.12xlarge","r5.16xlarge","r5.24xlarge","r5a.large","r5a.xlarge","r5a.2xlarge","r5a.4xlarge","r5a.8xlarge","r5a.12xlarge","r5a.16xlarge","r5a.24xlarge","r6g.medium","r6g.large","r6g.xlarge","r6g.2xlarge","r6g.4xlarge","r6g.8xlarge","r6g.12xlarge","r6g.16xlarge","i3.large","i3.xlarge","i3.2xlarge","i3.4xlarge","i3.8xlarge","i3.16xlarge","p3.2xlarge","p3.8xlarge","p3.16xlarge","g4dn.xlarge","g4dn.2xlarge","g4dn.4xlarge","g4dn.8xlarge","g4dn.12xlarge","g4dn.16xlarge","m5.large","m5.xlarge","m5.2xlarge","m5.4xlarge","m5.8xlarge","m5.12xlarge","m5.16xlarge","m5.24xlarge","m5a.large","m5a.xlarge","m5a.2xlarge","m5a.4xlarge","m5a.8xlarge","m5a.12xlarge","m5a.16xlarge","m5a.24xlarge"],fO=[0,1,5,10,15,30,60];function Ft(e,t){return e.includes(t)}lK(Ft,"constIncludes");var hO=1,gO=65535,yce=Object.freeze({postgresql:5432,mysql:3306}),yO=128,vO=10240,bf=1,Sf=900,Zx=1,Hx=1e3,ss=100,bO=100;var SO=3e3;var EO=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"],AO=["standard","assets","upload","website"],cs=["AES256","KMS"];var uK=Object.defineProperty,kl=(e,t)=>uK(e,"name",{value:t,configurable:!0}),Ut=kl(e=>c.union([c.literal(!1),e]),"optionalOrDisabled"),ha={check:kl(e=>e.minCapacity!==void 0&&e.maxCapacity!==void 0?e.minCapacity<=e.maxCapacity:!0,"check"),params:{message:E.CAPACITY_CONSTRAINT.MIN_LTE_MAX,path:["maxCapacity"]}},Nl=kl(e=>c.number().int(E.MEMORY_LIMIT.INTEGER).min(e,e===128?E.MEMORY_LIMIT.MIN_128:E.MEMORY_LIMIT.MIN_512).max(30720,E.MEMORY_LIMIT.MAX),"memoryLimitMiBSchema"),be=c.string().min(1,E.REQUIRED.RESOURCE_NAME).max(63,E.MAX_LENGTH.RESOURCE_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),_O=c.string().min(1,E.REQUIRED.BUCKET_NAME).max(63,E.MAX_LENGTH.BUCKET_NAME).regex(fe.BUCKET_NAME,E.BUCKET_NAME),TO=c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME);function Ef(e,t=fe.IDENTIFIER,r=E.IDENTIFIER){return c.string().min(2,E.IDENTIFIER_MIN_LENGTH).max(50,e).regex(t,r).refine(i=>!i.endsWith("-"),{message:E.IDENTIFIER_NO_TRAILING_HYPHEN}).refine(i=>!i.includes("--"),{message:E.IDENTIFIER_NO_CONSECUTIVE_HYPHENS})}kl(Ef,"identifierSchema");var lt=Ef(E.MAX_LENGTH.APP_NAME),_ce=Ef(E.MAX_LENGTH.APP_NAME,fe.NEW_APP_NAME,E.NEW_APP_NAME),ga=c.number().int(E.PORT.INTEGER).min(hO,E.PORT.MIN).max(gO,E.PORT.MAX),bt=c.object({key:c.string(),sourceText:c.string()}).strict(),dK=c.object({__identifier:c.string()}).strict(),pK=c.object({__expression:c.string()}).strict(),mK=c.object({__call:c.string()}).strict(),fK=c.union([dK,pK,mK]),hK=c.union([c.string(),c.number(),c.boolean(),fK]),ls=c.record(c.string().regex(fe.ENV_VAR_NAME,E.ENV_VAR_NAME),hK),gK=c.object({id:c.string(),name:c.string().optional(),arn:c.string().optional(),field:c.string().optional()}).strict().refine(e=>e.name!==void 0!=(e.arn!==void 0),{message:"secretsImport requires exactly one of `name` or `arn`."}),CO=c.record(c.string(),gK),Tce=c.record(c.string(),c.unknown()),Jx=c.enum(_l).describe(`Application type must be one of: ${_l.join(", ")}`),Xx=c.enum(gr).describe(`OpenNext deployment pattern: ${gr.join(", ")}`),yK=c.enum(["before-imports","after-imports","after-app-init","after-tags","after-resource","end-of-file"]),vK=c.enum(["import","app-init","tags","database","compute","storage","network","messaging","cdn","pattern","vpc-peer","vpc-peer-accepter","cross-plan-connection","custom"]),DO=c.object({sourceText:c.string(),position:yK,afterManagedResource:c.object({type:vK,name:c.string().optional()}).strict().optional(),originalLine:c.number().int().optional(),leadingComments:c.array(c.string()).optional(),orphaned:c.boolean().optional(),orphanedComment:c.string().optional()}).strict(),IO=c.union([c.object({tier:c.enum(Gr)}).strict(),c.literal(!1)]),kO=c.union([c.object({instanceType:c.string().optional()}).strict(),c.literal(!1)]),bK=Ef(E.MAX_LENGTH.ORGANISATION_NAME),SK=c.string().regex(fe.EMAIL,E.EMAIL),xO=c.string().refine(e=>wn.includes(e),{message:E.REGION}),Cce=c.object({name:bK,email:SK,accountName:c.string().optional(),primaryRegion:xO.optional().default(hi),secondaryRegions:c.array(xO).optional(),security:c.enum(mO).optional(),force:c.boolean().optional()}).strict();function wl(e){return e.issues.map(t=>`${t.path.length>0?`${t.path.join(".")}: `:""}${t.message}`).join(`
313
+ `)}kl(wl,"getZodErrorMessage");var Af=c.number().min(1,E.ALARM.PERCENTAGE.MIN).max(100,E.ALARM.PERCENTAGE.MAX),qx=c.union([Af,c.literal(!1)]),EK=c.union([c.number().min(1,E.ALARM.RESPONSE_TIME_MS.MIN),c.literal(!1)]),AK=c.number().min(1,E.ALARM.FREE_STORAGE_GIB.MIN),NO=c.union([c.literal(!1),c.object({cpuThreshold:qx.optional(),memoryThreshold:qx.optional(),runningTasksMinimum:c.number().int().min(0).optional(),http5xxThreshold:qx.optional(),p99ResponseTimeThresholdMs:EK.optional()}).strict()]),wO=c.union([c.literal(!1),c.object({cpuThreshold:Af.optional(),freeStorageThresholdGiB:AK.optional(),connectionsThreshold:c.number().int().min(1).optional()}).strict()]),PO=c.union([c.literal(!1),c.object({errorRateThreshold:Af.optional(),durationThresholdPercent:Af.optional()}).strict()]);var ya=c.number().int(E.BACKUP_RETENTION.INTEGER).min(1,E.BACKUP_RETENTION.MIN).max(35,E.BACKUP_RETENTION.MAX),RO=c.number().int(E.CLICKHOUSE_STORAGE.INTEGER).min(100,E.CLICKHOUSE_STORAGE.MIN).max(16384,E.CLICKHOUSE_STORAGE.MAX),OO=c.number().int(E.CLICKHOUSE_IOPS.INTEGER).min(3e3,E.CLICKHOUSE_IOPS.MIN).max(8e4,E.CLICKHOUSE_IOPS.MAX),$O=c.number().int(E.CLICKHOUSE_THROUGHPUT.INTEGER).min(125,E.CLICKHOUSE_THROUGHPUT.MIN).max(2e3,E.CLICKHOUSE_THROUGHPUT.MAX),xK=c.enum(oO),jO=c.number().int(E.CLICKHOUSE_BACKUP_RETENTION.INTEGER).min(1,E.CLICKHOUSE_BACKUP_RETENTION.MIN).max(3650,E.CLICKHOUSE_BACKUP_RETENTION.MAX),Pl=c.number().int(E.MONITORING_INTERVAL.INTEGER).refine(e=>Ft(fO,e),{message:E.MONITORING_INTERVAL.VALUES}),_f=c.number().int(E.DATABASE.PORT.INTEGER).min(1024,E.DATABASE.PORT.MIN).max(65535,E.DATABASE.PORT.MAX),_K=c.enum(uf).describe(`Database type must be one of: ${uf.join(", ")}`),TK=c.object({maxConnections:c.number().int(E.MAX_CONNECTIONS.INTEGER).min(1,E.MAX_CONNECTIONS.MIN).max(100,E.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:c.number().int(E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:c.number().int(E.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,E.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,E.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:c.boolean().optional()}).strict().describe("RDS Proxy configuration"),CK=c.object({instanceType:c.string().optional(),availabilityZone:c.string().optional()}).strict().describe("Read replica configuration"),DK=c.object({automaticallyAfterDays:c.number().int(E.ROTATION.INTEGER).min(1,E.ROTATION.MIN).max(365,E.ROTATION.MAX).optional()}).strict().describe("Secret rotation configuration"),Tf=c.object({username:c.string().min(1,E.REQUIRED.USERNAME).max(63,E.USERNAME.MAX_LENGTH).optional(),secretRotation:DK.optional()}).strict().describe("Database credentials configuration"),Cf=Ut(TK),Df=Ut(CK),IK=c.object({scaleWithWriter:c.boolean().optional(),enableDatabaseInsights:c.boolean().optional(),identifierSuffix:c.string().min(1,E.IDENTIFIER_SUFFIX.REQUIRED).max(50,E.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:c.string().optional()}).strict().describe("Configuration for a single Aurora reader instance"),Rl=c.object({enableDatabaseInsights:c.boolean().optional(),identifierSuffix:c.string().min(1,E.IDENTIFIER_SUFFIX.REQUIRED).max(50,E.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:c.string().optional()}).strict().describe("Configuration for Aurora writer instance"),kK=c.object({count:c.number().int(E.READER.COUNT.INTEGER).min(0,E.READER.COUNT.MIN).max(15,E.READER.COUNT.MAX).optional(),instances:c.array(IK).max(15,E.READER_INSTANCES.MAX).optional(),defaultEnableDatabaseInsights:c.boolean().optional()}).strict().refine(e=>!(e.count!==void 0&&e.instances!==void 0),{message:E.READER_INSTANCES.COUNT_OR_INSTANCES,path:["count"]}).describe("Aurora readers configuration"),Ol=Ut(kK),NK=c.object({awsManaged:c.literal(!0)}).strict(),wK=c.object({useCMK:c.literal(!0)}).strict(),MO=c.union([NK,wK]),PK=c.object({mode:c.enum(["standard","advanced"]).optional(),encryptionKey:MO.optional()}).strict().describe("Database Insights configuration"),If=Ut(PK),kf=c.object({storageKey:MO.optional()}).strict().describe("Encryption configuration (DESTRUCTIVE to change storageKey)"),$l=c.object({name:be,type:_K,databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME),instanceType:c.string().optional(),allocatedStorage:c.number().optional(),multiAz:c.boolean().optional(),publiclyAccessible:c.boolean().optional(),databaseInsights:If.optional(),port:_f.optional(),deletionProtection:c.boolean().optional(),proxy:Cf.optional(),credentials:Tf.optional(),readReplica:Df.optional(),encryption:kf.optional(),writer:Rl.optional(),readers:Ol.optional(),backupRetention:ya.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:Pl.optional(),primaryRegion:c.string().optional(),secondaryRegions:c.array(c.string()).optional(),globalClusterIdentifier:c.string().optional(),enableGlobalWriteForwarding:c.boolean().optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional(),databaseEngine:c.enum(os).optional(),engineExpression:c.string().optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional(),alarms:wO.optional()}).strict(),Nf=c.object({appName:lt,nameProvidedByFlag:c.boolean().optional(),databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME),resourceName:be.optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional(),databaseInsights:If.optional(),port:_f.optional(),proxy:Cf.optional(),credentials:Tf.optional(),encryption:kf.optional(),deletionProtection:c.boolean().optional()}).strict(),LO={databaseType:c.literal("Instance"),instanceType:c.string().optional(),multiAz:c.boolean().optional(),readReplica:Df.optional(),publiclyAccessible:c.boolean().optional(),backupRetention:ya.optional(),allocatedStorage:c.number().optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},FO={databaseType:c.literal("Aurora"),writer:Rl.optional(),readers:Ol.optional(),backupRetention:ya.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:Pl.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},UO={databaseType:c.literal("GlobalAurora"),primaryRegion:c.string().min(1,E.GLOBAL_AURORA.PRIMARY_REGION_REQUIRED),secondaryRegions:c.array(c.string()).optional(),globalClusterIdentifier:c.string().optional(),enableGlobalWriteForwarding:c.boolean().optional(),writer:Rl.optional(),readers:Ol.optional(),backupRetention:ya.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:Pl.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},zO=c.object({appName:lt,nameProvidedByFlag:c.boolean().optional(),databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME),resourceName:be.optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional()}).strict(),BO={databaseType:c.literal("ClickHouse"),instanceType:xK.optional(),storageGb:RO.optional(),iops:OO.optional(),throughputMbps:$O.optional(),coldTier:c.union([c.object({mode:c.literal("s3")}).strict(),c.literal(!1)]).optional(),optimiseSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupVerify:c.literal(!1).optional(),backupRetentionDays:jO.optional()},RK=Nf.extend(LO).strict(),OK=Nf.extend(FO).strict(),$K=Nf.extend(UO).strict(),jK=zO.extend(BO).strict(),Mce=c.discriminatedUnion("databaseType",[RK,OK,$K,jK]),Yx=Nf.extend({resourceName:be}).strict(),MK=Yx.extend(LO).strict(),LK=Yx.extend(FO).strict(),FK=Yx.extend(UO).strict(),UK=zO.extend({resourceName:be}).strict(),zK=UK.extend(BO).strict(),Lce=c.discriminatedUnion("databaseType",[MK,LK,FK,zK]),Fce=c.object({appName:lt,databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME),maxConnections:c.number().int(E.MAX_CONNECTIONS.INTEGER).min(1,E.MAX_CONNECTIONS.MIN).max(100,E.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:c.number().int(E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:c.number().int(E.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,E.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,E.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:c.boolean().optional(),nameProvidedByFlag:c.boolean().optional()}).strict(),BK=["S","N","B"],xf=c.object({name:c.string(),type:c.enum(BK)}).strict(),GO=c.object({name:be,partitionKey:xf,sortKey:xf.optional(),globalSecondaryIndexes:c.array(c.object({indexName:c.string(),partitionKey:xf,sortKey:xf.optional()}).strict()).optional(),ttlAttribute:c.string().optional(),stream:c.boolean().optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional()}).strict(),GK=c.object({mode:c.literal("s3")}).strict(),VO=c.object({name:be,type:c.literal("ClickHouse"),databaseName:TO,instanceType:c.string().optional(),storageGb:RO.optional(),iops:OO.optional(),throughputMbps:$O.optional(),coldTier:c.union([GK,c.literal(!1)]).optional(),optimiseSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupVerify:c.literal(!1).optional(),backupRetentionDays:jO.optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional()}).strict();var VK=c.object({count:c.number().int(E.NAT_GATEWAY.INTEGER).min(0,E.NAT_GATEWAY.MIN).max(3,E.NAT_GATEWAY.MAX).optional()}).strict().describe("NAT gateway configuration"),WO=Ut(VK),Qx=c.enum(["cloudwatch","s3"]),WK=c.object({destination:Qx.optional(),retentionDays:c.number().int(E.RETENTION_DAYS.INTEGER).min(1,E.RETENTION_DAYS.MIN).max(365,E.RETENTION_DAYS.MAX).optional(),trafficType:c.enum(["ALL","ACCEPT","REJECT"]).optional()}).strict().describe("VPC flow log configuration"),KO=Ut(WK),KK=c.object({s3:c.boolean().optional(),dynamodb:c.boolean().optional()}).strict().describe("Gateway VPC endpoints (FREE)"),ZK=Ut(KK),HK=c.object({ecr:c.boolean().optional(),secretsManager:c.boolean().optional(),kms:c.boolean().optional(),cloudwatchLogs:c.boolean().optional(),ssm:c.boolean().optional(),sts:c.boolean().optional()}).strict().describe("Interface VPC endpoints (cost per hour)"),JK=Ut(HK),XK=c.object({gateway:ZK.optional(),interface:JK.optional()}).strict().describe("VPC endpoints configuration"),ZO=Ut(XK),va=c.object({maxAzs:c.number().int(E.MAX_AZS.INTEGER).min(1,E.MAX_AZS.MIN).max(3,E.MAX_AZS.MAX).optional(),natGateways:WO.optional(),flowLogs:KO.optional(),vpcEndpoints:ZO.optional(),cidrMask:c.number().int(E.CIDR_MASK.INTEGER).min(16,E.CIDR_MASK.MIN).max(28,E.CIDR_MASK.MAX).optional()}).strict(),HO=c.string().min(1,E.REQUIRED.NETWORK_NAME).max(50,E.MAX_LENGTH.NETWORK_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),JO=va.extend({name:HO}).strict(),XO=Ut(va),Vce=c.object({appName:lt,networkName:HO.optional(),maxAzs:c.number().int(E.MAX_AZS.INTEGER).min(1,E.MAX_AZS.MIN).max(3,E.MAX_AZS.MAX).optional(),natGateways:WO.optional(),flowLogs:KO.optional(),vpcEndpoints:ZO.optional()}).strict(),qK=fe.CIDR,e_=c.string().regex(qK,E.CIDR),YK=c.object({kind:c.literal("database"),resource:c.string().min(1,E.REQUIRED.RESOURCE_REFERENCE),name:be,allowedFromCidrs:c.array(e_),access:c.enum(["read","write","readWrite"]).optional()}).strict(),QK=c.object({kind:c.literal("ecsService"),resource:c.string().min(1,E.REQUIRED.RESOURCE_REFERENCE),serviceName:c.string().min(1,E.REQUIRED.SERVICE_NAME),name:be,allowedFromCidrs:c.array(e_),port:ga.optional()}).strict(),eZ=c.discriminatedUnion("kind",[YK,QK]),qO=c.object({name:be,peerAppName:c.string().min(1,E.REQUIRED.APP_NAME),peerAccountId:c.string().regex(fe.AWS_ACCOUNT_ID,E.AWS_ACCOUNT_ID),peerRegion:c.string().min(1,E.VPC_PEER.REGION_REQUIRED).optional(),peerVpcId:c.string().regex(fe.VPC_ID,E.VPC_ID).optional(),peerVpcCidr:e_.optional(),peerRoleArn:c.string().regex(fe.ROLE_ARN,E.ROLE_ARN).optional(),peerRouteTableIds:c.array(c.string().min(1,E.VPC_PEER.ROUTE_TABLE_ID_REQUIRED)).optional(),localVpcName:c.string().min(1,E.REQUIRED.NETWORK_NAME).optional(),enableDnsResolution:c.boolean().optional()}).strict(),t_=c.object({name:be,requesterAccountIds:c.array(c.string().regex(fe.AWS_ACCOUNT_ID,E.AWS_ACCOUNT_ID)).min(1,E.VPC_PEER.MIN_REQUESTER_ACCOUNTS),localVpcName:c.string().min(1,E.REQUIRED.NETWORK_NAME).optional(),publishToSsm:c.boolean().optional(),exposedResources:c.array(eZ).optional()}).strict();var wf=["storage","cdn","compute"],tZ=c.object({sid:c.string().optional(),effect:c.enum(["Allow","Deny"]),principals:c.array(c.string()),actions:c.array(c.string()),resources:c.array(c.string()).optional(),conditions:c.record(c.string(),c.record(c.string(),c.union([c.string(),c.array(c.string())]))).optional()}).strict(),jl=c.object({name:be,bucketName:c.string().optional(),publicReadAccess:c.boolean().optional(),websiteHosting:c.object({indexDocument:c.string(),errorDocument:c.string().optional()}).strict().optional(),backupVaultTier:c.enum(Gr).optional(),versioned:c.boolean().optional(),encryption:c.enum(cs).optional(),kmsKeyArn:c.string().optional(),cors:c.array(c.object({allowedOrigins:c.array(c.string()),allowedMethods:c.array(c.string()),allowedHeaders:c.array(c.string()).optional(),exposedHeaders:c.array(c.string()).optional(),maxAge:c.number().optional()}).strict()).optional(),deployment:c.object({source:c.string(),prune:c.boolean().optional(),cacheControl:c.object({maxAge:c.number().optional(),immutable:c.boolean().optional()}).strict().optional()}).strict().optional(),retain:c.boolean().optional(),resourcePolicyStatements:c.array(tZ).optional(),stackPlacement:c.enum(wf).optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional()}).strict().refine(e=>e.encryption!=="KMS"||!!e.kmsKeyArn,{message:E.KMS.KEY_REQUIRED}),Xce=c.object({appName:lt,bucketName:_O,nameProvidedByFlag:c.boolean().optional(),storagePreset:c.enum(AO).optional(),publicReadAccess:c.boolean().optional(),websiteHosting:c.object({indexDocument:c.string(),errorDocument:c.string().optional()}).strict().optional(),backupVaultTier:c.enum(Gr).optional(),versioned:c.boolean().optional(),encryption:c.enum(cs).optional(),kmsKeyArn:c.string().optional(),cors:c.array(c.object({allowedOrigins:c.array(c.string()),allowedMethods:c.array(c.string()),allowedHeaders:c.array(c.string()).optional(),exposedHeaders:c.array(c.string()).optional(),maxAge:c.number().optional()}).strict()).optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional()}).strict().refine(e=>e.encryption!=="KMS"||!!e.kmsKeyArn,{message:E.KMS.KEY_REQUIRED,path:["kmsKeyArn"]});var r_=c.enum(["DESTROY","RETAIN"]),Ml=c.object({name:be,queueType:c.enum(["standard","fifo"]).default("standard"),visibilityTimeout:c.number().int(E.SQS.VISIBILITY_TIMEOUT.INTEGER).min(0,E.SQS.VISIBILITY_TIMEOUT.MIN).max(43200,E.SQS.VISIBILITY_TIMEOUT.MAX).optional(),retentionPeriod:c.number().int(E.SQS.RETENTION_PERIOD.INTEGER).min(60,E.SQS.RETENTION_PERIOD.MIN).max(1209600,E.SQS.RETENTION_PERIOD.MAX).optional(),contentBasedDeduplication:c.boolean().optional(),removalPolicy:r_.optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional()}).strict();var YO=c.object({type:c.literal("basic-auth"),username:c.string().min(1),password:c.string().min(1)}).strict(),Ll=c.object({name:be,defaultOriginRef:c.string(),behaviours:c.array(c.object({pathPattern:c.string(),originRef:c.string(),cachePolicy:c.enum(["CACHING_OPTIMIZED","CACHING_DISABLED"]).optional()}).strict()).optional(),customDomain:c.string().optional(),certificateArn:c.string().optional(),domain:c.string().optional(),originHostname:c.string().optional(),accessGate:c.union([c.literal(!1),YO]).optional(),extraProperties:c.array(bt).optional()}).strict(),ile=c.object({appName:c.string(),name:be.optional(),defaultOriginRef:c.string(),behaviours:c.array(c.object({pathPattern:c.string(),originRef:c.string(),cachePolicy:c.enum(["CACHING_OPTIMIZED","CACHING_DISABLED"]).optional()}).strict()).optional(),customDomain:c.string().optional(),certificateArn:c.string().optional(),domain:c.string().optional(),originHostname:c.string().optional(),accessGate:c.union([c.literal(!1),YO]).optional(),nameProvidedByFlag:c.boolean().optional()}).strict();var rZ=Object.defineProperty,n_=(e,t)=>rZ(e,"name",{value:t,configurable:!0}),nZ=new Set(["t4g","c6g","c6gd","c6gn","c7g","c7gd","c7gn","r6g","r6gd","r7g","r7gd","r8g","r8gd","c8g","c8gd","c8gn","m6g","m6gd","m7g","m7gd","m8g","m8gd","x8g","i8g","a1","x2gd","im4gn","is4gen","i4g","hpc7g"]);function xi(e){let t=e.split(".")[0]??"";return nZ.has(t)?"ARM":"STANDARD"}n_(xi,"getArchitectureForInstanceType");function Pf(e,t){let r=xi(e);return r!==t?{valid:!1,message:`Instance type '${e}' requires ${r} architecture, but '${t}' AMI was specified. Use a ${r==="ARM"?"Graviton instance (t4g, c6g, r6g, m6g, etc.)":"Intel/AMD instance (t3, c5, r5, m5, etc.)"} instead.`}:{valid:!0}}n_(Pf,"validateArchitectureMatch");function QO(e,t){return xi(e)===t}n_(QO,"isArchitectureCompatible");var iZ=Object.defineProperty,Rf=(e,t)=>iZ(e,"name",{value:t,configurable:!0});var aZ=1;var oZ=/^[A-Za-z0-9_.-]+$/,sZ=c.object({id:c.string().min(1,"buildSecret id cannot be empty").regex(oZ,"buildSecret id may contain only letters, digits, '_', '.', and '-' (no comma, '=', or whitespace, which would break the buildx --secret argv)"),ssm:c.string().min(1,"ssm parameter name cannot be empty").optional(),secretsManager:c.object({name:c.string().min(1,"secret name cannot be empty").optional(),arn:c.string().min(1,"secret arn cannot be empty").optional(),field:c.string().min(1,"secret field cannot be empty").optional()}).strict().refine(e=>e.name===void 0!=(e.arn===void 0),"secretsManager requires exactly one of name or arn").optional(),env:c.string().min(1,"env variable name cannot be empty").optional()}).strict().superRefine((e,t)=>{[e.ssm,e.secretsManager,e.env].filter(r=>r!==void 0).length!==1&&t.addIssue({code:c.ZodIssueCode.custom,message:"buildSecret requires exactly one source (ssm, secretsManager, or env)"})}),cZ=c.union([c.string(),c.object({ssm:c.string().min(1,"ssm parameter name cannot be empty").optional(),secretsManager:c.object({name:c.string().min(1,"secret name cannot be empty").optional(),arn:c.string().min(1,"secret arn cannot be empty").optional(),field:c.string().min(1,"secret field cannot be empty").optional()}).strict().refine(e=>e.name===void 0!=(e.arn===void 0),"secretsManager requires exactly one of name or arn").optional(),env:c.string().min(1,"env variable name cannot be empty").optional(),acknowledgePublic:c.boolean().optional()}).strict().superRefine((e,t)=>{[e.ssm,e.secretsManager,e.env].filter(r=>r!==void 0).length!==1&&t.addIssue({code:c.ZodIssueCode.custom,message:"buildArg value requires exactly one source (ssm, secretsManager, or env)"})})]),on=c.object({path:c.string(),context:c.string().min(1,"context cannot be empty").optional(),target:c.string().min(1,"target cannot be empty").optional(),buildArgs:c.record(c.string(),cZ).optional(),buildSecrets:c.array(sZ).optional()}).strict(),lle=on.partial();function lZ(e,t){if(t===void 0)return e;let r=t.context??e.context,i=t.target??e.target,n=t.buildArgs??e.buildArgs,a=t.buildSecrets??e.buildSecrets;return{path:t.path??e.path,...r!==void 0&&{context:r},...i!==void 0&&{target:i},...n!==void 0&&{buildArgs:n},...a!==void 0&&{buildSecrets:a}}}Rf(lZ,"mergeDockerBuild");function i_(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}Rf(i_,"isRecord");function e$(e){if(!i_(e)||typeof e.path!="string"||e.path.length===0)return;let t=typeof e.context=="string"&&e.context.length>0?e.context:void 0,r=typeof e.target=="string"&&e.target.length>0?e.target:void 0,i=i_(e.buildArgs)&&Object.keys(e.buildArgs).length>0?e.buildArgs:void 0,n=Array.isArray(e.buildSecrets)&&e.buildSecrets.length>0?e.buildSecrets:void 0,a={path:e.path,...t!==void 0&&{context:t},...r!==void 0&&{target:r},...i!==void 0&&{buildArgs:i},...n!==void 0&&{buildSecrets:n}},o=on.safeParse(a);return o.success?o.data:void 0}Rf(e$,"normaliseDockerBuild");function uZ(e){if(e===void 0)return;let t=e$(e);return t===void 0?void 0:JSON.stringify(t)}Rf(uZ,"dockerBuildFingerprint");var dZ=c.object({name:c.string(),clusterName:c.string().optional(),docker:on.optional(),containerPort:c.number().optional(),secrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),importedSecretNames:c.array(c.string()).optional(),schemaGateImageTag:c.string().optional()}).strict(),pZ=c.object({type:c.enum(gr),name:c.string(),source:c.string()}).strict(),mZ=c.object({repositoryName:c.string()}).strict(),fZ=["x86_64","arm64"],hZ=c.object({name:c.string(),secrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),importedSecretNames:c.array(c.string()).optional(),docker:on.optional(),imageKey:c.string().optional(),architecture:c.enum(fZ).optional()}).strict(),gZ=c.object({templateHash:c.string(),synthTimestamp:c.string()}).strict(),yZ=c.object({constructPath:c.string().max(512),group:c.string().max(128),resourceType:c.string().max(256)}).strict(),vZ=c.object({synthesisedBy:c.string().min(1).max(128),minimumEngineVersion:c.string().min(1).max(32),maximumEngineMajor:c.number().int().min(0).optional(),minimumAwsCdkCli:c.string().min(1).max(32).optional()}).strict(),bZ=c.object({appName:c.string().min(1).max(128),slot:c.string().min(1).max(64),clusterName:c.string().min(1).max(128),anchor:c.string().min(1).max(128),pinned:c.boolean(),currentServiceName:c.string().min(1).max(256),legacyKey:c.string().min(1).max(256),legacyAnchor:c.string().min(1).max(256),legacyServiceName:c.string().min(1).max(512),legacyKeyFields:c.array(c.string().max(64)).max(32)}).strict(),SZ=c.object({constructPath:c.string().min(1).max(512),resourceType:c.string().min(1).max(256),physicalNameHint:c.string().min(1).max(512),policy:c.enum(["retain","snapshot","adopted"]),destroyDisposition:c.enum(["survives","deleted-on-explicit-destroy"]),reason:c.string().min(1).max(1024),costClass:c.enum(["none","storage","fixed-monthly"]),cleanupHint:c.string().min(1).max(1024)}).strict(),ule=c.object({version:c.literal(aZ),generatedAt:c.string(),appName:c.string(),services:c.array(dZ),lambdas:c.array(hZ),pattern:pZ.optional(),ecr:mZ.optional(),stacks:c.record(c.string(),gZ),resourceMap:c.record(c.string(),yZ).optional(),engineCompat:vZ.optional(),identityAliases:c.array(bZ).optional(),residuals:c.array(SZ).optional()}).strict();var EZ=Object.defineProperty,AZ=(e,t)=>EZ(e,"name",{value:t,configurable:!0});function r$(e){return!(e.image!==void 0&&e.docker!==void 0)}AZ(r$,"imageDockerMutexCheck");var n$=c.number().int(E.CAPACITY.MIN.INTEGER).min(Zx,E.GENERATOR_CAPACITY.MIN.MIN).max(Hx,E.GENERATOR_CAPACITY.MIN.MAX),i$=c.number().int(E.CAPACITY.MAX.INTEGER).min(Zx,E.GENERATOR_CAPACITY.MAX.MIN).max(Hx,E.GENERATOR_CAPACITY.MAX.MAX),us=c.number().int(E.LAMBDA.MEMORY.INTEGER).min(yO,E.LAMBDA.MEMORY.MIN).max(vO,E.LAMBDA.MEMORY.MAX).refine(e=>e===128||e%64===0,E.LAMBDA.MEMORY.MULTIPLE),a$=c.string().regex(fe.LAMBDA_RUNTIME_IDENTIFIER,E.LAMBDA.RUNTIME),a_=c.number().int(E.CPU.INTEGER).min(256,E.CPU.MIN).max(4096,E.CPU.MAX),$f=c.number().int(E.CAPACITY.DESIRED.INTEGER).min(0,E.CAPACITY.DESIRED.MIN).max(ss,E.CAPACITY.DESIRED.MAX),Fl=c.object({connectToDatabase:c.array(c.string()).optional()}).strict(),xZ=c.object({minSize:c.number().int(E.CAPACITY.WARM_POOL.MIN_SIZE.INTEGER).min(0,E.CAPACITY.WARM_POOL.MIN_SIZE.MIN).max(bO,E.CAPACITY.WARM_POOL.MIN_SIZE.MAX).optional(),reuseOnScaleIn:c.boolean().optional()}).strict(),o_=c.object({instanceType:c.string().optional(),amiHardwareType:c.enum(yf).optional(),minCapacity:c.number().int(E.CAPACITY.MIN.INTEGER).min(0,E.CAPACITY.MIN.MIN_0).max(ss,E.CAPACITY.MIN.MAX).optional(),maxCapacity:c.number().int(E.CAPACITY.MAX.INTEGER).min(1,E.CAPACITY.MAX.MIN_1).max(ss,E.CAPACITY.MAX.MAX).optional(),memoryLimitMiB:Nl(128).optional(),warmPool:xZ.optional(),extraProperties:c.array(bt).optional()}).strict().superRefine((e,t)=>{if(!e.instanceType||!e.amiHardwareType)return;let r=Pf(e.instanceType,e.amiHardwareType);r.valid||t.addIssue({code:"custom",message:r.message??E.ARCHITECTURE_MISMATCH,path:["instanceType"]})}).superRefine((e,t)=>{e.minCapacity===0&&!e.warmPool&&t.addIssue({code:"custom",message:E.CAPACITY.WARM_POOL_REQUIRED,path:["minCapacity"]}),e.warmPool?.minSize!==void 0&&e.maxCapacity!==void 0&&e.warmPool.minSize>e.maxCapacity&&t.addIssue({code:"custom",message:E.CAPACITY.WARM_POOL.MIN_SIZE_EXCEEDS_MAX_CAPACITY,path:["warmPool","minSize"]})}),_Z=c.enum(Tl).describe(`Compute type must be one of: ${Tl.join(", ")}`),s_=c.enum(as).describe(`ECS capacity provider must be one of: ${as.join(", ")}`),c_=c.string().refine(e=>Ft(vf,e),{message:E.INSTANCE_TYPE}),o$=c.object({sourceType:c.enum(["sqs","dynamodb","eventbridge"]),sourceRef:c.string().describe("Name of the source resource"),batchSize:c.number().int(E.BATCH_SIZE.INTEGER).min(1,E.BATCH_SIZE.MIN).max(1e4,E.BATCH_SIZE.MAX).optional(),startingPosition:c.enum(["TRIM_HORIZON","LATEST"]).optional(),maxBatchingWindow:c.number().int(E.BATCHING_WINDOW.INTEGER).min(0,E.BATCHING_WINDOW.MIN).max(300,E.BATCHING_WINDOW.MAX).optional(),reportBatchItemFailures:c.boolean().optional()}).strict(),TZ=c.object({name:c.string().min(1,E.REQUIRED.CONTAINER_NAME).optional(),image:c.string().optional(),port:ga.optional(),environment:ls.optional(),secretsImport:CO.optional(),command:c.array(c.string()).optional(),entryPoint:c.array(c.string()).optional(),essential:c.boolean().optional(),healthCheck:c.object({command:c.array(c.string()),interval:c.number().int(E.HEALTH_CHECK.INTERVAL.INTEGER).min(5,E.HEALTH_CHECK.INTERVAL.MIN).max(300,E.HEALTH_CHECK.INTERVAL.MAX).optional(),timeout:c.number().int(E.HEALTH_CHECK.TIMEOUT.INTEGER).min(2,E.HEALTH_CHECK.TIMEOUT.MIN).max(60,E.HEALTH_CHECK.TIMEOUT.MAX).optional(),retries:c.number().int(E.HEALTH_CHECK.RETRIES.INTEGER).min(1,E.HEALTH_CHECK.RETRIES.MIN).max(10,E.HEALTH_CHECK.RETRIES.MAX).optional(),startPeriod:c.number().int(E.HEALTH_CHECK.START_PERIOD.INTEGER).min(0,E.HEALTH_CHECK.START_PERIOD.MIN).max(300,E.HEALTH_CHECK.START_PERIOD.MAX).optional()}).strict().optional(),ssmSecrets:c.array(c.string().regex(fe.SECRET_NAME,E.SECRET_NAME)).optional(),extraProperties:c.array(bt).optional()}).strict(),s$=c.string().min(1,E.REQUIRED.SERVICE_NAME).max(255,E.MAX_LENGTH.SERVICE_NAME).regex(fe.ECS_SERVICE_NAME,E.ECS_SERVICE_NAME),c$=c.object({domain:c.string().optional(),loadBalancer:c.union([c.literal(!1),c.enum(hf)]).optional(),directAccess:c.boolean().optional(),extraProperties:c.array(bt).optional()}).strict().refine(e=>!(e.directAccess&&e.domain),{message:E.DIRECT_ACCESS.NO_DOMAIN,path:["directAccess"]}).refine(e=>!(e.directAccess&&typeof e.loadBalancer=="string"),{message:E.DIRECT_ACCESS.NO_LOAD_BALANCER}).describe("Cluster-level configuration"),Of=c.object({path:c.string().optional(),host:c.string().optional(),priority:c.number().int(E.PRIORITY.INTEGER).min(1,E.PRIORITY.MIN).max(5e4,E.PRIORITY.MAX).optional(),healthCheckPath:c.string().optional()}).strict().describe("Path/host-based routing configuration"),CZ=c.object({desiredCount:$f.optional(),minCapacity:c.number().int(E.CAPACITY.MIN.INTEGER).min(0,E.CAPACITY.MIN.MIN_0).max(ss,E.CAPACITY.MIN.MAX).optional(),maxCapacity:c.number().int(E.CAPACITY.MAX.INTEGER).min(1,E.CAPACITY.MAX.MIN_1).max(ss,E.CAPACITY.MAX.MAX).optional(),scalingType:c.enum(gf).optional()}).strict().refine(ha.check,ha.params).describe("ECS service scaling configuration"),l$=c.object({name:s$,docker:on.optional(),needsDatabaseConnection:c.boolean().optional(),needsStorageConnection:c.boolean().optional(),needsMessagingConnection:c.boolean().optional(),image:c.string().optional(),containers:c.array(TZ).optional(),routing:c.union([Of,c.array(Of).min(1)]).optional(),serviceType:c.enum(Il).optional(),cpu:a_.optional(),memoryLimitMiB:Nl(512).optional(),desiredCount:$f.optional(),scaling:Ut(CZ).optional(),capacityProvider:s_,ec2Config:o_.optional(),ssmSecretsPath:c.string().regex(fe.SSM_PATH,E.SSM_PATH).optional(),extraProperties:c.array(bt).optional(),alarms:NO.optional()}).strict().superRefine((e,t)=>{r$(e)||t.addIssue({code:"custom",path:["docker"],message:E.IMAGE_DOCKER_MUTEX})}).describe("Configuration for a service in an ECS cluster"),Ul=c.object({name:be,type:_Z,needsConnection:c.boolean(),connectedDatabase:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),connectedStorage:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),connectedMessaging:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),cluster:c$.optional(),services:c.array(l$).optional(),docker:on.partial().optional(),deployment:c.enum(pf).optional(),codePath:c.string().optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(bf,E.LAMBDA.TIMEOUT.MIN).max(Sf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:us.optional(),handler:c.string().optional(),runtime:a$.optional(),environment:ls.optional(),secrets:ls.optional(),eventSources:c.array(o$).optional(),functionUrl:c.object({authType:c.enum(Dl)}).strict().optional(),description:c.string().optional(),scheduleExpression:c.string().optional(),scheduleStackPlacement:c.enum(fa).optional(),architecture:c.enum(ff).optional(),ephemeralStorageSize:c.number().int(E.EPHEMERAL_STORAGE.INTEGER).min(512,E.EPHEMERAL_STORAGE.MIN).max(10240,E.EPHEMERAL_STORAGE.MAX).optional(),functionName:c.string().optional(),ssmSecrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),alarms:PO.optional(),instanceType:c_.optional(),enableSSH:c.boolean().optional(),keyName:c.string().optional(),userData:c.string().optional(),securityGroups:c.array(c.string()).optional(),variableName:c.string().optional(),extraProperties:c.array(bt).optional()}).strict().superRefine((e,t)=>{if(e.type==="ecs"&&e.services)for(let r=0;r<e.services.length;r++){let i=e.services[r];i?.ec2Config?.instanceType&&!i.ec2Config.amiHardwareType&&xi(i.ec2Config.instanceType)!=="ARM"&&t.addIssue({code:"custom",message:`Service '${i.name??r}' uses instance type '${i.ec2Config.instanceType}' (x86), which requires Docker images built for linux/amd64. The default build targets linux/arm64 (Graviton). Use a Graviton instance type (t4g, c6g, r6g, m6g, etc.) or set amiHardwareType: "STANDARD" to acknowledge x86.`,path:["services",r,"ec2Config","instanceType"]})}e.type==="lambda"&&e.deployment==="container"&&e.architecture==="X86_64"&&t.addIssue({code:"custom",message:"Lambda architecture 'X86_64' requires Docker images built for linux/amd64, but the default build targets linux/arm64. Use 'ARM_64' for Graviton Lambdas (recommended) or ensure your build pipeline targets linux/amd64.",path:["architecture"]})}),ble=c.object({appName:lt,clusterName:be,containerPort:ga,nameProvidedByFlag:c.boolean().optional(),ecrRepository:c.string().optional(),capacityProvider:s_.optional(),useAppEcr:c.boolean().optional(),desiredCount:$f.optional(),cpu:a_.optional(),memoryLimitMiB:Nl(512).optional(),minCapacity:n$.optional(),maxCapacity:i$.optional(),ec2Config:o_.optional(),connectionConfig:Fl.optional()}).strict().refine(ha.check,ha.params),Sle=c.object({appName:lt,functionName:be,nameProvidedByFlag:c.boolean().optional(),lambdaType:c.enum(["basic","web","custom"]).optional(),ecrRepository:c.string().optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(bf,E.LAMBDA.TIMEOUT.MIN).max(Sf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:us.optional(),enableFunctionUrl:c.boolean().optional(),description:c.string().optional(),enableCors:c.boolean().optional(),corsOrigins:c.string().optional(),corsHeaders:c.string().optional(),corsMethods:c.array(c.enum(EO)).optional(),corsCredentials:c.boolean().optional(),connectionConfig:Fl.optional()}).strict(),Ele=c.object({appName:lt,instanceName:be,nameProvidedByFlag:c.boolean().optional(),instanceType:c_.optional(),enableSSH:c.boolean().optional(),minCapacity:n$.optional(),maxCapacity:i$.optional(),connectionConfig:Fl.optional()}).strict().refine(ha.check,ha.params),Ale=c.object({appName:lt,clusterName:be,serviceName:s$,capacityProvider:s_,containerPort:ga.optional(),cpu:a_.optional(),memoryLimitMiB:Nl(512).optional(),desiredCount:$f.optional(),ec2Config:o_.optional(),routing:c.union([Of,c.array(Of).min(1)]).optional(),docker:on.partial().optional(),nameProvidedByFlag:c.boolean().optional(),connectionConfig:Fl.optional()}).strict(),l_=c.object({appName:lt,computeName:be,nameProvidedByFlag:c.boolean().optional(),connectionConfig:Fl.optional()}).strict(),DZ=l_.extend({type:c.literal("ecs"),cluster:c$.optional(),services:c.array(l$).min(1,E.SERVICE.MIN_REQUIRED),docker:on.partial().optional()}).strict().refine(e=>{let t=e.services.filter(r=>r.containers?.some(i=>i.port));return t.length>1?t.every(r=>(Array.isArray(r.routing)?r.routing:r.routing?[r.routing]:[]).some(i=>i.path||i.host)):!0},{message:E.SERVICE.ROUTING_REQUIRED}).refine(e=>{let t=e.services.map(r=>r.name);return new Set(t).size===t.length},{message:E.SERVICE.UNIQUE_WITHIN_CLUSTER}),IZ=l_.extend({type:c.literal("lambda"),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(bf,E.LAMBDA.TIMEOUT.MIN).max(Sf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:us.optional(),handler:c.string().optional(),runtime:a$.optional(),environment:ls.optional(),secrets:ls.optional(),description:c.string().optional(),functionUrl:c.union([c.object({authType:c.enum(Dl).optional()}).strict(),c.literal(!1)]).optional(),eventSources:c.array(o$).optional()}).strict(),kZ=l_.extend({type:c.literal("ec2"),instanceType:c_.optional(),enableSSH:c.boolean().optional(),keyName:c.string().optional(),userData:c.string().optional(),securityGroups:c.array(c.string()).optional()}).strict(),xle=c.discriminatedUnion("type",[DZ,IZ,kZ]),t$=c.object({path:c.string().min(1,E.REQUIRED.ROUTING_PATH),priority:c.number().int(E.PRIORITY.INTEGER).min(1,E.PRIORITY.MIN).max(5e4,E.PRIORITY.MAX).optional()}).strict(),u$=c.object({name:c.string().min(1,E.REQUIRED.SERVICE_NAME).max(255,E.MAX_LENGTH.SERVICE_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),serviceType:c.enum(Il).optional(),docker:on.partial().optional(),containerPort:ga.optional(),needsDatabaseConnection:c.boolean().optional(),routing:c.union([t$,c.array(t$).min(1)]).optional()}).strict().superRefine((e,t)=>{e.serviceType==="worker"&&(e.containerPort!==void 0&&t.addIssue({code:"custom",path:["containerPort"],message:"Worker services are not reachable inbound; remove containerPort."}),e.routing!==void 0&&t.addIssue({code:"custom",path:["routing"],message:"Worker services have no ALB route; remove routing."}))}),_le=c.object({appName:lt,instanceType:c.string().optional()}).strict();var u_=c.object({memorySize:us.optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(1,E.LAMBDA.TIMEOUT.MIN).max(900,E.LAMBDA.TIMEOUT.MAX).optional(),ephemeralStorageSize:c.number().int(E.EPHEMERAL_STORAGE.INTEGER).min(512,E.EPHEMERAL_STORAGE.MIN).max(10240,E.EPHEMERAL_STORAGE.MAX).optional()}).strict(),d$=c.object({type:c.enum(Kx).optional(),databaseName:c.string().optional(),databaseEngine:c.enum(os).optional(),deletionProtection:c.boolean().optional(),backupRetention:ya.optional(),port:_f.optional(),publiclyAccessible:c.boolean().optional(),allowedIpCidr:c.string().optional(),instanceType:c.string().optional(),allocatedStorage:c.number().int(E.ALLOCATED_STORAGE.INTEGER).min(20,E.ALLOCATED_STORAGE.MIN).max(65536,E.ALLOCATED_STORAGE.MAX).optional(),multiAz:c.boolean().optional(),readReplica:Df.optional(),writer:Rl.optional(),readers:Ol.optional(),allowVpcAccess:c.boolean().optional(),monitoringInterval:Pl.optional(),preferredMaintenanceWindow:c.string().optional(),databaseInsights:If.optional(),proxy:Cf.optional(),credentials:Tf.optional(),encryption:kf.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()}).strict(),p$=c.object({server:u_.optional(),imageOptimisation:u_.optional(),revalidation:u_.optional()}).strict(),d_=c.object({versioned:c.boolean().optional()}).strict(),m$=c.object({assets:d_.optional(),cache:d_.optional(),media:d_.optional()}).strict(),NZ=c.object({visibilityTimeout:c.number().int(E.SQS.VISIBILITY_TIMEOUT.INTEGER).min(0,E.SQS.VISIBILITY_TIMEOUT.MIN).max(43200,E.SQS.VISIBILITY_TIMEOUT.MAX).optional(),messageRetentionPeriod:c.number().int(E.SQS.RETENTION_PERIOD.INTEGER).min(60,E.SQS.RETENTION_PERIOD.MIN).max(1209600,E.SQS.RETENTION_PERIOD.MAX).optional(),maxMessageSize:c.number().int(E.MAX_MESSAGE_SIZE.INTEGER).min(1024,E.MAX_MESSAGE_SIZE.MIN).max(262144,E.MAX_MESSAGE_SIZE.MAX).optional(),deadLetterQueue:c.union([c.literal(!1),c.object({enabled:c.boolean().optional(),maxReceiveCount:c.number().int(E.DLQ.MAX_RECEIVE_COUNT.INTEGER).min(1,E.DLQ.MAX_RECEIVE_COUNT.MIN).max(1e3,E.DLQ.MAX_RECEIVE_COUNT.MAX).optional()}).strict()]).optional()}).strict(),f$=c.object({revalidationQueue:NZ.optional()}).strict(),h$=c.object({domainNames:c.array(c.string()).optional(),certificateArn:c.string().optional()}).strict(),g$=c.record(c.string().regex(fe.ENV_VAR_NAME,E.ENV_VAR_NAME),c.string()).optional(),p_=c.object({type:c.literal("payload"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),domain:c.string().optional(),database:d$.optional(),compute:p$.optional(),storage:m$.optional(),messaging:f$.optional(),cdn:h$.optional(),environment:g$}).strict(),m_=c.object({type:c.literal("nextjs"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),domain:c.string().optional(),database:d$.optional(),compute:p$.optional(),storage:m$.optional(),messaging:f$.optional(),cdn:h$.optional(),environment:g$}).strict(),f_=c.enum(tl),wZ=c.object({command:c.string().min(1,E.REQUIRED.BUILD_COMMAND),outputDir:c.string().min(1,E.REQUIRED.OUTPUT_DIR)}).strict(),PZ=c.object({maxAgeDays:c.number().optional(),includeSubdomains:c.boolean().optional(),preload:c.boolean().optional()}).strict(),RZ=c.object({headers:c.boolean().optional(),contentSecurityPolicy:c.string().optional(),hsts:c.union([c.literal(!1),PZ]).optional()}).strict(),OZ=c.object({to:c.string().min(1,E.REQUIRED.FORMS_TO).regex(fe.EMAIL,E.EMAIL),from:c.string().regex(fe.EMAIL,E.EMAIL).optional(),corsOrigin:c.string().regex(fe.HTTP_ORIGIN,"corsOrigin must be an exact origin such as https://example.com (no path, no trailing slash)").optional(),maxConcurrency:c.number().int().min(1).max(100).optional()}).strict(),$Z=c.object({behaviours:c.array(c.unknown()).optional(),priceClass:c.enum(rl).optional(),invalidateOnDeploy:c.boolean().optional()}).strict(),jZ=c.object({type:c.literal("basic-auth"),username:c.string().min(1,"accessGate.username must not be empty"),password:c.string().min(1,"accessGate.password must not be empty")}).strict(),zl=c.object({type:c.literal("staticsite"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),source:c.string().min(1,E.REQUIRED.SOURCE),build:wZ,routing:f_.optional(),security:RZ.optional(),domain:c.string().optional(),zoneName:c.string().optional(),hostedZoneId:c.string().optional(),forms:OZ.optional(),cdn:$Z.optional(),accessGate:jZ.optional()}).strict().superRefine((e,t)=>{if(e.forms===void 0)return;let r=e.domain;if(r===void 0||r===""){t.addIssue({code:"custom",path:["domain"],message:"A domain is required when forms are enabled: SES sends only from a verified identity, and the site's domain is the identity the pattern verifies"});return}let i=e.forms.from;i!==void 0&&!km(i,r)&&t.addIssue({code:"custom",path:["forms","from"],message:`forms.from must be an address at ${r} (the verified SES identity) \u2014 for example noreply@${r}. Use forms.to for the recipient.`})}),Bl=c.discriminatedUnion("type",[p_,m_,zl]),y$=c.enum(["lightweight","standard","resilient","custom"]),v$=c.object({type:c.enum(Kx),instanceType:c.string().optional(),backupRetention:ya.optional(),deletionProtection:c.boolean().optional(),encryption:c.union([c.object({useCMK:c.literal(!0)}).strict(),c.literal(!1)]).optional()}).strict(),b$=c.object({memorySize:us.optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(1,E.LAMBDA.TIMEOUT.MIN).max(900,E.LAMBDA.TIMEOUT.MAX).optional()}).strict();var S$=c.object({appName:lt,type:Jx,pattern:Xx.optional(),patternConfig:Bl.optional(),owner:c.string().optional(),tags:c.record(c.string(),c.string()).optional(),vpcId:c.string().optional(),network:va.optional(),backup:IO.optional(),tunnel:kO.optional(),additionalNetworks:c.array(JO).optional(),database:c.array($l),s3:c.array(jl),compute:c.array(Ul),dynamodb:c.array(GO).optional(),clickhouse:c.array(VO).optional(),sqs:c.array(Ml).optional(),cdn:Ll.optional(),customCodeBlocks:c.array(DO).optional(),additionalManagedImports:c.array(c.object({moduleSpecifier:c.string(),namedImports:c.array(c.string()),defaultImport:c.string().optional()}).strict()).optional()}).strict(),Vle=c.object({name:lt,type:Jx,pattern:Xx.optional(),patternTier:y$.optional(),patternDomain:c.string().optional(),source:c.string().min(1,E.REQUIRED.SOURCE).optional(),buildCommand:c.string().min(1,E.REQUIRED.BUILD_COMMAND).optional(),outputDir:c.string().min(1,E.REQUIRED.OUTPUT_DIR).optional(),routing:f_.optional(),formsTo:c.string().min(1,E.REQUIRED.FORMS_TO).regex(fe.EMAIL,E.EMAIL).optional(),corsOrigin:c.string().regex(fe.HTTP_ORIGIN,"corsOrigin must be an exact origin such as https://example.com (no path, no trailing slash)").optional(),customDatabase:v$.optional(),customCompute:b$.optional(),region:c.string().optional(),owner:c.string().optional(),includeDatabase:c.boolean().optional(),databaseName:c.string().min(1,E.DATABASE.NAME.REQUIRED).max(63,E.DATABASE.NAME.MAX_LENGTH).optional(),vpcId:c.string().optional(),network:XO.optional(),services:c.array(u$).optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()}).strict().superRefine((e,t)=>{e.formsTo!==void 0&&(e.patternDomain!==void 0&&e.patternDomain!==""||t.addIssue({code:"custom",path:["patternDomain"],message:"A domain is required when forms are enabled: SES sends only from a verified identity, and the site's domain is the identity the pattern verifies"}))}),h_=c.object({name:be,localResource:c.string().min(1),remoteApp:c.string().min(1),remoteResource:c.string().min(1),permission:c.enum(["read","write","read-write"]),remoteArn:c.string().optional()}).strict();var MZ=["fjall-managed","external","external-manual"],Jle=c.enum(MZ);var E$=c.object({givenName:c.string().min(1),familyName:c.string().min(1),displayName:c.string().min(1).optional(),expires:c.string().min(1).optional()}).strict(),A$=c.object({name:c.string().min(1),path:c.string().min(1).optional()}).strict(),LZ=c.union([c.object({managedPolicyArn:c.string().min(1)}).strict(),c.object({customerManagedPolicy:A$}).strict()]),FZ=c.object({managedPolicies:c.array(c.string().min(1)).optional(),inlinePolicy:c.record(c.string(),c.unknown()).optional(),customerManagedPolicies:c.array(A$).optional(),permissionsBoundary:LZ.optional(),sessionDuration:c.string().min(1).optional(),description:c.string().optional(),accounts:c.union([c.array(c.string().min(1)),c.literal("all")]).optional(),includeManagementAccount:c.boolean().optional(),groups:c.array(c.string().min(1)).optional()}).strict(),UZ=c.object({description:c.string().optional()}).strict(),jf=c.string().regex(fe.EMAIL,E.EMAIL),g_={groups:c.record(c.string(),UZ).optional(),permissionSets:c.record(c.string(),FZ).optional(),memberships:c.record(c.string(),c.array(jf)).optional(),resolutionVersion:c.number().int().min(1).optional(),defaultPermissionSets:c.boolean().optional()},zZ=c.discriminatedUnion("source",[c.object({...g_,source:c.literal("fjall-managed"),users:c.record(jf,E$)}).strict(),c.object({...g_,source:c.literal("external")}).strict(),c.object({...g_,source:c.literal("external-manual"),users:c.record(jf,E$).optional()}).strict()]),y_=c.object({name:be,type:c.literal("organisation").optional(),organisationName:c.string().min(1).optional(),orgEmail:jf.optional(),accounts:c.unknown().optional(),accountIds:c.record(c.string(),c.string()).optional(),identityCentre:c.union([zZ,c.literal(!1)]).optional(),allowedRegions:c.array(c.string().min(1)).optional()}).strict();var BZ=Object.defineProperty,GZ=(e,t)=>BZ(e,"name",{value:t,configurable:!0}),VZ=[1,3,5,7,14,30,60,90,120,150,180,365,400,545,731,1827,3653],Mf=c.object({buildkiteQueue:c.string().min(1,"buildkiteQueue cannot be empty").max(100).regex(/^[a-zA-Z0-9-_]+$/,"buildkiteQueue must be alphanumeric with hyphens/underscores"),buildkiteOrgSlug:c.string().min(1,"buildkiteOrgSlug cannot be empty").max(100).regex(/^[a-z0-9-]+$/,"buildkiteOrgSlug must be a lowercase Buildkite organisation slug"),agentTokenSsmParameterName:c.string().min(2).regex(/^\//,"agentTokenSsmParameterName must be a full path (leading /)").optional(),agentTokenKmsKeyArn:c.string().min(1).optional(),fjallApiKeySsmParameterName:c.string().min(2).regex(/^\//,"fjallApiKeySsmParameterName must be a full path (leading /)").optional(),instanceType:c.string().min(1).default("c8g.xlarge"),agentVolumeSizeGib:c.number().int().min(20).max(1e3).default(250),agentMinInstances:c.number().int().min(0).default(0),agentMaxInstances:c.number().int().min(1).default(2),agentsPerInstance:c.number().int().min(1).default(1),spotCapacityPercentage:c.number().int().min(0).max(100).default(0),scaleInIdlePeriodSeconds:c.number().int().min(60).default(600),disconnectAfterUptimeSeconds:c.number().int().min(3600).default(86400),maxInstanceLifetimeDays:c.number().int().min(1).max(365).default(7),terminateInstanceAfterJob:c.boolean().default(!1),purgeBuildsOnDiskFull:c.boolean().default(!0),terminateInstanceOnDiskFull:c.boolean().default(!1),logRetentionDays:c.number().int().min(1).default(30),agentLogRetentionDays:c.literal(VZ).default(7),buildkiteAgentRelease:c.enum(["stable","beta","edge"]).default("stable"),buildkiteAgentTags:c.string().default(""),buildkiteAgentTimestampLines:c.boolean().default(!1),buildkiteAgentExperiments:c.string().default(""),buildkiteAgentTracingBackend:c.enum(["","datadog","opentelemetry"]).default(""),buildkiteAgentCancelGracePeriodSeconds:c.number().int().min(10).default(60),enableSecretsPlugin:c.boolean().default(!0),enableEcrPlugin:c.boolean().default(!1),enableDockerLoginPlugin:c.boolean().default(!1),enableDockerUserNamespaceRemap:c.boolean().default(!0),enableDockerExperimental:c.boolean().default(!1),dockerNetworkingProtocol:c.enum(["ipv4","dualstack"]).default("ipv4"),enableInstanceStorage:c.boolean().default(!1),mountTmpfsAtTmp:c.boolean().default(!0),buildkiteAgentEnableGitMirrors:c.boolean().default(!1),bootstrapScriptUrl:c.string().default(""),agentEnvFileUrl:c.string().default(""),scalerEventSchedulePeriod:c.string().min(1).default("1 minute"),scalerMinPollInterval:c.string().min(1).default("10s"),scaleOutFactor:c.string().min(1).default("1.0"),scaleOutWaitingForJobs:c.boolean().default(!1),rolePermissionsBoundaryArn:c.string().min(1).optional(),alarmSnsTopicArn:c.string().min(1).optional(),applicationId:c.string().min(1).optional(),costAllocationEnvironment:c.string().min(1).optional(),costAllocationOwner:c.string().min(1).optional()}).strict(),WZ=Mf.refine(e=>e.agentMinInstances<=e.agentMaxInstances,{message:"agentMinInstances must be <= agentMaxInstances"});function KZ(e){let t=WZ.safeParse(e);if(!t.success){let r=t.error.issues.map(i=>` - ${i.path.join(".")||"(root)"}: ${i.message}`).join(`
314
314
  `);throw new Error(`Buildkite: invalid props:
315
- ${r}`)}return t.data}GZ(KZ,"validateBuildkiteProps");var ZZ=Object.defineProperty,HZ=(e,t)=>ZZ(e,"name",{value:t,configurable:!0});function JZ(e){return`FjallDeployBoundary${e}`}HZ(JZ,"deployBoundaryName");var v_={Sid:"FjallInheritAdministratorAccess",Effect:"Allow",Action:"*",Resource:"*"},x$=[{Sid:"FjallDenyOrgAndAccountEscape",Effect:"Deny",Action:["organizations:LeaveOrganization","account:CloseAccount"],Resource:"*"},{Sid:"FjallDenyDisableAuditLogging",Effect:"Deny",Action:["cloudtrail:StopLogging"],Resource:"*"},{Sid:"FjallDenyBoundarySelfEscape",Effect:"Deny",Action:["iam:DeleteRolePermissionsBoundary"],Resource:"*"},{Sid:"FjallDenyDisableKmsKey",Effect:"Deny",Action:["kms:DisableKey"],Resource:"*"}],_$=[...x$,{Sid:"FjallDenyStandingHumanCredentials",Effect:"Deny",Action:["iam:CreateUser","iam:CreateLoginProfile","iam:CreateAccessKey","iam:CreateAccountAlias"],Resource:"*"},{Sid:"FjallDenyDisableConfigRecorder",Effect:"Deny",Action:["config:StopConfigurationRecorder"],Resource:"*"}],XZ=[..._$,{Sid:"FjallDenyAccountPasswordPolicyTamper",Effect:"Deny",Action:["iam:UpdateAccountPasswordPolicy","iam:DeleteAccountPasswordPolicy"],Resource:"*"},{Sid:"FjallDenyDisableDefaultEbsEncryption",Effect:"Deny",Action:["ec2:DisableEbsEncryptionByDefault"],Resource:"*"}],uue={foundation:[v_,...x$],compliance:[v_,..._$],hardened:[v_,...XZ]};var qZ=Object.defineProperty,ut=(e,t)=>qZ(e,"name",{value:t,configurable:!0});var E_="sts.amazonaws.com";function YZ(e){return`FjallDevDeploy${e}`}ut(YZ,"devDeployRoleName");function QZ(e){return`FjallDevProvisioner${e}`}ut(QZ,"devProvisionerRoleName");function eH(e){return`FjallDevSyncWriter${e}`}ut(eH,"devSyncWriterRoleName");var tH="FjallDevBoundary";function T$(e){return`arn:aws:iam::${e}:policy/${tH}`}ut(T$,"devBoundaryPolicyArn");function C$(e){return`org:${e}:dev-provisioner`}ut(C$,"devProvisionerSubject");function D$(e){return`org:${e}:dev-sync`}ut(D$,"devSyncSubject");function b_(e,t){return`org:${e}:acct:${t}`}ut(b_,"deployAccountSubject");function S_(e){return`org:${e}:*`}ut(S_,"genericMachineSubject");var rH=["discovery","connection","org-setup","dev-substrate-setup"];function I$(e,t){return`org:${e}:${t}`}ut(I$,"serviceSubject");function nH(e){let{fjallOrgId:t,providerArn:r,issuerDomain:i,accountTier:n,accountId:a}=e,o=e.machineTrustMode??"expanded",s={[`${i}:aud`]:E_},l;if(o==="account-scoped"){if(n===void 0||!ym(n)||a===void 0)throw new Error(`machineTrustMode "account-scoped" requires a governance accountTier and an accountId (got tier: ${String(n)}, accountId ${a===void 0?"absent":"present"}) \u2014 refusing to fall back to the generic machine subject: a silent fallback would re-widen the trust the \xA74.4a Step-3 contract removes`);l=[b_(t,a)]}else a!==void 0?l=[S_(t),b_(t,a)]:l=S_(t);return[{Sid:"FjallMachineSubject",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...s,[`${i}:sub`]:l}}},{Sid:"FjallUserSubjects",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:s,StringLike:{[`${i}:sub`]:`org:${t}:user:*`}}},{Sid:"FjallServiceSubjects",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...s,[`${i}:sub`]:rH.map(m=>I$(t,m))}}}]}ut(nH,"buildNarrowedDeployTrustStatements");function iH(e){let{fjallOrgId:t,providerArn:r,issuerDomain:i,accountId:n}=e;return[{Sid:"FjallDevSubjectsThisAccount",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${i}:aud`]:E_},StringLike:{[`${i}:sub`]:`org:${t}:dev:${n}:*`}}}]}ut(iH,"buildDevDeployTrustStatements");function A_(e){let{providerArn:t,issuerDomain:r,sid:i,subject:n}=e;return[{Sid:i,Effect:"Allow",Principal:{Federated:t},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${r}:aud`]:E_,[`${r}:sub`]:n}}}]}ut(A_,"buildServiceSubjectTrustStatements");function aH(e){return A_({...e,sid:"FjallDevProvisionerSubject",subject:C$(e.fjallOrgId)})}ut(aH,"buildDevProvisionerTrustStatements");function oH(e){return A_({...e,sid:"FjallDevSyncSubject",subject:D$(e.fjallOrgId)})}ut(oH,"buildDevSyncWriterTrustStatements");function sH({accountId:e}){return[{Sid:"FjallDevEcsTaggedMutations",Effect:"Allow",Action:["ecs:UpdateService","ecs:DeleteService","ecs:RunTask","ecs:StopTask"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTaggedCreates",Effect:"Allow",Action:["ecs:RegisterTaskDefinition","ecs:CreateService"],Resource:"*",Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTagOnCreate",Effect:"Allow",Action:["ecs:TagResource"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"ecs:CreateAction":["RegisterTaskDefinition","CreateService","RunTask"]}}},{Sid:"FjallDevEcsReads",Effect:"Allow",Action:["ecs:Describe*","ecs:List*"],Resource:"*"},{Sid:"FjallDevEcsDeregisterTaskDefinition",Effect:"Allow",Action:["ecs:DeregisterTaskDefinition"],Resource:`arn:aws:ecs:*:${e}:task-definition/fjall-dev-*`},{Sid:"FjallDevElbTaggedMutations",Effect:"Allow",Action:["elasticloadbalancing:ModifyRule","elasticloadbalancing:DeleteRule","elasticloadbalancing:ModifyTargetGroup","elasticloadbalancing:ModifyTargetGroupAttributes","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:RegisterTargets","elasticloadbalancing:DeregisterTargets"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTaggedCreates",Effect:"Allow",Action:["elasticloadbalancing:CreateTargetGroup","elasticloadbalancing:CreateRule"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTagOnCreate",Effect:"Allow",Action:["elasticloadbalancing:AddTags"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"elasticloadbalancing:CreateAction":["CreateTargetGroup","CreateRule"]}}},{Sid:"FjallDevElbReads",Effect:"Allow",Action:["elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevSsmDevTree",Effect:"Allow",Action:["ssm:GetParameter*","ssm:PutParameter","ssm:AddTagsToResource"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevLogsMutations",Effect:"Allow",Action:["logs:PutRetentionPolicy","logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsTaggedCreate",Effect:"Allow",Action:["logs:CreateLogGroup","logs:TagResource"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevLogsRead",Effect:"Allow",Action:["logs:GetLogEvents","logs:DescribeLogStreams","logs:FilterLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsDescribeGroups",Effect:"Allow",Action:["logs:DescribeLogGroups"],Resource:"*"},{Sid:"FjallDevKmsViaDevAlias",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevKmsSsmSecureString",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}},{Sid:"FjallDevEcrAuthToken",Effect:"Allow",Action:["ecr:GetAuthorizationToken"],Resource:"*"},{Sid:"FjallDevEcrPushPull",Effect:"Allow",Action:["ecr:PutImage","ecr:InitiateLayerUpload","ecr:UploadLayerPart","ecr:CompleteLayerUpload","ecr:BatchCheckLayerAvailability","ecr:BatchGetImage","ecr:GetDownloadUrlForLayer","ecr:DescribeImages"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevPassDevPathRoles",Effect:"Allow",Action:["iam:PassRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`}]}ut(sH,"buildDevDeployPolicyStatements");function cH({accountId:e}){return[{Sid:"FjallDevProvisionerBoundedRoleWrites",Effect:"Allow",Action:["iam:CreateRole","iam:PutRolePolicy","iam:AttachRolePolicy"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`,Condition:{StringEquals:{"iam:PermissionsBoundary":T$(e)}}},{Sid:"FjallDevProvisionerPathRoleOps",Effect:"Allow",Action:["iam:DeleteRole","iam:DeleteRolePolicy","iam:DetachRolePolicy","iam:ListRolePolicies","iam:TagRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`},{Sid:"FjallDevProvisionerListRoles",Effect:"Allow",Action:["iam:ListRoles"],Resource:"*"},{Sid:"FjallDevProvisionerDevMasterSecrets",Effect:"Allow",Action:["secretsmanager:GetSecretValue"],Resource:`arn:aws:secretsmanager:*:${e}:secret:fjall-dev-*`},{Sid:"FjallDevProvisionerKmsDecryptViaSecretsManager",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"secretsmanager.*.amazonaws.com"}}},{Sid:"FjallDevProvisionerDataApi",Effect:"Allow",Action:["rds-data:ExecuteStatement","rds-data:BatchExecuteStatement","rds-data:BeginTransaction","rds-data:CommitTransaction","rds-data:RollbackTransaction"],Resource:`arn:aws:rds:*:${e}:cluster:fjall-dev-*`},{Sid:"FjallDevProvisionerMetrics",Effect:"Allow",Action:["cloudwatch:GetMetricData"],Resource:"*"},{Sid:"FjallDevProvisionerOrphanDiscovery",Effect:"Allow",Action:["tag:GetResources"],Resource:"*"},{Sid:"FjallDevProvisionerSsmTeardown",Effect:"Allow",Action:["ssm:DeleteParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevProvisionerLogsTeardown",Effect:"Allow",Action:["logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevProvisionerTaggedTeardown",Effect:"Allow",Action:["ecs:UpdateService","ecs:StopTask","ecs:DeleteService","elasticloadbalancing:DeleteRule","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:DeregisterTargets"],Resource:[`arn:aws:ecs:*:${e}:*`,`arn:aws:elasticloadbalancing:*:${e}:*`],Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevProvisionerTeardownReads",Effect:"Allow",Action:["ecs:Describe*","elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevProvisionerImageJanitor",Effect:"Allow",Action:["ecr:ListImages","ecr:DescribeImages","ecr:BatchDeleteImage"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevProvisionerSsmReadAll",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/*`},{Sid:"FjallDevProvisionerKmsDecryptViaSsm",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}}]}ut(cH,"buildDevProvisionerPolicyStatements");function lH({accountId:e}){return[{Sid:"FjallDevSyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}}]}ut(lH,"buildDevSyncWriterPolicyStatements");function uH({accountId:e}){return[{Sid:"FjallDevBoundarySsmDevRead",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevBoundaryKmsDecryptDevAlias",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevBoundarySyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}},{Sid:"FjallDevBoundarySlotLogs",Effect:"Allow",Action:["logs:CreateLogStream","logs:PutLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevBoundarySyncQueue",Effect:"Allow",Action:["sqs:ReceiveMessage","sqs:DeleteMessage","sqs:GetQueueUrl"],Resource:`arn:aws:sqs:*:${e}:fjall-dev-sync-${e}-*`}]}ut(uH,"buildDevBoundaryStatements");var dH=Object.defineProperty,Yt=(e,t)=>dH(e,"name",{value:t,configurable:!0});function J(e){return JSON.stringify(e)}Yt(J,"escapeStringLiteral");function Gl(e){return e.map(J).join(", ")}Yt(Gl,"formatStringArray");var pH="import:SharedAlarmTopicArn";function ba(e=" "){return`
315
+ ${r}`)}return t.data}GZ(KZ,"validateBuildkiteProps");var ZZ=Object.defineProperty,HZ=(e,t)=>ZZ(e,"name",{value:t,configurable:!0});function JZ(e){return`FjallDeployBoundary${e}`}HZ(JZ,"deployBoundaryName");var v_={Sid:"FjallInheritAdministratorAccess",Effect:"Allow",Action:"*",Resource:"*"},x$=[{Sid:"FjallDenyOrgAndAccountEscape",Effect:"Deny",Action:["organizations:LeaveOrganization","account:CloseAccount"],Resource:"*"},{Sid:"FjallDenyDisableAuditLogging",Effect:"Deny",Action:["cloudtrail:StopLogging"],Resource:"*"},{Sid:"FjallDenyBoundarySelfEscape",Effect:"Deny",Action:["iam:DeleteRolePermissionsBoundary"],Resource:"*"},{Sid:"FjallDenyDisableKmsKey",Effect:"Deny",Action:["kms:DisableKey"],Resource:"*"}],_$=[...x$,{Sid:"FjallDenyStandingHumanCredentials",Effect:"Deny",Action:["iam:CreateUser","iam:CreateLoginProfile","iam:CreateAccessKey","iam:CreateAccountAlias"],Resource:"*"},{Sid:"FjallDenyDisableConfigRecorder",Effect:"Deny",Action:["config:StopConfigurationRecorder"],Resource:"*"}],XZ=[..._$,{Sid:"FjallDenyAccountPasswordPolicyTamper",Effect:"Deny",Action:["iam:UpdateAccountPasswordPolicy","iam:DeleteAccountPasswordPolicy"],Resource:"*"},{Sid:"FjallDenyDisableDefaultEbsEncryption",Effect:"Deny",Action:["ec2:DisableEbsEncryptionByDefault"],Resource:"*"}],due={foundation:[v_,...x$],compliance:[v_,..._$],hardened:[v_,...XZ]};var qZ=Object.defineProperty,ut=(e,t)=>qZ(e,"name",{value:t,configurable:!0});var E_="sts.amazonaws.com";function YZ(e){return`FjallDevDeploy${e}`}ut(YZ,"devDeployRoleName");function QZ(e){return`FjallDevProvisioner${e}`}ut(QZ,"devProvisionerRoleName");function eH(e){return`FjallDevSyncWriter${e}`}ut(eH,"devSyncWriterRoleName");var tH="FjallDevBoundary";function T$(e){return`arn:aws:iam::${e}:policy/${tH}`}ut(T$,"devBoundaryPolicyArn");function C$(e){return`org:${e}:dev-provisioner`}ut(C$,"devProvisionerSubject");function D$(e){return`org:${e}:dev-sync`}ut(D$,"devSyncSubject");function b_(e,t){return`org:${e}:acct:${t}`}ut(b_,"deployAccountSubject");function S_(e){return`org:${e}:*`}ut(S_,"genericMachineSubject");var rH=["discovery","connection","org-setup","dev-substrate-setup"];function I$(e,t){return`org:${e}:${t}`}ut(I$,"serviceSubject");function nH(e){let{fjallOrgId:t,providerArn:r,issuerDomain:i,accountTier:n,accountId:a}=e,o=e.machineTrustMode??"expanded",s={[`${i}:aud`]:E_},l;if(o==="account-scoped"){if(n===void 0||!ym(n)||a===void 0)throw new Error(`machineTrustMode "account-scoped" requires a governance accountTier and an accountId (got tier: ${String(n)}, accountId ${a===void 0?"absent":"present"}) \u2014 refusing to fall back to the generic machine subject: a silent fallback would re-widen the trust the \xA74.4a Step-3 contract removes`);l=[b_(t,a)]}else a!==void 0?l=[S_(t),b_(t,a)]:l=S_(t);return[{Sid:"FjallMachineSubject",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...s,[`${i}:sub`]:l}}},{Sid:"FjallUserSubjects",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:s,StringLike:{[`${i}:sub`]:`org:${t}:user:*`}}},{Sid:"FjallServiceSubjects",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...s,[`${i}:sub`]:rH.map(m=>I$(t,m))}}}]}ut(nH,"buildNarrowedDeployTrustStatements");function iH(e){let{fjallOrgId:t,providerArn:r,issuerDomain:i,accountId:n}=e;return[{Sid:"FjallDevSubjectsThisAccount",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${i}:aud`]:E_},StringLike:{[`${i}:sub`]:`org:${t}:dev:${n}:*`}}}]}ut(iH,"buildDevDeployTrustStatements");function A_(e){let{providerArn:t,issuerDomain:r,sid:i,subject:n}=e;return[{Sid:i,Effect:"Allow",Principal:{Federated:t},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${r}:aud`]:E_,[`${r}:sub`]:n}}}]}ut(A_,"buildServiceSubjectTrustStatements");function aH(e){return A_({...e,sid:"FjallDevProvisionerSubject",subject:C$(e.fjallOrgId)})}ut(aH,"buildDevProvisionerTrustStatements");function oH(e){return A_({...e,sid:"FjallDevSyncSubject",subject:D$(e.fjallOrgId)})}ut(oH,"buildDevSyncWriterTrustStatements");function sH({accountId:e}){return[{Sid:"FjallDevEcsTaggedMutations",Effect:"Allow",Action:["ecs:UpdateService","ecs:DeleteService","ecs:RunTask","ecs:StopTask"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTaggedCreates",Effect:"Allow",Action:["ecs:RegisterTaskDefinition","ecs:CreateService"],Resource:"*",Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTagOnCreate",Effect:"Allow",Action:["ecs:TagResource"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"ecs:CreateAction":["RegisterTaskDefinition","CreateService","RunTask"]}}},{Sid:"FjallDevEcsReads",Effect:"Allow",Action:["ecs:Describe*","ecs:List*"],Resource:"*"},{Sid:"FjallDevEcsDeregisterTaskDefinition",Effect:"Allow",Action:["ecs:DeregisterTaskDefinition"],Resource:`arn:aws:ecs:*:${e}:task-definition/fjall-dev-*`},{Sid:"FjallDevElbTaggedMutations",Effect:"Allow",Action:["elasticloadbalancing:ModifyRule","elasticloadbalancing:DeleteRule","elasticloadbalancing:ModifyTargetGroup","elasticloadbalancing:ModifyTargetGroupAttributes","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:RegisterTargets","elasticloadbalancing:DeregisterTargets"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTaggedCreates",Effect:"Allow",Action:["elasticloadbalancing:CreateTargetGroup","elasticloadbalancing:CreateRule"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTagOnCreate",Effect:"Allow",Action:["elasticloadbalancing:AddTags"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"elasticloadbalancing:CreateAction":["CreateTargetGroup","CreateRule"]}}},{Sid:"FjallDevElbReads",Effect:"Allow",Action:["elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevSsmDevTree",Effect:"Allow",Action:["ssm:GetParameter*","ssm:PutParameter","ssm:AddTagsToResource"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevLogsMutations",Effect:"Allow",Action:["logs:PutRetentionPolicy","logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsTaggedCreate",Effect:"Allow",Action:["logs:CreateLogGroup","logs:TagResource"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevLogsRead",Effect:"Allow",Action:["logs:GetLogEvents","logs:DescribeLogStreams","logs:FilterLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsDescribeGroups",Effect:"Allow",Action:["logs:DescribeLogGroups"],Resource:"*"},{Sid:"FjallDevKmsViaDevAlias",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevKmsSsmSecureString",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}},{Sid:"FjallDevEcrAuthToken",Effect:"Allow",Action:["ecr:GetAuthorizationToken"],Resource:"*"},{Sid:"FjallDevEcrPushPull",Effect:"Allow",Action:["ecr:PutImage","ecr:InitiateLayerUpload","ecr:UploadLayerPart","ecr:CompleteLayerUpload","ecr:BatchCheckLayerAvailability","ecr:BatchGetImage","ecr:GetDownloadUrlForLayer","ecr:DescribeImages"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevPassDevPathRoles",Effect:"Allow",Action:["iam:PassRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`}]}ut(sH,"buildDevDeployPolicyStatements");function cH({accountId:e}){return[{Sid:"FjallDevProvisionerBoundedRoleWrites",Effect:"Allow",Action:["iam:CreateRole","iam:PutRolePolicy","iam:AttachRolePolicy"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`,Condition:{StringEquals:{"iam:PermissionsBoundary":T$(e)}}},{Sid:"FjallDevProvisionerPathRoleOps",Effect:"Allow",Action:["iam:DeleteRole","iam:DeleteRolePolicy","iam:DetachRolePolicy","iam:ListRolePolicies","iam:TagRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`},{Sid:"FjallDevProvisionerListRoles",Effect:"Allow",Action:["iam:ListRoles"],Resource:"*"},{Sid:"FjallDevProvisionerDevMasterSecrets",Effect:"Allow",Action:["secretsmanager:GetSecretValue"],Resource:`arn:aws:secretsmanager:*:${e}:secret:fjall-dev-*`},{Sid:"FjallDevProvisionerKmsDecryptViaSecretsManager",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"secretsmanager.*.amazonaws.com"}}},{Sid:"FjallDevProvisionerDataApi",Effect:"Allow",Action:["rds-data:ExecuteStatement","rds-data:BatchExecuteStatement","rds-data:BeginTransaction","rds-data:CommitTransaction","rds-data:RollbackTransaction"],Resource:`arn:aws:rds:*:${e}:cluster:fjall-dev-*`},{Sid:"FjallDevProvisionerMetrics",Effect:"Allow",Action:["cloudwatch:GetMetricData"],Resource:"*"},{Sid:"FjallDevProvisionerOrphanDiscovery",Effect:"Allow",Action:["tag:GetResources"],Resource:"*"},{Sid:"FjallDevProvisionerSsmTeardown",Effect:"Allow",Action:["ssm:DeleteParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevProvisionerLogsTeardown",Effect:"Allow",Action:["logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevProvisionerTaggedTeardown",Effect:"Allow",Action:["ecs:UpdateService","ecs:StopTask","ecs:DeleteService","elasticloadbalancing:DeleteRule","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:DeregisterTargets"],Resource:[`arn:aws:ecs:*:${e}:*`,`arn:aws:elasticloadbalancing:*:${e}:*`],Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevProvisionerTeardownReads",Effect:"Allow",Action:["ecs:Describe*","elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevProvisionerImageJanitor",Effect:"Allow",Action:["ecr:ListImages","ecr:DescribeImages","ecr:BatchDeleteImage"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevProvisionerSsmReadAll",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/*`},{Sid:"FjallDevProvisionerKmsDecryptViaSsm",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}}]}ut(cH,"buildDevProvisionerPolicyStatements");function lH({accountId:e}){return[{Sid:"FjallDevSyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}}]}ut(lH,"buildDevSyncWriterPolicyStatements");function uH({accountId:e}){return[{Sid:"FjallDevBoundarySsmDevRead",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevBoundaryKmsDecryptDevAlias",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevBoundarySyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}},{Sid:"FjallDevBoundarySlotLogs",Effect:"Allow",Action:["logs:CreateLogStream","logs:PutLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevBoundarySyncQueue",Effect:"Allow",Action:["sqs:ReceiveMessage","sqs:DeleteMessage","sqs:GetQueueUrl"],Resource:`arn:aws:sqs:*:${e}:fjall-dev-sync-${e}-*`}]}ut(uH,"buildDevBoundaryStatements");var dH=Object.defineProperty,Yt=(e,t)=>dH(e,"name",{value:t,configurable:!0});function J(e){return JSON.stringify(e)}Yt(J,"escapeStringLiteral");function Gl(e){return e.map(J).join(", ")}Yt(Gl,"formatStringArray");var pH="import:SharedAlarmTopicArn";function ba(e=" "){return`
316
316
  ${e}...(getConfig().environment === "production" ? { alertsTopic: ${J(pH)} } : {}),`}Yt(ba,"emitProductionAlertsTopicSpread");function Un(e){return e===0?"":`_${String(e+1)}`}Yt(Un,"connectionEnvSuffix");function mH(e,t){if(e===t)return 1;if(!e.startsWith(`${t}_`))return;let r=e.slice(t.length+1);return/^\d+$/.test(r)?parseInt(r,10):void 0}Yt(mH,"connectionKeyOrdinal");function x_(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.__identifier=="string"||typeof t.__expression=="string"||typeof t.__call=="string"}Yt(x_,"isSpecialValue");function Sr(e){return e.replace(/[^a-zA-Z0-9]/g," ").split(" ").map((t,r)=>r===0?t.charAt(0).toLowerCase()+t.slice(1):t.charAt(0).toUpperCase()+t.slice(1)).join("")}Yt(Sr,"toVariableName");function we(e){return e.variableName??Sr(e.name)}Yt(we,"getVariableName");function Vl(e,t){for(let r of e.database)if(r.name===t&&r.variableName)return r.variableName;for(let r of e.s3)if(r.name===t&&r.variableName)return r.variableName;for(let r of e.compute)if(r.name===t&&r.variableName)return r.variableName;for(let r of e.dynamodb??[])if(r.name===t&&r.variableName)return r.variableName;for(let r of e.sqs??[])if(r.name===t&&r.variableName)return r.variableName;return Sr(t)}Yt(Vl,"resolveResourceVariable");function k$(e){let t=Object.entries(e);return t.length===0?!0:t.length>1?!1:t.every(([,r])=>typeof r=="string"||typeof r=="number"||typeof r=="boolean"||r===null)}Yt(k$,"isSimpleObject");function Ae(e,t=" "){if(e==null)return"undefined";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);if(x_(e)){if("__identifier"in e)return e.__identifier;if("__expression"in e)return e.__expression;if("__call"in e)return e.__call}if(Array.isArray(e))return`[${e.map(r=>Ae(r,t)).join(", ")}]`;if(typeof e=="object"){let r=Object.entries(e).filter(([,a])=>a!==void 0);if(k$(e)){let a=r.map(([o,s])=>`${o}: ${Ae(s,t)}`).join(", ");return a?`{ ${a} }`:"{}"}let i=t+" ",n=r.map(([a,o])=>`${i}${a}: ${Ae(o,i)}`).join(`,
317
317
  `);return n?`{
318
318
  ${n}
319
319
  ${t}}`:"{}"}return JSON.stringify(e)}Yt(Ae,"formatValue");function ie(e,t,r,i="raw"){if(!e)return"";let n;switch(i){case"string":n=J(String(r));break;case"object":n=Ae(r);break;case"boolean-or-object":n=r===!1?"false":Ae(r);break;default:n=String(r)}return`
320
320
  ${t}: ${n},`}Yt(ie,"buildProperty");function rt(e,t=" "){return e?.length?e.map(r=>`
321
- ${t}${r.key}: ${r.sourceText},`).join(""):""}Yt(rt,"emitExtraProperties");var wt=lc(Ar(),1);var Ge=lc(Ar(),1),b9=Object.defineProperty,xr=(e,t)=>b9(e,"name",{value:t,configurable:!0});function S9(e){return Ge.builders.expressionStatement(S0(e))}xr(S9,"buildFactoryStatement");function E9(e){let t=Ge.builders.callExpression(E0(e.appIdentifier,e.appMethod),[S0(e)]);return Ge.builders.expressionStatement(t)}xr(E9,"buildAppMethodWrappedStatement");function A9(e){let t=Ge.builders.callExpression(E0(e.appIdentifier,e.appMethod),[ql(e.name,e.quoteStyle),Ge.builders.objectExpression(e.properties.map(r=>hs(r.key,r.value,e.quoteStyle)))]);return Ge.builders.expressionStatement(t)}xr(A9,"buildAppMethodStatement");function S0(e){let t=Ge.builders.memberExpression(Ge.builders.identifier(e.factory),Ge.builders.identifier("build"),!1),r=ql(e.name,e.quoteStyle),i=Ge.builders.objectExpression(e.properties.map(n=>hs(n.key,n.value,e.quoteStyle)));return Ge.builders.callExpression(t,[r,i])}xr(S0,"buildFactoryCall");function hs(e,t,r){let i=Hf(e)?Ge.builders.identifier(e):ql(e,r);return Ge.builders.property("init",i,t)}xr(hs,"buildObjectProperty");function x9(e,t,r="double"){let i=e.map(a=>Ge.builders.importSpecifier(Ge.builders.identifier(a))),n=ql(t,r);return Ge.builders.importDeclaration(i,n)}xr(x9,"buildImportDeclaration");function E0(e,t){return Ge.builders.memberExpression(Ge.builders.identifier(e),Ge.builders.identifier(t),!1)}xr(E0,"buildMemberExpression");function _9(e,t){Array.isArray(e.specifiers)||(e.specifiers=[]);for(let r of e.specifiers)if(x1(r)&&r.imported.name===t)return;e.specifiers.push(Ge.builders.importSpecifier(Ge.builders.identifier(t)))}xr(_9,"appendSpecifier");function ql(e,t){let r=t==="single"?"'":'"',i=`${r}${A1(e,t)}${r}`;return Ge.builders.stringLiteral.from({value:e,extra:{rawValue:e,raw:i}})}xr(ql,"makeStringLiteral");function A1(e,t){let r=e.replace(/\\/g,"\\\\");return t==="single"?r.replace(/'/g,"\\'"):r.replace(/"/g,'\\"')}xr(A1,"escapeForQuote");function Hf(e){return/^[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*$/u.test(e)}xr(Hf,"isValidIdentifier");function x1(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="ImportSpecifier"}xr(x1,"isNamedImportSpecifier");var T9=Object.defineProperty,Ea=(e,t)=>T9(e,"name",{value:t,configurable:!0});function C9(e,t){let r=[];for(let i of e){let n=_1(i,t);if(!n.success)return j(n.error);r.push({key:i.key,value:n.data})}return K(r)}Ea(C9,"buildPropertyInputs");var Xf=/^[A-Za-z_$][A-Za-z0-9_$]*$/,_i=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","implements","interface","package","private","protected","public","let","static","eval","arguments"]);function _1(e,t){if(e.kind==="expression")return Xf.test(e.source)?_i.has(e.source)?j({kind:"InvalidPropertyError",property:e.key,reason:`\`${e.key}\` resolved to \`${e.source}\`, which is a JavaScript reserved word \u2014 no binding can carry that name, so splicing it would write a file that does not parse.`}):K(wt.builders.identifier(e.source)):j({kind:"InvalidPropertyError",property:e.key,reason:`\`${e.key}\` resolved to the expression \`${e.source}\`, which is not a bare identifier; this emitter only splices the name of a live binding.`});if(e.kind==="structured")return gs(e.key,e.expression,t);let r=ys(e.value,t);return r===void 0?j({kind:"InvalidPropertyError",property:e.key,reason:`Unsupported property value for "${e.key}" (accepts string/number/boolean/null/array/object of the same).`}):K(r)}Ea(_1,"buildEmittedValue");function Jf(e,t){if(!Xf.test(t))return{kind:"InvalidPropertyError",property:e,reason:`\`${e}\` produced the expression segment \`${t}\`, which is not a bare identifier; structured expressions emit validated identifier segments only.`};if(_i.has(t))return{kind:"InvalidPropertyError",property:e,reason:`\`${e}\` produced the expression segment \`${t}\`, which is a JavaScript reserved word \u2014 emitting it would write a file that does not parse.`}}Ea(Jf,"identifierSegmentRefusal");function A0(e){return{kind:"InvalidPropertyError",property:e,reason:`Unsupported property value for "${e}" (accepts string/number/boolean/null/array/object of the same).`}}Ea(A0,"unsupportedLiteralRefusal");function gs(e,t,r){switch(t.kind){case"primary-binding":return j({kind:"InvalidPropertyError",property:e,reason:`\`${e}\` carries an unsubstituted primary-binding marker \u2014 only a sibling statement's props may reference the primary construct, and the sibling engine substitutes the marker before anything is built.`});case"literal":{let i=ys(t.value,r);return i===void 0?j(A0(e)):K(i)}case"identifier":{let i=Jf(e,t.name);return i!==void 0?j(i):K(wt.builders.identifier(t.name))}case"member":{let i=Jf(e,t.property);if(i!==void 0)return j(i);let n=gs(e,t.object,r);return n.success?K(wt.builders.memberExpression(n.data,wt.builders.identifier(t.property),!1)):n}case"call":{let i=gs(e,t.callee,r);if(!i.success)return i;let n=[];for(let a of t.args){if(a.kind==="identifier"){let s=Jf(e,a.name);if(s!==void 0)return j(s);n.push(wt.builders.identifier(a.name));continue}let o=ys(a.value,r);if(o===void 0)return j(A0(e));n.push(o)}return K(wt.builders.callExpression(i.data,n))}case"object":{let i=[];for(let n of t.entries){let a=gs(e,n.value,r);if(!a.success)return a;i.push(hs(n.key,a.data,r))}return K(wt.builders.objectExpression(i))}case"array":{let i=[];for(let n of t.elements){let a=gs(e,n,r);if(!a.success)return a;i.push(a.data)}return K(wt.builders.arrayExpression(i))}}}Ea(gs,"buildStructuredValue");function ys(e,t){if(typeof e=="string")return T1(e,t);if(typeof e=="number"&&Number.isFinite(e))return wt.builders.numericLiteral(e);if(typeof e=="boolean")return wt.builders.booleanLiteral(e);if(e===null)return wt.builders.nullLiteral();if(Array.isArray(e)){let r=[];for(let i of e){let n=ys(i,t);if(n===void 0)return;r.push(n)}return wt.builders.arrayExpression(r)}if(typeof e=="object"&&e!==null){let r=[];for(let[i,n]of Object.entries(e)){let a=ys(n,t);if(a===void 0)return;r.push(hs(i,a,t))}return wt.builders.objectExpression(r)}}Ea(ys,"toAstValue");function T1(e,t){let r=t==="single"?"'":'"',i=t==="single"?e.replace(/\\/g,"\\\\").replace(/'/g,"\\'"):e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),n=`${r}${i}${r}`;return wt.builders.stringLiteral.from({value:e,extra:{rawValue:e,raw:n}})}Ea(T1,"makeStringLiteral");var D9=Object.defineProperty,Bn=(e,t)=>D9(e,"name",{value:t,configurable:!0});function Ql(e){return Hf(e)?e:JSON.stringify(e)}Bn(Ql,"renderObjectKey");function Yl(e,t){if(!Xf.test(t))throw new Error(`Cannot render "${e}": expression segment \`${t}\` is not a bare identifier \u2014 structured expressions emit validated identifier segments only.`);if(_i.has(t))throw new Error(`Cannot render "${e}": expression segment \`${t}\` is a JavaScript reserved word \u2014 emitting it would write a file that does not parse.`)}Bn(Yl,"assertIdentifierSegment");function C1(e){let t=Object.entries(e);return t.length===0?!0:t.length>1?!1:t.every(([,r])=>typeof r=="string"||typeof r=="number"||typeof r=="boolean"||r===null)}Bn(C1,"isSimpleLiteralObject");function Aa(e,t,r){if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"&&Number.isFinite(t)||typeof t=="boolean")return String(t);if(t===null)return"null";if(Array.isArray(t))return`[${t.map(i=>Aa(e,i,r)).join(", ")}]`;if(typeof t=="object"){let i=Object.entries(t).filter(([,o])=>o!==void 0);if(C1(t)){let o=i.map(([s,l])=>`${Ql(s)}: ${Aa(e,l,r)}`).join(", ");return o?`{ ${o} }`:"{}"}let n=r+" ",a=i.map(([o,s])=>`${n}${Ql(o)}: ${Aa(e,s,n)}`).join(`,
321
+ ${t}${r.key}: ${r.sourceText},`).join(""):""}Yt(rt,"emitExtraProperties");var wt=lc(Ar(),1);var Ge=lc(Ar(),1),b9=Object.defineProperty,xr=(e,t)=>b9(e,"name",{value:t,configurable:!0});function S9(e){return Ge.builders.expressionStatement(S0(e))}xr(S9,"buildFactoryStatement");function E9(e){let t=Ge.builders.callExpression(E0(e.appIdentifier,e.appMethod),[S0(e)]);return Ge.builders.expressionStatement(t)}xr(E9,"buildAppMethodWrappedStatement");function A9(e){let t=Ge.builders.callExpression(E0(e.appIdentifier,e.appMethod),[ql(e.name,e.quoteStyle),Ge.builders.objectExpression(e.properties.map(r=>hs(r.key,r.value,e.quoteStyle)))]);return Ge.builders.expressionStatement(t)}xr(A9,"buildAppMethodStatement");function S0(e){let t=Ge.builders.memberExpression(Ge.builders.identifier(e.factory),Ge.builders.identifier("build"),!1),r=ql(e.name,e.quoteStyle),i=Ge.builders.objectExpression(e.properties.map(n=>hs(n.key,n.value,e.quoteStyle)));return Ge.builders.callExpression(t,[r,i])}xr(S0,"buildFactoryCall");function hs(e,t,r){let i=Hf(e)?Ge.builders.identifier(e):ql(e,r);return Ge.builders.property("init",i,t)}xr(hs,"buildObjectProperty");function x9(e,t,r="double"){let i=e.map(a=>Ge.builders.importSpecifier(Ge.builders.identifier(a))),n=ql(t,r);return Ge.builders.importDeclaration(i,n)}xr(x9,"buildImportDeclaration");function E0(e,t){return Ge.builders.memberExpression(Ge.builders.identifier(e),Ge.builders.identifier(t),!1)}xr(E0,"buildMemberExpression");function _9(e,t){Array.isArray(e.specifiers)||(e.specifiers=[]);for(let r of e.specifiers)if(xj(r)&&r.imported.name===t)return;e.specifiers.push(Ge.builders.importSpecifier(Ge.builders.identifier(t)))}xr(_9,"appendSpecifier");function ql(e,t){let r=t==="single"?"'":'"',i=`${r}${Aj(e,t)}${r}`;return Ge.builders.stringLiteral.from({value:e,extra:{rawValue:e,raw:i}})}xr(ql,"makeStringLiteral");function Aj(e,t){let r=e.replace(/\\/g,"\\\\");return t==="single"?r.replace(/'/g,"\\'"):r.replace(/"/g,'\\"')}xr(Aj,"escapeForQuote");function Hf(e){return/^[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*$/u.test(e)}xr(Hf,"isValidIdentifier");function xj(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="ImportSpecifier"}xr(xj,"isNamedImportSpecifier");var T9=Object.defineProperty,Ea=(e,t)=>T9(e,"name",{value:t,configurable:!0});function C9(e,t){let r=[];for(let i of e){let n=_j(i,t);if(!n.success)return j(n.error);r.push({key:i.key,value:n.data})}return K(r)}Ea(C9,"buildPropertyInputs");var Xf=/^[A-Za-z_$][A-Za-z0-9_$]*$/,_i=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","implements","interface","package","private","protected","public","let","static","eval","arguments"]);function _j(e,t){if(e.kind==="expression")return Xf.test(e.source)?_i.has(e.source)?j({kind:"InvalidPropertyError",property:e.key,reason:`\`${e.key}\` resolved to \`${e.source}\`, which is a JavaScript reserved word \u2014 no binding can carry that name, so splicing it would write a file that does not parse.`}):K(wt.builders.identifier(e.source)):j({kind:"InvalidPropertyError",property:e.key,reason:`\`${e.key}\` resolved to the expression \`${e.source}\`, which is not a bare identifier; this emitter only splices the name of a live binding.`});if(e.kind==="structured")return gs(e.key,e.expression,t);let r=ys(e.value,t);return r===void 0?j({kind:"InvalidPropertyError",property:e.key,reason:`Unsupported property value for "${e.key}" (accepts string/number/boolean/null/array/object of the same).`}):K(r)}Ea(_j,"buildEmittedValue");function Jf(e,t){if(!Xf.test(t))return{kind:"InvalidPropertyError",property:e,reason:`\`${e}\` produced the expression segment \`${t}\`, which is not a bare identifier; structured expressions emit validated identifier segments only.`};if(_i.has(t))return{kind:"InvalidPropertyError",property:e,reason:`\`${e}\` produced the expression segment \`${t}\`, which is a JavaScript reserved word \u2014 emitting it would write a file that does not parse.`}}Ea(Jf,"identifierSegmentRefusal");function A0(e){return{kind:"InvalidPropertyError",property:e,reason:`Unsupported property value for "${e}" (accepts string/number/boolean/null/array/object of the same).`}}Ea(A0,"unsupportedLiteralRefusal");function gs(e,t,r){switch(t.kind){case"primary-binding":return j({kind:"InvalidPropertyError",property:e,reason:`\`${e}\` carries an unsubstituted primary-binding marker \u2014 only a sibling statement's props may reference the primary construct, and the sibling engine substitutes the marker before anything is built.`});case"literal":{let i=ys(t.value,r);return i===void 0?j(A0(e)):K(i)}case"identifier":{let i=Jf(e,t.name);return i!==void 0?j(i):K(wt.builders.identifier(t.name))}case"member":{let i=Jf(e,t.property);if(i!==void 0)return j(i);let n=gs(e,t.object,r);return n.success?K(wt.builders.memberExpression(n.data,wt.builders.identifier(t.property),!1)):n}case"call":{let i=gs(e,t.callee,r);if(!i.success)return i;let n=[];for(let a of t.args){if(a.kind==="identifier"){let s=Jf(e,a.name);if(s!==void 0)return j(s);n.push(wt.builders.identifier(a.name));continue}let o=ys(a.value,r);if(o===void 0)return j(A0(e));n.push(o)}return K(wt.builders.callExpression(i.data,n))}case"object":{let i=[];for(let n of t.entries){let a=gs(e,n.value,r);if(!a.success)return a;i.push(hs(n.key,a.data,r))}return K(wt.builders.objectExpression(i))}case"array":{let i=[];for(let n of t.elements){let a=gs(e,n,r);if(!a.success)return a;i.push(a.data)}return K(wt.builders.arrayExpression(i))}}}Ea(gs,"buildStructuredValue");function ys(e,t){if(typeof e=="string")return Tj(e,t);if(typeof e=="number"&&Number.isFinite(e))return wt.builders.numericLiteral(e);if(typeof e=="boolean")return wt.builders.booleanLiteral(e);if(e===null)return wt.builders.nullLiteral();if(Array.isArray(e)){let r=[];for(let i of e){let n=ys(i,t);if(n===void 0)return;r.push(n)}return wt.builders.arrayExpression(r)}if(typeof e=="object"&&e!==null){let r=[];for(let[i,n]of Object.entries(e)){let a=ys(n,t);if(a===void 0)return;r.push(hs(i,a,t))}return wt.builders.objectExpression(r)}}Ea(ys,"toAstValue");function Tj(e,t){let r=t==="single"?"'":'"',i=t==="single"?e.replace(/\\/g,"\\\\").replace(/'/g,"\\'"):e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),n=`${r}${i}${r}`;return wt.builders.stringLiteral.from({value:e,extra:{rawValue:e,raw:n}})}Ea(Tj,"makeStringLiteral");var D9=Object.defineProperty,Bn=(e,t)=>D9(e,"name",{value:t,configurable:!0});function Ql(e){return Hf(e)?e:JSON.stringify(e)}Bn(Ql,"renderObjectKey");function Yl(e,t){if(!Xf.test(t))throw new Error(`Cannot render "${e}": expression segment \`${t}\` is not a bare identifier \u2014 structured expressions emit validated identifier segments only.`);if(_i.has(t))throw new Error(`Cannot render "${e}": expression segment \`${t}\` is a JavaScript reserved word \u2014 emitting it would write a file that does not parse.`)}Bn(Yl,"assertIdentifierSegment");function Cj(e){let t=Object.entries(e);return t.length===0?!0:t.length>1?!1:t.every(([,r])=>typeof r=="string"||typeof r=="number"||typeof r=="boolean"||r===null)}Bn(Cj,"isSimpleLiteralObject");function Aa(e,t,r){if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"&&Number.isFinite(t)||typeof t=="boolean")return String(t);if(t===null)return"null";if(Array.isArray(t))return`[${t.map(i=>Aa(e,i,r)).join(", ")}]`;if(typeof t=="object"){let i=Object.entries(t).filter(([,o])=>o!==void 0);if(Cj(t)){let o=i.map(([s,l])=>`${Ql(s)}: ${Aa(e,l,r)}`).join(", ");return o?`{ ${o} }`:"{}"}let n=r+" ",a=i.map(([o,s])=>`${n}${Ql(o)}: ${Aa(e,s,n)}`).join(`,
322
322
  `);return a?`{
323
323
  ${a}
324
- ${r}}`:"{}"}throw new Error(`Cannot render "${e}": unsupported literal value (accepts string/number/boolean/null/array/object of the same).`)}Bn(Aa,"renderLiteralSource");function D1(e,t,r){return t.kind==="identifier"?(Yl(e,t.name),t.name):Aa(e,t.value,r.indent??" ")}Bn(D1,"renderCallArgument");function zn(e,t,r={}){let i=r.indent??" ";switch(t.kind){case"primary-binding":{if(r.primaryBinding===void 0)throw new Error(`Cannot render "${e}": unsubstituted primary-binding marker \u2014 only a sibling statement's props may reference the primary construct, and the caller must supply the binding identifier.`);return Yl(e,r.primaryBinding),r.primaryBinding}case"literal":return Aa(e,t.value,i);case"identifier":return Yl(e,t.name),t.name;case"member":return Yl(e,t.property),`${zn(e,t.object,r)}.${t.property}`;case"call":{let n=zn(e,t.callee,r),a=t.args.map(o=>D1(e,o,r)).join(", ");return`${n}(${a})`}case"object":{if(t.entries.length===0)return"{}";let n=i+" ",a=t.entries.map(s=>({key:s.key,source:zn(e,s.value,{...r,indent:n})})),[o]=a;return a.length===1&&o!==void 0&&!o.source.includes(`
324
+ ${r}}`:"{}"}throw new Error(`Cannot render "${e}": unsupported literal value (accepts string/number/boolean/null/array/object of the same).`)}Bn(Aa,"renderLiteralSource");function Dj(e,t,r){return t.kind==="identifier"?(Yl(e,t.name),t.name):Aa(e,t.value,r.indent??" ")}Bn(Dj,"renderCallArgument");function zn(e,t,r={}){let i=r.indent??" ";switch(t.kind){case"primary-binding":{if(r.primaryBinding===void 0)throw new Error(`Cannot render "${e}": unsubstituted primary-binding marker \u2014 only a sibling statement's props may reference the primary construct, and the caller must supply the binding identifier.`);return Yl(e,r.primaryBinding),r.primaryBinding}case"literal":return Aa(e,t.value,i);case"identifier":return Yl(e,t.name),t.name;case"member":return Yl(e,t.property),`${zn(e,t.object,r)}.${t.property}`;case"call":{let n=zn(e,t.callee,r),a=t.args.map(o=>Dj(e,o,r)).join(", ");return`${n}(${a})`}case"object":{if(t.entries.length===0)return"{}";let n=i+" ",a=t.entries.map(s=>({key:s.key,source:zn(e,s.value,{...r,indent:n})})),[o]=a;return a.length===1&&o!==void 0&&!o.source.includes(`
325
325
  `)?`{ ${Ql(o.key)}: ${o.source} }`:`{
326
326
  ${a.map(s=>`${n}${Ql(s.key)}: ${s.source}`).join(`,
327
327
  `)}
328
328
  ${i}}`}case"array":return`[${t.elements.map(n=>zn(e,n,r)).join(", ")}]`}}Bn(zn,"renderStructuredValueSource");function Gn(e,t={}){switch(e.value.kind){case"expression":return e.value.source;case"structured":return zn(e.key,e.value.expression,t);case"literal":return Aa(e.key,e.value.value,t.indent??" ")}}Bn(Gn,"renderProjectedValueSource");function qf(e,t=" "){return e.map(r=>`
329
- ${t}${r.key}: ${Gn(r,{indent:t})}`).join(",")}Bn(qf,"emitProjectedProps");function Yf(e){let t=new Set;for(let r of e)if(!(r.value.kind!=="structured"||r.value.imports===void 0))for(let i of r.value.imports)t.add(i);return[...t]}Bn(Yf,"collectProjectedPropImports");var I9=Object.defineProperty,eu=(e,t)=>I9(e,"name",{value:t,configurable:!0}),Pt=Object.freeze({HOST:"DATABASE_HOST",PORT:"DATABASE_PORT",NAME:"DATABASE_NAME",SSL:"DATABASE_SSL",USERNAME:"DATABASE_USERNAME",PASSWORD:"DATABASE_PASSWORD"}),Qf=Object.freeze({USERNAME:"username",PASSWORD:"password"}),bs="true",sn=Object.freeze({HOST:"getHostEndpoint",PORT:"getHostPort",NAME:"getDatabaseName",CREDENTIALS:"getCredentials",IMPORT:"getImport"}),tu=Object.freeze({NAME:"BUCKET_NAME"}),x0=Object.freeze({BUCKET_NAME:"getBucketName"}),_a=Object.freeze({URL:"QUEUE_URL",ARN:"QUEUE_ARN"}),eh=Object.freeze({URL:"getQueueUrl",ARN:"getQueueArn"}),ru=["database","storage","messaging"],xa=eu((e,t)=>({key:e,target:"environment",value:t}),"environmentEntry"),I1=eu((e,t)=>({key:e,target:"secretsImport",value:{kind:"credential",credentialKey:t}}),"secretEntry"),vs=eu(e=>({kind:"accessor",method:e}),"accessor");function cn(e,t){switch(e){case"database":return[xa(`${Pt.HOST}${t}`,vs(sn.HOST)),xa(`${Pt.PORT}${t}`,vs(sn.PORT)),xa(`${Pt.NAME}${t}`,vs(sn.NAME)),xa(`${Pt.SSL}${t}`,{kind:"literal",value:bs}),I1(`${Pt.USERNAME}${t}`,Qf.USERNAME),I1(`${Pt.PASSWORD}${t}`,Qf.PASSWORD)];case"storage":return[xa(`${tu.NAME}${t}`,vs(x0.BUCKET_NAME))];case"messaging":return[xa(`${_a.URL}${t}`,vs(eh.URL)),xa(`${_a.ARN}${t}`,vs(eh.ARN))]}}eu(cn,"buildConnectionWiringEntries");function Ti(e,t){switch(e.kind){case"accessor":return`${t}.${e.method}()`;case"credential":return`${t}.${sn.CREDENTIALS}().${sn.IMPORT}(${J(e.credentialKey)})`;case"literal":return J(e.value)}}eu(Ti,"renderWiringValueSource");var N9=Object.defineProperty,k1=(e,t)=>N9(e,"name",{value:t,configurable:!0});function th(e){return t=>t[e]===void 0}k1(th,"whenAbsent");function w9(e,t){if(e!==void 0){for(let r of e)if(r.refuseWhen(t))return{kind:"InvalidPropertyError",property:r.property,reason:r.reason}}}k1(w9,"evaluateEmitGuard");var P9=Object.defineProperty,Bt=(e,t)=>P9(e,"name",{value:t,configurable:!0}),zt={database:"DatabaseFactory",storage:"StorageFactory",compute:"ComputeFactory",messaging:"MessagingFactory",cdn:"CdnFactory",network:"NetworkFactory",pattern:"PatternFactory","vpc-peer":"VpcPeerFactory","vpc-peer-accepter":"VpcPeerAccepterFactory","cross-plan-connection":"CrossPlanConnectionFactory",organisation:"OrganisationFactory",buildkite:"BuildkiteFactory"};function Vr(e){let{name:t,...r}=e.shape;return c.object(r).partial().strict()}Bt(Vr,"fragmentOf");function ln(e){let{name:t,...r}=e.shape;return c.object(r).strict()}Bt(ln,"completeFragmentOf");var R9=Vr($l),O9=Vr(jl),$9=(()=>{let{name:e,...t}=Ul.shape;return c.object(t).partial().strict()})(),j9=(()=>{let{name:e,...t}=Ul.shape;return c.object(t).strict()})(),M9=Vr(Ml),L9=Vr(Ll),F9=Vr(va),N1=(()=>{let{name:e,type:t,cdn:r,...i}=p_.shape,{name:n,type:a,cdn:o,...s}=m_.shape,{name:l,type:m,domain:d,cdn:h,...g}=zl.shape;return{...i,...s,...g,cdn:c.union([r,h]),type:c.enum(Dm)}})(),U9=c.object(N1).partial().strict(),z9=c.object(N1).partial().required({type:!0}).strict(),B9={emitConstructId:Bt((e,t)=>el(t.type)?ea(e,t.type):e,"emitConstructId"),locateCandidates:Bt(e=>[e,...gr.map(t=>ea(e,t))],"locateCandidates")},G9=Vr(qO),V9=Vr(t_),W9=Vr(h_),K9=Vr(y_),Z9=Vr(Mf);function rh(e,t){return j({kind:"SemanticQueryError",reason:`StatementTypeEntry.${e} for ${t} is not wired; existing types dispatch through the shared locator/generator.`})}Bt(rh,"notWiredError");function w1(e){return{factoryIdentifier:e,findByShape:Bt(()=>rh("locator.findByShape",e),"findByShape"),validateContext:Bt(()=>rh("locator.validateContext",e),"validateContext")}}Bt(w1,"createLocator");function P1(e){return{build:Bt(()=>{let t=rh("generator.build",e);throw new Error(t.success?"unreachable":t.error.reason)},"build")}}Bt(P1,"createGenerator");var H9=[{property:"peerAppName",refuseWhen:th("peerAppName"),reason:"`peerAppName` is required: it is the SSM prefix every remote lookup is built from, and omitting it does NOT fail \u2014 synth succeeds and the app deploys a peering connection pointed at `/fjall/default/undefined/vpc-id`. Pass `--peerAppName <remote app>`."},{property:"peerAccountId",refuseWhen:th("peerAccountId"),reason:"`peerAccountId` is required: omitting it does NOT fail, it deploys a VPC peering connection with no `PeerOwnerId`. Pass `--peerAccountId <12-digit account>`."}];function Qt(e,t,r={}){return{factoryIdentifier:e,locator:w1(e),generator:P1(e),schemaFragment:t,...r}}Bt(Qt,"createEntry");var Vn={database:Qt(zt.database,R9,{emitWrapper:{appMethod:"addDatabase"},addContract:ln($l)}),storage:Qt(zt.storage,O9,{emitWrapper:{appMethod:"addStorage"},addContract:ln(jl)}),compute:Qt(zt.compute,$9,{emitWrapper:{appMethod:"addCompute"},addContract:j9}),messaging:Qt(zt.messaging,M9,{emitWrapper:{appMethod:"addMessaging"},addContract:ln(Ml)}),cdn:Qt(zt.cdn,L9,{emitWrapper:{appMethod:"addCdn"},addContract:ln(Ll)}),network:Qt(zt.network,F9,{emitWrapper:{appMethod:"addNetwork"},addContract:ln(va)}),pattern:Qt(zt.pattern,U9,{emitWrapper:{appMethod:"addPattern"},addContract:z9,statementIdentity:B9}),"vpc-peer":Qt(zt["vpc-peer"],G9,{emitWrapper:{appMethod:"addVpcPeer"},emitGuard:H9}),"vpc-peer-accepter":Qt(zt["vpc-peer-accepter"],V9,{emitWrapper:{appMethod:"addVpcPeerAccepter"},addContract:ln(t_)}),"cross-plan-connection":Qt(zt["cross-plan-connection"],W9,{addContract:ln(h_)}),organisation:Qt(zt.organisation,K9,{addContract:ln(y_)}),buildkite:Qt(zt.buildkite,Z9,{emitWrapper:{appMethod:"addBuildkite",propsOverloadConstructId:"Buildkite"},addContract:ln(Mf)})},Vue=Object.keys(Vn);function J9(e,t,r){return Vn[e].statementIdentity?.emitConstructId(t,r)??t}Bt(J9,"constructIdFor");function X9(e,t){return Vn[e].statementIdentity?.locateCandidates(t)??[t]}Bt(X9,"locateNamesFor");function q9(e){let t=Object.keys(Vn);for(let r of t)if(Vn[r].factoryIdentifier===e)return r}Bt(q9,"findTypeByIdentifier");var Y9=Object.defineProperty,Q9=(e,t)=>Y9(e,"name",{value:t,configurable:!0});function Ci(e){let t=Vn[e],r=t.emitWrapper?.appMethod;if(r===void 0)throw new Error(`Statement type "${e}" declares no emitWrapper.appMethod \u2014 the scaffold emits wrapped statements only.`);return{factory:t.factoryIdentifier,appMethod:r}}Q9(Ci,"invocationOf");var _r=Ci("database"),Ta=Ci("storage"),nu=Ci("compute"),iu=Ci("messaging"),Ss=Ci("cdn"),nh=Ci("network"),au=Ci("pattern");var e8=Object.defineProperty,er=(e,t)=>e8(e,"name",{value:t,configurable:!0});function Ca(e,t){let r=t.connectedDatabase;return r?.length?e.database.filter(i=>r.includes(i.name)):[]}er(Ca,"getConnectedDatabases");function ou(e){let t=[];for(let[r,i]of e.entries()){let n=we(i),a=Un(r);for(let o of cn("database",a))t.push({key:o.key,expression:Ti(o.value,n),isSecret:o.target==="secretsImport"})}return t}er(ou,"generateDatabaseEnvVarEntries");function R1(e){return`connections: [${e.map(t=>we(t)).join(", ")}],`}er(R1,"formatConnectionsCode");function ih(e){return e.expression===J(bs)?bs:{__expression:e.expression}}er(ih,"toDatabaseEnvVarValue");function ah(e,t){let r={},i={};if(!t.needsConnection||!t.connectedDatabase?.length)return{env:r,secrets:i};let n=Ca(e,t),a=ou(n);for(let o of a){let s=ih(o);o.isSecret?i[o.key]={__expression:o.expression}:r[o.key]=s}return{env:r,secrets:i}}er(ah,"buildDatabaseEnvVars");function O1(e){let t="";return t+=ie(e.port!==void 0,"port",e.port),t+=ie(e.deletionProtection!==void 0,"deletionProtection",e.deletionProtection),t+=ie(e.snapshotIdentifier!==void 0,"snapshotIdentifier",e.snapshotIdentifier,"string"),t+=ie(e.snapshotUsername!==void 0,"snapshotUsername",e.snapshotUsername,"string"),t+=ie(e.monitoringInterval!==void 0,"monitoringInterval",e.monitoringInterval),t}er(O1,"generateDatabaseSharedProps");function $1(e){if(e.type!=="Instance")return"";let t="";return t+=ie(e.instanceType!==void 0,"instanceType",e.instanceType,"string"),t+=ie(e.allocatedStorage!==void 0,"allocatedStorage",e.allocatedStorage),t+=ie(e.multiAz!==void 0,"multiAz",e.multiAz),t+=ie(e.publiclyAccessible!==void 0,"publiclyAccessible",e.publiclyAccessible),t+=ie(e.encryption!==void 0,"encryption",e.encryption,"object"),t+=ie(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),t+=ie(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),t+=ie(e.readReplica!==void 0,"readReplica",e.readReplica,"boolean-or-object"),t+=ie(e.credentials!==void 0,"credentials",e.credentials,"object"),t+=ie(e.backupRetention!==void 0,"backupRetention",e.backupRetention),t}er($1,"generateDatabaseInstanceProps");function j1(e){if(e.type!=="Aurora"&&e.type!=="GlobalAurora")return"";let t="";return t+=ie(e.encryption!==void 0,"encryption",e.encryption,"object"),t+=ie(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),t+=ie(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),t+=ie(e.credentials!==void 0,"credentials",e.credentials,"object"),t+=ie(e.writer!==void 0,"writer",e.writer,"object"),t+=ie(e.readers!==void 0,"readers",e.readers,"boolean-or-object"),t+=ie(e.backupRetention!==void 0,"backupRetention",e.backupRetention),t+=ie(e.preferredMaintenanceWindow!==void 0,"preferredMaintenanceWindow",e.preferredMaintenanceWindow,"string"),t}er(j1,"generateDatabaseAuroraProps");function M1(e){if(e.type!=="GlobalAurora")return"";let t="";return t+=ie(e.primaryRegion!==void 0,"primaryRegion",e.primaryRegion,"string"),e.secondaryRegions!==void 0&&e.secondaryRegions.length>0&&(t+=`
330
- secondaryRegions: [${Gl(e.secondaryRegions)}],`),t+=ie(e.globalClusterIdentifier!==void 0,"globalClusterIdentifier",e.globalClusterIdentifier,"string"),t+=ie(e.enableGlobalWriteForwarding!==void 0,"enableGlobalWriteForwarding",e.enableGlobalWriteForwarding),t}er(M1,"generateDatabaseGlobalAuroraProps");function su(e,t){return t.compute.some(r=>r.needsConnection&&r.connectedDatabase?.includes(e.name))}er(su,"databaseNeedsVariable");function oh(e){if(e.database.length===0)return"";let t="";for(let r=0;r<e.database.length;r++){let i=e.database[r],n=we(i),a=su(i,e),o=r>0,s=a?`const ${n} = `:"";t+=`${o?`
329
+ ${t}${r.key}: ${Gn(r,{indent:t})}`).join(",")}Bn(qf,"emitProjectedProps");function Yf(e){let t=new Set;for(let r of e)if(!(r.value.kind!=="structured"||r.value.imports===void 0))for(let i of r.value.imports)t.add(i);return[...t]}Bn(Yf,"collectProjectedPropImports");var I9=Object.defineProperty,eu=(e,t)=>I9(e,"name",{value:t,configurable:!0}),Pt=Object.freeze({HOST:"DATABASE_HOST",PORT:"DATABASE_PORT",NAME:"DATABASE_NAME",SSL:"DATABASE_SSL",USERNAME:"DATABASE_USERNAME",PASSWORD:"DATABASE_PASSWORD"}),Qf=Object.freeze({USERNAME:"username",PASSWORD:"password"}),bs="true",sn=Object.freeze({HOST:"getHostEndpoint",PORT:"getHostPort",NAME:"getDatabaseName",CREDENTIALS:"getCredentials",IMPORT:"getImport"}),tu=Object.freeze({NAME:"BUCKET_NAME"}),x0=Object.freeze({BUCKET_NAME:"getBucketName"}),_a=Object.freeze({URL:"QUEUE_URL",ARN:"QUEUE_ARN"}),eh=Object.freeze({URL:"getQueueUrl",ARN:"getQueueArn"}),ru=["database","storage","messaging"],xa=eu((e,t)=>({key:e,target:"environment",value:t}),"environmentEntry"),Ij=eu((e,t)=>({key:e,target:"secretsImport",value:{kind:"credential",credentialKey:t}}),"secretEntry"),vs=eu(e=>({kind:"accessor",method:e}),"accessor");function cn(e,t){switch(e){case"database":return[xa(`${Pt.HOST}${t}`,vs(sn.HOST)),xa(`${Pt.PORT}${t}`,vs(sn.PORT)),xa(`${Pt.NAME}${t}`,vs(sn.NAME)),xa(`${Pt.SSL}${t}`,{kind:"literal",value:bs}),Ij(`${Pt.USERNAME}${t}`,Qf.USERNAME),Ij(`${Pt.PASSWORD}${t}`,Qf.PASSWORD)];case"storage":return[xa(`${tu.NAME}${t}`,vs(x0.BUCKET_NAME))];case"messaging":return[xa(`${_a.URL}${t}`,vs(eh.URL)),xa(`${_a.ARN}${t}`,vs(eh.ARN))]}}eu(cn,"buildConnectionWiringEntries");function Ti(e,t){switch(e.kind){case"accessor":return`${t}.${e.method}()`;case"credential":return`${t}.${sn.CREDENTIALS}().${sn.IMPORT}(${J(e.credentialKey)})`;case"literal":return J(e.value)}}eu(Ti,"renderWiringValueSource");var N9=Object.defineProperty,kj=(e,t)=>N9(e,"name",{value:t,configurable:!0});function th(e){return t=>t[e]===void 0}kj(th,"whenAbsent");function w9(e,t){if(e!==void 0){for(let r of e)if(r.refuseWhen(t))return{kind:"InvalidPropertyError",property:r.property,reason:r.reason}}}kj(w9,"evaluateEmitGuard");var P9=Object.defineProperty,Bt=(e,t)=>P9(e,"name",{value:t,configurable:!0}),zt={database:"DatabaseFactory",storage:"StorageFactory",compute:"ComputeFactory",messaging:"MessagingFactory",cdn:"CdnFactory",network:"NetworkFactory",pattern:"PatternFactory","vpc-peer":"VpcPeerFactory","vpc-peer-accepter":"VpcPeerAccepterFactory","cross-plan-connection":"CrossPlanConnectionFactory",organisation:"OrganisationFactory",buildkite:"BuildkiteFactory"};function Vr(e){let{name:t,...r}=e.shape;return c.object(r).partial().strict()}Bt(Vr,"fragmentOf");function ln(e){let{name:t,...r}=e.shape;return c.object(r).strict()}Bt(ln,"completeFragmentOf");var R9=Vr($l),O9=Vr(jl),$9=(()=>{let{name:e,...t}=Ul.shape;return c.object(t).partial().strict()})(),j9=(()=>{let{name:e,...t}=Ul.shape;return c.object(t).strict()})(),M9=Vr(Ml),L9=Vr(Ll),F9=Vr(va),Nj=(()=>{let{name:e,type:t,cdn:r,...i}=p_.shape,{name:n,type:a,cdn:o,...s}=m_.shape,{name:l,type:m,domain:d,cdn:h,...g}=zl.shape;return{...i,...s,...g,cdn:c.union([r,h]),type:c.enum(Dm)}})(),U9=c.object(Nj).partial().strict(),z9=c.object(Nj).partial().required({type:!0}).strict(),B9={emitConstructId:Bt((e,t)=>el(t.type)?ea(e,t.type):e,"emitConstructId"),locateCandidates:Bt(e=>[e,...gr.map(t=>ea(e,t))],"locateCandidates")},G9=Vr(qO),V9=Vr(t_),W9=Vr(h_),K9=Vr(y_),Z9=Vr(Mf);function rh(e,t){return j({kind:"SemanticQueryError",reason:`StatementTypeEntry.${e} for ${t} is not wired; existing types dispatch through the shared locator/generator.`})}Bt(rh,"notWiredError");function wj(e){return{factoryIdentifier:e,findByShape:Bt(()=>rh("locator.findByShape",e),"findByShape"),validateContext:Bt(()=>rh("locator.validateContext",e),"validateContext")}}Bt(wj,"createLocator");function Pj(e){return{build:Bt(()=>{let t=rh("generator.build",e);throw new Error(t.success?"unreachable":t.error.reason)},"build")}}Bt(Pj,"createGenerator");var H9=[{property:"peerAppName",refuseWhen:th("peerAppName"),reason:"`peerAppName` is required: it is the SSM prefix every remote lookup is built from, and omitting it does NOT fail \u2014 synth succeeds and the app deploys a peering connection pointed at `/fjall/default/undefined/vpc-id`. Pass `--peerAppName <remote app>`."},{property:"peerAccountId",refuseWhen:th("peerAccountId"),reason:"`peerAccountId` is required: omitting it does NOT fail, it deploys a VPC peering connection with no `PeerOwnerId`. Pass `--peerAccountId <12-digit account>`."}];function Qt(e,t,r={}){return{factoryIdentifier:e,locator:wj(e),generator:Pj(e),schemaFragment:t,...r}}Bt(Qt,"createEntry");var Vn={database:Qt(zt.database,R9,{emitWrapper:{appMethod:"addDatabase"},addContract:ln($l)}),storage:Qt(zt.storage,O9,{emitWrapper:{appMethod:"addStorage"},addContract:ln(jl)}),compute:Qt(zt.compute,$9,{emitWrapper:{appMethod:"addCompute"},addContract:j9}),messaging:Qt(zt.messaging,M9,{emitWrapper:{appMethod:"addMessaging"},addContract:ln(Ml)}),cdn:Qt(zt.cdn,L9,{emitWrapper:{appMethod:"addCdn"},addContract:ln(Ll)}),network:Qt(zt.network,F9,{emitWrapper:{appMethod:"addNetwork"},addContract:ln(va)}),pattern:Qt(zt.pattern,U9,{emitWrapper:{appMethod:"addPattern"},addContract:z9,statementIdentity:B9}),"vpc-peer":Qt(zt["vpc-peer"],G9,{emitWrapper:{appMethod:"addVpcPeer"},emitGuard:H9}),"vpc-peer-accepter":Qt(zt["vpc-peer-accepter"],V9,{emitWrapper:{appMethod:"addVpcPeerAccepter"},addContract:ln(t_)}),"cross-plan-connection":Qt(zt["cross-plan-connection"],W9,{addContract:ln(h_)}),organisation:Qt(zt.organisation,K9,{addContract:ln(y_)}),buildkite:Qt(zt.buildkite,Z9,{emitWrapper:{appMethod:"addBuildkite",propsOverloadConstructId:"Buildkite"},addContract:ln(Mf)})},Wue=Object.keys(Vn);function J9(e,t,r){return Vn[e].statementIdentity?.emitConstructId(t,r)??t}Bt(J9,"constructIdFor");function X9(e,t){return Vn[e].statementIdentity?.locateCandidates(t)??[t]}Bt(X9,"locateNamesFor");function q9(e){let t=Object.keys(Vn);for(let r of t)if(Vn[r].factoryIdentifier===e)return r}Bt(q9,"findTypeByIdentifier");var Y9=Object.defineProperty,Q9=(e,t)=>Y9(e,"name",{value:t,configurable:!0});function Ci(e){let t=Vn[e],r=t.emitWrapper?.appMethod;if(r===void 0)throw new Error(`Statement type "${e}" declares no emitWrapper.appMethod \u2014 the scaffold emits wrapped statements only.`);return{factory:t.factoryIdentifier,appMethod:r}}Q9(Ci,"invocationOf");var _r=Ci("database"),Ta=Ci("storage"),nu=Ci("compute"),iu=Ci("messaging"),Ss=Ci("cdn"),nh=Ci("network"),au=Ci("pattern");var e8=Object.defineProperty,er=(e,t)=>e8(e,"name",{value:t,configurable:!0});function Ca(e,t){let r=t.connectedDatabase;return r?.length?e.database.filter(i=>r.includes(i.name)):[]}er(Ca,"getConnectedDatabases");function ou(e){let t=[];for(let[r,i]of e.entries()){let n=we(i),a=Un(r);for(let o of cn("database",a))t.push({key:o.key,expression:Ti(o.value,n),isSecret:o.target==="secretsImport"})}return t}er(ou,"generateDatabaseEnvVarEntries");function Rj(e){return`connections: [${e.map(t=>we(t)).join(", ")}],`}er(Rj,"formatConnectionsCode");function ih(e){return e.expression===J(bs)?bs:{__expression:e.expression}}er(ih,"toDatabaseEnvVarValue");function ah(e,t){let r={},i={};if(!t.needsConnection||!t.connectedDatabase?.length)return{env:r,secrets:i};let n=Ca(e,t),a=ou(n);for(let o of a){let s=ih(o);o.isSecret?i[o.key]={__expression:o.expression}:r[o.key]=s}return{env:r,secrets:i}}er(ah,"buildDatabaseEnvVars");function Oj(e){let t="";return t+=ie(e.port!==void 0,"port",e.port),t+=ie(e.deletionProtection!==void 0,"deletionProtection",e.deletionProtection),t+=ie(e.snapshotIdentifier!==void 0,"snapshotIdentifier",e.snapshotIdentifier,"string"),t+=ie(e.snapshotUsername!==void 0,"snapshotUsername",e.snapshotUsername,"string"),t+=ie(e.monitoringInterval!==void 0,"monitoringInterval",e.monitoringInterval),t}er(Oj,"generateDatabaseSharedProps");function $j(e){if(e.type!=="Instance")return"";let t="";return t+=ie(e.instanceType!==void 0,"instanceType",e.instanceType,"string"),t+=ie(e.allocatedStorage!==void 0,"allocatedStorage",e.allocatedStorage),t+=ie(e.multiAz!==void 0,"multiAz",e.multiAz),t+=ie(e.publiclyAccessible!==void 0,"publiclyAccessible",e.publiclyAccessible),t+=ie(e.encryption!==void 0,"encryption",e.encryption,"object"),t+=ie(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),t+=ie(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),t+=ie(e.readReplica!==void 0,"readReplica",e.readReplica,"boolean-or-object"),t+=ie(e.credentials!==void 0,"credentials",e.credentials,"object"),t+=ie(e.backupRetention!==void 0,"backupRetention",e.backupRetention),t}er($j,"generateDatabaseInstanceProps");function jj(e){if(e.type!=="Aurora"&&e.type!=="GlobalAurora")return"";let t="";return t+=ie(e.encryption!==void 0,"encryption",e.encryption,"object"),t+=ie(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),t+=ie(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),t+=ie(e.credentials!==void 0,"credentials",e.credentials,"object"),t+=ie(e.writer!==void 0,"writer",e.writer,"object"),t+=ie(e.readers!==void 0,"readers",e.readers,"boolean-or-object"),t+=ie(e.backupRetention!==void 0,"backupRetention",e.backupRetention),t+=ie(e.preferredMaintenanceWindow!==void 0,"preferredMaintenanceWindow",e.preferredMaintenanceWindow,"string"),t}er(jj,"generateDatabaseAuroraProps");function Mj(e){if(e.type!=="GlobalAurora")return"";let t="";return t+=ie(e.primaryRegion!==void 0,"primaryRegion",e.primaryRegion,"string"),e.secondaryRegions!==void 0&&e.secondaryRegions.length>0&&(t+=`
330
+ secondaryRegions: [${Gl(e.secondaryRegions)}],`),t+=ie(e.globalClusterIdentifier!==void 0,"globalClusterIdentifier",e.globalClusterIdentifier,"string"),t+=ie(e.enableGlobalWriteForwarding!==void 0,"enableGlobalWriteForwarding",e.enableGlobalWriteForwarding),t}er(Mj,"generateDatabaseGlobalAuroraProps");function su(e,t){return t.compute.some(r=>r.needsConnection&&r.connectedDatabase?.includes(e.name))}er(su,"databaseNeedsVariable");function oh(e){if(e.database.length===0)return"";let t="";for(let r=0;r<e.database.length;r++){let i=e.database[r],n=we(i),a=su(i,e),o=r>0,s=a?`const ${n} = `:"";t+=`${o?`
331
331
  `:""}${s}app.${_r.appMethod}(
332
332
  ${_r.factory}.build(${J(i.name)}, {
333
333
  vpc: app.getVpc(),
334
334
  type: ${J(i.type)},
335
335
  databaseName: ${J(i.databaseName)},`,i.engineExpression?t+=`
336
336
  engine: ${i.engineExpression},`:i.databaseEngine&&(t+=`
337
- databaseEngine: ${J(i.databaseEngine)},`),t+=O1(i),t+=$1(i),t+=j1(i),t+=M1(i),t+=rt(i.extraProperties),i.alarms===!1?t+=`
337
+ databaseEngine: ${J(i.databaseEngine)},`),t+=Oj(i),t+=$j(i),t+=jj(i),t+=Mj(i),t+=rt(i.extraProperties),i.alarms===!1?t+=`
338
338
  alarms: false,`:typeof i.alarms=="object"&&(t+=`
339
339
  alarms: ${Ae(i.alarms," ")},`),i.type!=="GlobalAurora"&&(t+=ba()),t+=`
340
340
  })
@@ -355,7 +355,7 @@ ${t}${r.key}: ${Gn(r,{indent:t})}`).join(",")}Bn(qf,"emitProjectedProps");functi
355
355
  backupRetentionDays: ${i.backupRetentionDays},`),t+=rt(i.extraProperties),t+=`
356
356
  })
357
357
  );
358
- `}return t}er(sh,"generateClickHouseCode");function cu(e,t){return t.compute.some(r=>r.connectedDatabase?.includes(e.name))}er(cu,"clickhouseNeedsVariable");var t8=Object.defineProperty,ch=(e,t)=>t8(e,"name",{value:t,configurable:!0});function Da(e,t){let{connectedStorage:r}=t;return r?.length?e.s3.filter(i=>r.includes(i.name)):[]}ch(Da,"getConnectedStorage");function lu(e){let t=[];for(let[r,i]of e.entries()){let n=we(i),a=Un(r);for(let o of cn("storage",a))t.push({key:o.key,expression:Ti(o.value,n)})}return t}ch(lu,"generateStorageEnvVarEntries");function lh(e,t){let r={},i={};if(!t.connectedStorage?.length)return{env:r,secrets:i};let n=Da(e,t),a=lu(n);for(let o of a)r[o.key]={__expression:o.expression};return{env:r,secrets:i}}ch(lh,"buildStorageEnvVars");function Es(e,t,r=[]){let i={database:e.map(n=>we(n)),storage:t.map(n=>we(n)),messaging:r.map(n=>we(n))};return`connections: [${ru.flatMap(n=>i[n]).join(", ")}],`}ch(Es,"formatAllConnectionsCode");var r8=Object.defineProperty,_0=(e,t)=>r8(e,"name",{value:t,configurable:!0});function Ia(e,t){let{connectedMessaging:r}=t;return r?.length?(e.sqs??[]).filter(i=>r.includes(i.name)):[]}_0(Ia,"getConnectedMessaging");function uu(e){let t=[];for(let[r,i]of e.entries()){let n=we(i),a=Un(r);for(let o of cn("messaging",a))t.push({key:o.key,expression:Ti(o.value,n)})}return t}_0(uu,"generateMessagingEnvVarEntries");function uh(e,t){let r={},i={};if(!t.connectedMessaging?.length)return{env:r,secrets:i};let n=Ia(e,t),a=uu(n);for(let o of a)r[o.key]={__expression:o.expression};return{env:r,secrets:i}}_0(uh,"buildMessagingEnvVars");var n8={kind:"planOnly",reason:"`variableName` is a plan-only round-trip key naming the `const <var> =` binding the scaffold emits; no construct reads it."},T0={kind:"planOnly",reason:"`extraProperties` is a plan-only round-trip key: the scaffold flattens each `{ key, sourceText }` entry into a sibling property, and no construct reads the array."},ka={variableName:n8,extraProperties:T0};var i8=Object.defineProperty,Le=(e,t)=>i8(e,"name",{value:t,configurable:!0}),dh=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function As(e,t){return{kind:"member",object:{kind:"identifier",name:e},property:t}}Le(As,"memberOf");function Ii(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}Le(Ii,"isPlainRecord");function Di(e){return Array.isArray(e)?{kind:"array",elements:e.map(Di)}:Ii(e)?{kind:"object",entries:Object.entries(e).filter(([,t])=>t!==void 0).map(([t,r])=>({key:t,value:Di(r)}))}:{kind:"literal",value:e}}Le(Di,"toStructuredLiteral");function xs(e){if(typeof e=="string"&&dh.test(e))return{expression:As("ScalingType",e),imports:["ScalingType"]}}Le(xs,"scalingTypeBinding");function L1(e){if(!Array.isArray(e))return{expression:Di(e)};let t=!1,r=[];for(let i of e){if(!Ii(i))return{expression:Di(e)};let n=[];for(let[a,o]of Object.entries(i)){if(o===void 0)continue;if(a!=="scaling"||!Ii(o)){n.push({key:a,value:Di(o)});continue}let s=[];for(let[l,m]of Object.entries(o))if(m!==void 0){if(l==="scalingType"){let d=xs(m);if(d!==void 0){t=!0,s.push({key:l,value:d.expression});continue}}s.push({key:l,value:Di(m)})}n.push({key:a,value:{kind:"object",entries:s}})}r.push({kind:"object",entries:n})}return{expression:{kind:"array",elements:r},...t&&{imports:["ScalingType"]}}}Le(L1,"buildServicesBinding");function F1(e){return Ii(e)&&Object.keys(e).length===1&&typeof e.authType=="string"&&dh.test(e.authType)?{expression:{kind:"object",entries:[{key:"authType",value:As("FunctionUrlAuthType",e.authType)}]},imports:["FunctionUrlAuthType"]}:{expression:Di(e)}}Le(F1,"buildFunctionUrlBinding");var a8=[{property:"deployment",reason:"a Lambda needs a deployment mode: pass `deployment=container` (the image carries code and runtime) or `deployment=code` with a `codePath` for `Code.fromAsset(...)`.",refuseWhen:Le(e=>e.type==="lambda"&&e.deployment===void 0&&e.code===void 0,"refuseWhen")},{property:"codePath",reason:"a container Lambda takes its code from the image, so `codePath` is never read \u2014 drop it, or use `deployment=code`.",refuseWhen:Le(e=>e.deployment==="container"&&e.codePath!==void 0,"refuseWhen")},{property:"handler",reason:"a container Lambda takes its handler from the image (`Handler.FROM_IMAGE`), so `handler` is never read \u2014 drop it, or use `deployment=code`.",refuseWhen:Le(e=>e.deployment==="container"&&e.handler!==void 0,"refuseWhen")},{property:"runtime",reason:"a container Lambda takes its runtime from the image (`Runtime.FROM_IMAGE`), so `runtime` is never read \u2014 drop it, or use `deployment=code`.",refuseWhen:Le(e=>e.deployment==="container"&&e.runtime!==void 0,"refuseWhen")},{property:"codePath",reason:"`deployment=code` needs a `codePath` for `Code.fromAsset(...)`: without one the statement takes the whole app's synth down with `Cannot read properties of undefined (reading 'bind')` \u2014 naming no resource. Pass `codePath=<dir>`, or use `deployment=container`.",refuseWhen:Le(e=>e.deployment==="code"&&e.code===void 0&&e.codePath===void 0,"refuseWhen")},{property:"scheduleExpression",reason:"`scheduleExpression` expands into an `app.addSchedule(...)` statement targeting this compute, and only a Lambda is a schedule target \u2014 drop it, or use `type=lambda`.",refuseWhen:Le(e=>e.scheduleExpression!==void 0&&typeof e.type=="string"&&e.type!=="lambda","refuseWhen")},{property:"services",reason:'an x86 instance type mismatches the default linux/arm64 (Graviton) Docker build, so the service would pull images the instance cannot run. Use a Graviton instance type (t4g, c6g, r6g, m6g, \u2026), or set `amiHardwareType: "STANDARD"` on that service\'s `ec2Config` to acknowledge x86.',refuseWhen:Le(e=>e.type==="ecs"&&Array.isArray(e.services)&&e.services.some(t=>{if(!Ii(t))return!1;let r=t.ec2Config;return!Ii(r)||typeof r.instanceType!="string"||r.instanceType===""||r.amiHardwareType!==void 0?!1:xi(r.instanceType)!=="ARM"}),"refuseWhen")},{property:"architecture",reason:"`X86_64` on a container Lambda mismatches the default linux/arm64 Docker build. Use `ARM_64` (recommended), or author the statement by hand with a build pipeline that targets linux/amd64.",refuseWhen:Le(e=>e.type==="lambda"&&e.deployment==="container"&&e.architecture==="X86_64","refuseWhen")}];function U1(e,t){let r=e.scheduleExpression,i=e.scheduleStackPlacement;return typeof r!="string"?i!==void 0?{siblings:[],unprojectable:[{key:"scheduleStackPlacement",reason:"`scheduleStackPlacement` places the `app.addSchedule(...)` sibling statement and there is no `scheduleExpression` to place \u2014 pass `scheduleExpression=<expr>` alongside it, or drop it.",kind:"cross-key"}]}:{siblings:[],unprojectable:[]}:i!==void 0&&(typeof i!="string"||!Ft(fa,i))?{siblings:[],unprojectable:[{key:"scheduleStackPlacement",reason:`\`scheduleStackPlacement\` must be one of ${fa.map(n=>`\`${n}\``).join(", ")} \u2014 the addSchedule construct accepts no other placement.`,kind:"cross-key"}]}:typeof e.type=="string"&&e.type!=="lambda"?{siblings:[],unprojectable:[{key:"scheduleExpression",reason:"`scheduleExpression` expands into an `app.addSchedule(...)` statement targeting this compute, and only a Lambda is a schedule target.",kind:"cross-key"}]}:t.resourceName===void 0?{siblings:[],unprojectable:[{key:"scheduleExpression",reason:"`scheduleExpression` expands into an `app.addSchedule(...)` statement whose construct id derives from the resource name, and this caller supplied none.",kind:"missing-context"}]}:{siblings:[{planKey:"scheduleExpression",constructId:`${t.resourceName}Schedule`,appMethod:"addSchedule",props:[{key:"schedule",value:{kind:"literal",value:r}},{key:"target",value:{kind:"structured",expression:{kind:"primary-binding"}}},{key:"stackPlacement",value:{kind:"literal",value:i??"compute"}}]}],unprojectable:[]}}Le(U1,"deriveScheduleSibling");var o8={database:"connectedDatabase",storage:"connectedStorage",messaging:"connectedMessaging"};function z1(e){let t=[],r=[];for(let i of ru){let n=o8[i],a=e[n];if(!Array.isArray(a)||a.length===0)continue;let o=a.filter(s=>typeof s=="string"&&s.length>0);if(o.length!==a.length){let s=typeof a.find(l=>typeof l!="string"||l.length===0)=="string"?'the empty string ""':"not a string";r.push({key:n,reason:`\`${n}\` lists sibling resources by name and one element is ${s} \u2014 nothing can be wired to a nameless resource, and dropping the element would deploy the compute with the requested wiring silently missing. Replace the element with the resource's name, or drop it.`,kind:"unresolved-binding"});continue}t.push({planKey:n,resourceType:i,names:o})}return{requests:t,unprojectable:r}}Le(z1,"readConnectionRequests");function B1(e,t){switch(e.kind){case"accessor":return{kind:"call",callee:{kind:"member",object:{kind:"identifier",name:t},property:e.method},args:[]};case"credential":return{kind:"call",callee:{kind:"member",object:{kind:"call",callee:{kind:"member",object:{kind:"identifier",name:t},property:sn.CREDENTIALS},args:[]},property:sn.IMPORT},args:[{kind:"literal",value:e.credentialKey}]};case"literal":return{kind:"literal",value:e.value}}}Le(B1,"wiringValueToStructured");function du(e,t,r){return{props:[],unprojectable:[{key:e,reason:t,kind:r}]}}Le(du,"expansionRefusal");function G1(e,t){let{requests:r,unprojectable:i}=z1(e);if(i.length>0)return{props:[],unprojectable:i};let n=Ii(e.environment)?e.environment:void 0;if(r.length===0)return{props:n!==void 0?[{key:"environment",value:{kind:"literal",value:n}}]:[],unprojectable:[]};let[a]=r;if(a===void 0)return{props:[],unprojectable:[]};if(t.editingExisting===!0)return du(a.planKey,"connection keys rebuild the statement's `environment`, `secretsImport` and `connections` props wholesale, which an edit to an existing compute cannot do safely. Wire the connection when creating the compute (`fjall add compute \u2026 connectedDatabase=<Name>`), add it from the resource's own side (`fjall add <database|storage|messaging>` connecting to this compute's services), or author the wiring in infrastructure.ts by hand.","cross-key");if(typeof e.type=="string"&&e.type!=="lambda")return du(a.planKey,"top-level connection wiring is a Lambda shape (`environment`/`secretsImport`/`connections` are Lambda construct props); an ECS cluster wires connections per SERVICE \u2014 add the resource from its own side (`fjall add <database|storage|messaging>` connecting to the services), or author the per-service wiring by hand.","cross-key");if(r.some(d=>d.resourceType==="database")&&e.needsConnection!==!0)return du("connectedDatabase","`connectedDatabase` wires only when `needsConnection` is true \u2014 database wiring is gated on it (storage and messaging wiring are not). Pass `needsConnection=true` alongside `connectedDatabase`.","cross-key");let o=[];for(let d of r){let h=t.resolveBindings?.(d.names,d.planKey);if(h===void 0)return du(d.planKey,`\`${d.planKey}\` names planned sibling resources and the wiring reads live bindings in their place; no unique ${d.resourceType} binding could be resolved for every listed name in this file.`,"unresolved-binding");o.push({request:d,variables:[...h]})}let s=new Map,l=[];for(let{request:d,variables:h}of o)h.forEach((g,u)=>{let p=Un(u);for(let f of cn(d.resourceType,p)){let y=B1(f.value,g);f.target==="secretsImport"?l.push({key:f.key,value:y}):s.set(f.key,y)}});if(n!==void 0)for(let[d,h]of Object.entries(n))h!==void 0&&s.set(d,{kind:"literal",value:h});let m=[{key:"environment",value:{kind:"structured",expression:{kind:"object",entries:[...s].map(([d,h])=>({key:d,value:h}))}}}];return l.length>0&&m.push({key:"secretsImport",value:{kind:"structured",expression:{kind:"object",entries:l}}}),m.push({key:"connections",value:{kind:"structured",expression:{kind:"array",elements:o.flatMap(({variables:d})=>d.map(h=>({kind:"identifier",name:h})))}}}),{props:m,unprojectable:[]}}Le(G1,"deriveConnectionExpansion");var V1={keys:{memory:{kind:"prop",as:"memorySize"},ssmSecrets:{kind:"prop",as:"secrets"},codePath:{kind:"structured",as:"code",reason:"`codePath` becomes `code: Code.fromAsset(<dir>)` and needs a non-empty directory path; nothing else can feed `Code.fromAsset`.",build:Le(e=>typeof e=="string"&&e.length>0?{expression:{kind:"call",callee:As("Code","fromAsset"),args:[{kind:"literal",value:e}]},imports:["Code"]}:void 0,"build")},runtime:{kind:"structured",reason:"the construct reads a CDK `Runtime` member, so pass the MEMBER name (`NODEJS_22_X`), not a version string: `nodejs20.x` passes the plan schema but no `Runtime.<member>` expression can carry it.",build:Le(e=>typeof e=="string"&&dh.test(e)?{expression:As("Runtime",e),imports:["Runtime"]}:void 0,"build")},architecture:{kind:"structured",reason:"the construct reads a CDK `Architecture` member (`ARM_64`, `X86_64`); a value that is not a member name would emit an EMPTY `Architectures` list where omitting the key yields the correct default.",build:Le(e=>typeof e=="string"&&dh.test(e)?{expression:As("Architecture",e),imports:["Architecture"]}:void 0,"build")},functionUrl:{kind:"structured",reason:"`functionUrl.authType` is a CDK `FunctionUrlAuthType` member; the emitted prop is `{ authType: FunctionUrlAuthType.<member> }`.",build:Le(e=>F1(e),"build")},services:{kind:"structured",reason:"`services[].scaling.scalingType` is a CDK `ScalingType` member: written as a string it silently scales on CPU whatever was asked, so the array is re-emitted with `ScalingType.<member>` accesses.",build:Le(e=>L1(e),"build")},enableSSH:{kind:"transform",as:"ssh",apply:Le(e=>e===!0?{}:!1,"apply")},secrets:{kind:"planOnly",reason:"the plan's `secrets` RECORD has no construct slot: the Lambda construct reads `secrets` as a string ARRAY of SSM names (the plan's `ssmSecrets`), and ECS secrets live per service \u2014 a record here lands inert and the function deploys without those secrets."},eventSources:{kind:"planOnly",reason:"zero `props.eventSources` reads exist across @fjall/components-infrastructure \u2014 the array lands inert and no event source mapping is created."},functionName:{kind:"planOnly",reason:"the Lambda construct hardcodes `functionName: id` (its construct id), so an override is never read and the function keeps the id-derived name."},keyName:{kind:"planOnly",reason:"the EC2 construct reads only the `ssh` prop's presence; `keyName` is never forwarded, so the instance launches without the named key pair."},userData:{kind:"planOnly",reason:"the EC2 construct wants a live CDK `UserData` object; a plan string is never read, so the instance boots without the requested user data."},securityGroups:{kind:"planOnly",reason:"no EC2 construct prop reads `securityGroups`; the instance deploys with the construct's own groups and the listed ones are never attached."},alarms:{kind:"planOnly",reason:"no construct reads a top-level `alarms`: ECS alarm thresholds live per service (`services[].alarms`) and the Lambda construct reads no alarm config at all, so the thresholds land inert."},...ka},crossKey:a8,siblings:{keys:["scheduleExpression","scheduleStackPlacement"],derive:U1},expansion:{keys:["needsConnection","connectedDatabase","connectedStorage","connectedMessaging","environment"],derive:G1},constructKeyAliases:{memorySize:["memory"],description:["lambdaDescription"],secrets:["ssmSecrets"],secretsImport:["containerSecretsImport"]}};var s8=Object.defineProperty,Tr=(e,t)=>s8(e,"name",{value:t,configurable:!0}),c8={constants:[{key:"type",value:{kind:"literal",value:"queue"}}],keys:{retentionPeriod:{kind:"prop",as:"messageRetentionPeriod"},...ka}},l8={keys:{...ka}},u8={keys:{engineExpression:{kind:"planOnly",reason:"`engineExpression` carries a raw CDK engine expression for the scaffold to inline; the construct reads `databaseEngine` instead, so a cluster pinned to `DatabaseClusterEngine.auroraMysql(...)` still deploys as aurora-postgresql."},...ka}},d8={keys:{...ka}},p8={constants:Tr(e=>e.resourceName!==void 0?{props:[{key:"name",value:{kind:"literal",value:mr(e.resourceName)}}],unprojectable:[]}:{props:[],unprojectable:[{key:"name",reason:"every pattern construct reads a `name` prop (`toPascalCase(props.name)` names its child constructs), and this caller supplied no resource name to derive it from."}]},"constants")},m8={constants:[{key:"originType",value:{kind:"literal",value:"auto"}}],keys:{defaultOriginRef:{kind:"live",as:"origin",reason:"`defaultOriginRef` names a planned sibling resource and the construct reads a live `origin` binding in its place; no unique storage or compute binding for that name could be resolved in this file, and writing the name as a string would deploy a distribution treating it as an HTTP origin domain.",bind:Tr((e,t)=>typeof e=="string"?t.resolveBinding?.(e):void 0,"bind")},customDomain:{kind:"transform",as:"domainNames",apply:Tr(e=>[e],"apply")},domain:{kind:"transform",as:"domainConfig",apply:Tr(e=>({domainName:e}),"apply")},behaviours:{kind:"planOnly",reason:"each `behaviours[].originRef` names a live origin PER ELEMENT, and a single-value binding cannot reach inside an array literal; the plan shape throws `Cannot read properties of undefined (reading 'computeType')` at synth."},extraProperties:T0},crossKey:[{property:"domain",reason:"`domain` is the managed-domain lane (the construct resolves zone and certificate from the injected managed-domain binding) and `customDomain` is the BYO lane \u2014 the construct refuses `domainConfig` beside `domainNames`. Pass one or the other.",refuseWhen:Tr(e=>e.domain!==void 0&&e.customDomain!==void 0,"refuseWhen")},{property:"domain",reason:"`domain` resolves its certificate from the managed-domain binding, so a BYO `certificateArn` beside it is refused by the construct (`domainConfig` excludes `certificateArn`). Pass one or the other.",refuseWhen:Tr(e=>e.domain!==void 0&&e.certificateArn!==void 0,"refuseWhen")},{property:"domain",reason:"this statement already carries `domainNames` (the BYO lane) and `domain` projects to `domainConfig` \u2014 the construct refuses the pair. Drop `domainNames` first, or keep the BYO lane and drop `domain`.",refuseWhen:Tr(e=>e.domain!==void 0&&e.domainNames!==void 0,"refuseWhen")},{property:"domain",reason:"this statement already carries a `certificate` and `domain` projects to `domainConfig` \u2014 the construct refuses the pair. Drop `certificate` first, or keep the BYO lane and drop `domain`.",refuseWhen:Tr(e=>e.domain!==void 0&&e.certificate!==void 0,"refuseWhen")},{property:"domain",reason:"this statement already carries a `domainConfig` and `domain` projects to a second one \u2014 the plan key would silently REPLACE the existing `domainConfig`, discarding whatever richer shape it carries. Modify the existing `domainConfig` instead.",refuseWhen:Tr(e=>e.domain!==void 0&&e.domainConfig!==void 0,"refuseWhen")},{property:"customDomain",reason:"this statement already carries a `domainConfig` (the managed-domain lane) and `customDomain` projects to `domainNames` \u2014 the construct refuses the pair. Drop `domainConfig` first, or keep the managed lane and pass `domain` instead.",refuseWhen:Tr(e=>e.customDomain!==void 0&&e.domainConfig!==void 0,"refuseWhen")},{property:"certificateArn",reason:"this statement already carries a `domainConfig`, which resolves its certificate from the managed-domain binding \u2014 a BYO `certificateArn` beside it is refused by the construct (`domainConfig` excludes `certificateArn`). Drop `domainConfig` first, or let the managed lane keep the certificate.",refuseWhen:Tr(e=>e.certificateArn!==void 0&&e.domainConfig!==void 0,"refuseWhen")}]},_s={messaging:c8,storage:l8,database:u8,network:d8,pattern:p8,cdn:m8,compute:V1};function ph(e){return Object.prototype.hasOwnProperty.call(_s,e)}Tr(ph,"isProjectableType");var f8=Object.defineProperty,C0=(e,t)=>f8(e,"name",{value:t,configurable:!0});function W1(e){return ph(e)?_s[e].constructKeyAliases??{}:{}}C0(W1,"constructKeyAliasesFor");function D0(e,t){return(_s[e].crossKey??[]).filter(r=>r.refuseWhen(t)).map(r=>({key:r.property,reason:r.reason,kind:"cross-key"}))}C0(D0,"crossKeyUnprojectables");function Wr(e,t,r={}){let i=_s[e],n=[];r.editingExisting!==!0&&n.push(...D0(e,t));let a=[];if(r.editingExisting!==!0)if(typeof i.constants=="function"){let d=i.constants(r);a=d.props,n.push(...d.unprojectable.map(h=>({...h,kind:h.kind??"missing-context"})))}else a=i.constants??[];let o=new Map(a.map(d=>[d.key,d])),s=new Set([...i.siblings?.keys??[],...i.expansion?.keys??[]]),l;if(i.siblings!==void 0&&i.siblings.keys.some(d=>t[d]!==void 0)){let d=i.siblings.derive(t,r);l=d.siblings,n.push(...d.unprojectable)}let m=[];if(i.expansion!==void 0&&i.expansion.keys.some(d=>t[d]!==void 0)){let d=i.expansion.derive(t,r);m=d.props,n.push(...d.unprojectable)}for(let[d,h]of Object.entries(t)){if(h===void 0||s.has(d))continue;let g=i.keys?.[d];if(g===void 0||g.kind==="prop"){let f=g?.as??d;o.set(f,{key:f,value:{kind:"literal",value:h}});continue}if(g.kind==="transform"){let f=g.as??d;o.set(f,{key:f,value:{kind:"literal",value:g.apply(h)}});continue}if(g.kind==="planOnly"){n.push({key:d,reason:g.reason,kind:"plan-only"});continue}if(g.kind==="structured"){let f=g.build(h,r);if(f===void 0){n.push({key:d,reason:g.reason,kind:"unresolved-binding"});continue}let y=g.as??d;o.set(y,{key:y,value:{kind:"structured",expression:f.expression,...f.imports!==void 0&&{imports:f.imports}}});continue}let u=g.bind(h,r);if(u===void 0){n.push({key:d,reason:g.reason,kind:"unresolved-binding"});continue}let p=g.as??d;o.set(p,{key:p,value:{kind:"expression",source:u}})}for(let d of m)o.set(d.key,d);return{props:[...o.values()],unprojectable:n,...l!==void 0&&{siblings:l}}}C0(Wr,"projectPlanToConstructProps");var h8=Object.defineProperty,Ts=(e,t)=>h8(e,"name",{value:t,configurable:!0});function Na(e){return!!(e.needsConnection&&e.connectedDatabase?.length)}Ts(Na,"computeHasDatabaseConnections");function wa(e){return!!e.connectedStorage?.length}Ts(wa,"computeHasStorageConnections");function Pa(e){return!!e.connectedMessaging?.length}Ts(Pa,"computeHasMessagingConnections");function pu(e){return Na(e)||wa(e)||Pa(e)}Ts(pu,"computeHasConnections");var mu={ENVIRONMENT:{__expression:"getConfig().environment"}};function Cs(e,t){return Object.entries(e).map(([r,i])=>`${t}${r}: ${Ae(i)},`).join(`
358
+ `}return t}er(sh,"generateClickHouseCode");function cu(e,t){return t.compute.some(r=>r.connectedDatabase?.includes(e.name))}er(cu,"clickhouseNeedsVariable");var t8=Object.defineProperty,ch=(e,t)=>t8(e,"name",{value:t,configurable:!0});function Da(e,t){let{connectedStorage:r}=t;return r?.length?e.s3.filter(i=>r.includes(i.name)):[]}ch(Da,"getConnectedStorage");function lu(e){let t=[];for(let[r,i]of e.entries()){let n=we(i),a=Un(r);for(let o of cn("storage",a))t.push({key:o.key,expression:Ti(o.value,n)})}return t}ch(lu,"generateStorageEnvVarEntries");function lh(e,t){let r={},i={};if(!t.connectedStorage?.length)return{env:r,secrets:i};let n=Da(e,t),a=lu(n);for(let o of a)r[o.key]={__expression:o.expression};return{env:r,secrets:i}}ch(lh,"buildStorageEnvVars");function Es(e,t,r=[]){let i={database:e.map(n=>we(n)),storage:t.map(n=>we(n)),messaging:r.map(n=>we(n))};return`connections: [${ru.flatMap(n=>i[n]).join(", ")}],`}ch(Es,"formatAllConnectionsCode");var r8=Object.defineProperty,_0=(e,t)=>r8(e,"name",{value:t,configurable:!0});function Ia(e,t){let{connectedMessaging:r}=t;return r?.length?(e.sqs??[]).filter(i=>r.includes(i.name)):[]}_0(Ia,"getConnectedMessaging");function uu(e){let t=[];for(let[r,i]of e.entries()){let n=we(i),a=Un(r);for(let o of cn("messaging",a))t.push({key:o.key,expression:Ti(o.value,n)})}return t}_0(uu,"generateMessagingEnvVarEntries");function uh(e,t){let r={},i={};if(!t.connectedMessaging?.length)return{env:r,secrets:i};let n=Ia(e,t),a=uu(n);for(let o of a)r[o.key]={__expression:o.expression};return{env:r,secrets:i}}_0(uh,"buildMessagingEnvVars");var n8={kind:"planOnly",reason:"`variableName` is a plan-only round-trip key naming the `const <var> =` binding the scaffold emits; no construct reads it."},T0={kind:"planOnly",reason:"`extraProperties` is a plan-only round-trip key: the scaffold flattens each `{ key, sourceText }` entry into a sibling property, and no construct reads the array."},ka={variableName:n8,extraProperties:T0};var i8=Object.defineProperty,Le=(e,t)=>i8(e,"name",{value:t,configurable:!0}),dh=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function As(e,t){return{kind:"member",object:{kind:"identifier",name:e},property:t}}Le(As,"memberOf");function Ii(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}Le(Ii,"isPlainRecord");function Di(e){return Array.isArray(e)?{kind:"array",elements:e.map(Di)}:Ii(e)?{kind:"object",entries:Object.entries(e).filter(([,t])=>t!==void 0).map(([t,r])=>({key:t,value:Di(r)}))}:{kind:"literal",value:e}}Le(Di,"toStructuredLiteral");function xs(e){if(typeof e=="string"&&dh.test(e))return{expression:As("ScalingType",e),imports:["ScalingType"]}}Le(xs,"scalingTypeBinding");function Lj(e){if(!Array.isArray(e))return{expression:Di(e)};let t=!1,r=[];for(let i of e){if(!Ii(i))return{expression:Di(e)};let n=[];for(let[a,o]of Object.entries(i)){if(o===void 0)continue;if(a!=="scaling"||!Ii(o)){n.push({key:a,value:Di(o)});continue}let s=[];for(let[l,m]of Object.entries(o))if(m!==void 0){if(l==="scalingType"){let d=xs(m);if(d!==void 0){t=!0,s.push({key:l,value:d.expression});continue}}s.push({key:l,value:Di(m)})}n.push({key:a,value:{kind:"object",entries:s}})}r.push({kind:"object",entries:n})}return{expression:{kind:"array",elements:r},...t&&{imports:["ScalingType"]}}}Le(Lj,"buildServicesBinding");function Fj(e){return Ii(e)&&Object.keys(e).length===1&&typeof e.authType=="string"&&dh.test(e.authType)?{expression:{kind:"object",entries:[{key:"authType",value:As("FunctionUrlAuthType",e.authType)}]},imports:["FunctionUrlAuthType"]}:{expression:Di(e)}}Le(Fj,"buildFunctionUrlBinding");var a8=[{property:"deployment",reason:"a Lambda needs a deployment mode: pass `deployment=container` (the image carries code and runtime) or `deployment=code` with a `codePath` for `Code.fromAsset(...)`.",refuseWhen:Le(e=>e.type==="lambda"&&e.deployment===void 0&&e.code===void 0,"refuseWhen")},{property:"codePath",reason:"a container Lambda takes its code from the image, so `codePath` is never read \u2014 drop it, or use `deployment=code`.",refuseWhen:Le(e=>e.deployment==="container"&&e.codePath!==void 0,"refuseWhen")},{property:"handler",reason:"a container Lambda takes its handler from the image (`Handler.FROM_IMAGE`), so `handler` is never read \u2014 drop it, or use `deployment=code`.",refuseWhen:Le(e=>e.deployment==="container"&&e.handler!==void 0,"refuseWhen")},{property:"runtime",reason:"a container Lambda takes its runtime from the image (`Runtime.FROM_IMAGE`), so `runtime` is never read \u2014 drop it, or use `deployment=code`.",refuseWhen:Le(e=>e.deployment==="container"&&e.runtime!==void 0,"refuseWhen")},{property:"codePath",reason:"`deployment=code` needs a `codePath` for `Code.fromAsset(...)`: without one the statement takes the whole app's synth down with `Cannot read properties of undefined (reading 'bind')` \u2014 naming no resource. Pass `codePath=<dir>`, or use `deployment=container`.",refuseWhen:Le(e=>e.deployment==="code"&&e.code===void 0&&e.codePath===void 0,"refuseWhen")},{property:"scheduleExpression",reason:"`scheduleExpression` expands into an `app.addSchedule(...)` statement targeting this compute, and only a Lambda is a schedule target \u2014 drop it, or use `type=lambda`.",refuseWhen:Le(e=>e.scheduleExpression!==void 0&&typeof e.type=="string"&&e.type!=="lambda","refuseWhen")},{property:"services",reason:'an x86 instance type mismatches the default linux/arm64 (Graviton) Docker build, so the service would pull images the instance cannot run. Use a Graviton instance type (t4g, c6g, r6g, m6g, \u2026), or set `amiHardwareType: "STANDARD"` on that service\'s `ec2Config` to acknowledge x86.',refuseWhen:Le(e=>e.type==="ecs"&&Array.isArray(e.services)&&e.services.some(t=>{if(!Ii(t))return!1;let r=t.ec2Config;return!Ii(r)||typeof r.instanceType!="string"||r.instanceType===""||r.amiHardwareType!==void 0?!1:xi(r.instanceType)!=="ARM"}),"refuseWhen")},{property:"architecture",reason:"`X86_64` on a container Lambda mismatches the default linux/arm64 Docker build. Use `ARM_64` (recommended), or author the statement by hand with a build pipeline that targets linux/amd64.",refuseWhen:Le(e=>e.type==="lambda"&&e.deployment==="container"&&e.architecture==="X86_64","refuseWhen")}];function Uj(e,t){let r=e.scheduleExpression,i=e.scheduleStackPlacement;return typeof r!="string"?i!==void 0?{siblings:[],unprojectable:[{key:"scheduleStackPlacement",reason:"`scheduleStackPlacement` places the `app.addSchedule(...)` sibling statement and there is no `scheduleExpression` to place \u2014 pass `scheduleExpression=<expr>` alongside it, or drop it.",kind:"cross-key"}]}:{siblings:[],unprojectable:[]}:i!==void 0&&(typeof i!="string"||!Ft(fa,i))?{siblings:[],unprojectable:[{key:"scheduleStackPlacement",reason:`\`scheduleStackPlacement\` must be one of ${fa.map(n=>`\`${n}\``).join(", ")} \u2014 the addSchedule construct accepts no other placement.`,kind:"cross-key"}]}:typeof e.type=="string"&&e.type!=="lambda"?{siblings:[],unprojectable:[{key:"scheduleExpression",reason:"`scheduleExpression` expands into an `app.addSchedule(...)` statement targeting this compute, and only a Lambda is a schedule target.",kind:"cross-key"}]}:t.resourceName===void 0?{siblings:[],unprojectable:[{key:"scheduleExpression",reason:"`scheduleExpression` expands into an `app.addSchedule(...)` statement whose construct id derives from the resource name, and this caller supplied none.",kind:"missing-context"}]}:{siblings:[{planKey:"scheduleExpression",constructId:`${t.resourceName}Schedule`,appMethod:"addSchedule",props:[{key:"schedule",value:{kind:"literal",value:r}},{key:"target",value:{kind:"structured",expression:{kind:"primary-binding"}}},{key:"stackPlacement",value:{kind:"literal",value:i??"compute"}}]}],unprojectable:[]}}Le(Uj,"deriveScheduleSibling");var o8={database:"connectedDatabase",storage:"connectedStorage",messaging:"connectedMessaging"};function zj(e){let t=[],r=[];for(let i of ru){let n=o8[i],a=e[n];if(!Array.isArray(a)||a.length===0)continue;let o=a.filter(s=>typeof s=="string"&&s.length>0);if(o.length!==a.length){let s=typeof a.find(l=>typeof l!="string"||l.length===0)=="string"?'the empty string ""':"not a string";r.push({key:n,reason:`\`${n}\` lists sibling resources by name and one element is ${s} \u2014 nothing can be wired to a nameless resource, and dropping the element would deploy the compute with the requested wiring silently missing. Replace the element with the resource's name, or drop it.`,kind:"unresolved-binding"});continue}t.push({planKey:n,resourceType:i,names:o})}return{requests:t,unprojectable:r}}Le(zj,"readConnectionRequests");function Bj(e,t){switch(e.kind){case"accessor":return{kind:"call",callee:{kind:"member",object:{kind:"identifier",name:t},property:e.method},args:[]};case"credential":return{kind:"call",callee:{kind:"member",object:{kind:"call",callee:{kind:"member",object:{kind:"identifier",name:t},property:sn.CREDENTIALS},args:[]},property:sn.IMPORT},args:[{kind:"literal",value:e.credentialKey}]};case"literal":return{kind:"literal",value:e.value}}}Le(Bj,"wiringValueToStructured");function du(e,t,r){return{props:[],unprojectable:[{key:e,reason:t,kind:r}]}}Le(du,"expansionRefusal");function Gj(e,t){let{requests:r,unprojectable:i}=zj(e);if(i.length>0)return{props:[],unprojectable:i};let n=Ii(e.environment)?e.environment:void 0;if(r.length===0)return{props:n!==void 0?[{key:"environment",value:{kind:"literal",value:n}}]:[],unprojectable:[]};let[a]=r;if(a===void 0)return{props:[],unprojectable:[]};if(t.editingExisting===!0)return du(a.planKey,"connection keys rebuild the statement's `environment`, `secretsImport` and `connections` props wholesale, which an edit to an existing compute cannot do safely. Wire the connection when creating the compute (`fjall add compute \u2026 connectedDatabase=<Name>`), add it from the resource's own side (`fjall add <database|storage|messaging>` connecting to this compute's services), or author the wiring in infrastructure.ts by hand.","cross-key");if(typeof e.type=="string"&&e.type!=="lambda")return du(a.planKey,"top-level connection wiring is a Lambda shape (`environment`/`secretsImport`/`connections` are Lambda construct props); an ECS cluster wires connections per SERVICE \u2014 add the resource from its own side (`fjall add <database|storage|messaging>` connecting to the services), or author the per-service wiring by hand.","cross-key");if(r.some(d=>d.resourceType==="database")&&e.needsConnection!==!0)return du("connectedDatabase","`connectedDatabase` wires only when `needsConnection` is true \u2014 database wiring is gated on it (storage and messaging wiring are not). Pass `needsConnection=true` alongside `connectedDatabase`.","cross-key");let o=[];for(let d of r){let h=t.resolveBindings?.(d.names,d.planKey);if(h===void 0)return du(d.planKey,`\`${d.planKey}\` names planned sibling resources and the wiring reads live bindings in their place; no unique ${d.resourceType} binding could be resolved for every listed name in this file.`,"unresolved-binding");o.push({request:d,variables:[...h]})}let s=new Map,l=[];for(let{request:d,variables:h}of o)h.forEach((g,u)=>{let p=Un(u);for(let f of cn(d.resourceType,p)){let y=Bj(f.value,g);f.target==="secretsImport"?l.push({key:f.key,value:y}):s.set(f.key,y)}});if(n!==void 0)for(let[d,h]of Object.entries(n))h!==void 0&&s.set(d,{kind:"literal",value:h});let m=[{key:"environment",value:{kind:"structured",expression:{kind:"object",entries:[...s].map(([d,h])=>({key:d,value:h}))}}}];return l.length>0&&m.push({key:"secretsImport",value:{kind:"structured",expression:{kind:"object",entries:l}}}),m.push({key:"connections",value:{kind:"structured",expression:{kind:"array",elements:o.flatMap(({variables:d})=>d.map(h=>({kind:"identifier",name:h})))}}}),{props:m,unprojectable:[]}}Le(Gj,"deriveConnectionExpansion");var Vj={keys:{memory:{kind:"prop",as:"memorySize"},ssmSecrets:{kind:"prop",as:"secrets"},codePath:{kind:"structured",as:"code",reason:"`codePath` becomes `code: Code.fromAsset(<dir>)` and needs a non-empty directory path; nothing else can feed `Code.fromAsset`.",build:Le(e=>typeof e=="string"&&e.length>0?{expression:{kind:"call",callee:As("Code","fromAsset"),args:[{kind:"literal",value:e}]},imports:["Code"]}:void 0,"build")},runtime:{kind:"structured",reason:"the construct reads a CDK `Runtime` member, so pass the MEMBER name (`NODEJS_22_X`), not a version string: `nodejs20.x` passes the plan schema but no `Runtime.<member>` expression can carry it.",build:Le(e=>typeof e=="string"&&dh.test(e)?{expression:As("Runtime",e),imports:["Runtime"]}:void 0,"build")},architecture:{kind:"structured",reason:"the construct reads a CDK `Architecture` member (`ARM_64`, `X86_64`); a value that is not a member name would emit an EMPTY `Architectures` list where omitting the key yields the correct default.",build:Le(e=>typeof e=="string"&&dh.test(e)?{expression:As("Architecture",e),imports:["Architecture"]}:void 0,"build")},functionUrl:{kind:"structured",reason:"`functionUrl.authType` is a CDK `FunctionUrlAuthType` member; the emitted prop is `{ authType: FunctionUrlAuthType.<member> }`.",build:Le(e=>Fj(e),"build")},services:{kind:"structured",reason:"`services[].scaling.scalingType` is a CDK `ScalingType` member: written as a string it silently scales on CPU whatever was asked, so the array is re-emitted with `ScalingType.<member>` accesses.",build:Le(e=>Lj(e),"build")},enableSSH:{kind:"transform",as:"ssh",apply:Le(e=>e===!0?{}:!1,"apply")},secrets:{kind:"planOnly",reason:"the plan's `secrets` RECORD has no construct slot: the Lambda construct reads `secrets` as a string ARRAY of SSM names (the plan's `ssmSecrets`), and ECS secrets live per service \u2014 a record here lands inert and the function deploys without those secrets."},eventSources:{kind:"planOnly",reason:"zero `props.eventSources` reads exist across @fjall/components-infrastructure \u2014 the array lands inert and no event source mapping is created."},functionName:{kind:"planOnly",reason:"the Lambda construct hardcodes `functionName: id` (its construct id), so an override is never read and the function keeps the id-derived name."},keyName:{kind:"planOnly",reason:"the EC2 construct reads only the `ssh` prop's presence; `keyName` is never forwarded, so the instance launches without the named key pair."},userData:{kind:"planOnly",reason:"the EC2 construct wants a live CDK `UserData` object; a plan string is never read, so the instance boots without the requested user data."},securityGroups:{kind:"planOnly",reason:"no EC2 construct prop reads `securityGroups`; the instance deploys with the construct's own groups and the listed ones are never attached."},alarms:{kind:"planOnly",reason:"no construct reads a top-level `alarms`: ECS alarm thresholds live per service (`services[].alarms`) and the Lambda construct reads no alarm config at all, so the thresholds land inert."},...ka},crossKey:a8,siblings:{keys:["scheduleExpression","scheduleStackPlacement"],derive:Uj},expansion:{keys:["needsConnection","connectedDatabase","connectedStorage","connectedMessaging","environment"],derive:Gj},constructKeyAliases:{memorySize:["memory"],description:["lambdaDescription"],secrets:["ssmSecrets"],secretsImport:["containerSecretsImport"]}};var s8=Object.defineProperty,Tr=(e,t)=>s8(e,"name",{value:t,configurable:!0}),c8={constants:[{key:"type",value:{kind:"literal",value:"queue"}}],keys:{retentionPeriod:{kind:"prop",as:"messageRetentionPeriod"},...ka}},l8={keys:{...ka}},u8={keys:{engineExpression:{kind:"planOnly",reason:"`engineExpression` carries a raw CDK engine expression for the scaffold to inline; the construct reads `databaseEngine` instead, so a cluster pinned to `DatabaseClusterEngine.auroraMysql(...)` still deploys as aurora-postgresql."},...ka}},d8={keys:{...ka}},p8={constants:Tr(e=>e.resourceName!==void 0?{props:[{key:"name",value:{kind:"literal",value:mr(e.resourceName)}}],unprojectable:[]}:{props:[],unprojectable:[{key:"name",reason:"every pattern construct reads a `name` prop (`toPascalCase(props.name)` names its child constructs), and this caller supplied no resource name to derive it from."}]},"constants")},m8={constants:[{key:"originType",value:{kind:"literal",value:"auto"}}],keys:{defaultOriginRef:{kind:"live",as:"origin",reason:"`defaultOriginRef` names a planned sibling resource and the construct reads a live `origin` binding in its place; no unique storage or compute binding for that name could be resolved in this file, and writing the name as a string would deploy a distribution treating it as an HTTP origin domain.",bind:Tr((e,t)=>typeof e=="string"?t.resolveBinding?.(e):void 0,"bind")},customDomain:{kind:"transform",as:"domainNames",apply:Tr(e=>[e],"apply")},domain:{kind:"transform",as:"domainConfig",apply:Tr(e=>({domainName:e}),"apply")},behaviours:{kind:"planOnly",reason:"each `behaviours[].originRef` names a live origin PER ELEMENT, and a single-value binding cannot reach inside an array literal; the plan shape throws `Cannot read properties of undefined (reading 'computeType')` at synth."},extraProperties:T0},crossKey:[{property:"domain",reason:"`domain` is the managed-domain lane (the construct resolves zone and certificate from the injected managed-domain binding) and `customDomain` is the BYO lane \u2014 the construct refuses `domainConfig` beside `domainNames`. Pass one or the other.",refuseWhen:Tr(e=>e.domain!==void 0&&e.customDomain!==void 0,"refuseWhen")},{property:"domain",reason:"`domain` resolves its certificate from the managed-domain binding, so a BYO `certificateArn` beside it is refused by the construct (`domainConfig` excludes `certificateArn`). Pass one or the other.",refuseWhen:Tr(e=>e.domain!==void 0&&e.certificateArn!==void 0,"refuseWhen")},{property:"domain",reason:"this statement already carries `domainNames` (the BYO lane) and `domain` projects to `domainConfig` \u2014 the construct refuses the pair. Drop `domainNames` first, or keep the BYO lane and drop `domain`.",refuseWhen:Tr(e=>e.domain!==void 0&&e.domainNames!==void 0,"refuseWhen")},{property:"domain",reason:"this statement already carries a `certificate` and `domain` projects to `domainConfig` \u2014 the construct refuses the pair. Drop `certificate` first, or keep the BYO lane and drop `domain`.",refuseWhen:Tr(e=>e.domain!==void 0&&e.certificate!==void 0,"refuseWhen")},{property:"domain",reason:"this statement already carries a `domainConfig` and `domain` projects to a second one \u2014 the plan key would silently REPLACE the existing `domainConfig`, discarding whatever richer shape it carries. Modify the existing `domainConfig` instead.",refuseWhen:Tr(e=>e.domain!==void 0&&e.domainConfig!==void 0,"refuseWhen")},{property:"customDomain",reason:"this statement already carries a `domainConfig` (the managed-domain lane) and `customDomain` projects to `domainNames` \u2014 the construct refuses the pair. Drop `domainConfig` first, or keep the managed lane and pass `domain` instead.",refuseWhen:Tr(e=>e.customDomain!==void 0&&e.domainConfig!==void 0,"refuseWhen")},{property:"certificateArn",reason:"this statement already carries a `domainConfig`, which resolves its certificate from the managed-domain binding \u2014 a BYO `certificateArn` beside it is refused by the construct (`domainConfig` excludes `certificateArn`). Drop `domainConfig` first, or let the managed lane keep the certificate.",refuseWhen:Tr(e=>e.certificateArn!==void 0&&e.domainConfig!==void 0,"refuseWhen")}]},_s={messaging:c8,storage:l8,database:u8,network:d8,pattern:p8,cdn:m8,compute:Vj};function ph(e){return Object.prototype.hasOwnProperty.call(_s,e)}Tr(ph,"isProjectableType");var f8=Object.defineProperty,C0=(e,t)=>f8(e,"name",{value:t,configurable:!0});function Wj(e){return ph(e)?_s[e].constructKeyAliases??{}:{}}C0(Wj,"constructKeyAliasesFor");function D0(e,t){return(_s[e].crossKey??[]).filter(r=>r.refuseWhen(t)).map(r=>({key:r.property,reason:r.reason,kind:"cross-key"}))}C0(D0,"crossKeyUnprojectables");function Wr(e,t,r={}){let i=_s[e],n=[];r.editingExisting!==!0&&n.push(...D0(e,t));let a=[];if(r.editingExisting!==!0)if(typeof i.constants=="function"){let d=i.constants(r);a=d.props,n.push(...d.unprojectable.map(h=>({...h,kind:h.kind??"missing-context"})))}else a=i.constants??[];let o=new Map(a.map(d=>[d.key,d])),s=new Set([...i.siblings?.keys??[],...i.expansion?.keys??[]]),l;if(i.siblings!==void 0&&i.siblings.keys.some(d=>t[d]!==void 0)){let d=i.siblings.derive(t,r);l=d.siblings,n.push(...d.unprojectable)}let m=[];if(i.expansion!==void 0&&i.expansion.keys.some(d=>t[d]!==void 0)){let d=i.expansion.derive(t,r);m=d.props,n.push(...d.unprojectable)}for(let[d,h]of Object.entries(t)){if(h===void 0||s.has(d))continue;let g=i.keys?.[d];if(g===void 0||g.kind==="prop"){let f=g?.as??d;o.set(f,{key:f,value:{kind:"literal",value:h}});continue}if(g.kind==="transform"){let f=g.as??d;o.set(f,{key:f,value:{kind:"literal",value:g.apply(h)}});continue}if(g.kind==="planOnly"){n.push({key:d,reason:g.reason,kind:"plan-only"});continue}if(g.kind==="structured"){let f=g.build(h,r);if(f===void 0){n.push({key:d,reason:g.reason,kind:"unresolved-binding"});continue}let y=g.as??d;o.set(y,{key:y,value:{kind:"structured",expression:f.expression,...f.imports!==void 0&&{imports:f.imports}}});continue}let u=g.bind(h,r);if(u===void 0){n.push({key:d,reason:g.reason,kind:"unresolved-binding"});continue}let p=g.as??d;o.set(p,{key:p,value:{kind:"expression",source:u}})}for(let d of m)o.set(d.key,d);return{props:[...o.values()],unprojectable:n,...l!==void 0&&{siblings:l}}}C0(Wr,"projectPlanToConstructProps");var h8=Object.defineProperty,Ts=(e,t)=>h8(e,"name",{value:t,configurable:!0});function Na(e){return!!(e.needsConnection&&e.connectedDatabase?.length)}Ts(Na,"computeHasDatabaseConnections");function wa(e){return!!e.connectedStorage?.length}Ts(wa,"computeHasStorageConnections");function Pa(e){return!!e.connectedMessaging?.length}Ts(Pa,"computeHasMessagingConnections");function pu(e){return Na(e)||wa(e)||Pa(e)}Ts(pu,"computeHasConnections");var mu={ENVIRONMENT:{__expression:"getConfig().environment"}};function Cs(e,t){return Object.entries(e).map(([r,i])=>`${t}${r}: ${Ae(i)},`).join(`
359
359
  `)}Ts(Cs,"formatEnvBlock");function Ds(e,t,r){return e.length<=1?`{ ${e[0]??""} }`:`{${e.map(i=>`
360
360
  ${r}${i},`).join("")}
361
361
  ${t}}`}Ts(Ds,"formatCompactOrExpandedObject");var g8=Object.defineProperty,fu=(e,t)=>g8(e,"name",{value:t,configurable:!0});function I0(e){return e.deployment===mf.CODE&&!!e.codePath}fu(I0,"isCodeDeployment");function mh(e){let t=I0(e);return{deployment:t?mf.CODE:mf.CONTAINER,...t&&{codePath:e.codePath},...t&&e.handler&&{handler:e.handler},...t&&e.runtime&&{runtime:e.runtime},...e.timeout!==void 0&&{timeout:e.timeout},...e.memory!==void 0&&{memory:e.memory},...e.functionUrl&&{functionUrl:e.functionUrl},...e.description&&{description:e.description},...(e.architecture!==void 0||!t)&&{architecture:e.architecture??pO},...e.ephemeralStorageSize!==void 0&&{ephemeralStorageSize:e.ephemeralStorageSize},...e.functionName&&{functionName:e.functionName},...e.ssmSecretsPath&&{ssmSecretsPath:e.ssmSecretsPath},...e.ssmSecrets&&e.ssmSecrets.length>0&&{ssmSecrets:e.ssmSecrets}}}fu(mh,"buildLambdaProjectionFragment");function fh(e){let{props:t}=Wr("compute",mh(e));return t}fu(fh,"projectLambdaProps");function hu(e){let t="";for(let r of fh(e))t+=`
@@ -370,10 +370,10 @@ ${Cs(r," ")}
370
370
  environment: {`;for(let[h,g]of Object.entries(l))d+=`
371
371
  ${h}: ${Ae(g)},`;d+=`
372
372
  },`}return d+=`
373
- ${Es(a,o,s)}`,d}fu(gu,"generateLambdaConnectionsCode");var y8=Object.defineProperty,K1=(e,t)=>y8(e,"name",{value:t,configurable:!0});function hh(e){return{...e.instanceType&&{instanceType:e.instanceType},...e.enableSSH!==void 0&&{enableSSH:e.enableSSH}}}K1(hh,"buildEc2ProjectionFragment");function yu(e){let{props:t}=Wr("compute",hh(e)),r="";for(let i of t)r+=`
374
- ${i.key}: ${Gn(i,{indent:" "})},`;return r+=rt(e.extraProperties),r}K1(yu,"generateEc2Code");var v8=Object.defineProperty,un=(e,t)=>v8(e,"name",{value:t,configurable:!0});function Z1(e){let t=[];if(e.instanceType!==void 0&&t.push(`instanceType: ${J(e.instanceType)}`),e.amiHardwareType!==void 0&&t.push(`amiHardwareType: ${J(e.amiHardwareType)}`),e.minCapacity!==void 0&&t.push(`minCapacity: ${e.minCapacity}`),e.maxCapacity!==void 0&&t.push(`maxCapacity: ${e.maxCapacity}`),e.memoryLimitMiB!==void 0&&t.push(`memoryLimitMiB: ${e.memoryLimitMiB}`),e.warmPool!==void 0&&t.push(`warmPool: ${Ae(e.warmPool," ")}`),e.extraProperties?.length)for(let r of e.extraProperties)t.push(`${r.key}: ${r.sourceText}`);return`
375
- ec2Config: ${Ds(t," "," ")},`}un(Z1,"generateEcsServiceEc2ConfigCode");function H1(e){if(!e.cluster)return"";let t=[];if(e.cluster.directAccess&&t.push("directAccess: true"),e.cluster.domain&&t.push(`domain: ${J(e.cluster.domain)}`),e.cluster.loadBalancer!==void 0&&t.push(e.cluster.loadBalancer===!1?"loadBalancer: false":`loadBalancer: ${J(e.cluster.loadBalancer)}`),e.cluster.extraProperties?.length)for(let r of e.cluster.extraProperties)t.push(`${r.key}: ${r.sourceText}`);return`
376
- cluster: ${Ds(t," "," ")},`}un(H1,"generateEcsClusterCode");function J1(e,t,r,i,n,a){let o="";e.name&&(o+=`
373
+ ${Es(a,o,s)}`,d}fu(gu,"generateLambdaConnectionsCode");var y8=Object.defineProperty,Kj=(e,t)=>y8(e,"name",{value:t,configurable:!0});function hh(e){return{...e.instanceType&&{instanceType:e.instanceType},...e.enableSSH!==void 0&&{enableSSH:e.enableSSH}}}Kj(hh,"buildEc2ProjectionFragment");function yu(e){let{props:t}=Wr("compute",hh(e)),r="";for(let i of t)r+=`
374
+ ${i.key}: ${Gn(i,{indent:" "})},`;return r+=rt(e.extraProperties),r}Kj(yu,"generateEc2Code");var v8=Object.defineProperty,un=(e,t)=>v8(e,"name",{value:t,configurable:!0});function Zj(e){let t=[];if(e.instanceType!==void 0&&t.push(`instanceType: ${J(e.instanceType)}`),e.amiHardwareType!==void 0&&t.push(`amiHardwareType: ${J(e.amiHardwareType)}`),e.minCapacity!==void 0&&t.push(`minCapacity: ${e.minCapacity}`),e.maxCapacity!==void 0&&t.push(`maxCapacity: ${e.maxCapacity}`),e.memoryLimitMiB!==void 0&&t.push(`memoryLimitMiB: ${e.memoryLimitMiB}`),e.warmPool!==void 0&&t.push(`warmPool: ${Ae(e.warmPool," ")}`),e.extraProperties?.length)for(let r of e.extraProperties)t.push(`${r.key}: ${r.sourceText}`);return`
375
+ ec2Config: ${Ds(t," "," ")},`}un(Zj,"generateEcsServiceEc2ConfigCode");function Hj(e){if(!e.cluster)return"";let t=[];if(e.cluster.directAccess&&t.push("directAccess: true"),e.cluster.domain&&t.push(`domain: ${J(e.cluster.domain)}`),e.cluster.loadBalancer!==void 0&&t.push(e.cluster.loadBalancer===!1?"loadBalancer: false":`loadBalancer: ${J(e.cluster.loadBalancer)}`),e.cluster.extraProperties?.length)for(let r of e.cluster.extraProperties)t.push(`${r.key}: ${r.sourceText}`);return`
376
+ cluster: ${Ds(t," "," ")},`}un(Hj,"generateEcsClusterCode");function Jj(e,t,r,i,n,a){let o="";e.name&&(o+=`
377
377
  name: ${J(e.name)},`),e.image&&(o+=`
378
378
  image: ${J(e.image)},`),e.port!==void 0&&(o+=`
379
379
  port: ${e.port},`),e.essential!==void 0&&(o+=`
@@ -387,32 +387,32 @@ ${Cs(m," ")}
387
387
  ${Cs(d," ")}
388
388
  },`),e.ssmSecrets&&e.ssmSecrets.length>0&&(o+=`
389
389
  secrets: [${Gl(e.ssmSecrets)}],`),e.healthCheck&&(o+=`
390
- healthCheck: ${Ae(e.healthCheck," ")},`),o+=rt(e.extraProperties," "),o}un(J1,"generateEcsContainerCode");function k0(e,t){let r=[];return e.path&&r.push(`path: ${J(e.path)}`),e.host&&r.push(`host: ${J(e.host)}`),e.priority!==void 0&&r.push(`priority: ${e.priority}`),e.healthCheckPath&&r.push(`healthCheckPath: ${J(e.healthCheckPath)}`),Ds(r,t,`${t} `)}un(k0,"formatRoutingRule");function X1(e){let t=Array.isArray(e)?e:[e];return t.length===1?`
390
+ healthCheck: ${Ae(e.healthCheck," ")},`),o+=rt(e.extraProperties," "),o}un(Jj,"generateEcsContainerCode");function k0(e,t){let r=[];return e.path&&r.push(`path: ${J(e.path)}`),e.host&&r.push(`host: ${J(e.host)}`),e.priority!==void 0&&r.push(`priority: ${e.priority}`),e.healthCheckPath&&r.push(`healthCheckPath: ${J(e.healthCheckPath)}`),Ds(r,t,`${t} `)}un(k0,"formatRoutingRule");function Xj(e){let t=Array.isArray(e)?e:[e];return t.length===1?`
391
391
  routing: ${k0(t[0]," ")},`:`
392
392
  routing: [
393
393
  ${t.map(r=>k0(r," ")).join(`,
394
394
  `)},
395
- ],`}un(X1,"generateEcsServiceRoutingCode");function q1(e){if(e===!1)return`
395
+ ],`}un(Xj,"generateEcsServiceRoutingCode");function qj(e){if(e===!1)return`
396
396
  scaling: false,`;if(typeof e!="object"||!(e.minCapacity!==void 0||e.maxCapacity!==void 0||e.desiredCount!==void 0||e.scalingType!==void 0))return"";let t=[];if(e.minCapacity!==void 0&&t.push(`minCapacity: ${e.minCapacity}`),e.maxCapacity!==void 0&&t.push(`maxCapacity: ${e.maxCapacity}`),e.desiredCount!==void 0&&t.push(`desiredCount: ${e.desiredCount}`),e.scalingType){let r=xs(e.scalingType);if(r===void 0)throw new Error(`services[].scaling.scalingType \`${e.scalingType}\` is not a ScalingType member name \u2014 the schema gate (z.enum(SCALING_TYPES)) should have refused this plan.`);t.push(`scalingType: ${zn("scalingType",r.expression)}`)}return`
397
- scaling: ${Ds(t," "," ")},`}un(q1,"generateEcsServiceScalingCode");function Y1(e,t,r){return{needsDb:e.needsDatabaseConnection!==void 0?e.needsDatabaseConnection:t&&Na(r),needsStorage:e.needsStorageConnection!==void 0?e.needsStorageConnection:t&&wa(r),needsMessaging:e.needsMessagingConnection!==void 0?e.needsMessagingConnection:t&&Pa(r)}}un(Y1,"deriveServiceConnectionNeeds");function Q1(e){let{service:t,isFirstService:r,hasConnections:i,dbEnvVars:n,storageEnvVars:a,messagingEnvVars:o,baseEnvVars:s,plan:l,compute:m}=e,d=`
397
+ scaling: ${Ds(t," "," ")},`}un(qj,"generateEcsServiceScalingCode");function Yj(e,t,r){return{needsDb:e.needsDatabaseConnection!==void 0?e.needsDatabaseConnection:t&&Na(r),needsStorage:e.needsStorageConnection!==void 0?e.needsStorageConnection:t&&wa(r),needsMessaging:e.needsMessagingConnection!==void 0?e.needsMessagingConnection:t&&Pa(r)}}un(Yj,"deriveServiceConnectionNeeds");function Qj(e){let{service:t,isFirstService:r,hasConnections:i,dbEnvVars:n,storageEnvVars:a,messagingEnvVars:o,baseEnvVars:s,plan:l,compute:m}=e,d=`
398
398
  name: ${J(t.name)},`;d+=`
399
399
  capacityProvider: ${J(t.capacityProvider)},`,t.serviceType!==void 0&&(d+=`
400
- serviceType: ${J(t.serviceType)},`),t.ec2Config&&(d+=Z1(t.ec2Config)),t.docker&&(d+=`
400
+ serviceType: ${J(t.serviceType)},`),t.ec2Config&&(d+=Zj(t.ec2Config)),t.docker&&(d+=`
401
401
  docker: ${Ae(t.docker," ")},`),t.image&&(d+=`
402
402
  image: ${J(t.image)},`),t.ssmSecretsPath&&(d+=`
403
- ssmSecretsPath: ${J(t.ssmSecretsPath)},`);let h=Y1(t,r,m);if(t.containers?.length){d+=`
403
+ ssmSecretsPath: ${J(t.ssmSecretsPath)},`);let h=Yj(t,r,m);if(t.containers?.length){d+=`
404
404
  containers: [{`;for(let g=0;g<t.containers.length;g++){let u=t.containers[g];if(!u)continue;let p=g===0&&(h.needsDb||h.needsStorage||h.needsMessaging)&&i,f=h.needsDb?n:{env:{},secrets:{}},y=h.needsStorage?a:{env:{},secrets:{}},v=h.needsMessaging?o:{env:{},secrets:{}};g>0&&(d+=`
405
- }, {`),d+=J1(u,p,f,y,v,s)}d+=`
406
- }],`}if(t.routing&&(d+=X1(t.routing)),t.cpu!==void 0&&(d+=`
405
+ }, {`),d+=Jj(u,p,f,y,v,s)}d+=`
406
+ }],`}if(t.routing&&(d+=Xj(t.routing)),t.cpu!==void 0&&(d+=`
407
407
  cpu: ${t.cpu},`),t.memoryLimitMiB!==void 0&&(d+=`
408
408
  memoryLimitMiB: ${t.memoryLimitMiB},`),t.desiredCount!==void 0&&(d+=`
409
- desiredCount: ${t.desiredCount},`),t.scaling!==void 0&&(d+=q1(t.scaling)),t.alarms===!1?d+=`
409
+ desiredCount: ${t.desiredCount},`),t.scaling!==void 0&&(d+=qj(t.scaling)),t.alarms===!1?d+=`
410
410
  alarms: false,`:typeof t.alarms=="object"&&(d+=`
411
411
  alarms: ${Ae(t.alarms," ")},`),d+=rt(t.extraProperties," "),h.needsDb||h.needsStorage||h.needsMessaging){let g=h.needsDb?Ca(l,m):[],u=h.needsStorage?Da(l,m):[],p=h.needsMessaging?Ia(l,m):[];(g.length>0||u.length>0||p.length>0)&&(d+=`
412
- ${Es(g,u,p)}`)}return d}un(Q1,"generateEcsServiceCode");function vu(e,t){let r=pu(e),i={...mu},n={env:{},secrets:{}};if(Na(e)){let l=ah(t,e);Object.assign(n.env,l.env),Object.assign(n.secrets,l.secrets)}let a={env:{},secrets:{}};if(wa(e)){let l=lh(t,e);Object.assign(a.env,l.env)}let o={env:{},secrets:{}};if(Pa(e)){let l=uh(t,e);Object.assign(o.env,l.env)}let s=`
413
- ecrRepository: app.getDefaultContainerRegistry(),`;if(s+=H1(e),e.services?.length){s+=`
412
+ ${Es(g,u,p)}`)}return d}un(Qj,"generateEcsServiceCode");function vu(e,t){let r=pu(e),i={...mu},n={env:{},secrets:{}};if(Na(e)){let l=ah(t,e);Object.assign(n.env,l.env),Object.assign(n.secrets,l.secrets)}let a={env:{},secrets:{}};if(wa(e)){let l=lh(t,e);Object.assign(a.env,l.env)}let o={env:{},secrets:{}};if(Pa(e)){let l=uh(t,e);Object.assign(o.env,l.env)}let s=`
413
+ ecrRepository: app.getDefaultContainerRegistry(),`;if(s+=Hj(e),e.services?.length){s+=`
414
414
  services: [{`;for(let l=0;l<e.services.length;l++){let m=e.services[l];m&&(l>0&&(s+=`
415
- }, {`),s+=Q1({service:m,isFirstService:l===0,hasConnections:r,dbEnvVars:n,storageEnvVars:a,messagingEnvVars:o,baseEnvVars:i,plan:t,compute:e}))}s+=`
415
+ }, {`),s+=Qj({service:m,isFirstService:l===0,hasConnections:r,dbEnvVars:n,storageEnvVars:a,messagingEnvVars:o,baseEnvVars:i,plan:t,compute:e}))}s+=`
416
416
  }],`}return s+=rt(e.extraProperties),s+=ba(),s}un(vu,"generateEcsCode");var b8=Object.defineProperty,N0=(e,t)=>b8(e,"name",{value:t,configurable:!0});function gh(e){for(let t of e.compute){let r;switch(t.type){case"lambda":r=mh(t);break;case"ec2":r=hh(t);break;case"ecs":continue;default:{let a=t.type;throw new Error(`Unhandled compute type: ${String(a)}`)}}let{unprojectable:i}=Wr("compute",r),n=i.find(a=>a.kind==="unresolved-binding");if(n!==void 0)return{resourceName:t.name,key:n.key,reason:n.reason}}}N0(gh,"findComputeProjectionRefusal");function yh(e,t){if(e.compute.length===0)return"";let r="";for(let i=0;i<e.compute.length;i++){let n=e.compute[i],a=t.has(n.name)||n.scheduleExpression!==void 0,o=we(n),s=e.database.length>0||e.s3.length>0||i>0,l=a?`const ${o} = `:"";switch(r+=`${s?`
417
417
  `:""}${l}app.${nu.appMethod}(
418
418
  ${nu.factory}.build(${J(n.name)}, {
@@ -573,7 +573,7 @@ ${a}`)}throw n}}Mh(Fu,"convertToResourcePlan");var c5=Object.defineProperty,Us=(
573
573
  `;return i.push(`Custom code from line ${t.originalLine} could not be positioned. Added at end of file.`),e+`
574
574
  `+n+t.sourceText}Pr(wL,"insertOrOrphanBlock");function zh(e,t,r){if(!t||t.length===0)return{content:e,success:!0};try{let i=Ri(e),n=Vt(i),a=[],o=NL(t),s=e;for(let l of o){let m=RL(i,n,l,r,a);s=wL(s,l,m,a)}return{content:s,success:!0,warnings:a.length>0?a:void 0}}catch(i){return fn(i,e)}}Pr(zh,"injectCustomCodeBlocks");function PL(e,t,r,i){if(!t.afterManagedResource)return null;let n=t.afterManagedResource,a=(n.name&&r?.get(n.name))??n.name,o=e.find(l=>l.type===n.type&&l.resourceName===a);if(o)return o.endPos;let s=e.filter(l=>l.type===n.type&&l.isManaged);return s.length===1?s[0].endPos:(i&&i.push(`Resource ${Oi(t.afterManagedResource.type,t.afterManagedResource.name)} not found. Custom code may be orphaned.`),null)}Pr(PL,"findAfterResourcePosition");function RL(e,t,r,i,n){switch(r.position){case"before-imports":return 0;case"after-imports":return TT(t,"import")?.endPos??0;case"after-app-init":return Lh(t,"app-init")?.endPos??null;case"after-tags":return Lh(t,"tags")?.endPos??null;case"after-resource":return PL(t,r,i,n);case"end-of-file":return e.getEnd();default:return null}}Pr(RL,"findCustomCodeInsertPosition");function OL(e,t,r){let i=Uh(e,t),n=r.sourceText;return n=Fh(i,n)+n,n.endsWith(`
575
575
  `)||(n+=`
576
- `),n}Pr(OL,"formatCustomCodeForInsertion");function $L(e){try{let t=function(n){n.kind===Ma.SyntaxKind.Unknown&&i.push("Unknown node found in AST - possible parse error"),Ma.forEachChild(n,t)};Pr(t,"visit");let r=Ri(e),i=[];return t(r),i.length>0?{valid:!1,errors:i}:{valid:!0}}catch(t){return{valid:!1,errors:[Ke(t)]}}}Pr($L,"validateModifiedFile");import*as Ve from"typescript";var Uu=c.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),d5=c.object({name:c.string(),type:Uu,ttl:c.number().optional(),value:c.string(),priority:c.number().optional(),weight:c.number().optional(),port:c.number().optional()}).strict(),p5=c.object({subdomain:c.string(),targetAccount:c.string(),auto:c.boolean()}).strict(),m5=c.object({domainName:c.string(),subjectAlternativeNames:c.array(c.string())}).strict(),Afe=c.object({origin:c.string(),ttl:c.number(),records:c.array(d5),delegations:c.array(p5),certificates:c.array(m5)}).strict(),hn=Object.freeze({ORIGIN:"$ORIGIN",TTL:"$TTL",FJALL_DELEGATE:"$FJALL-DELEGATE",FJALL_CERT:"$FJALL-CERT"}),jL="ALIAS ";var ML=c.discriminatedUnion("kind",[c.object({kind:c.literal("ecs"),appName:c.string(),computeName:c.string().min(1).optional()}).strict(),c.object({kind:c.literal("cdn"),appName:c.string(),cdnName:c.string().min(1).optional()}).strict(),c.object({kind:c.literal("bucket"),appName:c.string(),bucketName:c.string()}).strict(),c.object({kind:c.literal("custom"),dnsName:c.string(),hostedZoneId:c.string()}).strict()]),LL=ML.options.map(e=>e.shape.kind.value),kT=c.enum(["A","AAAA"]),NT=c.enum(["route53","external-delegated","external-records"]),FL=c.enum(["zone","full"]),Bh=c.string().regex(/^[A-Za-z][A-Za-z0-9]*$/),f5=c.object({kind:c.literal("standard"),type:c.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),name:c.string(),value:c.union([c.string(),c.array(c.string())]),ttl:c.number().int().positive().optional(),id:Bh.optional()}).strict(),h5=c.object({kind:c.literal("alias"),type:kT,name:c.string(),target:ML,id:Bh.optional()}).strict(),g5=c.discriminatedUnion("kind",[f5,h5]),y5=c.object({domainName:c.string(),subjectAlternativeNames:c.array(c.string()).optional(),transparencyLogging:c.boolean().optional(),cloudFront:c.boolean().optional()}).strict(),v5=c.object({subdomain:c.string(),toAccount:c.string(),auto:c.boolean().optional()}).strict(),wT=c.enum(["indexed","stable"]),Tfe=c.object({zoneName:c.string(),registrar:NT,recordIds:wT.optional(),hostedZoneId:c.string().optional(),delegatedSubdomain:c.string().optional(),adoptedNameServers:c.array(c.string().min(1)).min(1).optional(),records:c.array(g5),certificates:c.array(y5),delegations:c.array(v5)}).strict().refine(e=>e.registrar!=="external-delegated"||e.delegatedSubdomain!==void 0,{message:"external-delegated requires delegatedSubdomain"}).refine(e=>e.registrar!=="external-records"||e.delegations.length===0,{message:"external-records forbids delegations"}).refine(e=>e.registrar==="external-delegated"||e.adoptedNameServers===void 0,{message:"adoptedNameServers requires registrar external-delegated"}).refine(e=>e.registrar!=="external-delegated"||e.hostedZoneId===void 0==(e.adoptedNameServers===void 0),{message:"external-delegated adoption requires hostedZoneId and adoptedNameServers together (both-or-neither)"});var b5=Object.defineProperty,Je=(e,t)=>b5(e,"name",{value:t,configurable:!0}),BL=NT.options,UL=FL.options,zL=wT.options,S5=Uu.options,E5=kT.options;function RT(e){let t=[],r=Je(n=>{if(Ve.isNewExpression(n)&&GL(n.expression)){let a=VL(n);a!==void 0&&t.push(a)}Ve.forEachChild(n,r)},"visit");if(r(e),t.length===0)return K(void 0);if(t.length>1)return j(new Error(`Expected exactly one 'new Domain(...)' call per infrastructure file, found ${t.length}`));let i=t[0];return i?K(i):K(void 0)}Je(RT,"findDomainConstructCall");function GL(e){return Ve.isIdentifier(e)&&e.text==="Domain"}Je(GL,"isDomainIdentifier");function VL(e){let t=e.arguments;if(!t||t.length<3)return;let r=t[0],i=t[1],n=t[2];if(!r||!i||!n||!Ve.isObjectLiteralExpression(n))return;let a=WL(e);if(a===void 0)return;let o=KL(e),s=Ve.isStringLiteral(i)?i.text:void 0;return{callExpression:e,containingStatement:a,propsObjectLiteral:n,domainVarId:o,scopeArgumentText:r.getText(),constructIdLiteral:s}}Je(VL,"buildMatch");function WL(e){let t=e;for(;t!==void 0;){if(Ve.isExpressionStatement(t)||Ve.isVariableStatement(t))return t;t=t.parent}}Je(WL,"findContainingTopLevelStatement");function KL(e){let t=e.parent;for(;t!==void 0;){if(Ve.isVariableDeclaration(t)&&Ve.isIdentifier(t.name)&&t.initializer===e)return t.name.text;t=t.parent}}Je(KL,"extractDomainVarId");function ZL(e){switch(e.kind){case"registrar_required":return"'registrar' property is required";case"registrar_unsupported":return`'registrar' must be one of ${BL.join(", ")}, got ${JSON.stringify(e.value)}`;case"missing_field":return`'${e.field}' property is required`;case"invalid_literal":return`'${e.field}' ${e.reason}`;case"removed_field":return`'${e.field}' was removed from the Domain API \u2014 ${e.cure}`}}Je(ZL,"errorMessage");var A5="declare the delegated child as its own Domain with registrar: 'external-delegated' and set 'parentDelegationRoleArn' (the CLI injects it via ManagedDomainBinding.delegationRoleArn); the child UPSERTs its NS records into the parent zone";function OT(e){let t=ye(e),r=se(t.registrar,BL);if(r===void 0){let l=t.registrar;if(l===void 0)return j({kind:"registrar_required"});let m=typeof l=="string"?l:Vh(l);return j({kind:"registrar_unsupported",value:m})}let i=w(t.zoneName);if(i===void 0)return j({kind:"missing_field",field:"zoneName"});let n=se(t.recordIds,zL);if(t.recordIds!==void 0&&n===void 0)return j({kind:"invalid_literal",field:"recordIds",reason:`must be one of ${zL.map(l=>`'${l}'`).join(", ")}`});let a=XL(t.records);if(!a.success)return a;let o=tF(t.certificates);if(!o.success)return o;if(t.delegations!==void 0)return j({kind:"removed_field",field:"delegations",cure:A5});let s={zoneName:i,recordIds:n,description:w(t.description),costAllocationEnvironment:w(t.costAllocationEnvironment),tags:rF(t.tags),records:a.data,certificates:o.data};switch(r){case"route53":return K({...s,registrar:r,hostedZoneId:w(t.hostedZoneId)});case"external-delegated":{let l=w(t.delegatedSubdomain);if(l===void 0)return j({kind:"missing_field",field:"delegatedSubdomain"});let m=w(t.hostedZoneId);if(t.hostedZoneId!==void 0&&m===void 0)return j({kind:"invalid_literal",field:"hostedZoneId",reason:"must be a literal string zone id on external-delegated \u2014 dynamic expressions cannot be round-tripped"});let d=He(t.adoptedNameServers);if(t.adoptedNameServers!==void 0&&d===void 0)return j({kind:"invalid_literal",field:"adoptedNameServers",reason:"must be an array of literal NS hostname strings \u2014 the parent NS UPSERT writes them verbatim"});if(m===void 0!=(d===void 0))return j({kind:"invalid_literal",field:m===void 0?"hostedZoneId":"adoptedNameServers",reason:"adopting an existing child zone requires hostedZoneId and adoptedNameServers together (both-or-neither) \u2014 an imported zone exposes no name-server attribute at synth"});let h=w(t.parentDelegationRoleArn);if(t.parentDelegationRoleArn!==void 0&&h===void 0)return j({kind:"invalid_literal",field:"parentDelegationRoleArn",reason:"must be a literal string ARN (VD2-a) \u2014 the CLI injects it via ManagedDomainBinding.delegationRoleArn; dynamic expressions such as Fn.importValue are not supported"});let g=se(t.phase,UL);return t.phase!==void 0&&g===void 0?j({kind:"invalid_literal",field:"phase",reason:`must be one of ${UL.map(u=>`'${u}'`).join(", ")}`}):K({...s,registrar:r,delegatedSubdomain:l,hostedZoneId:m,adoptedNameServers:d,parentDelegationRoleArn:h,phase:g})}case"external-records":return K({...s,registrar:r})}}Je(OT,"parseDomainProps");function HL(e){return ZL(e)}Je(HL,"parseDomainErrorMessage");function JL(e,t,r){let i=Ve.createSourceFile(t,e,Ve.ScriptTarget.Latest,!0,Ve.ScriptKind.TS),n=RT(i);if(!n.success)return j(new Error(n.error.message));if(n.data===void 0)return j(new Error(`Domain '${r}': no 'new Domain(...)' call found in ${t} \u2014 the file is not a Fjall domain component.`));let a=OT(n.data.propsObjectLiteral);return a.success?K(a.data):j(new Error(`Domain '${r}': infrastructure.ts could not be parsed (${a.error.kind}).`))}Je(JL,"parseDomainInfrastructureSource");function XL(e){if(e===void 0)return K([]);if(!Array.isArray(e))return j({kind:"invalid_literal",field:"records",reason:"must be an array"});let t=[];for(let r=0;r<e.length;r++){let i=e[r];if(!Z(i))return j({kind:"invalid_literal",field:`records[${r}]`,reason:"must be an object literal"});let n=qL(i,r);if(!n.success)return n;t.push(n.data)}return K(t)}Je(XL,"parseRecordsArray");function qL(e,t){let r=w(e.type),i=w(e.name);if(r===void 0)return j({kind:"missing_field",field:`records[${t}].type`});if(i===void 0)return j({kind:"missing_field",field:`records[${t}].name`});let n=w(e.id);if(e.id!==void 0&&(n===void 0||!Bh.safeParse(n).success))return j({kind:"invalid_literal",field:`records[${t}].id`,reason:"must be a literal alphanumeric string starting with a letter \u2014 it becomes a CloudFormation logical-ID segment"});if(e.target!==void 0){if(!E5.some(m=>m===r))return j({kind:"invalid_literal",field:`records[${t}]`,reason:`alias records must have type 'A' or 'AAAA', got '${r}'`});let l=QL(e.target);return K({kind:"alias",type:r,name:i,target:l,...n!==void 0?{id:n}:{}})}if(!S5.some(l=>l===r))return j({kind:"invalid_literal",field:`records[${t}]`,reason:`unsupported record type '${r}'`});let a=YL(e.value);if(a===void 0)return j({kind:"invalid_literal",field:`records[${t}].value`,reason:`must be a string or array of strings (got ${JSON.stringify(e.value)})`});let o=W(e.ttl),s={kind:"standard",type:r,name:i,value:a,...o!==void 0?{ttl:o}:{},...n!==void 0?{id:n}:{}};return K(s)}Je(qL,"parseRecord");function YL(e){if(e===void 0)return;if(typeof e=="string")return e;let t=He(e);if(t!==void 0)return t}Je(YL,"parseRecordValue");function QL(e){if(Kr(e))return eF(e);if(Z(e)){let t=se(e.kind,LL);if(t==="ecs"||t==="cdn"){let r=w(e.appName);if(r!==void 0)return{kind:t,appName:r}}if(t==="bucket"){let r=w(e.appName),i=w(e.bucketName);if(r!==void 0&&i!==void 0)return{kind:t,appName:r,bucketName:i}}if(t==="custom"){let r=w(e.dnsName),i=w(e.hostedZoneId);if(r!==void 0&&i!==void 0)return{kind:t,dnsName:r,hostedZoneId:i}}}return{kind:"unresolved",sourceText:Vh(e)}}Je(QL,"parseTarget");function eF(e){let t=e.__call.trim(),r=t.match(/^([A-Za-z_][\w$]*)\s*\(([\s\S]*)\)\s*$/);if(!r)return{kind:"unresolved",sourceText:t};let i=r[1],n=r[2]??"",a=Gh(n);switch(i){case"fjallApp":{let o=gn(a,0);if(o===void 0)return{kind:"dynamic",sourceText:t};if(a.length<2)return{kind:"ecs",appName:o};let s=gn(a,1);return s===void 0?{kind:"dynamic",sourceText:t}:{kind:"ecs",appName:o,computeName:s}}case"fjallCdn":{let o=gn(a,0);if(o===void 0)return{kind:"dynamic",sourceText:t};if(a.length<2)return{kind:"cdn",appName:o};let s=gn(a,1);return s===void 0?{kind:"dynamic",sourceText:t}:{kind:"cdn",appName:o,cdnName:s}}case"fjallBucket":{if(a.length<2)return{kind:"unresolved",sourceText:t};let o=gn(a,0),s=gn(a,1);return o===void 0||s===void 0?{kind:"dynamic",sourceText:t}:{kind:"bucket",appName:o,bucketName:s}}case"aliasTo":{if(a.length>=2){let o=gn(a,0),s=gn(a,1);return o!==void 0&&s!==void 0?{kind:"custom",dnsName:o,hostedZoneId:s}:{kind:"dynamic",sourceText:t}}if(a.length===1){let o=a[0]?.trim()??"",s=PT(o,"dnsName"),l=PT(o,"hostedZoneId");return s!==void 0&&l!==void 0?{kind:"custom",dnsName:s,hostedZoneId:l}:{kind:"dynamic",sourceText:t}}return{kind:"unresolved",sourceText:t}}default:return{kind:"unresolved",sourceText:t}}}Je(eF,"resolveCallRefTarget");function Gh(e){let t=[],r=0,i=null,n="";for(let o=0;o<e.length;o++){let s=e[o];if(i!==null){if(n+=s,s==="\\"&&o+1<e.length){let l=e[o+1];l!==void 0&&(n+=l,o+=1);continue}s===i&&(i=null);continue}if(s==='"'||s==="'"||s==="`"){i=s,n+=s;continue}if(s==="("||s==="{"||s==="["){r+=1,n+=s;continue}if(s===")"||s==="}"||s==="]"){r-=1,n+=s;continue}if(s===","&&r===0){t.push(n.trim()),n="";continue}n+=s}let a=n.trim();return a.length>0&&t.push(a),t}Je(Gh,"splitTopLevelArgs");function gn(e,t){let r=e[t];if(r===void 0)return;let i=r.trim();if(i.length<2)return;let n=i[0],a=i[i.length-1];if(n===a&&!(n!=='"'&&n!=="'"&&n!=="`"))return i.slice(1,-1)}Je(gn,"extractStringLiteralArg");function PT(e,t){let r=e.trim().replace(/^\{|\}$/g,""),i=Gh(r);for(let n of i){let a=n.indexOf(":");if(a<0||n.slice(0,a).trim().replace(/["'`]/g,"")!==t)continue;let o=n.slice(a+1).trim();return gn([o],0)}}Je(PT,"extractObjectFieldString");function tF(e){if(e===void 0)return K([]);if(!Array.isArray(e))return j({kind:"invalid_literal",field:"certificates",reason:"must be an array"});let t=[];for(let r=0;r<e.length;r++){let i=e[r];if(typeof i=="string"){t.push({domainName:i});continue}if(!Z(i))return j({kind:"invalid_literal",field:`certificates[${r}]`,reason:"must be a string or object literal"});let n=w(i.domainName);if(n===void 0)return j({kind:"missing_field",field:`certificates[${r}].domainName`});let a=He(i.subjectAlternativeNames),o=oe(i.transparencyLogging),s=oe(i.cloudFront);if(i.cloudFront!==void 0&&s===void 0)return j({kind:"invalid_literal",field:`certificates[${r}].cloudFront`,reason:"must be a boolean literal \u2014 the CloudFront designation drives the zone-level us-east-1 export contract and cannot be round-tripped from a dynamic expression"});t.push({domainName:n,...a!==void 0?{subjectAlternativeNames:a}:{},...o!==void 0?{transparencyLogging:o}:{},...s!==void 0?{cloudFront:s}:{}})}return K(t)}Je(tF,"parseCertificatesArray");function rF(e){if(e===void 0||!Z(e))return;let t={};for(let[r,i]of Object.entries(e)){let n=w(i);n!==void 0&&(t[r]=n)}return Object.keys(t).length===0?void 0:t}Je(rF,"parseStringRecord");function Vh(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return`[${e.map(t=>Vh(t)).join(", ")}]`;if(typeof e=="object"){if("__call"in e)return String(e.__call);if("__identifier"in e)return String(e.__identifier);if("__expression"in e)return String(e.__expression);if("__unknown"in e)return String(e.__unknown)}return String(e)}Je(Vh,"stringifyParsedValue");var Sg=lc(Ar(),1);var x5=Object.defineProperty,La=(e,t)=>x5(e,"name",{value:t,configurable:!0}),Wt=Symbol("non-literal");function _5(e,t){let r={};for(let i of e.properties){if(i.type!=="Property"&&i.type!=="ObjectProperty"||i.shorthand===!0||i.computed===!0)continue;let n=Jn(i.key);if(n===void 0||i.value===void 0)continue;let a=Wh(i.value);a!==Wt&&(r[n]=a)}return{...r,...t}}La(_5,"buildMergedLiteral");function T5(e){let t=[];for(let r of e.properties){if(r.type!=="Property"&&r.type!=="ObjectProperty"||r.shorthand===!0||r.computed===!0)continue;let i=Jn(r.key);i!==void 0&&t.push(i)}return t}La(T5,"collectPropertyKeys");function Wh(e){let t=e.value;switch(e.type){case"StringLiteral":return typeof t=="string"?t:Wt;case"NumericLiteral":return typeof t=="number"?t:Wt;case"BooleanLiteral":return typeof t=="boolean"?t:Wt;case"NullLiteral":return null;case"ArrayExpression":return nF(e);case"ObjectExpression":return iF(e);default:return Wt}}La(Wh,"astToLiteral");function nF(e){let t=e.elements;if(!Array.isArray(t))return Wt;let r=[];for(let i of t){if(!Se(i))return Wt;let n=Wh(i);if(n===Wt)return Wt;r.push(n)}return r}La(nF,"arrayToLiteral");function iF(e){let t=e.properties;if(!Array.isArray(t))return Wt;let r={};for(let i of t){if(!Se(i)||i.type!=="Property"&&i.type!=="ObjectProperty")return Wt;let n=Jn(i.key),a=i.value;if(n===void 0||a===void 0)return Wt;let o=Wh(a);if(o===Wt)return Wt;r[n]=o}return r}La(iF,"objectToLiteral");function Jn(e){if(e===void 0)return;let t=e;if(e.type==="Identifier"&&typeof t.name=="string")return t.name;if(e.type==="StringLiteral"&&typeof t.value=="string")return t.value}La(Jn,"readKeyName");function Se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}La(Se,"isNodeShape");var gU=lc(hU(),1),iY=Object.defineProperty,Za=(e,t)=>iY(e,"name",{value:t,configurable:!0}),yU="\uFEFF",hg=65279;function aY(e,t){let r=ad(t),i=bU(e),n=gU.print(e,{quote:i,lineTerminator:r,trailingComma:!0}).code,a=vU(n,t),o=t.charCodeAt(0)===hg,s=a.charCodeAt(0)===hg;return o&&!s?`${yU}${a}`:a}Za(aY,"printFile");var oY=/^(#![^\n\r]*)((?:\r?\n)*)/;function vU(e,t){let r=t.charCodeAt(0)===hg?t.slice(1):t,i=oY.exec(r);if(i===null)return e;let n=i[1],a=i[2]??"";if(n===void 0)return e;let o=Za(d=>d!==""&&a===""?ad(t):a,"separatorOrFloor"),s=e.charCodeAt(0)===hg,l=s?yU:"",m=s?e.slice(1):e;if(m.startsWith(n)){let d=m.slice(n.length).replace(/^(?:\r?\n)*/,"");return`${l}${n}${o(d)}${d}`}return m.startsWith("#!")?e:`${l}${n}${o(m)}${m}`}Za(vU,"restoreShebangPrefix");function ad(e){return e.includes(`\r
576
+ `),n}Pr(OL,"formatCustomCodeForInsertion");function $L(e){try{let t=function(n){n.kind===Ma.SyntaxKind.Unknown&&i.push("Unknown node found in AST - possible parse error"),Ma.forEachChild(n,t)};Pr(t,"visit");let r=Ri(e),i=[];return t(r),i.length>0?{valid:!1,errors:i}:{valid:!0}}catch(t){return{valid:!1,errors:[Ke(t)]}}}Pr($L,"validateModifiedFile");import*as Ve from"typescript";var Uu=c.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),d5=c.object({name:c.string(),type:Uu,ttl:c.number().optional(),value:c.string(),priority:c.number().optional(),weight:c.number().optional(),port:c.number().optional()}).strict(),p5=c.object({subdomain:c.string(),targetAccount:c.string(),auto:c.boolean()}).strict(),m5=c.object({domainName:c.string(),subjectAlternativeNames:c.array(c.string())}).strict(),xfe=c.object({origin:c.string(),ttl:c.number(),records:c.array(d5),delegations:c.array(p5),certificates:c.array(m5)}).strict(),hn=Object.freeze({ORIGIN:"$ORIGIN",TTL:"$TTL",FJALL_DELEGATE:"$FJALL-DELEGATE",FJALL_CERT:"$FJALL-CERT"}),jL="ALIAS ";var ML=c.discriminatedUnion("kind",[c.object({kind:c.literal("ecs"),appName:c.string(),computeName:c.string().min(1).optional()}).strict(),c.object({kind:c.literal("cdn"),appName:c.string(),cdnName:c.string().min(1).optional()}).strict(),c.object({kind:c.literal("bucket"),appName:c.string(),bucketName:c.string()}).strict(),c.object({kind:c.literal("custom"),dnsName:c.string(),hostedZoneId:c.string()}).strict()]),LL=ML.options.map(e=>e.shape.kind.value),kT=c.enum(["A","AAAA"]),NT=c.enum(["route53","external-delegated","external-records"]),FL=c.enum(["zone","full"]),Bh=c.string().regex(/^[A-Za-z][A-Za-z0-9]*$/),f5=c.object({kind:c.literal("standard"),type:c.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),name:c.string(),value:c.union([c.string(),c.array(c.string())]),ttl:c.number().int().positive().optional(),id:Bh.optional()}).strict(),h5=c.object({kind:c.literal("alias"),type:kT,name:c.string(),target:ML,id:Bh.optional()}).strict(),g5=c.discriminatedUnion("kind",[f5,h5]),y5=c.object({domainName:c.string(),subjectAlternativeNames:c.array(c.string()).optional(),transparencyLogging:c.boolean().optional(),cloudFront:c.boolean().optional()}).strict(),v5=c.object({subdomain:c.string(),toAccount:c.string(),auto:c.boolean().optional()}).strict(),wT=c.enum(["indexed","stable"]),Cfe=c.object({zoneName:c.string(),registrar:NT,recordIds:wT.optional(),hostedZoneId:c.string().optional(),delegatedSubdomain:c.string().optional(),adoptedNameServers:c.array(c.string().min(1)).min(1).optional(),records:c.array(g5),certificates:c.array(y5),delegations:c.array(v5)}).strict().refine(e=>e.registrar!=="external-delegated"||e.delegatedSubdomain!==void 0,{message:"external-delegated requires delegatedSubdomain"}).refine(e=>e.registrar!=="external-records"||e.delegations.length===0,{message:"external-records forbids delegations"}).refine(e=>e.registrar==="external-delegated"||e.adoptedNameServers===void 0,{message:"adoptedNameServers requires registrar external-delegated"}).refine(e=>e.registrar!=="external-delegated"||e.hostedZoneId===void 0==(e.adoptedNameServers===void 0),{message:"external-delegated adoption requires hostedZoneId and adoptedNameServers together (both-or-neither)"});var b5=Object.defineProperty,Je=(e,t)=>b5(e,"name",{value:t,configurable:!0}),BL=NT.options,UL=FL.options,zL=wT.options,S5=Uu.options,E5=kT.options;function RT(e){let t=[],r=Je(n=>{if(Ve.isNewExpression(n)&&GL(n.expression)){let a=VL(n);a!==void 0&&t.push(a)}Ve.forEachChild(n,r)},"visit");if(r(e),t.length===0)return K(void 0);if(t.length>1)return j(new Error(`Expected exactly one 'new Domain(...)' call per infrastructure file, found ${t.length}`));let i=t[0];return i?K(i):K(void 0)}Je(RT,"findDomainConstructCall");function GL(e){return Ve.isIdentifier(e)&&e.text==="Domain"}Je(GL,"isDomainIdentifier");function VL(e){let t=e.arguments;if(!t||t.length<3)return;let r=t[0],i=t[1],n=t[2];if(!r||!i||!n||!Ve.isObjectLiteralExpression(n))return;let a=WL(e);if(a===void 0)return;let o=KL(e),s=Ve.isStringLiteral(i)?i.text:void 0;return{callExpression:e,containingStatement:a,propsObjectLiteral:n,domainVarId:o,scopeArgumentText:r.getText(),constructIdLiteral:s}}Je(VL,"buildMatch");function WL(e){let t=e;for(;t!==void 0;){if(Ve.isExpressionStatement(t)||Ve.isVariableStatement(t))return t;t=t.parent}}Je(WL,"findContainingTopLevelStatement");function KL(e){let t=e.parent;for(;t!==void 0;){if(Ve.isVariableDeclaration(t)&&Ve.isIdentifier(t.name)&&t.initializer===e)return t.name.text;t=t.parent}}Je(KL,"extractDomainVarId");function ZL(e){switch(e.kind){case"registrar_required":return"'registrar' property is required";case"registrar_unsupported":return`'registrar' must be one of ${BL.join(", ")}, got ${JSON.stringify(e.value)}`;case"missing_field":return`'${e.field}' property is required`;case"invalid_literal":return`'${e.field}' ${e.reason}`;case"removed_field":return`'${e.field}' was removed from the Domain API \u2014 ${e.cure}`}}Je(ZL,"errorMessage");var A5="declare the delegated child as its own Domain with registrar: 'external-delegated' and set 'parentDelegationRoleArn' (the CLI injects it via ManagedDomainBinding.delegationRoleArn); the child UPSERTs its NS records into the parent zone";function OT(e){let t=ye(e),r=se(t.registrar,BL);if(r===void 0){let l=t.registrar;if(l===void 0)return j({kind:"registrar_required"});let m=typeof l=="string"?l:Vh(l);return j({kind:"registrar_unsupported",value:m})}let i=w(t.zoneName);if(i===void 0)return j({kind:"missing_field",field:"zoneName"});let n=se(t.recordIds,zL);if(t.recordIds!==void 0&&n===void 0)return j({kind:"invalid_literal",field:"recordIds",reason:`must be one of ${zL.map(l=>`'${l}'`).join(", ")}`});let a=XL(t.records);if(!a.success)return a;let o=tF(t.certificates);if(!o.success)return o;if(t.delegations!==void 0)return j({kind:"removed_field",field:"delegations",cure:A5});let s={zoneName:i,recordIds:n,description:w(t.description),costAllocationEnvironment:w(t.costAllocationEnvironment),tags:rF(t.tags),records:a.data,certificates:o.data};switch(r){case"route53":return K({...s,registrar:r,hostedZoneId:w(t.hostedZoneId)});case"external-delegated":{let l=w(t.delegatedSubdomain);if(l===void 0)return j({kind:"missing_field",field:"delegatedSubdomain"});let m=w(t.hostedZoneId);if(t.hostedZoneId!==void 0&&m===void 0)return j({kind:"invalid_literal",field:"hostedZoneId",reason:"must be a literal string zone id on external-delegated \u2014 dynamic expressions cannot be round-tripped"});let d=He(t.adoptedNameServers);if(t.adoptedNameServers!==void 0&&d===void 0)return j({kind:"invalid_literal",field:"adoptedNameServers",reason:"must be an array of literal NS hostname strings \u2014 the parent NS UPSERT writes them verbatim"});if(m===void 0!=(d===void 0))return j({kind:"invalid_literal",field:m===void 0?"hostedZoneId":"adoptedNameServers",reason:"adopting an existing child zone requires hostedZoneId and adoptedNameServers together (both-or-neither) \u2014 an imported zone exposes no name-server attribute at synth"});let h=w(t.parentDelegationRoleArn);if(t.parentDelegationRoleArn!==void 0&&h===void 0)return j({kind:"invalid_literal",field:"parentDelegationRoleArn",reason:"must be a literal string ARN (VD2-a) \u2014 the CLI injects it via ManagedDomainBinding.delegationRoleArn; dynamic expressions such as Fn.importValue are not supported"});let g=se(t.phase,UL);return t.phase!==void 0&&g===void 0?j({kind:"invalid_literal",field:"phase",reason:`must be one of ${UL.map(u=>`'${u}'`).join(", ")}`}):K({...s,registrar:r,delegatedSubdomain:l,hostedZoneId:m,adoptedNameServers:d,parentDelegationRoleArn:h,phase:g})}case"external-records":return K({...s,registrar:r})}}Je(OT,"parseDomainProps");function HL(e){return ZL(e)}Je(HL,"parseDomainErrorMessage");function JL(e,t,r){let i=Ve.createSourceFile(t,e,Ve.ScriptTarget.Latest,!0,Ve.ScriptKind.TS),n=RT(i);if(!n.success)return j(new Error(n.error.message));if(n.data===void 0)return j(new Error(`Domain '${r}': no 'new Domain(...)' call found in ${t} \u2014 the file is not a Fjall domain component.`));let a=OT(n.data.propsObjectLiteral);return a.success?K(a.data):j(new Error(`Domain '${r}': infrastructure.ts could not be parsed (${a.error.kind}).`))}Je(JL,"parseDomainInfrastructureSource");function XL(e){if(e===void 0)return K([]);if(!Array.isArray(e))return j({kind:"invalid_literal",field:"records",reason:"must be an array"});let t=[];for(let r=0;r<e.length;r++){let i=e[r];if(!Z(i))return j({kind:"invalid_literal",field:`records[${r}]`,reason:"must be an object literal"});let n=qL(i,r);if(!n.success)return n;t.push(n.data)}return K(t)}Je(XL,"parseRecordsArray");function qL(e,t){let r=w(e.type),i=w(e.name);if(r===void 0)return j({kind:"missing_field",field:`records[${t}].type`});if(i===void 0)return j({kind:"missing_field",field:`records[${t}].name`});let n=w(e.id);if(e.id!==void 0&&(n===void 0||!Bh.safeParse(n).success))return j({kind:"invalid_literal",field:`records[${t}].id`,reason:"must be a literal alphanumeric string starting with a letter \u2014 it becomes a CloudFormation logical-ID segment"});if(e.target!==void 0){if(!E5.some(m=>m===r))return j({kind:"invalid_literal",field:`records[${t}]`,reason:`alias records must have type 'A' or 'AAAA', got '${r}'`});let l=QL(e.target);return K({kind:"alias",type:r,name:i,target:l,...n!==void 0?{id:n}:{}})}if(!S5.some(l=>l===r))return j({kind:"invalid_literal",field:`records[${t}]`,reason:`unsupported record type '${r}'`});let a=YL(e.value);if(a===void 0)return j({kind:"invalid_literal",field:`records[${t}].value`,reason:`must be a string or array of strings (got ${JSON.stringify(e.value)})`});let o=W(e.ttl),s={kind:"standard",type:r,name:i,value:a,...o!==void 0?{ttl:o}:{},...n!==void 0?{id:n}:{}};return K(s)}Je(qL,"parseRecord");function YL(e){if(e===void 0)return;if(typeof e=="string")return e;let t=He(e);if(t!==void 0)return t}Je(YL,"parseRecordValue");function QL(e){if(Kr(e))return eF(e);if(Z(e)){let t=se(e.kind,LL);if(t==="ecs"||t==="cdn"){let r=w(e.appName);if(r!==void 0)return{kind:t,appName:r}}if(t==="bucket"){let r=w(e.appName),i=w(e.bucketName);if(r!==void 0&&i!==void 0)return{kind:t,appName:r,bucketName:i}}if(t==="custom"){let r=w(e.dnsName),i=w(e.hostedZoneId);if(r!==void 0&&i!==void 0)return{kind:t,dnsName:r,hostedZoneId:i}}}return{kind:"unresolved",sourceText:Vh(e)}}Je(QL,"parseTarget");function eF(e){let t=e.__call.trim(),r=t.match(/^([A-Za-z_][\w$]*)\s*\(([\s\S]*)\)\s*$/);if(!r)return{kind:"unresolved",sourceText:t};let i=r[1],n=r[2]??"",a=Gh(n);switch(i){case"fjallApp":{let o=gn(a,0);if(o===void 0)return{kind:"dynamic",sourceText:t};if(a.length<2)return{kind:"ecs",appName:o};let s=gn(a,1);return s===void 0?{kind:"dynamic",sourceText:t}:{kind:"ecs",appName:o,computeName:s}}case"fjallCdn":{let o=gn(a,0);if(o===void 0)return{kind:"dynamic",sourceText:t};if(a.length<2)return{kind:"cdn",appName:o};let s=gn(a,1);return s===void 0?{kind:"dynamic",sourceText:t}:{kind:"cdn",appName:o,cdnName:s}}case"fjallBucket":{if(a.length<2)return{kind:"unresolved",sourceText:t};let o=gn(a,0),s=gn(a,1);return o===void 0||s===void 0?{kind:"dynamic",sourceText:t}:{kind:"bucket",appName:o,bucketName:s}}case"aliasTo":{if(a.length>=2){let o=gn(a,0),s=gn(a,1);return o!==void 0&&s!==void 0?{kind:"custom",dnsName:o,hostedZoneId:s}:{kind:"dynamic",sourceText:t}}if(a.length===1){let o=a[0]?.trim()??"",s=PT(o,"dnsName"),l=PT(o,"hostedZoneId");return s!==void 0&&l!==void 0?{kind:"custom",dnsName:s,hostedZoneId:l}:{kind:"dynamic",sourceText:t}}return{kind:"unresolved",sourceText:t}}default:return{kind:"unresolved",sourceText:t}}}Je(eF,"resolveCallRefTarget");function Gh(e){let t=[],r=0,i=null,n="";for(let o=0;o<e.length;o++){let s=e[o];if(i!==null){if(n+=s,s==="\\"&&o+1<e.length){let l=e[o+1];l!==void 0&&(n+=l,o+=1);continue}s===i&&(i=null);continue}if(s==='"'||s==="'"||s==="`"){i=s,n+=s;continue}if(s==="("||s==="{"||s==="["){r+=1,n+=s;continue}if(s===")"||s==="}"||s==="]"){r-=1,n+=s;continue}if(s===","&&r===0){t.push(n.trim()),n="";continue}n+=s}let a=n.trim();return a.length>0&&t.push(a),t}Je(Gh,"splitTopLevelArgs");function gn(e,t){let r=e[t];if(r===void 0)return;let i=r.trim();if(i.length<2)return;let n=i[0],a=i[i.length-1];if(n===a&&!(n!=='"'&&n!=="'"&&n!=="`"))return i.slice(1,-1)}Je(gn,"extractStringLiteralArg");function PT(e,t){let r=e.trim().replace(/^\{|\}$/g,""),i=Gh(r);for(let n of i){let a=n.indexOf(":");if(a<0||n.slice(0,a).trim().replace(/["'`]/g,"")!==t)continue;let o=n.slice(a+1).trim();return gn([o],0)}}Je(PT,"extractObjectFieldString");function tF(e){if(e===void 0)return K([]);if(!Array.isArray(e))return j({kind:"invalid_literal",field:"certificates",reason:"must be an array"});let t=[];for(let r=0;r<e.length;r++){let i=e[r];if(typeof i=="string"){t.push({domainName:i});continue}if(!Z(i))return j({kind:"invalid_literal",field:`certificates[${r}]`,reason:"must be a string or object literal"});let n=w(i.domainName);if(n===void 0)return j({kind:"missing_field",field:`certificates[${r}].domainName`});let a=He(i.subjectAlternativeNames),o=oe(i.transparencyLogging),s=oe(i.cloudFront);if(i.cloudFront!==void 0&&s===void 0)return j({kind:"invalid_literal",field:`certificates[${r}].cloudFront`,reason:"must be a boolean literal \u2014 the CloudFront designation drives the zone-level us-east-1 export contract and cannot be round-tripped from a dynamic expression"});t.push({domainName:n,...a!==void 0?{subjectAlternativeNames:a}:{},...o!==void 0?{transparencyLogging:o}:{},...s!==void 0?{cloudFront:s}:{}})}return K(t)}Je(tF,"parseCertificatesArray");function rF(e){if(e===void 0||!Z(e))return;let t={};for(let[r,i]of Object.entries(e)){let n=w(i);n!==void 0&&(t[r]=n)}return Object.keys(t).length===0?void 0:t}Je(rF,"parseStringRecord");function Vh(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return`[${e.map(t=>Vh(t)).join(", ")}]`;if(typeof e=="object"){if("__call"in e)return String(e.__call);if("__identifier"in e)return String(e.__identifier);if("__expression"in e)return String(e.__expression);if("__unknown"in e)return String(e.__unknown)}return String(e)}Je(Vh,"stringifyParsedValue");var Sg=lc(Ar(),1);var x5=Object.defineProperty,La=(e,t)=>x5(e,"name",{value:t,configurable:!0}),Wt=Symbol("non-literal");function _5(e,t){let r={};for(let i of e.properties){if(i.type!=="Property"&&i.type!=="ObjectProperty"||i.shorthand===!0||i.computed===!0)continue;let n=Jn(i.key);if(n===void 0||i.value===void 0)continue;let a=Wh(i.value);a!==Wt&&(r[n]=a)}return{...r,...t}}La(_5,"buildMergedLiteral");function T5(e){let t=[];for(let r of e.properties){if(r.type!=="Property"&&r.type!=="ObjectProperty"||r.shorthand===!0||r.computed===!0)continue;let i=Jn(r.key);i!==void 0&&t.push(i)}return t}La(T5,"collectPropertyKeys");function Wh(e){let t=e.value;switch(e.type){case"StringLiteral":return typeof t=="string"?t:Wt;case"NumericLiteral":return typeof t=="number"?t:Wt;case"BooleanLiteral":return typeof t=="boolean"?t:Wt;case"NullLiteral":return null;case"ArrayExpression":return nF(e);case"ObjectExpression":return iF(e);default:return Wt}}La(Wh,"astToLiteral");function nF(e){let t=e.elements;if(!Array.isArray(t))return Wt;let r=[];for(let i of t){if(!Se(i))return Wt;let n=Wh(i);if(n===Wt)return Wt;r.push(n)}return r}La(nF,"arrayToLiteral");function iF(e){let t=e.properties;if(!Array.isArray(t))return Wt;let r={};for(let i of t){if(!Se(i)||i.type!=="Property"&&i.type!=="ObjectProperty")return Wt;let n=Jn(i.key),a=i.value;if(n===void 0||a===void 0)return Wt;let o=Wh(a);if(o===Wt)return Wt;r[n]=o}return r}La(iF,"objectToLiteral");function Jn(e){if(e===void 0)return;let t=e;if(e.type==="Identifier"&&typeof t.name=="string")return t.name;if(e.type==="StringLiteral"&&typeof t.value=="string")return t.value}La(Jn,"readKeyName");function Se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}La(Se,"isNodeShape");var gU=lc(hU(),1),iY=Object.defineProperty,Za=(e,t)=>iY(e,"name",{value:t,configurable:!0}),yU="\uFEFF",hg=65279;function aY(e,t){let r=ad(t),i=bU(e),n=gU.print(e,{quote:i,lineTerminator:r,trailingComma:!0}).code,a=vU(n,t),o=t.charCodeAt(0)===hg,s=a.charCodeAt(0)===hg;return o&&!s?`${yU}${a}`:a}Za(aY,"printFile");var oY=/^(#![^\n\r]*)((?:\r?\n)*)/;function vU(e,t){let r=t.charCodeAt(0)===hg?t.slice(1):t,i=oY.exec(r);if(i===null)return e;let n=i[1],a=i[2]??"";if(n===void 0)return e;let o=Za(d=>d!==""&&a===""?ad(t):a,"separatorOrFloor"),s=e.charCodeAt(0)===hg,l=s?yU:"",m=s?e.slice(1):e;if(m.startsWith(n)){let d=m.slice(n.length).replace(/^(?:\r?\n)*/,"");return`${l}${n}${o(d)}${d}`}return m.startsWith("#!")?e:`${l}${n}${o(m)}${m}`}Za(vU,"restoreShebangPrefix");function ad(e){return e.includes(`\r
577
577
  `)?`\r
578
578
  `:`
579
579
  `}Za(ad,"detectLineTerminator");function bU(e){let t=0,r=0;return SU(e,i=>{if(i.type!=="StringLiteral"&&i.type!=="Literal")return;let n=i.extra;if(!id(n))return;let a=n.raw;if(typeof a!="string"||a.length===0)return;let o=a.charAt(0);o==="'"?t+=1:o==='"'&&(r+=1)}),t>r?"single":"double"}Za(bU,"detectQuoteStyle");function SU(e,t){let r=[e];for(;r.length>0;){let i=r.pop();if(!(!id(i)||typeof i.type!="string")){t(i);for(let n of Object.keys(i)){if(n==="loc"||n==="comments"||n==="tokens")continue;let a=i[n];if(Array.isArray(a))for(let o of a)id(o)&&typeof o.type=="string"&&r.push(o);else id(a)&&typeof a.type=="string"&&r.push(a)}}}}Za(SU,"visit");function id(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}Za(id,"isRecord");var sY=Object.defineProperty,gg=(e,t)=>sY(e,"name",{value:t,configurable:!0});function Zt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}gg(Zt,"isRecord");function cY(e){if(!Zt(e))return;let t=e.program;if(!Zt(t))return;let r=t.body;if(Array.isArray(r)&&r.every(Zt))return r}gg(cY,"extractProgramBody");function AC(e,t){return e.length===0?0:e.split(t).length}gg(AC,"countLines");function lY(e,t){let r=ad(e),i=AC(t,r)-AC(e,r);return i>=0?{added:i,removed:0}:{added:0,removed:-i}}gg(lY,"computeLinesDelta");var uY=Object.defineProperty,Xr=(e,t)=>uY(e,"name",{value:t,configurable:!0});function dY(e){let t=EU(e),r=AU(e),i=Xr(n=>t.get(n)===1?r.get(n):void 0,"initFor");return{resolveString(n){let a=i(n);return a===void 0?void 0:xC(a)},resolveStringArray(n){let a=i(n);if(a===void 0)return;let o=Li(a);if(o.type!=="ArrayExpression")return;let s=o.elements;if(!Array.isArray(s))return;let l=[];for(let m of s){if(!Se(m))return;let d=xC(m);if(d===void 0)return;l.push(d)}return l},objectKeysOf:Xr(n=>yg(n,i,new Set),"objectKeysOf")}}Xr(dY,"buildModuleConstResolver");function xC(e){let t=Li(e);if(t.type==="StringLiteral"){let r=t.value;return typeof r=="string"?r:void 0}if(t.type==="TemplateLiteral"){let r=t.expressions,i=t.quasis;if(!Array.isArray(r)||r.length!==0||!Array.isArray(i)||i.length!==1)return;let[n]=i;return!Zt(n)||!Zt(n.value)?void 0:typeof n.value.cooked=="string"?n.value.cooked:void 0}}Xr(xC,"readStaticString");var pY=new Set(["TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression","ParenthesizedExpression"]);function Li(e){let t=e;for(;pY.has(t.type);){let r=t.expression;if(!Se(r))return t;t=r}return t}Xr(Li,"unwrapTsWrappers");function yg(e,t,r){let i=Li(e);if(i.type==="Identifier"){let o=i.name;if(typeof o!="string"||r.has(o))return;r.add(o);let s=t(o);return s===void 0?void 0:yg(s,t,r)}if(i.type!=="ObjectExpression")return;let n=i.properties;if(!Array.isArray(n))return;let a=[];for(let o of n){if(!Se(o))return;if(o.type==="SpreadElement"||o.type==="SpreadProperty"){let m=o.argument;if(!Se(m))return;let d=yg(m,t,r);if(d===void 0)return;a.push(...d);continue}if(o.type!=="Property"&&o.type!=="ObjectProperty"&&o.type!=="ObjectMethod"||o.computed===!0)return;let s=o.key;if(!Se(s))return;let l=Jn(s);if(l===void 0)return;a.push(l)}return a}Xr(yg,"objectKeysOfNode");function EU(e){let t=new Map,r=Xr(a=>{t.set(a,(t.get(a)??0)+1)},"bump"),i=Xr(a=>{if(Se(a))switch(a.type){case"Identifier":{let o=a.name;typeof o=="string"&&r(o);return}case"ObjectPattern":{let o=a.properties;if(!Array.isArray(o))return;for(let s of o)Se(s)&&(s.type==="RestElement"||s.type==="RestProperty"?i(s.argument):i(s.value));return}case"ArrayPattern":{let o=a.elements;if(!Array.isArray(o))return;for(let s of o)i(s);return}case"AssignmentPattern":i(a.left);return;case"RestElement":i(a.argument);return;case"TSParameterProperty":i(a.parameter);return;default:return}},"bumpPattern"),n=Xr(a=>{let o=[a];for(;o.length>0;){let s=o.pop();if(Zt(s)){if(typeof s.type=="string"){let l=s;switch(l.type){case"VariableDeclarator":i(l.id);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":{i(l.id);let m=l.params;if(Array.isArray(m))for(let d of m)i(d);break}case"ClassDeclaration":case"ClassExpression":i(l.id);break;case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":i(l.local);break;case"CatchClause":i(l.param);break;default:break}}for(let l of Object.keys(s)){if(l==="loc"||l==="comments"||l==="tokens")continue;let m=s[l];if(Array.isArray(m))for(let d of m)Zt(d)&&o.push(d);else Zt(m)&&o.push(m)}}}},"visitForBindings");for(let a of e)n(a);return t}Xr(EU,"countBindings");function AU(e){let t=new Map;for(let r of e){let i=r.type==="ExportNamedDeclaration"?r.declaration:r;if(!Se(i)||i.type!=="VariableDeclaration"||i.kind!=="const")continue;let n=i.declarations;if(Array.isArray(n))for(let a of n){if(!Se(a)||a.type!=="VariableDeclarator")continue;let o=a.id,s=a.init;if(!Se(o)||o.type!=="Identifier"||!Se(s))continue;let l=o.name;typeof l=="string"&&t.set(l,s)}}return t}Xr(AU,"collectTopLevelConstInits");var mY=Object.defineProperty,vg=(e,t)=>mY(e,"name",{value:t,configurable:!0});function fY(e,t){return e.properties.find(r=>(r.type==="Property"||r.type==="ObjectProperty")&&r.shorthand!==!0&&r.computed!==!0&&Jn(r.key)===t)}vg(fY,"findPropertyByKey");function hY(e,t){return!e.properties.some(r=>r.type==="SpreadElement"||r.type==="SpreadProperty"?!0:r.type!=="Property"&&r.type!=="ObjectProperty"?!1:r.computed===!0?!0:r.shorthand===!0&&Jn(r.key)===t)}vg(hY,"objectAbsenceIsProvable");function gY(e,t){e.properties[e.properties.length-1]?.extra?.trailingComma===!0&&(t.extra={...t.extra??{},trailingComma:!0}),e.properties.push(t)}vg(gY,"pushPropertyPreservingComma");function bg(e,t){let r=[e];for(;r.length>0;){let i=r.pop();if(Zt(i)){typeof i.type=="string"&&t(i);for(let n of Object.keys(i)){if(n==="loc"||n==="comments"||n==="tokens")continue;let a=i[n];if(Array.isArray(a))for(let o of a)Zt(o)&&r.push(o);else Zt(a)&&r.push(a)}}}}vg(bg,"visit");var yY=Object.defineProperty,Ha=(e,t)=>yY(e,"name",{value:t,configurable:!0});function TC(e,t,r){let i=[];for(let d=0;d<e.length;d++){let h=e[d];if(h===void 0)continue;let g=!1;bg(h,u=>{u.type==="CallExpression"&&Eg(u,t.factory,r)&&(g=!0)}),g&&i.push({statementIndex:d})}if(i.length===0)return j({kind:"statement-not-found"});if(i.length>1)return j({kind:"ambiguous",count:i.length});let n=i[0];if(n===void 0)return j({kind:"statement-not-found"});let a=e[n.statementIndex];if(a===void 0)return j({kind:"statement-not-found"});let o=a.type==="ExportNamedDeclaration"||a.type==="ExportDefaultDeclaration",s=CC(a);if(s===void 0)return j({kind:"unbindable-statement",statementType:a.type});if(s.type==="VariableDeclaration"){let d=s.declarations;if(!Array.isArray(d)||d.length!==1)return j({kind:"multiple-declarators"});let h=d[0].id;if(!Se(h)||h.type!=="Identifier")return j({kind:"pattern-binding"});let g=h.name;if(typeof g!="string")return j({kind:"unreadable-name"});let u=d[0].init;return!Se(u)||!_C(u,t,r)?j({kind:"init-not-app-method-wrap"}):K({variableName:g,resourceName:r,statementIndex:n.statementIndex})}if(o)return j({kind:"unbindable-statement",statementType:a.type});if(s.type!=="ExpressionStatement")return j({kind:"unbindable-statement",statementType:s.type});let l=s.expression;if(!Se(l)||l.type!=="CallExpression")return j({kind:"not-app-method-call"});if(Eg(l,t.factory,r))return j({kind:"bare-factory-call"});if(!_C(l,t,r))return j({kind:"foreign-wrapper"});let m=Sr(r);return _i.has(m)?j({kind:"reserved-word",variableName:m}):_U(e,m)?j({kind:"name-conflict",variableName:m}):K({variableName:m,resourceName:r,statementIndex:n.statementIndex,wrap:{statementIndex:n.statementIndex,expression:l}})}Ha(TC,"planBinding");function vY(e,t){if(t.wrap===void 0)return;let{statementIndex:r,expression:i}=t.wrap,n=e[r],a=Sg.builders.variableDeclaration("const",[Sg.builders.variableDeclarator(Sg.builders.identifier(t.variableName),i)]),o=n?.comments;o!==void 0&&(a.comments=o),e[r]=a}Ha(vY,"applyBinding");function Eg(e,t,r){let i=e.callee;if(!Se(i)||i.type!=="MemberExpression"||i.computed===!0)return!1;let n=i.object,a=i.property;if(!Se(n)||n.type!=="Identifier"||n.name!==t||!Se(a)||a.type!=="Identifier"||a.name!=="build")return!1;let o=e.arguments;if(!Array.isArray(o))return!1;let s=o[0];return!Se(s)||s.type!=="StringLiteral"&&s.type!=="Literal"?!1:s.value===r}Ha(Eg,"isFactoryBuildOf");function CC(e){if(e.type!=="ExportNamedDeclaration"&&e.type!=="ExportDefaultDeclaration")return e;let t=e.declaration;return Se(t)?t:void 0}Ha(CC,"unwrapExportDeclaration");function xU(e){let t=Li(e);if(t.type!=="CallExpression")return;let r=t.callee;if(!Se(r)||r.type!=="MemberExpression"||r.computed===!0)return;let i=r.property;if(!Se(i)||i.type!=="Identifier")return;let n=i.name;return typeof n=="string"?n:void 0}Ha(xU,"appMethodNameOf");function _C(e,t,r){let i=Li(e);if(xU(i)!==t.appMethod)return!1;let n=i.arguments;if(!Array.isArray(n))return!1;let a=n[0];return Se(a)?Eg(Li(a),t.factory,r):!1}Ha(_C,"isAppMethodWrap");function _U(e,t){for(let r of e){let i=CC(r);if(i!==void 0){if(i.type==="ImportDeclaration"){let n=i.specifiers;if(!Array.isArray(n))continue;for(let a of n){let o=a.local;if(Se(o)&&o.name===t)return!0}continue}if(i.type==="VariableDeclaration"){let n=i.declarations;if(!Array.isArray(n))continue;for(let a of n){if(!Se(a))continue;let o=a.id;if(!Se(o))continue;let s=!1;if(bg(o,l=>{l.type==="Identifier"&&l.name===t&&(s=!0)}),s)return!0}continue}if(i.type==="FunctionDeclaration"||i.type==="ClassDeclaration"){let n=i.id;if(Se(n)&&n.name===t)return!0}}}return!1}Ha(_U,"moduleScopeDeclares");var bY=Object.defineProperty,ac=(e,t)=>bY(e,"name",{value:t,configurable:!0}),SY={cdn:{default:["storage","compute"]},compute:{perKey:{connectedDatabase:["database"],connectedStorage:["storage"],connectedMessaging:["messaging"]}}};function EY(e,t,r={}){let i=SY[e],n=[],a=ac((o,s)=>{let l=t();if(l===void 0)return;let m=(s!==void 0?i?.perKey?.[s]:void 0)??i?.default??[],d=[];for(let u of m){let p=Vn[u].emitWrapper?.appMethod;if(p===void 0)continue;let f=TC(l,{factory:zt[u],appMethod:p},o);if(f.success){d.push(f.data);continue}if(f.error.kind!=="statement-not-found")return}if(d.length!==1)return;let h=d[0];if(h===void 0)return;let g=r.mustPrecedeStatementIndex;if(!(g!==void 0&&h.statementIndex>=g))return h.wrap!==void 0&&n.push({plan:h,...s!==void 0&&{planKey:s}}),h.variableName},"resolveBinding");return{resolveBinding:a,resolveBindings:ac((o,s)=>{let l=n.length,m=[];for(let d of o){let h=a(d,s);if(h===void 0){n.length=l;return}m.push(h)}return m},"resolveBindings"),takePendingWraps:ac(()=>{let o=n;return n=[],o.map(s=>s.plan)},"takePendingWraps"),pendingDeclarations:ac(()=>n.map(({plan:o,planKey:s})=>({variableName:o.variableName,resourceName:o.resourceName,statementIndex:o.statementIndex,...s!==void 0&&{planKey:s}})),"pendingDeclarations")}}ac(EY,"createSiblingBindingResolution");function DC(e){let t=new Map;for(let r of e){let i=t.get(r.variableName);if(i===void 0){t.set(r.variableName,r);continue}if(i.statementIndex!==r.statementIndex)return{first:i,second:r}}}ac(DC,"findPendingWrapCollision");var AY=Object.defineProperty,jr=(e,t)=>AY(e,"name",{value:t,configurable:!0});function TU(e){return e?.map(t=>({name:t.name,...t.serviceType!==void 0&&{serviceType:t.serviceType},...t.docker!==void 0&&{docker:t.docker},...t.containerPort!==void 0&&{containerPort:t.containerPort},...t.needsDatabaseConnection!==void 0&&{needsDatabaseConnection:t.needsDatabaseConnection},...t.routing!==void 0&&{routing:t.routing}}))}jr(TU,"toUserServiceConfigs");function CU(e,t,r=!0,i,n){let a={appName:e,type:t,database:[],s3:[],compute:[]};if(t==="custom")return a;let o=t,s=Wn[o];return{...a,database:DU(e,s,o,r,n),compute:wU(e,s,o,r,i),network:s.network,backup:s.backup}}jr(CU,"planApplicationResources");function DU(e,t,r,i,n){let a=$0(r),o=t.database[a];return!i||o===null?[]:[{name:e,type:a,databaseName:to(e),variableName:`${Sr(e)}Database`,...o,...n?.snapshotIdentifier!==void 0&&{snapshotIdentifier:n.snapshotIdentifier},...n?.snapshotUsername!==void 0&&{snapshotUsername:n.snapshotUsername}}]}jr(DU,"buildDatabasePlan");function IU(e,t){if(!(e===void 0&&t===void 0))return{scaling:{...e!==void 0&&{minCapacity:e},...t!==void 0&&{maxCapacity:t}}}}jr(IU,"buildScalingConfig");function IC(e){let{minCapacity:t,maxCapacity:r,...i}=e;return{...i,...IU(t,r)}}jr(IC,"planServiceFromTierPreset");function kU(e,t){let r=IC(e),i=t?.serviceType==="worker",n=t?.containerPort??SO,a=t?.docker;return{...r,...a?.path!==void 0&&{docker:{path:a.path,...a.context!==void 0&&{context:a.context},...a.target!==void 0&&{target:a.target}}},...t?.needsDatabaseConnection!==void 0&&{needsDatabaseConnection:t.needsDatabaseConnection},...i&&{serviceType:"worker"},containers:i?[{}]:[{port:n}]}}jr(kU,"buildServiceEntry");function NU(e,t){return t||e?.directAccess===!0?e:{...e,loadBalancer:!1}}jr(NU,"resolveClusterConfig");function wU(e,t,r,i,n){let a=t.compute.ecs,o=(n&&n.length>0?j0(r,n):a.services.map((l,m)=>({...l,name:m===0?"api":`service-${m+1}`}))).map((l,m)=>kU(l,n?.[m])),s=o.some(l=>l.containers?.some(m=>m.port!==void 0));return[{name:e,type:Cl.ECS,needsConnection:i,connectedDatabase:i?[e]:void 0,variableName:`${Sr(e)}Compute`,cluster:NU(a.cluster,s),services:o}]}jr(wU,"buildComputePlan");function PU(e){let t=[],r=0,i=jr((a,o,s)=>{t.push({variableName:a,resourceName:o,statementIndex:r++,planKey:s})},"declare");for(let a of e.additionalNetworks??[])i(Sr(a.name),a.name,"additionalNetworks");if(ks(e))return t;for(let a of e.database)su(a,e)&&i(we(a),a.name,"database");for(let a of e.clickhouse??[])cu(a,e)&&i(we(a),a.name,"clickhouse");for(let a of e.s3)bu(a,e)&&i(we(a),a.name,"s3");for(let a of e.dynamodb??[])i(we(a),a.name,"dynamodb");for(let a of e.sqs??[])Su(a,e)&&i(we(a),a.name,"sqs");let n=Cu(e);for(let a of e.compute)(n.has(a.name)||a.scheduleExpression!==void 0)&&i(we(a),a.name,"compute");return t}jr(PU,"collectPlannedDeclarations");function RU(e){let t=[],r=/^const\s+([A-Za-z_$][A-Za-z0-9_$]*)\s*=/gm,i=Tu(e),n=-1,a;for(;(a=r.exec(i))!==null;){let o=a[1];o!==void 0&&t.push({variableName:o,resourceName:o,statementIndex:n--,planKey:"prelude"})}return t}jr(RU,"collectPreludeDeclarations");function Ag(e,t){let r=PU(e),i=r.find(s=>_i.has(s.variableName));if(i!==void 0)return j(new Error(`Cannot generate infrastructure: ${i.planKey} resource "${i.resourceName}" binds the module-scope const \`${i.variableName}\`, a JavaScript reserved word \u2014 the generated file would not parse. Rename the resource, or give it a distinct variableName in the plan.`));let n=DC([...RU(e),...r]);if(n!==void 0)return n.first.planKey==="prelude"?j(new Error(`Cannot generate infrastructure: ${n.second.planKey} resource "${n.second.resourceName}" binds the module-scope const \`${n.first.variableName}\`, which the scaffold prelude itself declares \u2014 the generated file would not compile (Identifier '${n.first.variableName}' has already been declared). Rename the resource, or give it a distinct variableName in the plan.`)):j(new Error(`Cannot generate infrastructure: ${n.first.planKey} resource "${n.first.resourceName}" and ${n.second.planKey} resource "${n.second.resourceName}" both bind the module-scope const \`${n.first.variableName}\` \u2014 the generated file would not compile (Identifier '${n.first.variableName}' has already been declared). Rename one of the resources, or give one a distinct variableName in the plan.`));if(!ks(e)){let s=gh(e);if(s!==void 0)return j(new Error(`Cannot generate infrastructure: compute resource "${s.resourceName}" key \`${s.key}\` cannot be emitted \u2014 ${s.reason}`))}let a=[Ah(e),Tu(e),Eh(e)];if(ks(e))a.push(Au(e),_u(e));else{let s=Cu(e);a.push(_u(e),oh(e),sh(e),vh(e),bh(e),Sh(e),yh(e,s),xh(e))}let o=a.join("");if(e.customCodeBlocks&&e.customCodeBlocks.length>0){let s=zh(o,e.customCodeBlocks,t?.resourceMapping);return s.success?K(s.content):j(new Error(`Custom code injection failed: ${s.error??"unknown error"}`))}return K(o)}jr(Ag,"generateInfrastructureFromPlan");var xY=Object.defineProperty,oc=(e,t)=>xY(e,"name",{value:t,configurable:!0}),_Y=O0("standard");function OU(e){return Bl.options.some(t=>t.shape?.type?.value===e)}oc(OU,"isPatternConfigType");function $U(e,t,r){let{tier:i="standard",domain:n,database:a,compute:o,cdn:s,environment:l,tags:m}=r??{},d=Th(i);if(!d&&i!=="custom")return j(new Error(`Invalid pattern tier: "${i}". Valid tiers are: ${[...Iu,"custom"].join(", ")}`));if(!OU(t))return j(new Error(`Unsupported pattern type: ${t}`));let h=d?_h(i):null,g=FU(t,e,{domain:n,database:a,compute:o,cdn:s,environment:l,tierPreset:h});if(!g.success)return g;let u=g.data;return K({appName:e,type:"standard",pattern:t,network:h?h.network:_Y,backup:h?h.backup:!1,patternConfig:u,database:[],s3:[],compute:[],tags:m??{}})}oc($U,"planOpenNextResources");function jU(e,t){return{type:e?.type??t.database.type,instanceType:e?.instanceType??t.database.instanceType,backupRetention:e?.backupRetention??t.database.backupRetention,deletionProtection:e?.deletionProtection??t.database.deletionProtection,...e?.databaseName!==void 0&&{databaseName:e.databaseName},...e?.publiclyAccessible!==void 0&&{publiclyAccessible:e.publiclyAccessible},...e?.allowedIpCidr!==void 0&&{allowedIpCidr:e.allowedIpCidr},...e?.encryption!==void 0&&{encryption:e.encryption}}}oc(jU,"mergeDatabaseConfig");function MU(e,t){return{memorySize:e?.memorySize??t.compute.memorySize,timeout:e?.timeout??t.compute.timeout}}oc(MU,"mergeComputeConfig");function LU(e){let{encryption:t,...r}=e;return{...r,...t&&{encryption:{storageKey:t}}}}oc(LU,"toPatternDatabaseConfig");function FU(e,t,r){let{domain:i,database:n,compute:a,cdn:o,environment:s,tierPreset:l}=r,m=l?jU(n,l):n,d=l?MU(a,l):a,h={type:e,name:t,domain:i,database:m?LU(m):void 0,compute:d?{server:d}:void 0,cdn:o?{domainNames:o.domainNames,certificateArn:o.certificateArn}:void 0,environment:s},g=Bl.safeParse(h);return g.success?K(g.data):j(new Error(`Invalid pattern config: ${g.error.message}`))}oc(FU,"buildPatternConfig");var TY=Object.defineProperty,CY=(e,t)=>TY(e,"name",{value:t,configurable:!0});function UU(e,t){let r={type:"staticsite",name:e,source:t.source,build:t.build,...t.routing!==void 0&&{routing:t.routing},...t.security!==void 0&&{security:t.security},...t.domain!==void 0&&{domain:t.domain},...t.forms!==void 0&&{forms:t.forms},...t.cdn!==void 0&&{cdn:t.cdn}},i=zl.safeParse(r);return i.success?K({appName:e,type:"standard",pattern:"staticsite",patternConfig:i.data,database:[],s3:[],compute:[],tags:t.tags??{}}):j(new Error(`Invalid static-site pattern config: ${i.error.message}`))}CY(UU,"planStaticSiteResources");var DY=Object.defineProperty,xg=(e,t)=>DY(e,"name",{value:t,configurable:!0});function zU(e){let t=e.split("/");if(t.length!==2||!t[0]||!t[1])throw new Error(`Invalid service reference format: '${e}'. Expected 'ClusterName/ServiceName'.`);return t[0]}xg(zU,"parseServiceReference");function kC(e,t,r){r==="database"?(e.needsConnection=!0,e.connectedDatabase=[...new Set([...e.connectedDatabase??[],t])]):e.connectedStorage=[...new Set([...e.connectedStorage??[],t])]}xg(kC,"addResourceConnection");function _g(e,t,r,i){let n=new Set(t),a=[...new Set(t.map(zU))];for(let o of a){let s=e.compute.find(l=>l.name===o);if(s?.services){kC(s,r,i);for(let l of s.services){let m=`${o}/${l.name}`;n.has(m)&&(i==="database"?l.needsDatabaseConnection=!0:l.needsStorageConnection=!0)}}}}xg(_g,"applyServiceConnections");function Tg(e,t,r,i){for(let n of e.compute)if(t.includes(n.name)&&(kC(n,r,i),n.services))for(let a of n.services)i==="database"?a.needsDatabaseConnection=!0:a.needsStorageConnection=!0}xg(Tg,"applyComputeConnections");var IY=Object.defineProperty,at=(e,t)=>IY(e,"name",{value:t,configurable:!0});function BU(e){let t=e.database.length>0,r=e.cdn!==void 0;return[{type:"database",label:"Database (RDS)",available:!0},{type:"database:proxy",label:"RDS Proxy",available:t,reason:t?void 0:"Requires at least one database"},{type:"storage:s3",label:"S3 Bucket",available:!0},{type:"network",label:"Network (VPC)",available:!0},{type:"compute:ecs",label:"Compute (ECS)",available:!0},{type:"compute:lambda",label:"Compute (Lambda)",available:!0},{type:"cdn",label:"CDN (CloudFront)",available:!r,reason:r?"A CDN is already configured. Remove existing CDN first.":void 0},{type:"tunnel",label:"Database Tunnel",available:t&&!e.tunnel,reason:t?e.tunnel?"Tunnel is already enabled":void 0:"Requires at least one database"}]}at(BU,"listAvailableResources");function od(e,t){if(wC(e,t.resourceName))return j(new Error(PC(t.resourceName)));switch(t.type){case"database":return GU(e,t);case"database:proxy":return VU(e,t);case"storage:s3":return K(void 0);case"network":return K(void 0);case"compute:ecs":return!t.services||t.services.length===0?j(new Error("ECS compute requires at least one service.")):K(void 0);case"compute:lambda":return K(void 0);case"cdn":return WU(e,t);case"tunnel":return KU(e);default:{let r=t;return j(new Error(`Unknown resource type: ${String(r)}`))}}}at(od,"validateResourceAddition");function GU(e,t){let r=t.databaseName??t.resourceName.toLowerCase();return e.database.some(i=>i.databaseName===r)?j(new Error(`Database name '${r}' already exists. Choose a different database name.`)):t.databaseType==="GlobalAurora"&&!t.primaryRegion?j(new Error("GlobalAurora databases require a primaryRegion.")):K(void 0)}at(GU,"validateDatabaseAddition");function VU(e,t){let r=e.database.find(i=>i.name===t.targetDatabase||i.databaseName===t.targetDatabase);if(!r){let i=e.database.map(n=>n.name).join(", ")||"none";return j(new Error(`Database '${t.targetDatabase}' not found. Available databases: ${i}`))}return r.proxy!==void 0&&r.proxy!==!1?j(new Error(`Database '${r.name}' already has RDS Proxy enabled.`)):K(void 0)}at(VU,"validateProxyAddition");function WU(e,t){if(e.cdn)return j(new Error("A CDN is already configured for this application. Remove the existing CDN first."));if(!NC(e,t.defaultOriginRef))return j(new Error(`Origin '${t.defaultOriginRef}' not found in plan. CDN origin must reference an existing resource.`));if(t.behaviours){for(let r of t.behaviours)if(!NC(e,r.originRef))return j(new Error(`Behaviour origin '${r.originRef}' not found in plan.`))}return K(void 0)}at(WU,"validateCdnAddition");function KU(e){return e.tunnel&&typeof e.tunnel=="object"?j(new Error("Tunnel is already enabled for this application.")):e.database.length===0?j(new Error("No databases found \u2014 tunnel requires at least one relational database.")):K(void 0)}at(KU,"validateTunnelAddition");function Cg(e,t){let r=od(e,t);if(!r.success)return r;switch(t.type){case"database":return ZU(e,t);case"database:proxy":return HU(e,t);case"storage:s3":return JU(e,t);case"network":return XU(e,t);case"compute:ecs":return qU(e,t);case"compute:lambda":return YU(e,t);case"cdn":return QU(e,t);case"tunnel":return ez(e,t);default:{let i=t;return j(new Error(`Unknown resource type: ${String(i)}`))}}}at(Cg,"addResourceToPlan");function ZU(e,t){let r=t.databaseName??t.resourceName.toLowerCase(),i={name:t.resourceName,type:t.databaseType,databaseName:r},n;switch(t.databaseType){case"Instance":n={...i,...t.instanceType!==void 0?{instanceType:t.instanceType}:{},...t.multiAz!==void 0?{multiAz:t.multiAz}:{},...t.readReplica!==void 0?{readReplica:t.readReplica}:{},...t.publiclyAccessible!==void 0?{publiclyAccessible:t.publiclyAccessible}:{},...t.backupRetention!==void 0?{backupRetention:t.backupRetention}:{}};break;case"Aurora":n={...i,...t.writer!==void 0?{writer:t.writer}:{},...t.readers!==void 0?{readers:t.readers}:{},...t.backupRetention!==void 0?{backupRetention:t.backupRetention}:{},...t.preferredMaintenanceWindow!==void 0?{preferredMaintenanceWindow:t.preferredMaintenanceWindow}:{}};break;case"GlobalAurora":n={...i,primaryRegion:t.primaryRegion,...t.secondaryRegions!==void 0?{secondaryRegions:t.secondaryRegions}:{}};break;default:{let o=t.databaseType;return j(new Error(`Unknown database type: ${String(o)}`))}}let a={...e,database:[...e.database,n]};return RC(a,t.resourceName,"database",t),K(a)}at(ZU,"addDatabase");function HU(e,t){let r=e.database.map(a=>({...a})),i=r.find(a=>a.name===t.targetDatabase||a.databaseName===t.targetDatabase);if(!i)return j(new Error(`Database '${t.targetDatabase}' not found.`));let n={};return t.maxConnections!==void 0&&(n.maxConnections=t.maxConnections),t.maxIdleConnections!==void 0&&(n.maxIdleConnections=t.maxIdleConnections),t.connectionBorrowTimeout!==void 0&&(n.connectionBorrowTimeout=t.connectionBorrowTimeout),t.requireTLS!==void 0&&(n.requireTLS=t.requireTLS),i.proxy=Object.keys(n).length>0?n:{},K({...e,database:r})}at(HU,"addProxy");function JU(e,t){let r=t.bucketName??t.resourceName.toLowerCase(),i=st(r),n=e.s3.length,a=n===0?"":`${n+1}`,o={name:i,bucketName:r,variableName:`bucket${a}`,...t.publicReadAccess!==void 0?{publicReadAccess:t.publicReadAccess}:{},...t.versioned!==void 0?{versioned:t.versioned}:{},...t.encryption!==void 0?{encryption:t.encryption}:{},...t.websiteHosting?{websiteHosting:{indexDocument:"index.html"}}:{}},s={...e,s3:[...e.s3,o]};return RC(s,i,"storage",t),K(s)}at(JU,"addS3");function XU(e,t){let r={};if(t.maxAzs!==void 0&&(r.maxAzs=t.maxAzs),t.natGateways!==void 0&&(r.natGateways=t.natGateways),t.flowLogs!==void 0&&(r.flowLogs=t.flowLogs),t.vpcEndpoints!==void 0&&(r.vpcEndpoints=t.vpcEndpoints),t.networkName){let i={name:t.networkName,...r};return K({...e,additionalNetworks:[...e.additionalNetworks??[],i]})}return K({...e,network:{...e.network??{},...r}})}at(XU,"addNetwork");function qU(e,t){let r=t.connectedDatabase??[],i={name:t.resourceName,type:"ecs",needsConnection:r.length>0,connectedDatabase:r,...t.loadBalancer!==void 0?{cluster:{loadBalancer:t.loadBalancer}}:{},services:t.services.map(n=>({name:n.name,capacityProvider:n.capacityProvider??"FARGATE",...n.port!==void 0?{containers:[{port:n.port}]}:{},...n.cpu!==void 0?{cpu:n.cpu}:{},...n.memory!==void 0?{memoryLimitMiB:n.memory}:{}})),...t.docker!==void 0&&{docker:t.docker}};return K({...e,compute:[...e.compute,i]})}at(qU,"addEcsCompute");function YU(e,t){let r=t.connectedDatabase??[],i={name:t.resourceName,type:"lambda",needsConnection:r.length>0,connectedDatabase:r,...t.timeout!==void 0?{timeout:t.timeout}:{},...t.memory!==void 0?{memory:t.memory}:{},...t.handler!==void 0?{handler:t.handler}:{},...t.runtime!==void 0?{runtime:t.runtime}:{}};return K({...e,compute:[...e.compute,i]})}at(YU,"addLambdaCompute");function QU(e,t){let r={name:t.resourceName,defaultOriginRef:t.defaultOriginRef,...t.customDomain!==void 0?{customDomain:t.customDomain}:{},...t.certificateArn!==void 0?{certificateArn:t.certificateArn}:{},...t.domain!==void 0?{domain:t.domain}:{},...t.originHostname!==void 0?{originHostname:t.originHostname}:{},...t.behaviours&&t.behaviours.length>0?{behaviours:[...t.behaviours].map(i=>({pathPattern:i.pathPattern,originRef:i.originRef,...i.cachePolicy!==void 0?{cachePolicy:i.cachePolicy}:{}}))}:{}};return K({...e,cdn:r})}at(QU,"addCdn");function ez(e,t){let r=t.instanceType?{instanceType:t.instanceType}:{};return K({...e,tunnel:r})}at(ez,"addTunnel");function wC(e,t){let r=[...e.database.map(i=>i.name),...(e.clickhouse??[]).map(i=>i.name),...e.s3.map(i=>i.name),...e.compute.map(i=>i.name),...(e.dynamodb??[]).map(i=>i.name),...(e.sqs??[]).map(i=>i.name),...(e.additionalNetworks??[]).map(i=>i.name)];return e.cdn&&r.push(e.cdn.name),r.includes(t)}at(wC,"isResourceNameTaken");function PC(e){return`Resource name '${e}' is already used in this application.`}at(PC,"resourceNameTakenMessage");function NC(e,t){return e.database.some(r=>r.name===t)||e.s3.some(r=>r.name===t)||e.compute.some(r=>r.name===t)||(e.dynamodb??[]).some(r=>r.name===t)||(e.sqs??[]).some(r=>r.name===t)}at(NC,"resourceExistsInPlan");function RC(e,t,r,i){i.connectToCompute&&i.connectToCompute.length>0&&Tg(e,[...i.connectToCompute],t,r),i.connectToServices&&i.connectToServices.length>0&&_g(e,[...i.connectToServices],t,r)}at(RC,"applyConnections");var kY=Object.defineProperty,NY=(e,t)=>kY(e,"name",{value:t,configurable:!0});function tz(e,t,r){let i;try{i=zs(e,{extractCustomCode:!0})}catch(l){return j(new Error(`Failed to parse infrastructure.ts: ${l instanceof Error?l.message:String(l)}`))}let n;try{n=Fu(i,t,{skipValidation:!0})}catch(l){return j(new Error(`Failed to build resource plan: ${l instanceof Error?l.message:String(l)}`))}i.customCodeBlocks&&i.customCodeBlocks.length>0&&(n.customCodeBlocks=i.customCodeBlocks);let a=od(n,r);if(!a.success)return a;let o=Cg(n,r);if(!o.success)return o;let s=Ag(o.data);return s.success?K({originalContent:e,modifiedContent:s.data,addedResource:{type:r.type,name:r.resourceName}}):j(new Error(`Code generation failed: ${s.error.message}`))}NY(tz,"generateResourceChange");var wY=Object.defineProperty,Ja=(e,t)=>wY(e,"name",{value:t,configurable:!0});function ti(e,...t){let r={};for(let i of t)e[i]!==void 0&&(r[i]=e[i]);return r}Ja(ti,"pickDefined");function rz(e,t){let r={name:e,type:t.databaseType,databaseName:t.databaseName,...ti(t,"databaseInsights","port","proxy","credentials","encryption","deletionProtection")};switch(t.databaseType){case"Instance":return{...r,...ti(t,"instanceType","multiAz","readReplica","publiclyAccessible","backupRetention","allocatedStorage","snapshotIdentifier","snapshotUsername")};case"Aurora":return{...r,...ti(t,"writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};case"GlobalAurora":return{...r,primaryRegion:t.primaryRegion,...t.secondaryRegions&&t.secondaryRegions.length>0&&{secondaryRegions:t.secondaryRegions},...ti(t,"globalClusterIdentifier","enableGlobalWriteForwarding","writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};default:return t}}Ja(rz,"buildRelationalResourcePlan");function nz(e){return`${e}Database`}Ja(nz,"defaultRelationalDatabaseName");function iz(e,t){return`Database name '${e}' already exists in ${t}. Please choose a different database name.`}Ja(iz,"duplicateDatabaseNameMessage");function az(e,t){let r=e.find(n=>n.name===t.databaseName||n.databaseName===t.databaseName);if(!r)return{ok:!1,message:`Database '${t.databaseName}' not found. Available databases: ${e.map(n=>n.name).join(", ")||"none"}`};if(r.proxy!==void 0&&r.proxy!==!1)return{ok:!1,message:`Database '${r.name}' already has RDS Proxy enabled.`};let i=ti(t,"maxConnections","maxIdleConnections","connectionBorrowTimeout","requireTLS");return{ok:!0,database:r,proxyValue:Object.keys(i).length>0?i:{}}}Ja(az,"resolveProxyAddition");function oz(e,t){return{name:e,type:"ClickHouse",databaseName:t.databaseName,...ti(t,"instanceType","storageGb","iops","throughputMbps","coldTier","optimiseSchedule","backupSchedule","backupVerify","backupRetentionDays")}}Ja(oz,"buildClickHouseResourcePlan");function sz(e,t,r){let i=t.storagePreset??"standard",n=Ch[i],a=r===0?"":`${r+1}`;return{name:e,bucketName:t.bucketName,variableName:`bucket${a}`,...n,...ti(t,"publicReadAccess","websiteHosting","backupVaultTier","versioned","encryption","kmsKeyArn","cors")}}Ja(sz,"buildS3ResourcePlan");var PY=Object.defineProperty,ri=(e,t)=>PY(e,"name",{value:t,configurable:!0}),RY=new Set(Uu.options);function cz(e){return RY.has(e.toUpperCase())}ri(cz,"isRecordType");function lz(e){return e.endsWith(".")?e.slice(0,-1):e}ri(lz,"stripTrailingDot");function uz(e){let t=!1;for(let r=0;r<e.length;r++)if(e[r]==='"')t=!t;else if(e[r]===";"&&!t)return e.slice(0,r).trimEnd();return e}ri(uz,"stripInlineComment");function dz(e,t){let r=e.slice(t).join(" "),i=[],n="",a=!1;for(let o of r)o==='"'?(a&&(i.push(n),n=""),a=!a):a&&(n+=o);return i.join(" ")}ri(dz,"parseTxtValue");function pz(e){let t=/;\s*auto\s*$/.test(e),r=e.replace(/;\s*auto\s*$/,"").trim().match(/^\$FJALL-DELEGATE\s+(\S+)\s+TO\s+(\S+)$/i);if(r)return{subdomain:r[1],targetAccount:r[2],auto:t}}ri(pz,"parseDelegateDirective");function mz(e){if(e.length<2)return;let t=e[1],r=e.slice(2);return{domainName:t,subjectAlternativeNames:r}}ri(mz,"parseCertDirective");function fz(e){let t=[],r="",i=!1;for(let n of e)n==='"'?(i=!i,r+=n):/\s/.test(n)&&!i?r.length>0&&(t.push(r),r=""):r+=n;return r.length>0&&t.push(r),t}ri(fz,"tokenise");function hz(e){if(e.length<2)return;let t=0,r=e[t++],i,n;for(;t<e.length&&n===void 0;){let o=e[t].toUpperCase();if(o==="IN")t++;else if(cz(o))n=o,t++;else if(/^\d+$/.test(e[t]))i=parseInt(e[t],10),t++;else return}if(!n)return;let a=e.slice(t);switch(n){case"MX":{if(a.length<2)return;let o=parseInt(a[0],10),s=a.slice(1).join(" ");return{name:r,type:n,ttl:i,value:s,priority:o}}case"SRV":{if(a.length<4)return;let o=parseInt(a[0],10),s=parseInt(a[1],10),l=parseInt(a[2],10),m=a[3];return{name:r,type:n,ttl:i,value:m,priority:o,weight:s,port:l}}case"TXT":{let o=dz(e,t);return{name:r,type:n,ttl:i,value:o}}case"CAA":{let o=a.join(" ");return{name:r,type:n,ttl:i,value:o}}case"A":case"AAAA":{if(a.length===0)return;if(a[0].toUpperCase()==="ALIAS"){if(a.length<2)return;let o=a.slice(1).join(" ");return{name:r,type:n,ttl:i,value:`${jL}${o}`}}return{name:r,type:n,ttl:i,value:a[0]}}default:return a.length===0?void 0:{name:r,type:n,ttl:i,value:a[0]}}}ri(hz,"parseRecord");function gz(e){let t=e.split(`
@@ -771,7 +771,7 @@ ${h.length>0?h.join(`
771
771
  ${u}
772
772
  });
773
773
  ${p}`}ot(Mz,"emitDomainTs");var BY=Object.defineProperty,GY=(e,t)=>BY(e,"name",{value:t,configurable:!0}),WY=import.meta.dirname,KY=c.object({primaryRegion:c.string().optional().default(hi),force:c.boolean().optional()}).strict();async function Lz(e,t){let r=KY.safeParse(t);if(!r.success)throw new Error(`Invalid account generator options:
774
- ${wl(r.error)}`);let i=Tx("account"),n={security:void 0},a=[],o={overwrite:r.data.force===!0,conflicts:a};if(mc(e,VY(WY,"..","shared","account","files"),i,n,o),Ix(e,i,{...n,packageName:"infra-app"},o),a.length>0)throw new Qa(a)}GY(Lz,"accountGenerator");var Vge=Lz;export{KY as AccountGeneratorSchema,Lz as accountGenerator,Vge as default};
774
+ ${wl(r.error)}`);let i=Tx("account"),n={security:void 0},a=[],o={overwrite:r.data.force===!0,conflicts:a};if(mc(e,VY(WY,"..","shared","account","files"),i,n,o),Ix(e,i,{...n,packageName:"infra-app"},o),a.length>0)throw new Qa(a)}GY(Lz,"accountGenerator");var Wge=Lz;export{KY as AccountGeneratorSchema,Lz as accountGenerator,Wge as default};
775
775
  /*! Bundled license information:
776
776
 
777
777
  ejs/lib/esm/ejs.js: