cdktn-cli 0.24.0-pre.29 → 0.24.0-pre.30

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.
@@ -91,21 +91,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
91
91
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yAt(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);u=!0);}catch(f){l=!0,i=f}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw i}}return o}}function bAt(t){if(Array.isArray(t))return t}function _At(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=cAe(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
92
92
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function cAe(t,e){if(t){if(typeof t=="string")return uAe(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uAe(t,e):void 0}}function uAe(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function CAt(t){var e=new Set(["subject","body","cc","bcc"]),r={cc:"",bcc:""},n=!1,i=t.split("&");if(i.length>4)return!1;var a=_At(i),s;try{for(a.s();!(s=a.n()).done;){var o=s.value,u=o.split("="),l=lAe(u,2),f=l[0],h=l[1];if(f&&!e.has(f)){n=!0;break}h&&(f==="cc"||f==="bcc")&&(r[f]=h),f&&e.delete(f)}}catch(g){a.e(g)}finally{a.f()}return n?!1:r}function IAt(t,e){if((0,gAt.default)(t),t.indexOf("mailto:")!==0)return!1;var r=t.replace("mailto:","").split("?"),n=lAe(r,2),i=n[0],a=n[1],s=a===void 0?"":a;if(!i&&!s)return!0;var o=CAt(s);return o?"".concat(i,",").concat(o.cc,",").concat(o.bcc).split(",").every(function(u){return u=(0,hAt.default)(u," "),u?(0,mAt.default)(u,e):!0}):!1}une.exports=BB.default;une.exports.default=BB.default});var fAe=x((NB,lne)=>{"use strict";Object.defineProperty(NB,"__esModule",{value:!0});NB.default=RAt;var SAt=EAt(Xt());function EAt(t){return t&&t.__esModule?t:{default:t}}var xAt=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i,wAt=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,AAt=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;function RAt(t){return(0,SAt.default)(t),xAt.test(t)||wAt.test(t)||AAt.test(t)}lne.exports=NB.default;lne.exports.default=NB.default});var pAe=x((DB,dne)=>{"use strict";Object.defineProperty(DB,"__esModule",{value:!0});DB.default=ZAt;var TAt=cne(Xt()),BAt=cne(Wd()),NAt=cne(bte());function cne(t){return t&&t.__esModule?t:{default:t}}var DAt=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,GAt=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,FAt=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,OAt=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,kAt={checkDMS:!1};function ZAt(t,e){if((0,TAt.default)(t),e=(0,BAt.default)(e,kAt),!(0,NAt.default)(t,","))return!1;var r=t.split(",");return r[0].startsWith("(")&&!r[1].endsWith(")")||r[1].endsWith(")")&&!r[0].startsWith("(")?!1:e.checkDMS?FAt.test(r[0])&&OAt.test(r[1]):DAt.test(r[0])&&GAt.test(r[1])}dne.exports=DB.default;dne.exports.default=DB.default});var mAe=x(GB=>{"use strict";Object.defineProperty(GB,"__esModule",{value:!0});GB.default=VAt;GB.locales=void 0;var LAt=WAt(Xt());function WAt(t){return t&&t.__esModule?t:{default:t}}var hAe=/^\d{3}$/,l1=/^\d{4}$/,Af=/^\d{5}$/,fne=/^\d{6}$/,nE={AD:/^AD\d{3}$/,AT:l1,AU:l1,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BD:/^([1-8][0-9]{3}|9[0-4][0-9]{2})$/,BE:l1,BG:l1,BR:/^\d{5}-?\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:l1,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CO:/^(05|08|11|13|15|17|18|19|20|23|25|27|41|44|47|50|52|54|63|66|68|70|73|76|81|85|86|88|91|94|95|97|99)(\d{4})$/,CZ:/^\d{3}\s?\d{2}$/,DE:Af,DK:l1,DO:Af,DZ:Af,EE:Af,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:Af,FR:/^(?:(?:0[1-9]|[1-8]\d|9[0-5])\d{3}|97[1-46]\d{2})$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:l1,ID:Af,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:hAe,IT:Af,JP:/^\d{3}\-\d{4}$/,KE:Af,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:l1,LV:/^LV\-\d{4}$/,LK:Af,MC:/^980\d{2}$/,MG:hAe,MX:Af,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:Af,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:l1,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:l1,PK:Af,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:fne,RU:fne,SA:Af,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:fne,SI:l1,SK:/^\d{3}\s?\d{2}$/,TH:Af,TN:l1,TW:/^\d{3}(\d{2,3})?$/,UA:Af,US:/^\d{5}(-\d{4})?$/,ZA:l1,ZM:Af},Pyr=GB.locales=Object.keys(nE);function VAt(t,e){if((0,LAt.default)(t),e in nE)return nE[e].test(t);if(e==="any"){for(var r in nE)if(nE.hasOwnProperty(r)){var n=nE[r];if(n.test(t))return!0}return!1}throw new Error("Invalid locale '".concat(e,"'"))}});var gAe=x((FB,pne)=>{"use strict";Object.defineProperty(FB,"__esModule",{value:!0});FB.default=MAt;var PAt=HAt(Xt());function HAt(t){return t&&t.__esModule?t:{default:t}}function MAt(t){return(0,PAt.default)(t),t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\//g,"&#x2F;").replace(/\\/g,"&#x5C;").replace(/`/g,"&#96;")}pne.exports=FB.default;pne.exports.default=FB.default});var vAe=x((OB,hne)=>{"use strict";Object.defineProperty(OB,"__esModule",{value:!0});OB.default=jAt;var UAt=YAt(Xt());function YAt(t){return t&&t.__esModule?t:{default:t}}function jAt(t){return(0,UAt.default)(t),t.replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#x2F;/g,"/").replace(/&#x5C;/g,"\\").replace(/&#96;/g,"`").replace(/&amp;/g,"&")}hne.exports=OB.default;hne.exports.default=OB.default});var gne=x((kB,mne)=>{"use strict";Object.defineProperty(kB,"__esModule",{value:!0});kB.default=zAt;var XAt=qAt(Xt());function qAt(t){return t&&t.__esModule?t:{default:t}}function zAt(t,e){return(0,XAt.default)(t),t.replace(new RegExp("[".concat(e,"]+"),"g"),"")}mne.exports=kB.default;mne.exports.default=kB.default});var bAe=x((ZB,vne)=>{"use strict";Object.defineProperty(ZB,"__esModule",{value:!0});ZB.default=JAt;var KAt=yAe(Xt()),$At=yAe(gne());function yAe(t){return t&&t.__esModule?t:{default:t}}function JAt(t,e){(0,KAt.default)(t);var r=e?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,$At.default)(t,r)}vne.exports=ZB.default;vne.exports.default=ZB.default});var _Ae=x((LB,yne)=>{"use strict";Object.defineProperty(LB,"__esModule",{value:!0});LB.default=tRt;var QAt=eRt(Xt());function eRt(t){return t&&t.__esModule?t:{default:t}}function tRt(t,e){return(0,QAt.default)(t),t.replace(new RegExp("[^".concat(e,"]+"),"g"),"")}yne.exports=LB.default;yne.exports.default=LB.default});var CAe=x((WB,bne)=>{"use strict";Object.defineProperty(WB,"__esModule",{value:!0});WB.default=iRt;var rRt=nRt(Xt());function nRt(t){return t&&t.__esModule?t:{default:t}}function iRt(t,e){(0,rRt.default)(t);for(var r=t.length-1;r>=0;r--)if(e.indexOf(t[r])===-1)return!1;return!0}bne.exports=WB.default;bne.exports.default=WB.default});var IAe=x((VB,_ne)=>{"use strict";Object.defineProperty(VB,"__esModule",{value:!0});VB.default=pRt;var aRt=sRt(Wd());function sRt(t){return t&&t.__esModule?t:{default:t}}var oRt={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,yandex_convert_yandexru:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},uRt=["icloud.com","me.com"],lRt=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],cRt=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],dRt=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function fRt(t){return t.length>1?t:""}function pRt(t,e){e=(0,aRt.default)(e,oRt);var r=t.split("@"),n=r.pop(),i=r.join("@"),a=[i,n];if(a[1]=a[1].toLowerCase(),a[1]==="gmail.com"||a[1]==="googlemail.com"){if(e.gmail_remove_subaddress&&(a[0]=a[0].split("+")[0]),e.gmail_remove_dots&&(a[0]=a[0].replace(/\.+/g,fRt)),!a[0].length)return!1;(e.all_lowercase||e.gmail_lowercase)&&(a[0]=a[0].toLowerCase()),a[1]=e.gmail_convert_googlemaildotcom?"gmail.com":a[1]}else if(uRt.indexOf(a[1])>=0){if(e.icloud_remove_subaddress&&(a[0]=a[0].split("+")[0]),!a[0].length)return!1;(e.all_lowercase||e.icloud_lowercase)&&(a[0]=a[0].toLowerCase())}else if(lRt.indexOf(a[1])>=0){if(e.outlookdotcom_remove_subaddress&&(a[0]=a[0].split("+")[0]),!a[0].length)return!1;(e.all_lowercase||e.outlookdotcom_lowercase)&&(a[0]=a[0].toLowerCase())}else if(cRt.indexOf(a[1])>=0){if(e.yahoo_remove_subaddress){var s=a[0].split("-");a[0]=s.length>1?s.slice(0,-1).join("-"):s[0]}if(!a[0].length)return!1;(e.all_lowercase||e.yahoo_lowercase)&&(a[0]=a[0].toLowerCase())}else dRt.indexOf(a[1])>=0?((e.all_lowercase||e.yandex_lowercase)&&(a[0]=a[0].toLowerCase()),a[1]=e.yandex_convert_yandexru?"yandex.ru":a[1]):e.all_lowercase&&(a[0]=a[0].toLowerCase());return a.join("@")}_ne.exports=VB.default;_ne.exports.default=VB.default});var SAe=x((PB,Cne)=>{"use strict";Object.defineProperty(PB,"__esModule",{value:!0});PB.default=vRt;var hRt=mRt(Xt());function mRt(t){return t&&t.__esModule?t:{default:t}}var gRt=/^[a-z0-9](?!.*[-_]{2,})(?:[a-z0-9_-]*[a-z0-9])?$/;function vRt(t){return(0,hRt.default)(t),gRt.test(t)}Cne.exports=PB.default;Cne.exports.default=PB.default});var EAe=x((HB,Ine)=>{"use strict";Object.defineProperty(HB,"__esModule",{value:!0});HB.default=_Rt;var yRt=bRt(Xt());function bRt(t){return t&&t.__esModule?t:{default:t}}var yV={"cs-CZ":function(e){return/^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(e)},"de-DE":function(e){return/^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÜ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÖ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|TR|TS|TT|TÜ|ÜB|UE|UH|UL|UM|UN|V|VB|VG|VK|VR|VS|W|WA|WB|WE|WF|WI|WK|WL|WM|WN|WO|WR|WS|WT|WÜ|WW|WZ|Z|ZE|ZI|ZP|ZR|ZW|ZZ)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(ABG|ABI|AIB|AIC|ALF|ALZ|ANA|ANG|ANK|APD|ARN|ART|ASL|ASZ|AUR|AZE|BAD|BAR|BBG|BCH|BED|BER|BGD|BGL|BID|BIN|BIR|BIT|BIW|BKS|BLB|BLK|BNA|BOG|BOH|BOR|BOT|BRA|BRB|BRG|BRK|BRL|BRV|BSB|BSK|BTF|BÜD|BUL|BÜR|BÜS|BÜZ|CAS|CHA|CLP|CLZ|COC|COE|CUX|DAH|DAN|DAU|DBR|DEG|DEL|DGF|DIL|DIN|DIZ|DKB|DLG|DON|DUD|DÜW|EBE|EBN|EBS|ECK|EIC|EIL|EIN|EIS|EMD|EMS|ERB|ERH|ERK|ERZ|ESB|ESW|FDB|FDS|FEU|FFB|FKB|FLÖ|FOR|FRG|FRI|FRW|FTL|FÜS|GAN|GAP|GDB|GEL|GEO|GER|GHA|GHC|GLA|GMN|GNT|GOA|GOH|GRA|GRH|GRI|GRM|GRZ|GTH|GUB|GUN|GVM|HAB|HAL|HAM|HAS|HBN|HBS|HCH|HDH|HDL|HEB|HEF|HEI|HER|HET|HGN|HGW|HHM|HIG|HIP|HMÜ|HOG|HOH|HOL|HOM|HOR|HÖS|HOT|HRO|HSK|HST|HVL|HWI|IGB|ILL|JÜL|KEH|KEL|KEM|KIB|KLE|KLZ|KÖN|KÖT|KÖZ|KRU|KÜN|KUS|KYF|LAN|LAU|LBS|LBZ|LDK|LDS|LEO|LER|LEV|LIB|LIF|LIP|LÖB|LOS|LRO|LSZ|LÜN|LUP|LWL|MAB|MAI|MAK|MAL|MED|MEG|MEI|MEK|MEL|MER|MET|MGH|MGN|MHL|MIL|MKK|MOD|MOL|MON|MOS|MSE|MSH|MSP|MST|MTK|MTL|MÜB|MÜR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÖHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÖ|PRÜ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÜD|RÜG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÜ|SLZ|SMÜ|SOB|SOG|SOK|SÖM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÜW|SWA|SZB|TBB|TDO|TET|TIR|TÖL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÜM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(e)},"de-LI":function(e){return/^FL[- ]?\d{1,5}[UZ]?$/.test(e)},"en-IN":function(e){return/^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(e)},"en-SG":function(e){return/^[A-Z]{3}[ -]?[\d]{4}[ -]?[A-Z]{1}$/.test(e)},"es-AR":function(e){return/^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(e)},"fi-FI":function(e){return/^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(e)},"hu-HU":function(e){return/^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(e)},"pt-BR":function(e){return/^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(e)},"pt-PT":function(e){return/^(([A-Z]{2}[ -·]?[0-9]{2}[ -·]?[0-9]{2})|([0-9]{2}[ -·]?[A-Z]{2}[ -·]?[0-9]{2})|([0-9]{2}[ -·]?[0-9]{2}[ -·]?[A-Z]{2})|([A-Z]{2}[ -·]?[0-9]{2}[ -·]?[A-Z]{2}))$/.test(e)},"sq-AL":function(e){return/^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(e)},"sv-SE":function(e){return/^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(e.trim())},"en-PK":function(e){return/(^[A-Z]{2}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{3}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{4}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]((\s|-){0,1})[0-9]{4}((\s|-)[0-9]{2}){0,1}$)/.test(e.trim())}};function _Rt(t,e){if((0,yRt.default)(t),e in yV)return yV[e](t);if(e==="any"){for(var r in yV){var n=yV[r];if(n(t))return!0}return!1}throw new Error("Invalid locale '".concat(e,"'"))}Ine.exports=HB.default;Ine.exports.default=HB.default});var wAe=x((MB,Sne)=>{"use strict";Object.defineProperty(MB,"__esModule",{value:!0});MB.default=NRt;var CRt=xAe(Wd()),IRt=xAe(Xt());function xAe(t){return t&&t.__esModule?t:{default:t}}var SRt=/^[A-Z]$/,ERt=/^[a-z]$/,xRt=/^[0-9]$/,wRt=/^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/,ARt={minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1,returnScore:!1,pointsPerUnique:1,pointsPerRepeat:.5,pointsForContainingLower:10,pointsForContainingUpper:10,pointsForContainingNumber:10,pointsForContainingSymbol:10};function RRt(t){var e={};return Array.from(t).forEach(function(r){var n=e[r];n?e[r]+=1:e[r]=1}),e}function TRt(t){var e=RRt(t),r={length:t.length,uniqueChars:Object.keys(e).length,uppercaseCount:0,lowercaseCount:0,numberCount:0,symbolCount:0};return Object.keys(e).forEach(function(n){SRt.test(n)?r.uppercaseCount+=e[n]:ERt.test(n)?r.lowercaseCount+=e[n]:xRt.test(n)?r.numberCount+=e[n]:wRt.test(n)&&(r.symbolCount+=e[n])}),r}function BRt(t,e){var r=0;return r+=t.uniqueChars*e.pointsPerUnique,r+=(t.length-t.uniqueChars)*e.pointsPerRepeat,t.lowercaseCount>0&&(r+=e.pointsForContainingLower),t.uppercaseCount>0&&(r+=e.pointsForContainingUpper),t.numberCount>0&&(r+=e.pointsForContainingNumber),t.symbolCount>0&&(r+=e.pointsForContainingSymbol),r}function NRt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;(0,IRt.default)(t);var r=TRt(t);return e=(0,CRt.default)(e||{},ARt),e.returnScore?BRt(r,e):r.length>=e.minLength&&r.lowercaseCount>=e.minLowercase&&r.uppercaseCount>=e.minUppercase&&r.numberCount>=e.minNumbers&&r.symbolCount>=e.minSymbols}Sne.exports=MB.default;Sne.exports.default=MB.default});var BAe=x(UB=>{"use strict";function Ene(t){"@babel/helpers - typeof";return Ene=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ene(t)}Object.defineProperty(UB,"__esModule",{value:!0});UB.default=ZRt;UB.vatMatchers=void 0;var AAe=GRt(Xt()),DRt=TAe(Lre());function TAe(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(TAe=function(a,s){if(!s&&a&&a.__esModule)return a;var o,u,l={__proto__:null,default:a};if(a===null||Ene(a)!="object"&&typeof a!="function")return l;if(o=s?n:r){if(o.has(a))return o.get(a);o.set(a,l)}for(var f in a)f!=="default"&&{}.hasOwnProperty.call(a,f)&&((u=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(u.get||u.set)?o(l,f,u):l[f]=a[f]);return l})(t,e)}function GRt(t){return t&&t.__esModule?t:{default:t}}var FRt=function(e){var r=e.match(/^(AU)?(\d{11})$/);if(!r)return!1;var n=[10,1,3,5,7,9,11,13,15,17,19];e=e.replace(/^AU/,"");for(var i=(parseInt(e.slice(0,1),10)-1).toString()+e.slice(1),a=0,s=0;s<11;s++)a+=n[s]*i.charAt(s);return a!==0&&a%89===0},ORt=function(e){var r=function(i){var a=i.pop(),s=[5,4,3,2,7,6,5,4],o=(11-i.reduce(function(u,l,f){return u+l*s[f]},0)%11)%11;return a===o};return/^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(e)&&r(e.match(/\d/g).map(function(n){return+n}))},kRt=function(e){var r=e.match(/^(PT)?(\d{9})$/);if(!r)return!1;var n=r[2],i=11-DRt.reverseMultiplyAndSum(n.split("").slice(0,8).map(function(a){return parseInt(a,10)}),9)%11;return i>9?parseInt(n[8],10)===0:i===parseInt(n[8],10)},RAe=UB.vatMatchers={AT:function(e){return/^(AT)?U\d{8}$/.test(e)},BE:function(e){return/^(BE)?\d{10}$/.test(e)},BG:function(e){return/^(BG)?\d{9,10}$/.test(e)},HR:function(e){return/^(HR)?\d{11}$/.test(e)},CY:function(e){return/^(CY)?\w{9}$/.test(e)},CZ:function(e){return/^(CZ)?\d{8,10}$/.test(e)},DK:function(e){return/^(DK)?\d{8}$/.test(e)},EE:function(e){return/^(EE)?\d{9}$/.test(e)},FI:function(e){return/^(FI)?\d{8}$/.test(e)},FR:function(e){return/^(FR)([A-Z0-9]{2}\d{9})$/.test(e)},DE:function(e){return/^(DE)?\d{9}$/.test(e)},EL:function(e){return/^(EL)?\d{9}$/.test(e)},HU:function(e){return/^(HU)?\d{8}$/.test(e)},IE:function(e){return/^(IE)?\d{7}\w{1}(W)?$/.test(e)},IT:function(e){return/^(IT)?\d{11}$/.test(e)},LV:function(e){return/^(LV)?\d{11}$/.test(e)},LT:function(e){return/^(LT)?\d{9,12}$/.test(e)},LU:function(e){return/^(LU)?\d{8}$/.test(e)},MT:function(e){return/^(MT)?\d{8}$/.test(e)},NL:function(e){return/^(NL)?\d{9}B\d{2}$/.test(e)},PL:function(e){return/^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(e)},PT:kRt,RO:function(e){return/^(RO)?\d{2,10}$/.test(e)},SK:function(e){return/^(SK)?\d{10}$/.test(e)},SI:function(e){return/^(SI)?\d{8}$/.test(e)},ES:function(e){return/^(ES)?\w\d{7}[A-Z]$/.test(e)},SE:function(e){return/^(SE)?\d{12}$/.test(e)},AL:function(e){return/^(AL)?\w{9}[A-Z]$/.test(e)},MK:function(e){return/^(MK)?\d{13}$/.test(e)},AU:FRt,BY:function(e){return/^(УНП )?\d{9}$/.test(e)},CA:function(e){return/^(CA)?\d{9}$/.test(e)},IS:function(e){return/^(IS)?\d{5,6}$/.test(e)},IN:function(e){return/^(IN)?\d{15}$/.test(e)},ID:function(e){return/^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(e)},IL:function(e){return/^(IL)?\d{9}$/.test(e)},KZ:function(e){return/^(KZ)?\d{12}$/.test(e)},NZ:function(e){return/^(NZ)?\d{9}$/.test(e)},NG:function(e){return/^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(e)},NO:function(e){return/^(NO)?\d{9}MVA$/.test(e)},PH:function(e){return/^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(e)},RU:function(e){return/^(RU)?(\d{10}|\d{12})$/.test(e)},SM:function(e){return/^(SM)?\d{5}$/.test(e)},SA:function(e){return/^(SA)?\d{15}$/.test(e)},RS:function(e){return/^(RS)?\d{9}$/.test(e)},CH:ORt,TR:function(e){return/^(TR)?\d{10}$/.test(e)},UA:function(e){return/^(UA)?\d{12}$/.test(e)},GB:function(e){return/^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(e)},UZ:function(e){return/^(UZ)?\d{9}$/.test(e)},AR:function(e){return/^(AR)?\d{11}$/.test(e)},BO:function(e){return/^(BO)?\d{7}$/.test(e)},BR:function(e){return/^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(e)},CL:function(e){return/^(CL)?\d{8}-\d{1}$/.test(e)},CO:function(e){return/^(CO)?\d{10}$/.test(e)},CR:function(e){return/^(CR)?\d{9,12}$/.test(e)},EC:function(e){return/^(EC)?\d{13}$/.test(e)},SV:function(e){return/^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(e)},GT:function(e){return/^(GT)?\d{7}-\d{1}$/.test(e)},HN:function(e){return/^(HN)?$/.test(e)},MX:function(e){return/^(MX)?\w{3,4}\d{6}\w{3}$/.test(e)},NI:function(e){return/^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(e)},PA:function(e){return/^(PA)?$/.test(e)},PY:function(e){return/^(PY)?\d{6,8}-\d{1}$/.test(e)},PE:function(e){return/^(PE)?\d{11}$/.test(e)},DO:function(e){return/^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(e)},UY:function(e){return/^(UY)?\d{12}$/.test(e)},VE:function(e){return/^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(e)}};function ZRt(t,e){if((0,AAe.default)(t),(0,AAe.default)(e),e in RAe)return RAe[e](t);throw new Error("Invalid country code: '".concat(e,"'"))}});var WAe=x((iE,wne)=>{"use strict";function xne(t){"@babel/helpers - typeof";return xne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xne(t)}Object.defineProperty(iE,"__esModule",{value:!0});iE.default=void 0;var LRt=zt(nV()),WRt=zt(qee()),VRt=zt(jxe()),PRt=zt(Xxe()),HRt=zt(qxe()),MRt=zt(Kxe()),URt=zt($xe()),YRt=zt(vte()),jRt=zt(awe()),XRt=zt(uwe()),qRt=zt(iT()),zRt=zt(pwe()),KRt=zt(fV()),$Rt=zt(wte()),JRt=zt(ywe()),QRt=zt(Iwe()),eTt=zt(Ewe()),tTt=zt(xwe()),NAe=m_(wwe()),DAe=m_(Awe()),rTt=zt(Rwe()),GAe=m_(Twe()),nTt=zt(Nwe()),iTt=zt(Dwe()),aTt=zt(Gwe()),sTt=zt(Fwe()),oTt=zt(Owe()),uTt=zt(Hte()),lTt=zt(Mte()),cTt=zt(kwe()),dTt=zt(Zwe()),fTt=zt(Vwe()),pTt=zt(Pwe()),hTt=zt(hV()),FAe=m_(jee()),mTt=zt(Mwe()),gTt=zt(Jte()),vTt=zt(Uwe()),yTt=zt(jwe()),bTt=zt(qwe()),_Tt=zt($we()),CTt=zt(Jwe()),ITt=zt(Qwe()),OAe=m_(r7e()),STt=zt(i7e()),ETt=zt(a7e()),xTt=zt(s7e()),wTt=zt(l7e()),ATt=zt(c7e()),RTt=zt(f7e()),TTt=zt(p7e()),BTt=zt(cte()),NTt=zt(h7e()),DTt=zt(g7e()),GTt=zt(y7e()),FTt=zt(_7e()),OTt=zt(I7e()),kTt=zt(E7e()),ZTt=zt(Tre()),LTt=zt(w7e()),WTt=zt(A7e()),VTt=zt(R7e()),PTt=zt(T7e()),HTt=zt(B7e()),MTt=zt(N7e()),UTt=zt(Z7e()),kAe=m_(L7e()),YTt=zt(W7e()),jTt=zt(P7e()),XTt=zt(H7e()),ZAe=U7e(),qTt=zt(Y7e()),zTt=zt(j7e()),KTt=zt(z7e()),$Tt=zt($7e()),JTt=zt(sre()),QTt=zt(J7e()),eBt=zt(Q7e()),tBt=zt(tAe()),rBt=zt(nAe()),nBt=zt(iAe()),iBt=zt(dre()),aBt=zt(aAe()),sBt=zt(sAe()),oBt=zt(dAe()),uBt=zt(fAe()),lBt=zt(pAe()),LAe=m_(mAe()),cBt=zt(ine()),dBt=zt(rne()),fBt=zt(sne()),pBt=zt(gAe()),hBt=zt(vAe()),mBt=zt(bAe()),gBt=zt(_Ae()),vBt=zt(gne()),yBt=zt(CAe()),bBt=zt(IAe()),_Bt=zt(SAe()),CBt=zt(EAe()),IBt=zt(wAe()),SBt=zt(BAe());function m_(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(m_=function(a,s){if(!s&&a&&a.__esModule)return a;var o,u,l={__proto__:null,default:a};if(a===null||xne(a)!="object"&&typeof a!="function")return l;if(o=s?n:r){if(o.has(a))return o.get(a);o.set(a,l)}for(var f in a)f!=="default"&&{}.hasOwnProperty.call(a,f)&&((u=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,f))&&(u.get||u.set)?o(l,f,u):l[f]=a[f]);return l})(t,e)}function zt(t){return t&&t.__esModule?t:{default:t}}var EBt="13.15.35",xBt={version:EBt,toDate:LRt.default,toFloat:WRt.default,toInt:VRt.default,toBoolean:PRt.default,equals:HRt.default,contains:MRt.default,matches:URt.default,isEmail:YRt.default,isURL:jRt.default,isMACAddress:XRt.default,isIP:qRt.default,isIPRange:zRt.default,isFQDN:KRt.default,isBoolean:QRt.default,isIBAN:OAe.default,isBIC:STt.default,isAbaRouting:tTt.default,isAlpha:NAe.default,isAlphaLocales:NAe.locales,isAlphanumeric:DAe.default,isAlphanumericLocales:DAe.locales,isNumeric:rTt.default,isPassportNumber:GAe.default,passportNumberLocales:GAe.locales,isPort:nTt.default,isLowercase:iTt.default,isUppercase:aTt.default,isAscii:oTt.default,isFullWidth:uTt.default,isHalfWidth:lTt.default,isVariableWidth:cTt.default,isMultibyte:dTt.default,isSemVer:fTt.default,isSurrogatePair:pTt.default,isInt:hTt.default,isIMEI:sTt.default,isFloat:FAe.default,isFloatLocales:FAe.locales,isDecimal:mTt.default,isHexadecimal:gTt.default,isOctal:vTt.default,isDivisibleBy:yTt.default,isHexColor:bTt.default,isRgbColor:_Tt.default,isHSL:CTt.default,isISRC:ITt.default,isMD5:ETt.default,isHash:xTt.default,isJWT:wTt.default,isJSON:ATt.default,isEmpty:RTt.default,isLength:TTt.default,isLocale:eTt.default,isByteLength:BTt.default,isULID:NTt.default,isUUID:DTt.default,isMongoId:GTt.default,isAfter:FTt.default,isBefore:OTt.default,isIn:kTt.default,isLuhnNumber:ZTt.default,isCreditCard:LTt.default,isIdentityCard:WTt.default,isEAN:VTt.default,isISIN:PTt.default,isISBN:HTt.default,isISSN:MTt.default,isMobilePhone:kAe.default,isMobilePhoneLocales:kAe.locales,isPostalCode:LAe.default,isPostalCodeLocales:LAe.locales,isEthereumAddress:YTt.default,isCurrency:jTt.default,isBtcAddress:XTt.default,isISO6346:ZAe.isISO6346,isFreightContainerID:ZAe.isFreightContainerID,isISO6391:qTt.default,isISO8601:zTt.default,isISO15924:$Tt.default,isRFC3339:KTt.default,isISO31661Alpha2:JTt.default,isISO31661Alpha3:QTt.default,isISO31661Numeric:eBt.default,isISO4217:tBt.default,isBase32:rBt.default,isBase58:nBt.default,isBase64:iBt.default,isDataURI:aBt.default,isMagnetURI:sBt.default,isMailtoURI:oBt.default,isMimeType:uBt.default,isLatLong:lBt.default,ltrim:cBt.default,rtrim:dBt.default,trim:fBt.default,escape:pBt.default,unescape:hBt.default,stripLow:mBt.default,whitelist:gBt.default,blacklist:vBt.default,isWhitelisted:yBt.default,normalizeEmail:bBt.default,toString,isSlug:_Bt.default,isStrongPassword:IBt.default,isTaxID:UTt.default,isDate:$Rt.default,isTime:JRt.default,isLicensePlate:CBt.default,isVAT:SBt.default,ibanLocales:OAe.locales},Uyr=iE.default=xBt;wne.exports=iE.default;wne.exports.default=iE.default});var Ane=x(bV=>{"use strict";Object.defineProperty(bV,"__esModule",{value:!0});bV.isRegistryModule=void 0;var wBt=WAe();function ABt(t){let e=t.split("/");return!(t.startsWith(".")||e.length<3||e.length>4||t.includes("github.com")||t.includes("bitbucket.org")||e.length===4&&!(0,wBt.isFQDN)(e[0]))}bV.isRegistryModule=ABt});var SV=x(ps=>{"use strict";var RBt=ps&&ps.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TBt=ps&&ps.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HAe=ps&&ps.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&RBt(e,t,r);return TBt(e,t),e};Object.defineProperty(ps,"__esModule",{value:!0});ps.logTimespan=ps.shouldCheckCodeMakerOutput=ps.readConfigSync=ps.parseConfig=ps.TerraformProviderConstraint=ps.TerraformModuleConstraint=ps.isLocalModule=ps.CONFIG_DEFAULTS=ps.LANGUAGES=ps.Language=void 0;var VAe=HAe(ZC()),MAe=HAe(require("path")),PAe=_I(),BBt=Ane(),NBt=require("process"),DBt=a6(),bI;(function(t){t.TYPESCRIPT="typescript",t.PYTHON="python",t.CSHARP="csharp",t.JAVA="java",t.GO="go"})(bI||(ps.Language=bI={}));ps.LANGUAGES=[bI.TYPESCRIPT,bI.PYTHON,bI.JAVA,bI.CSHARP,bI.GO];var GBt="CDKTF_CONTEXT_JSON",FBt="cdktf.json";ps.CONFIG_DEFAULTS={output:"cdktf.out",codeMakerOutput:".gen"};function _V(t){return Array.isArray(t)&&t.length>0}function Rne(t){return t.match(/^(\.\/|\.\.\/|\.\\\\|\.\.\\\\)(.*)/)}function OBt(t){return Rne(t)!==null}ps.isLocalModule=OBt;var CV=class{constructor(e){if(typeof e=="string"){let n=this.parseDependencyConstraint(e);this.name=n.name,this.source=n.source,this.fqn=n.fqn,this.version=n.version,this.namespace=n.namespace}else this.source=e.source,this.name=e.name,this.fqn=e.name,this.version=e.version,this.namespace=e.namespace;Rne(this.source)&&(this.localSourceAbsolutePath=MAe.join(process.cwd(),this.source))}get className(){return(0,DBt.toPascalCase)(this.name.replace(/[-/.]/g,"_"))}get fileName(){return this.namespace?`${this.namespace}/${this.name}`:this.name}parseDependencyConstraint(e){var r,n,i;let a=Rne(e);if(a){let Z=a[2],X=Z.split("/"),ue=(r=X.pop())!==null&&r!==void 0?r:Z,Q=X.pop();return{name:ue,fqn:Z,source:e,namespace:Q}}let[s,o]=e.split("@"),u=s.split("//");if((0,BBt.isRegistryModule)(u[0])){let Z=u[0].split("/"),X=Z.pop(),ue=(n=Z.pop())!==null&&n!==void 0?n:s,Q=`${Z.pop()}/${X}`;if(u.length>1){let ie=u[1].split("/"),M=ie.pop();Q=`${Q}/${ue}/${ie.join("/")}`,ue=M??ue}return{name:ue,source:s,version:o,namespace:Q,fqn:s.replace("//","/").replace(/\./g,"-")}}let l=e,f=l.match(/^([a-zA-Z0-9]*)::(.*)/);f&&(l=f[2]);let h=l.match(/^([a-zA-Z]*):\/\/(.*)/);h&&(l=h[2]),l=(i=l.split(":").pop())!==null&&i!==void 0?i:l;let _=l.match(/^[\d]*(.*)/);_&&(l=_[1]);let w=l.match(/[^/]*\.[^/]*\/(.*)/);w&&(l=w[1]);let T=l.match(/(.*)\?.*/);T&&(l=T[1]),l=l.replace(/\.git|\.hg|\.zip/,""),u=l.split("//");let D=u[0].split("/"),G=D.pop(),O=D.pop();if(!G)throw new Error(`Module name should be properly set in ${e}`);if(u.length>1){let Z=u[1].split("/"),X=Z.pop();O?O=`${O}/${G}/${Z.join("/")}`:O=`${G}/${Z.join("/")}`,G=X??G}return{name:G,source:e,fqn:l.replace("//","/"),namespace:O}}};ps.TerraformModuleConstraint=CV;var IV=class{constructor(e){if(typeof e=="string"){let r=this.parseDependencyConstraint(e);this.name=r.name,this.fqn=r.fqn,this.source=r.fqn,this.version=r.version,this.namespace=r.namespace}else this.name=e.name,this.fqn=e.name,this.version=e.version,this.source=e.source,this.namespace=e.namespace}parseDependencyConstraint(e){let[r,n]=e.split("@"),i=r.split("/"),a=i.pop(),s=i.pop();if(!a)throw new Error(`Provider name should be properly set in ${e}`);return{name:a,source:r,version:n==="*"?void 0:n,fqn:r,namespace:s}}};ps.TerraformProviderConstraint=IV;var kBt=t=>{var e,r;let n={...ps.CONFIG_DEFAULTS,...JSON.parse(t||"{}")};return _V(n.terraformModules)&&(n.terraformModules=(e=n.terraformModules)===null||e===void 0?void 0:e.map(i=>new CV(i))),_V(n.terraformProviders)&&(n.terraformProviders=(r=n.terraformProviders)===null||r===void 0?void 0:r.map(i=>new IV(i))),n.context&&(NBt.env[GBt]=JSON.stringify(n.context)),n};ps.parseConfig=kBt;function ZBt(t=MAe.join(process.cwd(),FBt)){let e;return VAe.existsSync(t)&&(e=VAe.readFileSync(t).toString()),(0,ps.parseConfig)(e)}ps.readConfigSync=ZBt;function LBt(t){return _V(t.terraformModules)||_V(t.terraformProviders)}ps.shouldCheckCodeMakerOutput=LBt;function WBt(t){PAe.logger.debug(`Start timer for ${t}...`);let e=Date.now();return function(){let i=Date.now()-e;PAe.logger.debug(`${t} took ${i}ms`)}}ps.logTimespan=WBt});var YAe=x((Xyr,UAe)=>{"use strict";UAe.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var N6=x((qyr,jAe)=>{"use strict";var VBt=YAe();jAe.exports=t=>typeof t=="string"?t.replace(VBt(),""):t});var aE=x(Za=>{"use strict";var PBt=Za&&Za.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HBt=Za&&Za.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wV=Za&&Za.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&PBt(e,t,r);return HBt(e,t),e},MBt=Za&&Za.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Za,"__esModule",{value:!0});Za.hasNoColorFlagOrEnv=Za.ensureAllSettledBeforeThrowing=Za.downloadFile=Za.HttpError=Za.downcaseFirst=Za.readCDKTFManifest=Za.readCDKTFVersion=Za.exec=Za.mkdtemp=Za.withTempDir=Za.shell=void 0;var UBt=Tee(),S2=wV(ZC()),XAe=Zxe(),qAe=wV(require("os")),jB=wV(require("path")),EV=_I(),YBt=require("cdktn"),jBt=wV(SV()),YB=MBt(N6());function XBt(t,e,r){t.stderr=e,t.stdout=r;let n=[e,r].filter(Boolean).join(`
93
93
  `);if(n){let i=t.message;t.toString=()=>`Error: ${i}
94
- ${n}`}}async function qBt(t,e=[],r={}){return(0,Za.exec)(t,e,r,n=>{let i=r.noColor?(0,YB.default)(n.toLocaleString()):n.toLocaleString();console.log(i)},()=>{})}Za.shell=qBt;async function zBt(t,e){let r=process.cwd(),n=await S2.mkdtemp(jB.join(qAe.tmpdir(),"cdktf.")),i=jB.join(n,t);await S2.mkdirp(i);try{process.chdir(i),await e()}finally{process.chdir(r),await S2.remove(n)}}Za.withTempDir=zBt;async function KBt(t){let e=await S2.mkdtemp(jB.join(qAe.tmpdir(),"cdktf."));try{await t(e)}finally{await S2.remove(e)}}Za.mkdtemp=KBt;var $Bt=async(t,e,r,n,i,a=!0)=>(typeof r.noColor!="boolean"&&zAe()&&(r.noColor=!0),new Promise((s,o)=>{var u,l,f,h;let g=(0,UBt.spawn)(t,e,r),_=new Array,w=new Array;n!==void 0?(u=g.stdout)===null||u===void 0||u.on("data",T=>{let D=r.noColor?(0,YB.default)(T.toLocaleString()):T.toLocaleString();(0,EV.processLoggerDebug)(D),_.push(D),n(D)}):(l=g.stdout)===null||l===void 0||l.on("data",T=>{let D=r.noColor?(0,YB.default)(T.toLocaleString()):T.toLocaleString();(0,EV.processLoggerDebug)(D),_.push(D)}),i!==void 0?(f=g.stderr)===null||f===void 0||f.on("data",T=>{let D=r.noColor?(0,YB.default)(T.toLocaleString()):T.toLocaleString();(0,EV.processLoggerError)(D),a&&i(D),w.push(D)}):(h=g.stderr)===null||h===void 0||h.on("data",T=>{let D=r.noColor?(0,YB.default)(T.toLocaleString()):T.toLocaleString();(0,EV.processLoggerError)(D),a&&process.stderr.write(D),w.push(D)}),g.once("error",T=>o(T)),g.once("close",T=>{if(T!==0){let D=new Error(`${t} ${e.join(" ")} exited with code ${T}`);return XBt(D,w.join(""),_.join("")),o(D)}return s(_.join(""))})}));Za.exec=$Bt;async function JBt(t){let e=jB.join(t,"cdk.tf.json");if(S2.existsSync(e)){let r=S2.readFileSync(e,"utf8");return JSON.parse(r)["//"].metadata.version}return""}Za.readCDKTFVersion=JBt;async function QBt(){let{output:t}=jBt.readConfigSync(),e=await S2.readFile(jB.join(t,YBt.Manifest.fileName));return JSON.parse(e.toString())}Za.readCDKTFManifest=QBt;function eNt(t){return t===""?t:`${t[0].toLocaleLowerCase()}${t.slice(1)}`}Za.downcaseFirst=eNt;var xV=class extends Error{constructor(e,r){super(e),this.statusCode=r,Object.setPrototypeOf(this,new.target.prototype)}};Za.HttpError=xV;async function tNt(t,e){let r=t.startsWith("http://")?XAe.http:XAe.https,n=S2.createWriteStream(e);return new Promise((i,a)=>{let s=r.get(t,o=>{if(o.statusCode!==200){a(new xV(`Failed to get '${t}' (${o.statusCode})`,o.statusCode));return}o.pipe(n)});n.on("finish",()=>i()),s.on("error",o=>{S2.unlink(e,()=>a(o))}),n.on("error",o=>{S2.unlink(e,()=>a(o))}),s.end()})}Za.downloadFile=tNt;async function rNt(t,e){try{await t}catch(r){throw await Promise.allSettled(e),r}}Za.ensureAllSettledBeforeThrowing=rNt;function zAe(){return nNt("no-color")||process.env.FORCE_COLOR==="0"}Za.hasNoColorFlagOrEnv=zAe;function nNt(t){let e=t.startsWith("-")?"":t.length===1?"-":"--",r=process.argv.indexOf(e+t),n=process.argv.indexOf("--");return r!==-1&&(n===-1||r<n)}});var _I=x(Rf=>{"use strict";var iNt=Rf&&Rf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aNt=Rf&&Rf.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Bne=Rf&&Rf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&iNt(e,t,r);return aNt(e,t),e};Object.defineProperty(Rf,"__esModule",{value:!0});Rf.logFileName=Rf.processLoggerError=Rf.processLoggerDebug=Rf.logger=void 0;var Tne=X6e(),KAe=Bne(ZC()),sNt=Bne(require("path")),sE=Bne(tV()),oNt=aE(),D6=(0,Tne.getLogger)(),Nne={trace(t,...e){D6.trace(t,...e),sE.addBreadcrumb({message:t,level:"debug"})},debug(t,...e){D6.debug(t,...e),sE.addBreadcrumb({message:t,level:"debug"})},info(t,...e){D6.info(t,...e),sE.addBreadcrumb({message:t,level:"info"})},warn(t,...e){D6.warn(t,...e),sE.addBreadcrumb({message:t,level:"warning"})},error(t,...e){D6.error(t,...e),sE.addBreadcrumb({message:t,level:"error"})},fatal(t,...e){D6.fatal(t,...e),sE.addBreadcrumb({message:t,level:"fatal"})},setLevel(t){D6.level=t},useDefaultLevel(){D6.level=process.env.CDKTF_LOG_LEVEL||"INFO"}};Rf.logger=Nne;D6.level=process.env.CDKTF_LOG_LEVEL||"INFO";var $Ae="cdktf.log";Rf.logFileName=$Ae;if(process.env.CDKTF_LOG_FILE_DIRECTORY&&KAe.existsSync(process.env.CDKTF_LOG_FILE_DIRECTORY)&&KAe.statSync(process.env.CDKTF_LOG_FILE_DIRECTORY).isDirectory())(0,Tne.configure)({appenders:{cdktf:{type:"file",filename:sNt.join(process.env.CDKTF_LOG_FILE_DIRECTORY,$Ae)}},categories:{default:{appenders:["cdktf"],level:"debug"}}});else{let t=(0,oNt.hasNoColorFlagOrEnv)()?"basic":"colored";(0,Tne.configure)({appenders:{out:{type:"stdout",layout:{type:t}}},categories:{default:{appenders:["out"],level:"info"}}})}var uNt=t=>{Nne.debug(t.toString())};Rf.processLoggerDebug=uNt;var lNt=t=>{Nne.error(t.toString())};Rf.processLoggerError=lNt});var JAe=x(($yr,cNt)=>{cNt.exports={name:"@cdktn/commons",version:"0.24.0-pre.29",publishConfig:{access:"public"},description:"CDK Terrain Common utilities",scripts:{build:"tsc",watch:"tsc -w","watch-preserve-output":"tsc -w --preserveWatchOutput","test:update":"jest -u",package:"./package.sh","dist-clean":"rm -rf dist","package:js":"./package.sh"},main:"build/index.js",types:"build/index.d.ts",nx:{tags:["unit-test"]},repository:{type:"git",url:"git://github.com/open-constructs/cdk-terrain.git",directory:"packages/@cdktn/commons"},author:{name:"OpenConstructs",url:"https://github.com/open-constructs"},keywords:["cdk","cdktf","cdktn","terraform"],license:"MPL-2.0",dependencies:{"@sentry/node":"7.120.4",cdktn:"0.24.0-pre.29","ci-info":"3.9.0",codemaker:"1.128.0","cross-spawn":"7.0.6","follow-redirects":"1.15.11","fs-extra":"11.3.4",log4js:"6.9.1","strip-ansi":"6.0.1",uuid:"9.0.1",validator:"13.15.35"},devDependencies:{"@types/follow-redirects":"1.14.4","@types/fs-extra":"11.0.4","@types/uuid":"9.0.8","@types/validator":"13.15.10","tsc-files":"1.1.4",typescript:"5.4.5"},"lint-staged":{"src/**/*.{ts,tsx}":"tsc-files ambient.d.ts --noEmit"}}});var XB=x(AV=>{"use strict";Object.defineProperty(AV,"__esModule",{value:!0});AV.DISPLAY_VERSION=void 0;AV.DISPLAY_VERSION=`${dNt()}`;function dNt(){return JAe().version.replace(/\+[0-9a-f]+$/,"")}});var Gne=x(kc=>{"use strict";var fNt=kc&&kc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pNt=kc&&kc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BV=kc&&kc.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&fNt(e,t,r);return pNt(e,t),e},hNt=kc&&kc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kc,"__esModule",{value:!0});kc.ReportRequest=kc.getUserId=kc.getProjectId=kc.sendTelemetry=void 0;var mNt=BV(require("https")),gNt=require("url"),tRe=(Gye(),jhe(Dye)),TV=BV(require("os")),QAe=hNt(az()),Dne=_I(),qB=BV(require("path")),RV=BV(ZC()),vNt=XB(),yNt="https://checkpoint-api.hashicorp.com/v1/",bNt=[200,201],eRe=8192;function _Nt(){var t;return process.env.CDKTF_HOME?qB.resolve(process.env.CDKTF_HOME):qB.join(((t=TV.userInfo().homedir)!==null&&t!==void 0?t:TV.homedir()).trim()||"/",".cdktf")}async function CNt(t,e){return new Promise((r,n)=>{let i=mNt.request((0,gNt.format)(t),{headers:{Accept:"application/json","Content-Length":e.length,"User-Agent":"OpenConstructs/cdktn-cli"},method:"POST"},a=>{if(a.statusCode){let o=a.statusCode;if(!bNt.includes(o))return n(new Error(a.statusMessage))}let s=new Array;a.on("data",o=>s.push(o)),a.on("error",o=>n(o)),a.on("end",()=>r())});i.setTimeout(1e3,()=>n(new Error("request timeout"))),i.write(e),i.end(),i.on("error",a=>n(a))})}async function INt(t,e){let r={command:t,product:"cdktn",version:`${vNt.DISPLAY_VERSION}`,dateTime:new Date,language:e.language,payload:e};try{await aRe(r)}catch(n){Dne.logger.error(`Could not send telemetry data: ${n}`)}}kc.sendTelemetry=INt;function rRe(t,e,r=!1,n){let i=(0,tRe.v4)(),a;try{a=JSON.parse(RV.readFileSync(t,"utf-8"))}catch{if(r){let o={};n&&(o["//"]=n.replace(/\n/g," ")),o[e]=i,RV.ensureDirSync(qB.dirname(t)),RV.writeFileSync(t,JSON.stringify(o,null,2))}return i}return a[e]?a[e]:(RV.writeFileSync(t,JSON.stringify({...a,[e]:i},null,2)),i)}function nRe(t=process.cwd()){return rRe(qB.resolve(t,"cdktf.json"),"projectId")}kc.getProjectId=nRe;function iRe(){return rRe(qB.resolve(_Nt(),"config.json"),"userId",!0,`This signature is a randomly generated UUID used to anonymously differentiate users in telemetry data order to inform product direction.
94
+ ${n}`}}async function qBt(t,e=[],r={}){return(0,Za.exec)(t,e,r,n=>{let i=r.noColor?(0,YB.default)(n.toLocaleString()):n.toLocaleString();console.log(i)},()=>{})}Za.shell=qBt;async function zBt(t,e){let r=process.cwd(),n=await S2.mkdtemp(jB.join(qAe.tmpdir(),"cdktf.")),i=jB.join(n,t);await S2.mkdirp(i);try{process.chdir(i),await e()}finally{process.chdir(r),await S2.remove(n)}}Za.withTempDir=zBt;async function KBt(t){let e=await S2.mkdtemp(jB.join(qAe.tmpdir(),"cdktf."));try{await t(e)}finally{await S2.remove(e)}}Za.mkdtemp=KBt;var $Bt=async(t,e,r,n,i,a=!0)=>(typeof r.noColor!="boolean"&&zAe()&&(r.noColor=!0),new Promise((s,o)=>{var u,l,f,h;let g=(0,UBt.spawn)(t,e,r),_=new Array,w=new Array;n!==void 0?(u=g.stdout)===null||u===void 0||u.on("data",T=>{let D=r.noColor?(0,YB.default)(T.toLocaleString()):T.toLocaleString();(0,EV.processLoggerDebug)(D),_.push(D),n(D)}):(l=g.stdout)===null||l===void 0||l.on("data",T=>{let D=r.noColor?(0,YB.default)(T.toLocaleString()):T.toLocaleString();(0,EV.processLoggerDebug)(D),_.push(D)}),i!==void 0?(f=g.stderr)===null||f===void 0||f.on("data",T=>{let D=r.noColor?(0,YB.default)(T.toLocaleString()):T.toLocaleString();(0,EV.processLoggerError)(D),a&&i(D),w.push(D)}):(h=g.stderr)===null||h===void 0||h.on("data",T=>{let D=r.noColor?(0,YB.default)(T.toLocaleString()):T.toLocaleString();(0,EV.processLoggerError)(D),a&&process.stderr.write(D),w.push(D)}),g.once("error",T=>o(T)),g.once("close",T=>{if(T!==0){let D=new Error(`${t} ${e.join(" ")} exited with code ${T}`);return XBt(D,w.join(""),_.join("")),o(D)}return s(_.join(""))})}));Za.exec=$Bt;async function JBt(t){let e=jB.join(t,"cdk.tf.json");if(S2.existsSync(e)){let r=S2.readFileSync(e,"utf8");return JSON.parse(r)["//"].metadata.version}return""}Za.readCDKTFVersion=JBt;async function QBt(){let{output:t}=jBt.readConfigSync(),e=await S2.readFile(jB.join(t,YBt.Manifest.fileName));return JSON.parse(e.toString())}Za.readCDKTFManifest=QBt;function eNt(t){return t===""?t:`${t[0].toLocaleLowerCase()}${t.slice(1)}`}Za.downcaseFirst=eNt;var xV=class extends Error{constructor(e,r){super(e),this.statusCode=r,Object.setPrototypeOf(this,new.target.prototype)}};Za.HttpError=xV;async function tNt(t,e){let r=t.startsWith("http://")?XAe.http:XAe.https,n=S2.createWriteStream(e);return new Promise((i,a)=>{let s=r.get(t,o=>{if(o.statusCode!==200){a(new xV(`Failed to get '${t}' (${o.statusCode})`,o.statusCode));return}o.pipe(n)});n.on("finish",()=>i()),s.on("error",o=>{S2.unlink(e,()=>a(o))}),n.on("error",o=>{S2.unlink(e,()=>a(o))}),s.end()})}Za.downloadFile=tNt;async function rNt(t,e){try{await t}catch(r){throw await Promise.allSettled(e),r}}Za.ensureAllSettledBeforeThrowing=rNt;function zAe(){return nNt("no-color")||process.env.FORCE_COLOR==="0"}Za.hasNoColorFlagOrEnv=zAe;function nNt(t){let e=t.startsWith("-")?"":t.length===1?"-":"--",r=process.argv.indexOf(e+t),n=process.argv.indexOf("--");return r!==-1&&(n===-1||r<n)}});var _I=x(Rf=>{"use strict";var iNt=Rf&&Rf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aNt=Rf&&Rf.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Bne=Rf&&Rf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&iNt(e,t,r);return aNt(e,t),e};Object.defineProperty(Rf,"__esModule",{value:!0});Rf.logFileName=Rf.processLoggerError=Rf.processLoggerDebug=Rf.logger=void 0;var Tne=X6e(),KAe=Bne(ZC()),sNt=Bne(require("path")),sE=Bne(tV()),oNt=aE(),D6=(0,Tne.getLogger)(),Nne={trace(t,...e){D6.trace(t,...e),sE.addBreadcrumb({message:t,level:"debug"})},debug(t,...e){D6.debug(t,...e),sE.addBreadcrumb({message:t,level:"debug"})},info(t,...e){D6.info(t,...e),sE.addBreadcrumb({message:t,level:"info"})},warn(t,...e){D6.warn(t,...e),sE.addBreadcrumb({message:t,level:"warning"})},error(t,...e){D6.error(t,...e),sE.addBreadcrumb({message:t,level:"error"})},fatal(t,...e){D6.fatal(t,...e),sE.addBreadcrumb({message:t,level:"fatal"})},setLevel(t){D6.level=t},useDefaultLevel(){D6.level=process.env.CDKTF_LOG_LEVEL||"INFO"}};Rf.logger=Nne;D6.level=process.env.CDKTF_LOG_LEVEL||"INFO";var $Ae="cdktf.log";Rf.logFileName=$Ae;if(process.env.CDKTF_LOG_FILE_DIRECTORY&&KAe.existsSync(process.env.CDKTF_LOG_FILE_DIRECTORY)&&KAe.statSync(process.env.CDKTF_LOG_FILE_DIRECTORY).isDirectory())(0,Tne.configure)({appenders:{cdktf:{type:"file",filename:sNt.join(process.env.CDKTF_LOG_FILE_DIRECTORY,$Ae)}},categories:{default:{appenders:["cdktf"],level:"debug"}}});else{let t=(0,oNt.hasNoColorFlagOrEnv)()?"basic":"colored";(0,Tne.configure)({appenders:{out:{type:"stdout",layout:{type:t}}},categories:{default:{appenders:["out"],level:"info"}}})}var uNt=t=>{Nne.debug(t.toString())};Rf.processLoggerDebug=uNt;var lNt=t=>{Nne.error(t.toString())};Rf.processLoggerError=lNt});var JAe=x(($yr,cNt)=>{cNt.exports={name:"@cdktn/commons",version:"0.24.0-pre.30",publishConfig:{access:"public"},description:"CDK Terrain Common utilities",scripts:{build:"tsc",watch:"tsc -w","watch-preserve-output":"tsc -w --preserveWatchOutput","test:update":"jest -u",package:"./package.sh","dist-clean":"rm -rf dist","package:js":"./package.sh"},main:"build/index.js",types:"build/index.d.ts",nx:{tags:["unit-test"]},repository:{type:"git",url:"git://github.com/open-constructs/cdk-terrain.git",directory:"packages/@cdktn/commons"},author:{name:"OpenConstructs",url:"https://github.com/open-constructs"},keywords:["cdk","cdktf","cdktn","terraform"],license:"MPL-2.0",dependencies:{"@sentry/node":"7.120.4",cdktn:"0.24.0-pre.30","ci-info":"3.9.0",codemaker:"1.128.0","cross-spawn":"7.0.6","follow-redirects":"1.15.11","fs-extra":"11.3.4",log4js:"6.9.1","strip-ansi":"6.0.1",uuid:"9.0.1",validator:"13.15.35"},devDependencies:{"@types/follow-redirects":"1.14.4","@types/fs-extra":"11.0.4","@types/uuid":"9.0.8","@types/validator":"13.15.10","tsc-files":"1.1.4",typescript:"5.4.5"},"lint-staged":{"src/**/*.{ts,tsx}":"tsc-files ambient.d.ts --noEmit"}}});var XB=x(AV=>{"use strict";Object.defineProperty(AV,"__esModule",{value:!0});AV.DISPLAY_VERSION=void 0;AV.DISPLAY_VERSION=`${dNt()}`;function dNt(){return JAe().version.replace(/\+[0-9a-f]+$/,"")}});var Gne=x(kc=>{"use strict";var fNt=kc&&kc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pNt=kc&&kc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BV=kc&&kc.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&fNt(e,t,r);return pNt(e,t),e},hNt=kc&&kc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kc,"__esModule",{value:!0});kc.ReportRequest=kc.getUserId=kc.getProjectId=kc.sendTelemetry=void 0;var mNt=BV(require("https")),gNt=require("url"),tRe=(Gye(),jhe(Dye)),TV=BV(require("os")),QAe=hNt(az()),Dne=_I(),qB=BV(require("path")),RV=BV(ZC()),vNt=XB(),yNt="https://checkpoint-api.hashicorp.com/v1/",bNt=[200,201],eRe=8192;function _Nt(){var t;return process.env.CDKTF_HOME?qB.resolve(process.env.CDKTF_HOME):qB.join(((t=TV.userInfo().homedir)!==null&&t!==void 0?t:TV.homedir()).trim()||"/",".cdktf")}async function CNt(t,e){return new Promise((r,n)=>{let i=mNt.request((0,gNt.format)(t),{headers:{Accept:"application/json","Content-Length":e.length,"User-Agent":"OpenConstructs/cdktn-cli"},method:"POST"},a=>{if(a.statusCode){let o=a.statusCode;if(!bNt.includes(o))return n(new Error(a.statusMessage))}let s=new Array;a.on("data",o=>s.push(o)),a.on("error",o=>n(o)),a.on("end",()=>r())});i.setTimeout(1e3,()=>n(new Error("request timeout"))),i.write(e),i.end(),i.on("error",a=>n(a))})}async function INt(t,e){let r={command:t,product:"cdktn",version:`${vNt.DISPLAY_VERSION}`,dateTime:new Date,language:e.language,payload:e};try{await aRe(r)}catch(n){Dne.logger.error(`Could not send telemetry data: ${n}`)}}kc.sendTelemetry=INt;function rRe(t,e,r=!1,n){let i=(0,tRe.v4)(),a;try{a=JSON.parse(RV.readFileSync(t,"utf-8"))}catch{if(r){let o={};n&&(o["//"]=n.replace(/\n/g," ")),o[e]=i,RV.ensureDirSync(qB.dirname(t)),RV.writeFileSync(t,JSON.stringify(o,null,2))}return i}return a[e]?a[e]:(RV.writeFileSync(t,JSON.stringify({...a,[e]:i},null,2)),i)}function nRe(t=process.cwd()){return rRe(qB.resolve(t,"cdktf.json"),"projectId")}kc.getProjectId=nRe;function iRe(){return rRe(qB.resolve(_Nt(),"config.json"),"userId",!0,`This signature is a randomly generated UUID used to anonymously differentiate users in telemetry data order to inform product direction.
95
95
  This signature is random, it is not based on any personally identifiable information.
96
96
  To create a new signature, you can simply delete this file at any time.
97
- See https://cdk.tf/telemetry for more
98
- information on how to disable it.`)}kc.getUserId=iRe;async function aRe(t){if(process.env.CHECKPOINT_DISABLE)return;t.runID||(t.runID=(0,tRe.v4)()),t.dateTime||(t.dateTime=new Date),t.arch||(t.arch=TV.arch()),t.os||(t.os=TV.platform());let e=QAe.default.isCI?QAe.default.name||"unknown":!1;!t.userId&&!e&&(t.userId=iRe()),e&&(t.ci=e),t.projectId=t.projectId||nRe();let r=JSON.stringify(t);if(r.length>eRe){Dne.logger.warn(`Skipped sending telemetry as the request body size was ${r.length} bytes. The limit is ${eRe} bytes`);return}try{await CNt(`${yNt}telemetry/${t.product}`,r)}catch(n){(0,Dne.processLoggerError)(n.message)}}kc.ReportRequest=aRe});var sRe=x(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});g_.ConstructsMakerProviderTarget=g_.ConstructsMakerModuleTarget=g_.ConstructsMakerTarget=void 0;var Sy=SV(),zB=class{constructor(e,r){this.constraint=e,this.targetLanguage=r,this.constraint instanceof Sy.TerraformModuleConstraint?this.fileName=`${this.typesPath(this.constraint.fileName)}.ts`:this.fileName=`${this.typesPath(this.constraint.name)}.ts`}static from(e,r){return e instanceof Sy.TerraformModuleConstraint?new NV(e,r):new DV(e,r)}get version(){return this.constraint.version}get source(){return this.constraint.source}get name(){return this.constraint.name}get fqn(){return this.constraint.fqn}get namespace(){return this.constraint.namespace}get moduleKey(){return this.fqn.replace(/\//gi,"_")}};g_.ConstructsMakerTarget=zB;var NV=class extends zB{get isModule(){return!0}get isProvider(){return!1}get srcMakName(){switch(this.targetLanguage){case Sy.Language.GO:return this.name.replace(/-/gi,"_");case Sy.Language.JAVA:case Sy.Language.CSHARP:case Sy.Language.PYTHON:return this.simplifiedFqn;default:return this.simplifiedName}}get trackingPayload(){return{name:this.name,fullName:this.fqn,version:this.version,type:"module"}}typesPath(e){return`modules/${e}`}get simplifiedName(){var e,r;return(r=(e=this.namespace)===null||e===void 0?void 0:e.replace(/\//gi,".").replace(/-/gi,"_"))!==null&&r!==void 0?r:this.name}get simplifiedFqn(){return this.fqn.replace(/\//gi,".").replace(/-/gi,"_")}};g_.ConstructsMakerModuleTarget=NV;var DV=class extends zB{get isModule(){return!1}get isProvider(){return!0}get srcMakName(){switch(this.targetLanguage){case Sy.Language.JAVA:return this.isNullProvider?"nullprovider":this.simplifiedName;case Sy.Language.CSHARP:return this.isNullProvider?"Providers.Null":this.simplifiedName;case Sy.Language.PYTHON:return this.simplifiedName;case Sy.Language.GO:return this.name.replace(/-/gi,"_");default:return this.constraint.fqn}}get trackingPayload(){return{name:this.name,fullName:this.source,version:this.version,type:"provider"}}typesPath(e){return`providers/${e}/index`}get isNullProvider(){return this.constraint.name==="null"}get simplifiedName(){return this.name.replace(/\//gi,".").replace(/-/gi,"_")}};g_.ConstructsMakerProviderTarget=DV});var One=x(Pm=>{"use strict";var SNt=Pm&&Pm.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ENt=Pm&&Pm.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xNt=Pm&&Pm.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&SNt(e,t,r);return ENt(e,t),e};Object.defineProperty(Pm,"__esModule",{value:!0});Pm.Errors=Pm.IsErrorType=void 0;var wNt=Gne(),ANt=XB(),RNt=xNt(tV());async function TNt(t,e){let r={command:t,product:"cdktn",version:`${ANt.DISPLAY_VERSION}`,dateTime:new Date,payload:e};await(0,wNt.ReportRequest)(r)}function BNt(t,e){return t&&t.__type===e}Pm.IsErrorType=BNt;function Fne(t,e){return(r,n=new Error,i)=>{TNt(e,{...i,message:r,type:t});let a=new Error(`${t} Error: ${r}`);return Object.entries(i||{}).forEach(([s,o])=>{a[s]=o}),a.__type=t,a.stack=n.stack,a}}var GV="unknown";Pm.Errors={Internal:Fne("Internal",GV),Usage:Fne("Usage",GV),External:Fne("External",GV),setScope(t){GV=t,RNt.configureScope(e=>e.setTransactionName(t))}}});var kne=x(CI=>{"use strict";Object.defineProperty(CI,"__esModule",{value:!0});CI.terraformVersion=CI.terraformBinaryName=void 0;var NNt=One(),DNt=aE();CI.terraformBinaryName=process.env.TERRAFORM_BINARY_NAME||"terraform";CI.terraformVersion=(0,DNt.exec)(CI.terraformBinaryName,["version","-json"],{}).then(t=>JSON.parse(t).terraform_version).catch(t=>NNt.Errors.Usage(`Unknown: Error loading terraform version ${t}`,t))});var Zne=x(K0=>{"use strict";var oRe=K0&&K0.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(K0,"__esModule",{value:!0});K0.getGradlePackageVersionFromBuild=K0.getGradlePackageVersion=K0.getDependencyInformationFromLine=K0.getGradleDependencies=K0.isGradleProject=void 0;var uRe=oRe(require("path")),FV=oRe(ZC()),v_=_I(),GNt=aE();function FNt(t){let e=uRe.default.join(t,"build.gradle");try{return FV.default.accessSync(e,FV.default.constants.R_OK|FV.default.constants.W_OK),!0}catch{return v_.logger.debug(`No build.gradle found at ${e}`),!1}}K0.isGradleProject=FNt;async function lRe(){let t;try{t=await(0,GNt.exec)("gradle",["dependencies","--console=plain"],{env:process.env})}catch(_){v_.logger.debug(`Unable to run 'gradle dependencies': ${_}`);return}let e=t.split(/\r\n|\r|\n/),r=e.findIndex(_=>_.includes("implementation - "));if(r===-1){v_.logger.debug(`Unable to find implementation section in output of 'gradle dependencies': ${t}`);return}let n=/^\s*$/,i=e.slice(r+1),a=i.findIndex(_=>n.test(_)),s=i.slice(0,a),o=e.findIndex(_=>_.includes("api - "));if(o===-1){v_.logger.debug(`Unable to find api section in output of 'gradle dependencies': ${t}`);return}let u=e.slice(o+1),l=u.findIndex(_=>n.test(_)),f=u.slice(0,l),h=/^\s*[+\\-]+\s*/,g=/\s+\([nc*]\)\s*$/;return[...s,...f].filter(_=>_!=="No dependencies").map(_=>_.replace(h,"").replace(g,""))}K0.getGradleDependencies=lRe;function cRe(t){let e=/^\s*([^:]+):([^:]+)(?::([^\s]+))?/,r=t.match(e);if(!r){v_.logger.debug("Unexpected format for gradle build. Please file an issue at https://cdk.tf/bug");return}return r[3]===void 0?{group:"",name:r[1],version:r[2]}:{group:r[1],name:r[2],version:r[3]}}K0.getDependencyInformationFromLine=cRe;async function ONt(t){let r={jsii:"jsii-runtime"}[t]||t;v_.logger.debug("Running 'gradle dependencies' to find package version",r);let n=await lRe();if(!n||n.length===0)return;for(let a of n)if(a.includes(`:${r}:`)){let s=cRe(a);return s?s.version:void 0}let i=await dRe(t);if(i)return i.version}K0.getGradlePackageVersion=ONt;async function dRe(t){let e=uRe.default.join(process.cwd(),"build.gradle"),n=(await FV.default.readFile(e,"utf-8")).split(/\r\n|\r|\n/),i=/^\s*dependencies\s*\{/i;if(n.findIndex(g=>i.test(g))===-1){v_.logger.debug("Unable to find dependencies section in output build.gradle");return}let s=n.findIndex(g=>g.includes(t));if(s===-1){v_.logger.debug(`Unable to find package ${t} in output build.gradle`);return}let o=n[s],l=new RegExp(`([^:]+):${t}(?::([^\\s]+))?`,"i").exec(o);if(l)return{group:l[1],name:t,version:l[2]||""};let h=new RegExp(`java/(.*)/${t}/([^/]+)/.*\\.jar`,"i").exec(o);if(h)return{group:h[1].replace(/\//g,"."),name:t,version:h[2]}}K0.getGradlePackageVersionFromBuild=dRe});var xRe=x(Ya=>{"use strict";var kNt=Ya&&Ya.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZNt=Ya&&Ya.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pRe=Ya&&Ya.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&kNt(e,t,r);return ZNt(e,t),e};Object.defineProperty(Ya,"__esModule",{value:!0});Ya.collectDebugInformation=Ya.getPackageVersion=Ya.getNodeVersion=Ya.getGoVersion=Ya.getPipenvVersion=Ya.getPipVersion=Ya.getPythonVersion=Ya.getGradleVersion=Ya.getMavenVersion=Ya.getJavaVersion=Ya.getDotnetVersion=Ya.getLanguage=void 0;var LNt=pRe(require("path")),Lne=pRe(require("os")),ql=_I(),Ey=aE(),WNt=kne(),VNt=XB(),hRe=ZC(),fRe=Zne();function mRe(t=process.cwd()){try{return JSON.parse((0,hRe.readFileSync)(LNt.resolve(t,"cdktf.json"),"utf-8")).language}catch{ql.logger.debug(`Unable to detect language in ${t}`);return}}Ya.getLanguage=mRe;async function xy(t,e){let r=()=>{};try{return(await(0,Ey.exec)(t,[e],{env:process.env,stdio:[void 0,void 0,"ignore"]},r,r)).trim().replace(/\r?\n|\r/g,"")}catch(n){ql.logger.debug(`Failed to run ${t} ${e}: ${n}`);return}}function gRe(){return xy("dotnet","--version")}Ya.getDotnetVersion=gRe;function vRe(){return xy("java","-version")}Ya.getJavaVersion=vRe;function yRe(){return xy("mvn","--version")}Ya.getMavenVersion=yRe;function bRe(){return xy("gradle","--version")}Ya.getGradleVersion=bRe;async function _Re(){return await xy("python3","--version")||await xy("python","--version")}Ya.getPythonVersion=_Re;function CRe(){return xy("pip","--version")}Ya.getPipVersion=CRe;function IRe(){return xy("pipenv","--version")}Ya.getPipenvVersion=IRe;function SRe(){return xy("go","version")}Ya.getGoVersion=SRe;function ERe(){return xy("node","--version")}Ya.getNodeVersion=ERe;async function PNt(t){return await(0,hRe.pathExists)("pnpm-lock.yaml")?HNt(t):MNt(t)}async function HNt(t){var e,r,n;let i;try{i=await(0,Ey.exec)("pnpm",["list",t,"--json"],{env:{...process.env}})}catch(s){ql.logger.debug(`Unable to run 'pnpm list ${t} --json': ${s}`);return}let a;try{a=JSON.parse(i)}catch(s){ql.logger.debug(`Unable to parse output of 'pnpm list ${t} --json': ${s}`);return}if(!a||!Array.isArray(a)||a.length===0||!(!((n=(r=(e=a[0])===null||e===void 0?void 0:e.dependencies)===null||r===void 0?void 0:r[t])===null||n===void 0)&&n.version)){ql.logger.debug(`Unable to find '${t}' in 'pnpm list ${t} --json': ${i}`);return}return a[0].dependencies[t].version}async function MNt(t){let e;try{e=await(0,Ey.exec)("npm",["list",t,"--json"],{env:{...process.env}})}catch(n){ql.logger.debug(`Unable to run 'npm list ${t} --json': ${n}`);return}let r;try{r=JSON.parse(e)}catch(n){ql.logger.debug(`Unable to parse output of 'npm list ${t} --json': ${n}`);return}if(!r.dependencies||!r.dependencies[t]||!r.dependencies[t].version){ql.logger.debug(`Unable to find '${t}' in 'npm list ${t} --json': ${e}`);return}return r.dependencies[t].version}async function UNt(t){let e;try{e=await(0,Ey.exec)("pipenv",["run","pip","show","-qq",t],{env:process.env}),e=await(0,Ey.exec)("pipenv",["run","pip","show",t],{env:process.env})}catch(i){ql.logger.debug(`Unable to run 'pipenv run pip show ${t}': ${i}`)}if(!e)try{e=await(0,Ey.exec)("pip",["show","-qq",t],{env:process.env}),e=await(0,Ey.exec)("pip",["show",t],{env:process.env})}catch(i){ql.logger.debug(`Unable to run 'pip show ${t}': ${i}`)}if(!e)return;let r=e.split(/\r\n|\r|\n/).find(i=>i.startsWith("Version:"));if(!r){ql.logger.debug(`Unable to find version in output of 'pipenv run pip show ${t}' / 'pip show ${t}': ${e}`);return}return r.split(":")[1].trim()}async function YNt(t){let r={jsii:"Amazon.JSII.Runtime",constructs:"Constructs",cdktf:"HashiCorp.Cdktf",cdktn:"Io.Cdktn"}[t]||t,n;try{n=await(0,Ey.exec)("dotnet",["list","package","--include-transitive"],{env:process.env})}catch(a){ql.logger.debug(`Unable to run 'dotnet list package --include-transitive': ${a}`);return}let i=n.split(/\r\n|\r|\n/).find(a=>a.includes(`> ${r}`));if(!i){ql.logger.debug(`Unable to find version for '${r}' in output of 'dotnet list package --include-transitive': ${n}`);return}return i.split(" ").reverse().find(a=>a!=="")}async function jNt(t){var e;let n={jsii:"jsii-runtime-go",cdktf:"github.com/hashicorp/terraform-cdk-go",cdktn:"github.com/open-constructs/cdk-terrain-go"}[t]||t,i;try{i=await(0,Ey.exec)("go",["list","-m","all"],{env:process.env})}catch(s){ql.logger.debug(`Unable to run 'go list -m all': ${s}`);return}let a=i.split(/\r\n|\r|\n/).find(s=>s.includes(n));if(!a){ql.logger.debug(`Unable to find version for '${n}' in output of 'go list -m all': ${i}`);return}return a.includes("=>")&&(ql.logger.debug(`Found local version for '${n}': ${a}`),a=a.split("=>")[0].trim()),(e=a.split(" ").pop())===null||e===void 0?void 0:e.replace("v","")}async function XNt(t){let r={jsii:"jsii-runtime"}[t]||t,n;try{n=await(0,Ey.exec)("mvn",["dependency:list"],{env:process.env})}catch(f){ql.logger.debug(`Unable to run 'mvn dependency:list': ${f}`);return}let i=n.split("The following files have been resolved")[1];if(!i){ql.logger.debug(`Unable to find resolution passage in output of 'mvn dependency:list': ${n}`);return}let a=i.split(/\r\n|\r|\n/).find(f=>f.includes(`${r}:`));if(!a){ql.logger.debug(`Unable to find version for '${r}' in output of 'mvn dependency:list': ${n}`);return}let s=`${r}:jar:`,o=a.indexOf(s)+s.length,l=a.indexOf(":compile");return a.substring(o,l)}async function qNt(t){return(0,fRe.isGradleProject)("./")?(0,fRe.getGradlePackageVersion)(t):XNt(t)}async function KB(t,e){let r=async()=>{},i=await({typescript:PNt,python:UNt,go:jNt,csharp:YNt,java:qNt}[t]||r)(e);return i??void 0}Ya.getPackageVersion=KB;async function zNt(){var t,e,r,n,i,a,s,o,u,l,f,h,g;let _={},w=mRe();_.language=w??null,_["cdktn-cli"]=VNt.DISPLAY_VERSION;let T=ERe();if(_.node=(t=await T)!==null&&t!==void 0?t:null,w){let D=KB(w,"cdktn"),G=KB(w,"cdktf"),O=KB(w,"constructs"),Z=KB(w,"jsii");_.cdktn=(e=await D)!==null&&e!==void 0?e:null,_.cdktf=(r=await G)!==null&&r!==void 0?r:null,_.constructs=(n=await O)!==null&&n!==void 0?n:null,_.jsii=(i=await Z)!==null&&i!==void 0?i:null}switch(_.terraform=await WNt.terraformVersion,_.arch=Lne.arch(),_.os=`${Lne.platform()} ${Lne.release()}`,w){case"python":{let D=_Re(),G=CRe(),O=IRe();_.python=(a=await D)!==null&&a!==void 0?a:null,_.pip=(s=await G)!==null&&s!==void 0?s:null,_.pipenv=(o=await O)!==null&&o!==void 0?o:null}break;case"java":{let D=vRe(),G=yRe(),O=bRe();_.java=(u=await D)!==null&&u!==void 0?u:null,_.maven=(l=await G)!==null&&l!==void 0?l:null,_.gradle=(f=await O)!==null&&f!==void 0?f:null}break;case"csharp":_.dotnet=(h=await gRe())!==null&&h!==void 0?h:null;break;case"go":_.go=(g=await SRe())!==null&&g!==void 0?g:null;break}return _}Ya.collectDebugInformation=zNt});var ARe=x(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});y_.CDKTF_DISABLE_PLUGIN_CACHE_ENV=y_.CHECKPOINT_DISABLE=y_.DISABLE_VERSION_CHECK=void 0;function wRe(t){return t==="true"||t==="1"}y_.DISABLE_VERSION_CHECK=wRe(process.env.DISABLE_VERSION_CHECK);y_.CHECKPOINT_DISABLE=!!process.env.CHECKPOINT_DISABLE;y_.CDKTF_DISABLE_PLUGIN_CACHE_ENV=wRe(process.env.CDKTF_DISABLE_PLUGIN_CACHE_ENV)});var TRe=x(RRe=>{"use strict";Object.defineProperty(RRe,"__esModule",{value:!0})});var NRe=x(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});oE.isNestedTypeAttribute=oE.isAttributeNestedType=void 0;function BRe(t){return typeof t=="object"&&!Array.isArray(t)&&typeof t.nesting_mode=="string"&&(typeof t.attributes=="object"||typeof t.attributes>"u")}oE.isAttributeNestedType=BRe;function KNt(t){return typeof t.nested_type<"u"&&BRe(t.nested_type)}oE.isNestedTypeAttribute=KNt});var Ln=x(_l=>{"use strict";var $Nt=_l&&_l.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$0=_l&&_l.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Nt(e,t,r)};Object.defineProperty(_l,"__esModule",{value:!0});$0(Gne(),_l);$0(sRe(),_l);$0(SV(),_l);$0(xRe(),_l);$0(ARe(),_l);$0(One(),_l);$0(Zne(),_l);$0(_I(),_l);$0(TRe(),_l);$0(NRe(),_l);$0(Ane(),_l);$0(kne(),_l);$0(aE(),_l);$0(XB(),_l)});var ORe=x((lbr,FRe)=>{"use strict";var JNt=function(e){return QNt(e)&&!eDt(e)};function QNt(t){return!!t&&typeof t=="object"}function eDt(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||nDt(t)}var tDt=typeof Symbol=="function"&&Symbol.for,rDt=tDt?Symbol.for("react.element"):60103;function nDt(t){return t.$$typeof===rDt}function iDt(t){return Array.isArray(t)?[]:{}}function $B(t,e){return e.clone!==!1&&e.isMergeableObject(t)?uE(iDt(t),t,e):t}function aDt(t,e,r){return t.concat(e).map(function(n){return $B(n,r)})}function sDt(t,e){if(!e.customMerge)return uE;var r=e.customMerge(t);return typeof r=="function"?r:uE}function oDt(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function DRe(t){return Object.keys(t).concat(oDt(t))}function GRe(t,e){try{return e in t}catch{return!1}}function uDt(t,e){return GRe(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function lDt(t,e,r){var n={};return r.isMergeableObject(t)&&DRe(t).forEach(function(i){n[i]=$B(t[i],r)}),DRe(e).forEach(function(i){uDt(t,i)||(GRe(t,i)&&r.isMergeableObject(e[i])?n[i]=sDt(i,r)(t[i],e[i],r):n[i]=$B(e[i],r))}),n}function uE(t,e,r){r=r||{},r.arrayMerge=r.arrayMerge||aDt,r.isMergeableObject=r.isMergeableObject||JNt,r.cloneUnlessOtherwiseSpecified=$B;var n=Array.isArray(e),i=Array.isArray(t),a=n===i;return a?n?r.arrayMerge(t,e,r):lDt(t,e,r):$B(e,r)}uE.all=function(e,r){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,i){return uE(n,i,r)},{})};var cDt=uE;FRe.exports=cDt});var Vp=x(G6=>{"use strict";var kRe=qn().fromCallback,Wp=Ei(),dDt=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Wp[t]=="function");Object.assign(G6,Wp);dDt.forEach(t=>{G6[t]=kRe(Wp[t])});G6.exists=function(t,e){return typeof e=="function"?Wp.exists(t,e):new Promise(r=>Wp.exists(t,r))};G6.read=function(t,e,r,n,i,a){return typeof a=="function"?Wp.read(t,e,r,n,i,a):new Promise((s,o)=>{Wp.read(t,e,r,n,i,(u,l,f)=>{if(u)return o(u);s({bytesRead:l,buffer:f})})})};G6.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Wp.write(t,e,...r):new Promise((n,i)=>{Wp.write(t,e,...r,(a,s,o)=>{if(a)return i(a);n({bytesWritten:s,buffer:o})})})};G6.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Wp.readv(t,e,...r):new Promise((n,i)=>{Wp.readv(t,e,...r,(a,s,o)=>{if(a)return i(a);n({bytesRead:s,buffers:o})})})};G6.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Wp.writev(t,e,...r):new Promise((n,i)=>{Wp.writev(t,e,...r,(a,s,o)=>{if(a)return i(a);n({bytesWritten:s,buffers:o})})})};typeof Wp.realpath.native=="function"?G6.realpath.native=kRe(Wp.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var LRe=x((dbr,ZRe)=>{"use strict";var fDt=require("path");ZRe.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(fDt.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}}});var HRe=x((fbr,Wne)=>{"use strict";var WRe=Vp(),{checkPath:VRe}=LRe(),PRe=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Wne.exports.makeDir=async(t,e)=>(VRe(t),WRe.mkdir(t,{mode:PRe(e),recursive:!0}));Wne.exports.makeDirSync=(t,e)=>(VRe(t),WRe.mkdirSync(t,{mode:PRe(e),recursive:!0}))});var E2=x((pbr,MRe)=>{"use strict";var pDt=qn().fromPromise,{makeDir:hDt,makeDirSync:Vne}=HRe(),Pne=pDt(hDt);MRe.exports={mkdirs:Pne,mkdirsSync:Vne,mkdirp:Pne,mkdirpSync:Vne,ensureDir:Pne,ensureDirSync:Vne}});var b_=x((hbr,YRe)=>{"use strict";var mDt=qn().fromPromise,URe=Vp();function gDt(t){return URe.access(t).then(()=>!0).catch(()=>!1)}YRe.exports={pathExists:mDt(gDt),pathExistsSync:URe.existsSync}});var Hne=x((mbr,jRe)=>{"use strict";var lE=Vp(),vDt=qn().fromPromise;async function yDt(t,e,r){let n=await lE.open(t,"r+"),i=null;try{await lE.futimes(n,e,r)}finally{try{await lE.close(n)}catch(a){i=a}}if(i)throw i}function bDt(t,e,r){let n=lE.openSync(t,"r+");return lE.futimesSync(n,e,r),lE.closeSync(n)}jRe.exports={utimesMillis:vDt(yDt),utimesMillisSync:bDt}});var II=x((gbr,KRe)=>{"use strict";var cE=Vp(),Zc=require("path"),XRe=qn().fromPromise;function _Dt(t,e,r){let n=r.dereference?i=>cE.stat(i,{bigint:!0}):i=>cE.lstat(i,{bigint:!0});return Promise.all([n(t),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,a])=>({srcStat:i,destStat:a}))}function CDt(t,e,r){let n,i=r.dereference?s=>cE.statSync(s,{bigint:!0}):s=>cE.lstatSync(s,{bigint:!0}),a=i(t);try{n=i(e)}catch(s){if(s.code==="ENOENT")return{srcStat:a,destStat:null};throw s}return{srcStat:a,destStat:n}}async function IDt(t,e,r,n){let{srcStat:i,destStat:a}=await _Dt(t,e,n);if(a){if(JB(i,a)){let s=Zc.basename(t),o=Zc.basename(e);if(r==="move"&&s!==o&&s.toLowerCase()===o.toLowerCase())return{srcStat:i,destStat:a,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!a.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&a.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&Mne(t,e))throw new Error(OV(t,e,r));return{srcStat:i,destStat:a}}function SDt(t,e,r,n){let{srcStat:i,destStat:a}=CDt(t,e,n);if(a){if(JB(i,a)){let s=Zc.basename(t),o=Zc.basename(e);if(r==="move"&&s!==o&&s.toLowerCase()===o.toLowerCase())return{srcStat:i,destStat:a,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!a.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&a.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&Mne(t,e))throw new Error(OV(t,e,r));return{srcStat:i,destStat:a}}async function qRe(t,e,r,n){let i=Zc.resolve(Zc.dirname(t)),a=Zc.resolve(Zc.dirname(r));if(a===i||a===Zc.parse(a).root)return;let s;try{s=await cE.stat(a,{bigint:!0})}catch(o){if(o.code==="ENOENT")return;throw o}if(JB(e,s))throw new Error(OV(t,r,n));return qRe(t,e,a,n)}function zRe(t,e,r,n){let i=Zc.resolve(Zc.dirname(t)),a=Zc.resolve(Zc.dirname(r));if(a===i||a===Zc.parse(a).root)return;let s;try{s=cE.statSync(a,{bigint:!0})}catch(o){if(o.code==="ENOENT")return;throw o}if(JB(e,s))throw new Error(OV(t,r,n));return zRe(t,e,a,n)}function JB(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}function Mne(t,e){let r=Zc.resolve(t).split(Zc.sep).filter(i=>i),n=Zc.resolve(e).split(Zc.sep).filter(i=>i);return r.every((i,a)=>n[a]===i)}function OV(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}KRe.exports={checkPaths:XRe(IDt),checkPathsSync:SDt,checkParentPaths:XRe(qRe),checkParentPathsSync:zRe,isSrcSubdir:Mne,areIdentical:JB}});var JRe=x((vbr,$Re)=>{"use strict";async function EDt(t,e){let r=[];for await(let n of t)r.push(e(n).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(r.map(n=>n.then(i=>{if(i!==null)throw i})))}$Re.exports={asyncIteratorConcurrentProcess:EDt}});var nTe=x((ybr,rTe)=>{"use strict";var Tf=Vp(),QB=require("path"),{mkdirs:xDt}=E2(),{pathExists:wDt}=b_(),{utimesMillis:ADt}=Hne(),eN=II(),{asyncIteratorConcurrentProcess:RDt}=JRe();async function TDt(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
97
+ See https://cdktn.io/docs/telemetry for more
98
+ information on how to disable it.`)}kc.getUserId=iRe;async function aRe(t){if(process.env.CHECKPOINT_DISABLE)return;t.runID||(t.runID=(0,tRe.v4)()),t.dateTime||(t.dateTime=new Date),t.arch||(t.arch=TV.arch()),t.os||(t.os=TV.platform());let e=QAe.default.isCI?QAe.default.name||"unknown":!1;!t.userId&&!e&&(t.userId=iRe()),e&&(t.ci=e),t.projectId=t.projectId||nRe();let r=JSON.stringify(t);if(r.length>eRe){Dne.logger.warn(`Skipped sending telemetry as the request body size was ${r.length} bytes. The limit is ${eRe} bytes`);return}try{await CNt(`${yNt}telemetry/${t.product}`,r)}catch(n){(0,Dne.processLoggerError)(n.message)}}kc.ReportRequest=aRe});var sRe=x(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});g_.ConstructsMakerProviderTarget=g_.ConstructsMakerModuleTarget=g_.ConstructsMakerTarget=void 0;var Sy=SV(),zB=class{constructor(e,r){this.constraint=e,this.targetLanguage=r,this.constraint instanceof Sy.TerraformModuleConstraint?this.fileName=`${this.typesPath(this.constraint.fileName)}.ts`:this.fileName=`${this.typesPath(this.constraint.name)}.ts`}static from(e,r){return e instanceof Sy.TerraformModuleConstraint?new NV(e,r):new DV(e,r)}get version(){return this.constraint.version}get source(){return this.constraint.source}get name(){return this.constraint.name}get fqn(){return this.constraint.fqn}get namespace(){return this.constraint.namespace}get moduleKey(){return this.fqn.replace(/\//gi,"_")}};g_.ConstructsMakerTarget=zB;var NV=class extends zB{get isModule(){return!0}get isProvider(){return!1}get srcMakName(){switch(this.targetLanguage){case Sy.Language.GO:return this.name.replace(/-/gi,"_");case Sy.Language.JAVA:case Sy.Language.CSHARP:case Sy.Language.PYTHON:return this.simplifiedFqn;default:return this.simplifiedName}}get trackingPayload(){return{name:this.name,fullName:this.fqn,version:this.version,type:"module"}}typesPath(e){return`modules/${e}`}get simplifiedName(){var e,r;return(r=(e=this.namespace)===null||e===void 0?void 0:e.replace(/\//gi,".").replace(/-/gi,"_"))!==null&&r!==void 0?r:this.name}get simplifiedFqn(){return this.fqn.replace(/\//gi,".").replace(/-/gi,"_")}};g_.ConstructsMakerModuleTarget=NV;var DV=class extends zB{get isModule(){return!1}get isProvider(){return!0}get srcMakName(){switch(this.targetLanguage){case Sy.Language.JAVA:return this.isNullProvider?"nullprovider":this.simplifiedName;case Sy.Language.CSHARP:return this.isNullProvider?"Providers.Null":this.simplifiedName;case Sy.Language.PYTHON:return this.simplifiedName;case Sy.Language.GO:return this.name.replace(/-/gi,"_");default:return this.constraint.fqn}}get trackingPayload(){return{name:this.name,fullName:this.source,version:this.version,type:"provider"}}typesPath(e){return`providers/${e}/index`}get isNullProvider(){return this.constraint.name==="null"}get simplifiedName(){return this.name.replace(/\//gi,".").replace(/-/gi,"_")}};g_.ConstructsMakerProviderTarget=DV});var One=x(Pm=>{"use strict";var SNt=Pm&&Pm.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ENt=Pm&&Pm.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xNt=Pm&&Pm.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&SNt(e,t,r);return ENt(e,t),e};Object.defineProperty(Pm,"__esModule",{value:!0});Pm.Errors=Pm.IsErrorType=void 0;var wNt=Gne(),ANt=XB(),RNt=xNt(tV());async function TNt(t,e){let r={command:t,product:"cdktn",version:`${ANt.DISPLAY_VERSION}`,dateTime:new Date,payload:e};await(0,wNt.ReportRequest)(r)}function BNt(t,e){return t&&t.__type===e}Pm.IsErrorType=BNt;function Fne(t,e){return(r,n=new Error,i)=>{TNt(e,{...i,message:r,type:t});let a=new Error(`${t} Error: ${r}`);return Object.entries(i||{}).forEach(([s,o])=>{a[s]=o}),a.__type=t,a.stack=n.stack,a}}var GV="unknown";Pm.Errors={Internal:Fne("Internal",GV),Usage:Fne("Usage",GV),External:Fne("External",GV),setScope(t){GV=t,RNt.configureScope(e=>e.setTransactionName(t))}}});var kne=x(CI=>{"use strict";Object.defineProperty(CI,"__esModule",{value:!0});CI.terraformVersion=CI.terraformBinaryName=void 0;var NNt=One(),DNt=aE();CI.terraformBinaryName=process.env.TERRAFORM_BINARY_NAME||"terraform";CI.terraformVersion=(0,DNt.exec)(CI.terraformBinaryName,["version","-json"],{}).then(t=>JSON.parse(t).terraform_version).catch(t=>NNt.Errors.Usage(`Unknown: Error loading terraform version ${t}`,t))});var Zne=x(K0=>{"use strict";var oRe=K0&&K0.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(K0,"__esModule",{value:!0});K0.getGradlePackageVersionFromBuild=K0.getGradlePackageVersion=K0.getDependencyInformationFromLine=K0.getGradleDependencies=K0.isGradleProject=void 0;var uRe=oRe(require("path")),FV=oRe(ZC()),v_=_I(),GNt=aE();function FNt(t){let e=uRe.default.join(t,"build.gradle");try{return FV.default.accessSync(e,FV.default.constants.R_OK|FV.default.constants.W_OK),!0}catch{return v_.logger.debug(`No build.gradle found at ${e}`),!1}}K0.isGradleProject=FNt;async function lRe(){let t;try{t=await(0,GNt.exec)("gradle",["dependencies","--console=plain"],{env:process.env})}catch(_){v_.logger.debug(`Unable to run 'gradle dependencies': ${_}`);return}let e=t.split(/\r\n|\r|\n/),r=e.findIndex(_=>_.includes("implementation - "));if(r===-1){v_.logger.debug(`Unable to find implementation section in output of 'gradle dependencies': ${t}`);return}let n=/^\s*$/,i=e.slice(r+1),a=i.findIndex(_=>n.test(_)),s=i.slice(0,a),o=e.findIndex(_=>_.includes("api - "));if(o===-1){v_.logger.debug(`Unable to find api section in output of 'gradle dependencies': ${t}`);return}let u=e.slice(o+1),l=u.findIndex(_=>n.test(_)),f=u.slice(0,l),h=/^\s*[+\\-]+\s*/,g=/\s+\([nc*]\)\s*$/;return[...s,...f].filter(_=>_!=="No dependencies").map(_=>_.replace(h,"").replace(g,""))}K0.getGradleDependencies=lRe;function cRe(t){let e=/^\s*([^:]+):([^:]+)(?::([^\s]+))?/,r=t.match(e);if(!r){v_.logger.debug("Unexpected format for gradle build. Please file an issue at https://github.com/open-constructs/cdk-terrain/issues/new?assignees=&labels=bug%2Cnew&template=bug-report.yml&title=");return}return r[3]===void 0?{group:"",name:r[1],version:r[2]}:{group:r[1],name:r[2],version:r[3]}}K0.getDependencyInformationFromLine=cRe;async function ONt(t){let r={jsii:"jsii-runtime"}[t]||t;v_.logger.debug("Running 'gradle dependencies' to find package version",r);let n=await lRe();if(!n||n.length===0)return;for(let a of n)if(a.includes(`:${r}:`)){let s=cRe(a);return s?s.version:void 0}let i=await dRe(t);if(i)return i.version}K0.getGradlePackageVersion=ONt;async function dRe(t){let e=uRe.default.join(process.cwd(),"build.gradle"),n=(await FV.default.readFile(e,"utf-8")).split(/\r\n|\r|\n/),i=/^\s*dependencies\s*\{/i;if(n.findIndex(g=>i.test(g))===-1){v_.logger.debug("Unable to find dependencies section in output build.gradle");return}let s=n.findIndex(g=>g.includes(t));if(s===-1){v_.logger.debug(`Unable to find package ${t} in output build.gradle`);return}let o=n[s],l=new RegExp(`([^:]+):${t}(?::([^\\s]+))?`,"i").exec(o);if(l)return{group:l[1],name:t,version:l[2]||""};let h=new RegExp(`java/(.*)/${t}/([^/]+)/.*\\.jar`,"i").exec(o);if(h)return{group:h[1].replace(/\//g,"."),name:t,version:h[2]}}K0.getGradlePackageVersionFromBuild=dRe});var xRe=x(Ya=>{"use strict";var kNt=Ya&&Ya.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZNt=Ya&&Ya.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pRe=Ya&&Ya.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&kNt(e,t,r);return ZNt(e,t),e};Object.defineProperty(Ya,"__esModule",{value:!0});Ya.collectDebugInformation=Ya.getPackageVersion=Ya.getNodeVersion=Ya.getGoVersion=Ya.getPipenvVersion=Ya.getPipVersion=Ya.getPythonVersion=Ya.getGradleVersion=Ya.getMavenVersion=Ya.getJavaVersion=Ya.getDotnetVersion=Ya.getLanguage=void 0;var LNt=pRe(require("path")),Lne=pRe(require("os")),ql=_I(),Ey=aE(),WNt=kne(),VNt=XB(),hRe=ZC(),fRe=Zne();function mRe(t=process.cwd()){try{return JSON.parse((0,hRe.readFileSync)(LNt.resolve(t,"cdktf.json"),"utf-8")).language}catch{ql.logger.debug(`Unable to detect language in ${t}`);return}}Ya.getLanguage=mRe;async function xy(t,e){let r=()=>{};try{return(await(0,Ey.exec)(t,[e],{env:process.env,stdio:[void 0,void 0,"ignore"]},r,r)).trim().replace(/\r?\n|\r/g,"")}catch(n){ql.logger.debug(`Failed to run ${t} ${e}: ${n}`);return}}function gRe(){return xy("dotnet","--version")}Ya.getDotnetVersion=gRe;function vRe(){return xy("java","-version")}Ya.getJavaVersion=vRe;function yRe(){return xy("mvn","--version")}Ya.getMavenVersion=yRe;function bRe(){return xy("gradle","--version")}Ya.getGradleVersion=bRe;async function _Re(){return await xy("python3","--version")||await xy("python","--version")}Ya.getPythonVersion=_Re;function CRe(){return xy("pip","--version")}Ya.getPipVersion=CRe;function IRe(){return xy("pipenv","--version")}Ya.getPipenvVersion=IRe;function SRe(){return xy("go","version")}Ya.getGoVersion=SRe;function ERe(){return xy("node","--version")}Ya.getNodeVersion=ERe;async function PNt(t){return await(0,hRe.pathExists)("pnpm-lock.yaml")?HNt(t):MNt(t)}async function HNt(t){var e,r,n;let i;try{i=await(0,Ey.exec)("pnpm",["list",t,"--json"],{env:{...process.env}})}catch(s){ql.logger.debug(`Unable to run 'pnpm list ${t} --json': ${s}`);return}let a;try{a=JSON.parse(i)}catch(s){ql.logger.debug(`Unable to parse output of 'pnpm list ${t} --json': ${s}`);return}if(!a||!Array.isArray(a)||a.length===0||!(!((n=(r=(e=a[0])===null||e===void 0?void 0:e.dependencies)===null||r===void 0?void 0:r[t])===null||n===void 0)&&n.version)){ql.logger.debug(`Unable to find '${t}' in 'pnpm list ${t} --json': ${i}`);return}return a[0].dependencies[t].version}async function MNt(t){let e;try{e=await(0,Ey.exec)("npm",["list",t,"--json"],{env:{...process.env}})}catch(n){ql.logger.debug(`Unable to run 'npm list ${t} --json': ${n}`);return}let r;try{r=JSON.parse(e)}catch(n){ql.logger.debug(`Unable to parse output of 'npm list ${t} --json': ${n}`);return}if(!r.dependencies||!r.dependencies[t]||!r.dependencies[t].version){ql.logger.debug(`Unable to find '${t}' in 'npm list ${t} --json': ${e}`);return}return r.dependencies[t].version}async function UNt(t){let e;try{e=await(0,Ey.exec)("pipenv",["run","pip","show","-qq",t],{env:process.env}),e=await(0,Ey.exec)("pipenv",["run","pip","show",t],{env:process.env})}catch(i){ql.logger.debug(`Unable to run 'pipenv run pip show ${t}': ${i}`)}if(!e)try{e=await(0,Ey.exec)("pip",["show","-qq",t],{env:process.env}),e=await(0,Ey.exec)("pip",["show",t],{env:process.env})}catch(i){ql.logger.debug(`Unable to run 'pip show ${t}': ${i}`)}if(!e)return;let r=e.split(/\r\n|\r|\n/).find(i=>i.startsWith("Version:"));if(!r){ql.logger.debug(`Unable to find version in output of 'pipenv run pip show ${t}' / 'pip show ${t}': ${e}`);return}return r.split(":")[1].trim()}async function YNt(t){let r={jsii:"Amazon.JSII.Runtime",constructs:"Constructs",cdktf:"HashiCorp.Cdktf",cdktn:"Io.Cdktn"}[t]||t,n;try{n=await(0,Ey.exec)("dotnet",["list","package","--include-transitive"],{env:process.env})}catch(a){ql.logger.debug(`Unable to run 'dotnet list package --include-transitive': ${a}`);return}let i=n.split(/\r\n|\r|\n/).find(a=>a.includes(`> ${r}`));if(!i){ql.logger.debug(`Unable to find version for '${r}' in output of 'dotnet list package --include-transitive': ${n}`);return}return i.split(" ").reverse().find(a=>a!=="")}async function jNt(t){var e;let n={jsii:"jsii-runtime-go",cdktf:"github.com/hashicorp/terraform-cdk-go",cdktn:"github.com/open-constructs/cdk-terrain-go"}[t]||t,i;try{i=await(0,Ey.exec)("go",["list","-m","all"],{env:process.env})}catch(s){ql.logger.debug(`Unable to run 'go list -m all': ${s}`);return}let a=i.split(/\r\n|\r|\n/).find(s=>s.includes(n));if(!a){ql.logger.debug(`Unable to find version for '${n}' in output of 'go list -m all': ${i}`);return}return a.includes("=>")&&(ql.logger.debug(`Found local version for '${n}': ${a}`),a=a.split("=>")[0].trim()),(e=a.split(" ").pop())===null||e===void 0?void 0:e.replace("v","")}async function XNt(t){let r={jsii:"jsii-runtime"}[t]||t,n;try{n=await(0,Ey.exec)("mvn",["dependency:list"],{env:process.env})}catch(f){ql.logger.debug(`Unable to run 'mvn dependency:list': ${f}`);return}let i=n.split("The following files have been resolved")[1];if(!i){ql.logger.debug(`Unable to find resolution passage in output of 'mvn dependency:list': ${n}`);return}let a=i.split(/\r\n|\r|\n/).find(f=>f.includes(`${r}:`));if(!a){ql.logger.debug(`Unable to find version for '${r}' in output of 'mvn dependency:list': ${n}`);return}let s=`${r}:jar:`,o=a.indexOf(s)+s.length,l=a.indexOf(":compile");return a.substring(o,l)}async function qNt(t){return(0,fRe.isGradleProject)("./")?(0,fRe.getGradlePackageVersion)(t):XNt(t)}async function KB(t,e){let r=async()=>{},i=await({typescript:PNt,python:UNt,go:jNt,csharp:YNt,java:qNt}[t]||r)(e);return i??void 0}Ya.getPackageVersion=KB;async function zNt(){var t,e,r,n,i,a,s,o,u,l,f,h,g;let _={},w=mRe();_.language=w??null,_["cdktn-cli"]=VNt.DISPLAY_VERSION;let T=ERe();if(_.node=(t=await T)!==null&&t!==void 0?t:null,w){let D=KB(w,"cdktn"),G=KB(w,"cdktf"),O=KB(w,"constructs"),Z=KB(w,"jsii");_.cdktn=(e=await D)!==null&&e!==void 0?e:null,_.cdktf=(r=await G)!==null&&r!==void 0?r:null,_.constructs=(n=await O)!==null&&n!==void 0?n:null,_.jsii=(i=await Z)!==null&&i!==void 0?i:null}switch(_.terraform=await WNt.terraformVersion,_.arch=Lne.arch(),_.os=`${Lne.platform()} ${Lne.release()}`,w){case"python":{let D=_Re(),G=CRe(),O=IRe();_.python=(a=await D)!==null&&a!==void 0?a:null,_.pip=(s=await G)!==null&&s!==void 0?s:null,_.pipenv=(o=await O)!==null&&o!==void 0?o:null}break;case"java":{let D=vRe(),G=yRe(),O=bRe();_.java=(u=await D)!==null&&u!==void 0?u:null,_.maven=(l=await G)!==null&&l!==void 0?l:null,_.gradle=(f=await O)!==null&&f!==void 0?f:null}break;case"csharp":_.dotnet=(h=await gRe())!==null&&h!==void 0?h:null;break;case"go":_.go=(g=await SRe())!==null&&g!==void 0?g:null;break}return _}Ya.collectDebugInformation=zNt});var ARe=x(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});y_.CDKTF_DISABLE_PLUGIN_CACHE_ENV=y_.CHECKPOINT_DISABLE=y_.DISABLE_VERSION_CHECK=void 0;function wRe(t){return t==="true"||t==="1"}y_.DISABLE_VERSION_CHECK=wRe(process.env.DISABLE_VERSION_CHECK);y_.CHECKPOINT_DISABLE=!!process.env.CHECKPOINT_DISABLE;y_.CDKTF_DISABLE_PLUGIN_CACHE_ENV=wRe(process.env.CDKTF_DISABLE_PLUGIN_CACHE_ENV)});var TRe=x(RRe=>{"use strict";Object.defineProperty(RRe,"__esModule",{value:!0})});var NRe=x(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});oE.isNestedTypeAttribute=oE.isAttributeNestedType=void 0;function BRe(t){return typeof t=="object"&&!Array.isArray(t)&&typeof t.nesting_mode=="string"&&(typeof t.attributes=="object"||typeof t.attributes>"u")}oE.isAttributeNestedType=BRe;function KNt(t){return typeof t.nested_type<"u"&&BRe(t.nested_type)}oE.isNestedTypeAttribute=KNt});var Ln=x(_l=>{"use strict";var $Nt=_l&&_l.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$0=_l&&_l.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Nt(e,t,r)};Object.defineProperty(_l,"__esModule",{value:!0});$0(Gne(),_l);$0(sRe(),_l);$0(SV(),_l);$0(xRe(),_l);$0(ARe(),_l);$0(One(),_l);$0(Zne(),_l);$0(_I(),_l);$0(TRe(),_l);$0(NRe(),_l);$0(Ane(),_l);$0(kne(),_l);$0(aE(),_l);$0(XB(),_l)});var ORe=x((lbr,FRe)=>{"use strict";var JNt=function(e){return QNt(e)&&!eDt(e)};function QNt(t){return!!t&&typeof t=="object"}function eDt(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||nDt(t)}var tDt=typeof Symbol=="function"&&Symbol.for,rDt=tDt?Symbol.for("react.element"):60103;function nDt(t){return t.$$typeof===rDt}function iDt(t){return Array.isArray(t)?[]:{}}function $B(t,e){return e.clone!==!1&&e.isMergeableObject(t)?uE(iDt(t),t,e):t}function aDt(t,e,r){return t.concat(e).map(function(n){return $B(n,r)})}function sDt(t,e){if(!e.customMerge)return uE;var r=e.customMerge(t);return typeof r=="function"?r:uE}function oDt(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function DRe(t){return Object.keys(t).concat(oDt(t))}function GRe(t,e){try{return e in t}catch{return!1}}function uDt(t,e){return GRe(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function lDt(t,e,r){var n={};return r.isMergeableObject(t)&&DRe(t).forEach(function(i){n[i]=$B(t[i],r)}),DRe(e).forEach(function(i){uDt(t,i)||(GRe(t,i)&&r.isMergeableObject(e[i])?n[i]=sDt(i,r)(t[i],e[i],r):n[i]=$B(e[i],r))}),n}function uE(t,e,r){r=r||{},r.arrayMerge=r.arrayMerge||aDt,r.isMergeableObject=r.isMergeableObject||JNt,r.cloneUnlessOtherwiseSpecified=$B;var n=Array.isArray(e),i=Array.isArray(t),a=n===i;return a?n?r.arrayMerge(t,e,r):lDt(t,e,r):$B(e,r)}uE.all=function(e,r){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,i){return uE(n,i,r)},{})};var cDt=uE;FRe.exports=cDt});var Vp=x(G6=>{"use strict";var kRe=qn().fromCallback,Wp=Ei(),dDt=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Wp[t]=="function");Object.assign(G6,Wp);dDt.forEach(t=>{G6[t]=kRe(Wp[t])});G6.exists=function(t,e){return typeof e=="function"?Wp.exists(t,e):new Promise(r=>Wp.exists(t,r))};G6.read=function(t,e,r,n,i,a){return typeof a=="function"?Wp.read(t,e,r,n,i,a):new Promise((s,o)=>{Wp.read(t,e,r,n,i,(u,l,f)=>{if(u)return o(u);s({bytesRead:l,buffer:f})})})};G6.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Wp.write(t,e,...r):new Promise((n,i)=>{Wp.write(t,e,...r,(a,s,o)=>{if(a)return i(a);n({bytesWritten:s,buffer:o})})})};G6.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Wp.readv(t,e,...r):new Promise((n,i)=>{Wp.readv(t,e,...r,(a,s,o)=>{if(a)return i(a);n({bytesRead:s,buffers:o})})})};G6.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Wp.writev(t,e,...r):new Promise((n,i)=>{Wp.writev(t,e,...r,(a,s,o)=>{if(a)return i(a);n({bytesWritten:s,buffers:o})})})};typeof Wp.realpath.native=="function"?G6.realpath.native=kRe(Wp.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var LRe=x((dbr,ZRe)=>{"use strict";var fDt=require("path");ZRe.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(fDt.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}}});var HRe=x((fbr,Wne)=>{"use strict";var WRe=Vp(),{checkPath:VRe}=LRe(),PRe=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Wne.exports.makeDir=async(t,e)=>(VRe(t),WRe.mkdir(t,{mode:PRe(e),recursive:!0}));Wne.exports.makeDirSync=(t,e)=>(VRe(t),WRe.mkdirSync(t,{mode:PRe(e),recursive:!0}))});var E2=x((pbr,MRe)=>{"use strict";var pDt=qn().fromPromise,{makeDir:hDt,makeDirSync:Vne}=HRe(),Pne=pDt(hDt);MRe.exports={mkdirs:Pne,mkdirsSync:Vne,mkdirp:Pne,mkdirpSync:Vne,ensureDir:Pne,ensureDirSync:Vne}});var b_=x((hbr,YRe)=>{"use strict";var mDt=qn().fromPromise,URe=Vp();function gDt(t){return URe.access(t).then(()=>!0).catch(()=>!1)}YRe.exports={pathExists:mDt(gDt),pathExistsSync:URe.existsSync}});var Hne=x((mbr,jRe)=>{"use strict";var lE=Vp(),vDt=qn().fromPromise;async function yDt(t,e,r){let n=await lE.open(t,"r+"),i=null;try{await lE.futimes(n,e,r)}finally{try{await lE.close(n)}catch(a){i=a}}if(i)throw i}function bDt(t,e,r){let n=lE.openSync(t,"r+");return lE.futimesSync(n,e,r),lE.closeSync(n)}jRe.exports={utimesMillis:vDt(yDt),utimesMillisSync:bDt}});var II=x((gbr,KRe)=>{"use strict";var cE=Vp(),Zc=require("path"),XRe=qn().fromPromise;function _Dt(t,e,r){let n=r.dereference?i=>cE.stat(i,{bigint:!0}):i=>cE.lstat(i,{bigint:!0});return Promise.all([n(t),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,a])=>({srcStat:i,destStat:a}))}function CDt(t,e,r){let n,i=r.dereference?s=>cE.statSync(s,{bigint:!0}):s=>cE.lstatSync(s,{bigint:!0}),a=i(t);try{n=i(e)}catch(s){if(s.code==="ENOENT")return{srcStat:a,destStat:null};throw s}return{srcStat:a,destStat:n}}async function IDt(t,e,r,n){let{srcStat:i,destStat:a}=await _Dt(t,e,n);if(a){if(JB(i,a)){let s=Zc.basename(t),o=Zc.basename(e);if(r==="move"&&s!==o&&s.toLowerCase()===o.toLowerCase())return{srcStat:i,destStat:a,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!a.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&a.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&Mne(t,e))throw new Error(OV(t,e,r));return{srcStat:i,destStat:a}}function SDt(t,e,r,n){let{srcStat:i,destStat:a}=CDt(t,e,n);if(a){if(JB(i,a)){let s=Zc.basename(t),o=Zc.basename(e);if(r==="move"&&s!==o&&s.toLowerCase()===o.toLowerCase())return{srcStat:i,destStat:a,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!a.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&a.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&Mne(t,e))throw new Error(OV(t,e,r));return{srcStat:i,destStat:a}}async function qRe(t,e,r,n){let i=Zc.resolve(Zc.dirname(t)),a=Zc.resolve(Zc.dirname(r));if(a===i||a===Zc.parse(a).root)return;let s;try{s=await cE.stat(a,{bigint:!0})}catch(o){if(o.code==="ENOENT")return;throw o}if(JB(e,s))throw new Error(OV(t,r,n));return qRe(t,e,a,n)}function zRe(t,e,r,n){let i=Zc.resolve(Zc.dirname(t)),a=Zc.resolve(Zc.dirname(r));if(a===i||a===Zc.parse(a).root)return;let s;try{s=cE.statSync(a,{bigint:!0})}catch(o){if(o.code==="ENOENT")return;throw o}if(JB(e,s))throw new Error(OV(t,r,n));return zRe(t,e,a,n)}function JB(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}function Mne(t,e){let r=Zc.resolve(t).split(Zc.sep).filter(i=>i),n=Zc.resolve(e).split(Zc.sep).filter(i=>i);return r.every((i,a)=>n[a]===i)}function OV(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}KRe.exports={checkPaths:XRe(IDt),checkPathsSync:SDt,checkParentPaths:XRe(qRe),checkParentPathsSync:zRe,isSrcSubdir:Mne,areIdentical:JB}});var JRe=x((vbr,$Re)=>{"use strict";async function EDt(t,e){let r=[];for await(let n of t)r.push(e(n).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(r.map(n=>n.then(i=>{if(i!==null)throw i})))}$Re.exports={asyncIteratorConcurrentProcess:EDt}});var nTe=x((ybr,rTe)=>{"use strict";var Tf=Vp(),QB=require("path"),{mkdirs:xDt}=E2(),{pathExists:wDt}=b_(),{utimesMillis:ADt}=Hne(),eN=II(),{asyncIteratorConcurrentProcess:RDt}=JRe();async function TDt(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
99
99
 
100
100
  see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await eN.checkPaths(t,e,"copy",r);if(await eN.checkParentPaths(t,n,e,"copy"),!await eTe(t,e,r))return;let s=QB.dirname(e);await wDt(s)||await xDt(s),await tTe(i,t,e,r)}async function eTe(t,e,r){return r.filter?r.filter(t,e):!0}async function tTe(t,e,r,n){let a=await(n.dereference?Tf.stat:Tf.lstat)(e);if(a.isDirectory())return GDt(a,t,e,r,n);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return BDt(a,t,e,r,n);if(a.isSymbolicLink())return FDt(t,e,r,n);throw a.isSocket()?new Error(`Cannot copy a socket file: ${e}`):a.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function BDt(t,e,r,n,i){if(!e)return QRe(t,r,n,i);if(i.overwrite)return await Tf.unlink(n),QRe(t,r,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}async function QRe(t,e,r,n){if(await Tf.copyFile(e,r),n.preserveTimestamps){NDt(t.mode)&&await DDt(r,t.mode);let i=await Tf.stat(e);await ADt(r,i.atime,i.mtime)}return Tf.chmod(r,t.mode)}function NDt(t){return(t&128)===0}function DDt(t,e){return Tf.chmod(t,e|128)}async function GDt(t,e,r,n,i){e||await Tf.mkdir(n),await RDt(await Tf.opendir(r),async a=>{let s=QB.join(r,a.name),o=QB.join(n,a.name);if(await eTe(s,o,i)){let{destStat:l}=await eN.checkPaths(s,o,"copy",i);await tTe(l,s,o,i)}}),e||await Tf.chmod(n,t.mode)}async function FDt(t,e,r,n){let i=await Tf.readlink(e);if(n.dereference&&(i=QB.resolve(process.cwd(),i)),!t)return Tf.symlink(i,r);let a=null;try{a=await Tf.readlink(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Tf.symlink(i,r);throw s}if(n.dereference&&(a=QB.resolve(process.cwd(),a)),i!==a){if(eN.isSrcSubdir(i,a))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${a}'.`);if(eN.isSrcSubdir(a,i))throw new Error(`Cannot overwrite '${a}' with '${i}'.`)}return await Tf.unlink(r),Tf.symlink(i,r)}rTe.exports=TDt});var uTe=x((bbr,oTe)=>{"use strict";var Pp=Ei(),tN=require("path"),ODt=E2().mkdirsSync,kDt=Hne().utimesMillisSync,rN=II();function ZDt(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
101
101
 
102
102
  see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=rN.checkPathsSync(t,e,"copy",r);if(rN.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let a=tN.dirname(e);return Pp.existsSync(a)||ODt(a),iTe(i,t,e,r)}function iTe(t,e,r,n){let a=(n.dereference?Pp.statSync:Pp.lstatSync)(e);if(a.isDirectory())return UDt(a,t,e,r,n);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return LDt(a,t,e,r,n);if(a.isSymbolicLink())return XDt(t,e,r,n);throw a.isSocket()?new Error(`Cannot copy a socket file: ${e}`):a.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function LDt(t,e,r,n,i){return e?WDt(t,r,n,i):aTe(t,r,n,i)}function WDt(t,e,r,n){if(n.overwrite)return Pp.unlinkSync(r),aTe(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function aTe(t,e,r,n){return Pp.copyFileSync(e,r),n.preserveTimestamps&&VDt(t.mode,e,r),Une(r,t.mode)}function VDt(t,e,r){return PDt(t)&&HDt(r,t),MDt(e,r)}function PDt(t){return(t&128)===0}function HDt(t,e){return Une(t,e|128)}function Une(t,e){return Pp.chmodSync(t,e)}function MDt(t,e){let r=Pp.statSync(t);return kDt(e,r.atime,r.mtime)}function UDt(t,e,r,n,i){return e?sTe(r,n,i):YDt(t.mode,r,n,i)}function YDt(t,e,r,n){return Pp.mkdirSync(r),sTe(e,r,n),Une(r,t)}function sTe(t,e,r){let n=Pp.opendirSync(t);try{let i;for(;(i=n.readSync())!==null;)jDt(i.name,t,e,r)}finally{n.closeSync()}}function jDt(t,e,r,n){let i=tN.join(e,t),a=tN.join(r,t);if(n.filter&&!n.filter(i,a))return;let{destStat:s}=rN.checkPathsSync(i,a,"copy",n);return iTe(s,i,a,n)}function XDt(t,e,r,n){let i=Pp.readlinkSync(e);if(n.dereference&&(i=tN.resolve(process.cwd(),i)),t){let a;try{a=Pp.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Pp.symlinkSync(i,r);throw s}if(n.dereference&&(a=tN.resolve(process.cwd(),a)),i!==a){if(rN.isSrcSubdir(i,a))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${a}'.`);if(rN.isSrcSubdir(a,i))throw new Error(`Cannot overwrite '${a}' with '${i}'.`)}return qDt(i,r)}else return Pp.symlinkSync(i,r)}function qDt(t,e){return Pp.unlinkSync(e),Pp.symlinkSync(t,e)}oTe.exports=ZDt});var kV=x((_br,lTe)=>{"use strict";var zDt=qn().fromPromise;lTe.exports={copy:zDt(nTe()),copySync:uTe()}});var nN=x((Cbr,dTe)=>{"use strict";var cTe=Ei(),KDt=qn().fromCallback;function $Dt(t,e){cTe.rm(t,{recursive:!0,force:!0},e)}function JDt(t){cTe.rmSync(t,{recursive:!0,force:!0})}dTe.exports={remove:KDt($Dt),removeSync:JDt}});var bTe=x((Ibr,yTe)=>{"use strict";var QDt=qn().fromPromise,hTe=Vp(),mTe=require("path"),gTe=E2(),vTe=nN(),fTe=QDt(async function(e){let r;try{r=await hTe.readdir(e)}catch{return gTe.mkdirs(e)}return Promise.all(r.map(n=>vTe.remove(mTe.join(e,n))))});function pTe(t){let e;try{e=hTe.readdirSync(t)}catch{return gTe.mkdirsSync(t)}e.forEach(r=>{r=mTe.join(t,r),vTe.removeSync(r)})}yTe.exports={emptyDirSync:pTe,emptydirSync:pTe,emptyDir:fTe,emptydir:fTe}});var STe=x((Sbr,ITe)=>{"use strict";var eGt=qn().fromPromise,_Te=require("path"),F6=Vp(),CTe=E2();async function tGt(t){let e;try{e=await F6.stat(t)}catch{}if(e&&e.isFile())return;let r=_Te.dirname(t),n=null;try{n=await F6.stat(r)}catch(i){if(i.code==="ENOENT"){await CTe.mkdirs(r),await F6.writeFile(t,"");return}else throw i}n.isDirectory()?await F6.writeFile(t,""):await F6.readdir(r)}function rGt(t){let e;try{e=F6.statSync(t)}catch{}if(e&&e.isFile())return;let r=_Te.dirname(t);try{F6.statSync(r).isDirectory()||F6.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")CTe.mkdirsSync(r);else throw n}F6.writeFileSync(t,"")}ITe.exports={createFile:eGt(tGt),createFileSync:rGt}});var RTe=x((Ebr,ATe)=>{"use strict";var nGt=qn().fromPromise,ETe=require("path"),__=Vp(),xTe=E2(),{pathExists:iGt}=b_(),{areIdentical:wTe}=II();async function aGt(t,e){let r;try{r=await __.lstat(e)}catch{}let n;try{n=await __.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}if(r&&wTe(n,r))return;let i=ETe.dirname(e);await iGt(i)||await xTe.mkdirs(i),await __.link(t,e)}function sGt(t,e){let r;try{r=__.lstatSync(e)}catch{}try{let a=__.lstatSync(t);if(r&&wTe(a,r))return}catch(a){throw a.message=a.message.replace("lstat","ensureLink"),a}let n=ETe.dirname(e);return __.existsSync(n)||xTe.mkdirsSync(n),__.linkSync(t,e)}ATe.exports={createLink:nGt(aGt),createLinkSync:sGt}});var BTe=x((xbr,TTe)=>{"use strict";var C_=require("path"),iN=Vp(),{pathExists:oGt}=b_(),uGt=qn().fromPromise;async function lGt(t,e){if(C_.isAbsolute(t)){try{await iN.lstat(t)}catch(a){throw a.message=a.message.replace("lstat","ensureSymlink"),a}return{toCwd:t,toDst:t}}let r=C_.dirname(e),n=C_.join(r,t);if(await oGt(n))return{toCwd:n,toDst:t};try{await iN.lstat(t)}catch(a){throw a.message=a.message.replace("lstat","ensureSymlink"),a}return{toCwd:t,toDst:C_.relative(r,t)}}function cGt(t,e){if(C_.isAbsolute(t)){if(!iN.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=C_.dirname(e),n=C_.join(r,t);if(iN.existsSync(n))return{toCwd:n,toDst:t};if(!iN.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:C_.relative(r,t)}}TTe.exports={symlinkPaths:uGt(lGt),symlinkPathsSync:cGt}});var GTe=x((wbr,DTe)=>{"use strict";var NTe=Vp(),dGt=qn().fromPromise;async function fGt(t,e){if(e)return e;let r;try{r=await NTe.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}function pGt(t,e){if(e)return e;let r;try{r=NTe.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}DTe.exports={symlinkType:dGt(fGt),symlinkTypeSync:pGt}});var kTe=x((Abr,OTe)=>{"use strict";var hGt=qn().fromPromise,I_=require("path"),J0=Vp(),{mkdirs:mGt,mkdirsSync:gGt}=E2(),{symlinkPaths:vGt,symlinkPathsSync:yGt}=BTe(),{symlinkType:bGt,symlinkTypeSync:_Gt}=GTe(),{pathExists:CGt}=b_(),{areIdentical:FTe}=II();async function IGt(t,e,r){let n;try{n=await J0.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let o;if(I_.isAbsolute(t))o=await J0.stat(t);else{let l=I_.dirname(e),f=I_.join(l,t);try{o=await J0.stat(f)}catch{o=await J0.stat(t)}}let u=await J0.stat(e);if(FTe(o,u))return}let i=await vGt(t,e);t=i.toDst;let a=await bGt(i.toCwd,r),s=I_.dirname(e);return await CGt(s)||await mGt(s),J0.symlink(t,e,a)}function SGt(t,e,r){let n;try{n=J0.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let o;if(I_.isAbsolute(t))o=J0.statSync(t);else{let l=I_.dirname(e),f=I_.join(l,t);try{o=J0.statSync(f)}catch{o=J0.statSync(t)}}let u=J0.statSync(e);if(FTe(o,u))return}let i=yGt(t,e);t=i.toDst,r=_Gt(i.toCwd,r);let a=I_.dirname(e);return J0.existsSync(a)||gGt(a),J0.symlinkSync(t,e,r)}OTe.exports={createSymlink:hGt(IGt),createSymlinkSync:SGt}});var UTe=x((Rbr,MTe)=>{"use strict";var{createFile:ZTe,createFileSync:LTe}=STe(),{createLink:WTe,createLinkSync:VTe}=RTe(),{createSymlink:PTe,createSymlinkSync:HTe}=kTe();MTe.exports={createFile:ZTe,createFileSync:LTe,ensureFile:ZTe,ensureFileSync:LTe,createLink:WTe,createLinkSync:VTe,ensureLink:WTe,ensureLinkSync:VTe,createSymlink:PTe,createSymlinkSync:HTe,ensureSymlink:PTe,ensureSymlinkSync:HTe}});var jTe=x((Tbr,YTe)=>{"use strict";var ZV=Dk();YTe.exports={readJson:ZV.readFile,readJsonSync:ZV.readFileSync,writeJson:ZV.writeFile,writeJsonSync:ZV.writeFileSync}});var LV=x((Bbr,zTe)=>{"use strict";var EGt=qn().fromPromise,Yne=Vp(),XTe=require("path"),qTe=E2(),xGt=b_().pathExists;async function wGt(t,e,r="utf-8"){let n=XTe.dirname(t);return await xGt(n)||await qTe.mkdirs(n),Yne.writeFile(t,e,r)}function AGt(t,...e){let r=XTe.dirname(t);Yne.existsSync(r)||qTe.mkdirsSync(r),Yne.writeFileSync(t,...e)}zTe.exports={outputFile:EGt(wGt),outputFileSync:AGt}});var $Te=x((Nbr,KTe)=>{"use strict";var{stringify:RGt}=Z9(),{outputFile:TGt}=LV();async function BGt(t,e,r={}){let n=RGt(e,r);await TGt(t,n,r)}KTe.exports=BGt});var QTe=x((Dbr,JTe)=>{"use strict";var{stringify:NGt}=Z9(),{outputFileSync:DGt}=LV();function GGt(t,e,r){let n=NGt(e,r);DGt(t,n,r)}JTe.exports=GGt});var tBe=x((Gbr,eBe)=>{"use strict";var FGt=qn().fromPromise,Hp=jTe();Hp.outputJson=FGt($Te());Hp.outputJsonSync=QTe();Hp.outputJSON=Hp.outputJson;Hp.outputJSONSync=Hp.outputJsonSync;Hp.writeJSON=Hp.writeJson;Hp.writeJSONSync=Hp.writeJsonSync;Hp.readJSON=Hp.readJson;Hp.readJSONSync=Hp.readJsonSync;eBe.exports=Hp});var sBe=x((Fbr,aBe)=>{"use strict";var OGt=Vp(),rBe=require("path"),{copy:kGt}=kV(),{remove:iBe}=nN(),{mkdirp:ZGt}=E2(),{pathExists:LGt}=b_(),nBe=II();async function WGt(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:a=!1}=await nBe.checkPaths(t,e,"move",r);await nBe.checkParentPaths(t,i,e,"move");let s=rBe.dirname(e);return rBe.parse(s).root!==s&&await ZGt(s),VGt(t,e,n,a)}async function VGt(t,e,r,n){if(!n){if(r)await iBe(e);else if(await LGt(e))throw new Error("dest already exists.")}try{await OGt.rename(t,e)}catch(i){if(i.code!=="EXDEV")throw i;await PGt(t,e,r)}}async function PGt(t,e,r){return await kGt(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),iBe(t)}aBe.exports=WGt});var dBe=x((Obr,cBe)=>{"use strict";var uBe=Ei(),Xne=require("path"),HGt=kV().copySync,lBe=nN().removeSync,MGt=E2().mkdirpSync,oBe=II();function UGt(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:a=!1}=oBe.checkPathsSync(t,e,"move",r);return oBe.checkParentPathsSync(t,i,e,"move"),YGt(e)||MGt(Xne.dirname(e)),jGt(t,e,n,a)}function YGt(t){let e=Xne.dirname(t);return Xne.parse(e).root===e}function jGt(t,e,r,n){if(n)return jne(t,e,r);if(r)return lBe(e),jne(t,e,r);if(uBe.existsSync(e))throw new Error("dest already exists.");return jne(t,e,r)}function jne(t,e,r){try{uBe.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return XGt(t,e,r)}}function XGt(t,e,r){return HGt(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),lBe(t)}cBe.exports=UGt});var pBe=x((kbr,fBe)=>{"use strict";var qGt=qn().fromPromise;fBe.exports={move:qGt(sBe()),moveSync:dBe()}});var qne=x((Zbr,hBe)=>{"use strict";hBe.exports={...Vp(),...kV(),...bTe(),...UTe(),...tBe(),...E2(),...pBe(),...LV(),...b_(),...nN()}});var zne=x(Lc=>{"use strict";var zGt=Lc&&Lc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KGt=Lc&&Lc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mBe=Lc&&Lc.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&zGt(e,t,r);return KGt(e,t),e};Object.defineProperty(Lc,"__esModule",{value:!0});Lc.readModuleSchema=Lc.sanitizeProviderSchema=Lc.readProviderSchema=Lc.parseFQPN=Lc.terraformInitWithRetry=void 0;var WV=mBe(qne()),aN=mBe(require("path")),$Gt=require("@cdktn/hcl2json"),SI=Ln(),VV=process.env.TERRAFORM_BINARY_NAME||"terraform",JGt=[/\b50[234]\b/,/Bad Gateway/i,/Service Unavailable/i,/Gateway Timeout/i,/ECONNRESET/i,/ETIMEDOUT/i,/EAI_AGAIN/i,/unexpected EOF/i];async function gBe(t,e=5,r=5e3,n=2){var i;for(let a=1;a<=e;a++)try{return await(0,SI.exec)(VV,["init"],t)}catch(s){let o=(i=s==null?void 0:s.stderr)!==null&&i!==void 0?i:"";if(!JGt.some(f=>f.test(o))||a===e)throw s;let l=r*n**(a-1);console.log(`terraform init failed with a transient error, retrying in ${l}ms (attempt ${a}/${e-1})`),await new Promise(f=>setTimeout(f,l))}throw new Error("unreachable")}Lc.terraformInitWithRetry=gBe;var QGt=t=>{let[e,r,n]=t.split("/");if(!n)throw new Error(`can't handle ${t}`);return{hostname:e,namespace:r,name:n}};Lc.parseFQPN=QGt;var vBe=t=>Array.isArray(t)?t[0]:t,eFt=t=>{let e=[];if(!t)return e;for(let r of Object.keys(t)){let n=vBe(t[r]),i;if(n.hasOwnProperty("type")==!1&&n.hasOwnProperty("default")==!0)switch(typeof n.default){case"boolean":i="bool";break;case"number":i="number";break;default:i="any"}else{let s=n.type;typeof s=="string"&&s.startsWith("${")&&s.endsWith("}")&&!s.includes(`
103
- `)?i=s.slice(2,-1):i="any"}let a={name:r,type:i,description:n.description,required:n.hasOwnProperty("default")==!1};a.required||(a.default=n.default),e.push(a)}return e},tFt=t=>{let e=[];if(t)for(let r of Object.keys(t)){let n=vBe(t[r]),i={name:r,description:n.description};e.push(i)}return e},rFt=async(t,e)=>{let r=aN.join(t,".terraform","modules","modules.json"),n={};if(!WV.existsSync(r))throw new Error(`Modules were not generated properly - couldn't find ${r}`);let i=JSON.parse(WV.readFileSync(r,"utf-8"));for(let a of e){let s=i.Modules.find(l=>a===l.Key);if(!s)throw new Error(`Couldn't find ${s}`);let o=await(0,$Gt.convertFiles)(aN.join(t,s.Dir));if(!o)throw new Error(`Modules were not generated properly - couldn't parse ${s.Dir}`);let u={inputs:eFt(o.variable),outputs:tFt(o.output),name:a};n[a]=u}return n};async function nFt(t){let e={provider:{},terraform:{required_providers:{}}};e.provider[t.name]={},e.terraform.required_providers[t.name]={version:t.version,source:t.source};let r={format_version:"0.1"};return await(0,SI.withTempDir)("fetchProviderSchema",async()=>{let n=process.cwd(),i=aN.join(n,"main.tf.json");await WV.writeFile(i,JSON.stringify(e)),await gBe({cwd:n}),r=JSON.parse(await(0,SI.exec)(VV,["providers","schema","-json"],{cwd:n}));let a=JSON.parse(await(0,SI.exec)(VV,["version","-json"],{cwd:n}));r.provider_versions=a.provider_selections}),yBe(r)}Lc.readProviderSchema=nFt;function yBe(t){function e(n){if((0,SI.isNestedTypeAttribute)(n)||!Array.isArray(n.type))return n;let i=n.type.length===2?n.type:n.type.slice(0,2);return n.type=i,n}function r(n){Object.values(n.attributes||{}).forEach(e),Object.values(n.block_types||{}).forEach(i=>{r(i.block)})}return Object.values(t.provider_schemas||{}).forEach(n=>{[n.provider,...Object.values(n.resource_schemas||{}),...Object.values(n.data_source_schemas||{})].forEach(a=>{r(a.block)})}),t}Lc.sanitizeProviderSchema=yBe;async function iFt(t){let e={};return await(0,SI.withTempDir)("fetchSchema",async()=>{let r={terraform:{}};r.module||(r.module={});let n=t.source,i=t.constraint.localSourceAbsolutePath;i&&(n=aN.relative(process.cwd(),i)),r.module[t.moduleKey]={source:n},t.version&&(r.module[t.moduleKey].version=t.version);let a=process.cwd(),s=aN.join(a,"main.tf.json");await WV.writeFile(s,JSON.stringify(r)),await(0,SI.exec)(VV,["get"],{cwd:a}),r.module&&(e=await rFt(a,Object.keys(r.module)))}),e}Lc.readModuleSchema=iFt});var _Be=x(wy=>{"use strict";var aFt=wy&&wy.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sFt=wy&&wy.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bBe=wy&&wy.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&aFt(e,t,r);return sFt(e,t),e};Object.defineProperty(wy,"__esModule",{value:!0});wy.cachedAccess=void 0;var dE=Ln(),PV=bBe(qne()),oFt=bBe(require("path"));function uFt(t){return`${encodeURIComponent(t.fqn)}@${encodeURIComponent(t.version||"")}`}function lFt(t,e){let r=typeof e=="string"&&e.length>0;if(r&&!PV.lstatSync(e).isDirectory())throw dE.Errors.Usage(`Provider Schema Cache directory '${e}' is not a directory`);return r?(dE.logger.debug(`Provider Schema Cache enabled, caching at ${e}`),async n=>{let i=uFt(n),a=oFt.join(e,`${i}.json`);if(PV.existsSync(a))return dE.logger.debug(`Cache hit for ${i}`),JSON.parse(await PV.readFile(a,"utf-8"));dE.logger.debug(`Cache miss for ${i}, generating schema`);let s=await t(n);return await PV.writeFile(a,JSON.stringify(s)),dE.logger.debug(`Write cache for ${i}`),s}):(dE.logger.debug("Provider Schema Cache disabled"),n=>t(n))}wy.cachedAccess=lFt});var IBe=x(Q0=>{"use strict";var cFt=Q0&&Q0.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Q0,"__esModule",{value:!0});Q0.readSchema=Q0.isLocalModule=Q0.TerraformProviderConstraint=Q0.TerraformModuleConstraint=Q0.isRegistryModule=void 0;var HV=Ln();Object.defineProperty(Q0,"isRegistryModule",{enumerable:!0,get:function(){return HV.isRegistryModule}});Object.defineProperty(Q0,"TerraformModuleConstraint",{enumerable:!0,get:function(){return HV.TerraformModuleConstraint}});Object.defineProperty(Q0,"TerraformProviderConstraint",{enumerable:!0,get:function(){return HV.TerraformProviderConstraint}});Object.defineProperty(Q0,"isLocalModule",{enumerable:!0,get:function(){return HV.isLocalModule}});var Kne=Ln(),dFt=cFt(ORe()),CBe=zne(),fFt=_Be();async function pFt(t,e){let r=(0,fFt.cachedAccess)(CBe.readProviderSchema,e),n=t.map(a=>Kne.ConstructsMakerProviderTarget.from(a,Kne.LANGUAGES[0]));hFt(n);let i=await Promise.all(n.map(a=>a.isModule?(0,CBe.readModuleSchema)(a).then(s=>({moduleSchema:s})):r(a).then(s=>({providerSchema:s}))));return i.unshift({providerSchema:{format_version:"0.1"},moduleSchema:{}}),dFt.default.all(i)}Q0.readSchema=pFt;function hFt(t){let e=t.filter(r=>r.isModule);e.forEach(r=>{e.forEach(n=>{if(r!==n&&r.name===n.name)throw Kne.Errors.Usage(`Found two modules with the same name "${r.name}" which is not supported. Please rename one of the modules in your cdktf.json config. For more information on how to set the name refer to https://cdk.tf/adding-modules`)})})}});var S_=x(fE=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});fE.parseFQPN=fE.readSchema=void 0;var mFt=IBe();Object.defineProperty(fE,"readSchema",{enumerable:!0,get:function(){return mFt.readSchema}});var gFt=zne();Object.defineProperty(fE,"parseFQPN",{enumerable:!0,get:function(){return gFt.parseFQPN}})});var EBe=x(pE=>{"use strict";Object.defineProperty(pE,"__esModule",{value:!0});pE.AttributeModel=pE.escapeAttributeName=void 0;function SBe(t){return t==="self"||t==="build"?`${t}Attribute`:t.match(/^get[A-Za-z]+/)?t.replace("get","fetch"):t==="equals"?"equalTo":t==="node"?"nodeAttribute":t==="system"?"systemAttribute":t==="tfResourceType"?`${t}Attribute`:t==="importFrom"?`${t}Attribute`:t==="moveTo"?`${t}Attribute`:t==="software"?`${t}Attribute`:t}pE.escapeAttributeName=SBe;var $ne=class t{constructor(e){this.storageName=e.storageName,this._name=e.name,this.type=e.type,this.optional=e.optional,this.computed=e.computed,this.terraformName=e.terraformName,this.terraformFullName=e.terraformFullName,this._description=e.description,this.provider=e.provider,this.required=e.required,this.forcePlainGetterType=e.forcePlainGetterType}get typeDefinition(){let e=this.optional?"?":"";return`${this.name}${e}: ${this.type.inputTypeDefinition}`}get isAssignable(){return this.required||this.optional}get isOptional(){return this.optional}get isRequired(){return this.required}get isProvider(){return this.provider}get getterType(){let e={_type:"plain"};return this.forcePlainGetterType||this.isProvider||(this.type.hasReferenceClass?e={_type:"stored_class"}:this.computed&&!this.isAssignable&&(!this.type.isTokenizable||this.type.typeModelType==="map")&&(e={_type:"stored_class"})),e}get isStored(){return this.isAssignable}get setterType(){return this.isStored?this.getterType._type==="stored_class"?{_type:"stored_class",type:this.type.inputTypeDefinition}:{_type:"set",type:`${this.type.inputTypeDefinition}${this.isProvider?" | undefined":""}`}:{_type:"none"}}get name(){return t.escapeName(this._name)}static escapeName(e){return SBe(e)}get description(){var e;return(e=this._description)===null||e===void 0?void 0:e.replace(/'''/gi,"```")}getReferencedTypes(e){let r=this.type.struct;if(!r)return;let n=[];return this.isAssignable&&(n.push(r.name),n.push(r.mapperName),n.push(r.hclMapperName)),!r.isSingleItem&&(r.nestingMode==="list"||r.nestingMode==="set")?n.push(r.listName):r.nestingMode==="map"?n.push(r.mapName):r.nestingMode==="maplist"||r.nestingMode==="mapset"?n.push(r.mapListName):r.nestingMode==="listmap"||r.nestingMode==="setmap"?n.push(r.listMapName):r.nestingMode==="listlist"||r.nestingMode==="listset"||r.nestingMode==="setlist"||r.nestingMode=="setset"?n.push(r.listListName):e||n.push(r.outputReferenceName),n}};pE.AttributeModel=$ne});var MV=x(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});hE.uppercaseFirst=hE.downcaseFirst=void 0;function vFt(t){return t===""?t:`${t[0].toLocaleLowerCase()}${t.slice(1)}`}hE.downcaseFirst=vFt;function yFt(t){return t===""?t:`${t[0].toLocaleUpperCase()}${t.slice(1)}`}hE.uppercaseFirst=yFt});var xBe=x(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.MapAttributeTypeModel=eh.SetAttributeTypeModel=eh.ListAttributeTypeModel=eh.StructAttributeTypeModel=eh.SimpleAttributeTypeModel=eh.SkippedAttributeTypeModel=void 0;var EI=MV(),Jne=class{constructor(){}get typeModelType(){return"simple"}get struct(){}get isComplex(){return!1}getStoredClassInitializer(e){return""}get storedClassType(){return"any"}get inputTypeDefinition(){return"any"}getAttributeAccessFunction(e){return`this.interpolationForAttribute('${e}')`}get toTerraformFunction(){return"cdktn.anyToTerraform"}get toHclTerraformFunction(){return"cdktn.anyToHclTerraform"}get hasReferenceClass(){return!1}get isTokenizable(){return!1}};eh.SkippedAttributeTypeModel=Jne;var Qne=class{constructor(e){this.type=e}get typeModelType(){return"simple"}get struct(){}get isComplex(){return!1}getStoredClassInitializer(e){return""}get storedClassType(){return this.type}get inputTypeDefinition(){return this.type==="boolean"?"boolean | cdktn.IResolvable":this.type}getAttributeAccessFunction(e){return`this.get${(0,EI.uppercaseFirst)(this.type)}Attribute('${e}')`}get toTerraformFunction(){return`cdktn.${this.type}ToTerraform`}get toHclTerraformFunction(){return`cdktn.${this.type}ToHclTerraform`}get hasReferenceClass(){return!1}get isTokenizable(){return!0}};eh.SimpleAttributeTypeModel=Qne;var eie=class{constructor(e){this.struct=e}get typeModelType(){return"struct"}get isComplex(){return!0}getStoredClassInitializer(e){return`new ${this.struct.outputReferenceName}(this, "${e}")`}get storedClassType(){return this.struct.name}get inputTypeDefinition(){return this.struct.name}getAttributeAccessFunction(e){return`this.interpolationForAttribute('${e}')`}get toTerraformFunction(){return`${(0,EI.downcaseFirst)(this.struct.name)}ToTerraform`}get toHclTerraformFunction(){return`${(0,EI.downcaseFirst)(this.struct.name)}ToHclTerraform`}get hasReferenceClass(){return!0}get isTokenizable(){return!1}};eh.StructAttributeTypeModel=eie;var tie=class{constructor(e,r,n){this.elementType=e,this.isSingleItem=r,this.isBlock=n,this.struct&&(this.struct.isSingleItem=this.isSingleItem||!1)}get typeModelType(){return"list"}get struct(){return this.elementType.struct}get isComplex(){return this.elementType.isComplex}getStoredClassInitializer(e){return this.isSingleItem?`new ${this.elementType.storedClassType}OutputReference(this, "${e}")`:this.isComplex?`new ${this.storedClassType}(this, "${e}", false)`:`new cdktn.${(0,EI.uppercaseFirst)(this.storedClassType)}(this, "${e}", false)`}get storedClassType(){return`${this.elementType.storedClassType}List`}get inputTypeDefinition(){return this.isSingleItem?this.elementType.inputTypeDefinition:this.elementType.storedClassType==="boolean"?"Array<boolean | cdktn.IResolvable> | cdktn.IResolvable":this.isComplex?`${this.elementType.storedClassType}[] | cdktn.IResolvable`:this.elementType.typeModelType!=="simple"?`${this.elementType.inputTypeDefinition}[] | cdktn.IResolvable`:`${this.elementType.inputTypeDefinition}[]`}getAttributeAccessFunction(e){switch(this.elementType.storedClassType){case"string":return`this.getListAttribute('${e}')`;case"number":return`this.getNumberListAttribute('${e}')`}return`this.interpolationForAttribute('${e}')`}get toTerraformFunction(){return this.isSingleItem?this.elementType.toTerraformFunction:`cdktn.listMapper(${this.elementType.toTerraformFunction}, ${this.isBlock})`}get toHclTerraformFunction(){return this.isSingleItem?this.elementType.toHclTerraformFunction:`cdktn.listMapperHcl(${this.elementType.toHclTerraformFunction}, ${this.isBlock})`}get hasReferenceClass(){return this.isSingleItem||this.isComplex}get isTokenizable(){switch(this.elementType.storedClassType){case"string":return!0;case"number":return!0;default:return!1}}};eh.ListAttributeTypeModel=tie;var rie=class{constructor(e,r,n){this.elementType=e,this.isSingleItem=r,this.isBlock=n,this.struct&&(this.struct.isSingleItem=this.isSingleItem||!1)}get typeModelType(){return"set"}get struct(){return this.elementType.struct}get isComplex(){return this.elementType.isComplex}getStoredClassInitializer(e){return this.isSingleItem?`new ${this.elementType.storedClassType}OutputReference(this, "${e}")`:this.isComplex?`new ${this.storedClassType}(this, "${e}", true)`:`new cdktn.${(0,EI.uppercaseFirst)(this.storedClassType)}(this, "${e}", true)`}get storedClassType(){return`${this.elementType.storedClassType}List`}get inputTypeDefinition(){return this.isSingleItem?this.elementType.inputTypeDefinition:this.elementType.storedClassType==="boolean"?"Array<boolean | cdktn.IResolvable> | cdktn.IResolvable":this.isComplex?`${this.elementType.storedClassType}[] | cdktn.IResolvable`:this.elementType.typeModelType!=="simple"?`${this.elementType.inputTypeDefinition}[] | cdktn.IResolvable`:`${this.elementType.inputTypeDefinition}[]`}getAttributeAccessFunction(e){switch(this.elementType.storedClassType){case"string":return`cdktn.Fn.tolist(this.getListAttribute('${e}'))`;case"number":return`cdktn.Token.asNumberList(cdktn.Fn.tolist(this.getNumberListAttribute('${e}')))`}return`cdktn.Token.asAny(cdktn.Fn.tolist(this.interpolationForAttribute('${e}')))`}get toTerraformFunction(){return this.isSingleItem?this.elementType.toTerraformFunction:`cdktn.listMapper(${this.elementType.toTerraformFunction}, ${this.isBlock})`}get toHclTerraformFunction(){return this.isSingleItem?this.elementType.toHclTerraformFunction:`cdktn.listMapperHcl(${this.elementType.toHclTerraformFunction}, ${this.isBlock})`}get hasReferenceClass(){return this.isSingleItem||this.isComplex}get isTokenizable(){switch(this.elementType.storedClassType){case"string":return!0;case"number":return!0;default:return!1}}};eh.SetAttributeTypeModel=rie;var nie=class{constructor(e){this.elementType=e}get typeModelType(){return"map"}get struct(){return this.elementType.struct}get isComplex(){return this.elementType.isComplex}getStoredClassInitializer(e){return this.isComplex?`new ${this.storedClassType}(this, "${e}")`:`new cdktn.${(0,EI.uppercaseFirst)(this.storedClassType)}(this, "${e}")`}get storedClassType(){return`${this.elementType.storedClassType}Map`}get inputTypeDefinition(){return this.elementType.storedClassType==="boolean"?`{ [key: string]: (${this.elementType.storedClassType} | cdktn.IResolvable) }`:this.isComplex?`{ [key: string]: ${this.elementType.storedClassType} } | cdktn.IResolvable`:this.elementType.typeModelType!=="simple"?`{ [key: string]: ${this.elementType.inputTypeDefinition} } | cdktn.IResolvable`:`{ [key: string]: ${this.elementType.storedClassType} }`}getAttributeAccessFunction(e){return!this.isComplex&&this.elementType.typeModelType!=="simple"?`this.interpolationForAttribute('${e}')`:`this.get${(0,EI.uppercaseFirst)(this.storedClassType)}Attribute('${e}')`}get toTerraformFunction(){return`cdktn.hashMapper(${this.elementType.toTerraformFunction})`}get toHclTerraformFunction(){return`cdktn.hashMapperHcl(${this.elementType.toHclTerraformFunction})`}get hasReferenceClass(){return this.isComplex}get isTokenizable(){switch(this.elementType.storedClassType){case"string":return!0;case"number":return!0;case"boolean":return!0;case"any":return!0;default:return!1}}};eh.MapAttributeTypeModel=nie});var aie=x(mE=>{"use strict";Object.defineProperty(mE,"__esModule",{value:!0});mE.ConfigStruct=mE.Struct=void 0;var wBe=MV(),UV=class{constructor(e,r,n=!1,i=!1,a=!1,s=""){this.name=e,this.attributes=r,this.isClass=n,this.isAnonymous=i,this.isSingleItem=a,this.nestingMode=s}get assignableAttributes(){return this.attributes.filter(e=>e.isAssignable)}get optionalAttributes(){return this.attributes.filter(e=>e.optional)}get allOptional(){return this.attributes.filter(e=>!e.optional&&!e.computed).length==0}get attributeType(){return`${this.name}${this.allOptional?" = {}":""}`}get assignable(){return!this.isClass||this.assignableAttributes.length>0}get extends(){return""}get mapperName(){return`${(0,wBe.downcaseFirst)(this.name)}ToTerraform`}get hclMapperName(){return`${(0,wBe.downcaseFirst)(this.name)}ToHclTerraform`}get outputReferenceName(){return`${this.name}OutputReference`}get listName(){return`${this.name}List`}get mapName(){return`${this.name}Map`}get mapListName(){return`${this.name}MapList`}get listMapName(){return`${this.name}ListMap`}get listListName(){return`${this.name}ListList`}get isProvider(){return this.attributes.some(e=>e.isProvider)}get referencedTypes(){let e=[];return this.attributes.forEach(r=>{let n=r.getReferencedTypes(!1);n&&e.push(...n)}),e}get exportCount(){let e=1;return e+=1,(this.nestingMode==="list"||this.nestingMode==="set"||this.nestingMode==="map")&&(e+=1,this.isSingleItem||(e+=1)),e}};mE.Struct=UV;var iie=class extends UV{get extends(){return" extends cdktn.TerraformMetaArguments"}};mE.ConfigStruct=iie});var oie=x(O6=>{"use strict";var bFt=O6&&O6.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(O6,"__esModule",{value:!0});O6.ResourceModel=O6.STRUCT_SHARDING_THRESHOLD=void 0;var _Ft=a6(),ABe=bFt(require("path")),RBe=S_(),CFt=aie();O6.STRUCT_SHARDING_THRESHOLD=400;var sie=class{constructor(e){this.recursiveAttributePaths={},this.className=e.className,this.filePath=e.filePath,this.terraformType=e.terraformType,this.baseName=e.baseName,this.attributes=e.attributes,this.schema=e.schema,this.fqpn=e.fqpn,this.provider=(0,RBe.parseFQPN)(e.fqpn).name,this.terraformProviderName=this.provider,this.fileName=e.fileName,this._structs=e.structs,this.terraformSchemaType=e.terraformSchemaType,this.configStructName=e.configStructName,this.dependencies=["import { Construct } from 'constructs';","import * as cdktn from 'cdktn';"],this.structsRequireSharding=this._structs.reduce((r,n)=>r+n.exportCount,0)>O6.STRUCT_SHARDING_THRESHOLD}get structs(){return[this.configStruct,...this._structs]}get configStruct(){return new CFt.ConfigStruct(this.configStructName,this.attributes)}get synthesizableAttributes(){return this.configStruct.assignableAttributes}get importStatements(){return this.dependencies}get schemaAsJson(){return this.escapeSchema(JSON.stringify(this.schema,void 0,2))}get linkToDocs(){let{hostname:e,namespace:r,name:n}=(0,RBe.parseFQPN)(this.fqpn),i=this.providerVersion||"latest",a=`https://${e}/providers/${r}/${n}/${i}/docs`;return this.isProvider?a:this.isDataSource?`${a}/data-sources/${this.terraformDocName}`:`${a}/resources/${this.terraformDocName}`}get isProvider(){return this.terraformSchemaType==="provider"}get isDataSource(){return this.terraformSchemaType==="data_source"}get parentClassName(){return this.isProvider?"TerraformProvider":this.isDataSource?"TerraformDataSource":"TerraformResource"}get terraformResourceType(){return this.isProvider?this.terraformProviderName:this.isDataSource?this.terraformType.replace(/^data_/,""):this.terraformType}get terraformDocName(){return(0,_Ft.toSnakeCase)(this.terraformResourceType.replace(new RegExp(`^${this.provider}_`,"i"),""))}get referencedTypes(){return this.configStruct.referencedTypes}get structsFolderName(){return`${ABe.default.basename(this.fileName,".ts")}-structs`}get structsFolderPath(){return ABe.default.join(this.namespaceFolderPath,this.structsFolderName)}get namespaceFolderPath(){return this.filePath.split("/").slice(0,-1).join("/")}escapeSchema(e){return e.replace(/(\*\/)/gi,"*\\/")}};O6.ResourceModel=sie});var TBe=x(YV=>{"use strict";Object.defineProperty(YV,"__esModule",{value:!0});YV.Scope=void 0;var uie=class{constructor(e){var r,n,i,a,s;this.name=e.name,this.parent=e.parent,this.isProvider=e.isProvider,this.isComputed=(r=e.isComputed)!==null&&r!==void 0?r:!1,this.isOptional=(n=e.isOptional)!==null&&n!==void 0?n:!0,this.isRequired=(i=e.isRequired)!==null&&i!==void 0?i:!1,this.inBlockType=(a=e.inBlockType)!==null&&a!==void 0?a:!1,this.isNestedType=(s=e.isNestedType)!==null&&s!==void 0?s:!1}fullName(e){return`${this.baseName}.${e}`}get baseName(){let e=this,r="";for(;e;)r===""?r=e.name:r=`${e.name}.${r}`,e=e.parent;return r}};YV.Scope=uie});var gE=x(x2=>{"use strict";var IFt=x2&&x2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sN=x2&&x2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IFt(e,t,r)};Object.defineProperty(x2,"__esModule",{value:!0});sN(EBe(),x2);sN(xBe(),x2);sN(oie(),x2);sN(TBe(),x2);sN(aie(),x2)});var BBe=x(jV=>{"use strict";Object.defineProperty(jV,"__esModule",{value:!0});jV.detectAttributeLoops=void 0;var SFt=(t,e)=>t[0]===e[0]&&t[1].size===e[1].size&&[...t[1]].every(r=>e[1].has(r));function EFt(t){var e;return t.type.isComplex?`<complex:{${(e=t.type.struct)===null||e===void 0?void 0:e.attributes.map(r=>r.name).sort()}}${t.type.typeModelType}>`:t.type.storedClassType}function xFt(t){return[t.terraformName,new Set(t.type.struct.attributes.map(e=>`${e.name}:${EFt(e)}`))]}function wFt(t){let e={};function r(n,i=[],a={}){let s=n.terraformName,o=n.type.struct;if(!o)return;let u=xFt(n),l=Object.entries(a).find(([,f])=>SFt(u,f));if(l){let f=l[0],h=[...i,s].join(".");e[h]=f}else o.attributes.forEach(f=>r(f,[...i,s],{...a,[[...i,s].join(".")]:u}))}return t.forEach(n=>r(n)),e}jV.detectAttributeLoops=wFt});var NBe=x(XV=>{"use strict";Object.defineProperty(XV,"__esModule",{value:!0});XV.shouldSkipAttribute=void 0;var AFt=["aws.quicksight_template.definition","aws.quicksight_dashboard.definition","aws.quicksight_analysis.definition","aws.data_aws_quicksight_analysis.definition","aws.wafv2_web_acl.wafv2_web_acl_rule.statement","aws.wafv2_rule_group.wafv2_rule_group_rule.statement","oci.data_oci_objectstorage_private_endpoint.fqdns","oci.data_oci_objectstorage_private_endpoint_summaries.private_endpoint_summaries.fqdns"];function RFt(t){return AFt.includes(t)}XV.shouldSkipAttribute=RFt});var pie=x(vE=>{"use strict";Object.defineProperty(vE,"__esModule",{value:!0});vE.ResourceParser=vE.sanitizeClassOrNamespaceName=void 0;var Ay=a6(),DBe=Ln(),TFt=S_(),xi=gE(),BFt=BBe(),lie=NBe(),NFt=["implements","interface","let","package","private","protected","public","static","yield","await"],DFt=["license","version"],GFt=t=>["string","object","function",...NFt,...DFt].includes(t.toLowerCase()),FFt=t=>t.toLowerCase().endsWith("list"),OFt=(t,e)=>e==="index"?"index-resource/index.ts":e===`${t}_provider`?"provider/index.ts":`${(0,Ay.toSnakeCase)(e).replace(/_/g,"-")}/index.ts`;function GBe(t,e=!1){let r=!e&&t==="provider";return GFt(t)||r?`${t}_resource`:t}vE.sanitizeClassOrNamespaceName=GBe;function cie(t){return t.filter((e,r)=>!t.slice(r+1).some(i=>i.name===e.name&&i!==e))}var die=class{constructor(e,r){this.classNames=e,this.usedBaseNames=r,this.structs=new Array}uniqueClassName(e){return this.classNames.includes(e)&&(e=`${e}A`),this.classNames.push(e),e}uniqueBaseName(e){let r=(0,Ay.toPascalCase)(e),n=r.toLowerCase(),i=this.usedBaseNames.get(n);return i!==void 0&&i!==r?(e=`${e}A`,this.uniqueBaseName(e)):(this.usedBaseNames.set(n,r),e)}resourceFrom(e,r,n,i,a){let s=r,o=a?a.name:void 0,u=(0,TFt.parseFQPN)(e).name;s.startsWith(`${u}_`)&&(s=s.substr(u.length+1));let l=o||u,f=i==="provider";f&&(s=`${l}_${s}`,"attributes"in n.block||(n.block={attributes:{},block_types:n.block.block_types||{}}),n.block.attributes.alias={type:"string",description:"Alias name",optional:!0,computed:!1}),s=GBe(s,f),s=this.uniqueBaseName(s);let h=this.uniqueClassName((0,Ay.toPascalCase)(s)),g=this.uniqueClassName(`${h}Config`),_=OFt(l,s),w=`providers/${(0,Ay.toSnakeCase)(l)}/${_}`,T=this.renderAttributesForBlock(new xi.Scope({name:s,isProvider:f,parent:f?void 0:new xi.Scope({name:l,isProvider:!0})}),n.block);function D(Z,X){let[ue,...Q]=X.split("."),ie=Z.find(M=>M.terraformName===ue);if(!ie)throw new Error(`Expected to find recursive attribute at path: ${X}`);if(!ie.type.struct)throw new Error(`Expected to find struct type attribute at path: ${X} but got ${ie.type.storedClassType}`);return Q.length===0?ie:D(ie.type.struct.attributes,Q.join("."))}let G=(0,BFt.detectAttributeLoops)(T);return Object.entries(G).forEach(([Z,X])=>{let ue=D(T,X),Q=Z.split("."),ie=Q.pop(),M=D(T,Q.join(".")),ne=M.type.struct.attributes.findIndex(ke=>ke.terraformName===ie);if(ne===-1)throw new Error("Can't find attribute at path "+Z);let Te=M.type.struct.attributes[ne];M.type.struct.attributes[ne]=ue;let J=ke=>{ke.type.struct&&(ke.type.struct.attributes.forEach(J),this.structs=this.structs.filter(xe=>xe!==ke.type.struct))};J(Te)}),T=cie(T),new xi.ResourceModel({terraformType:r,baseName:s,fileName:_,filePath:w,className:h,schema:n,fqpn:e,attributes:T,terraformSchemaType:i,structs:this.structs,configStructName:g})}renderAttributeType(e,r,n){let i=e[e.length-1];if((0,lie.shouldSkipAttribute)(i.baseName))return new xi.MapAttributeTypeModel(new xi.SimpleAttributeTypeModel("any"));if(typeof r=="string")switch(r){case"bool":return new xi.SimpleAttributeTypeModel("boolean");case"string":return new xi.SimpleAttributeTypeModel("string");case"number":return new xi.SimpleAttributeTypeModel("number");case"dynamic":return new xi.MapAttributeTypeModel(new xi.SimpleAttributeTypeModel("any"));default:throw new Error(`invalid primitive type ${r}`)}if(Array.isArray(r)){if(r.length!==2)throw new Error("unexpected array");let[a,s]=r;if(a==="set"||a==="list"){let o=this.renderAttributeType(e,s,[a,n].join(""));return a==="list"?new xi.ListAttributeTypeModel(o,!1,!1):new xi.SetAttributeTypeModel(o,!1,!1)}if(a==="map"){let o=this.renderAttributeType(e,s,[a,n].join(""));return new xi.MapAttributeTypeModel(o)}if(a==="object"){let o=s,u={};for(let[f,h]of Object.entries(o))u[f]={type:h};let l=this.addAnonymousStruct(e,u,n??a);return new xi.StructAttributeTypeModel(l)}}if((0,DBe.isAttributeNestedType)(r)){let a,s;switch(r.nesting_mode){case"list":a=this.addAnonymousStruct(e,r.attributes,r.nesting_mode),s=new xi.ListAttributeTypeModel(new xi.StructAttributeTypeModel(a),!1,!1);break;case"set":a=this.addAnonymousStruct(e,r.attributes,r.nesting_mode),s=new xi.SetAttributeTypeModel(new xi.StructAttributeTypeModel(a),!1,!1);break;case"map":a=this.addAnonymousStruct(e,r.attributes,r.nesting_mode),s=new xi.MapAttributeTypeModel(new xi.StructAttributeTypeModel(a));break;case"single":a=this.addAnonymousStruct(e,r.attributes,r.nesting_mode),s=new xi.StructAttributeTypeModel(a);break;default:throw new Error(`nested_type with nesting_mode "${r.nesting_mode}" not supported (attribute scope: ${e.map(o=>o.fullName).join(",")}`)}return s}throw new Error(`unknown type ${JSON.stringify(r)}`)}renderAttributesForBlock(e,r){let n=new Array;for(let[a,s]of Object.entries(r.attributes||{})){let o,u=!1;(0,lie.shouldSkipAttribute)(e.fullName(a))?(o=new xi.SkippedAttributeTypeModel,u=!0):o=this.renderAttributeType([e,new xi.Scope({name:a,parent:e,isProvider:e.isProvider,isComputed:!!s.computed,isOptional:!!s.optional,isRequired:!!s.required,isNestedType:(0,DBe.isNestedTypeAttribute)(s)})],s.type||s.nested_type);let l=(0,Ay.toCamelCase)(a);n.push(new xi.AttributeModel({terraformFullName:e.fullName(a),description:s.description,name:l,storageName:`_${l}`,computed:!!s.computed,optional:!!s.optional,terraformName:a,type:o,provider:e.isProvider,required:!!s.required,forcePlainGetterType:u}))}for(let[a,s]of Object.entries(r.block_types||{})){if((0,lie.shouldSkipAttribute)(e.fullName(a))){let l=(0,Ay.toCamelCase)(a),f=new xi.Scope({name:a,parent:e,isProvider:e.isProvider});n.push(new xi.AttributeModel({name:l,terraformName:a,terraformFullName:f.fullName(a),type:new xi.SkippedAttributeTypeModel,description:`${a} block`,storageName:`_${l}`,optional:!0,computed:!1,provider:e.isProvider,required:!1}));continue}let o=this.renderAttributesForBlock(new xi.Scope({name:`${e.name}_${a}`,parent:e,isProvider:e.isProvider,inBlockType:!0}),s.block);o=cie(o);let u=this.addStruct([e,new xi.Scope({name:a,parent:e,isProvider:e.isProvider})],o,s.nesting_mode,(s.nesting_mode==="list"||s.nesting_mode==="set")&&s.max_items===1);n.push(i(a,s,u,e.isProvider,e))}return n;function i(a,s,o,u,l){let f=(0,Ay.toCamelCase)(a),h,g;switch(s.nesting_mode){case"single":return h=!o.attributes.some(_=>!_.optional),g=!o.attributes.some(_=>!_.required),!h&&!g&&(h=o.attributes.some(_=>_.optional||_.required)),new xi.AttributeModel({name:f,terraformName:a,terraformFullName:l.fullName(a),type:new xi.StructAttributeTypeModel(o),description:`${a} block`,storageName:`_${f}`,optional:h,computed:!1,provider:u,required:g});case"map":return new xi.AttributeModel({name:f,terraformName:a,terraformFullName:l.fullName(a),type:new xi.MapAttributeTypeModel(new xi.StructAttributeTypeModel(o)),description:`${a} block`,storageName:`_${f}`,optional:!1,computed:!1,provider:u,required:!1});case"list":case"set":return h=s.min_items===void 0?!0:s.min_items<1,g=s.min_items===void 0?!1:s.min_items>0,new xi.AttributeModel({name:f,terraformName:a,terraformFullName:l.fullName(a),type:s.nesting_mode==="list"?new xi.ListAttributeTypeModel(new xi.StructAttributeTypeModel(o),s.max_items===1,!0):new xi.SetAttributeTypeModel(new xi.StructAttributeTypeModel(o),s.max_items===1,!0),description:`${a} block`,storageName:`_${f}`,optional:h,computed:!1,provider:u,required:g})}}}addAnonymousStruct(e,r,n){let i=new Array,a=e[e.length-1];if(r)for(let[s,o]of Object.entries(r||{})){let u=!!a.isComputed||a.isNestedType&&!!o.computed,l=a.isNestedType?!!o.optional:!!a.isOptional,f=a.isNestedType?!!o.required:!!a.isRequired,h=(0,Ay.toCamelCase)(s),g=this.renderAttributeType([...e,new xi.Scope({name:s,parent:a,isProvider:a.isProvider,isComputed:u,isOptional:l,isRequired:f,isNestedType:a.isNestedType})],o.type||o.nested_type);i.push(new xi.AttributeModel({name:h,storageName:`_${h}`,computed:u,description:o.description,optional:l,terraformName:s,terraformFullName:a.fullName(s),type:g,provider:a.isProvider,required:f}))}return i=cie(i),this.addStruct(e,i,n)}addStruct(e,r,n,i=!1){let a=(0,Ay.toPascalCase)(e.map(h=>(0,Ay.toSnakeCase)(h.name)).join("_")),s=this.uniqueClassName(FFt(a)?`${a}Struct`:a),o=e[e.length-1],u=o.isComputed&&!o.isOptional||i,l=!0,f=new xi.Struct(s,r,u,l,i,n);return this.structs.push(f),f}},fie=class{constructor(){this.uniqueClassnames=[],this.uniqueBaseNames=new Map,this.resources={}}parse(e,r,n,i,a){if(this.resources[r])return this.resources[r];let o=new die(this.uniqueClassnames,this.uniqueBaseNames).resourceFrom(e,r,n,i,a);return this.resources[r]=o,o}getClassNameForResource(e){let r=this.resources[e];return r?r.className:""}getNamespaceNameForResource(e){e==="data_external_"&&(e="data_external");let r=this.resources[e];if(!r)return"";let n=`providers/${r.provider}`;return r.filePath.replace(`${n}/`,"").replace("/index.ts","")}};vE.ResourceParser=fie});var FBe=x(qV=>{"use strict";Object.defineProperty(qV,"__esModule",{value:!0});qV.CUSTOM_DEFAULTS=void 0;qV.CUSTOM_DEFAULTS={"aws.security_group.ingress.cidr_blocks":null,"aws.security_group.ingress.description":null,"aws.security_group.ingress.from_port":null,"aws.security_group.ingress.ipv6_cidr_blocks":null,"aws.security_group.ingress.prefix_list_ids":null,"aws.security_group.ingress.protocol":null,"aws.security_group.ingress.security_groups":null,"aws.security_group.ingress.self":null,"aws.security_group.ingress.to_port":null,"aws.security_group.egress.cidr_blocks":null,"aws.security_group.egress.description":null,"aws.security_group.egress.from_port":null,"aws.security_group.egress.ipv6_cidr_blocks":null,"aws.security_group.egress.prefix_list_ids":null,"aws.security_group.egress.protocol":null,"aws.security_group.egress.security_groups":null,"aws.security_group.egress.self":null,"aws.security_group.egress.to_port":null,"aws.default_route_table.route.cidr_block":null,"aws.default_route_table.route.ipv6_cidr_block":null,"aws.default_route_table.route.egress_only_gateway_id":null,"aws.default_route_table.route.gateway_id":null,"aws.default_route_table.route.instance_id":null,"aws.default_route_table.route.nat_gateway_id":null,"aws.default_route_table.route.network_interface_id":null,"aws.default_route_table.route.transit_gateway_id":null,"aws.default_route_table.route.vpc_endpoint_id":null,"aws.default_route_table.route.vpc_peering_connection_id":null,"aws.default_route_table.route.destination_prefix_list_id":null,"aws.default_route_table.route.core_network_arn":null,"aws.emr_cluster.step.action_on_failure":null,"aws.emr_cluster.step.hadoop_jar_step":null,"aws.emr_cluster.step.name":null,"aws.emr_cluster.step.hadoop_jar_step.args":null,"aws.emr_cluster.step.hadoop_jar_step.jar":null,"aws.emr_cluster.step.hadoop_jar_step.main_class":null,"aws.emr_cluster.step.hadoop_jar_step.properties":null,"aws.network_acl.ingress.from_port":null,"aws.network_acl.ingress.to_port":null,"aws.network_acl.ingress.rule_no":null,"aws.network_acl.ingress.action":null,"aws.network_acl.ingress.protocol":null,"aws.network_acl.ingress.cidr_block":null,"aws.network_acl.ingress.ipv6_cidr_block":null,"aws.network_acl.ingress.icmp_type":null,"aws.network_acl.ingress.icmp_code":null,"aws.network_acl.egress.from_port":null,"aws.network_acl.egress.to_port":null,"aws.network_acl.egress.rule_no":null,"aws.network_acl.egress.action":null,"aws.network_acl.egress.protocol":null,"aws.network_acl.egress.cidr_block":null,"aws.network_acl.egress.ipv6_cidr_block":null,"aws.network_acl.egress.icmp_type":null,"aws.network_acl.egress.icmp_code":null,"aws.route_table.route.cidr_block":null,"aws.route_table.route.ipv6_cidr_block":null,"aws.route_table.route.egress_only_gateway_id":null,"aws.route_table.route.gateway_id":null,"aws.route_table.route.instance_id":null,"aws.route_table.route.nat_gateway_id":null,"aws.route_table.route.local_gateway_id":null,"aws.route_table.route.network_interface_id":null,"aws.route_table.route.transit_gateway_id":null,"aws.route_table.route.vpc_endpoint_id":null,"aws.route_table.route.vpc_peering_connection_id":null,"aws.route_table.route.destination_prefix_list_id":null,"aws.route_table.route.carrier_gateway_id":null,"aws.route_table.route.core_network_arn":null,"aws.default_security_group.ingress.cidr_blocks":null,"aws.default_security_group.ingress.description":null,"aws.default_security_group.ingress.from_port":null,"aws.default_security_group.ingress.ipv6_cidr_blocks":null,"aws.default_security_group.ingress.prefix_list_ids":null,"aws.default_security_group.ingress.protocol":null,"aws.default_security_group.ingress.security_groups":null,"aws.default_security_group.ingress.self":null,"aws.default_security_group.ingress.to_port":null,"aws.default_security_group.egress.cidr_blocks":null,"aws.default_security_group.egress.description":null,"aws.default_security_group.egress.from_port":null,"aws.default_security_group.egress.ipv6_cidr_blocks":null,"aws.default_security_group.egress.prefix_list_ids":null,"aws.default_security_group.egress.protocol":null,"aws.default_security_group.egress.security_groups":null,"aws.default_security_group.egress.self":null,"aws.default_security_group.egress.to_port":null,"azuread.application.app_role.id":null,"azuread.application.app_role.allowed_member_types":null,"azuread.application.app_role.description":null,"azuread.application.app_role.display_name":null,"azuread.application.app_role.is_enabled":null,"azuread.application.app_role.value":null,"azuread.application.oauth2_permissions.id":null,"azuread.application.oauth2_permissions.admin_consent_description":null,"azuread.application.oauth2_permissions.admin_consent_display_name":null,"azuread.application.oauth2_permissions.value":null,"azuread.application.oauth2_permissions.type":null,"azuread.application.oauth2_permissions.is_enabled":null,"azuread.application.oauth2_permissions.user_consent_description":null,"azuread.application.oauth2_permissions.user_consent_display_name":null,"azurestack.route_table.route.name":null,"azurestack.route_table.route.address_prefix":null,"azurestack.route_table.route.next_hop_type":null,"azurestack.route_table.route.next_hop_in_ip_address":null,"azurestack.network_security_group.security_rule.name":null,"azurestack.network_security_group.security_rule.description":null,"azurestack.network_security_group.security_rule.protocol":null,"azurestack.network_security_group.security_rule.source_port_range":null,"azurestack.network_security_group.security_rule.source_port_ranges":null,"azurestack.network_security_group.security_rule.destination_port_range":null,"azurestack.network_security_group.security_rule.destination_port_ranges":null,"azurestack.network_security_group.security_rule.source_address_prefix":null,"azurestack.network_security_group.security_rule.source_address_prefixes":null,"azurestack.network_security_group.security_rule.destination_address_prefix":null,"azurestack.network_security_group.security_rule.destination_address_prefixes":null,"azurestack.network_security_group.security_rule.destination_application_security_group_ids":null,"azurestack.network_security_group.security_rule.source_application_security_group_ids":null,"azurestack.network_security_group.security_rule.access":null,"azurestack.network_security_group.security_rule.priority":null,"azurestack.network_security_group.security_rule.direction":null,"azurestack.virtual_network.subnet.name":null,"azurestack.virtual_network.subnet.address_prefix":null,"azurestack.virtual_network.subnet.security_group":null,"azurestack.virtual_network.subnet.id":null,"azurestack.key_vault.access_policy.tenant_id":null,"azurestack.key_vault.access_policy.object_id":null,"azurestack.key_vault.access_policy.application_id":null,"azurestack.key_vault.access_policy.certificate_permissions":null,"azurestack.key_vault.access_policy.key_permissions":null,"azurestack.key_vault.access_policy.secret_permissions":null,"azurestack.key_vault.access_policy.storage_permissions":null,"vault.auth_backend.tune.default_lease_ttl":null,"vault.auth_backend.tune.max_lease_ttl":null,"vault.auth_backend.tune.audit_non_hmac_request_keys":null,"vault.auth_backend.tune.audit_non_hmac_response_keys":null,"vault.auth_backend.tune.listing_visibility":null,"vault.auth_backend.tune.passthrough_request_headers":null,"vault.auth_backend.tune.allowed_response_headers":null,"vault.auth_backend.tune.token_type":null,"vault.github_auth_backend.tune.default_lease_ttl":null,"vault.github_auth_backend.tune.max_lease_ttl":null,"vault.github_auth_backend.tune.audit_non_hmac_request_keys":null,"vault.github_auth_backend.tune.audit_non_hmac_response_keys":null,"vault.github_auth_backend.tune.listing_visibility":null,"vault.github_auth_backend.tune.passthrough_request_headers":null,"vault.github_auth_backend.tune.allowed_response_headers":null,"vault.github_auth_backend.tune.token_type":null,"vault.jwt_auth_backend.tune.default_lease_ttl":null,"vault.jwt_auth_backend.tune.max_lease_ttl":null,"vault.jwt_auth_backend.tune.audit_non_hmac_request_keys":null,"vault.jwt_auth_backend.tune.audit_non_hmac_response_keys":null,"vault.jwt_auth_backend.tune.listing_visibility":null,"vault.jwt_auth_backend.tune.passthrough_request_headers":null,"vault.jwt_auth_backend.tune.allowed_response_headers":null,"vault.jwt_auth_backend.tune.token_type":null,"vault.okta_auth_backend.group.group_name":null,"vault.okta_auth_backend.group.policies":null,"vault.okta_auth_backend.user.username":null,"vault.okta_auth_backend.user.groups":null,"vault.okta_auth_backend.user.policies":null,"google.compute_instance.guest_accelerator.count":null,"google.compute_instance.guest_accelerator.type":null,"google.compute_instance_from_template.attached_disk.source":null,"google.compute_instance_from_template.attached_disk.device_name":null,"google.compute_instance_from_template.attached_disk.mode":null,"google.compute_instance_from_template.attached_disk.disk_encryption_key_raw":null,"google.compute_instance_from_template.attached_disk.kms_key_self_link":null,"google.compute_instance_from_template.guest_accelerator.count":null,"google.compute_instance_from_template.guest_accelerator.type":null,"google.compute_instance_from_template.service_account.email":null,"google.compute_instance_from_template.service_account.scopes":null,"google.compute_instance_from_template.scratch_disk.interface":null,"google.compute_instance_from_template.network_interface.alias_ip_range.ip_cidr_range":null,"google.compute_instance_from_template.network_interface.alias_ip_range.subnetwork_range_name":null,"google.compute_instance_from_template.network_interface.access_config.nat_ip":null,"google.compute_instance_from_template.network_interface.access_config.public_ptr_domain_name":null,"google.compute_instance_from_template.network_interface.access_config.network_tier":null,"google.compute_subnetwork.secondary_ip_range.range_name":null,"google.compute_subnetwork.secondary_ip_range.ip_cidr_range":null,"google.container_cluster.node_config.guest_accelerator.count":null,"google.container_cluster.node_config.guest_accelerator.type":null,"google.container_cluster.node_config.guest_accelerator.gpu_partition_size":null,"google.container_cluster.node_config.guest_accelerator.gpu_sharing_config":null,"google.container_cluster.node_config.guest_accelerator.gpu_sharing_config.gpu_sharing_strategy":null,"google.container_cluster.node_config.guest_accelerator.gpu_sharing_config.max_shared_clients_per_gpu":null,"google.container_cluster.node_config.taint.key":null,"google.container_cluster.node_config.taint.value":null,"google.container_cluster.node_config.taint.effect":null,"google.container_node_pool.node_config.guest_accelerator.count":null,"google.container_node_pool.node_config.guest_accelerator.type":null,"google.container_node_pool.node_config.guest_accelerator.gpu_partition_size":null,"google.container_node_pool.node_config.guest_accelerator.gpu_sharing_config":null,"google.container_node_pool.node_config.guest_accelerator.gpu_sharing_config.gpu_sharing_strategy":null,"google.container_node_pool.node_config.guest_accelerator.gpu_sharing_config.max_shared_clients_per_gpu":null,"google.container_node_pool.node_config.taint.key":null,"google.container_node_pool.node_config.taint.value":null,"google.container_node_pool.node_config.taint.effect":null,"google.composer_environment.ip_allocation_policy.use_ip_aliases":null,"google.composer_environment.ip_allocation_policy.cluster_secondary_range_name":null,"google.composer_environment.ip_allocation_policy.services_secondary_range_name":null,"google.composer_environment.ip_allocation_policy.cluster_ipv4_cidr_block":null,"google.composer_environment.ip_allocation_policy.services_ipv4_cidr_block":null,"azurerm.eventgrid_topic.inbound_ip_rule.ip_mask":null,"azurerm.eventgrid_topic.inbound_ip_rule.action":null,"azurerm.eventgrid_domain.inbound_ip_rule.ip_mask":null,"azurerm.eventgrid_domain.inbound_ip_rule.action":null,"azurerm.container_registry.network_rule_set.default_action":null,"azurerm.container_registry.network_rule_set.ip_rule":null,"azurerm.container_registry.network_rule_set.virtual_network":null,"azurerm.container_registry.network_rule_set.ip_rule.action":null,"azurerm.container_registry.network_rule_set.ip_rule.ip_range":null,"azurerm.container_registry.network_rule_set.virtual_network.action":null,"azurerm.container_registry.network_rule_set.virtual_network.subnet_id":null,"azurerm.container_registry.retention_policy.days":null,"azurerm.container_registry.retention_policy.enabled":null,"azurerm.container_registry.trust_policy.enabled":null,"azurerm.container_registry.encryption.enabled":null,"azurerm.container_registry.encryption.identity_client_id":null,"azurerm.container_registry.encryption.key_vault_key_id":null,"azurerm.eventhub_namespace.network_rulesets.default_action":null,"azurerm.eventhub_namespace.network_rulesets.public_network_access_enabled":null,"azurerm.eventhub_namespace.network_rulesets.trusted_service_access_enabled":null,"azurerm.eventhub_namespace.network_rulesets.virtual_network_rule":null,"azurerm.eventhub_namespace.network_rulesets.virtual_network_rule.subnet_id":null,"azurerm.eventhub_namespace.network_rulesets.virtual_network_rule.ignore_missing_virtual_network_service_endpoint":null,"azurerm.eventhub_namespace.network_rulesets.ip_rule":null,"azurerm.eventhub_namespace.network_rulesets.ip_rule.ip_mask":null,"azurerm.eventhub_namespace.network_rulesets.ip_rule.action":null,"azurerm.automation_runbook.job_schedule.schedule_name":null,"azurerm.automation_runbook.job_schedule.parameters":null,"azurerm.automation_runbook.job_schedule.run_on":null,"azurerm.automation_runbook.job_schedule.job_schedule_id":null,"azurerm.mssql_database.extended_auditing_policy.storage_account_access_key":null,"azurerm.mssql_database.extended_auditing_policy.storage_endpoint":null,"azurerm.mssql_database.extended_auditing_policy.storage_account_access_key_is_secondary":null,"azurerm.mssql_database.extended_auditing_policy.retention_in_days":null,"azurerm.mssql_database.extended_auditing_policy.log_monitoring_enabled":null,"azurerm.mssql_server.extended_auditing_policy.storage_account_access_key":null,"azurerm.mssql_server.extended_auditing_policy.storage_endpoint":null,"azurerm.mssql_server.extended_auditing_policy.storage_account_access_key_is_secondary":null,"azurerm.mssql_server.extended_auditing_policy.retention_in_days":null,"azurerm.mssql_server.extended_auditing_policy.log_monitoring_enabled":null,"azurerm.route_filter.rule.access":null,"azurerm.route_filter.rule.communities":null,"azurerm.route_filter.rule.name":null,"azurerm.route_filter.rule.rule_type":null,"azurerm.route_table.route.name":null,"azurerm.route_table.route.address_prefix":null,"azurerm.route_table.route.next_hop_type":null,"azurerm.route_table.route.next_hop_in_ip_address":null,"azurerm.site_recovery_replicated_vm.managed_disk.disk_id":null,"azurerm.site_recovery_replicated_vm.managed_disk.staging_storage_account_id":null,"azurerm.site_recovery_replicated_vm.managed_disk.target_resource_group_id":null,"azurerm.site_recovery_replicated_vm.managed_disk.target_disk_type":null,"azurerm.site_recovery_replicated_vm.managed_disk.target_replica_disk_type":null,"azurerm.site_recovery_replicated_vm.managed_disk.target_disk_encryption_set_id":null,"azurerm.site_recovery_replicated_vm.managed_disk.target_disk_encryption":null,"azurerm.site_recovery_replicated_vm.network_interface.source_network_interface_id":null,"azurerm.site_recovery_replicated_vm.network_interface.target_static_ip":null,"azurerm.site_recovery_replicated_vm.network_interface.target_subnet_name":null,"azurerm.site_recovery_replicated_vm.network_interface.recovery_public_ip_address_id":null,"azurerm.iothub.endpoint.type":null,"azurerm.iothub.endpoint.authentication_type":null,"azurerm.iothub.endpoint.identity_id":null,"azurerm.iothub.endpoint.endpoint_uri":null,"azurerm.iothub.endpoint.entity_path":null,"azurerm.iothub.endpoint.connection_string":null,"azurerm.iothub.endpoint.name":null,"azurerm.iothub.endpoint.batch_frequency_in_seconds":null,"azurerm.iothub.endpoint.max_chunk_size_in_bytes":null,"azurerm.iothub.endpoint.container_name":null,"azurerm.iothub.endpoint.encoding":null,"azurerm.iothub.endpoint.file_name_format":null,"azurerm.iothub.endpoint.resource_group_name":null,"azurerm.iothub.route.name":null,"azurerm.iothub.route.source":null,"azurerm.iothub.route.condition":null,"azurerm.iothub.route.endpoint_names":null,"azurerm.iothub.route.enabled":null,"azurerm.iothub.enrichment.key":null,"azurerm.iothub.enrichment.value":null,"azurerm.iothub.enrichment.endpoint_names":null,"azurerm.virtual_network.subnet.name":null,"azurerm.virtual_network.subnet.address_prefix":null,"azurerm.virtual_network.subnet.security_group":null,"azurerm.virtual_network.subnet.id":null,"azurerm.network_security_group.security_rule.name":null,"azurerm.network_security_group.security_rule.description":null,"azurerm.network_security_group.security_rule.protocol":null,"azurerm.network_security_group.security_rule.source_port_range":null,"azurerm.network_security_group.security_rule.source_port_ranges":null,"azurerm.network_security_group.security_rule.destination_port_range":null,"azurerm.network_security_group.security_rule.destination_port_ranges":null,"azurerm.network_security_group.security_rule.source_address_prefix":null,"azurerm.network_security_group.security_rule.source_address_prefixes":null,"azurerm.network_security_group.security_rule.destination_address_prefix":null,"azurerm.network_security_group.security_rule.destination_address_prefixes":null,"azurerm.network_security_group.security_rule.destination_application_security_group_ids":null,"azurerm.network_security_group.security_rule.source_application_security_group_ids":null,"azurerm.network_security_group.security_rule.access":null,"azurerm.network_security_group.security_rule.priority":null,"azurerm.network_security_group.security_rule.direction":null,"azurerm.synapse_workspace.aad_admin.login":null,"azurerm.synapse_workspace.aad_admin.object_id":null,"azurerm.synapse_workspace.aad_admin.tenant_id":null,"azurerm.synapse_workspace.sql_aad_admin.login":null,"azurerm.synapse_workspace.sql_aad_admin.object_id":null,"azurerm.synapse_workspace.sql_aad_admin.tenant_id":null,"azurerm.batch_pool.container_configuration.container_registries.registry_server":null,"azurerm.batch_pool.container_configuration.container_registries.user_name":null,"azurerm.batch_pool.container_configuration.container_registries.password":null,"azurerm.key_vault.access_policy.tenant_id":null,"azurerm.key_vault.access_policy.object_id":null,"azurerm.key_vault.access_policy.application_id":null,"azurerm.key_vault.access_policy.certificate_permissions":null,"azurerm.key_vault.access_policy.key_permissions":null,"azurerm.key_vault.access_policy.secret_permissions":null,"azurerm.key_vault.access_policy.storage_permissions":null,"azurerm.app_service.ip_restriction.ip_address":null,"azurerm.app_service.ip_restriction.service_tag":null,"azurerm.app_service.ip_restriction.subnet_id":null,"azurerm.app_service.ip_restriction.virtual_network_subnet_id":null,"azurerm.app_service.ip_restriction.name":null,"azurerm.app_service.ip_restriction.priority":null,"azurerm.app_service.ip_restriction.action":null,"azurerm.app_service.ip_restriction.headers":null,"azurerm.app_service.ip_restriction.headers.x_forwarded_host":null,"azurerm.app_service.ip_restriction.headers.x_forwarded_for":null,"azurerm.app_service.ip_restriction.headers.x_azure_fdid":null,"azurerm.app_service.ip_restriction.headers.x_fd_health_probe":null,"azurerm.app_service.scm_ip_restriction.ip_address":null,"azurerm.app_service.scm_ip_restriction.service_tag":null,"azurerm.app_service.scm_ip_restriction.subnet_id":null,"azurerm.app_service.scm_ip_restriction.virtual_network_subnet_id":null,"azurerm.app_service.scm_ip_restriction.name":null,"azurerm.app_service.scm_ip_restriction.priority":null,"azurerm.app_service.scm_ip_restriction.action":null,"azurerm.app_service.scm_ip_restriction.headers":null,"azurerm.app_service.scm_ip_restriction.headers.x_forwarded_host":null,"azurerm.app_service.scm_ip_restriction.headers.x_forwarded_for":null,"azurerm.app_service.scm_ip_restriction.headers.x_azure_fdid":null,"azurerm.app_service.scm_ip_restriction.headers.x_fd_health_probe":null,"azurerm.function_app.ip_restriction.ip_address":null,"azurerm.function_app.ip_restriction.service_tag":null,"azurerm.function_app.ip_restriction.subnet_id":null,"azurerm.function_app.ip_restriction.virtual_network_subnet_id":null,"azurerm.function_app.ip_restriction.name":null,"azurerm.function_app.ip_restriction.priority":null,"azurerm.function_app.ip_restriction.action":null,"azurerm.function_app.ip_restriction.headers":null,"azurerm.function_app.ip_restriction.headers.x_forwarded_host":null,"azurerm.function_app.ip_restriction.headers.x_forwarded_for":null,"azurerm.function_app.ip_restriction.headers.x_azure_fdid":null,"azurerm.function_app.ip_restriction.headers.x_fd_health_probe":null,"azurerm.function_app.scm_ip_restriction.ip_address":null,"azurerm.function_app.scm_ip_restriction.service_tag":null,"azurerm.function_app.scm_ip_restriction.subnet_id":null,"azurerm.function_app.scm_ip_restriction.virtual_network_subnet_id":null,"azurerm.function_app.scm_ip_restriction.name":null,"azurerm.function_app.scm_ip_restriction.priority":null,"azurerm.function_app.scm_ip_restriction.action":null,"azurerm.function_app.scm_ip_restriction.headers":null,"azurerm.function_app.scm_ip_restriction.headers.x_forwarded_host":null,"azurerm.function_app.scm_ip_restriction.headers.x_forwarded_for":null,"azurerm.function_app.scm_ip_restriction.headers.x_azure_fdid":null,"azurerm.function_app.scm_ip_restriction.headers.x_fd_health_probe":null,"azurerm.logic_app_standard.ip_restriction.ip_address":null,"azurerm.logic_app_standard.ip_restriction.service_tag":null,"azurerm.logic_app_standard.ip_restriction.subnet_id":null,"azurerm.logic_app_standard.ip_restriction.virtual_network_subnet_id":null,"azurerm.logic_app_standard.ip_restriction.name":null,"azurerm.logic_app_standard.ip_restriction.priority":null,"azurerm.logic_app_standard.ip_restriction.action":null,"azurerm.logic_app_standard.ip_restriction.headers":null,"azurerm.logic_app_standard.ip_restriction.headers.x_forwarded_host":null,"azurerm.logic_app_standard.ip_restriction.headers.x_forwarded_for":null,"azurerm.logic_app_standard.ip_restriction.headers.x_azure_fdid":null,"azurerm.logic_app_standard.ip_restriction.headers.x_fd_health_probe":null,"azurerm.logic_app_standard.scm_ip_restriction.ip_address":null,"azurerm.logic_app_standard.scm_ip_restriction.service_tag":null,"azurerm.logic_app_standard.scm_ip_restriction.subnet_id":null,"azurerm.logic_app_standard.scm_ip_restriction.virtual_network_subnet_id":null,"azurerm.logic_app_standard.scm_ip_restriction.name":null,"azurerm.logic_app_standard.scm_ip_restriction.priority":null,"azurerm.logic_app_standard.scm_ip_restriction.action":null,"azurerm.logic_app_standard.scm_ip_restriction.headers":null,"azurerm.logic_app_standard.scm_ip_restriction.headers.x_forwarded_host":null,"azurerm.logic_app_standard.scm_ip_restriction.headers.x_forwarded_for":null,"azurerm.logic_app_standard.scm_ip_restriction.headers.x_azure_fdid":null,"azurerm.logic_app_standard.scm_ip_restriction.headers.x_fd_health_probe":null,"azurerm.api_management.policy.xml_content":null,"azurerm.api_management.policy.xml_link":null,"azurerm.container_group.exposed_port.port":null,"azurerm.container_group.exposed_port.protocol":null}});var $V=x(KV=>{"use strict";Object.defineProperty(KV,"__esModule",{value:!0});KV.AttributesEmitter=void 0;var OBe=gE(),kBe=FBe();function zV(t){return t[0].toUpperCase()+t.slice(1)}var hie=class{constructor(e){this.code=e}emit(e,r,n){this.code.line(),this.code.line(`// ${e.terraformName} - computed: ${e.computed}, optional: ${e.isOptional}, required: ${e.isRequired}`);let i=e.isStored,a=i&&!e.isRequired&&e.setterType._type!=="none",s=i&&e.setterType._type!=="none",o=e.getterType;switch(o._type==="stored_class"?this.code.line(`private ${e.storageName} = ${this.storedClassInit(e)};`):i&&this.code.line(`private ${e.storageName}?: ${e.type.inputTypeDefinition}; `),o._type){case"plain":this.code.openBlock(`public get ${e.name}()`),this.code.line(`return ${this.determineGetAttCall(e)};`),this.code.closeBlock();break;case"args":this.code.openBlock(`public ${e.name}(${o.args})${o.returnType?": "+o.returnType:""}`),this.code.line(`return ${o.returnStatement};`),this.code.closeBlock();break;case"stored_class":this.code.openBlock(`public get ${e.name}()`),this.code.line(`return this.${e.storageName};`),this.code.closeBlock();break}let u=e.setterType;switch(u._type){case"set":this.code.openBlock(`public set ${e.name}(value: ${u.type})`),this.code.line(`this.${e.storageName} = value;`),this.code.closeBlock();break;case"put":this.code.openBlock(`public put${zV(e.name)}(value: ${u.type})`),this.code.line(`this.${e.storageName} = value;`),this.code.closeBlock();break;case"stored_class":this.code.openBlock(`public put${zV(e.name)}(value: ${u.type})`),this.code.line(`this.${e.storageName}.internalValue = value;`),this.code.closeBlock();break}a&&(this.code.openBlock(`public ${this.getResetName(e.name,r)}()`),u._type==="stored_class"?this.code.line(`this.${e.storageName}.internalValue = undefined;`):this.code.line(`this.${e.storageName} = undefined;`),this.code.closeBlock()),s&&(this.code.line("// Temporarily expose input value. Use with caution."),this.code.openBlock(`public get ${this.getInputName(e,n)}()`),u._type==="stored_class"?this.code.line(`return this.${e.storageName}.internalValue;`):this.code.line(`return this.${e.storageName};`),this.code.closeBlock())}storedClassInit(e){return e.type.getStoredClassInitializer(e.terraformName)}determineGetAttCall(e){return e.isProvider?`this.${e.storageName}`:e.type.getAttributeAccessFunction(e.terraformName)}needsInputEscape(e,r){return r.find(n=>n.terraformName.match(`^${e.terraformName}_input$`))instanceof OBe.AttributeModel}getInputName(e,r){return r?`${e.name}TfInput`:`${e.name}Input`}needsResetEscape(e,r){return r.find(n=>n.terraformName.match(`^reset_${e.terraformName}$`))instanceof OBe.AttributeModel}getResetName(e,r){return e&&(r?`resetTf${zV(e)}`:`reset${zV(e)}`)}emitToHclTerraform(e,r){var n;let i=e.type,a=r?"struct!":"this",s=r?e.name:e.storageName,o=kBe.CUSTOM_DEFAULTS[e.terraformFullName],u=`${a}.${s}${!r&&i.isComplex&&!e.isProvider&&(!((n=i.struct)===null||n===void 0)&&n.isClass||e.getterType._type==="stored_class")?".internalValue":""}`,f=`${o!==void 0?`${u} === undefined ? ${o} : `:""}${i.toHclTerraformFunction}(${u})`,h=e.type.isComplex,g=e.type.typeModelType;this.code.open(`${e.terraformName}: {`),this.code.line(`value: ${f},`),this.code.line(`isBlock: ${h},`),this.code.line(`type: "${g}",`),this.code.line(`storageClassType: "${e.type.storedClassType}",`),this.code.close("},")}emitToTerraform(e,r){var n;let i=e.type,a=r?"struct!":"this",s=r?e.name:e.storageName,o=kBe.CUSTOM_DEFAULTS[e.terraformFullName],u=`${a}.${s}${!r&&i.isComplex&&!e.isProvider&&(!((n=i.struct)===null||n===void 0)&&n.isClass||e.getterType._type==="stored_class")?".internalValue":""}`,l=o!==void 0?`${u} === undefined ? ${o} : `:"";this.code.line(`${e.terraformName}: ${l}${i.toTerraformFunction}(${u}),`)}};KV.AttributesEmitter=hie});var QV=x(JV=>{"use strict";Object.defineProperty(JV,"__esModule",{value:!0});JV.sanitizedComment=void 0;function kFt(t){let e=!1;return t.line("/**"),{line:r=>{if(typeof r=="object"&&!Array.isArray(r))return;let n=Array.isArray(r)?r.join(`
103
+ `)?i=s.slice(2,-1):i="any"}let a={name:r,type:i,description:n.description,required:n.hasOwnProperty("default")==!1};a.required||(a.default=n.default),e.push(a)}return e},tFt=t=>{let e=[];if(t)for(let r of Object.keys(t)){let n=vBe(t[r]),i={name:r,description:n.description};e.push(i)}return e},rFt=async(t,e)=>{let r=aN.join(t,".terraform","modules","modules.json"),n={};if(!WV.existsSync(r))throw new Error(`Modules were not generated properly - couldn't find ${r}`);let i=JSON.parse(WV.readFileSync(r,"utf-8"));for(let a of e){let s=i.Modules.find(l=>a===l.Key);if(!s)throw new Error(`Couldn't find ${s}`);let o=await(0,$Gt.convertFiles)(aN.join(t,s.Dir));if(!o)throw new Error(`Modules were not generated properly - couldn't parse ${s.Dir}`);let u={inputs:eFt(o.variable),outputs:tFt(o.output),name:a};n[a]=u}return n};async function nFt(t){let e={provider:{},terraform:{required_providers:{}}};e.provider[t.name]={},e.terraform.required_providers[t.name]={version:t.version,source:t.source};let r={format_version:"0.1"};return await(0,SI.withTempDir)("fetchProviderSchema",async()=>{let n=process.cwd(),i=aN.join(n,"main.tf.json");await WV.writeFile(i,JSON.stringify(e)),await gBe({cwd:n}),r=JSON.parse(await(0,SI.exec)(VV,["providers","schema","-json"],{cwd:n}));let a=JSON.parse(await(0,SI.exec)(VV,["version","-json"],{cwd:n}));r.provider_versions=a.provider_selections}),yBe(r)}Lc.readProviderSchema=nFt;function yBe(t){function e(n){if((0,SI.isNestedTypeAttribute)(n)||!Array.isArray(n.type))return n;let i=n.type.length===2?n.type:n.type.slice(0,2);return n.type=i,n}function r(n){Object.values(n.attributes||{}).forEach(e),Object.values(n.block_types||{}).forEach(i=>{r(i.block)})}return Object.values(t.provider_schemas||{}).forEach(n=>{[n.provider,...Object.values(n.resource_schemas||{}),...Object.values(n.data_source_schemas||{})].forEach(a=>{r(a.block)})}),t}Lc.sanitizeProviderSchema=yBe;async function iFt(t){let e={};return await(0,SI.withTempDir)("fetchSchema",async()=>{let r={terraform:{}};r.module||(r.module={});let n=t.source,i=t.constraint.localSourceAbsolutePath;i&&(n=aN.relative(process.cwd(),i)),r.module[t.moduleKey]={source:n},t.version&&(r.module[t.moduleKey].version=t.version);let a=process.cwd(),s=aN.join(a,"main.tf.json");await WV.writeFile(s,JSON.stringify(r)),await(0,SI.exec)(VV,["get"],{cwd:a}),r.module&&(e=await rFt(a,Object.keys(r.module)))}),e}Lc.readModuleSchema=iFt});var _Be=x(wy=>{"use strict";var aFt=wy&&wy.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sFt=wy&&wy.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bBe=wy&&wy.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&aFt(e,t,r);return sFt(e,t),e};Object.defineProperty(wy,"__esModule",{value:!0});wy.cachedAccess=void 0;var dE=Ln(),PV=bBe(qne()),oFt=bBe(require("path"));function uFt(t){return`${encodeURIComponent(t.fqn)}@${encodeURIComponent(t.version||"")}`}function lFt(t,e){let r=typeof e=="string"&&e.length>0;if(r&&!PV.lstatSync(e).isDirectory())throw dE.Errors.Usage(`Provider Schema Cache directory '${e}' is not a directory`);return r?(dE.logger.debug(`Provider Schema Cache enabled, caching at ${e}`),async n=>{let i=uFt(n),a=oFt.join(e,`${i}.json`);if(PV.existsSync(a))return dE.logger.debug(`Cache hit for ${i}`),JSON.parse(await PV.readFile(a,"utf-8"));dE.logger.debug(`Cache miss for ${i}, generating schema`);let s=await t(n);return await PV.writeFile(a,JSON.stringify(s)),dE.logger.debug(`Write cache for ${i}`),s}):(dE.logger.debug("Provider Schema Cache disabled"),n=>t(n))}wy.cachedAccess=lFt});var IBe=x(Q0=>{"use strict";var cFt=Q0&&Q0.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Q0,"__esModule",{value:!0});Q0.readSchema=Q0.isLocalModule=Q0.TerraformProviderConstraint=Q0.TerraformModuleConstraint=Q0.isRegistryModule=void 0;var HV=Ln();Object.defineProperty(Q0,"isRegistryModule",{enumerable:!0,get:function(){return HV.isRegistryModule}});Object.defineProperty(Q0,"TerraformModuleConstraint",{enumerable:!0,get:function(){return HV.TerraformModuleConstraint}});Object.defineProperty(Q0,"TerraformProviderConstraint",{enumerable:!0,get:function(){return HV.TerraformProviderConstraint}});Object.defineProperty(Q0,"isLocalModule",{enumerable:!0,get:function(){return HV.isLocalModule}});var Kne=Ln(),dFt=cFt(ORe()),CBe=zne(),fFt=_Be();async function pFt(t,e){let r=(0,fFt.cachedAccess)(CBe.readProviderSchema,e),n=t.map(a=>Kne.ConstructsMakerProviderTarget.from(a,Kne.LANGUAGES[0]));hFt(n);let i=await Promise.all(n.map(a=>a.isModule?(0,CBe.readModuleSchema)(a).then(s=>({moduleSchema:s})):r(a).then(s=>({providerSchema:s}))));return i.unshift({providerSchema:{format_version:"0.1"},moduleSchema:{}}),dFt.default.all(i)}Q0.readSchema=pFt;function hFt(t){let e=t.filter(r=>r.isModule);e.forEach(r=>{e.forEach(n=>{if(r!==n&&r.name===n.name)throw Kne.Errors.Usage(`Found two modules with the same name "${r.name}" which is not supported. Please rename one of the modules in your cdktf.json config. For more information on how to set the name refer to https://cdktn.io/docs/concepts/modules#add-module-to-cdktf-json`)})})}});var S_=x(fE=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});fE.parseFQPN=fE.readSchema=void 0;var mFt=IBe();Object.defineProperty(fE,"readSchema",{enumerable:!0,get:function(){return mFt.readSchema}});var gFt=zne();Object.defineProperty(fE,"parseFQPN",{enumerable:!0,get:function(){return gFt.parseFQPN}})});var EBe=x(pE=>{"use strict";Object.defineProperty(pE,"__esModule",{value:!0});pE.AttributeModel=pE.escapeAttributeName=void 0;function SBe(t){return t==="self"||t==="build"?`${t}Attribute`:t.match(/^get[A-Za-z]+/)?t.replace("get","fetch"):t==="equals"?"equalTo":t==="node"?"nodeAttribute":t==="system"?"systemAttribute":t==="tfResourceType"?`${t}Attribute`:t==="importFrom"?`${t}Attribute`:t==="moveTo"?`${t}Attribute`:t==="software"?`${t}Attribute`:t}pE.escapeAttributeName=SBe;var $ne=class t{constructor(e){this.storageName=e.storageName,this._name=e.name,this.type=e.type,this.optional=e.optional,this.computed=e.computed,this.terraformName=e.terraformName,this.terraformFullName=e.terraformFullName,this._description=e.description,this.provider=e.provider,this.required=e.required,this.forcePlainGetterType=e.forcePlainGetterType}get typeDefinition(){let e=this.optional?"?":"";return`${this.name}${e}: ${this.type.inputTypeDefinition}`}get isAssignable(){return this.required||this.optional}get isOptional(){return this.optional}get isRequired(){return this.required}get isProvider(){return this.provider}get getterType(){let e={_type:"plain"};return this.forcePlainGetterType||this.isProvider||(this.type.hasReferenceClass?e={_type:"stored_class"}:this.computed&&!this.isAssignable&&(!this.type.isTokenizable||this.type.typeModelType==="map")&&(e={_type:"stored_class"})),e}get isStored(){return this.isAssignable}get setterType(){return this.isStored?this.getterType._type==="stored_class"?{_type:"stored_class",type:this.type.inputTypeDefinition}:{_type:"set",type:`${this.type.inputTypeDefinition}${this.isProvider?" | undefined":""}`}:{_type:"none"}}get name(){return t.escapeName(this._name)}static escapeName(e){return SBe(e)}get description(){var e;return(e=this._description)===null||e===void 0?void 0:e.replace(/'''/gi,"```")}getReferencedTypes(e){let r=this.type.struct;if(!r)return;let n=[];return this.isAssignable&&(n.push(r.name),n.push(r.mapperName),n.push(r.hclMapperName)),!r.isSingleItem&&(r.nestingMode==="list"||r.nestingMode==="set")?n.push(r.listName):r.nestingMode==="map"?n.push(r.mapName):r.nestingMode==="maplist"||r.nestingMode==="mapset"?n.push(r.mapListName):r.nestingMode==="listmap"||r.nestingMode==="setmap"?n.push(r.listMapName):r.nestingMode==="listlist"||r.nestingMode==="listset"||r.nestingMode==="setlist"||r.nestingMode=="setset"?n.push(r.listListName):e||n.push(r.outputReferenceName),n}};pE.AttributeModel=$ne});var MV=x(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});hE.uppercaseFirst=hE.downcaseFirst=void 0;function vFt(t){return t===""?t:`${t[0].toLocaleLowerCase()}${t.slice(1)}`}hE.downcaseFirst=vFt;function yFt(t){return t===""?t:`${t[0].toLocaleUpperCase()}${t.slice(1)}`}hE.uppercaseFirst=yFt});var xBe=x(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.MapAttributeTypeModel=eh.SetAttributeTypeModel=eh.ListAttributeTypeModel=eh.StructAttributeTypeModel=eh.SimpleAttributeTypeModel=eh.SkippedAttributeTypeModel=void 0;var EI=MV(),Jne=class{constructor(){}get typeModelType(){return"simple"}get struct(){}get isComplex(){return!1}getStoredClassInitializer(e){return""}get storedClassType(){return"any"}get inputTypeDefinition(){return"any"}getAttributeAccessFunction(e){return`this.interpolationForAttribute('${e}')`}get toTerraformFunction(){return"cdktn.anyToTerraform"}get toHclTerraformFunction(){return"cdktn.anyToHclTerraform"}get hasReferenceClass(){return!1}get isTokenizable(){return!1}};eh.SkippedAttributeTypeModel=Jne;var Qne=class{constructor(e){this.type=e}get typeModelType(){return"simple"}get struct(){}get isComplex(){return!1}getStoredClassInitializer(e){return""}get storedClassType(){return this.type}get inputTypeDefinition(){return this.type==="boolean"?"boolean | cdktn.IResolvable":this.type}getAttributeAccessFunction(e){return`this.get${(0,EI.uppercaseFirst)(this.type)}Attribute('${e}')`}get toTerraformFunction(){return`cdktn.${this.type}ToTerraform`}get toHclTerraformFunction(){return`cdktn.${this.type}ToHclTerraform`}get hasReferenceClass(){return!1}get isTokenizable(){return!0}};eh.SimpleAttributeTypeModel=Qne;var eie=class{constructor(e){this.struct=e}get typeModelType(){return"struct"}get isComplex(){return!0}getStoredClassInitializer(e){return`new ${this.struct.outputReferenceName}(this, "${e}")`}get storedClassType(){return this.struct.name}get inputTypeDefinition(){return this.struct.name}getAttributeAccessFunction(e){return`this.interpolationForAttribute('${e}')`}get toTerraformFunction(){return`${(0,EI.downcaseFirst)(this.struct.name)}ToTerraform`}get toHclTerraformFunction(){return`${(0,EI.downcaseFirst)(this.struct.name)}ToHclTerraform`}get hasReferenceClass(){return!0}get isTokenizable(){return!1}};eh.StructAttributeTypeModel=eie;var tie=class{constructor(e,r,n){this.elementType=e,this.isSingleItem=r,this.isBlock=n,this.struct&&(this.struct.isSingleItem=this.isSingleItem||!1)}get typeModelType(){return"list"}get struct(){return this.elementType.struct}get isComplex(){return this.elementType.isComplex}getStoredClassInitializer(e){return this.isSingleItem?`new ${this.elementType.storedClassType}OutputReference(this, "${e}")`:this.isComplex?`new ${this.storedClassType}(this, "${e}", false)`:`new cdktn.${(0,EI.uppercaseFirst)(this.storedClassType)}(this, "${e}", false)`}get storedClassType(){return`${this.elementType.storedClassType}List`}get inputTypeDefinition(){return this.isSingleItem?this.elementType.inputTypeDefinition:this.elementType.storedClassType==="boolean"?"Array<boolean | cdktn.IResolvable> | cdktn.IResolvable":this.isComplex?`${this.elementType.storedClassType}[] | cdktn.IResolvable`:this.elementType.typeModelType!=="simple"?`${this.elementType.inputTypeDefinition}[] | cdktn.IResolvable`:`${this.elementType.inputTypeDefinition}[]`}getAttributeAccessFunction(e){switch(this.elementType.storedClassType){case"string":return`this.getListAttribute('${e}')`;case"number":return`this.getNumberListAttribute('${e}')`}return`this.interpolationForAttribute('${e}')`}get toTerraformFunction(){return this.isSingleItem?this.elementType.toTerraformFunction:`cdktn.listMapper(${this.elementType.toTerraformFunction}, ${this.isBlock})`}get toHclTerraformFunction(){return this.isSingleItem?this.elementType.toHclTerraformFunction:`cdktn.listMapperHcl(${this.elementType.toHclTerraformFunction}, ${this.isBlock})`}get hasReferenceClass(){return this.isSingleItem||this.isComplex}get isTokenizable(){switch(this.elementType.storedClassType){case"string":return!0;case"number":return!0;default:return!1}}};eh.ListAttributeTypeModel=tie;var rie=class{constructor(e,r,n){this.elementType=e,this.isSingleItem=r,this.isBlock=n,this.struct&&(this.struct.isSingleItem=this.isSingleItem||!1)}get typeModelType(){return"set"}get struct(){return this.elementType.struct}get isComplex(){return this.elementType.isComplex}getStoredClassInitializer(e){return this.isSingleItem?`new ${this.elementType.storedClassType}OutputReference(this, "${e}")`:this.isComplex?`new ${this.storedClassType}(this, "${e}", true)`:`new cdktn.${(0,EI.uppercaseFirst)(this.storedClassType)}(this, "${e}", true)`}get storedClassType(){return`${this.elementType.storedClassType}List`}get inputTypeDefinition(){return this.isSingleItem?this.elementType.inputTypeDefinition:this.elementType.storedClassType==="boolean"?"Array<boolean | cdktn.IResolvable> | cdktn.IResolvable":this.isComplex?`${this.elementType.storedClassType}[] | cdktn.IResolvable`:this.elementType.typeModelType!=="simple"?`${this.elementType.inputTypeDefinition}[] | cdktn.IResolvable`:`${this.elementType.inputTypeDefinition}[]`}getAttributeAccessFunction(e){switch(this.elementType.storedClassType){case"string":return`cdktn.Fn.tolist(this.getListAttribute('${e}'))`;case"number":return`cdktn.Token.asNumberList(cdktn.Fn.tolist(this.getNumberListAttribute('${e}')))`}return`cdktn.Token.asAny(cdktn.Fn.tolist(this.interpolationForAttribute('${e}')))`}get toTerraformFunction(){return this.isSingleItem?this.elementType.toTerraformFunction:`cdktn.listMapper(${this.elementType.toTerraformFunction}, ${this.isBlock})`}get toHclTerraformFunction(){return this.isSingleItem?this.elementType.toHclTerraformFunction:`cdktn.listMapperHcl(${this.elementType.toHclTerraformFunction}, ${this.isBlock})`}get hasReferenceClass(){return this.isSingleItem||this.isComplex}get isTokenizable(){switch(this.elementType.storedClassType){case"string":return!0;case"number":return!0;default:return!1}}};eh.SetAttributeTypeModel=rie;var nie=class{constructor(e){this.elementType=e}get typeModelType(){return"map"}get struct(){return this.elementType.struct}get isComplex(){return this.elementType.isComplex}getStoredClassInitializer(e){return this.isComplex?`new ${this.storedClassType}(this, "${e}")`:`new cdktn.${(0,EI.uppercaseFirst)(this.storedClassType)}(this, "${e}")`}get storedClassType(){return`${this.elementType.storedClassType}Map`}get inputTypeDefinition(){return this.elementType.storedClassType==="boolean"?`{ [key: string]: (${this.elementType.storedClassType} | cdktn.IResolvable) }`:this.isComplex?`{ [key: string]: ${this.elementType.storedClassType} } | cdktn.IResolvable`:this.elementType.typeModelType!=="simple"?`{ [key: string]: ${this.elementType.inputTypeDefinition} } | cdktn.IResolvable`:`{ [key: string]: ${this.elementType.storedClassType} }`}getAttributeAccessFunction(e){return!this.isComplex&&this.elementType.typeModelType!=="simple"?`this.interpolationForAttribute('${e}')`:`this.get${(0,EI.uppercaseFirst)(this.storedClassType)}Attribute('${e}')`}get toTerraformFunction(){return`cdktn.hashMapper(${this.elementType.toTerraformFunction})`}get toHclTerraformFunction(){return`cdktn.hashMapperHcl(${this.elementType.toHclTerraformFunction})`}get hasReferenceClass(){return this.isComplex}get isTokenizable(){switch(this.elementType.storedClassType){case"string":return!0;case"number":return!0;case"boolean":return!0;case"any":return!0;default:return!1}}};eh.MapAttributeTypeModel=nie});var aie=x(mE=>{"use strict";Object.defineProperty(mE,"__esModule",{value:!0});mE.ConfigStruct=mE.Struct=void 0;var wBe=MV(),UV=class{constructor(e,r,n=!1,i=!1,a=!1,s=""){this.name=e,this.attributes=r,this.isClass=n,this.isAnonymous=i,this.isSingleItem=a,this.nestingMode=s}get assignableAttributes(){return this.attributes.filter(e=>e.isAssignable)}get optionalAttributes(){return this.attributes.filter(e=>e.optional)}get allOptional(){return this.attributes.filter(e=>!e.optional&&!e.computed).length==0}get attributeType(){return`${this.name}${this.allOptional?" = {}":""}`}get assignable(){return!this.isClass||this.assignableAttributes.length>0}get extends(){return""}get mapperName(){return`${(0,wBe.downcaseFirst)(this.name)}ToTerraform`}get hclMapperName(){return`${(0,wBe.downcaseFirst)(this.name)}ToHclTerraform`}get outputReferenceName(){return`${this.name}OutputReference`}get listName(){return`${this.name}List`}get mapName(){return`${this.name}Map`}get mapListName(){return`${this.name}MapList`}get listMapName(){return`${this.name}ListMap`}get listListName(){return`${this.name}ListList`}get isProvider(){return this.attributes.some(e=>e.isProvider)}get referencedTypes(){let e=[];return this.attributes.forEach(r=>{let n=r.getReferencedTypes(!1);n&&e.push(...n)}),e}get exportCount(){let e=1;return e+=1,(this.nestingMode==="list"||this.nestingMode==="set"||this.nestingMode==="map")&&(e+=1,this.isSingleItem||(e+=1)),e}};mE.Struct=UV;var iie=class extends UV{get extends(){return" extends cdktn.TerraformMetaArguments"}};mE.ConfigStruct=iie});var oie=x(O6=>{"use strict";var bFt=O6&&O6.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(O6,"__esModule",{value:!0});O6.ResourceModel=O6.STRUCT_SHARDING_THRESHOLD=void 0;var _Ft=a6(),ABe=bFt(require("path")),RBe=S_(),CFt=aie();O6.STRUCT_SHARDING_THRESHOLD=400;var sie=class{constructor(e){this.recursiveAttributePaths={},this.className=e.className,this.filePath=e.filePath,this.terraformType=e.terraformType,this.baseName=e.baseName,this.attributes=e.attributes,this.schema=e.schema,this.fqpn=e.fqpn,this.provider=(0,RBe.parseFQPN)(e.fqpn).name,this.terraformProviderName=this.provider,this.fileName=e.fileName,this._structs=e.structs,this.terraformSchemaType=e.terraformSchemaType,this.configStructName=e.configStructName,this.dependencies=["import { Construct } from 'constructs';","import * as cdktn from 'cdktn';"],this.structsRequireSharding=this._structs.reduce((r,n)=>r+n.exportCount,0)>O6.STRUCT_SHARDING_THRESHOLD}get structs(){return[this.configStruct,...this._structs]}get configStruct(){return new CFt.ConfigStruct(this.configStructName,this.attributes)}get synthesizableAttributes(){return this.configStruct.assignableAttributes}get importStatements(){return this.dependencies}get schemaAsJson(){return this.escapeSchema(JSON.stringify(this.schema,void 0,2))}get linkToDocs(){let{hostname:e,namespace:r,name:n}=(0,RBe.parseFQPN)(this.fqpn),i=this.providerVersion||"latest",a=`https://${e}/providers/${r}/${n}/${i}/docs`;return this.isProvider?a:this.isDataSource?`${a}/data-sources/${this.terraformDocName}`:`${a}/resources/${this.terraformDocName}`}get isProvider(){return this.terraformSchemaType==="provider"}get isDataSource(){return this.terraformSchemaType==="data_source"}get parentClassName(){return this.isProvider?"TerraformProvider":this.isDataSource?"TerraformDataSource":"TerraformResource"}get terraformResourceType(){return this.isProvider?this.terraformProviderName:this.isDataSource?this.terraformType.replace(/^data_/,""):this.terraformType}get terraformDocName(){return(0,_Ft.toSnakeCase)(this.terraformResourceType.replace(new RegExp(`^${this.provider}_`,"i"),""))}get referencedTypes(){return this.configStruct.referencedTypes}get structsFolderName(){return`${ABe.default.basename(this.fileName,".ts")}-structs`}get structsFolderPath(){return ABe.default.join(this.namespaceFolderPath,this.structsFolderName)}get namespaceFolderPath(){return this.filePath.split("/").slice(0,-1).join("/")}escapeSchema(e){return e.replace(/(\*\/)/gi,"*\\/")}};O6.ResourceModel=sie});var TBe=x(YV=>{"use strict";Object.defineProperty(YV,"__esModule",{value:!0});YV.Scope=void 0;var uie=class{constructor(e){var r,n,i,a,s;this.name=e.name,this.parent=e.parent,this.isProvider=e.isProvider,this.isComputed=(r=e.isComputed)!==null&&r!==void 0?r:!1,this.isOptional=(n=e.isOptional)!==null&&n!==void 0?n:!0,this.isRequired=(i=e.isRequired)!==null&&i!==void 0?i:!1,this.inBlockType=(a=e.inBlockType)!==null&&a!==void 0?a:!1,this.isNestedType=(s=e.isNestedType)!==null&&s!==void 0?s:!1}fullName(e){return`${this.baseName}.${e}`}get baseName(){let e=this,r="";for(;e;)r===""?r=e.name:r=`${e.name}.${r}`,e=e.parent;return r}};YV.Scope=uie});var gE=x(x2=>{"use strict";var IFt=x2&&x2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sN=x2&&x2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IFt(e,t,r)};Object.defineProperty(x2,"__esModule",{value:!0});sN(EBe(),x2);sN(xBe(),x2);sN(oie(),x2);sN(TBe(),x2);sN(aie(),x2)});var BBe=x(jV=>{"use strict";Object.defineProperty(jV,"__esModule",{value:!0});jV.detectAttributeLoops=void 0;var SFt=(t,e)=>t[0]===e[0]&&t[1].size===e[1].size&&[...t[1]].every(r=>e[1].has(r));function EFt(t){var e;return t.type.isComplex?`<complex:{${(e=t.type.struct)===null||e===void 0?void 0:e.attributes.map(r=>r.name).sort()}}${t.type.typeModelType}>`:t.type.storedClassType}function xFt(t){return[t.terraformName,new Set(t.type.struct.attributes.map(e=>`${e.name}:${EFt(e)}`))]}function wFt(t){let e={};function r(n,i=[],a={}){let s=n.terraformName,o=n.type.struct;if(!o)return;let u=xFt(n),l=Object.entries(a).find(([,f])=>SFt(u,f));if(l){let f=l[0],h=[...i,s].join(".");e[h]=f}else o.attributes.forEach(f=>r(f,[...i,s],{...a,[[...i,s].join(".")]:u}))}return t.forEach(n=>r(n)),e}jV.detectAttributeLoops=wFt});var NBe=x(XV=>{"use strict";Object.defineProperty(XV,"__esModule",{value:!0});XV.shouldSkipAttribute=void 0;var AFt=["aws.quicksight_template.definition","aws.quicksight_dashboard.definition","aws.quicksight_analysis.definition","aws.data_aws_quicksight_analysis.definition","aws.wafv2_web_acl.wafv2_web_acl_rule.statement","aws.wafv2_rule_group.wafv2_rule_group_rule.statement","oci.data_oci_objectstorage_private_endpoint.fqdns","oci.data_oci_objectstorage_private_endpoint_summaries.private_endpoint_summaries.fqdns"];function RFt(t){return AFt.includes(t)}XV.shouldSkipAttribute=RFt});var pie=x(vE=>{"use strict";Object.defineProperty(vE,"__esModule",{value:!0});vE.ResourceParser=vE.sanitizeClassOrNamespaceName=void 0;var Ay=a6(),DBe=Ln(),TFt=S_(),xi=gE(),BFt=BBe(),lie=NBe(),NFt=["implements","interface","let","package","private","protected","public","static","yield","await"],DFt=["license","version"],GFt=t=>["string","object","function",...NFt,...DFt].includes(t.toLowerCase()),FFt=t=>t.toLowerCase().endsWith("list"),OFt=(t,e)=>e==="index"?"index-resource/index.ts":e===`${t}_provider`?"provider/index.ts":`${(0,Ay.toSnakeCase)(e).replace(/_/g,"-")}/index.ts`;function GBe(t,e=!1){let r=!e&&t==="provider";return GFt(t)||r?`${t}_resource`:t}vE.sanitizeClassOrNamespaceName=GBe;function cie(t){return t.filter((e,r)=>!t.slice(r+1).some(i=>i.name===e.name&&i!==e))}var die=class{constructor(e,r){this.classNames=e,this.usedBaseNames=r,this.structs=new Array}uniqueClassName(e){return this.classNames.includes(e)&&(e=`${e}A`),this.classNames.push(e),e}uniqueBaseName(e){let r=(0,Ay.toPascalCase)(e),n=r.toLowerCase(),i=this.usedBaseNames.get(n);return i!==void 0&&i!==r?(e=`${e}A`,this.uniqueBaseName(e)):(this.usedBaseNames.set(n,r),e)}resourceFrom(e,r,n,i,a){let s=r,o=a?a.name:void 0,u=(0,TFt.parseFQPN)(e).name;s.startsWith(`${u}_`)&&(s=s.substr(u.length+1));let l=o||u,f=i==="provider";f&&(s=`${l}_${s}`,"attributes"in n.block||(n.block={attributes:{},block_types:n.block.block_types||{}}),n.block.attributes.alias={type:"string",description:"Alias name",optional:!0,computed:!1}),s=GBe(s,f),s=this.uniqueBaseName(s);let h=this.uniqueClassName((0,Ay.toPascalCase)(s)),g=this.uniqueClassName(`${h}Config`),_=OFt(l,s),w=`providers/${(0,Ay.toSnakeCase)(l)}/${_}`,T=this.renderAttributesForBlock(new xi.Scope({name:s,isProvider:f,parent:f?void 0:new xi.Scope({name:l,isProvider:!0})}),n.block);function D(Z,X){let[ue,...Q]=X.split("."),ie=Z.find(M=>M.terraformName===ue);if(!ie)throw new Error(`Expected to find recursive attribute at path: ${X}`);if(!ie.type.struct)throw new Error(`Expected to find struct type attribute at path: ${X} but got ${ie.type.storedClassType}`);return Q.length===0?ie:D(ie.type.struct.attributes,Q.join("."))}let G=(0,BFt.detectAttributeLoops)(T);return Object.entries(G).forEach(([Z,X])=>{let ue=D(T,X),Q=Z.split("."),ie=Q.pop(),M=D(T,Q.join(".")),ne=M.type.struct.attributes.findIndex(ke=>ke.terraformName===ie);if(ne===-1)throw new Error("Can't find attribute at path "+Z);let Te=M.type.struct.attributes[ne];M.type.struct.attributes[ne]=ue;let J=ke=>{ke.type.struct&&(ke.type.struct.attributes.forEach(J),this.structs=this.structs.filter(xe=>xe!==ke.type.struct))};J(Te)}),T=cie(T),new xi.ResourceModel({terraformType:r,baseName:s,fileName:_,filePath:w,className:h,schema:n,fqpn:e,attributes:T,terraformSchemaType:i,structs:this.structs,configStructName:g})}renderAttributeType(e,r,n){let i=e[e.length-1];if((0,lie.shouldSkipAttribute)(i.baseName))return new xi.MapAttributeTypeModel(new xi.SimpleAttributeTypeModel("any"));if(typeof r=="string")switch(r){case"bool":return new xi.SimpleAttributeTypeModel("boolean");case"string":return new xi.SimpleAttributeTypeModel("string");case"number":return new xi.SimpleAttributeTypeModel("number");case"dynamic":return new xi.MapAttributeTypeModel(new xi.SimpleAttributeTypeModel("any"));default:throw new Error(`invalid primitive type ${r}`)}if(Array.isArray(r)){if(r.length!==2)throw new Error("unexpected array");let[a,s]=r;if(a==="set"||a==="list"){let o=this.renderAttributeType(e,s,[a,n].join(""));return a==="list"?new xi.ListAttributeTypeModel(o,!1,!1):new xi.SetAttributeTypeModel(o,!1,!1)}if(a==="map"){let o=this.renderAttributeType(e,s,[a,n].join(""));return new xi.MapAttributeTypeModel(o)}if(a==="object"){let o=s,u={};for(let[f,h]of Object.entries(o))u[f]={type:h};let l=this.addAnonymousStruct(e,u,n??a);return new xi.StructAttributeTypeModel(l)}}if((0,DBe.isAttributeNestedType)(r)){let a,s;switch(r.nesting_mode){case"list":a=this.addAnonymousStruct(e,r.attributes,r.nesting_mode),s=new xi.ListAttributeTypeModel(new xi.StructAttributeTypeModel(a),!1,!1);break;case"set":a=this.addAnonymousStruct(e,r.attributes,r.nesting_mode),s=new xi.SetAttributeTypeModel(new xi.StructAttributeTypeModel(a),!1,!1);break;case"map":a=this.addAnonymousStruct(e,r.attributes,r.nesting_mode),s=new xi.MapAttributeTypeModel(new xi.StructAttributeTypeModel(a));break;case"single":a=this.addAnonymousStruct(e,r.attributes,r.nesting_mode),s=new xi.StructAttributeTypeModel(a);break;default:throw new Error(`nested_type with nesting_mode "${r.nesting_mode}" not supported (attribute scope: ${e.map(o=>o.fullName).join(",")}`)}return s}throw new Error(`unknown type ${JSON.stringify(r)}`)}renderAttributesForBlock(e,r){let n=new Array;for(let[a,s]of Object.entries(r.attributes||{})){let o,u=!1;(0,lie.shouldSkipAttribute)(e.fullName(a))?(o=new xi.SkippedAttributeTypeModel,u=!0):o=this.renderAttributeType([e,new xi.Scope({name:a,parent:e,isProvider:e.isProvider,isComputed:!!s.computed,isOptional:!!s.optional,isRequired:!!s.required,isNestedType:(0,DBe.isNestedTypeAttribute)(s)})],s.type||s.nested_type);let l=(0,Ay.toCamelCase)(a);n.push(new xi.AttributeModel({terraformFullName:e.fullName(a),description:s.description,name:l,storageName:`_${l}`,computed:!!s.computed,optional:!!s.optional,terraformName:a,type:o,provider:e.isProvider,required:!!s.required,forcePlainGetterType:u}))}for(let[a,s]of Object.entries(r.block_types||{})){if((0,lie.shouldSkipAttribute)(e.fullName(a))){let l=(0,Ay.toCamelCase)(a),f=new xi.Scope({name:a,parent:e,isProvider:e.isProvider});n.push(new xi.AttributeModel({name:l,terraformName:a,terraformFullName:f.fullName(a),type:new xi.SkippedAttributeTypeModel,description:`${a} block`,storageName:`_${l}`,optional:!0,computed:!1,provider:e.isProvider,required:!1}));continue}let o=this.renderAttributesForBlock(new xi.Scope({name:`${e.name}_${a}`,parent:e,isProvider:e.isProvider,inBlockType:!0}),s.block);o=cie(o);let u=this.addStruct([e,new xi.Scope({name:a,parent:e,isProvider:e.isProvider})],o,s.nesting_mode,(s.nesting_mode==="list"||s.nesting_mode==="set")&&s.max_items===1);n.push(i(a,s,u,e.isProvider,e))}return n;function i(a,s,o,u,l){let f=(0,Ay.toCamelCase)(a),h,g;switch(s.nesting_mode){case"single":return h=!o.attributes.some(_=>!_.optional),g=!o.attributes.some(_=>!_.required),!h&&!g&&(h=o.attributes.some(_=>_.optional||_.required)),new xi.AttributeModel({name:f,terraformName:a,terraformFullName:l.fullName(a),type:new xi.StructAttributeTypeModel(o),description:`${a} block`,storageName:`_${f}`,optional:h,computed:!1,provider:u,required:g});case"map":return new xi.AttributeModel({name:f,terraformName:a,terraformFullName:l.fullName(a),type:new xi.MapAttributeTypeModel(new xi.StructAttributeTypeModel(o)),description:`${a} block`,storageName:`_${f}`,optional:!1,computed:!1,provider:u,required:!1});case"list":case"set":return h=s.min_items===void 0?!0:s.min_items<1,g=s.min_items===void 0?!1:s.min_items>0,new xi.AttributeModel({name:f,terraformName:a,terraformFullName:l.fullName(a),type:s.nesting_mode==="list"?new xi.ListAttributeTypeModel(new xi.StructAttributeTypeModel(o),s.max_items===1,!0):new xi.SetAttributeTypeModel(new xi.StructAttributeTypeModel(o),s.max_items===1,!0),description:`${a} block`,storageName:`_${f}`,optional:h,computed:!1,provider:u,required:g})}}}addAnonymousStruct(e,r,n){let i=new Array,a=e[e.length-1];if(r)for(let[s,o]of Object.entries(r||{})){let u=!!a.isComputed||a.isNestedType&&!!o.computed,l=a.isNestedType?!!o.optional:!!a.isOptional,f=a.isNestedType?!!o.required:!!a.isRequired,h=(0,Ay.toCamelCase)(s),g=this.renderAttributeType([...e,new xi.Scope({name:s,parent:a,isProvider:a.isProvider,isComputed:u,isOptional:l,isRequired:f,isNestedType:a.isNestedType})],o.type||o.nested_type);i.push(new xi.AttributeModel({name:h,storageName:`_${h}`,computed:u,description:o.description,optional:l,terraformName:s,terraformFullName:a.fullName(s),type:g,provider:a.isProvider,required:f}))}return i=cie(i),this.addStruct(e,i,n)}addStruct(e,r,n,i=!1){let a=(0,Ay.toPascalCase)(e.map(h=>(0,Ay.toSnakeCase)(h.name)).join("_")),s=this.uniqueClassName(FFt(a)?`${a}Struct`:a),o=e[e.length-1],u=o.isComputed&&!o.isOptional||i,l=!0,f=new xi.Struct(s,r,u,l,i,n);return this.structs.push(f),f}},fie=class{constructor(){this.uniqueClassnames=[],this.uniqueBaseNames=new Map,this.resources={}}parse(e,r,n,i,a){if(this.resources[r])return this.resources[r];let o=new die(this.uniqueClassnames,this.uniqueBaseNames).resourceFrom(e,r,n,i,a);return this.resources[r]=o,o}getClassNameForResource(e){let r=this.resources[e];return r?r.className:""}getNamespaceNameForResource(e){e==="data_external_"&&(e="data_external");let r=this.resources[e];if(!r)return"";let n=`providers/${r.provider}`;return r.filePath.replace(`${n}/`,"").replace("/index.ts","")}};vE.ResourceParser=fie});var FBe=x(qV=>{"use strict";Object.defineProperty(qV,"__esModule",{value:!0});qV.CUSTOM_DEFAULTS=void 0;qV.CUSTOM_DEFAULTS={"aws.security_group.ingress.cidr_blocks":null,"aws.security_group.ingress.description":null,"aws.security_group.ingress.from_port":null,"aws.security_group.ingress.ipv6_cidr_blocks":null,"aws.security_group.ingress.prefix_list_ids":null,"aws.security_group.ingress.protocol":null,"aws.security_group.ingress.security_groups":null,"aws.security_group.ingress.self":null,"aws.security_group.ingress.to_port":null,"aws.security_group.egress.cidr_blocks":null,"aws.security_group.egress.description":null,"aws.security_group.egress.from_port":null,"aws.security_group.egress.ipv6_cidr_blocks":null,"aws.security_group.egress.prefix_list_ids":null,"aws.security_group.egress.protocol":null,"aws.security_group.egress.security_groups":null,"aws.security_group.egress.self":null,"aws.security_group.egress.to_port":null,"aws.default_route_table.route.cidr_block":null,"aws.default_route_table.route.ipv6_cidr_block":null,"aws.default_route_table.route.egress_only_gateway_id":null,"aws.default_route_table.route.gateway_id":null,"aws.default_route_table.route.instance_id":null,"aws.default_route_table.route.nat_gateway_id":null,"aws.default_route_table.route.network_interface_id":null,"aws.default_route_table.route.transit_gateway_id":null,"aws.default_route_table.route.vpc_endpoint_id":null,"aws.default_route_table.route.vpc_peering_connection_id":null,"aws.default_route_table.route.destination_prefix_list_id":null,"aws.default_route_table.route.core_network_arn":null,"aws.emr_cluster.step.action_on_failure":null,"aws.emr_cluster.step.hadoop_jar_step":null,"aws.emr_cluster.step.name":null,"aws.emr_cluster.step.hadoop_jar_step.args":null,"aws.emr_cluster.step.hadoop_jar_step.jar":null,"aws.emr_cluster.step.hadoop_jar_step.main_class":null,"aws.emr_cluster.step.hadoop_jar_step.properties":null,"aws.network_acl.ingress.from_port":null,"aws.network_acl.ingress.to_port":null,"aws.network_acl.ingress.rule_no":null,"aws.network_acl.ingress.action":null,"aws.network_acl.ingress.protocol":null,"aws.network_acl.ingress.cidr_block":null,"aws.network_acl.ingress.ipv6_cidr_block":null,"aws.network_acl.ingress.icmp_type":null,"aws.network_acl.ingress.icmp_code":null,"aws.network_acl.egress.from_port":null,"aws.network_acl.egress.to_port":null,"aws.network_acl.egress.rule_no":null,"aws.network_acl.egress.action":null,"aws.network_acl.egress.protocol":null,"aws.network_acl.egress.cidr_block":null,"aws.network_acl.egress.ipv6_cidr_block":null,"aws.network_acl.egress.icmp_type":null,"aws.network_acl.egress.icmp_code":null,"aws.route_table.route.cidr_block":null,"aws.route_table.route.ipv6_cidr_block":null,"aws.route_table.route.egress_only_gateway_id":null,"aws.route_table.route.gateway_id":null,"aws.route_table.route.instance_id":null,"aws.route_table.route.nat_gateway_id":null,"aws.route_table.route.local_gateway_id":null,"aws.route_table.route.network_interface_id":null,"aws.route_table.route.transit_gateway_id":null,"aws.route_table.route.vpc_endpoint_id":null,"aws.route_table.route.vpc_peering_connection_id":null,"aws.route_table.route.destination_prefix_list_id":null,"aws.route_table.route.carrier_gateway_id":null,"aws.route_table.route.core_network_arn":null,"aws.default_security_group.ingress.cidr_blocks":null,"aws.default_security_group.ingress.description":null,"aws.default_security_group.ingress.from_port":null,"aws.default_security_group.ingress.ipv6_cidr_blocks":null,"aws.default_security_group.ingress.prefix_list_ids":null,"aws.default_security_group.ingress.protocol":null,"aws.default_security_group.ingress.security_groups":null,"aws.default_security_group.ingress.self":null,"aws.default_security_group.ingress.to_port":null,"aws.default_security_group.egress.cidr_blocks":null,"aws.default_security_group.egress.description":null,"aws.default_security_group.egress.from_port":null,"aws.default_security_group.egress.ipv6_cidr_blocks":null,"aws.default_security_group.egress.prefix_list_ids":null,"aws.default_security_group.egress.protocol":null,"aws.default_security_group.egress.security_groups":null,"aws.default_security_group.egress.self":null,"aws.default_security_group.egress.to_port":null,"azuread.application.app_role.id":null,"azuread.application.app_role.allowed_member_types":null,"azuread.application.app_role.description":null,"azuread.application.app_role.display_name":null,"azuread.application.app_role.is_enabled":null,"azuread.application.app_role.value":null,"azuread.application.oauth2_permissions.id":null,"azuread.application.oauth2_permissions.admin_consent_description":null,"azuread.application.oauth2_permissions.admin_consent_display_name":null,"azuread.application.oauth2_permissions.value":null,"azuread.application.oauth2_permissions.type":null,"azuread.application.oauth2_permissions.is_enabled":null,"azuread.application.oauth2_permissions.user_consent_description":null,"azuread.application.oauth2_permissions.user_consent_display_name":null,"azurestack.route_table.route.name":null,"azurestack.route_table.route.address_prefix":null,"azurestack.route_table.route.next_hop_type":null,"azurestack.route_table.route.next_hop_in_ip_address":null,"azurestack.network_security_group.security_rule.name":null,"azurestack.network_security_group.security_rule.description":null,"azurestack.network_security_group.security_rule.protocol":null,"azurestack.network_security_group.security_rule.source_port_range":null,"azurestack.network_security_group.security_rule.source_port_ranges":null,"azurestack.network_security_group.security_rule.destination_port_range":null,"azurestack.network_security_group.security_rule.destination_port_ranges":null,"azurestack.network_security_group.security_rule.source_address_prefix":null,"azurestack.network_security_group.security_rule.source_address_prefixes":null,"azurestack.network_security_group.security_rule.destination_address_prefix":null,"azurestack.network_security_group.security_rule.destination_address_prefixes":null,"azurestack.network_security_group.security_rule.destination_application_security_group_ids":null,"azurestack.network_security_group.security_rule.source_application_security_group_ids":null,"azurestack.network_security_group.security_rule.access":null,"azurestack.network_security_group.security_rule.priority":null,"azurestack.network_security_group.security_rule.direction":null,"azurestack.virtual_network.subnet.name":null,"azurestack.virtual_network.subnet.address_prefix":null,"azurestack.virtual_network.subnet.security_group":null,"azurestack.virtual_network.subnet.id":null,"azurestack.key_vault.access_policy.tenant_id":null,"azurestack.key_vault.access_policy.object_id":null,"azurestack.key_vault.access_policy.application_id":null,"azurestack.key_vault.access_policy.certificate_permissions":null,"azurestack.key_vault.access_policy.key_permissions":null,"azurestack.key_vault.access_policy.secret_permissions":null,"azurestack.key_vault.access_policy.storage_permissions":null,"vault.auth_backend.tune.default_lease_ttl":null,"vault.auth_backend.tune.max_lease_ttl":null,"vault.auth_backend.tune.audit_non_hmac_request_keys":null,"vault.auth_backend.tune.audit_non_hmac_response_keys":null,"vault.auth_backend.tune.listing_visibility":null,"vault.auth_backend.tune.passthrough_request_headers":null,"vault.auth_backend.tune.allowed_response_headers":null,"vault.auth_backend.tune.token_type":null,"vault.github_auth_backend.tune.default_lease_ttl":null,"vault.github_auth_backend.tune.max_lease_ttl":null,"vault.github_auth_backend.tune.audit_non_hmac_request_keys":null,"vault.github_auth_backend.tune.audit_non_hmac_response_keys":null,"vault.github_auth_backend.tune.listing_visibility":null,"vault.github_auth_backend.tune.passthrough_request_headers":null,"vault.github_auth_backend.tune.allowed_response_headers":null,"vault.github_auth_backend.tune.token_type":null,"vault.jwt_auth_backend.tune.default_lease_ttl":null,"vault.jwt_auth_backend.tune.max_lease_ttl":null,"vault.jwt_auth_backend.tune.audit_non_hmac_request_keys":null,"vault.jwt_auth_backend.tune.audit_non_hmac_response_keys":null,"vault.jwt_auth_backend.tune.listing_visibility":null,"vault.jwt_auth_backend.tune.passthrough_request_headers":null,"vault.jwt_auth_backend.tune.allowed_response_headers":null,"vault.jwt_auth_backend.tune.token_type":null,"vault.okta_auth_backend.group.group_name":null,"vault.okta_auth_backend.group.policies":null,"vault.okta_auth_backend.user.username":null,"vault.okta_auth_backend.user.groups":null,"vault.okta_auth_backend.user.policies":null,"google.compute_instance.guest_accelerator.count":null,"google.compute_instance.guest_accelerator.type":null,"google.compute_instance_from_template.attached_disk.source":null,"google.compute_instance_from_template.attached_disk.device_name":null,"google.compute_instance_from_template.attached_disk.mode":null,"google.compute_instance_from_template.attached_disk.disk_encryption_key_raw":null,"google.compute_instance_from_template.attached_disk.kms_key_self_link":null,"google.compute_instance_from_template.guest_accelerator.count":null,"google.compute_instance_from_template.guest_accelerator.type":null,"google.compute_instance_from_template.service_account.email":null,"google.compute_instance_from_template.service_account.scopes":null,"google.compute_instance_from_template.scratch_disk.interface":null,"google.compute_instance_from_template.network_interface.alias_ip_range.ip_cidr_range":null,"google.compute_instance_from_template.network_interface.alias_ip_range.subnetwork_range_name":null,"google.compute_instance_from_template.network_interface.access_config.nat_ip":null,"google.compute_instance_from_template.network_interface.access_config.public_ptr_domain_name":null,"google.compute_instance_from_template.network_interface.access_config.network_tier":null,"google.compute_subnetwork.secondary_ip_range.range_name":null,"google.compute_subnetwork.secondary_ip_range.ip_cidr_range":null,"google.container_cluster.node_config.guest_accelerator.count":null,"google.container_cluster.node_config.guest_accelerator.type":null,"google.container_cluster.node_config.guest_accelerator.gpu_partition_size":null,"google.container_cluster.node_config.guest_accelerator.gpu_sharing_config":null,"google.container_cluster.node_config.guest_accelerator.gpu_sharing_config.gpu_sharing_strategy":null,"google.container_cluster.node_config.guest_accelerator.gpu_sharing_config.max_shared_clients_per_gpu":null,"google.container_cluster.node_config.taint.key":null,"google.container_cluster.node_config.taint.value":null,"google.container_cluster.node_config.taint.effect":null,"google.container_node_pool.node_config.guest_accelerator.count":null,"google.container_node_pool.node_config.guest_accelerator.type":null,"google.container_node_pool.node_config.guest_accelerator.gpu_partition_size":null,"google.container_node_pool.node_config.guest_accelerator.gpu_sharing_config":null,"google.container_node_pool.node_config.guest_accelerator.gpu_sharing_config.gpu_sharing_strategy":null,"google.container_node_pool.node_config.guest_accelerator.gpu_sharing_config.max_shared_clients_per_gpu":null,"google.container_node_pool.node_config.taint.key":null,"google.container_node_pool.node_config.taint.value":null,"google.container_node_pool.node_config.taint.effect":null,"google.composer_environment.ip_allocation_policy.use_ip_aliases":null,"google.composer_environment.ip_allocation_policy.cluster_secondary_range_name":null,"google.composer_environment.ip_allocation_policy.services_secondary_range_name":null,"google.composer_environment.ip_allocation_policy.cluster_ipv4_cidr_block":null,"google.composer_environment.ip_allocation_policy.services_ipv4_cidr_block":null,"azurerm.eventgrid_topic.inbound_ip_rule.ip_mask":null,"azurerm.eventgrid_topic.inbound_ip_rule.action":null,"azurerm.eventgrid_domain.inbound_ip_rule.ip_mask":null,"azurerm.eventgrid_domain.inbound_ip_rule.action":null,"azurerm.container_registry.network_rule_set.default_action":null,"azurerm.container_registry.network_rule_set.ip_rule":null,"azurerm.container_registry.network_rule_set.virtual_network":null,"azurerm.container_registry.network_rule_set.ip_rule.action":null,"azurerm.container_registry.network_rule_set.ip_rule.ip_range":null,"azurerm.container_registry.network_rule_set.virtual_network.action":null,"azurerm.container_registry.network_rule_set.virtual_network.subnet_id":null,"azurerm.container_registry.retention_policy.days":null,"azurerm.container_registry.retention_policy.enabled":null,"azurerm.container_registry.trust_policy.enabled":null,"azurerm.container_registry.encryption.enabled":null,"azurerm.container_registry.encryption.identity_client_id":null,"azurerm.container_registry.encryption.key_vault_key_id":null,"azurerm.eventhub_namespace.network_rulesets.default_action":null,"azurerm.eventhub_namespace.network_rulesets.public_network_access_enabled":null,"azurerm.eventhub_namespace.network_rulesets.trusted_service_access_enabled":null,"azurerm.eventhub_namespace.network_rulesets.virtual_network_rule":null,"azurerm.eventhub_namespace.network_rulesets.virtual_network_rule.subnet_id":null,"azurerm.eventhub_namespace.network_rulesets.virtual_network_rule.ignore_missing_virtual_network_service_endpoint":null,"azurerm.eventhub_namespace.network_rulesets.ip_rule":null,"azurerm.eventhub_namespace.network_rulesets.ip_rule.ip_mask":null,"azurerm.eventhub_namespace.network_rulesets.ip_rule.action":null,"azurerm.automation_runbook.job_schedule.schedule_name":null,"azurerm.automation_runbook.job_schedule.parameters":null,"azurerm.automation_runbook.job_schedule.run_on":null,"azurerm.automation_runbook.job_schedule.job_schedule_id":null,"azurerm.mssql_database.extended_auditing_policy.storage_account_access_key":null,"azurerm.mssql_database.extended_auditing_policy.storage_endpoint":null,"azurerm.mssql_database.extended_auditing_policy.storage_account_access_key_is_secondary":null,"azurerm.mssql_database.extended_auditing_policy.retention_in_days":null,"azurerm.mssql_database.extended_auditing_policy.log_monitoring_enabled":null,"azurerm.mssql_server.extended_auditing_policy.storage_account_access_key":null,"azurerm.mssql_server.extended_auditing_policy.storage_endpoint":null,"azurerm.mssql_server.extended_auditing_policy.storage_account_access_key_is_secondary":null,"azurerm.mssql_server.extended_auditing_policy.retention_in_days":null,"azurerm.mssql_server.extended_auditing_policy.log_monitoring_enabled":null,"azurerm.route_filter.rule.access":null,"azurerm.route_filter.rule.communities":null,"azurerm.route_filter.rule.name":null,"azurerm.route_filter.rule.rule_type":null,"azurerm.route_table.route.name":null,"azurerm.route_table.route.address_prefix":null,"azurerm.route_table.route.next_hop_type":null,"azurerm.route_table.route.next_hop_in_ip_address":null,"azurerm.site_recovery_replicated_vm.managed_disk.disk_id":null,"azurerm.site_recovery_replicated_vm.managed_disk.staging_storage_account_id":null,"azurerm.site_recovery_replicated_vm.managed_disk.target_resource_group_id":null,"azurerm.site_recovery_replicated_vm.managed_disk.target_disk_type":null,"azurerm.site_recovery_replicated_vm.managed_disk.target_replica_disk_type":null,"azurerm.site_recovery_replicated_vm.managed_disk.target_disk_encryption_set_id":null,"azurerm.site_recovery_replicated_vm.managed_disk.target_disk_encryption":null,"azurerm.site_recovery_replicated_vm.network_interface.source_network_interface_id":null,"azurerm.site_recovery_replicated_vm.network_interface.target_static_ip":null,"azurerm.site_recovery_replicated_vm.network_interface.target_subnet_name":null,"azurerm.site_recovery_replicated_vm.network_interface.recovery_public_ip_address_id":null,"azurerm.iothub.endpoint.type":null,"azurerm.iothub.endpoint.authentication_type":null,"azurerm.iothub.endpoint.identity_id":null,"azurerm.iothub.endpoint.endpoint_uri":null,"azurerm.iothub.endpoint.entity_path":null,"azurerm.iothub.endpoint.connection_string":null,"azurerm.iothub.endpoint.name":null,"azurerm.iothub.endpoint.batch_frequency_in_seconds":null,"azurerm.iothub.endpoint.max_chunk_size_in_bytes":null,"azurerm.iothub.endpoint.container_name":null,"azurerm.iothub.endpoint.encoding":null,"azurerm.iothub.endpoint.file_name_format":null,"azurerm.iothub.endpoint.resource_group_name":null,"azurerm.iothub.route.name":null,"azurerm.iothub.route.source":null,"azurerm.iothub.route.condition":null,"azurerm.iothub.route.endpoint_names":null,"azurerm.iothub.route.enabled":null,"azurerm.iothub.enrichment.key":null,"azurerm.iothub.enrichment.value":null,"azurerm.iothub.enrichment.endpoint_names":null,"azurerm.virtual_network.subnet.name":null,"azurerm.virtual_network.subnet.address_prefix":null,"azurerm.virtual_network.subnet.security_group":null,"azurerm.virtual_network.subnet.id":null,"azurerm.network_security_group.security_rule.name":null,"azurerm.network_security_group.security_rule.description":null,"azurerm.network_security_group.security_rule.protocol":null,"azurerm.network_security_group.security_rule.source_port_range":null,"azurerm.network_security_group.security_rule.source_port_ranges":null,"azurerm.network_security_group.security_rule.destination_port_range":null,"azurerm.network_security_group.security_rule.destination_port_ranges":null,"azurerm.network_security_group.security_rule.source_address_prefix":null,"azurerm.network_security_group.security_rule.source_address_prefixes":null,"azurerm.network_security_group.security_rule.destination_address_prefix":null,"azurerm.network_security_group.security_rule.destination_address_prefixes":null,"azurerm.network_security_group.security_rule.destination_application_security_group_ids":null,"azurerm.network_security_group.security_rule.source_application_security_group_ids":null,"azurerm.network_security_group.security_rule.access":null,"azurerm.network_security_group.security_rule.priority":null,"azurerm.network_security_group.security_rule.direction":null,"azurerm.synapse_workspace.aad_admin.login":null,"azurerm.synapse_workspace.aad_admin.object_id":null,"azurerm.synapse_workspace.aad_admin.tenant_id":null,"azurerm.synapse_workspace.sql_aad_admin.login":null,"azurerm.synapse_workspace.sql_aad_admin.object_id":null,"azurerm.synapse_workspace.sql_aad_admin.tenant_id":null,"azurerm.batch_pool.container_configuration.container_registries.registry_server":null,"azurerm.batch_pool.container_configuration.container_registries.user_name":null,"azurerm.batch_pool.container_configuration.container_registries.password":null,"azurerm.key_vault.access_policy.tenant_id":null,"azurerm.key_vault.access_policy.object_id":null,"azurerm.key_vault.access_policy.application_id":null,"azurerm.key_vault.access_policy.certificate_permissions":null,"azurerm.key_vault.access_policy.key_permissions":null,"azurerm.key_vault.access_policy.secret_permissions":null,"azurerm.key_vault.access_policy.storage_permissions":null,"azurerm.app_service.ip_restriction.ip_address":null,"azurerm.app_service.ip_restriction.service_tag":null,"azurerm.app_service.ip_restriction.subnet_id":null,"azurerm.app_service.ip_restriction.virtual_network_subnet_id":null,"azurerm.app_service.ip_restriction.name":null,"azurerm.app_service.ip_restriction.priority":null,"azurerm.app_service.ip_restriction.action":null,"azurerm.app_service.ip_restriction.headers":null,"azurerm.app_service.ip_restriction.headers.x_forwarded_host":null,"azurerm.app_service.ip_restriction.headers.x_forwarded_for":null,"azurerm.app_service.ip_restriction.headers.x_azure_fdid":null,"azurerm.app_service.ip_restriction.headers.x_fd_health_probe":null,"azurerm.app_service.scm_ip_restriction.ip_address":null,"azurerm.app_service.scm_ip_restriction.service_tag":null,"azurerm.app_service.scm_ip_restriction.subnet_id":null,"azurerm.app_service.scm_ip_restriction.virtual_network_subnet_id":null,"azurerm.app_service.scm_ip_restriction.name":null,"azurerm.app_service.scm_ip_restriction.priority":null,"azurerm.app_service.scm_ip_restriction.action":null,"azurerm.app_service.scm_ip_restriction.headers":null,"azurerm.app_service.scm_ip_restriction.headers.x_forwarded_host":null,"azurerm.app_service.scm_ip_restriction.headers.x_forwarded_for":null,"azurerm.app_service.scm_ip_restriction.headers.x_azure_fdid":null,"azurerm.app_service.scm_ip_restriction.headers.x_fd_health_probe":null,"azurerm.function_app.ip_restriction.ip_address":null,"azurerm.function_app.ip_restriction.service_tag":null,"azurerm.function_app.ip_restriction.subnet_id":null,"azurerm.function_app.ip_restriction.virtual_network_subnet_id":null,"azurerm.function_app.ip_restriction.name":null,"azurerm.function_app.ip_restriction.priority":null,"azurerm.function_app.ip_restriction.action":null,"azurerm.function_app.ip_restriction.headers":null,"azurerm.function_app.ip_restriction.headers.x_forwarded_host":null,"azurerm.function_app.ip_restriction.headers.x_forwarded_for":null,"azurerm.function_app.ip_restriction.headers.x_azure_fdid":null,"azurerm.function_app.ip_restriction.headers.x_fd_health_probe":null,"azurerm.function_app.scm_ip_restriction.ip_address":null,"azurerm.function_app.scm_ip_restriction.service_tag":null,"azurerm.function_app.scm_ip_restriction.subnet_id":null,"azurerm.function_app.scm_ip_restriction.virtual_network_subnet_id":null,"azurerm.function_app.scm_ip_restriction.name":null,"azurerm.function_app.scm_ip_restriction.priority":null,"azurerm.function_app.scm_ip_restriction.action":null,"azurerm.function_app.scm_ip_restriction.headers":null,"azurerm.function_app.scm_ip_restriction.headers.x_forwarded_host":null,"azurerm.function_app.scm_ip_restriction.headers.x_forwarded_for":null,"azurerm.function_app.scm_ip_restriction.headers.x_azure_fdid":null,"azurerm.function_app.scm_ip_restriction.headers.x_fd_health_probe":null,"azurerm.logic_app_standard.ip_restriction.ip_address":null,"azurerm.logic_app_standard.ip_restriction.service_tag":null,"azurerm.logic_app_standard.ip_restriction.subnet_id":null,"azurerm.logic_app_standard.ip_restriction.virtual_network_subnet_id":null,"azurerm.logic_app_standard.ip_restriction.name":null,"azurerm.logic_app_standard.ip_restriction.priority":null,"azurerm.logic_app_standard.ip_restriction.action":null,"azurerm.logic_app_standard.ip_restriction.headers":null,"azurerm.logic_app_standard.ip_restriction.headers.x_forwarded_host":null,"azurerm.logic_app_standard.ip_restriction.headers.x_forwarded_for":null,"azurerm.logic_app_standard.ip_restriction.headers.x_azure_fdid":null,"azurerm.logic_app_standard.ip_restriction.headers.x_fd_health_probe":null,"azurerm.logic_app_standard.scm_ip_restriction.ip_address":null,"azurerm.logic_app_standard.scm_ip_restriction.service_tag":null,"azurerm.logic_app_standard.scm_ip_restriction.subnet_id":null,"azurerm.logic_app_standard.scm_ip_restriction.virtual_network_subnet_id":null,"azurerm.logic_app_standard.scm_ip_restriction.name":null,"azurerm.logic_app_standard.scm_ip_restriction.priority":null,"azurerm.logic_app_standard.scm_ip_restriction.action":null,"azurerm.logic_app_standard.scm_ip_restriction.headers":null,"azurerm.logic_app_standard.scm_ip_restriction.headers.x_forwarded_host":null,"azurerm.logic_app_standard.scm_ip_restriction.headers.x_forwarded_for":null,"azurerm.logic_app_standard.scm_ip_restriction.headers.x_azure_fdid":null,"azurerm.logic_app_standard.scm_ip_restriction.headers.x_fd_health_probe":null,"azurerm.api_management.policy.xml_content":null,"azurerm.api_management.policy.xml_link":null,"azurerm.container_group.exposed_port.port":null,"azurerm.container_group.exposed_port.protocol":null}});var $V=x(KV=>{"use strict";Object.defineProperty(KV,"__esModule",{value:!0});KV.AttributesEmitter=void 0;var OBe=gE(),kBe=FBe();function zV(t){return t[0].toUpperCase()+t.slice(1)}var hie=class{constructor(e){this.code=e}emit(e,r,n){this.code.line(),this.code.line(`// ${e.terraformName} - computed: ${e.computed}, optional: ${e.isOptional}, required: ${e.isRequired}`);let i=e.isStored,a=i&&!e.isRequired&&e.setterType._type!=="none",s=i&&e.setterType._type!=="none",o=e.getterType;switch(o._type==="stored_class"?this.code.line(`private ${e.storageName} = ${this.storedClassInit(e)};`):i&&this.code.line(`private ${e.storageName}?: ${e.type.inputTypeDefinition}; `),o._type){case"plain":this.code.openBlock(`public get ${e.name}()`),this.code.line(`return ${this.determineGetAttCall(e)};`),this.code.closeBlock();break;case"args":this.code.openBlock(`public ${e.name}(${o.args})${o.returnType?": "+o.returnType:""}`),this.code.line(`return ${o.returnStatement};`),this.code.closeBlock();break;case"stored_class":this.code.openBlock(`public get ${e.name}()`),this.code.line(`return this.${e.storageName};`),this.code.closeBlock();break}let u=e.setterType;switch(u._type){case"set":this.code.openBlock(`public set ${e.name}(value: ${u.type})`),this.code.line(`this.${e.storageName} = value;`),this.code.closeBlock();break;case"put":this.code.openBlock(`public put${zV(e.name)}(value: ${u.type})`),this.code.line(`this.${e.storageName} = value;`),this.code.closeBlock();break;case"stored_class":this.code.openBlock(`public put${zV(e.name)}(value: ${u.type})`),this.code.line(`this.${e.storageName}.internalValue = value;`),this.code.closeBlock();break}a&&(this.code.openBlock(`public ${this.getResetName(e.name,r)}()`),u._type==="stored_class"?this.code.line(`this.${e.storageName}.internalValue = undefined;`):this.code.line(`this.${e.storageName} = undefined;`),this.code.closeBlock()),s&&(this.code.line("// Temporarily expose input value. Use with caution."),this.code.openBlock(`public get ${this.getInputName(e,n)}()`),u._type==="stored_class"?this.code.line(`return this.${e.storageName}.internalValue;`):this.code.line(`return this.${e.storageName};`),this.code.closeBlock())}storedClassInit(e){return e.type.getStoredClassInitializer(e.terraformName)}determineGetAttCall(e){return e.isProvider?`this.${e.storageName}`:e.type.getAttributeAccessFunction(e.terraformName)}needsInputEscape(e,r){return r.find(n=>n.terraformName.match(`^${e.terraformName}_input$`))instanceof OBe.AttributeModel}getInputName(e,r){return r?`${e.name}TfInput`:`${e.name}Input`}needsResetEscape(e,r){return r.find(n=>n.terraformName.match(`^reset_${e.terraformName}$`))instanceof OBe.AttributeModel}getResetName(e,r){return e&&(r?`resetTf${zV(e)}`:`reset${zV(e)}`)}emitToHclTerraform(e,r){var n;let i=e.type,a=r?"struct!":"this",s=r?e.name:e.storageName,o=kBe.CUSTOM_DEFAULTS[e.terraformFullName],u=`${a}.${s}${!r&&i.isComplex&&!e.isProvider&&(!((n=i.struct)===null||n===void 0)&&n.isClass||e.getterType._type==="stored_class")?".internalValue":""}`,f=`${o!==void 0?`${u} === undefined ? ${o} : `:""}${i.toHclTerraformFunction}(${u})`,h=e.type.isComplex,g=e.type.typeModelType;this.code.open(`${e.terraformName}: {`),this.code.line(`value: ${f},`),this.code.line(`isBlock: ${h},`),this.code.line(`type: "${g}",`),this.code.line(`storageClassType: "${e.type.storedClassType}",`),this.code.close("},")}emitToTerraform(e,r){var n;let i=e.type,a=r?"struct!":"this",s=r?e.name:e.storageName,o=kBe.CUSTOM_DEFAULTS[e.terraformFullName],u=`${a}.${s}${!r&&i.isComplex&&!e.isProvider&&(!((n=i.struct)===null||n===void 0)&&n.isClass||e.getterType._type==="stored_class")?".internalValue":""}`,l=o!==void 0?`${u} === undefined ? ${o} : `:"";this.code.line(`${e.terraformName}: ${l}${i.toTerraformFunction}(${u}),`)}};KV.AttributesEmitter=hie});var QV=x(JV=>{"use strict";Object.defineProperty(JV,"__esModule",{value:!0});JV.sanitizedComment=void 0;function kFt(t){let e=!1;return t.line("/**"),{line:r=>{if(typeof r=="object"&&!Array.isArray(r))return;let n=Array.isArray(r)?r.join(`
104
104
  `):r.toLocaleString(),i=typeof n=="string"?n.replace(/\*\//g,"* /"):n;if(i===""){t.line("*");return}i!==n&&(e=!0),i.split(`
105
105
  `).forEach(a=>{t.line(`* ${a}`)})},end:()=>{e&&(t.line(" *"),t.line("* Note: The above comment contained a comment block ending sequence (* followed by /). We have introduced a space between to prevent syntax errors. Please ignore the space.")),t.line("*/")}}}JV.sanitizedComment=kFt});var ZBe=x(eP=>{"use strict";Object.defineProperty(eP,"__esModule",{value:!0});eP.ResourceEmitter=void 0;var ZFt=$V(),mie=QV(),gie=class{constructor(e){this.code=e,this.attributesEmitter=new ZFt.AttributesEmitter(this.code)}emit(e){this.code.line();let r=(0,mie.sanitizedComment)(this.code);r.line(`Represents a {@link ${e.linkToDocs} ${e.terraformResourceType}}`),r.end(),this.code.openBlock(`export class ${e.className} extends cdktn.${e.parentClassName}`),this.emitHeader("STATIC PROPERTIES"),this.emitStaticProperties(e),this.emitHeader("STATIC Methods"),this.emitStaticMethods(e),this.emitHeader("INITIALIZER"),this.emitInitializer(e),this.emitHeader("ATTRIBUTES"),this.emitResourceAttributes(e),this.emitHeader("SYNTHESIS"),this.emitResourceSynthesis(e),this.emitHclResourceSynthesis(e),this.code.closeBlock()}emitHeader(e){this.code.line(),this.code.line("// "+"=".repeat(e.length)),this.code.line(`// ${e}`),this.code.line("// "+"=".repeat(e.length))}emitStaticProperties(e){this.code.line(`public static readonly tfResourceType = "${e.terraformResourceType}";`)}emitStaticMethods(e){let r=(0,mie.sanitizedComment)(this.code);r.line(`Generates CDKTN code for importing a ${e.className} resource upon running "cdktn plan <stack-name>"`),r.line("@param scope The scope in which to define this construct"),r.line(`@param importToId The construct id used in the generated config for the ${e.className} to import`),r.line(`@param importFromId The id of the existing ${e.className} that should be imported. Refer to the {@link ${e.linkToDocs}#import import section} in the documentation of this resource for the id to use`),r.line(`@param provider? Optional instance of the provider where the ${e.className} to import is found`),r.end(),this.code.line(`public static generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: cdktn.TerraformProvider) {
106
106
  return new cdktn.ImportableResource(scope, importToId, { terraformResourceType: "${e.terraformResourceType}", importId: importFromId, provider });
107
107
  }`)}emitHclResourceSynthesis(e){this.code.line(),this.code.openBlock("protected synthesizeHclAttributes(): { [name: string]: any }"),this.code.open("const attrs = {");for(let r of e.synthesizableAttributes)this.attributesEmitter.emitToHclTerraform(r,!1);this.code.close("};"),e.synthesizableAttributes.length>0?(this.code.line(),this.code.line("// remove undefined attributes"),this.code.line("return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined ))")):this.code.line("return attrs;"),this.code.closeBlock()}emitResourceSynthesis(e){this.code.line(),this.code.openBlock("protected synthesizeAttributes(): { [name: string]: any }"),this.code.open("return {");for(let r of e.synthesizableAttributes)this.attributesEmitter.emitToTerraform(r,!1);this.code.close("};"),this.code.closeBlock()}emitResourceAttributes(e){for(let r of e.attributes)this.attributesEmitter.emit(r,this.attributesEmitter.needsResetEscape(r,e.attributes),this.attributesEmitter.needsInputEscape(r,e.attributes))}emitInitializer(e){this.code.line();let r=(0,mie.sanitizedComment)(this.code);r.line(`Create a new {@link ${e.linkToDocs} ${e.terraformResourceType}} ${e.isDataSource?"Data Source":"Resource"}`),r.line(""),r.line("@param scope The scope in which to define this construct"),r.line("@param id The scoped construct ID. Must be unique amongst siblings in the same scope"),r.line(`@param options ${e.configStruct.attributeType}`),r.end(),this.code.openBlock(`public constructor(scope: Construct, id: string, config: ${e.configStruct.attributeType})`),e.isProvider?this.emitProviderSuper(e):this.emitResourceSuper(e);for(let n of e.configStruct.assignableAttributes)n.setterType._type==="stored_class"?this.code.line(`this.${n.storageName}.internalValue = config.${n.name};`):this.code.line(`this.${n.storageName} = config.${n.name};`);this.code.closeBlock()}emitResourceSuper(e){this.code.open("super(scope, id, {"),this.code.line(`terraformResourceType: '${e.terraformResourceType}',`),this.emitTerraformGeneratorMetadata(e),this.code.line("provider: config.provider,"),this.code.line("dependsOn: config.dependsOn,"),this.code.line("count: config.count,"),this.code.line("lifecycle: config.lifecycle,"),this.code.line("provisioners: config.provisioners,"),this.code.line("connection: config.connection,"),this.code.line("forEach: config.forEach"),this.code.close("});")}emitProviderSuper(e){this.code.open("super(scope, id, {"),this.code.line(`terraformResourceType: '${e.terraformResourceType}',`),this.emitTerraformGeneratorMetadata(e),this.code.line(`terraformProviderSource: '${e.terraformProviderSource}'`),this.code.close("});")}emitTerraformGeneratorMetadata(e){this.code.open("terraformGeneratorMetadata: {"),this.code.line(`providerName: '${e.provider}'${e.providerVersion||e.providerVersionConstraint?",":""}`),e.providerVersion&&this.code.line(`providerVersion: '${e.providerVersion}'${e.providerVersionConstraint?",":""}`),e.providerVersionConstraint&&this.code.line(`providerVersionConstraint: '${e.providerVersionConstraint}'`),this.code.close("},")}};eP.ResourceEmitter=gie});var WBe=x(Ry=>{"use strict";var LFt=Ry&&Ry.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WFt=Ry&&Ry.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),VFt=Ry&&Ry.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&LFt(e,t,r);return WFt(e,t),e};Object.defineProperty(Ry,"__esModule",{value:!0});Ry.StructEmitter=void 0;var tP=gE(),PFt=$V(),LBe=MV(),rP=VFt(require("path")),vie=oie(),Hm=QV(),yie=class{constructor(e,r){this.code=e,this.attributesEmitter=new PFt.AttributesEmitter(this.code),this.importExtension=r}emit(e){e.structsRequireSharding?this.emitNamespacedStructs(e):this.emitStructs(e)}warnAboutIdField(e){e.name==="id"&&(this.code.line("*"),this.code.line("* Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2."),this.code.line("* If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable."))}emitInterface(e,r,n=r.name){e.isProvider?this.code.openBlock(`export interface ${n}`):this.code.openBlock(`export interface ${n}${r.extends}`);for(let i of r.assignableAttributes){let a=(0,Hm.sanitizedComment)(this.code);i.description?(a.line(i.description),a.line(""),a.line(`Docs at Terraform Registry: {@link ${e.linkToDocs}#${i.terraformName} ${e.className}#${i.terraformName}}`),this.warnAboutIdField(i),a.end()):(a.line(`Docs at Terraform Registry: {@link ${e.linkToDocs}#${i.terraformName} ${e.className}#${i.terraformName}}`),this.warnAboutIdField(i),a.end()),this.code.line(`readonly ${i.typeDefinition};`)}this.code.closeBlock(),r instanceof tP.ConfigStruct||(this.emitToTerraformFunction(r),this.emitToHclTerraformFunction(r))}emitStructs(e){e.structs.forEach(r=>{r instanceof tP.ConfigStruct?this.emitInterface(e,r):(this.emitInterface(e,r),r.isProvider||this.emitClass(r))})}emitNamespacedStructs(e){let r={},n=e.structs.slice(1),i=[[]],a=[0];n.forEach(u=>{a[a.length-1]+u.exportCount<=vie.STRUCT_SHARDING_THRESHOLD?(i[i.length-1].push(u),a[a.length-1]+=u.exportCount):(i.push([u]),a.push(u.exportCount))});for(let u=0;u<i.length;u++){let l=`structs${u*vie.STRUCT_SHARDING_THRESHOLD}.ts`;i[u].forEach(h=>r[h.name]=l)}let s=[];for(let u=0;u<i.length;u++){let l={},f=i[u],h=`structs${u*vie.STRUCT_SHARDING_THRESHOLD}.ts`;s.push(h),f.forEach(_=>{_.attributes.forEach(w=>{var T,D;let G=(T=w.type.struct)===null||T===void 0?void 0:T.name,O=r[G??""];if(O&&O!==h){if(!w.type.struct)throw new Error(`${G} is not a struct`);(D=l[O])!==null&&D!==void 0||(l[O]=[]);let X=w.getReferencedTypes(_ instanceof tP.ConfigStruct);X&&l[O].push(...X)}})});let g=rP.join(e.structsFolderPath,h);this.code.openFile(g),this.code.line("import * as cdktn from 'cdktn';"),Object.entries(l).forEach(([_,w])=>{let T=rP.basename(_,".ts");this.code.line(`import { ${[...new Set(w)].join(`,
108
- `)} } from './${T}${this.importExtension}';`)}),f.forEach(_=>{_ instanceof tP.ConfigStruct?this.emitInterface(e,_):(this.emitInterface(e,_),_.isProvider||this.emitClass(_))}),this.code.closeFile(g)}let o=rP.join(e.structsFolderPath,"index.ts");this.code.openFile(o),s.forEach(u=>{let l=rP.basename(u,".ts");this.code.line(`export * from './${l}${this.importExtension}';`)}),this.code.closeFile(o)}emitClass(e){this.code.openBlock(`export class ${e.outputReferenceName} extends cdktn.ComplexObject`),this.code.line("private isEmptyObject = false;"),e.isClass||this.code.line("private resolvableValue?: cdktn.IResolvable;"),this.code.line();let r=(0,Hm.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),e.isSingleItem?(r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute, false, 0);"),this.code.closeBlock()):e.nestingMode==="single"||e.nestingMode==="object"?(r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute, false);"),this.code.closeBlock()):e.nestingMode.startsWith("map")?(this.code.line("* @param complexObjectKey the key of this item in the map"),r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, complexObjectKey: string)"),this.code.line("super(terraformResource, terraformAttribute, false, complexObjectKey);"),this.code.closeBlock()):(r.line("@param complexObjectIndex the index of this item in the list"),r.line("@param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex);"),this.code.closeBlock()),this.code.line(),this.emitInternalValueGetter(e),this.code.line(),this.emitInternalValueSetter(e);for(let n of e.attributes)this.attributesEmitter.emit(n,this.attributesEmitter.needsResetEscape(n,e.attributes),this.attributesEmitter.needsInputEscape(n,e.attributes));this.code.closeBlock(),!e.isSingleItem&&(e.nestingMode==="list"||e.nestingMode==="set")?this.emitComplexListClass(e):e.nestingMode==="map"?this.emitComplexMapClass(e):e.nestingMode==="maplist"?this.emitComplexMapListClasses(e):e.nestingMode==="mapset"?this.emitComplexMapListClasses(e):e.nestingMode==="listmap"?this.emitComplexListMapClasses(e,!1):e.nestingMode==="setmap"?this.emitComplexListMapClasses(e,!0):(e.nestingMode==="listlist"||e.nestingMode==="listset"||e.nestingMode==="setlist"||e.nestingMode==="setset")&&this.emitComplexListListClasses(e)}emitComplexListClass(e){this.code.line(),this.code.openBlock(`export class ${e.listName} extends cdktn.ComplexList`),e.assignable&&this.code.line(`public internalValue? : ${e.name}[] | cdktn.IResolvable`),this.code.line();let r=(0,Hm.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.line("@param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, wrapsSet);"),this.code.closeBlock(),this.code.line();let n=(0,Hm.sanitizedComment)(this.code);n.line("@param index the index of the item to return"),n.end(),this.code.openBlock(`public get(index: number): ${e.outputReferenceName}`),this.code.line(`return new ${e.outputReferenceName}(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);`),this.code.closeBlock(),this.code.closeBlock()}emitComplexMapClass(e){this.code.line(),this.code.openBlock(`export class ${e.mapName} extends cdktn.ComplexMap`),e.assignable&&this.code.line(`public internalValue? : { [key: string]: ${e.name} } | cdktn.IResolvable`),this.code.line();let r=(0,Hm.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute);"),this.code.closeBlock(),this.code.line();let n=(0,Hm.sanitizedComment)(this.code);n.line("@param key the key of the item to return"),n.end(),this.code.openBlock(`public get(key: string): ${e.outputReferenceName}`),this.code.line(`return new ${e.outputReferenceName}(this.terraformResource, this.terraformAttribute, key);`),this.code.closeBlock(),this.code.closeBlock()}emitComplexMapListClasses(e){this.emitComplexMapListClass(e),this.emitComplexMapClass(e)}emitComplexMapListClass(e){this.code.line(),this.code.openBlock(`export class ${e.mapListName} extends cdktn.MapList`),e.assignable&&this.code.line(`public internalValue? : ${e.mapName}[] | cdktn.IResolvable`),this.code.line();let r=(0,Hm.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.line("@param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, wrapsSet);"),this.code.closeBlock(),this.code.line();let n=(0,Hm.sanitizedComment)(this.code);n.line("@param index the index of the item to return"),n.end(),this.code.openBlock(`public get(index: number): ${e.mapName}`),this.code.line(`return new ${e.mapName}(this, \`[\${index}]\`);`),this.code.closeBlock(),this.code.closeBlock()}emitComplexListMapClasses(e,r){this.emitComplexListMapClass(e,r),this.emitComplexListClass(e)}emitComplexListMapClass(e,r){this.code.line(),this.code.openBlock(`export class ${e.listMapName} extends cdktn.ComplexMap`),e.assignable&&this.code.line(`public internalValue? : { [key: string]: ${e.name}[] } | cdktn.IResolvable`),this.code.line();let n=(0,Hm.sanitizedComment)(this.code);n.line("@param terraformResource The parent resource"),n.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),n.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute);"),this.code.closeBlock(),this.code.line();let i=(0,Hm.sanitizedComment)(this.code);i.line("@param key the key of the item to return"),i.end(),this.code.openBlock(`public get(key: string): ${e.listName}`),this.code.line(`return new ${e.listName}(this, \`[\${key}]\`, ${r});`),this.code.closeBlock(),this.code.closeBlock()}emitComplexListListClasses(e){this.emitComplexListListClass(e),this.emitComplexListClass(e)}emitComplexListListClass(e){this.code.line(),this.code.openBlock(`export class ${e.listListName} extends cdktn.MapList`),e.assignable&&this.code.line(`public internalValue? : ${e.name}[][] | cdktn.IResolvable`),this.code.line();let r=(0,Hm.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.line("@param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, wrapsSet);"),this.code.closeBlock(),this.code.line();let n=(0,Hm.sanitizedComment)(this.code);n.line("@param index the index of the item to return"),n.end(),this.code.openBlock(`public get(index: number): ${e.listName}`),this.code.line(`return new ${e.listName}(this, \`[\${index}]\`, ${e.nestingMode==="setlist"||e.nestingMode==="setset"});`),this.code.closeBlock(),this.code.closeBlock()}emitInternalValueGetter(e){this.code.openBlock(`public get internalValue(): ${e.name}${e.isClass?"":" | cdktn.IResolvable"} | undefined`),e.isClass||(this.code.openBlock("if (this.resolvableValue)"),this.code.line("return this.resolvableValue;"),this.code.closeBlock()),this.code.line("let hasAnyValues = this.isEmptyObject;"),this.code.line("const internalValueResult: any = {};");for(let r of e.attributes)r.isStored&&(r.getterType._type==="stored_class"?this.code.openBlock(`if (this.${r.storageName}?.internalValue !== undefined)`):this.code.openBlock(`if (this.${r.storageName} !== undefined)`),this.code.line("hasAnyValues = true;"),r.getterType._type==="stored_class"?this.code.line(`internalValueResult.${r.name} = this.${r.storageName}?.internalValue;`):this.code.line(`internalValueResult.${r.name} = this.${r.storageName};`),this.code.closeBlock());this.code.line("return hasAnyValues ? internalValueResult : undefined;"),this.code.closeBlock()}emitInternalValueSetter(e){this.code.openBlock(`public set internalValue(value: ${e.name}${e.isClass?"":" | cdktn.IResolvable"} | undefined)`),this.code.openBlock("if (value === undefined)"),this.code.line("this.isEmptyObject = false;"),e.isClass||this.code.line("this.resolvableValue = undefined;");for(let r of e.attributes)r.isStored&&(r.setterType._type==="stored_class"?this.code.line(`this.${r.storageName}.internalValue = undefined;`):r.setterType._type!=="none"&&this.code.line(`this.${r.storageName} = undefined;`));this.code.closeBlock(),e.isClass||(this.code.openBlock("else if (cdktn.Tokenization.isResolvable(value))"),this.code.line("this.isEmptyObject = false;"),this.code.line("this.resolvableValue = value;"),this.code.closeBlock()),this.code.openBlock("else"),this.code.line("this.isEmptyObject = Object.keys(value).length === 0;"),e.isClass||this.code.line("this.resolvableValue = undefined;");for(let r of e.attributes)r.isStored&&(r.setterType._type==="stored_class"?this.code.line(`this.${r.storageName}.internalValue = value.${r.name};`):r.setterType._type!=="none"&&this.code.line(`this.${r.storageName} = value.${r.name};`));this.code.closeBlock(),this.code.closeBlock()}emitToHclTerraformFunction(e){this.code.line(),this.code.openBlock(`export function ${(0,LBe.downcaseFirst)(e.name)}ToHclTerraform(struct?: ${e.isSingleItem&&!e.isProvider?`${e.name}OutputReference | `:""}${e.name}${e.isClass?"":" | cdktn.IResolvable"}): any`),this.code.line("if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }"),this.code.openBlock("if (cdktn.isComplexElement(struct))"),this.code.line('throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");'),this.code.closeBlock(),this.code.open("const attrs = {");for(let r of e.assignableAttributes)this.attributesEmitter.emitToHclTerraform(r,!0);this.code.close("};"),e.assignableAttributes.length>0?(this.code.line(),this.code.line("// remove undefined attributes"),this.code.line("return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));")):this.code.line("return attrs;"),this.code.closeBlock(),this.code.line()}emitToTerraformFunction(e){this.code.line(),this.code.openBlock(`export function ${(0,LBe.downcaseFirst)(e.name)}ToTerraform(struct?: ${e.isSingleItem&&!e.isProvider?`${e.name}OutputReference | `:""}${e.name}${e.isClass?"":" | cdktn.IResolvable"}): any`),this.code.line("if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }"),this.code.openBlock("if (cdktn.isComplexElement(struct))"),this.code.line('throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");'),this.code.closeBlock(),this.code.openBlock("return");for(let r of e.assignableAttributes)this.attributesEmitter.emitToTerraform(r,!0);this.code.closeBlock(";"),this.code.closeBlock(),this.code.line()}};Ry.StructEmitter=yie});var VBe=x(k6=>{"use strict";var HFt=k6&&k6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bie=k6&&k6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&HFt(e,t,r)};Object.defineProperty(k6,"__esModule",{value:!0});bie($V(),k6);bie(ZBe(),k6);bie(WBe(),k6)});var Cie=x(iP=>{"use strict";Object.defineProperty(iP,"__esModule",{value:!0});iP.TerraformProviderGenerator=void 0;var PBe=a6(),nP=Ln(),MFt=S_(),UFt=pie(),HBe=VBe(),YFt=(t,e)=>{if(t.isModule)return!1;let r=e.split("/");if(r.length===1)return t.source===e;{let[n,i,a]=r;if(!n||!i||!a)throw new Error(`can't handle ${e}`);if(t.source){let s={hostname:"registry.terraform.io",namespace:"hashicorp",name:""},o=t.source.split("/");switch(o.length){case 1:s.name=o[0].toLowerCase();break;case 2:s.namespace=o[0].toLowerCase(),s.name=o[1].toLowerCase();break;case 3:s.hostname=o[0].toLowerCase(),s.namespace=o[1].toLowerCase(),s.name=o[2].toLowerCase();break;default:throw new Error(`can't handle ${t.source}. Expected string with 1, 2 or 3 elements separated by '/'`)}return s.hostname===n&&s.namespace===i&&s.name===a}return t.name===a}},_ie=class{constructor(e,r,n={}){var i;this.code=e,this.schema=r,this.resourceParser=new UFt.ResourceParser,this.versions={},this.code.indentation=2,this.importExtension=(i=n.importExtension)!==null&&i!==void 0?i:"",this.resourceEmitter=new HBe.ResourceEmitter(this.code),this.structEmitter=new HBe.StructEmitter(this.code,this.importExtension)}getProviderByConstraint(e){return Object.keys(this.schema.provider_schemas||{}).find(r=>YFt(e,r))}generate(e){var r;let n=this.getProviderByConstraint(e);if(!n)throw nP.logger.debug(`Could not find provider constraint for ${e} in schema: ${JSON.stringify(this.schema,null,2)}`),new Error(`Could not find provider with constraint ${JSON.stringify(e)}`);let i=(r=this.schema.provider_versions)===null||r===void 0?void 0:r[n];this.emitProvider(n,i,e),this.versions[n]=i}generateAll(){for(let e of Object.keys(this.schema.provider_schemas||{}))this.generate(new nP.ConstructsMakerProviderTarget(new nP.TerraformProviderConstraint(e),nP.LANGUAGES[0]))}async save(e){await this.code.save(e)}buildResourceModels(e,r){var n;let i=(n=this.schema.provider_schemas)===null||n===void 0?void 0:n[e];if(!i)throw new Error(`Can not find provider '${e}' in schema`);let a=Object.entries(i.resource_schemas||{}).map(([o,u])=>this.resourceParser.parse(e,o,u,"resource",r)),s=Object.entries(i.data_source_schemas||{}).map(([o,u])=>this.resourceParser.parse(e,`data_${o}`,u,"data_source",r));return[].concat(...a,...s)}getClassNameForResource(e){return this.resourceParser.getClassNameForResource(e)}getNamespaceNameForResource(e){return this.resourceParser.getNamespaceNameForResource(e)}emitProvider(e,r,n){var i;let a=n!=null&&n.name?n.name:(0,MFt.parseFQPN)(e).name,s=(i=this.schema.provider_schemas)===null||i===void 0?void 0:i[e];if(!s)throw new Error(`Can not find provider '${e}' in schema`);let o=[];if(this.buildResourceModels(e,n).forEach(u=>{n&&(u.providerVersionConstraint=n.version,u.terraformProviderSource=n.source),u.providerVersion=r,u.structsRequireSharding?o.push(this.emitResourceWithComplexStruct(u)):o.push(this.emitResource(u)),this.emitResourceReadme(u)}),s.provider){let u=this.resourceParser.parse(e,"provider",s.provider,"provider",n);n&&(u.providerVersionConstraint=n.version,u.terraformProviderSource=n.source,u.terraformProviderName=n.name),u.providerVersion=r,o.push(this.emitResource(u)),this.emitResourceReadme(u)}this.emitIndexFile(a,o),this.emitLazyIndexFile(a,o)}emitResourceReadme(e){let r=`${e.namespaceFolderPath}/README.md`;this.code.openFile(r),this.code.line(`# \`${e.terraformType}\``),this.code.line();let n=e.isProvider?e.provider:e.terraformType;this.code.line(`Refer to the Terraform Registry for docs: [\`${n}\`](${e.linkToDocs}).`),this.code.closeFile(r)}emitIndexFile(e,r){let n=`providers/${e}`,i=`${n}/index.ts`;this.code.openFile(i),this.code.line("// generated by cdktn get");for(let a of r){let s=a.replace(`${n}/`,"").replace("/index.ts","");this.code.line(`export * as ${(0,PBe.toCamelCase)(s)} from './${s}/index${this.importExtension}';`)}this.code.line(),this.code.closeFile(i)}emitLazyIndexFile(e,r){let n=`providers/${e}`,i=`${n}/lazy-index.ts`;this.code.openFile(i),this.code.line("// generated by cdktn get");for(let a of r){let s=a.replace(`${n}/`,"").replace("/index.ts","");this.code.line(`Object.defineProperty(exports, '${(0,PBe.toCamelCase)(s)}', { get: function () { return require('./${s}'); } });`)}this.code.line(),this.code.closeFile(i)}emitResource(e){return this.code.openFile(e.filePath),this.emitFileHeader(e),this.structEmitter.emit(e),this.resourceEmitter.emit(e),this.code.closeFile(e.filePath),e.filePath}emitResourceWithComplexStruct(e){let r=[],n=e.filePath;if(this.code.openFile(n),this.code.line("// generated from terraform resource schema"),this.code.line(),e.structsRequireSharding){let i=`./${e.structsFolderName}/index${this.importExtension}`;e.referencedTypes.length>0&&this.code.line(`import { ${e.referencedTypes.join(`,
108
+ `)} } from './${T}${this.importExtension}';`)}),f.forEach(_=>{_ instanceof tP.ConfigStruct?this.emitInterface(e,_):(this.emitInterface(e,_),_.isProvider||this.emitClass(_))}),this.code.closeFile(g)}let o=rP.join(e.structsFolderPath,"index.ts");this.code.openFile(o),s.forEach(u=>{let l=rP.basename(u,".ts");this.code.line(`export * from './${l}${this.importExtension}';`)}),this.code.closeFile(o)}emitClass(e){this.code.openBlock(`export class ${e.outputReferenceName} extends cdktn.ComplexObject`),this.code.line("private isEmptyObject = false;"),e.isClass||this.code.line("private resolvableValue?: cdktn.IResolvable;"),this.code.line();let r=(0,Hm.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),e.isSingleItem?(r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute, false, 0);"),this.code.closeBlock()):e.nestingMode==="single"||e.nestingMode==="object"?(r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute, false);"),this.code.closeBlock()):e.nestingMode.startsWith("map")?(this.code.line("* @param complexObjectKey the key of this item in the map"),r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, complexObjectKey: string)"),this.code.line("super(terraformResource, terraformAttribute, false, complexObjectKey);"),this.code.closeBlock()):(r.line("@param complexObjectIndex the index of this item in the list"),r.line("@param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex);"),this.code.closeBlock()),this.code.line(),this.emitInternalValueGetter(e),this.code.line(),this.emitInternalValueSetter(e);for(let n of e.attributes)this.attributesEmitter.emit(n,this.attributesEmitter.needsResetEscape(n,e.attributes),this.attributesEmitter.needsInputEscape(n,e.attributes));this.code.closeBlock(),!e.isSingleItem&&(e.nestingMode==="list"||e.nestingMode==="set")?this.emitComplexListClass(e):e.nestingMode==="map"?this.emitComplexMapClass(e):e.nestingMode==="maplist"?this.emitComplexMapListClasses(e):e.nestingMode==="mapset"?this.emitComplexMapListClasses(e):e.nestingMode==="listmap"?this.emitComplexListMapClasses(e,!1):e.nestingMode==="setmap"?this.emitComplexListMapClasses(e,!0):(e.nestingMode==="listlist"||e.nestingMode==="listset"||e.nestingMode==="setlist"||e.nestingMode==="setset")&&this.emitComplexListListClasses(e)}emitComplexListClass(e){this.code.line(),this.code.openBlock(`export class ${e.listName} extends cdktn.ComplexList`),e.assignable&&this.code.line(`public internalValue? : ${e.name}[] | cdktn.IResolvable`),this.code.line();let r=(0,Hm.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.line("@param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, wrapsSet);"),this.code.closeBlock(),this.code.line();let n=(0,Hm.sanitizedComment)(this.code);n.line("@param index the index of the item to return"),n.end(),this.code.openBlock(`public get(index: number): ${e.outputReferenceName}`),this.code.line(`return new ${e.outputReferenceName}(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);`),this.code.closeBlock(),this.code.closeBlock()}emitComplexMapClass(e){this.code.line(),this.code.openBlock(`export class ${e.mapName} extends cdktn.ComplexMap`),e.assignable&&this.code.line(`public internalValue? : { [key: string]: ${e.name} } | cdktn.IResolvable`),this.code.line();let r=(0,Hm.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute);"),this.code.closeBlock(),this.code.line();let n=(0,Hm.sanitizedComment)(this.code);n.line("@param key the key of the item to return"),n.end(),this.code.openBlock(`public get(key: string): ${e.outputReferenceName}`),this.code.line(`return new ${e.outputReferenceName}(this.terraformResource, this.terraformAttribute, key);`),this.code.closeBlock(),this.code.closeBlock()}emitComplexMapListClasses(e){this.emitComplexMapListClass(e),this.emitComplexMapClass(e)}emitComplexMapListClass(e){this.code.line(),this.code.openBlock(`export class ${e.mapListName} extends cdktn.MapList`),e.assignable&&this.code.line(`public internalValue? : ${e.mapName}[] | cdktn.IResolvable`),this.code.line();let r=(0,Hm.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.line("@param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, wrapsSet);"),this.code.closeBlock(),this.code.line();let n=(0,Hm.sanitizedComment)(this.code);n.line("@param index the index of the item to return"),n.end(),this.code.openBlock(`public get(index: number): ${e.mapName}`),this.code.line(`return new ${e.mapName}(this, \`[\${index}]\`);`),this.code.closeBlock(),this.code.closeBlock()}emitComplexListMapClasses(e,r){this.emitComplexListMapClass(e,r),this.emitComplexListClass(e)}emitComplexListMapClass(e,r){this.code.line(),this.code.openBlock(`export class ${e.listMapName} extends cdktn.ComplexMap`),e.assignable&&this.code.line(`public internalValue? : { [key: string]: ${e.name}[] } | cdktn.IResolvable`),this.code.line();let n=(0,Hm.sanitizedComment)(this.code);n.line("@param terraformResource The parent resource"),n.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),n.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute);"),this.code.closeBlock(),this.code.line();let i=(0,Hm.sanitizedComment)(this.code);i.line("@param key the key of the item to return"),i.end(),this.code.openBlock(`public get(key: string): ${e.listName}`),this.code.line(`return new ${e.listName}(this, \`[\${key}]\`, ${r});`),this.code.closeBlock(),this.code.closeBlock()}emitComplexListListClasses(e){this.emitComplexListListClass(e),this.emitComplexListClass(e)}emitComplexListListClass(e){this.code.line(),this.code.openBlock(`export class ${e.listListName} extends cdktn.MapList`),e.assignable&&this.code.line(`public internalValue? : ${e.name}[][] | cdktn.IResolvable`),this.code.line();let r=(0,Hm.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.line("@param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, wrapsSet);"),this.code.closeBlock(),this.code.line();let n=(0,Hm.sanitizedComment)(this.code);n.line("@param index the index of the item to return"),n.end(),this.code.openBlock(`public get(index: number): ${e.listName}`),this.code.line(`return new ${e.listName}(this, \`[\${index}]\`, ${e.nestingMode==="setlist"||e.nestingMode==="setset"});`),this.code.closeBlock(),this.code.closeBlock()}emitInternalValueGetter(e){this.code.openBlock(`public get internalValue(): ${e.name}${e.isClass?"":" | cdktn.IResolvable"} | undefined`),e.isClass||(this.code.openBlock("if (this.resolvableValue)"),this.code.line("return this.resolvableValue;"),this.code.closeBlock()),this.code.line("let hasAnyValues = this.isEmptyObject;"),this.code.line("const internalValueResult: any = {};");for(let r of e.attributes)r.isStored&&(r.getterType._type==="stored_class"?this.code.openBlock(`if (this.${r.storageName}?.internalValue !== undefined)`):this.code.openBlock(`if (this.${r.storageName} !== undefined)`),this.code.line("hasAnyValues = true;"),r.getterType._type==="stored_class"?this.code.line(`internalValueResult.${r.name} = this.${r.storageName}?.internalValue;`):this.code.line(`internalValueResult.${r.name} = this.${r.storageName};`),this.code.closeBlock());this.code.line("return hasAnyValues ? internalValueResult : undefined;"),this.code.closeBlock()}emitInternalValueSetter(e){this.code.openBlock(`public set internalValue(value: ${e.name}${e.isClass?"":" | cdktn.IResolvable"} | undefined)`),this.code.openBlock("if (value === undefined)"),this.code.line("this.isEmptyObject = false;"),e.isClass||this.code.line("this.resolvableValue = undefined;");for(let r of e.attributes)r.isStored&&(r.setterType._type==="stored_class"?this.code.line(`this.${r.storageName}.internalValue = undefined;`):r.setterType._type!=="none"&&this.code.line(`this.${r.storageName} = undefined;`));this.code.closeBlock(),e.isClass||(this.code.openBlock("else if (cdktn.Tokenization.isResolvable(value))"),this.code.line("this.isEmptyObject = false;"),this.code.line("this.resolvableValue = value;"),this.code.closeBlock()),this.code.openBlock("else"),this.code.line("this.isEmptyObject = Object.keys(value).length === 0;"),e.isClass||this.code.line("this.resolvableValue = undefined;");for(let r of e.attributes)r.isStored&&(r.setterType._type==="stored_class"?this.code.line(`this.${r.storageName}.internalValue = value.${r.name};`):r.setterType._type!=="none"&&this.code.line(`this.${r.storageName} = value.${r.name};`));this.code.closeBlock(),this.code.closeBlock()}emitToHclTerraformFunction(e){this.code.line(),this.code.openBlock(`export function ${(0,LBe.downcaseFirst)(e.name)}ToHclTerraform(struct?: ${e.isSingleItem&&!e.isProvider?`${e.name}OutputReference | `:""}${e.name}${e.isClass?"":" | cdktn.IResolvable"}): any`),this.code.line("if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }"),this.code.openBlock("if (cdktn.isComplexElement(struct))"),this.code.line('throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");'),this.code.closeBlock(),this.code.open("const attrs = {");for(let r of e.assignableAttributes)this.attributesEmitter.emitToHclTerraform(r,!0);this.code.close("};"),e.assignableAttributes.length>0?(this.code.line(),this.code.line("// remove undefined attributes"),this.code.line("return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));")):this.code.line("return attrs;"),this.code.closeBlock(),this.code.line()}emitToTerraformFunction(e){this.code.line(),this.code.openBlock(`export function ${(0,LBe.downcaseFirst)(e.name)}ToTerraform(struct?: ${e.isSingleItem&&!e.isProvider?`${e.name}OutputReference | `:""}${e.name}${e.isClass?"":" | cdktn.IResolvable"}): any`),this.code.line("if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }"),this.code.openBlock("if (cdktn.isComplexElement(struct))"),this.code.line('throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");'),this.code.closeBlock(),this.code.openBlock("return");for(let r of e.assignableAttributes)this.attributesEmitter.emitToTerraform(r,!0);this.code.closeBlock(";"),this.code.closeBlock(),this.code.line()}};Ry.StructEmitter=yie});var VBe=x(k6=>{"use strict";var HFt=k6&&k6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bie=k6&&k6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&HFt(e,t,r)};Object.defineProperty(k6,"__esModule",{value:!0});bie($V(),k6);bie(ZBe(),k6);bie(WBe(),k6)});var Cie=x(iP=>{"use strict";Object.defineProperty(iP,"__esModule",{value:!0});iP.TerraformProviderGenerator=void 0;var PBe=a6(),nP=Ln(),MFt=S_(),UFt=pie(),HBe=VBe(),YFt=(t,e)=>{if(t.isModule)return!1;let r=e.split("/");if(r.length===1)return t.source===e;{let[n,i,a]=r;if(!n||!i||!a)throw new Error(`can't handle ${e}`);if(t.source){let s={hostname:"registry.terraform.io",namespace:"hashicorp",name:""},o=t.source.split("/");switch(o.length){case 1:s.name=o[0].toLowerCase();break;case 2:s.namespace=o[0].toLowerCase(),s.name=o[1].toLowerCase();break;case 3:s.hostname=o[0].toLowerCase(),s.namespace=o[1].toLowerCase(),s.name=o[2].toLowerCase();break;default:throw new Error(`can't handle ${t.source}. Expected string with 1, 2 or 3 elements separated by '/'`)}return s.hostname===n&&s.namespace===i&&s.name===a}return t.name===a}},_ie=class{constructor(e,r,n={}){var i;this.code=e,this.schema=r,this.resourceParser=new UFt.ResourceParser,this.versions={},this.code.indentation=2,this.importExtension=(i=n.importExtension)!==null&&i!==void 0?i:"",this.resourceEmitter=new HBe.ResourceEmitter(this.code),this.structEmitter=new HBe.StructEmitter(this.code,this.importExtension)}getProviderByConstraint(e){return Object.keys(this.schema.provider_schemas||{}).find(r=>YFt(e,r))}generate(e){var r;let n=this.getProviderByConstraint(e);if(!n)throw nP.logger.debug(`Could not find provider constraint for ${e} in schema: ${JSON.stringify(this.schema,null,2)}`),new Error(`Could not find provider with constraint ${JSON.stringify(e)}`);let i=(r=this.schema.provider_versions)===null||r===void 0?void 0:r[n];this.emitProvider(n,i,e),this.versions[n]=i}generateAll(){for(let e of Object.keys(this.schema.provider_schemas||{}))this.generate(new nP.ConstructsMakerProviderTarget(new nP.TerraformProviderConstraint(e),nP.LANGUAGES[0]))}async save(e){await this.code.save(e)}buildResourceModels(e,r){var n;let i=(n=this.schema.provider_schemas)===null||n===void 0?void 0:n[e];if(!i)throw new Error(`Can not find provider '${e}' in schema`);let a=Object.entries(i.resource_schemas||{}).map(([o,u])=>this.resourceParser.parse(e,o,u,"resource",r)),s=Object.entries(i.data_source_schemas||{}).map(([o,u])=>this.resourceParser.parse(e,`data_${o}`,u,"data_source",r));return[].concat(...a,...s)}getClassNameForResource(e){return this.resourceParser.getClassNameForResource(e)}getNamespaceNameForResource(e){return this.resourceParser.getNamespaceNameForResource(e)}emitProvider(e,r,n){var i;let a=n!=null&&n.name?n.name:(0,MFt.parseFQPN)(e).name,s=(i=this.schema.provider_schemas)===null||i===void 0?void 0:i[e];if(!s)throw new Error(`Can not find provider '${e}' in schema`);let o=[];if(this.buildResourceModels(e,n).forEach(u=>{n&&(u.providerVersionConstraint=n.version,u.terraformProviderSource=n.source),u.providerVersion=r,u.structsRequireSharding?o.push(this.emitResourceWithComplexStruct(u)):o.push(this.emitResource(u)),this.emitResourceReadme(u)}),s.provider){let u=this.resourceParser.parse(e,"provider",s.provider,"provider",n);n&&(u.providerVersionConstraint=n.version,u.terraformProviderSource=n.source,u.terraformProviderName=n.name),u.providerVersion=r,o.push(this.emitResource(u)),this.emitResourceReadme(u)}this.emitIndexFile(a,o),this.emitLazyIndexFile(a,o)}emitResourceReadme(e){let r=`${e.namespaceFolderPath}/README.md`;this.code.openFile(r),this.code.line(`# \`${e.terraformType}\``),this.code.line();let n=e.isProvider?e.provider:e.terraformType;this.code.line(`Refer to the Terraform Registry for docs: [\`${n}\`](${e.linkToDocs}).`),this.code.closeFile(r)}emitIndexFile(e,r){let n=`providers/${e}`,i=`${n}/index.ts`;this.code.openFile(i),this.code.line("// generated by cdktn get");for(let a of r){let s=a.replace(`${n}/`,"").replace("/index.ts","");this.code.line(`export * as ${(0,PBe.toCamelCase)(s)} from './${s}/index${this.importExtension}';`)}this.code.line(),this.code.closeFile(i)}emitLazyIndexFile(e,r){let n=`providers/${e}`,i=`${n}/lazy-index.ts`;this.code.openFile(i),this.code.line("// generated by cdktn get");for(let a of r){let s=a.replace(`${n}/`,"").replace("/index.ts","");this.code.line(`Object.defineProperty(exports, '${(0,PBe.toCamelCase)(s)}', { get: function () { return require('./${s}'); } });`)}this.code.line(),this.code.closeFile(i)}emitResource(e){return this.code.openFile(e.filePath),this.emitFileHeader(e),this.structEmitter.emit(e),this.resourceEmitter.emit(e),this.code.closeFile(e.filePath),e.filePath}emitResourceWithComplexStruct(e){let r=[],n=e.filePath;if(this.code.openFile(n),this.code.line("// generated from terraform resource schema"),this.code.line(),e.structsRequireSharding){let i=`./${e.structsFolderName}/index${this.importExtension}`;e.referencedTypes.length>0&&this.code.line(`import { ${e.referencedTypes.join(`,
109
109
  `)}} from '${i}';`),this.code.line(`export * from '${i}';`),e.importStatements.forEach(a=>this.code.line(a)),this.structEmitter.emitInterface(e,e.configStruct),this.resourceEmitter.emit(e),this.code.closeFile(n),this.structEmitter.emit(e),r.push(e.fileName),r.push(e.structsFolderName)}else e.importStatements.forEach(i=>this.code.line(i)),this.structEmitter.emit(e),this.resourceEmitter.emit(e),this.code.closeFile(n),r.push(e.fileName);return n}emitFileHeader(e){this.code.line(`// ${e.linkToDocs}`),this.code.line("// generated from terraform resource schema"),this.code.line(),e.importStatements.forEach(r=>this.code.line(r)),this.code.line(),this.code.line("// Configuration"),this.code.line()}};iP.TerraformProviderGenerator=_ie});var UBe=x(oP=>{"use strict";Object.defineProperty(oP,"__esModule",{value:!0});oP.ModuleGenerator=void 0;var aP=a6(),Iie=gE(),MBe=QV(),Sie=class{constructor(e,r){this.code=e,this.targets=r,this.code.indentation=2;for(let n of this.targets)this.emitSubmodule(n)}emitSubmodule(e){let r=e.spec;if(!r)throw new Error(`missing spec for ${e.fqn}`);this.code.openFile(e.fileName),this.code.line("// generated by cdktn get"),this.code.line(`// ${e.source}`),this.code.line("import { TerraformModule, type TerraformModuleUserConfig } from 'cdktn';"),this.code.line("import { Construct } from 'constructs';");let n=this.code.toPascalCase(e.name.replace(/[-/.]/g,"_")),i=`${n}Config`;this.code.openBlock(`export interface ${i} extends TerraformModuleUserConfig`);for(let l of r.inputs){let f=l.required&&l.default===void 0?"":"?",h=(0,MBe.sanitizedComment)(this.code);l.description&&h.line(l.description),l.default&&h.line(l.default),l.type.includes("map(")&&h.line("The property type contains a map, they have special handling, please see {@link cdk.tf/module-map-inputs the docs}"),h.end(),this.code.line(`readonly ${Iie.AttributeModel.escapeName((0,aP.toCamelCase)(l.name))}${f}: ${sP(l.type)};`)}this.code.closeBlock();let a=e.source.includes("."),s;e.source.includes("//")?s=e.source.replace("//modules",`/${e.version||"latest"}/submodules`):s=`${e.source}/${e.version||"latest"}`;let o=(0,MBe.sanitizedComment)(this.code);o.line(`Defines an ${n} based on a Terraform module`),o.line(""),o.line(a?`Source at ${e.source}`:`Docs at Terraform Registry: {@link https://registry.terraform.io/modules/${s} ${e.source}}`),o.end(),this.code.openBlock(`export class ${n} extends TerraformModule`),this.code.line("private readonly inputs: { [name: string]: any } = { };");let u=r.inputs.find(l=>l.required)?"":" = {}";this.code.open(`public constructor(scope: Construct, id: string, config: ${i}${u}) {`),this.code.open("super(scope, id, {"),this.code.line("...config,"),this.code.line(`source: '${e.source}',`),e.version&&this.code.line(`version: '${e.version}',`),this.code.close("});");for(let l of r.inputs){let f=Iie.AttributeModel.escapeName((0,aP.toCamelCase)(l.name));this.code.line(`this.${f} = config.${f};`)}this.code.close("}");for(let l of r.inputs){let f=Iie.AttributeModel.escapeName((0,aP.toCamelCase)(l.name)),h=sP(l.type)+(l.required&&l.default===void 0?"":" | undefined");this.code.openBlock(`public get ${f}(): ${h}`),this.code.line(`return this.inputs['${l.name}'] as ${h};`),this.code.closeBlock(),this.code.openBlock(`public set ${f}(value: ${h})`),this.code.line(`this.inputs['${l.name}'] = value;`),this.code.closeBlock()}for(let l of r.outputs){let f=(0,aP.toCamelCase)(l.name);this.code.openBlock(`public get ${f}Output()`),this.code.line(`return this.getString('${l.name}');`),this.code.closeBlock()}this.code.openBlock("protected synthesizeAttributes()"),this.code.line("return this.inputs;"),this.code.closeBlock(),this.code.openBlock("protected synthesizeHclAttributes(): { [name: string]: any }"),this.code.line("return Object.fromEntries("),this.code.line(" Object.entries(this.inputs)"),this.code.line(" .filter(([, val]) => val !== undefined)"),this.code.line(" .map(([key, val]) => {"),this.code.line(" return ["),this.code.line(" key,"),this.code.line(" {"),this.code.line(" value: val,"),this.code.line(' type: "any",'),this.code.line(" },"),this.code.line(" ];"),this.code.line(" })"),this.code.line(");"),this.code.closeBlock(),this.code.closeBlock(),this.code.closeFile(e.fileName)}};oP.ModuleGenerator=Sie;function sP(t){if(t==="string")return"string";if(t==="number")return"number";if(t==="bool")return"boolean";if(t==="list")return"string[]";if(t==="map")return"{ [key: string]: string }";if(t==="tuple")return"string[]";if(t==="any")return"any";let e=jFt(t);if(e)return e;throw new Error(`unknown type ${t}`)}function jFt(t){let r=/^(object|list|map|set|tuple)\(([\s\S]+)\)/.exec(t);if(!r)return;let[,n,i]=r;if(n==="object")return"any";if(n==="list"||n==="set")return`${sP(i)}[]`;if(n==="tuple")return"any[]";if(n==="map")return`{ [key: string]: ${sP(i)} }`;throw new Error(`unexpected kind ${n}`)}});var zBe=x((s6r,qBe)=>{"use strict";qBe.exports=jBe;function jBe(t,e,r){t instanceof RegExp&&(t=YBe(t,r)),e instanceof RegExp&&(e=YBe(e,r));var n=XBe(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function YBe(t,e){var r=e.match(t);return r?r[0]:null}jBe.range=XBe;function XBe(t,e,r){var n,i,a,s,o,u=r.indexOf(t),l=r.indexOf(e,u+1),f=u;if(u>=0&&l>0){if(t===e)return[u,l];for(n=[],a=r.length;f>=0&&!o;)f==u?(n.push(f),u=r.indexOf(t,f+1)):n.length==1?o=[n.pop(),l]:(i=n.pop(),i<a&&(a=i,s=l),l=r.indexOf(e,f+1)),f=u<l&&u>=0?u:l;n.length&&(o=[a,s])}return o}});var uP=x((o6r,rNe)=>{"use strict";var KBe=zBe();rNe.exports=zFt;var $Be="\0SLASH"+Math.random()+"\0",JBe="\0OPEN"+Math.random()+"\0",xie="\0CLOSE"+Math.random()+"\0",QBe="\0COMMA"+Math.random()+"\0",eNe="\0PERIOD"+Math.random()+"\0";function Eie(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function XFt(t){return t.split("\\\\").join($Be).split("\\{").join(JBe).split("\\}").join(xie).split("\\,").join(QBe).split("\\.").join(eNe)}function qFt(t){return t.split($Be).join("\\").split(JBe).join("{").split(xie).join("}").split(QBe).join(",").split(eNe).join(".")}function tNe(t){if(!t)return[""];var e=[],r=KBe("{","}",t);if(!r)return t.split(",");var n=r.pre,i=r.body,a=r.post,s=n.split(",");s[s.length-1]+="{"+i+"}";var o=tNe(a);return a.length&&(s[s.length-1]+=o.shift(),s.push.apply(s,o)),e.push.apply(e,s),e}function zFt(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),oN(XFt(t),!0).map(qFt)):[]}function KFt(t){return"{"+t+"}"}function $Ft(t){return/^-?0\d/.test(t)}function JFt(t,e){return t<=e}function QFt(t,e){return t>=e}function oN(t,e){var r=[],n=KBe("{","}",t);if(!n)return[t];var i=n.pre,a=n.post.length?oN(n.post,!1):[""];if(/\$$/.test(n.pre))for(var s=0;s<a.length;s++){var o=i+"{"+n.body+"}"+a[s];r.push(o)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),f=u||l,h=n.body.indexOf(",")>=0;if(!f&&!h)return n.post.match(/,(?!,).*\}/)?(t=n.pre+"{"+n.body+xie+n.post,oN(t)):[t];var g;if(f)g=n.body.split(/\.\./);else if(g=tNe(n.body),g.length===1&&(g=oN(g[0],!1).map(KFt),g.length===1))return a.map(function(Te){return n.pre+g[0]+Te});var _;if(f){var w=Eie(g[0]),T=Eie(g[1]),D=Math.max(g[0].length,g[1].length),G=g.length==3?Math.max(Math.abs(Eie(g[2])),1):1,O=JFt,Z=T<w;Z&&(G*=-1,O=QFt);var X=g.some($Ft);_=[];for(var ue=w;O(ue,T);ue+=G){var Q;if(l)Q=String.fromCharCode(ue),Q==="\\"&&(Q="");else if(Q=String(ue),X){var ie=D-Q.length;if(ie>0){var M=new Array(ie+1).join("0");ue<0?Q="-"+M+Q.slice(1):Q=M+Q}}_.push(Q)}}else{_=[];for(var ne=0;ne<g.length;ne++)_.push.apply(_,oN(g[ne],!1))}for(var ne=0;ne<_.length;ne++)for(var s=0;s<a.length;s++){var o=i+_[ne]+a[s];(!e||f||o)&&r.push(o)}}return r}});var nNe=x(lP=>{"use strict";Object.defineProperty(lP,"__esModule",{value:!0});lP.assertValidPattern=void 0;var eOt=1024*64,tOt=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>eOt)throw new TypeError("pattern is too long")};lP.assertValidPattern=tOt});var aNe=x(cP=>{"use strict";Object.defineProperty(cP,"__esModule",{value:!0});cP.parseClass=void 0;var rOt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},uN=t=>t.replace(/[[\]\\-]/g,"\\$&"),nOt=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),iNe=t=>t.join(""),iOt=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],a=r+1,s=!1,o=!1,u=!1,l=!1,f=r,h="";e:for(;a<t.length;){let T=t.charAt(a);if((T==="!"||T==="^")&&a===r+1){l=!0,a++;continue}if(T==="]"&&s&&!u){f=a+1;break}if(s=!0,T==="\\"&&!u){u=!0,a++;continue}if(T==="["&&!u){for(let[D,[G,O,Z]]of Object.entries(rOt))if(t.startsWith(D,a)){if(h)return["$.",!1,t.length-r,!0];a+=D.length,Z?i.push(G):n.push(G),o=o||O;continue e}}if(u=!1,h){T>h?n.push(uN(h)+"-"+uN(T)):T===h&&n.push(uN(T)),h="",a++;continue}if(t.startsWith("-]",a+1)){n.push(uN(T+"-")),a+=2;continue}if(t.startsWith("-",a+1)){h=T,a+=2;continue}n.push(uN(T)),a++}if(f<a)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let T=n[0].length===2?n[0].slice(-1):n[0];return[nOt(T),!1,f-r,!1]}let g="["+(l?"^":"")+iNe(n)+"]",_="["+(l?"":"^")+iNe(i)+"]";return[n.length&&i.length?"("+g+"|"+_+")":n.length?g:_,o,f-r,!0]};cP.parseClass=iOt});var fP=x(dP=>{"use strict";Object.defineProperty(dP,"__esModule",{value:!0});dP.unescape=void 0;var aOt=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");dP.unescape=aOt});var Nie=x(yP=>{"use strict";var th;Object.defineProperty(yP,"__esModule",{value:!0});yP.AST=void 0;var sOt=aNe(),pP=fP(),oOt=new Set(["!","?","+","*","@"]),wie=t=>oOt.has(t),sNe=t=>wie(t.type),uOt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),lOt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),cOt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),oNe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),dOt="(?!(?:^|/)\\.\\.?(?:$|/))",hP="(?!\\.)",fOt=new Set(["[","."]),pOt=new Set(["..","."]),hOt=new Set("().*{}+?[]^$\\!"),mOt=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Bie="[^/]",uNe=Bie+"*?",lNe=Bie+"+?",zl,Wc,Z6,wi,_u,E_,xI,x_,Ty,By,yE,is,cNe,w_,mP,dNe,Aie,gP,fNe,Rie,pNe,hNe,mNe,vP,Tie,gNe,lN=class{constructor(e,r,n={}){Be(this,is);Et(this,"type");Be(this,zl);Be(this,Wc);Be(this,Z6,!1);Be(this,wi,[]);Be(this,_u);Be(this,E_);Be(this,xI);Be(this,x_,!1);Be(this,Ty);Be(this,By);Be(this,yE,!1);this.type=e,e&&de(this,Wc,!0),de(this,_u,r),de(this,zl,I(this,_u)?I(I(this,_u),zl):this),de(this,Ty,I(this,zl)===this?n:I(I(this,zl),Ty)),de(this,xI,I(this,zl)===this?[]:I(I(this,zl),xI)),e==="!"&&!I(I(this,zl),x_)&&I(this,xI).push(this),de(this,E_,I(this,_u)?I(I(this,_u),wi).length:0)}get hasMagic(){if(I(this,Wc)!==void 0)return I(this,Wc);for(let e of I(this,wi))if(typeof e!="string"&&(e.type||e.hasMagic))return de(this,Wc,!0);return I(this,Wc)}toString(){return I(this,By)!==void 0?I(this,By):this.type?de(this,By,this.type+"("+I(this,wi).map(e=>String(e)).join("|")+")"):de(this,By,I(this,wi).map(e=>String(e)).join(""))}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof th&&I(r,_u)===this))throw new Error("invalid part: "+r);I(this,wi).push(r)}}toJSON(){var r;let e=this.type===null?I(this,wi).slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...I(this,wi).map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===I(this,zl)||I(I(this,zl),x_)&&((r=I(this,_u))==null?void 0:r.type)==="!")&&e.push({}),e}isStart(){var r;if(I(this,zl)===this)return!0;if(!((r=I(this,_u))!=null&&r.isStart()))return!1;if(I(this,E_)===0)return!0;let e=I(this,_u);for(let n=0;n<I(this,E_);n++){let i=I(e,wi)[n];if(!(i instanceof th&&i.type==="!"))return!1}return!0}isEnd(){var r,n,i;if(I(this,zl)===this||((r=I(this,_u))==null?void 0:r.type)==="!")return!0;if(!((n=I(this,_u))!=null&&n.isEnd()))return!1;if(!this.type)return(i=I(this,_u))==null?void 0:i.isEnd();let e=I(this,_u)?I(I(this,_u),wi).length:0;return I(this,E_)===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new th(this.type,e);for(let n of I(this,wi))r.copyIn(n);return r}static fromGlob(e,r={}){var i;let n=new th(null,void 0,r);return he(i=th,w_,mP).call(i,e,n,0,r,0),n}toMMPattern(){if(this!==I(this,zl))return I(this,zl).toMMPattern();let e=this.toString(),[r,n,i,a]=this.toRegExpSource();if(!(i||I(this,Wc)||I(this,Ty).nocase&&!I(this,Ty).nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let o=(I(this,Ty).nocase?"i":"")+(a?"u":"");return Object.assign(new RegExp(`^${r}$`,o),{_src:r,_glob:e})}get options(){return I(this,Ty)}toRegExpSource(e){var u;let r=e??!!I(this,Ty).dot;if(I(this,zl)===this&&(he(this,is,vP).call(this),he(this,is,cNe).call(this)),!sNe(this)){let l=this.isStart()&&this.isEnd(),f=I(this,wi).map(w=>{var Z;let[T,D,G,O]=typeof w=="string"?he(Z=th,w_,gNe).call(Z,w,I(this,Wc),l):w.toRegExpSource(e);return de(this,Wc,I(this,Wc)||G),de(this,Z6,I(this,Z6)||O),T}).join(""),h="";if(this.isStart()&&typeof I(this,wi)[0]=="string"&&!(I(this,wi).length===1&&pOt.has(I(this,wi)[0]))){let T=fOt,D=r&&T.has(f.charAt(0))||f.startsWith("\\.")&&T.has(f.charAt(2))||f.startsWith("\\.\\.")&&T.has(f.charAt(4)),G=!r&&!e&&T.has(f.charAt(0));h=D?dOt:G?hP:""}let g="";return this.isEnd()&&I(I(this,zl),x_)&&((u=I(this,_u))==null?void 0:u.type)==="!"&&(g="(?:$|\\/)"),[h+f+g,(0,pP.unescape)(f),de(this,Wc,!!I(this,Wc)),I(this,Z6)]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",a=he(this,is,Tie).call(this,r);if(this.isStart()&&this.isEnd()&&!a&&this.type!=="!"){let l=this.toString(),f=this;return de(f,wi,[l]),f.type=null,de(f,Wc,void 0),[l,(0,pP.unescape)(this.toString()),!1,!1]}let s=!n||e||r||!hP?"":he(this,is,Tie).call(this,!0);s===a&&(s=""),s&&(a=`(?:${a})(?:${s})*?`);let o="";if(this.type==="!"&&I(this,yE))o=(this.isStart()&&!r?hP:"")+lNe;else{let l=this.type==="!"?"))"+(this.isStart()&&!r&&!e?hP:"")+uNe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`;o=i+a+l}return[o,(0,pP.unescape)(a),de(this,Wc,!!I(this,Wc)),I(this,Z6)]}};zl=new WeakMap,Wc=new WeakMap,Z6=new WeakMap,wi=new WeakMap,_u=new WeakMap,E_=new WeakMap,xI=new WeakMap,x_=new WeakMap,Ty=new WeakMap,By=new WeakMap,yE=new WeakMap,is=new WeakSet,cNe=function(){if(this!==I(this,zl))throw new Error("should only call on root");if(I(this,x_))return this;this.toString(),de(this,x_,!0);let e;for(;e=I(this,xI).pop();){if(e.type!=="!")continue;let r=e,n=I(r,_u);for(;n;){for(let i=I(r,E_)+1;!n.type&&i<I(n,wi).length;i++)for(let a of I(e,wi)){if(typeof a=="string")throw new Error("string part in extglob AST??");a.copyIn(I(n,wi)[i])}r=n,n=I(r,_u)}}return this},w_=new WeakSet,mP=function(e,r,n,i,a){var T,D,G,O;let s=i.maxExtglobRecursion??2,o=!1,u=!1,l=-1,f=!1;if(r.type===null){let Z=n,X="";for(;Z<e.length;){let ue=e.charAt(Z++);if(o||ue==="\\"){o=!o,X+=ue;continue}if(u){Z===l+1?(ue==="^"||ue==="!")&&(f=!0):ue==="]"&&!(Z===l+2&&f)&&(u=!1),X+=ue;continue}else if(ue==="["){u=!0,l=Z,f=!1,X+=ue;continue}if(!i.noext&&wie(ue)&&e.charAt(Z)==="("&&a<=s){r.push(X),X="";let ie=new th(ue,r);Z=he(T=th,w_,mP).call(T,e,ie,Z,i,a+1),r.push(ie);continue}X+=ue}return r.push(X),Z}let h=n+1,g=new th(null,r),_=[],w="";for(;h<e.length;){let Z=e.charAt(h++);if(o||Z==="\\"){o=!o,w+=Z;continue}if(u){h===l+1?(Z==="^"||Z==="!")&&(f=!0):Z==="]"&&!(h===l+2&&f)&&(u=!1),w+=Z;continue}else if(Z==="["){u=!0,l=h,f=!1,w+=Z;continue}if(wie(Z)&&e.charAt(h)==="("&&(a<=s||r&&he(D=r,is,gP).call(D,Z))){let ue=r&&he(G=r,is,gP).call(G,Z)?0:1;g.push(w),w="";let Q=new th(Z,g);g.push(Q),h=he(O=th,w_,mP).call(O,e,Q,h,i,a+ue);continue}if(Z==="|"){g.push(w),w="",_.push(g),g=new th(null,r);continue}if(Z===")")return w===""&&I(r,wi).length===0&&de(r,yE,!0),g.push(w),w="",r.push(..._,g),h;w+=Z}return r.type=null,de(r,Wc,void 0),de(r,wi,[e.substring(n-1)]),h},dNe=function(e){return he(this,is,Aie).call(this,e,lOt)},Aie=function(e,r=uOt){if(!e||typeof e!="object"||e.type!==null||I(e,wi).length!==1||this.type===null)return!1;let n=I(e,wi)[0];return!n||typeof n!="object"||n.type===null?!1:he(this,is,gP).call(this,n.type,r)},gP=function(e,r=cOt){var n;return!!((n=r.get(this.type))!=null&&n.includes(e))},fNe=function(e,r){let n=I(e,wi)[0],i=new th(null,n,this.options);I(i,wi).push(""),n.push(i),he(this,is,Rie).call(this,e,r)},Rie=function(e,r){let n=I(e,wi)[0];I(this,wi).splice(r,1,...I(n,wi));for(let i of I(n,wi))typeof i=="object"&&de(i,_u,this);de(this,By,void 0)},pNe=function(e){let r=oNe.get(this.type);return!!(r!=null&&r.has(e))},hNe=function(e){if(!e||typeof e!="object"||e.type!==null||I(e,wi).length!==1||this.type===null||I(this,wi).length!==1)return!1;let r=I(e,wi)[0];return!r||typeof r!="object"||r.type===null?!1:he(this,is,pNe).call(this,r.type)},mNe=function(e){let r=oNe.get(this.type),n=I(e,wi)[0],i=r==null?void 0:r.get(n.type);if(!i)return!1;de(this,wi,I(n,wi));for(let a of I(this,wi))typeof a=="object"&&de(a,_u,this);this.type=i,de(this,By,void 0),de(this,yE,!1)},vP=function(){var e,r;if(sNe(this)){let n=0,i=!1;do{i=!0;for(let a=0;a<I(this,wi).length;a++){let s=I(this,wi)[a];typeof s=="object"&&(he(r=s,is,vP).call(r),he(this,is,Aie).call(this,s)?(i=!1,he(this,is,Rie).call(this,s,a)):he(this,is,dNe).call(this,s)?(i=!1,he(this,is,fNe).call(this,s,a)):he(this,is,hNe).call(this,s)&&(i=!1,he(this,is,mNe).call(this,s)))}}while(!i&&++n<10)}else for(let n of I(this,wi))typeof n=="object"&&he(e=n,is,vP).call(e);de(this,By,void 0)},Tie=function(e){return I(this,wi).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,a,s]=r.toRegExpSource(e);return de(this,Z6,I(this,Z6)||s),n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")},gNe=function(e,r,n=!1){let i=!1,a="",s=!1,o=!1;for(let u=0;u<e.length;u++){let l=e.charAt(u);if(i){i=!1,a+=(hOt.has(l)?"\\":"")+l,o=!1;continue}if(l==="\\"){u===e.length-1?a+="\\\\":i=!0;continue}if(l==="["){let[f,h,g,_]=(0,sOt.parseClass)(e,u);if(g){a+=f,s=s||h,u+=g-1,r=r||_,o=!1;continue}}if(l==="*"){if(o)continue;o=!0,a+=n&&/^[*]+$/.test(e)?lNe:uNe,r=!0;continue}else o=!1;if(l==="?"){a+=Bie,r=!0;continue}a+=mOt(l)}return[a,(0,pP.unescape)(e),!!r,s]},Be(lN,w_);yP.AST=lN;th=lN});var Die=x(bP=>{"use strict";Object.defineProperty(bP,"__esModule",{value:!0});bP.escape=void 0;var gOt=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");bP.escape=gOt});var A_=x(Ur=>{"use strict";var vOt=Ur&&Ur.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.unescape=Ur.escape=Ur.AST=Ur.Minimatch=Ur.match=Ur.makeRe=Ur.braceExpand=Ur.defaults=Ur.filter=Ur.GLOBSTAR=Ur.sep=Ur.minimatch=void 0;var yOt=vOt(uP()),_P=nNe(),bNe=Nie(),bOt=Die(),_Ot=fP(),COt=(t,e,r={})=>((0,_P.assertValidPattern)(e),!r.nocomment&&e.charAt(0)==="#"?!1:new wI(e,r).match(t));Ur.minimatch=COt;var IOt=/^\*+([^+@!?\*\[\(]*)$/,SOt=t=>e=>!e.startsWith(".")&&e.endsWith(t),EOt=t=>e=>e.endsWith(t),xOt=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),wOt=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),AOt=/^\*+\.\*+$/,ROt=t=>!t.startsWith(".")&&t.includes("."),TOt=t=>t!=="."&&t!==".."&&t.includes("."),BOt=/^\.\*+$/,NOt=t=>t!=="."&&t!==".."&&t.startsWith("."),DOt=/^\*+$/,GOt=t=>t.length!==0&&!t.startsWith("."),FOt=t=>t.length!==0&&t!=="."&&t!=="..",OOt=/^\?+([^+@!?\*\[\(]*)?$/,kOt=([t,e=""])=>{let r=_Ne([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},ZOt=([t,e=""])=>{let r=CNe([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},LOt=([t,e=""])=>{let r=CNe([t]);return e?n=>r(n)&&n.endsWith(e):r},WOt=([t,e=""])=>{let r=_Ne([t]);return e?n=>r(n)&&n.endsWith(e):r},_Ne=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},CNe=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},INe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",vNe={win32:{sep:"\\"},posix:{sep:"/"}};Ur.sep=INe==="win32"?vNe.win32.sep:vNe.posix.sep;Ur.minimatch.sep=Ur.sep;Ur.GLOBSTAR=Symbol("globstar **");Ur.minimatch.GLOBSTAR=Ur.GLOBSTAR;var VOt="[^/]",POt=VOt+"*?",HOt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",MOt="(?:(?!(?:\\/|^)\\.).)*?",UOt=(t,e={})=>r=>(0,Ur.minimatch)(r,t,e);Ur.filter=UOt;Ur.minimatch.filter=Ur.filter;var Mm=(t,e={})=>Object.assign({},t,e),YOt=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Ur.minimatch;let e=Ur.minimatch;return Object.assign((n,i,a={})=>e(n,i,Mm(t,a)),{Minimatch:class extends e.Minimatch{constructor(i,a={}){super(i,Mm(t,a))}static defaults(i){return e.defaults(Mm(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,a,s={}){super(i,a,Mm(t,s))}static fromGlob(i,a={}){return e.AST.fromGlob(i,Mm(t,a))}},unescape:(n,i={})=>e.unescape(n,Mm(t,i)),escape:(n,i={})=>e.escape(n,Mm(t,i)),filter:(n,i={})=>e.filter(n,Mm(t,i)),defaults:n=>e.defaults(Mm(t,n)),makeRe:(n,i={})=>e.makeRe(n,Mm(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,Mm(t,i)),match:(n,i,a={})=>e.match(n,i,Mm(t,a)),sep:e.sep,GLOBSTAR:Ur.GLOBSTAR})};Ur.defaults=YOt;Ur.minimatch.defaults=Ur.defaults;var jOt=(t,e={})=>((0,_P.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,yOt.default)(t));Ur.braceExpand=jOt;Ur.minimatch.braceExpand=Ur.braceExpand;var XOt=(t,e={})=>new wI(t,e).makeRe();Ur.makeRe=XOt;Ur.minimatch.makeRe=Ur.makeRe;var qOt=(t,e,r={})=>{let n=new wI(e,r);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};Ur.match=qOt;Ur.minimatch.match=Ur.match;var yNe=/[?*]|[+@!]\(.*?\)|\[|\]/,zOt=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c1,SNe,Gie,bE,wI=class{constructor(e,r={}){Be(this,c1);Et(this,"options");Et(this,"set");Et(this,"pattern");Et(this,"windowsPathsNoEscape");Et(this,"nonegate");Et(this,"negate");Et(this,"comment");Et(this,"empty");Et(this,"preserveMultipleSlashes");Et(this,"partial");Et(this,"globSet");Et(this,"globParts");Et(this,"nocase");Et(this,"isWindows");Et(this,"platform");Et(this,"windowsNoMagicRoot");Et(this,"maxGlobstarRecursion");Et(this,"regexp");(0,_P.assertValidPattern)(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||INe,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...a)=>console.error(...a)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(a=>this.slashSplit(a));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((a,s,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=a[0]===""&&a[1]===""&&(a[2]==="?"||!yNe.test(a[2]))&&!yNe.test(a[3]),l=/^[a-z]:/i.test(a[0]);if(u)return[...a.slice(0,4),...a.slice(4).map(f=>this.parse(f))];if(l)return[a[0],...a.slice(1).map(f=>this.parse(f))]}return a.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(a=>a.indexOf(!1)===-1),this.isWindows)for(let a=0;a<this.set.length;a++){let s=this.set[a];s[0]===""&&s[1]===""&&this.globParts[a][2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3])&&(s[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,i)=>{let a=n[n.length-1];return i==="**"&&a==="**"?n:i===".."&&a&&a!==".."&&a!=="."&&a!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let a=e[i];i===1&&a===""&&e[0]===""||(a==="."||a==="")&&(r=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,e.splice(n-1,2),n-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let s=i;for(;n[s+1]==="**";)s++;s>i&&n.splice(i+1,s-i);let o=n[i+1],u=n[i+2],l=n[i+3];if(o!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;r=!0,n.splice(i,1);let f=n.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let s=1;s<n.length-1;s++){let o=n[s];s===1&&o===""&&n[0]===""||(o==="."||o==="")&&(r=!0,n.splice(s,1),s--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let a=0;for(;(a=n.indexOf("..",a+1))!==-1;){let s=n[a-1];if(s&&s!=="."&&s!==".."&&s!=="**"){r=!0;let u=a===1&&n[a+1]==="**"?["."]:[];n.splice(a-1,2,...u),n.length===0&&n.push(""),a-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let n=r+1;n<e.length;n++){let i=this.partsMatch(e[r],e[n],!this.preserveMultipleSlashes);if(i){e[r]=[],e[n]=i;break}}return e.filter(r=>r.length)}partsMatch(e,r,n=!1){let i=0,a=0,s=[],o="";for(;i<e.length&&a<r.length;)if(e[i]===r[a])s.push(o==="b"?r[a]:e[i]),i++,a++;else if(n&&e[i]==="**"&&r[a]===e[i+1])s.push(e[i]),i++;else if(n&&r[a]==="**"&&e[i]===r[a+1])s.push(r[a]),a++;else if(e[i]==="*"&&r[a]&&(this.options.dot||!r[a].startsWith("."))&&r[a]!=="**"){if(o==="b")return!1;o="a",s.push(e[i]),i++,a++}else if(r[a]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(o==="a")return!1;o="b",s.push(r[a]),i++,a++}else return!1;return e.length===r.length&&s}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=e.slice(n)),this.negate=r}matchOne(e,r,n=!1){let i=0,a=0;if(this.isWindows){let o=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),u=!o&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),l=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),f=!l&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),h=u?3:o?0:void 0,g=f?3:l?0:void 0;if(typeof h=="number"&&typeof g=="number"){let[_,w]=[e[h],r[g]];_.toLowerCase()===w.toLowerCase()&&(r[g]=_,a=g,i=h)}}let{optimizationLevel:s=1}=this.options;return s>=2&&(e=this.levelTwoFileOptimize(e)),r.includes(Ur.GLOBSTAR)?he(this,c1,SNe).call(this,e,r,n,i,a):he(this,c1,bE).call(this,e,r,n,i,a)}braceExpand(){return(0,Ur.braceExpand)(this.pattern,this.options)}parse(e){(0,_P.assertValidPattern)(e);let r=this.options;if(e==="**")return Ur.GLOBSTAR;if(e==="")return"";let n,i=null;(n=e.match(DOt))?i=r.dot?FOt:GOt:(n=e.match(IOt))?i=(r.nocase?r.dot?wOt:xOt:r.dot?EOt:SOt)(n[1]):(n=e.match(OOt))?i=(r.nocase?r.dot?ZOt:kOt:r.dot?LOt:WOt)(n):(n=e.match(AOt))?i=r.dot?TOt:ROt:(n=e.match(BOt))&&(i=NOt);let a=bNe.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:i}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?POt:r.dot?HOt:MOt,i=new Set(r.nocase?["i"]:[]),a=e.map(u=>{let l=u.map(f=>{if(f instanceof RegExp)for(let h of f.flags.split(""))i.add(h);return typeof f=="string"?zOt(f):f===Ur.GLOBSTAR?Ur.GLOBSTAR:f._src});return l.forEach((f,h)=>{let g=l[h+1],_=l[h-1];f!==Ur.GLOBSTAR||_===Ur.GLOBSTAR||(_===void 0?g!==void 0&&g!==Ur.GLOBSTAR?l[h+1]="(?:\\/|"+n+"\\/)?"+g:l[h]=n:g===void 0?l[h-1]=_+"(?:\\/|"+n+")?":g!==Ur.GLOBSTAR&&(l[h-1]=_+"(?:\\/|\\/"+n+"\\/)"+g,l[h+1]=Ur.GLOBSTAR))}),l.filter(f=>f!==Ur.GLOBSTAR).join("/")}).join("|"),[s,o]=e.length>1?["(?:",")"]:["",""];a="^"+s+a+o+"$",this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let a=this.set;this.debug(this.pattern,"set",a);let s=i[i.length-1];if(!s)for(let o=i.length-2;!s&&o>=0;o--)s=i[o];for(let o=0;o<a.length;o++){let u=a[o],l=i;if(n.matchBase&&u.length===1&&(l=[s]),this.matchOne(l,u,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Ur.minimatch.defaults(e).Minimatch}};c1=new WeakSet,SNe=function(e,r,n,i,a){let s=r.indexOf(Ur.GLOBSTAR,a),o=r.lastIndexOf(Ur.GLOBSTAR),[u,l,f]=n?[r.slice(a,s),r.slice(s+1),[]]:[r.slice(a,s),r.slice(s+1,o),r.slice(o+1)];if(u.length){let O=e.slice(i,i+u.length);if(!he(this,c1,bE).call(this,O,u,n,0,0))return!1;i+=u.length}let h=0;if(f.length){if(f.length+i>e.length)return!1;let O=e.length-f.length;if(he(this,c1,bE).call(this,e,f,n,O,0))h=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(O--,!he(this,c1,bE).call(this,e,f,n,O,0)))return!1;h=f.length+1}}if(!l.length){let O=!!h;for(let Z=i;Z<e.length-h;Z++){let X=String(e[Z]);if(O=!0,X==="."||X===".."||!this.options.dot&&X.startsWith("."))return!1}return n||O}let g=[[[],0]],_=g[0],w=0,T=[0];for(let O of l)O===Ur.GLOBSTAR?(T.push(w),_=[[],0],g.push(_)):(_[0].push(O),w++);let D=g.length-1,G=e.length-h;for(let O of g)O[1]=G-(T[D--]+O[0].length);return!!he(this,c1,Gie).call(this,e,g,i,0,n,0,!!h)},Gie=function(e,r,n,i,a,s,o){let u=r[i];if(!u){for(let h=n;h<e.length;h++){o=!0;let g=e[h];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1}return o}let[l,f]=u;for(;n<=f;){if(he(this,c1,bE).call(this,e.slice(0,n+l.length),l,a,n,0)&&s<this.maxGlobstarRecursion){let _=he(this,c1,Gie).call(this,e,r,n+l.length,i+1,a,s+1,o);if(_!==!1)return _}let g=e[n];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1;n++}return a||null},bE=function(e,r,n,i,a){let s,o,u,l;for(s=i,o=a,l=e.length,u=r.length;s<l&&o<u;s++,o++){this.debug("matchOne loop");let f=r[o],h=e[s];if(this.debug(r,f,h),f===!1||f===Ur.GLOBSTAR)return!1;let g;if(typeof f=="string"?(g=h===f,this.debug("string match",f,h,g)):(g=f.test(h),this.debug("pattern match",f,h,g)),!g)return!1}if(s===l&&o===u)return!0;if(s===l)return n;if(o===u)return s===l-1&&e[s]==="";throw new Error("wtf?")};Ur.Minimatch=wI;var KOt=Nie();Object.defineProperty(Ur,"AST",{enumerable:!0,get:function(){return KOt.AST}});var $Ot=Die();Object.defineProperty(Ur,"escape",{enumerable:!0,get:function(){return $Ot.escape}});var JOt=fP();Object.defineProperty(Ur,"unescape",{enumerable:!0,get:function(){return JOt.unescape}});Ur.minimatch.AST=bNe.AST;Ur.minimatch.Minimatch=wI;Ur.minimatch.escape=bOt.escape;Ur.minimatch.unescape=_Ot.unescape});var DNe=x(EP=>{"use strict";Object.defineProperty(EP,"__esModule",{value:!0});EP.LRUCache=void 0;var _E=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,RNe=new Set,Fie=typeof process=="object"&&process?process:{},TNe=(t,e,r,n)=>{typeof Fie.emitWarning=="function"?Fie.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},SP=globalThis.AbortController,ENe=globalThis.AbortSignal,xNe;if(typeof SP>"u"){ENe=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},SP=class{constructor(){e()}signal=new ENe;abort(n){var i,a;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);(a=(i=this.signal).onabort)==null||a.call(i,n)}}};let t=((xNe=Fie.env)==null?void 0:xNe.LRU_CACHE_IGNORE_AC_WARNING)!=="1",e=()=>{t&&(t=!1,TNe("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var QOt=t=>!RNe.has(t),R_=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),BNe=t=>R_(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?CE:null:null,CE=class extends Array{constructor(e){super(e),this.fill(0)}},Oie=class t{heap;length;static#e=!1;static create(e){let r=BNe(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},wNe,ANe,w2,d1,A2,R2,IE,SE,Kl,T2,Cl,mo,ai,Mp,f1,Bf,Vc,B2,Pc,N2,D2,p1,G2,D_,Up,Ir,Zie,AI,L6,dN,h1,NNe,RI,EE,fN,T_,B_,Lie,CP,IP,ho,Wie,cN,N_,Vie,Pie=class Pie{constructor(e){Be(this,Ir);Be(this,w2);Be(this,d1);Be(this,A2);Be(this,R2);Be(this,IE);Be(this,SE);Et(this,"ttl");Et(this,"ttlResolution");Et(this,"ttlAutopurge");Et(this,"updateAgeOnGet");Et(this,"updateAgeOnHas");Et(this,"allowStale");Et(this,"noDisposeOnSet");Et(this,"noUpdateTTL");Et(this,"maxEntrySize");Et(this,"sizeCalculation");Et(this,"noDeleteOnFetchRejection");Et(this,"noDeleteOnStaleGet");Et(this,"allowStaleOnFetchAbort");Et(this,"allowStaleOnFetchRejection");Et(this,"ignoreFetchAbort");Be(this,Kl);Be(this,T2);Be(this,Cl);Be(this,mo);Be(this,ai);Be(this,Mp);Be(this,f1);Be(this,Bf);Be(this,Vc);Be(this,B2);Be(this,Pc);Be(this,N2);Be(this,D2);Be(this,p1);Be(this,G2);Be(this,D_);Be(this,Up);Be(this,AI,()=>{});Be(this,L6,()=>{});Be(this,dN,()=>{});Be(this,h1,()=>!1);Be(this,RI,e=>{});Be(this,EE,(e,r,n)=>{});Be(this,fN,(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Et(this,wNe,"LRUCache");let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:u,dispose:l,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:g,maxSize:_=0,maxEntrySize:w=0,sizeCalculation:T,fetchMethod:D,memoMethod:G,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:Z,allowStaleOnFetchRejection:X,allowStaleOnFetchAbort:ue,ignoreFetchAbort:Q}=e;if(r!==0&&!R_(r))throw new TypeError("max option must be a nonnegative integer");let ie=r?BNe(r):Array;if(!ie)throw new Error("invalid max value: "+r);if(de(this,w2,r),de(this,d1,_),this.maxEntrySize=w||I(this,d1),this.sizeCalculation=T,this.sizeCalculation){if(!I(this,d1)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(G!==void 0&&typeof G!="function")throw new TypeError("memoMethod must be a function if defined");if(de(this,SE,G),D!==void 0&&typeof D!="function")throw new TypeError("fetchMethod must be a function if specified");if(de(this,IE,D),de(this,D_,!!D),de(this,Cl,new Map),de(this,mo,new Array(r).fill(void 0)),de(this,ai,new Array(r).fill(void 0)),de(this,Mp,new ie(r)),de(this,f1,new ie(r)),de(this,Bf,0),de(this,Vc,0),de(this,B2,Oie.create(r)),de(this,Kl,0),de(this,T2,0),typeof l=="function"&&de(this,A2,l),typeof f=="function"?(de(this,R2,f),de(this,Pc,[])):(de(this,R2,void 0),de(this,Pc,void 0)),de(this,G2,!!I(this,A2)),de(this,Up,!!I(this,R2)),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!X,this.allowStaleOnFetchAbort=!!ue,this.ignoreFetchAbort=!!Q,this.maxEntrySize!==0){if(I(this,d1)!==0&&!R_(I(this,d1)))throw new TypeError("maxSize must be a positive integer if specified");if(!R_(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");he(this,Ir,NNe).call(this)}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!Z,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=R_(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=n||0,this.ttl){if(!R_(this.ttl))throw new TypeError("ttl must be a positive integer if specified");he(this,Ir,Zie).call(this)}if(I(this,w2)===0&&this.ttl===0&&I(this,d1)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!I(this,w2)&&!I(this,d1)){let M="LRU_CACHE_UNBOUNDED";QOt(M)&&(RNe.add(M),TNe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,Pie))}}static unsafeExposeInternals(e){return{starts:I(e,D2),ttls:I(e,p1),sizes:I(e,N2),keyMap:I(e,Cl),keyList:I(e,mo),valList:I(e,ai),next:I(e,Mp),prev:I(e,f1),get head(){return I(e,Bf)},get tail(){return I(e,Vc)},free:I(e,B2),isBackgroundFetch:r=>{var n;return he(n=e,Ir,ho).call(n,r)},backgroundFetch:(r,n,i,a)=>{var s;return he(s=e,Ir,IP).call(s,r,n,i,a)},moveToTail:r=>{var n;return he(n=e,Ir,cN).call(n,r)},indexes:r=>{var n;return he(n=e,Ir,T_).call(n,r)},rindexes:r=>{var n;return he(n=e,Ir,B_).call(n,r)},isStale:r=>{var n;return I(n=e,h1).call(n,r)}}}get max(){return I(this,w2)}get maxSize(){return I(this,d1)}get calculatedSize(){return I(this,T2)}get size(){return I(this,Kl)}get fetchMethod(){return I(this,IE)}get memoMethod(){return I(this,SE)}get dispose(){return I(this,A2)}get disposeAfter(){return I(this,R2)}getRemainingTTL(e){return I(this,Cl).has(e)?1/0:0}*entries(){for(let e of he(this,Ir,T_).call(this))I(this,ai)[e]!==void 0&&I(this,mo)[e]!==void 0&&!he(this,Ir,ho).call(this,I(this,ai)[e])&&(yield[I(this,mo)[e],I(this,ai)[e]])}*rentries(){for(let e of he(this,Ir,B_).call(this))I(this,ai)[e]!==void 0&&I(this,mo)[e]!==void 0&&!he(this,Ir,ho).call(this,I(this,ai)[e])&&(yield[I(this,mo)[e],I(this,ai)[e]])}*keys(){for(let e of he(this,Ir,T_).call(this)){let r=I(this,mo)[e];r!==void 0&&!he(this,Ir,ho).call(this,I(this,ai)[e])&&(yield r)}}*rkeys(){for(let e of he(this,Ir,B_).call(this)){let r=I(this,mo)[e];r!==void 0&&!he(this,Ir,ho).call(this,I(this,ai)[e])&&(yield r)}}*values(){for(let e of he(this,Ir,T_).call(this))I(this,ai)[e]!==void 0&&!he(this,Ir,ho).call(this,I(this,ai)[e])&&(yield I(this,ai)[e])}*rvalues(){for(let e of he(this,Ir,B_).call(this))I(this,ai)[e]!==void 0&&!he(this,Ir,ho).call(this,I(this,ai)[e])&&(yield I(this,ai)[e])}[(ANe=Symbol.iterator,wNe=Symbol.toStringTag,ANe)](){return this.entries()}find(e,r={}){for(let n of he(this,Ir,T_).call(this)){let i=I(this,ai)[n],a=he(this,Ir,ho).call(this,i)?i.__staleWhileFetching:i;if(a!==void 0&&e(a,I(this,mo)[n],this))return this.get(I(this,mo)[n],r)}}forEach(e,r=this){for(let n of he(this,Ir,T_).call(this)){let i=I(this,ai)[n],a=he(this,Ir,ho).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(r,a,I(this,mo)[n],this)}}rforEach(e,r=this){for(let n of he(this,Ir,B_).call(this)){let i=I(this,ai)[n],a=he(this,Ir,ho).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(r,a,I(this,mo)[n],this)}}purgeStale(){let e=!1;for(let r of he(this,Ir,B_).call(this,{allowStale:!0}))I(this,h1).call(this,r)&&(he(this,Ir,N_).call(this,I(this,mo)[r],"expire"),e=!0);return e}info(e){let r=I(this,Cl).get(e);if(r===void 0)return;let n=I(this,ai)[r],i=he(this,Ir,ho).call(this,n)?n.__staleWhileFetching:n;if(i===void 0)return;let a={value:i};if(I(this,p1)&&I(this,D2)){let s=I(this,p1)[r],o=I(this,D2)[r];if(s&&o){let u=s-(_E.now()-o);a.ttl=u,a.start=Date.now()}}return I(this,N2)&&(a.size=I(this,N2)[r]),a}dump(){let e=[];for(let r of he(this,Ir,T_).call(this,{allowStale:!0})){let n=I(this,mo)[r],i=I(this,ai)[r],a=he(this,Ir,ho).call(this,i)?i.__staleWhileFetching:i;if(a===void 0||n===void 0)continue;let s={value:a};if(I(this,p1)&&I(this,D2)){s.ttl=I(this,p1)[r];let o=_E.now()-I(this,D2)[r];s.start=Math.floor(Date.now()-o)}I(this,N2)&&(s.size=I(this,N2)[r]),e.unshift([n,s])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=_E.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){var g,_,w,T,D;if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:a,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:u}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,f=I(this,fN).call(this,e,r,n.size||0,o);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),he(this,Ir,N_).call(this,e,"set"),this;let h=I(this,Kl)===0?void 0:I(this,Cl).get(e);if(h===void 0)h=I(this,Kl)===0?I(this,Vc):I(this,B2).length!==0?I(this,B2).pop():I(this,Kl)===I(this,w2)?he(this,Ir,CP).call(this,!1):I(this,Kl),I(this,mo)[h]=e,I(this,ai)[h]=r,I(this,Cl).set(e,h),I(this,Mp)[I(this,Vc)]=h,I(this,f1)[h]=I(this,Vc),de(this,Vc,h),R9(this,Kl)._++,I(this,EE).call(this,h,f,u),u&&(u.set="add"),l=!1;else{he(this,Ir,cN).call(this,h);let G=I(this,ai)[h];if(r!==G){if(I(this,D_)&&he(this,Ir,ho).call(this,G)){G.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:O}=G;O!==void 0&&!s&&(I(this,G2)&&((g=I(this,A2))==null||g.call(this,O,e,"set")),I(this,Up)&&((_=I(this,Pc))==null||_.push([O,e,"set"])))}else s||(I(this,G2)&&((w=I(this,A2))==null||w.call(this,G,e,"set")),I(this,Up)&&((T=I(this,Pc))==null||T.push([G,e,"set"])));if(I(this,RI).call(this,h),I(this,EE).call(this,h,f,u),I(this,ai)[h]=r,u){u.set="replace";let O=G&&he(this,Ir,ho).call(this,G)?G.__staleWhileFetching:G;O!==void 0&&(u.oldValue=O)}}else u&&(u.set="update")}if(i!==0&&!I(this,p1)&&he(this,Ir,Zie).call(this),I(this,p1)&&(l||I(this,dN).call(this,h,i,a),u&&I(this,L6).call(this,u,h)),!s&&I(this,Up)&&I(this,Pc)){let G=I(this,Pc),O;for(;O=G==null?void 0:G.shift();)(D=I(this,R2))==null||D.call(this,...O)}return this}pop(){var e;try{for(;I(this,Kl);){let r=I(this,ai)[I(this,Bf)];if(he(this,Ir,CP).call(this,!0),he(this,Ir,ho).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(I(this,Up)&&I(this,Pc)){let r=I(this,Pc),n;for(;n=r==null?void 0:r.shift();)(e=I(this,R2))==null||e.call(this,...n)}}}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,a=I(this,Cl).get(e);if(a!==void 0){let s=I(this,ai)[a];if(he(this,Ir,ho).call(this,s)&&s.__staleWhileFetching===void 0)return!1;if(I(this,h1).call(this,a))i&&(i.has="stale",I(this,L6).call(this,i,a));else return n&&I(this,AI).call(this,a),i&&(i.has="hit",I(this,L6).call(this,i,a)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=I(this,Cl).get(e);if(i===void 0||!n&&I(this,h1).call(this,i))return;let a=I(this,ai)[i];return he(this,Ir,ho).call(this,a)?a.__staleWhileFetching:a}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:T,forceRefresh:D=!1,status:G,signal:O}=r;if(!I(this,D_))return G&&(G.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:G});let Z={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:s,noDisposeOnSet:o,size:u,sizeCalculation:l,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:w,ignoreFetchAbort:_,status:G,signal:O},X=I(this,Cl).get(e);if(X===void 0){G&&(G.fetch="miss");let ue=he(this,Ir,IP).call(this,e,X,Z,T);return ue.__returned=ue}else{let ue=I(this,ai)[X];if(he(this,Ir,ho).call(this,ue)){let Te=n&&ue.__staleWhileFetching!==void 0;return G&&(G.fetch="inflight",Te&&(G.returnedStale=!0)),Te?ue.__staleWhileFetching:ue.__returned=ue}let Q=I(this,h1).call(this,X);if(!D&&!Q)return G&&(G.fetch="hit"),he(this,Ir,cN).call(this,X),i&&I(this,AI).call(this,X),G&&I(this,L6).call(this,G,X),ue;let ie=he(this,Ir,IP).call(this,e,X,Z,T),ne=ie.__staleWhileFetching!==void 0&&n;return G&&(G.fetch=Q?"stale":"refresh",ne&&Q&&(G.returnedStale=!0)),ne?ie.__staleWhileFetching:ie.__returned=ie}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=I(this,SE);if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:a,...s}=r,o=this.get(e,s);if(!a&&o!==void 0)return o;let u=n(e,o,{options:s,context:i});return this.set(e,u,s),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:s}=r,o=I(this,Cl).get(e);if(o!==void 0){let u=I(this,ai)[o],l=he(this,Ir,ho).call(this,u);return s&&I(this,L6).call(this,s,o),I(this,h1).call(this,o)?(s&&(s.get="stale"),l?(s&&n&&u.__staleWhileFetching!==void 0&&(s.returnedStale=!0),n?u.__staleWhileFetching:void 0):(a||he(this,Ir,N_).call(this,e,"expire"),s&&n&&(s.returnedStale=!0),n?u:void 0)):(s&&(s.get="hit"),l?u.__staleWhileFetching:(he(this,Ir,cN).call(this,o),i&&I(this,AI).call(this,o),u))}else s&&(s.get="miss")}delete(e){return he(this,Ir,N_).call(this,e,"delete")}clear(){return he(this,Ir,Vie).call(this,"delete")}};w2=new WeakMap,d1=new WeakMap,A2=new WeakMap,R2=new WeakMap,IE=new WeakMap,SE=new WeakMap,Kl=new WeakMap,T2=new WeakMap,Cl=new WeakMap,mo=new WeakMap,ai=new WeakMap,Mp=new WeakMap,f1=new WeakMap,Bf=new WeakMap,Vc=new WeakMap,B2=new WeakMap,Pc=new WeakMap,N2=new WeakMap,D2=new WeakMap,p1=new WeakMap,G2=new WeakMap,D_=new WeakMap,Up=new WeakMap,Ir=new WeakSet,Zie=function(){let e=new CE(I(this,w2)),r=new CE(I(this,w2));de(this,p1,e),de(this,D2,r),de(this,dN,(a,s,o=_E.now())=>{if(r[a]=s!==0?o:0,e[a]=s,s!==0&&this.ttlAutopurge){let u=setTimeout(()=>{I(this,h1).call(this,a)&&he(this,Ir,N_).call(this,I(this,mo)[a],"expire")},s+1);u.unref&&u.unref()}}),de(this,AI,a=>{r[a]=e[a]!==0?_E.now():0}),de(this,L6,(a,s)=>{if(e[s]){let o=e[s],u=r[s];if(!o||!u)return;a.ttl=o,a.start=u,a.now=n||i();let l=a.now-u;a.remainingTTL=o-l}});let n=0,i=()=>{let a=_E.now();if(this.ttlResolution>0){n=a;let s=setTimeout(()=>n=0,this.ttlResolution);s.unref&&s.unref()}return a};this.getRemainingTTL=a=>{let s=I(this,Cl).get(a);if(s===void 0)return 0;let o=e[s],u=r[s];if(!o||!u)return 1/0;let l=(n||i())-u;return o-l},de(this,h1,a=>{let s=r[a],o=e[a];return!!o&&!!s&&(n||i())-s>o})},AI=new WeakMap,L6=new WeakMap,dN=new WeakMap,h1=new WeakMap,NNe=function(){let e=new CE(I(this,w2));de(this,T2,0),de(this,N2,e),de(this,RI,r=>{de(this,T2,I(this,T2)-e[r]),e[r]=0}),de(this,fN,(r,n,i,a)=>{if(he(this,Ir,ho).call(this,n))return 0;if(!R_(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(n,r),!R_(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),de(this,EE,(r,n,i)=>{if(e[r]=n,I(this,d1)){let a=I(this,d1)-e[r];for(;I(this,T2)>a;)he(this,Ir,CP).call(this,!0)}de(this,T2,I(this,T2)+e[r]),i&&(i.entrySize=n,i.totalCalculatedSize=I(this,T2))})},RI=new WeakMap,EE=new WeakMap,fN=new WeakMap,T_=function*({allowStale:e=this.allowStale}={}){if(I(this,Kl))for(let r=I(this,Vc);!(!he(this,Ir,Lie).call(this,r)||((e||!I(this,h1).call(this,r))&&(yield r),r===I(this,Bf)));)r=I(this,f1)[r]},B_=function*({allowStale:e=this.allowStale}={}){if(I(this,Kl))for(let r=I(this,Bf);!(!he(this,Ir,Lie).call(this,r)||((e||!I(this,h1).call(this,r))&&(yield r),r===I(this,Vc)));)r=I(this,Mp)[r]},Lie=function(e){return e!==void 0&&I(this,Cl).get(I(this,mo)[e])===e},CP=function(e){var a,s;let r=I(this,Bf),n=I(this,mo)[r],i=I(this,ai)[r];return I(this,D_)&&he(this,Ir,ho).call(this,i)?i.__abortController.abort(new Error("evicted")):(I(this,G2)||I(this,Up))&&(I(this,G2)&&((a=I(this,A2))==null||a.call(this,i,n,"evict")),I(this,Up)&&((s=I(this,Pc))==null||s.push([i,n,"evict"]))),I(this,RI).call(this,r),e&&(I(this,mo)[r]=void 0,I(this,ai)[r]=void 0,I(this,B2).push(r)),I(this,Kl)===1?(de(this,Bf,de(this,Vc,0)),I(this,B2).length=0):de(this,Bf,I(this,Mp)[r]),I(this,Cl).delete(n),R9(this,Kl)._--,r},IP=function(e,r,n,i){let a=r===void 0?void 0:I(this,ai)[r];if(he(this,Ir,ho).call(this,a))return a;let s=new SP,{signal:o}=n;o==null||o.addEventListener("abort",()=>s.abort(o.reason),{signal:s.signal});let u={signal:s.signal,options:n,context:i},l=(T,D=!1)=>{let{aborted:G}=s.signal,O=n.ignoreFetchAbort&&T!==void 0;if(n.status&&(G&&!D?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,O&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),G&&!O&&!D)return h(s.signal.reason);let Z=_;return I(this,ai)[r]===_&&(T===void 0?Z.__staleWhileFetching?I(this,ai)[r]=Z.__staleWhileFetching:he(this,Ir,N_).call(this,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,T,u.options))),T},f=T=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=T),h(T)),h=T=>{let{aborted:D}=s.signal,G=D&&n.allowStaleOnFetchAbort,O=G||n.allowStaleOnFetchRejection,Z=O||n.noDeleteOnFetchRejection,X=_;if(I(this,ai)[r]===_&&(!Z||X.__staleWhileFetching===void 0?he(this,Ir,N_).call(this,e,"fetch"):G||(I(this,ai)[r]=X.__staleWhileFetching)),O)return n.status&&X.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),X.__staleWhileFetching;if(X.__returned===X)throw T},g=(T,D)=>{var O;let G=(O=I(this,IE))==null?void 0:O.call(this,e,a,u);G&&G instanceof Promise&&G.then(Z=>T(Z===void 0?void 0:Z),D),s.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(T(void 0),n.allowStaleOnFetchAbort&&(T=Z=>l(Z,!0)))})};n.status&&(n.status.fetchDispatched=!0);let _=new Promise(g).then(l,f),w=Object.assign(_,{__abortController:s,__staleWhileFetching:a,__returned:void 0});return r===void 0?(this.set(e,w,{...u.options,status:void 0}),r=I(this,Cl).get(e)):I(this,ai)[r]=w,w},ho=function(e){if(!I(this,D_))return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof SP},Wie=function(e,r){I(this,f1)[r]=e,I(this,Mp)[e]=r},cN=function(e){e!==I(this,Vc)&&(e===I(this,Bf)?de(this,Bf,I(this,Mp)[e]):he(this,Ir,Wie).call(this,I(this,f1)[e],I(this,Mp)[e]),he(this,Ir,Wie).call(this,I(this,Vc),e),de(this,Vc,e))},N_=function(e,r){var i,a,s,o;let n=!1;if(I(this,Kl)!==0){let u=I(this,Cl).get(e);if(u!==void 0)if(n=!0,I(this,Kl)===1)he(this,Ir,Vie).call(this,r);else{I(this,RI).call(this,u);let l=I(this,ai)[u];if(he(this,Ir,ho).call(this,l)?l.__abortController.abort(new Error("deleted")):(I(this,G2)||I(this,Up))&&(I(this,G2)&&((i=I(this,A2))==null||i.call(this,l,e,r)),I(this,Up)&&((a=I(this,Pc))==null||a.push([l,e,r]))),I(this,Cl).delete(e),I(this,mo)[u]=void 0,I(this,ai)[u]=void 0,u===I(this,Vc))de(this,Vc,I(this,f1)[u]);else if(u===I(this,Bf))de(this,Bf,I(this,Mp)[u]);else{let f=I(this,f1)[u];I(this,Mp)[f]=I(this,Mp)[u];let h=I(this,Mp)[u];I(this,f1)[h]=I(this,f1)[u]}R9(this,Kl)._--,I(this,B2).push(u)}}if(I(this,Up)&&((s=I(this,Pc))!=null&&s.length)){let u=I(this,Pc),l;for(;l=u==null?void 0:u.shift();)(o=I(this,R2))==null||o.call(this,...l)}return n},Vie=function(e){var r,n,i;for(let a of he(this,Ir,B_).call(this,{allowStale:!0})){let s=I(this,ai)[a];if(he(this,Ir,ho).call(this,s))s.__abortController.abort(new Error("deleted"));else{let o=I(this,mo)[a];I(this,G2)&&((r=I(this,A2))==null||r.call(this,s,o,e)),I(this,Up)&&((n=I(this,Pc))==null||n.push([s,o,e]))}}if(I(this,Cl).clear(),I(this,ai).fill(void 0),I(this,mo).fill(void 0),I(this,p1)&&I(this,D2)&&(I(this,p1).fill(0),I(this,D2).fill(0)),I(this,N2)&&I(this,N2).fill(0),de(this,Bf,0),de(this,Vc,0),I(this,B2).length=0,de(this,T2,0),de(this,Kl,0),I(this,Up)&&I(this,Pc)){let a=I(this,Pc),s;for(;s=a==null?void 0:a.shift();)(i=I(this,R2))==null||i.call(this,...s)}};var kie=Pie;EP.LRUCache=kie});var zie=x(jp=>{"use strict";var ekt=jp&&jp.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jp,"__esModule",{value:!0});jp.Minipass=jp.isWritable=jp.isReadable=jp.isStream=void 0;var GNe=typeof process=="object"&&process?process:{stdout:null,stderr:null},qie=require("events"),ZNe=ekt(require("stream")),tkt=require("string_decoder"),rkt=t=>!!t&&typeof t=="object"&&(t instanceof NP||t instanceof ZNe.default||(0,jp.isReadable)(t)||(0,jp.isWritable)(t));jp.isStream=rkt;var nkt=t=>!!t&&typeof t=="object"&&t instanceof qie.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==ZNe.default.Writable.prototype.pipe;jp.isReadable=nkt;var ikt=t=>!!t&&typeof t=="object"&&t instanceof qie.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";jp.isWritable=ikt;var W6=Symbol("EOF"),V6=Symbol("maybeEmitEnd"),G_=Symbol("emittedEnd"),xP=Symbol("emittingEnd"),pN=Symbol("emittedError"),wP=Symbol("closed"),FNe=Symbol("read"),AP=Symbol("flush"),ONe=Symbol("flushChunk"),F2=Symbol("encoding"),xE=Symbol("decoder"),Hc=Symbol("flowing"),hN=Symbol("paused"),wE=Symbol("resume"),Mc=Symbol("buffer"),Yp=Symbol("pipes"),Uc=Symbol("bufferLength"),Hie=Symbol("bufferPush"),RP=Symbol("bufferShift"),Nf=Symbol("objectMode"),Uu=Symbol("destroyed"),Mie=Symbol("error"),Uie=Symbol("emitData"),kNe=Symbol("emitEnd"),Yie=Symbol("emitEnd2"),Ny=Symbol("async"),jie=Symbol("abort"),TP=Symbol("aborted"),mN=Symbol("signal"),TI=Symbol("dataListeners"),m1=Symbol("discarded"),gN=t=>Promise.resolve().then(t),akt=t=>t(),skt=t=>t==="end"||t==="finish"||t==="prefinish",okt=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,ukt=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),BP=class{src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[wE](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Xie=class extends BP{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}},lkt=t=>!!t.objectMode,ckt=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",NP=class extends qie.EventEmitter{[Hc]=!1;[hN]=!1;[Yp]=[];[Mc]=[];[Nf];[F2];[Ny];[xE];[W6]=!1;[G_]=!1;[xP]=!1;[wP]=!1;[pN]=null;[Uc]=0;[Uu]=!1;[mN];[TP]=!1;[TI]=0;[m1]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");lkt(r)?(this[Nf]=!0,this[F2]=null):ckt(r)?(this[F2]=r.encoding,this[Nf]=!1):(this[Nf]=!1,this[F2]=null),this[Ny]=!!r.async,this[xE]=this[F2]?new tkt.StringDecoder(this[F2]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Mc]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Yp]});let{signal:n}=r;n&&(this[mN]=n,n.aborted?this[jie]():n.addEventListener("abort",()=>this[jie]()))}get bufferLength(){return this[Uc]}get encoding(){return this[F2]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Nf]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Ny]}set async(e){this[Ny]=this[Ny]||!!e}[jie](){var e,r;this[TP]=!0,this.emit("abort",(e=this[mN])==null?void 0:e.reason),this.destroy((r=this[mN])==null?void 0:r.reason)}get aborted(){return this[TP]}set aborted(e){}write(e,r,n){var a;if(this[TP])return!1;if(this[W6])throw new Error("write after end");if(this[Uu])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[Ny]?gN:akt;if(!this[Nf]&&!Buffer.isBuffer(e)){if(ukt(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(okt(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Nf]?(this[Hc]&&this[Uc]!==0&&this[AP](!0),this[Hc]?this.emit("data",e):this[Hie](e),this[Uc]!==0&&this.emit("readable"),n&&i(n),this[Hc]):e.length?(typeof e=="string"&&!(r===this[F2]&&!((a=this[xE])!=null&&a.lastNeed))&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[F2]&&(e=this[xE].write(e)),this[Hc]&&this[Uc]!==0&&this[AP](!0),this[Hc]?this.emit("data",e):this[Hie](e),this[Uc]!==0&&this.emit("readable"),n&&i(n),this[Hc]):(this[Uc]!==0&&this.emit("readable"),n&&i(n),this[Hc])}read(e){if(this[Uu])return null;if(this[m1]=!1,this[Uc]===0||e===0||e&&e>this[Uc])return this[V6](),null;this[Nf]&&(e=null),this[Mc].length>1&&!this[Nf]&&(this[Mc]=[this[F2]?this[Mc].join(""):Buffer.concat(this[Mc],this[Uc])]);let r=this[FNe](e||null,this[Mc][0]);return this[V6](),r}[FNe](e,r){if(this[Nf])this[RP]();else{let n=r;e===n.length||e===null?this[RP]():typeof n=="string"?(this[Mc][0]=n.slice(e),r=n.slice(0,e),this[Uc]-=e):(this[Mc][0]=n.subarray(e),r=n.subarray(0,e),this[Uc]-=e)}return this.emit("data",r),!this[Mc].length&&!this[W6]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[W6]=!0,this.writable=!1,(this[Hc]||!this[hN])&&this[V6](),this}[wE](){this[Uu]||(!this[TI]&&!this[Yp].length&&(this[m1]=!0),this[hN]=!1,this[Hc]=!0,this.emit("resume"),this[Mc].length?this[AP]():this[W6]?this[V6]():this.emit("drain"))}resume(){return this[wE]()}pause(){this[Hc]=!1,this[hN]=!0,this[m1]=!1}get destroyed(){return this[Uu]}get flowing(){return this[Hc]}get paused(){return this[hN]}[Hie](e){this[Nf]?this[Uc]+=1:this[Uc]+=e.length,this[Mc].push(e)}[RP](){return this[Nf]?this[Uc]-=1:this[Uc]-=this[Mc][0].length,this[Mc].shift()}[AP](e=!1){do;while(this[ONe](this[RP]())&&this[Mc].length);!e&&!this[Mc].length&&!this[W6]&&this.emit("drain")}[ONe](e){return this.emit("data",e),this[Hc]}pipe(e,r){if(this[Uu])return e;this[m1]=!1;let n=this[G_];return r=r||{},e===GNe.stdout||e===GNe.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[Yp].push(r.proxyErrors?new Xie(this,e,r):new BP(this,e,r)),this[Ny]?gN(()=>this[wE]()):this[wE]()),e}unpipe(e){let r=this[Yp].find(n=>n.dest===e);r&&(this[Yp].length===1?(this[Hc]&&this[TI]===0&&(this[Hc]=!1),this[Yp]=[]):this[Yp].splice(this[Yp].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[m1]=!1,this[TI]++,!this[Yp].length&&!this[Hc]&&this[wE]();else if(e==="readable"&&this[Uc]!==0)super.emit("readable");else if(skt(e)&&this[G_])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[pN]){let i=r;this[Ny]?gN(()=>i.call(this,this[pN])):i.call(this,this[pN])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[TI]=this.listeners("data").length,this[TI]===0&&!this[m1]&&!this[Yp].length&&(this[Hc]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[TI]=0,!this[m1]&&!this[Yp].length&&(this[Hc]=!1)),r}get emittedEnd(){return this[G_]}[V6](){!this[xP]&&!this[G_]&&!this[Uu]&&this[Mc].length===0&&this[W6]&&(this[xP]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[wP]&&this.emit("close"),this[xP]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==Uu&&this[Uu])return!1;if(e==="data")return!this[Nf]&&!n?!1:this[Ny]?(gN(()=>this[Uie](n)),!0):this[Uie](n);if(e==="end")return this[kNe]();if(e==="close"){if(this[wP]=!0,!this[G_]&&!this[Uu])return!1;let a=super.emit("close");return this.removeAllListeners("close"),a}else if(e==="error"){this[pN]=n,super.emit(Mie,n);let a=!this[mN]||this.listeners("error").length?super.emit("error",n):!1;return this[V6](),a}else if(e==="resume"){let a=super.emit("resume");return this[V6](),a}else if(e==="finish"||e==="prefinish"){let a=super.emit(e);return this.removeAllListeners(e),a}let i=super.emit(e,...r);return this[V6](),i}[Uie](e){for(let n of this[Yp])n.dest.write(e)===!1&&this.pause();let r=this[m1]?!1:super.emit("data",e);return this[V6](),r}[kNe](){return this[G_]?!1:(this[G_]=!0,this.readable=!1,this[Ny]?(gN(()=>this[Yie]()),!0):this[Yie]())}[Yie](){if(this[xE]){let r=this[xE].end();if(r){for(let n of this[Yp])n.dest.write(r);this[m1]||super.emit("data",r)}}for(let r of this[Yp])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Nf]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[Nf]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[Nf])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[F2]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Uu,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[m1]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[W6])return r();let a,s,o=h=>{this.off("data",u),this.off("end",l),this.off(Uu,f),r(),s(h)},u=h=>{this.off("error",o),this.off("end",l),this.off(Uu,f),this.pause(),a({value:h,done:!!this[W6]})},l=()=>{this.off("error",o),this.off("data",u),this.off(Uu,f),r(),a({done:!0,value:void 0})},f=()=>o(new Error("stream destroyed"));return new Promise((h,g)=>{s=g,a=h,this.once(Uu,f),this.once("error",o),this.once("end",l),this.once("data",u)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[m1]=!1;let e=!1,r=()=>(this.pause(),this.off(Mie,r),this.off(Uu,r),this.off("end",r),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return r();let i=this.read();return i===null?r():{done:!1,value:i}};return this.once("end",r),this.once(Mie,r),this.once(Uu,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Uu])return e?this.emit("error",e):this.emit(Uu),this;this[Uu]=!0,this[m1]=!0,this[Mc].length=0,this[Uc]=0;let r=this;return typeof r.close=="function"&&!this[wP]&&r.close(),e?this.emit("error",e):this.emit(Uu),this}static get isStream(){return jp.isStream}};jp.Minipass=NP});var rDe=x(hs=>{"use strict";var dkt=hs&&hs.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fkt=hs&&hs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pkt=hs&&hs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&dkt(e,t,r);return fkt(e,t),e};Object.defineProperty(hs,"__esModule",{value:!0});hs.PathScurry=hs.Path=hs.PathScurryDarwin=hs.PathScurryPosix=hs.PathScurryWin32=hs.PathScurryBase=hs.PathPosix=hs.PathWin32=hs.PathBase=hs.ChildrenCache=hs.ResolveCache=void 0;var MNe=DNe(),WP=require("path"),hkt=require("url"),yN=require("fs"),mkt=pkt(require("fs")),gkt=yN.realpathSync.native,DP=require("fs/promises"),LNe=zie(),bN={lstatSync:yN.lstatSync,readdir:yN.readdir,readdirSync:yN.readdirSync,readlinkSync:yN.readlinkSync,realpathSync:gkt,promises:{lstat:DP.lstat,readdir:DP.readdir,readlink:DP.readlink,realpath:DP.realpath}},UNe=t=>!t||t===bN||t===mkt?bN:{...bN,...t,promises:{...bN.promises,...t.promises||{}}},YNe=/^\\\\\?\\([a-z]:)\\?$/i,vkt=t=>t.replace(/\//g,"\\").replace(YNe,"$1\\"),ykt=/[\\\/]/,Ym=0,jNe=1,XNe=2,Dy=4,qNe=6,zNe=8,BI=10,KNe=12,Um=15,vN=~Um,Kie=16,WNe=32,_N=64,O2=128,GP=256,OP=512,VNe=_N|O2|OP,bkt=1023,$ie=t=>t.isFile()?zNe:t.isDirectory()?Dy:t.isSymbolicLink()?BI:t.isCharacterDevice()?XNe:t.isBlockDevice()?qNe:t.isSocket()?KNe:t.isFIFO()?jNe:Ym,PNe=new Map,CN=t=>{let e=PNe.get(t);if(e)return e;let r=t.normalize("NFKD");return PNe.set(t,r),r},HNe=new Map,FP=t=>{let e=HNe.get(t);if(e)return e;let r=CN(t.toLowerCase());return HNe.set(t,r),r},EN=class extends MNe.LRUCache{constructor(){super({max:256})}};hs.ResolveCache=EN;var VP=class extends MNe.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}};hs.ChildrenCache=VP;var $Ne=Symbol("PathScurry setAsCwd"),Xp,BN,NN,DN,GN,FN,ON,kN,ZN,LN,WN,VN,PN,HN,MN,UN,YN,jN,XN,F_,NI,Gy,P6,H6,M6,ti,DI,U6,Fy,An,Jie,kP,IN,Qie,eae,SN,ZP,tae,rae,LP,JNe,QNe,eDe,nae,AE,RE,tDe,GI,Vd=class{constructor(e,r=Ym,n,i,a,s,o){Be(this,An);Et(this,"name");Et(this,"root");Et(this,"roots");Et(this,"parent");Et(this,"nocase");Et(this,"isCWD",!1);Be(this,Xp);Be(this,BN);Be(this,NN);Be(this,DN);Be(this,GN);Be(this,FN);Be(this,ON);Be(this,kN);Be(this,ZN);Be(this,LN);Be(this,WN);Be(this,VN);Be(this,PN);Be(this,HN);Be(this,MN);Be(this,UN);Be(this,YN);Be(this,jN);Be(this,XN);Be(this,F_);Be(this,NI);Be(this,Gy);Be(this,P6);Be(this,H6);Be(this,M6);Be(this,ti);Be(this,DI);Be(this,U6);Be(this,Fy);Be(this,AE,[]);Be(this,RE,!1);Be(this,GI);this.name=e,de(this,F_,a?FP(e):CN(e)),de(this,ti,r&bkt),this.nocase=a,this.roots=i,this.root=n||this,de(this,DI,s),de(this,Gy,o.fullpath),de(this,H6,o.relative),de(this,M6,o.relativePosix),this.parent=o.parent,this.parent?de(this,Xp,I(this.parent,Xp)):de(this,Xp,UNe(o.fs))}get dev(){return I(this,BN)}get mode(){return I(this,NN)}get nlink(){return I(this,DN)}get uid(){return I(this,GN)}get gid(){return I(this,FN)}get rdev(){return I(this,ON)}get blksize(){return I(this,kN)}get ino(){return I(this,ZN)}get size(){return I(this,LN)}get blocks(){return I(this,WN)}get atimeMs(){return I(this,VN)}get mtimeMs(){return I(this,PN)}get ctimeMs(){return I(this,HN)}get birthtimeMs(){return I(this,MN)}get atime(){return I(this,UN)}get mtime(){return I(this,YN)}get ctime(){return I(this,jN)}get birthtime(){return I(this,XN)}get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return I(this,NI)!==void 0?I(this,NI):this.parent?de(this,NI,this.parent.depth()+1):de(this,NI,0)}childrenCache(){return I(this,DI)}resolve(e){var s;if(!e)return this;let r=this.getRootString(e),i=e.substring(r.length).split(this.splitSep);return r?he(s=this.getRoot(r),An,Jie).call(s,i):he(this,An,Jie).call(this,i)}children(){let e=I(this,DI).get(this);if(e)return e;let r=Object.assign([],{provisional:0});return I(this,DI).set(this,r),de(this,ti,I(this,ti)&~Kie),r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?FP(e):CN(e);for(let u of n)if(I(u,F_)===i)return u;let a=this.parent?this.sep:"",s=I(this,Gy)?I(this,Gy)+a+e:void 0,o=this.newChild(e,Ym,{...r,parent:this,fullpath:s});return this.canReaddir()||de(o,ti,I(o,ti)|O2),n.push(o),o}relative(){if(this.isCWD)return"";if(I(this,H6)!==void 0)return I(this,H6);let e=this.name,r=this.parent;if(!r)return de(this,H6,this.name);let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(I(this,M6)!==void 0)return I(this,M6);let e=this.name,r=this.parent;if(!r)return de(this,M6,this.fullpathPosix());let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(I(this,Gy)!==void 0)return I(this,Gy);let e=this.name,r=this.parent;if(!r)return de(this,Gy,this.name);let i=r.fullpath()+(r.parent?this.sep:"")+e;return de(this,Gy,i)}fullpathPosix(){if(I(this,P6)!==void 0)return I(this,P6);if(this.sep==="/")return de(this,P6,this.fullpath());if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?de(this,P6,`//?/${i}`):de(this,P6,i)}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return de(this,P6,n)}isUnknown(){return(I(this,ti)&Um)===Ym}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(I(this,ti)&Um)===zNe}isDirectory(){return(I(this,ti)&Um)===Dy}isCharacterDevice(){return(I(this,ti)&Um)===XNe}isBlockDevice(){return(I(this,ti)&Um)===qNe}isFIFO(){return(I(this,ti)&Um)===jNe}isSocket(){return(I(this,ti)&Um)===KNe}isSymbolicLink(){return(I(this,ti)&BI)===BI}lstatCached(){return I(this,ti)&WNe?this:void 0}readlinkCached(){return I(this,U6)}realpathCached(){return I(this,Fy)}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(I(this,U6))return!0;if(!this.parent)return!1;let e=I(this,ti)&Um;return!(e!==Ym&&e!==BI||I(this,ti)&GP||I(this,ti)&O2)}calledReaddir(){return!!(I(this,ti)&Kie)}isENOENT(){return!!(I(this,ti)&O2)}isNamed(e){return this.nocase?I(this,F_)===FP(e):I(this,F_)===CN(e)}async readlink(){var r;let e=I(this,U6);if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await I(this,Xp).promises.readlink(this.fullpath()),i=(r=await this.parent.realpath())==null?void 0:r.resolve(n);if(i)return de(this,U6,i)}catch(n){he(this,An,rae).call(this,n.code);return}}readlinkSync(){var r;let e=I(this,U6);if(e)return e;if(this.canReadlink()&&this.parent)try{let n=I(this,Xp).readlinkSync(this.fullpath()),i=(r=this.parent.realpathSync())==null?void 0:r.resolve(n);if(i)return de(this,U6,i)}catch(n){he(this,An,rae).call(this,n.code);return}}async lstat(){if((I(this,ti)&O2)===0)try{return he(this,An,nae).call(this,await I(this,Xp).promises.lstat(this.fullpath())),this}catch(e){he(this,An,tae).call(this,e.code)}}lstatSync(){if((I(this,ti)&O2)===0)try{return he(this,An,nae).call(this,I(this,Xp).lstatSync(this.fullpath())),this}catch(e){he(this,An,tae).call(this,e.code)}}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let a=n.slice(0,n.provisional);r?e(null,a):queueMicrotask(()=>e(null,a));return}if(I(this,AE).push(e),I(this,RE))return;de(this,RE,!0);let i=this.fullpath();I(this,Xp).readdir(i,{withFileTypes:!0},(a,s)=>{if(a)he(this,An,ZP).call(this,a.code),n.provisional=0;else{for(let o of s)he(this,An,LP).call(this,o,n);he(this,An,kP).call(this,n)}he(this,An,tDe).call(this,n.slice(0,n.provisional))})}async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(I(this,GI))await I(this,GI);else{let n=()=>{};de(this,GI,new Promise(i=>n=i));try{for(let i of await I(this,Xp).promises.readdir(r,{withFileTypes:!0}))he(this,An,LP).call(this,i,e);he(this,An,kP).call(this,e)}catch(i){he(this,An,ZP).call(this,i.code),e.provisional=0}de(this,GI,void 0),n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let n of I(this,Xp).readdirSync(r,{withFileTypes:!0}))he(this,An,LP).call(this,n,e);he(this,An,kP).call(this,e)}catch(n){he(this,An,ZP).call(this,n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(I(this,ti)&VNe)return!1;let e=Um&I(this,ti);return e===Ym||e===Dy||e===BI}shouldWalk(e,r){return(I(this,ti)&Dy)===Dy&&!(I(this,ti)&VNe)&&!e.has(this)&&(!r||r(this))}async realpath(){if(I(this,Fy))return I(this,Fy);if(!((OP|GP|O2)&I(this,ti)))try{let e=await I(this,Xp).promises.realpath(this.fullpath());return de(this,Fy,this.resolve(e))}catch{he(this,An,eae).call(this)}}realpathSync(){if(I(this,Fy))return I(this,Fy);if(!((OP|GP|O2)&I(this,ti)))try{let e=I(this,Xp).realpathSync(this.fullpath());return de(this,Fy,this.resolve(e))}catch{he(this,An,eae).call(this)}}[$Ne](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],i=this;for(;i&&i.parent;)r.add(i),de(i,H6,n.join(this.sep)),de(i,M6,n.join("/")),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!r.has(i);)de(i,H6,void 0),de(i,M6,void 0),i=i.parent}};Xp=new WeakMap,BN=new WeakMap,NN=new WeakMap,DN=new WeakMap,GN=new WeakMap,FN=new WeakMap,ON=new WeakMap,kN=new WeakMap,ZN=new WeakMap,LN=new WeakMap,WN=new WeakMap,VN=new WeakMap,PN=new WeakMap,HN=new WeakMap,MN=new WeakMap,UN=new WeakMap,YN=new WeakMap,jN=new WeakMap,XN=new WeakMap,F_=new WeakMap,NI=new WeakMap,Gy=new WeakMap,P6=new WeakMap,H6=new WeakMap,M6=new WeakMap,ti=new WeakMap,DI=new WeakMap,U6=new WeakMap,Fy=new WeakMap,An=new WeakSet,Jie=function(e){let r=this;for(let n of e)r=r.child(n);return r},kP=function(e){var r;de(this,ti,I(this,ti)|Kie);for(let n=e.provisional;n<e.length;n++){let i=e[n];i&&he(r=i,An,IN).call(r)}},IN=function(){I(this,ti)&O2||(de(this,ti,(I(this,ti)|O2)&vN),he(this,An,Qie).call(this))},Qie=function(){var r;let e=this.children();e.provisional=0;for(let n of e)he(r=n,An,IN).call(r)},eae=function(){de(this,ti,I(this,ti)|OP),he(this,An,SN).call(this)},SN=function(){if(I(this,ti)&_N)return;let e=I(this,ti);(e&Um)===Dy&&(e&=vN),de(this,ti,e|_N),he(this,An,Qie).call(this)},ZP=function(e=""){e==="ENOTDIR"||e==="EPERM"?he(this,An,SN).call(this):e==="ENOENT"?he(this,An,IN).call(this):this.children().provisional=0},tae=function(e=""){var r;if(e==="ENOTDIR"){let n=this.parent;he(r=n,An,SN).call(r)}else e==="ENOENT"&&he(this,An,IN).call(this)},rae=function(e=""){var n;let r=I(this,ti);r|=GP,e==="ENOENT"&&(r|=O2),(e==="EINVAL"||e==="UNKNOWN")&&(r&=vN),de(this,ti,r),e==="ENOTDIR"&&this.parent&&he(n=this.parent,An,SN).call(n)},LP=function(e,r){return he(this,An,QNe).call(this,e,r)||he(this,An,JNe).call(this,e,r)},JNe=function(e,r){let n=$ie(e),i=this.newChild(e.name,n,{parent:this}),a=I(i,ti)&Um;return a!==Dy&&a!==BI&&a!==Ym&&de(i,ti,I(i,ti)|_N),r.unshift(i),r.provisional++,i},QNe=function(e,r){for(let n=r.provisional;n<r.length;n++){let i=r[n];if((this.nocase?FP(e.name):CN(e.name))===I(i,F_))return he(this,An,eDe).call(this,e,i,n,r)}},eDe=function(e,r,n,i){let a=r.name;return de(r,ti,I(r,ti)&vN|$ie(e)),a!==e.name&&(r.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(r)),i.provisional++,r},nae=function(e){let{atime:r,atimeMs:n,birthtime:i,birthtimeMs:a,blksize:s,blocks:o,ctime:u,ctimeMs:l,dev:f,gid:h,ino:g,mode:_,mtime:w,mtimeMs:T,nlink:D,rdev:G,size:O,uid:Z}=e;de(this,UN,r),de(this,VN,n),de(this,XN,i),de(this,MN,a),de(this,kN,s),de(this,WN,o),de(this,jN,u),de(this,HN,l),de(this,BN,f),de(this,FN,h),de(this,ZN,g),de(this,NN,_),de(this,YN,w),de(this,PN,T),de(this,DN,D),de(this,ON,G),de(this,LN,O),de(this,GN,Z);let X=$ie(e);de(this,ti,I(this,ti)&vN|X|WNe),X!==Ym&&X!==Dy&&X!==BI&&de(this,ti,I(this,ti)|_N)},AE=new WeakMap,RE=new WeakMap,tDe=function(e){de(this,RE,!1);let r=I(this,AE).slice();I(this,AE).length=0,r.forEach(n=>n(null,e))},GI=new WeakMap;hs.PathBase=Vd;var xN=class t extends Vd{sep="\\";splitSep=ykt;constructor(e,r=Ym,n,i,a,s,o){super(e,r,n,i,a,s,o)}newChild(e,r=Ym,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return WP.win32.parse(e).root}getRoot(e){if(e=vkt(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new RN(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(YNe,"$1\\"),e===r}};hs.PathWin32=xN;var wN=class t extends Vd{splitSep="/";sep="/";constructor(e,r=Ym,n,i,a,s,o){super(e,r,n,i,a,s,o)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=Ym,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}};hs.PathPosix=wN;var TE,BE,qN,zN,AN=class{constructor(e=process.cwd(),r,n,{nocase:i,childrenCacheSize:a=16*1024,fs:s=bN}={}){Et(this,"root");Et(this,"rootPath");Et(this,"roots");Et(this,"cwd");Be(this,TE);Be(this,BE);Be(this,qN);Et(this,"nocase");Be(this,zN);de(this,zN,UNe(s)),(e instanceof URL||e.startsWith("file://"))&&(e=(0,hkt.fileURLToPath)(e));let o=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),de(this,TE,new EN),de(this,BE,new EN),de(this,qN,new VP(a));let u=o.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(I(this,zN)),this.roots[this.rootPath]=this.root;let l=this.root,f=u.length-1,h=r.sep,g=this.rootPath,_=!1;for(let w of u){let T=f--;l=l.child(w,{relative:new Array(T).fill("..").join(h),relativePosix:new Array(T).fill("..").join("/"),fullpath:g+=(_?"":h)+w}),_=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return I(this,qN)}resolve(...e){let r="";for(let a=e.length-1;a>=0;a--){let s=e[a];if(!(!s||s===".")&&(r=r?`${s}/${r}`:s,this.isAbsolute(s)))break}let n=I(this,TE).get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpath();return I(this,TE).set(r,i),i}resolvePosix(...e){let r="";for(let a=e.length-1;a>=0;a--){let s=e[a];if(!(!s||s===".")&&(r=r?`${s}/${r}`:s,this.isAbsolute(s)))break}let n=I(this,BE).get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpathPosix();return I(this,BE).set(r,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(a=>a.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n==null?void 0:n.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n==null?void 0:n.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n==null?void 0:n.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n==null?void 0:n.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:a,walkFilter:s}=r,o=[];(!a||a(e))&&o.push(n?e:e.fullpath());let u=new Set,l=(h,g)=>{u.add(h),h.readdirCB((_,w)=>{if(_)return g(_);let T=w.length;if(!T)return g();let D=()=>{--T===0&&g()};for(let G of w)(!a||a(G))&&o.push(n?G:G.fullpath()),i&&G.isSymbolicLink()?G.realpath().then(O=>O!=null&&O.isUnknown()?O.lstat():O).then(O=>O!=null&&O.shouldWalk(u,s)?l(O,D):D()):G.shouldWalk(u,s)?l(G,D):D()},!0)},f=e;return new Promise((h,g)=>{l(f,_=>{if(_)return g(_);h(o)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:a,walkFilter:s}=r,o=[];(!a||a(e))&&o.push(n?e:e.fullpath());let u=new Set([e]);for(let l of u){let f=l.readdirSync();for(let h of f){(!a||a(h))&&o.push(n?h:h.fullpath());let g=h;if(h.isSymbolicLink()){if(!(i&&(g=h.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(u,s)&&u.add(g)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:a,walkFilter:s}=r;(!a||a(e))&&(yield n?e:e.fullpath());let o=new Set([e]);for(let u of o){let l=u.readdirSync();for(let f of l){(!a||a(f))&&(yield n?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(i&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(o,s)&&o.add(h)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:a,walkFilter:s}=r,o=new LNe.Minipass({objectMode:!0});(!a||a(e))&&o.write(n?e:e.fullpath());let u=new Set,l=[e],f=0,h=()=>{let g=!1;for(;!g;){let _=l.shift();if(!_){f===0&&o.end();return}f++,u.add(_);let w=(D,G,O=!1)=>{if(D)return o.emit("error",D);if(i&&!O){let Z=[];for(let X of G)X.isSymbolicLink()&&Z.push(X.realpath().then(ue=>ue!=null&&ue.isUnknown()?ue.lstat():ue));if(Z.length){Promise.all(Z).then(()=>w(null,G,!0));return}}for(let Z of G)Z&&(!a||a(Z))&&(o.write(n?Z:Z.fullpath())||(g=!0));f--;for(let Z of G){let X=Z.realpathCached()||Z;X.shouldWalk(u,s)&&l.push(X)}g&&!o.flowing?o.once("drain",h):T||h()},T=!0;_.readdirCB(w,!0),T=!1}};return h(),o}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Vd||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:a,walkFilter:s}=r,o=new LNe.Minipass({objectMode:!0}),u=new Set;(!a||a(e))&&o.write(n?e:e.fullpath());let l=[e],f=0,h=()=>{let g=!1;for(;!g;){let _=l.shift();if(!_){f===0&&o.end();return}f++,u.add(_);let w=_.readdirSync();for(let T of w)(!a||a(T))&&(o.write(n?T:T.fullpath())||(g=!0));f--;for(let T of w){let D=T;if(T.isSymbolicLink()){if(!(i&&(D=T.realpathSync())))continue;D.isUnknown()&&D.lstatSync()}D.shouldWalk(u,s)&&l.push(D)}}g&&!o.flowing&&o.once("drain",h)};return h(),o}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[$Ne](r)}};TE=new WeakMap,BE=new WeakMap,qN=new WeakMap,zN=new WeakMap;hs.PathScurryBase=AN;var RN=class extends AN{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,WP.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return WP.win32.parse(e).root.toUpperCase()}newRoot(e){return new xN(this.rootPath,Dy,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};hs.PathScurryWin32=RN;var TN=class extends AN{sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,WP.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new wN(this.rootPath,Dy,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};hs.PathScurryPosix=TN;var PP=class extends TN{constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}};hs.PathScurryDarwin=PP;hs.Path=process.platform==="win32"?xN:wN;hs.PathScurry=process.platform==="win32"?RN:process.platform==="darwin"?PP:TN});var sae=x(HP=>{"use strict";Object.defineProperty(HP,"__esModule",{value:!0});HP.Pattern=void 0;var _kt=A_(),Ckt=t=>t.length>=1,Ikt=t=>t.length>=1,$l,g1,Yc,FI,k2,KN,O_,k_,Z_,NE,aae=class aae{constructor(e,r,n,i){Be(this,$l);Be(this,g1);Be(this,Yc);Et(this,"length");Be(this,FI);Be(this,k2);Be(this,KN);Be(this,O_);Be(this,k_);Be(this,Z_);Be(this,NE,!0);if(!Ckt(e))throw new TypeError("empty pattern list");if(!Ikt(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(de(this,$l,e),de(this,g1,r),de(this,Yc,n),de(this,FI,i),I(this,Yc)===0){if(this.isUNC()){let[a,s,o,u,...l]=I(this,$l),[f,h,g,_,...w]=I(this,g1);l[0]===""&&(l.shift(),w.shift());let T=[a,s,o,u,""].join("/"),D=[f,h,g,_,""].join("/");de(this,$l,[T,...l]),de(this,g1,[D,...w]),this.length=I(this,$l).length}else if(this.isDrive()||this.isAbsolute()){let[a,...s]=I(this,$l),[o,...u]=I(this,g1);s[0]===""&&(s.shift(),u.shift());let l=a+"/",f=o+"/";de(this,$l,[l,...s]),de(this,g1,[f,...u]),this.length=I(this,$l).length}}}pattern(){return I(this,$l)[I(this,Yc)]}isString(){return typeof I(this,$l)[I(this,Yc)]=="string"}isGlobstar(){return I(this,$l)[I(this,Yc)]===_kt.GLOBSTAR}isRegExp(){return I(this,$l)[I(this,Yc)]instanceof RegExp}globString(){return de(this,KN,I(this,KN)||(I(this,Yc)===0?this.isAbsolute()?I(this,g1)[0]+I(this,g1).slice(1).join("/"):I(this,g1).join("/"):I(this,g1).slice(I(this,Yc)).join("/")))}hasMore(){return this.length>I(this,Yc)+1}rest(){return I(this,k2)!==void 0?I(this,k2):this.hasMore()?(de(this,k2,new aae(I(this,$l),I(this,g1),I(this,Yc)+1,I(this,FI))),de(I(this,k2),Z_,I(this,Z_)),de(I(this,k2),k_,I(this,k_)),de(I(this,k2),O_,I(this,O_)),I(this,k2)):de(this,k2,null)}isUNC(){let e=I(this,$l);return I(this,k_)!==void 0?I(this,k_):de(this,k_,I(this,FI)==="win32"&&I(this,Yc)===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3])}isDrive(){let e=I(this,$l);return I(this,O_)!==void 0?I(this,O_):de(this,O_,I(this,FI)==="win32"&&I(this,Yc)===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]))}isAbsolute(){let e=I(this,$l);return I(this,Z_)!==void 0?I(this,Z_):de(this,Z_,e[0]===""&&e.length>1||this.isDrive()||this.isUNC())}root(){let e=I(this,$l)[0];return typeof e=="string"&&this.isAbsolute()&&I(this,Yc)===0?e:""}checkFollowGlobstar(){return!(I(this,Yc)===0||!this.isGlobstar()||!I(this,NE))}markFollowGlobstar(){return I(this,Yc)===0||!this.isGlobstar()||!I(this,NE)?!1:(de(this,NE,!1),!0)}};$l=new WeakMap,g1=new WeakMap,Yc=new WeakMap,FI=new WeakMap,k2=new WeakMap,KN=new WeakMap,O_=new WeakMap,k_=new WeakMap,Z_=new WeakMap,NE=new WeakMap;var iae=aae;HP.Pattern=iae});var uae=x(MP=>{"use strict";Object.defineProperty(MP,"__esModule",{value:!0});MP.Ignore=void 0;var nDe=A_(),Skt=sae(),Ekt=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",oae=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:i,noglobstar:a,platform:s=Ekt}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=s,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:i,noglobstar:a,optimizationLevel:2,platform:s,nocomment:!0,nonegate:!0};for(let o of e)this.add(o)}add(e){let r=new nDe.Minimatch(e,this.mmopts);for(let n=0;n<r.set.length;n++){let i=r.set[n],a=r.globParts[n];if(!i||!a)throw new Error("invalid pattern object");for(;i[0]==="."&&a[0]===".";)i.shift(),a.shift();let s=new Skt.Pattern(i,a,0,this.platform),o=new nDe.Minimatch(s.globString(),this.mmopts),u=a[a.length-1]==="**",l=s.isAbsolute();l?this.absolute.push(o):this.relative.push(o),u&&(l?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(e){let r=e.fullpath(),n=`${r}/`,i=e.relative()||".",a=`${i}/`;for(let s of this.relative)if(s.match(i)||s.match(a))return!0;for(let s of this.absolute)if(s.match(r)||s.match(n))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(r))return!0;return!1}};MP.Ignore=oae});var aDe=x(Oy=>{"use strict";Object.defineProperty(Oy,"__esModule",{value:!0});Oy.Processor=Oy.SubWalks=Oy.MatchRecord=Oy.HasWalkedCache=void 0;var iDe=A_(),UP=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){var n;return(n=this.store.get(e.fullpath()))==null?void 0:n.has(r.globString())}storeWalked(e,r){let n=e.fullpath(),i=this.store.get(n);i?i.add(r.globString()):this.store.set(n,new Set([r.globString()]))}};Oy.HasWalkedCache=UP;var YP=class{store=new Map;add(e,r,n){let i=(r?2:0)|(n?1:0),a=this.store.get(e);this.store.set(e,a===void 0?i:i&a)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}};Oy.MatchRecord=YP;var jP=class{store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};Oy.SubWalks=jP;var lae=class t{hasWalkedCache;matches=new YP;subwalks=new jP;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new UP}processPatterns(e,r){this.patterns=r;let n=r.map(i=>[e,i]);for(let[i,a]of n){this.hasWalkedCache.storeWalked(i,a);let s=a.root(),o=a.isAbsolute()&&this.opts.absolute!==!1;if(s){i=i.resolve(s==="/"&&this.opts.root!==void 0?this.opts.root:s);let h=a.rest();if(h)a=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,l,f=!1;for(;typeof(u=a.pattern())=="string"&&(l=a.rest());)i=i.resolve(u),a=l,f=!0;if(u=a.pattern(),l=a.rest(),f){if(this.hasWalkedCache.hasWalked(i,a))continue;this.hasWalkedCache.storeWalked(i,a)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(i.resolve(u),o,h);continue}else if(u===iDe.GLOBSTAR){(!i.isSymbolicLink()||this.follow||a.checkFollowGlobstar())&&this.subwalks.add(i,a);let h=l==null?void 0:l.pattern(),g=l==null?void 0:l.rest();if(!l||(h===""||h===".")&&!g)this.matches.add(i,o,h===""||h===".");else if(h===".."){let _=i.parent||i;g?this.hasWalkedCache.hasWalked(_,g)||this.subwalks.add(_,g):this.matches.add(_,o,!0)}}else u instanceof RegExp&&this.subwalks.add(i,a)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),i=this.child();for(let a of r)for(let s of n){let o=s.isAbsolute(),u=s.pattern(),l=s.rest();u===iDe.GLOBSTAR?i.testGlobstar(a,s,l,o):u instanceof RegExp?i.testRegExp(a,u,l,o):i.testString(a,u,l,o)}return i}testGlobstar(e,r,n,i){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let a=n.pattern();if(typeof a=="string"&&a!==".."&&a!==""&&a!==".")this.testString(e,a,n.rest(),i);else if(a===".."){let s=e.parent||e;this.subwalks.add(s,n)}else a instanceof RegExp&&this.testRegExp(e,a,n.rest(),i)}}testRegExp(e,r,n,i){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,r,n,i){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}};Oy.Processor=lae});var uDe=x(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});L_.GlobStream=L_.GlobWalker=L_.GlobUtil=void 0;var xkt=zie(),sDe=uae(),oDe=aDe(),wkt=(t,e)=>typeof t=="string"?new sDe.Ignore([t],e):Array.isArray(t)?new sDe.Ignore(t,e):t,DE,Y6,kI,jm,OI,cae,$N=class{constructor(e,r,n){Be(this,jm);Et(this,"path");Et(this,"patterns");Et(this,"opts");Et(this,"seen",new Set);Et(this,"paused",!1);Et(this,"aborted",!1);Be(this,DE,[]);Be(this,Y6);Be(this,kI);Et(this,"signal");Et(this,"maxDepth");Et(this,"includeChildMatches");if(this.patterns=e,this.path=r,this.opts=n,de(this,kI,!n.posix&&n.platform==="win32"?"\\":"/"),this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(de(this,Y6,wkt(n.ignore??[],n)),!this.includeChildMatches&&typeof I(this,Y6).add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{I(this,DE).length=0}))}pause(){this.paused=!0}resume(){var r;if((r=this.signal)!=null&&r.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=I(this,DE).shift());)e()}onResume(e){var r;(r=this.signal)!=null&&r.aborted||(this.paused?I(this,DE).push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let a=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&(a!=null&&a.isSymbolicLink())){let s=await a.realpath();s&&(s.isUnknown()||this.opts.stat)&&await s.lstat()}return this.matchCheckTest(a,r)}matchCheckTest(e,r){var n;return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!((n=e.realpathCached())!=null&&n.isDirectory()))&&!he(this,jm,OI).call(this,e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let a=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&(a!=null&&a.isSymbolicLink())){let s=a.realpathSync();s&&(s!=null&&s.isUnknown()||this.opts.stat)&&s.lstatSync()}return this.matchCheckTest(a,r)}matchFinish(e,r){var a;if(he(this,jm,OI).call(this,e))return;if(!this.includeChildMatches&&((a=I(this,Y6))!=null&&a.add)){let s=`${e.relativePosix()}/**`;I(this,Y6).add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?I(this,kI):"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+I(this,kI))?"."+I(this,kI):"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,r,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,r)}matchSync(e,r,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,r)}walkCB(e,r,n){var i;(i=this.signal)!=null&&i.aborted&&n(),this.walkCB2(e,r,new oDe.Processor(this.opts),n)}walkCB2(e,r,n,i){var o;if(he(this,jm,cae).call(this,e))return i();if((o=this.signal)!=null&&o.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,i));return}n.processPatterns(e,r);let a=1,s=()=>{--a===0&&i()};for(let[u,l,f]of n.matches.entries())he(this,jm,OI).call(this,u)||(a++,this.match(u,l,f).then(()=>s()));for(let u of n.subwalkTargets()){if(this.maxDepth!==1/0&&u.depth()>=this.maxDepth)continue;a++;let l=u.readdirCached();u.calledReaddir()?this.walkCB3(u,l,n,s):u.readdirCB((f,h)=>this.walkCB3(u,h,n,s),!0)}s()}walkCB3(e,r,n,i){n=n.filterEntries(e,r);let a=1,s=()=>{--a===0&&i()};for(let[o,u,l]of n.matches.entries())he(this,jm,OI).call(this,o)||(a++,this.match(o,u,l).then(()=>s()));for(let[o,u]of n.subwalks.entries())a++,this.walkCB2(o,u,n.child(),s);s()}walkCBSync(e,r,n){var i;(i=this.signal)!=null&&i.aborted&&n(),this.walkCB2Sync(e,r,new oDe.Processor(this.opts),n)}walkCB2Sync(e,r,n,i){var o;if(he(this,jm,cae).call(this,e))return i();if((o=this.signal)!=null&&o.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,i));return}n.processPatterns(e,r);let a=1,s=()=>{--a===0&&i()};for(let[u,l,f]of n.matches.entries())he(this,jm,OI).call(this,u)||this.matchSync(u,l,f);for(let u of n.subwalkTargets()){if(this.maxDepth!==1/0&&u.depth()>=this.maxDepth)continue;a++;let l=u.readdirSync();this.walkCB3Sync(u,l,n,s)}s()}walkCB3Sync(e,r,n,i){n=n.filterEntries(e,r);let a=1,s=()=>{--a===0&&i()};for(let[o,u,l]of n.matches.entries())he(this,jm,OI).call(this,o)||this.matchSync(o,u,l);for(let[o,u]of n.subwalks.entries())a++,this.walkCB2Sync(o,u,n.child(),s);s()}};DE=new WeakMap,Y6=new WeakMap,kI=new WeakMap,jm=new WeakSet,OI=function(e){var r,n;return this.seen.has(e)||!!((n=(r=I(this,Y6))==null?void 0:r.ignored)!=null&&n.call(r,e))},cae=function(e){var r,n;return!!((n=(r=I(this,Y6))==null?void 0:r.childrenIgnored)!=null&&n.call(r,e))};L_.GlobUtil=$N;var dae=class extends $N{matches=new Set;constructor(e,r,n){super(e,r,n)}matchEmit(e){this.matches.add(e)}async walk(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((r,n)=>{this.walkCB(this.path,this.patterns,()=>{var i;(i=this.signal)!=null&&i.aborted?n(this.signal.reason):r(this.matches)})}),this.matches}walkSync(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var r;if((r=this.signal)!=null&&r.aborted)throw this.signal.reason}),this.matches}};L_.GlobWalker=dae;var fae=class extends $N{results;constructor(e,r,n){super(e,r,n),this.results=new xkt.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};L_.GlobStream=fae});var hae=x(zP=>{"use strict";Object.defineProperty(zP,"__esModule",{value:!0});zP.Glob=void 0;var Akt=A_(),Rkt=require("url"),XP=rDe(),Tkt=sae(),qP=uDe(),Bkt=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",pae=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,Rkt.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=r.platform||Bkt,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=r.platform==="win32"?XP.PathScurryWin32:r.platform==="darwin"?XP.PathScurryDarwin:r.platform?XP.PathScurryPosix:XP.PathScurry;this.scurry=new u(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},a=this.pattern.map(u=>new Akt.Minimatch(u,i)),[s,o]=a.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=s.map((u,l)=>{let f=o[l];if(!f)throw new Error("invalid pattern object");return new Tkt.Pattern(u,f,0,this.platform)})}async walk(){return[...await new qP.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new qP.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new qP.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new qP.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};zP.Glob=pae});var mae=x(KP=>{"use strict";Object.defineProperty(KP,"__esModule",{value:!0});KP.hasMagic=void 0;var Nkt=A_(),Dkt=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Nkt.Minimatch(r,e).hasMagic())return!0;return!1};KP.hasMagic=Dkt});var fDe=x(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.glob=ua.sync=ua.iterate=ua.iterateSync=ua.stream=ua.streamSync=ua.Ignore=ua.hasMagic=ua.Glob=ua.unescape=ua.escape=void 0;ua.globStreamSync=JN;ua.globStream=gae;ua.globSync=vae;ua.globIterateSync=QN;ua.globIterate=yae;var lDe=A_(),ZI=hae(),Gkt=mae(),dDe=A_();Object.defineProperty(ua,"escape",{enumerable:!0,get:function(){return dDe.escape}});Object.defineProperty(ua,"unescape",{enumerable:!0,get:function(){return dDe.unescape}});var Fkt=hae();Object.defineProperty(ua,"Glob",{enumerable:!0,get:function(){return Fkt.Glob}});var Okt=mae();Object.defineProperty(ua,"hasMagic",{enumerable:!0,get:function(){return Okt.hasMagic}});var kkt=uae();Object.defineProperty(ua,"Ignore",{enumerable:!0,get:function(){return kkt.Ignore}});function JN(t,e={}){return new ZI.Glob(t,e).streamSync()}function gae(t,e={}){return new ZI.Glob(t,e).stream()}function vae(t,e={}){return new ZI.Glob(t,e).walkSync()}async function cDe(t,e={}){return new ZI.Glob(t,e).walk()}function QN(t,e={}){return new ZI.Glob(t,e).iterateSync()}function yae(t,e={}){return new ZI.Glob(t,e).iterate()}ua.streamSync=JN;ua.stream=Object.assign(gae,{sync:JN});ua.iterateSync=QN;ua.iterate=Object.assign(yae,{sync:QN});ua.sync=Object.assign(vae,{stream:JN,iterate:QN});ua.glob=Object.assign(cDe,{glob:cDe,globSync:vae,sync:ua.sync,globStream:gae,stream:ua.stream,globStreamSync:JN,streamSync:ua.streamSync,globIterate:yae,iterate:ua.iterate,globIterateSync:QN,iterateSync:ua.iterateSync,Glob:ZI.Glob,hasMagic:Gkt.hasMagic,escape:lDe.escape,unescape:lDe.unescape});ua.glob.glob=ua.glob});var Cae=x(qp=>{"use strict";var Zkt=qp&&qp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lkt=qp&&qp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pDe=qp&&qp.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Zkt(e,t,r);return Lkt(e,t),e};Object.defineProperty(qp,"__esModule",{value:!0});qp.determineGoModuleName=qp.ConstructsMaker=qp.generateJsiiLanguage=void 0;var Ys=pDe(Yl()),si=pDe(require("path")),Wkt=a6(),bae=Ln(),Cs=Ln(),v1=Ln(),Vkt=Cie(),Pkt=UBe(),hDe=fDe(),Hkt=S_(),Mkt=require.resolve("jsii-pacmak/bin/jsii-pacmak"),Ukt=require.resolve("jsii/bin/jsii");async function mDe(t,e,r,n=[]){await(0,bae.mkdtemp)(async i=>{await t.save(i);let a=n.flatMap(D=>hDe.glob.sync(D,{cwd:i}));await Promise.all(a.map(D=>Ys.remove(si.join(i,D))));let s=["--silence-warnings","reserved-word"],o=e.entrypoint,u=si.join(si.dirname(o),si.basename(o,".ts")),l=e.moduleKey.replace(/\./g,"").replace(/\//g,""),f=e.deps,h={},g={};for(let D of f){let G=await Ys.readJson(si.join(D,"package.json")),O=G.name,Z=G.version,X=si.join(si.join(i,"node_modules"),O);await Ys.mkdirp(si.dirname(X)),await Ys.copy(D,X),O.startsWith("@types/")||(g[O]=Z)}let _={name:l,version:"0.0.0",author:"generated@generated.com",main:`${u}.js`,types:`${u}.d.ts`,license:"UNLICENSED",repository:{url:"http://generated",type:"git"},jsii:{outdir:"dist",targets:h},dependencies:g,peerDependencies:g};e.exports&&(_.exports=e.exports),e.python&&(h.python={distName:"generated",module:e.python.moduleName}),e.java&&(h.java={package:e.java.package,maven:{groupId:"generated",artifactId:"generated"}}),e.csharp&&(h.dotnet={namespace:e.csharp.namespace,packageId:e.csharp.namespace}),e.golang&&(h.go={moduleName:e.golang.moduleName,packageName:e.golang.packageName}),await Ys.writeFile(si.join(i,"package.json"),JSON.stringify(_,void 0,2));let w=(0,Cs.logTimespan)("jsii");await(0,bae.exec)(Ukt,s,{cwd:i}),w(),e.jsii&&await Ys.copy(si.join(i,".jsii"),e.jsii.path);let T=(0,Cs.logTimespan)("jsii-pacmak");if(await(0,bae.exec)(Mkt,["--code-only"],{cwd:i}),T(),e.python){let D=e.python.moduleName.replace(/\./g,"/"),G=si.resolve(si.join(i,"dist/python/src",D)),O=si.join(e.python.outdir,D);await Ys.move(G,O,{overwrite:!0})}if(e.java){let D=si.resolve(si.join(i,"dist/java/src/")),G=si.join(e.java.outdir,"src/"),O=e.java.package.replace(/\./g,"/");await Ys.mkdirp(si.join(G,"main/java",O)),await Ys.mkdirp(si.join(G,"main/resources",O)),await Ys.copy(D,G,{recursive:!0,overwrite:!1})}if(e.csharp){let D=e.csharp.namespace,G=si.resolve(si.join(i,"dist/dotnet/",D)),O=si.join(e.csharp.outdir,D);await Ys.move(G,O,{overwrite:!0})}if(e.golang){let D=e.golang.packageName,G=si.resolve(si.join(i,"dist/go/",D)),O=si.join(e.golang.outdir,D);await Ys.move(G,O,{overwrite:!0}),await Ys.remove(si.join(O,"go.mod"))}["versions.json","constraints.json"].forEach(D=>{try{Ys.copySync(si.resolve(i,D),si.resolve(r,D))}catch(G){Cs.logger.debug(`Failed to copy ${D}: ${G}`)}})})}qp.generateJsiiLanguage=mDe;var _ae=class{constructor(e,r,n=async()=>{}){this.options=e,this.schemaCachePath=r,this.reportTelemetry=n,this.codeMakerOutdir=si.resolve(this.options.codeMakerOutput),Ys.mkdirpSync(this.codeMakerOutdir),this.code=new Wkt.CodeMaker,this.versions={}}async generateTypescriptProvider(e,r){var n;let i=(0,Cs.logTimespan)(`Generate Typescript for ${e.name}`),a=new Vkt.TerraformProviderGenerator(this.code,r,{importExtension:(n=this.options.languageOptions)===null||n===void 0?void 0:n.importExtension});a.generate(e),this.versions={...this.versions,...a.versions},i()}async filterAlreadyGenerated(e){let r="{}";try{r=await Ys.readFile(si.join(this.codeMakerOutdir,"constraints.json"),"utf8")}catch(a){return Cs.logger.debug(`Could not find constraints.json file while filtering: ${a}. This means no providers were generated, so all constraints need to be generated.`),e}Cs.logger.debug(`Found constraints.json file: ${r}`);let n={};try{n=JSON.parse(r)}catch(a){return Cs.logger.info(`Could not parse constraints.json file while filtering: ${a}. Generating all constraints.`),e}if(Cs.logger.debug(`Found previous constraints: ${JSON.stringify(n,null,2)}`),!n.providers||typeof n.providers!="object")return Cs.logger.info(`Could not find providers in constraints.json file, generating all constraints. The constraints file was ${JSON.stringify(n,null,2)}`),e;if(n.cdktf!==v1.DISPLAY_VERSION)return Cs.logger.info(`The CDKTN version has changed, generating all constraints. The previous version was ${n.cdktf}, the current version is ${v1.DISPLAY_VERSION}`),e;let i=e.filter(a=>{let s=n.providers[a.fqn]===a.version,o=!1;switch(this.options.targetLanguage){case v1.Language.TYPESCRIPT:o=Ys.existsSync(si.join(this.codeMakerOutdir,"providers",a.name));break;case v1.Language.PYTHON:case v1.Language.JAVA:case v1.Language.CSHARP:o=Ys.existsSync(si.join(this.codeMakerOutdir,a.name));break;case v1.Language.GO:o=Ys.existsSync(si.join(this.codeMakerOutdir,a.namespace||"hashicorp",a.name));break}return!(s&&o)});return Cs.logger.debug(`Constraints to generate: ${JSON.stringify(i,null,2)}`),i}async generateTypescriptModule(e,r){let n=(0,Cs.logTimespan)(`Generate Typescript for ${e.name}`);e.spec=r,new Pkt.ModuleGenerator(this.code,[e]),n()}async generateTypescript(e,r){var n;if(e.isModule){let i=(n=r.moduleSchema)===null||n===void 0?void 0:n[e.moduleKey];if(!i)throw Cs.Errors.Internal(`Could not generate schema for module ${e.moduleKey}`);await this.generateTypescriptModule(e,i)}else if(e.isProvider){if(!r.providerSchema)throw Cs.Errors.Internal("Could not generate schema for providers");await this.generateTypescriptProvider(e,r.providerSchema)}else throw new Error(`Unknown target type used to generate bindings: ${e.name}`)}updateVersionsFile(e){Cs.logger.debug(`Updating versions file with generated versions ${JSON.stringify(this.versions,null,2)} with allowed constraints ${JSON.stringify(e,null,2)}`);let r="versions.json",n={};try{n=JSON.parse(Ys.readFileSync(si.resolve(this.codeMakerOutdir,r),"utf8")),Cs.logger.debug(`Read existing versions file: ${JSON.stringify(n,null,2)}`)}catch(a){Cs.logger.debug(`Could not read versions file, this is expected if there are no pre-existing local providers: ${a}`)}let i=e.reduce((a,s)=>{let o=Object.entries(n).find(([u])=>u.endsWith(s.fqn));if(o){let[u,l]=o;return{...a,[u]:l}}return a},{});return Cs.logger.debug(`Writing versions file (${r}): ${JSON.stringify(i,null,2)}`),this.code.openFile(r),this.code.line(JSON.stringify({...i,...this.versions},null,2)),this.code.closeFile(r),r}async removeFoldersThatShouldNotExist(e){if(Cs.logger.debug(`Removing providers except for ${JSON.stringify(e,null,2)}`),!this.isJavascriptTarget)return;let r=[],n=si.resolve(this.codeMakerOutdir,"providers");try{r=await Ys.readdir(n)}catch(a){Cs.logger.debug(`Error listing files in providers folder '${n}': ${a}`)}return r.filter(a=>Ys.statSync(si.resolve(this.codeMakerOutdir,"providers",a)).isDirectory()).forEach(a=>{e.some(o=>o.name===a)||(Cs.logger.debug(`Removing folder ${a} from providers`),Ys.removeSync(si.resolve(this.codeMakerOutdir,"providers",a)))})}emitConstraintsFile(e){let r="constraints.json",n={cdktf:v1.DISPLAY_VERSION,providers:e.sort((i,a)=>i.fqn.localeCompare(a.fqn)).reduce((i,a)=>({...i,[a.fqn]:a.version}),{})};return this.code.openFile(r),this.code.line(JSON.stringify(n,null,2)),this.code.closeFile(r),r}async generateJsiiLanguage(e){var r;let n=["@types/node","constructs","cdktn"],i={entrypoint:e.fileName,deps:n.map(s=>si.dirname(require.resolve(`${s}/package.json`))),moduleKey:e.moduleKey,exports:e.isProvider?{".":{import:`./providers/${e.name}/index.js`,require:`./providers/${e.name}/lazy-index.js`}}:void 0};if(this.options.outputJsii&&(i.jsii={path:this.options.outputJsii}),this.isPythonTarget&&(i.python={outdir:this.codeMakerOutdir,moduleName:e.srcMakName}),this.isJavaTarget){if(this.options.codeMakerOutput.includes("/")||this.options.codeMakerOutput.includes("\\"))throw Cs.Errors.Usage('When using Java the "codeMakerOutput" option in the cdktf.json must be the organization identifier for your project (e.g. com.my-company), not a path. The generated Java code will be placed in a subdirectory of the given directory. If you are migrating from a < 0.19 version of cdktf you want to change the codemakerOutput to "imports".');i.java={outdir:".",package:`${this.options.codeMakerOutput}.${e.srcMakName}`}}if(this.isCsharpTarget&&(i.csharp={outdir:this.codeMakerOutdir,namespace:e.srcMakName}),this.isGoTarget){let s=si.join(this.codeMakerOutdir,(r=e.namespace)!==null&&r!==void 0?r:"");i.golang={outdir:s,moduleName:await(0,qp.determineGoModuleName)(s),packageName:e.srcMakName}}process.env.NODE_OPTIONS&&!process.env.NODE_OPTIONS.includes("--max-old-space-size")?Cs.logger.warn(`found NODE_OPTIONS environment variable without a setting for --max-old-space-size.
110
110
  The provider generation needs a substantial amount of memory (~13GB) for some providers and languages.
111
111
  So cdktn-cli sets it to NODE_OPTIONS="--max-old-space-size=16384" by default. As your environment already contains
@@ -158,7 +158,7 @@ ${e}${r?`~=${r}`:""}`;await Qy.writeFile(i,o,"utf8"),await(0,pn.exec)("pip",["in
158
158
  version : ${e.version||"latest"}
159
159
  language: ${this.targetLanguage}
160
160
  cdktf : ${this.cdktfVersion}
161
- `),this.targetLanguage===Di.Language.GO&&Ajt.lt(this.cdktfVersion,"0.12.0"))return Di.logger.info("Before CDKTF 0.12.0 there were no pre-built providers published for Go."),!1;let n=await(0,JD.getPrebuiltProviderVersions)(e,this.cdktfVersion)!==null;return n?Di.logger.info("Found pre-built provider."):Di.logger.info("Pre-built provider does not exist for the given constraints."),n}async tryGetPackageName(e,r){let n=await(0,JD.getNpmPackageName)(e,r);if(n)return this.tryGetLanguagePackageName(n)}async tryGetLanguagePackageName(e){let r=await(0,JD.getPrebuiltProviderRepositoryName)(e);return this.convertPackageName(e,r,e.startsWith("@cdktn"))}async getMatchingProviderVersion(e){let r=await(0,JD.getPrebuiltProviderVersions)(e,this.cdktfVersion);if(!r)throw Di.Errors.Usage(`No pre-built provider found for ${e.source} with version constraint ${e.version} and cdktf version ${this.cdktfVersion}`);let n=await this.getLanguageSpecificPackageVersion(r);if(!n)throw Di.Errors.Usage(`No pre-built provider found for ${e.source} with version constraint ${e.version} and cdktf version ${this.cdktfVersion} for language ${this.targetLanguage}.`);return n}async addPrebuiltProvider(e,r=!1){Di.logger.debug(`adding pre-built provider ${e.source} with version constraint ${e.version} for cdktf version ${this.cdktfVersion}`);let{name:n,version:i}=await this.getMatchingProviderVersion(e);await this.packageManager.addPackage(n,i,r)}async getLanguageSpecificPackageVersion(e){Di.logger.debug("Found possibly matching versions (released on npm): ",e),Di.logger.debug("Searching through package manager to find latest available version for given language");for(let{name:r,version:n}of e)try{let i=await this.tryGetLanguagePackageName(r);if(!i)continue;if(await this.packageManager.isNpmVersionAvailable(i,n))return{name:i,version:n}}catch(i){Di.logger.info(`Could not find version ${n} for package ${r}: '${i}'. Skipping...`)}return null}async addLocalProvider(e){if(Di.logger.info(`Adding local provider ${e.source} with version constraint ${e.version} to cdktf.json`),!e.version&&e.isFromTerraformRegistry()){let r=await(0,xjt.getLatestVersion)(e);if(r)e=new QD(e.source,`~> ${r.split(".").slice(0,2).join(".")}`);else throw Di.Errors.Usage(`Could not find a version for the provider '${e}' in the public registry. This could be due to a typo, please take a look at https://cdk.tf/registry-providers to find all supported providers.`)}await new fVe.CdktfConfigManager().addProvider(e)}convertPackageName(e,r,n){return n?this.convertPackageNameCdktn(e,r):this.convertPackageNameCdktf(e,r)}convertPackageNameCdktf(e,r){let n=e.replace("@cdktf/provider-","");switch(this.targetLanguage){case Di.Language.GO:return r?`${r}-go/${n}`:`github.com/cdktf/cdktf-provider-${n}-go/${n}`;case Di.Language.TYPESCRIPT:return e;case Di.Language.CSHARP:return"HashiCorp.Cdktf.Providers."+(0,$ue.toPascalCase)(n);case Di.Language.JAVA:return`com.hashicorp.cdktf-provider-${n}`;case Di.Language.PYTHON:return`cdktf-cdktf-provider-${n}`;default:throw new Error(`converting package name for language ${this.targetLanguage} not implemented yet`)}}convertPackageNameCdktn(e,r){let n=e.replace("@cdktn/provider-","");switch(this.targetLanguage){case Di.Language.GO:return r?`${r}-go/${n}`:`github.com/cdktn-io/cdktn-provider-${n}-go/${n}`;case Di.Language.TYPESCRIPT:return e;case Di.Language.CSHARP:return"Io.Cdktn.Providers."+(0,$ue.toPascalCase)(n);case Di.Language.JAVA:return`io.cdktn.cdktn-provider-${n}`;case Di.Language.PYTHON:return`cdktn-provider-${n}`;default:throw new Error(`converting package name for language ${this.targetLanguage} not implemented yet`)}}convertFromPackageNameToNpm(e){let n={[Di.Language.GO]:/github.com\/(?:cdktf|hashicorp|cdktn-io)\/cdkt([fn])-provider-(.+)-go\//i,[Di.Language.TYPESCRIPT]:/(.+)/i,[Di.Language.CSHARP]:/(?:HashiCorp|Io)\.Cdkt([fn])\.Providers\.(.+)/i,[Di.Language.JAVA]:/(?:com\.hashicorp|io\.cdktn)\.cdkt([fn])-provider-(.+)/i,[Di.Language.PYTHON]:/(?:cdktf-)?cdkt([fn])-provider-(.+)/i}[this.targetLanguage];if(!n)throw Di.Errors.Usage("Language not supported for pre-built providers");let i=n.exec(e);if(!i)throw new Error(`Package name is not in expected format: ${e}`);let a=`@cdkt${i[1]}/provider-`;switch(this.targetLanguage){case Di.Language.GO:return a+i[2];case Di.Language.TYPESCRIPT:return i[1];case Di.Language.CSHARP:return a+(0,$ue.toSnakeCase)(i[2]);case Di.Language.JAVA:return a+i[2];case Di.Language.PYTHON:return a+i[2];default:throw new Error(`converting package name for language ${this.targetLanguage} not implemented yet`)}}async allProviders(){let e=Sjt.CdktfConfig.read(),r=new Rjt.LocalProviderVersions,n=e.terraformProviders,i=await this.packageManager.listProviderPackages(),a=await Promise.all(i.map(async u=>{let l=this.convertFromPackageNameToNpm(u.name);return{...await(0,JD.getPrebuiltProviderVersionInformation)(l,u.version),packageName:u.name}})),s=new Tjt.LocalProviderConstraints;return{local:await Promise.all(n.map(async u=>{let l=QD.fromConfigEntry(u),f=await r.versionForProvider(l.simplifiedName),h=await s.constraintForProvider(l.simplifiedName);return{providerName:l.simplifiedName,providerConstraint:h||l.version,providerVersion:f}})),prebuilt:a}}};wu.DependencyManager=Jue});var hVe=x((FCr,Que)=>{"use strict";var pVe=require("fs");Que.exports=t=>new Promise(e=>{pVe.access(t,r=>{e(!r)})});Que.exports.sync=t=>{try{return pVe.accessSync(t),!0}catch{return!1}}});var gVe=x((OCr,ele)=>{"use strict";var mVe=(t,...e)=>new Promise(r=>{r(t(...e))});ele.exports=mVe;ele.exports.default=mVe});var yVe=x((kCr,tle)=>{"use strict";var Njt=gVe(),vVe=t=>{if(!((Number.isInteger(t)||t===1/0)&&t>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let e=[],r=0,n=()=>{r--,e.length>0&&e.shift()()},i=(o,u,...l)=>{r++;let f=Njt(o,...l);u(f),f.then(n,n)},a=(o,u,...l)=>{r<t?i(o,u,...l):e.push(i.bind(null,o,u,...l))},s=(o,...u)=>new Promise(l=>a(o,l,...u));return Object.defineProperties(s,{activeCount:{get:()=>r},pendingCount:{get:()=>e.length},clearQueue:{value:()=>{e.length=0}}}),s};tle.exports=vVe;tle.exports.default=vVe});var CVe=x((ZCr,_Ve)=>{"use strict";var bVe=yVe(),eU=class extends Error{constructor(e){super(),this.value=e}},Djt=(t,e)=>Promise.resolve(t).then(e),Gjt=t=>Promise.all(t).then(e=>e[1]===!0&&Promise.reject(new eU(e[0])));_Ve.exports=(t,e,r)=>{r=Object.assign({concurrency:1/0,preserveOrder:!0},r);let n=bVe(r.concurrency),i=[...t].map(s=>[s,n(Djt,s,e)]),a=bVe(r.preserveOrder?1:1/0);return Promise.all(i.map(s=>a(Gjt,s))).then(()=>{}).catch(s=>s instanceof eU?s.value:Promise.reject(s))}});var EVe=x((LCr,rle)=>{"use strict";var IVe=require("path"),SVe=hVe(),Fjt=CVe();rle.exports=(t,e)=>(e=Object.assign({cwd:process.cwd()},e),Fjt(t,r=>SVe(IVe.resolve(e.cwd,r)),e));rle.exports.sync=(t,e)=>{e=Object.assign({cwd:process.cwd()},e);for(let r of t)if(SVe.sync(IVe.resolve(e.cwd,r)))return r}});var wVe=x((WCr,nle)=>{"use strict";var c5=require("path"),xVe=EVe();nle.exports=(t,e={})=>{let r=c5.resolve(e.cwd||""),{root:n}=c5.parse(r),i=[].concat(t);return new Promise(a=>{(function s(o){xVe(i,{cwd:o}).then(u=>{u?a(c5.join(o,u)):o===n?a(null):s(c5.dirname(o))})})(r)})};nle.exports.sync=(t,e={})=>{let r=c5.resolve(e.cwd||""),{root:n}=c5.parse(r),i=[].concat(t);for(;;){let a=xVe.sync(i,{cwd:r});if(a)return c5.join(r,a);if(r===n)return null;r=c5.dirname(r)}}});var ale=x((VCr,ile)=>{"use strict";var AVe=wVe();ile.exports=async({cwd:t}={})=>AVe("package.json",{cwd:t});ile.exports.sync=({cwd:t}={})=>AVe.sync("package.json",{cwd:t})});var RVe=x(tU=>{"use strict";Object.defineProperty(tU,"__esModule",{value:!0});tU.substitute=void 0;function Ojt(t,e={}){for(let[r,n]of Object.entries({...e,"":""}))t=t.replace(new RegExp(`{{ *${kjt(r)} *}}`,"g"),n);return t}tU.substitute=Ojt;function kjt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}});var NVe=x(eb=>{"use strict";var Zjt=eb&&eb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ljt=eb&&eb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Wjt=eb&&eb.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&Zjt(e,t,r);return Ljt(e,t),e};Object.defineProperty(eb,"__esModule",{value:!0});eb.sscaff=void 0;var Rx=require("fs"),i4=Wjt(require("path")),TVe=RVe(),BVe=".hooks.sscaff.js";async function Vjt(t,e,r={}){t=i4.resolve(t),e=i4.resolve(e),await Rx.promises.mkdir(e,{recursive:!0});let n=u();r.$base||(r.$base=i4.basename(e));let i=process.cwd();try{process.chdir(e),await s(),await a("."),await o()}finally{process.chdir(i)}async function a(l){let f=i4.join(t,l);for(let h of await Rx.promises.readdir(f)){if(h===BVe)continue;let g=i4.join(f,h);if((await Rx.promises.stat(g)).isDirectory()){await a(i4.join(l,h));continue}let _=TVe.substitute(i4.join(l,h),r),w=await Rx.promises.readFile(g,"utf-8"),T=TVe.substitute(w.toString(),r);await Rx.promises.mkdir(i4.dirname(_),{recursive:!0}),await Rx.promises.writeFile(_,T)}}async function s(){n!=null&&n.pre&&await Promise.resolve(n.pre(r))}async function o(){n!=null&&n.post&&await Promise.resolve(n.post(r))}function u(){try{return require(i4.join(t,BVe))}catch{return}}}eb.sscaff=Vjt});var DVe=x(C3=>{"use strict";var Pjt=C3&&C3.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hjt=C3&&C3.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&Pjt(e,t,r)};Object.defineProperty(C3,"__esModule",{value:!0});Hjt(NVe(),C3)});var ule=x(qc=>{"use strict";var Mjt=qc&&qc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ujt=qc&&qc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),sle=qc&&qc.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Mjt(e,t,r);return Ujt(e,t),e};Object.defineProperty(qc,"__esModule",{value:!0});qc.determineDeps=qc.init=qc.templates=qc.templatesDir=void 0;var d5=sle(require("path")),ole=sle(Yl()),Yjt=sle(ale()),GVe=Ln(),jjt=DVe(),Xjt=require("cdktn/lib/features"),qjt=Yy(),zjt=lle(),Kjt=()=>{let t=Yjt.sync({cwd:__dirname});if(!t)throw new Error("unable to find package.json");return JSON.parse(ole.readFileSync(t,"utf-8"))},kVe=Kjt(),FVe=kVe.dependencies.constructs;qc.templatesDir=d5.join(__dirname,"..","..","templates");var $jt=ole.readdirSync(qc.templatesDir).filter(t=>!t.startsWith("."));qc.templates=[];for(let t of $jt)qc.templates.push(t);async function Jjt({cdktfVersion:t,destination:e,dist:r,projectId:n,projectInfo:i,templatePath:a,sendCrashReports:s,providers:o,providersForceLocal:u,silent:l}){let f=await ZVe(t,r,d5.basename(a)),h=Object.entries(Xjt.FUTURE_FLAGS).map(([w,T])=>` "${w}": "${T}"`).join(`,
161
+ `),this.targetLanguage===Di.Language.GO&&Ajt.lt(this.cdktfVersion,"0.12.0"))return Di.logger.info("Before CDKTF 0.12.0 there were no pre-built providers published for Go."),!1;let n=await(0,JD.getPrebuiltProviderVersions)(e,this.cdktfVersion)!==null;return n?Di.logger.info("Found pre-built provider."):Di.logger.info("Pre-built provider does not exist for the given constraints."),n}async tryGetPackageName(e,r){let n=await(0,JD.getNpmPackageName)(e,r);if(n)return this.tryGetLanguagePackageName(n)}async tryGetLanguagePackageName(e){let r=await(0,JD.getPrebuiltProviderRepositoryName)(e);return this.convertPackageName(e,r,e.startsWith("@cdktn"))}async getMatchingProviderVersion(e){let r=await(0,JD.getPrebuiltProviderVersions)(e,this.cdktfVersion);if(!r)throw Di.Errors.Usage(`No pre-built provider found for ${e.source} with version constraint ${e.version} and cdktf version ${this.cdktfVersion}`);let n=await this.getLanguageSpecificPackageVersion(r);if(!n)throw Di.Errors.Usage(`No pre-built provider found for ${e.source} with version constraint ${e.version} and cdktf version ${this.cdktfVersion} for language ${this.targetLanguage}.`);return n}async addPrebuiltProvider(e,r=!1){Di.logger.debug(`adding pre-built provider ${e.source} with version constraint ${e.version} for cdktf version ${this.cdktfVersion}`);let{name:n,version:i}=await this.getMatchingProviderVersion(e);await this.packageManager.addPackage(n,i,r)}async getLanguageSpecificPackageVersion(e){Di.logger.debug("Found possibly matching versions (released on npm): ",e),Di.logger.debug("Searching through package manager to find latest available version for given language");for(let{name:r,version:n}of e)try{let i=await this.tryGetLanguagePackageName(r);if(!i)continue;if(await this.packageManager.isNpmVersionAvailable(i,n))return{name:i,version:n}}catch(i){Di.logger.info(`Could not find version ${n} for package ${r}: '${i}'. Skipping...`)}return null}async addLocalProvider(e){if(Di.logger.info(`Adding local provider ${e.source} with version constraint ${e.version} to cdktf.json`),!e.version&&e.isFromTerraformRegistry()){let r=await(0,xjt.getLatestVersion)(e);if(r)e=new QD(e.source,`~> ${r.split(".").slice(0,2).join(".")}`);else throw Di.Errors.Usage(`Could not find a version for the provider '${e}' in the public registry. This could be due to a typo, please take a look at https://registry.terraform.io/browse/providers to find all supported providers.`)}await new fVe.CdktfConfigManager().addProvider(e)}convertPackageName(e,r,n){return n?this.convertPackageNameCdktn(e,r):this.convertPackageNameCdktf(e,r)}convertPackageNameCdktf(e,r){let n=e.replace("@cdktf/provider-","");switch(this.targetLanguage){case Di.Language.GO:return r?`${r}-go/${n}`:`github.com/cdktf/cdktf-provider-${n}-go/${n}`;case Di.Language.TYPESCRIPT:return e;case Di.Language.CSHARP:return"HashiCorp.Cdktf.Providers."+(0,$ue.toPascalCase)(n);case Di.Language.JAVA:return`com.hashicorp.cdktf-provider-${n}`;case Di.Language.PYTHON:return`cdktf-cdktf-provider-${n}`;default:throw new Error(`converting package name for language ${this.targetLanguage} not implemented yet`)}}convertPackageNameCdktn(e,r){let n=e.replace("@cdktn/provider-","");switch(this.targetLanguage){case Di.Language.GO:return r?`${r}-go/${n}`:`github.com/cdktn-io/cdktn-provider-${n}-go/${n}`;case Di.Language.TYPESCRIPT:return e;case Di.Language.CSHARP:return"Io.Cdktn.Providers."+(0,$ue.toPascalCase)(n);case Di.Language.JAVA:return`io.cdktn.cdktn-provider-${n}`;case Di.Language.PYTHON:return`cdktn-provider-${n}`;default:throw new Error(`converting package name for language ${this.targetLanguage} not implemented yet`)}}convertFromPackageNameToNpm(e){let n={[Di.Language.GO]:/github.com\/(?:cdktf|hashicorp|cdktn-io)\/cdkt([fn])-provider-(.+)-go\//i,[Di.Language.TYPESCRIPT]:/(.+)/i,[Di.Language.CSHARP]:/(?:HashiCorp|Io)\.Cdkt([fn])\.Providers\.(.+)/i,[Di.Language.JAVA]:/(?:com\.hashicorp|io\.cdktn)\.cdkt([fn])-provider-(.+)/i,[Di.Language.PYTHON]:/(?:cdktf-)?cdkt([fn])-provider-(.+)/i}[this.targetLanguage];if(!n)throw Di.Errors.Usage("Language not supported for pre-built providers");let i=n.exec(e);if(!i)throw new Error(`Package name is not in expected format: ${e}`);let a=`@cdkt${i[1]}/provider-`;switch(this.targetLanguage){case Di.Language.GO:return a+i[2];case Di.Language.TYPESCRIPT:return i[1];case Di.Language.CSHARP:return a+(0,$ue.toSnakeCase)(i[2]);case Di.Language.JAVA:return a+i[2];case Di.Language.PYTHON:return a+i[2];default:throw new Error(`converting package name for language ${this.targetLanguage} not implemented yet`)}}async allProviders(){let e=Sjt.CdktfConfig.read(),r=new Rjt.LocalProviderVersions,n=e.terraformProviders,i=await this.packageManager.listProviderPackages(),a=await Promise.all(i.map(async u=>{let l=this.convertFromPackageNameToNpm(u.name);return{...await(0,JD.getPrebuiltProviderVersionInformation)(l,u.version),packageName:u.name}})),s=new Tjt.LocalProviderConstraints;return{local:await Promise.all(n.map(async u=>{let l=QD.fromConfigEntry(u),f=await r.versionForProvider(l.simplifiedName),h=await s.constraintForProvider(l.simplifiedName);return{providerName:l.simplifiedName,providerConstraint:h||l.version,providerVersion:f}})),prebuilt:a}}};wu.DependencyManager=Jue});var hVe=x((FCr,Que)=>{"use strict";var pVe=require("fs");Que.exports=t=>new Promise(e=>{pVe.access(t,r=>{e(!r)})});Que.exports.sync=t=>{try{return pVe.accessSync(t),!0}catch{return!1}}});var gVe=x((OCr,ele)=>{"use strict";var mVe=(t,...e)=>new Promise(r=>{r(t(...e))});ele.exports=mVe;ele.exports.default=mVe});var yVe=x((kCr,tle)=>{"use strict";var Njt=gVe(),vVe=t=>{if(!((Number.isInteger(t)||t===1/0)&&t>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let e=[],r=0,n=()=>{r--,e.length>0&&e.shift()()},i=(o,u,...l)=>{r++;let f=Njt(o,...l);u(f),f.then(n,n)},a=(o,u,...l)=>{r<t?i(o,u,...l):e.push(i.bind(null,o,u,...l))},s=(o,...u)=>new Promise(l=>a(o,l,...u));return Object.defineProperties(s,{activeCount:{get:()=>r},pendingCount:{get:()=>e.length},clearQueue:{value:()=>{e.length=0}}}),s};tle.exports=vVe;tle.exports.default=vVe});var CVe=x((ZCr,_Ve)=>{"use strict";var bVe=yVe(),eU=class extends Error{constructor(e){super(),this.value=e}},Djt=(t,e)=>Promise.resolve(t).then(e),Gjt=t=>Promise.all(t).then(e=>e[1]===!0&&Promise.reject(new eU(e[0])));_Ve.exports=(t,e,r)=>{r=Object.assign({concurrency:1/0,preserveOrder:!0},r);let n=bVe(r.concurrency),i=[...t].map(s=>[s,n(Djt,s,e)]),a=bVe(r.preserveOrder?1:1/0);return Promise.all(i.map(s=>a(Gjt,s))).then(()=>{}).catch(s=>s instanceof eU?s.value:Promise.reject(s))}});var EVe=x((LCr,rle)=>{"use strict";var IVe=require("path"),SVe=hVe(),Fjt=CVe();rle.exports=(t,e)=>(e=Object.assign({cwd:process.cwd()},e),Fjt(t,r=>SVe(IVe.resolve(e.cwd,r)),e));rle.exports.sync=(t,e)=>{e=Object.assign({cwd:process.cwd()},e);for(let r of t)if(SVe.sync(IVe.resolve(e.cwd,r)))return r}});var wVe=x((WCr,nle)=>{"use strict";var c5=require("path"),xVe=EVe();nle.exports=(t,e={})=>{let r=c5.resolve(e.cwd||""),{root:n}=c5.parse(r),i=[].concat(t);return new Promise(a=>{(function s(o){xVe(i,{cwd:o}).then(u=>{u?a(c5.join(o,u)):o===n?a(null):s(c5.dirname(o))})})(r)})};nle.exports.sync=(t,e={})=>{let r=c5.resolve(e.cwd||""),{root:n}=c5.parse(r),i=[].concat(t);for(;;){let a=xVe.sync(i,{cwd:r});if(a)return c5.join(r,a);if(r===n)return null;r=c5.dirname(r)}}});var ale=x((VCr,ile)=>{"use strict";var AVe=wVe();ile.exports=async({cwd:t}={})=>AVe("package.json",{cwd:t});ile.exports.sync=({cwd:t}={})=>AVe.sync("package.json",{cwd:t})});var RVe=x(tU=>{"use strict";Object.defineProperty(tU,"__esModule",{value:!0});tU.substitute=void 0;function Ojt(t,e={}){for(let[r,n]of Object.entries({...e,"":""}))t=t.replace(new RegExp(`{{ *${kjt(r)} *}}`,"g"),n);return t}tU.substitute=Ojt;function kjt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}});var NVe=x(eb=>{"use strict";var Zjt=eb&&eb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ljt=eb&&eb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Wjt=eb&&eb.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&Zjt(e,t,r);return Ljt(e,t),e};Object.defineProperty(eb,"__esModule",{value:!0});eb.sscaff=void 0;var Rx=require("fs"),i4=Wjt(require("path")),TVe=RVe(),BVe=".hooks.sscaff.js";async function Vjt(t,e,r={}){t=i4.resolve(t),e=i4.resolve(e),await Rx.promises.mkdir(e,{recursive:!0});let n=u();r.$base||(r.$base=i4.basename(e));let i=process.cwd();try{process.chdir(e),await s(),await a("."),await o()}finally{process.chdir(i)}async function a(l){let f=i4.join(t,l);for(let h of await Rx.promises.readdir(f)){if(h===BVe)continue;let g=i4.join(f,h);if((await Rx.promises.stat(g)).isDirectory()){await a(i4.join(l,h));continue}let _=TVe.substitute(i4.join(l,h),r),w=await Rx.promises.readFile(g,"utf-8"),T=TVe.substitute(w.toString(),r);await Rx.promises.mkdir(i4.dirname(_),{recursive:!0}),await Rx.promises.writeFile(_,T)}}async function s(){n!=null&&n.pre&&await Promise.resolve(n.pre(r))}async function o(){n!=null&&n.post&&await Promise.resolve(n.post(r))}function u(){try{return require(i4.join(t,BVe))}catch{return}}}eb.sscaff=Vjt});var DVe=x(C3=>{"use strict";var Pjt=C3&&C3.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hjt=C3&&C3.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&Pjt(e,t,r)};Object.defineProperty(C3,"__esModule",{value:!0});Hjt(NVe(),C3)});var ule=x(qc=>{"use strict";var Mjt=qc&&qc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ujt=qc&&qc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),sle=qc&&qc.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Mjt(e,t,r);return Ujt(e,t),e};Object.defineProperty(qc,"__esModule",{value:!0});qc.determineDeps=qc.init=qc.templates=qc.templatesDir=void 0;var d5=sle(require("path")),ole=sle(Yl()),Yjt=sle(ale()),GVe=Ln(),jjt=DVe(),Xjt=require("cdktn/lib/features"),qjt=Yy(),zjt=lle(),Kjt=()=>{let t=Yjt.sync({cwd:__dirname});if(!t)throw new Error("unable to find package.json");return JSON.parse(ole.readFileSync(t,"utf-8"))},kVe=Kjt(),FVe=kVe.dependencies.constructs;qc.templatesDir=d5.join(__dirname,"..","..","templates");var $jt=ole.readdirSync(qc.templatesDir).filter(t=>!t.startsWith("."));qc.templates=[];for(let t of $jt)qc.templates.push(t);async function Jjt({cdktfVersion:t,destination:e,dist:r,projectId:n,projectInfo:i,templatePath:a,sendCrashReports:s,providers:o,providersForceLocal:u,silent:l}){let f=await ZVe(t,r,d5.basename(a)),h=Object.entries(Xjt.FUTURE_FLAGS).map(([w,T])=>` "${w}": "${T}"`).join(`,
162
162
  `);await(0,jjt.sscaff)(a,e,{...f,...i,futureFlags:h,projectId:n,sendCrashReports:s,silent:l});let g=qjt.CdktfConfig.read(e),_=!1;return o&&o.length&&(_=await(0,zjt.providerAdd)({providers:o,language:g.language,projectDirectory:e,forceLocal:u,dist:r})),_}qc.init=Jjt;var OVe={typescript:["npm_cdktf"],python:["pypi_cdktf"],"python-pip":["pypi_cdktf"],java:["mvn_cdktf"],csharp:["nuget_cdktf"],go:["go_cdktf"]};async function ZVe(t=kVe.version,e,r){let n=t.replace(/-pre\./g,".dev").replace(/-dev\./g,".dev");if(e){let a={npm_cdktf:d5.resolve(e,"js",`cdktn@${t}.jsii.tgz`),npm_cdktf_cli:d5.resolve(e,"js",`cdktn-cli-${t}.tgz`),pypi_cdktf:d5.resolve(e,"python",`cdktn-${n}-py3-none-any.whl`),mvn_cdktf:d5.resolve(e,"java",`io/cdktn/cdktn/${t}/cdktn-${t}.jar`),nuget_cdktf:d5.resolve(e,"dotnet",`Io.Cdktn.${t}.nupkg`),go_cdktf:d5.resolve(e,"go","cdktn")},s=r&&OVe[r]?OVe[r]:Object.keys(a);for(let u of s){let l=a[u];if(!await ole.pathExists(l))throw GVe.Errors.Internal(`unable to find ${l} under the "dist" directory (${e})`,new Error,{version:t})}return{...a,...{cdktf_version:t,constructs_version:FVe}}}if(t==="0.0.0")throw GVe.Errors.Usage('cannot use version 0.0.0, use --cdktf-version, --dist or CDKTF_DIST to install from a "dist" directory');let i=t.includes("-")?t:`^${t}`;return{cdktf_version:t,constructs_version:FVe,npm_cdktf:`cdktn@${i}`,npm_cdktf_cli:`cdktn-cli@${i}`,pypi_cdktf:`cdktn~=${n}`,mvn_cdktf:t,nuget_cdktf:t,go_cdktf:`v${t}`}}qc.determineDeps=ZVe});var lle=x(rU=>{"use strict";Object.defineProperty(rU,"__esModule",{value:!0});rU.providerAdd=void 0;var LVe=$_(),Qjt=ule();async function eXt({providers:t,language:e,projectDirectory:r,cdktfVersion:n,dist:i,forceLocal:a}){let s=n||(await(0,Qjt.determineDeps)(n,i)).cdktf_version,o=new LVe.DependencyManager(e,s,r),u=!1;for(let l of t){let f=LVe.ProviderConstraint.fromConfigEntry(l);if(a)u=!0,await o.addLocalProvider(f);else{let{addedLocalProvider:h}=await o.addProvider(f);h&&(u=!0)}}return u}rU.providerAdd=eXt});var nU=x(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});tb.AbstractTerraformPlan=tb.isTerraformOutput=tb.DeployingResourceApplyState=tb.PlannedResourceAction=void 0;var Tx;(function(t){t.CREATE="create",t.UPDATE="update",t.DELETE="delete",t.READ="read",t.NO_OP="no-op"})(Tx||(tb.PlannedResourceAction=Tx={}));var WVe;(function(t){t.WAITING="waiting",t.UPDATING="updating",t.UPDATED="updated",t.CREATING="creating",t.CREATED="created",t.DESTROYING="destroying",t.DESTROYED="destroyed",t.SUCCESS="success",t.ERROR="error"})(WVe||(tb.DeployingResourceApplyState=WVe={}));function tXt(t){return typeof t=="object"&&typeof t.sensitive=="boolean"&&(typeof t.type=="string"||Array.isArray(t.type))}tb.isTerraformOutput=tXt;function VVe(t){let e=[Tx.UPDATE,Tx.CREATE,Tx.DELETE,Tx.READ];return t.filter(r=>e.includes(r.action))}var cle=class{constructor(e,r,n){this.planFile=e,this.resourceChanges=r,this.outputChanges=n}get resources(){return(this.resourceChanges||[]).map(e=>({id:e.address,action:e.change.actions[0]}))}get applyableResources(){return VVe(this.resources)}get outputs(){return Object.entries(this.outputChanges||{}).map(([e,r])=>({id:`output.${e}`,action:r.actions[0]}))}get changingOutputs(){return VVe(this.outputs)}get needsApply(){return this.applyableResources.length>0||this.changingOutputs.length>0}};tb.AbstractTerraformPlan=cle});var I1=x(a4=>{"use strict";Object.defineProperty(a4,"__esModule",{value:!0});a4.__assign=function(){return a4.__assign=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},a4.__assign.apply(this,arguments)};function rXt(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function nXt(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function iXt(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a}function aXt(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}a4.__read=iXt;a4.__rest=rXt;a4.__spreadArray=aXt;a4.__values=nXt});var I3=x(f5=>{"use strict";Object.defineProperty(f5,"__esModule",{value:!0});f5.ActionTypes=void 0;(function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"})(f5.ActionTypes||(f5.ActionTypes={}));f5.SpecialTargets=void 0;(function(t){t.Parent="#_parent",t.Internal="#_internal"})(f5.SpecialTargets||(f5.SpecialTargets={}))});var Bx=x(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});var zc=I3(),sXt=zc.ActionTypes.Start,oXt=zc.ActionTypes.Stop,uXt=zc.ActionTypes.Raise,lXt=zc.ActionTypes.Send,cXt=zc.ActionTypes.Cancel,dXt=zc.ActionTypes.NullEvent,fXt=zc.ActionTypes.Assign,pXt=zc.ActionTypes.After,hXt=zc.ActionTypes.DoneState,mXt=zc.ActionTypes.Log,gXt=zc.ActionTypes.Init,vXt=zc.ActionTypes.Invoke,yXt=zc.ActionTypes.ErrorExecution,bXt=zc.ActionTypes.ErrorPlatform,_Xt=zc.ActionTypes.ErrorCustom,CXt=zc.ActionTypes.Update,IXt=zc.ActionTypes.Choose,SXt=zc.ActionTypes.Pure;Il.after=pXt;Il.assign=fXt;Il.cancel=cXt;Il.choose=IXt;Il.doneState=hXt;Il.error=_Xt;Il.errorExecution=yXt;Il.errorPlatform=bXt;Il.init=gXt;Il.invoke=vXt;Il.log=mXt;Il.nullEvent=dXt;Il.pure=SXt;Il.raise=uXt;Il.send=lXt;Il.start=sXt;Il.stop=oXt;Il.update=CXt});var iU=x(Nx=>{"use strict";Object.defineProperty(Nx,"__esModule",{value:!0});var EXt=".",xXt={},wXt="xstate.guard",AXt="";Nx.DEFAULT_GUARD_TYPE=wXt;Nx.EMPTY_ACTIVITY_MAP=xXt;Nx.STATE_DELIMITER=EXt;Nx.TARGETLESS_KEY=AXt});var s4=x(dle=>{"use strict";Object.defineProperty(dle,"__esModule",{value:!0});var RXt=process.env.NODE_ENV==="production";dle.IS_PRODUCTION=RXt});var j2=x(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});var sh=I1(),TXt=I3(),PVe=Bx(),eG=iU(),hle=s4(),aU;function BXt(t){return Object.keys(t)}function HVe(t,e,r){r===void 0&&(r=eG.STATE_DELIMITER);var n=fle(t,r),i=fle(e,r);return Y2(i)?Y2(n)?i===n:!1:Y2(n)?n in i:Object.keys(n).every(function(a){return a in i?HVe(n[a],i[a]):!1})}function NXt(t){try{return Y2(t)||typeof t=="number"?"".concat(t):t.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function DXt(t){try{return Y2(t)||typeof t=="number"?"".concat(t):rb(t)?t.name:t.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function MVe(t,e){try{return sU(t)?t:t.toString().split(e)}catch{throw new Error("'".concat(t,"' is not a valid state path."))}}function UVe(t){return typeof t=="object"&&"value"in t&&"context"in t&&"event"in t&&"_event"in t}function fle(t,e){if(UVe(t))return t.value;if(sU(t))return ple(t);if(typeof t!="string")return t;var r=MVe(t,e);return ple(r)}function ple(t){if(t.length===1)return t[0];for(var e={},r=e,n=0;n<t.length-1;n++)n===t.length-2?r[t[n]]=t[n+1]:(r[t[n]]={},r=r[t[n]]);return e}function YVe(t,e){for(var r={},n=Object.keys(t),i=0;i<n.length;i++){var a=n[i];r[a]=e(t[a],a,t,i)}return r}function GXt(t,e,r){var n,i,a={};try{for(var s=sh.__values(Object.keys(t)),o=s.next();!o.done;o=s.next()){var u=o.value,l=t[u];r(l)&&(a[u]=e(l,u,t))}}catch(f){n={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return a}var FXt=function(t){return function(e){var r,n,i=e;try{for(var a=sh.__values(t),s=a.next();!s.done;s=a.next()){var o=s.value;i=i[o]}}catch(u){r={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}};function OXt(t,e){return function(r){var n,i,a=r;try{for(var s=sh.__values(t),o=s.next();!o.done;o=s.next()){var u=o.value;a=a[e][u]}}catch(l){n={error:l}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return a}}function jVe(t){if(!t)return[[]];if(Y2(t))return[[t]];var e=XVe(Object.keys(t).map(function(r){var n=t[r];return typeof n!="string"&&(!n||!Object.keys(n).length)?[[r]]:jVe(t[r]).map(function(i){return[r].concat(i)})}));return e}function kXt(t){var e,r,n={};if(t&&t.length===1&&t[0].length===1)return t[0][0];try{for(var i=sh.__values(t),a=i.next();!a.done;a=i.next())for(var s=a.value,o=n,u=0;u<s.length;u++){var l=s[u];if(u===s.length-2){o[l]=s[u+1];break}o[l]=o[l]||{},o=o[l]}}catch(f){e={error:f}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}function XVe(t){var e;return(e=[]).concat.apply(e,sh.__spreadArray([],sh.__read(t),!1))}function mle(t){return sU(t)?t:[t]}function qVe(t){return t===void 0?[]:mle(t)}function ZXt(t,e,r){var n,i;if(rb(t))return t(e,r.data);var a={};try{for(var s=sh.__values(Object.keys(t)),o=s.next();!o.done;o=s.next()){var u=o.value,l=t[u];rb(l)?a[u]=l(e,r.data):a[u]=l}}catch(f){n={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return a}function LXt(t){return/^(done|error)\./.test(t)}function WXt(t){return!!(t instanceof Promise||t!==null&&(rb(t)||typeof t=="object")&&rb(t.then))}function VXt(t){return t!==null&&typeof t=="object"&&"transition"in t&&typeof t.transition=="function"}function PXt(t,e){var r,n,i=sh.__read([[],[]],2),a=i[0],s=i[1];try{for(var o=sh.__values(t),u=o.next();!u.done;u=o.next()){var l=u.value;e(l)?a.push(l):s.push(l)}}catch(f){r={error:f}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return[a,s]}function gle(t,e){return YVe(t.states,function(r,n){if(r){var i=(Y2(e)?void 0:e[n])||(r?r.current:void 0);if(i)return{current:i,states:gle(r,i)}}})}function HXt(t,e){return{current:e,states:gle(t,e)}}function MXt(t,e,r,n){hle.IS_PRODUCTION||Rn.warn(!!t,"Attempting to update undefined context");var i=t&&r.reduce(function(a,s){var o,u,l=s.assignment,f={state:n,action:s,_event:e},h={};if(rb(l))h=l(a,e.data,f);else try{for(var g=sh.__values(Object.keys(l)),_=g.next();!_.done;_=g.next()){var w=_.value,T=l[w];h[w]=rb(T)?T(a,e.data,f):T}}catch(D){o={error:D}}finally{try{_&&!_.done&&(u=g.return)&&u.call(g)}finally{if(o)throw o.error}}return Object.assign({},a,h)},t);return i}Rn.warn=function(){};hle.IS_PRODUCTION||(Rn.warn=function(t,e){var r=t instanceof Error?t:void 0;if(!(!r&&t)&&console!==void 0){var n=["Warning: ".concat(e)];r&&n.push(r),console.warn.apply(console,n)}});function sU(t){return Array.isArray(t)}function rb(t){return typeof t=="function"}function Y2(t){return typeof t=="string"}function UXt(t,e){if(t)return Y2(t)?{type:eG.DEFAULT_GUARD_TYPE,name:t,predicate:e?e[t]:void 0}:rb(t)?{type:eG.DEFAULT_GUARD_TYPE,name:t.name,predicate:t}:t}function YXt(t){try{return"subscribe"in t&&rb(t.subscribe)}catch{return!1}}var zVe=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),jXt=(aU={},aU[zVe]=function(){return this},aU[Symbol.observable]=function(){return this},aU);function KVe(t){return!!t&&"__xstatenode"in t}function XXt(t){return!!t&&typeof t.send=="function"}var qXt=(function(){var t=0;return function(){return t++,t.toString(16)}})();function $Ve(t,e){return Y2(t)||typeof t=="number"?sh.__assign({type:t},e):t}function zXt(t,e){if(!Y2(t)&&"$$type"in t&&t.$$type==="scxml")return t;var r=$Ve(t);return sh.__assign({name:r.type,data:r,$$type:"scxml",type:"external"},e)}function KXt(t,e){var r=mle(e).map(function(n){return typeof n>"u"||typeof n=="string"||KVe(n)?{target:n,event:t}:sh.__assign(sh.__assign({},n),{event:t})});return r}function $Xt(t){if(!(t===void 0||t===eG.TARGETLESS_KEY))return qVe(t)}function JXt(t,e,r){if(!hle.IS_PRODUCTION){var n=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";if(t===e)console.error("Missing onError handler for invocation '".concat(r,"', error was '").concat(t,"'.").concat(n));else{var i=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(r,"'. ")+"Original error: '".concat(t,"'. ").concat(n," Current error is '").concat(e,"'.").concat(i))}}}function QXt(t,e,r,n,i){var a=t.options.guards,s={state:i,cond:e,_event:n};if(e.type===eG.DEFAULT_GUARD_TYPE)return((a==null?void 0:a[e.name])||e.predicate)(r,n.data,s);var o=a==null?void 0:a[e.type];if(!o)throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return o(r,n.data,s)}function eqt(t){return typeof t=="string"?{type:t}:t}function tqt(t,e,r){var n=function(){},i=typeof t=="object",a=i?t:null;return{next:((i?t.next:t)||n).bind(a),error:((i?t.error:e)||n).bind(a),complete:((i?t.complete:r)||n).bind(a)}}function rqt(t,e){return"".concat(t,":invocation[").concat(e,"]")}function nqt(t){return(t.type===PVe.raise||t.type===PVe.send&&t.to===TXt.SpecialTargets.Internal)&&typeof t.delay!="number"}Rn.createInvokeId=rqt;Rn.evaluateGuard=QXt;Rn.flatten=XVe;Rn.getActionType=DXt;Rn.getEventType=NXt;Rn.interopSymbols=jXt;Rn.isActor=XXt;Rn.isArray=sU;Rn.isBehavior=VXt;Rn.isBuiltInEvent=LXt;Rn.isFunction=rb;Rn.isMachine=KVe;Rn.isObservable=YXt;Rn.isPromiseLike=WXt;Rn.isRaisableAction=nqt;Rn.isStateLike=UVe;Rn.isString=Y2;Rn.keys=BXt;Rn.mapContext=ZXt;Rn.mapFilterValues=GXt;Rn.mapValues=YVe;Rn.matchesState=HVe;Rn.nestedPath=OXt;Rn.normalizeTarget=$Xt;Rn.partition=PXt;Rn.path=FXt;Rn.pathToStateValue=ple;Rn.pathsToStateValue=kXt;Rn.reportUnhandledExceptionOnInvocation=JXt;Rn.symbolObservable=zVe;Rn.toArray=qVe;Rn.toArrayStrict=mle;Rn.toEventObject=$Ve;Rn.toGuard=UXt;Rn.toInvokeSource=eqt;Rn.toObserver=tqt;Rn.toSCXMLEvent=zXt;Rn.toStatePath=MVe;Rn.toStatePaths=jVe;Rn.toStateValue=fle;Rn.toTransitionConfigArray=KXt;Rn.uniqueId=qXt;Rn.updateContext=MXt;Rn.updateHistoryStates=gle;Rn.updateHistoryValue=HXt});var Dx=x(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});var La=I1(),dg=I3(),Kc=Bx(),la=j2(),JVe=s4(),iqt=la.toSCXMLEvent({type:Kc.init});function vle(t,e){return e&&e[t]||void 0}function oU(t,e){var r;if(la.isString(t)||typeof t=="number"){var n=vle(t,e);la.isFunction(n)?r={type:t,exec:n}:n?r=n:r={type:t,exec:void 0}}else if(la.isFunction(t))r={type:t.name||t.toString(),exec:t};else{var n=vle(t.type,e);if(la.isFunction(n))r=La.__assign(La.__assign({},t),{exec:n});else if(n){var i=n.type||t.type;r=La.__assign(La.__assign(La.__assign({},n),t),{type:i})}else r=t}return r}var yle=function(t,e){if(!t)return[];var r=la.isArray(t)?t:[t];return r.map(function(n){return oU(n,e)})};function _le(t){var e=oU(t);return La.__assign(La.__assign({id:la.isString(t)?t:e.id},e),{type:e.type})}function aqt(t,e){return{type:Kc.raise,event:typeof t=="function"?t:la.toEventObject(t),delay:e?e.delay:void 0,id:e==null?void 0:e.id}}function QVe(t,e,r,n){var i={_event:r},a=la.toSCXMLEvent(la.isFunction(t.event)?t.event(e,r.data,i):t.event),s;if(la.isString(t.delay)){var o=n&&n[t.delay];s=la.isFunction(o)?o(e,r.data,i):o}else s=la.isFunction(t.delay)?t.delay(e,r.data,i):t.delay;return La.__assign(La.__assign({},t),{type:Kc.raise,_event:a,delay:s})}function tG(t,e){return{to:e?e.to:void 0,type:Kc.send,event:la.isFunction(t)?t:la.toEventObject(t),delay:e?e.delay:void 0,id:e&&e.id!==void 0?e.id:la.isFunction(t)?t.name:la.getEventType(t)}}function ePe(t,e,r,n){var i={_event:r},a=la.toSCXMLEvent(la.isFunction(t.event)?t.event(e,r.data,i):t.event),s;if(la.isString(t.delay)){var o=n&&n[t.delay];s=la.isFunction(o)?o(e,r.data,i):o}else s=la.isFunction(t.delay)?t.delay(e,r.data,i):t.delay;var u=la.isFunction(t.to)?t.to(e,r.data,i):t.to;return La.__assign(La.__assign({},t),{to:u,_event:a,event:a.data,delay:s})}function Cle(t,e){return tG(t,La.__assign(La.__assign({},e),{to:dg.SpecialTargets.Parent}))}function sqt(t,e,r){return tG(e,La.__assign(La.__assign({},r),{to:t}))}function oqt(){return Cle(Kc.update)}function uqt(t,e){return tG(t,La.__assign(La.__assign({},e),{to:function(r,n,i){var a=i._event;return a.origin}}))}var lqt=function(t,e){return{context:t,event:e}};function cqt(t,e){return t===void 0&&(t=lqt),{type:Kc.log,label:e,expr:t}}var tPe=function(t,e,r){return La.__assign(La.__assign({},t),{value:la.isString(t.expr)?t.expr:t.expr(e,r.data,{_event:r})})},dqt=function(t){return{type:Kc.cancel,sendId:t}};function fqt(t){var e=_le(t);return{type:dg.ActionTypes.Start,activity:e,exec:void 0}}function pqt(t){var e=la.isFunction(t)?t:_le(t);return{type:dg.ActionTypes.Stop,activity:e,exec:void 0}}function rPe(t,e,r){var n=la.isFunction(t.activity)?t.activity(e,r.data):t.activity,i=typeof n=="string"?{id:n}:n,a={type:dg.ActionTypes.Stop,activity:i};return a}var hqt=function(t){return{type:Kc.assign,assignment:t}};function mqt(t){return typeof t=="object"&&"type"in t}function gqt(t,e){var r=e?"#".concat(e):"";return"".concat(dg.ActionTypes.After,"(").concat(t,")").concat(r)}function vqt(t,e){var r="".concat(dg.ActionTypes.DoneState,".").concat(t),n={type:r,data:e};return n.toString=function(){return r},n}function yqt(t,e){var r="".concat(dg.ActionTypes.DoneInvoke,".").concat(t),n={type:r,data:e};return n.toString=function(){return r},n}function bqt(t,e){var r="".concat(dg.ActionTypes.ErrorPlatform,".").concat(t),n={type:r,data:e};return n.toString=function(){return r},n}function _qt(t){return{type:dg.ActionTypes.Pure,get:t}}function Cqt(t,e){if(!JVe.IS_PRODUCTION&&(!t||typeof t=="function")){var r=t;t=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=typeof r=="function"?r.apply(void 0,La.__spreadArray([],La.__read(n),!1)):r;if(!a)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return a}}return tG(function(n,i){return i},La.__assign(La.__assign({},e),{to:t}))}function Iqt(t,e){return Cle(function(r,n,i){return{type:Kc.error,data:la.isFunction(t)?t(r,n,i):t}},La.__assign(La.__assign({},e),{to:dg.SpecialTargets.Parent}))}function Sqt(t){return{type:dg.ActionTypes.Choose,conds:t}}var Eqt=function(t){var e,r,n=[];try{for(var i=La.__values(t),a=i.next();!a.done;a=i.next())for(var s=a.value,o=0;o<s.actions.length;){if(s.actions[o].type===Kc.assign){n.push(s.actions[o]),s.actions.splice(o,1);continue}o++}}catch(u){e={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n};function ble(t,e,r,n,i,a,s){s===void 0&&(s=!1);var o=s?[]:Eqt(i),u=o.length?la.updateContext(r,n,o,e):r,l=s?[r]:void 0,f=[];function h(w,T){var D;switch(T.type){case Kc.raise:{var G=QVe(T,u,n,t.options.delays);return a&&typeof G.delay=="number"&&a(G,u,n),G}case Kc.send:var O=ePe(T,u,n,t.options.delays);if(!JVe.IS_PRODUCTION){var Z=T.delay;la.warn(!la.isString(Z)||typeof O.delay=="number","No delay reference for delay expression '".concat(Z,"' was found on machine '").concat(t.id,"'"))}return a&&O.to!==dg.SpecialTargets.Internal&&(w==="entry"?f.push(O):a(O,u,n)),O;case Kc.log:{var X=tPe(T,u,n);return a==null||a(X,u,n),X}case Kc.choose:{var ue=T,Q=(D=ue.conds.find(function(_e){var Fe=la.toGuard(_e.cond,t.options.guards);return!Fe||la.evaluateGuard(t,Fe,u,n,a?void 0:e)}))===null||D===void 0?void 0:D.actions;if(!Q)return[];var ie=La.__read(ble(t,e,u,n,[{type:w,actions:yle(la.toArray(Q),t.options.actions)}],a,s),2),M=ie[0],ne=ie[1];return u=ne,l==null||l.push(u),M}case Kc.pure:{var Q=T.get(u,n.data);if(!Q)return[];var Te=La.__read(ble(t,e,u,n,[{type:w,actions:yle(la.toArray(Q),t.options.actions)}],a,s),2),J=Te[0],ke=Te[1];return u=ke,l==null||l.push(u),J}case Kc.stop:{var X=rPe(T,u,n);return a==null||a(X,r,n),X}case Kc.assign:{u=la.updateContext(u,n,[T],a?void 0:e),l==null||l.push(u);break}default:var xe=oU(T,t.options.actions),le=xe.exec;if(a)a(xe,u,n);else if(le&&l){var H=l.length-1,j=La.__assign(La.__assign({},xe),{exec:function(_e){for(var Fe=[],rt=1;rt<arguments.length;rt++)Fe[rt-1]=arguments[rt];le.apply(void 0,La.__spreadArray([l[H]],La.__read(Fe),!1))}});xe=j}return xe}}function g(w){var T,D,G=[];try{for(var O=La.__values(w.actions),Z=O.next();!Z.done;Z=O.next()){var X=Z.value,ue=h(w.type,X);ue&&(G=G.concat(ue))}}catch(Q){T={error:Q}}finally{try{Z&&!Z.done&&(D=O.return)&&D.call(O)}finally{if(T)throw T.error}}return f.forEach(function(Q){a(Q,u,n)}),f.length=0,G}var _=la.flatten(i.map(g));return[_,u]}Wa.actionTypes=Kc;Wa.after=gqt;Wa.assign=hqt;Wa.cancel=dqt;Wa.choose=Sqt;Wa.done=vqt;Wa.doneInvoke=yqt;Wa.error=bqt;Wa.escalate=Iqt;Wa.forwardTo=Cqt;Wa.getActionFunction=vle;Wa.initEvent=iqt;Wa.isActionObject=mqt;Wa.log=cqt;Wa.pure=_qt;Wa.raise=aqt;Wa.resolveActions=ble;Wa.resolveLog=tPe;Wa.resolveRaise=QVe;Wa.resolveSend=ePe;Wa.resolveStop=rPe;Wa.respond=uqt;Wa.send=tG;Wa.sendParent=Cle;Wa.sendTo=sqt;Wa.sendUpdate=oqt;Wa.start=fqt;Wa.stop=pqt;Wa.toActionObject=oU;Wa.toActionObjects=yle;Wa.toActivityDefinition=_le});var Ile=x(lU=>{"use strict";Object.defineProperty(lU,"__esModule",{value:!0});var uU=[],xqt=function(t,e){uU.push(t);var r=e(t);return uU.pop(),r},wqt=function(t){return t(uU[uU.length-1])};lU.consume=wqt;lU.provide=xqt});var nG=x(p5=>{"use strict";Object.defineProperty(p5,"__esModule",{value:!0});var Aqt=I1(),rG=j2(),Rqt=Ile();function Sle(t){var e;return e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}},e[rG.symbolObservable]=function(){return this},e}function Tqt(t,e,r,n){var i,a=rG.toInvokeSource(t.src),s=(i=e==null?void 0:e.options.services)===null||i===void 0?void 0:i[a.type],o=t.data?rG.mapContext(t.data,r,n):void 0,u=s?nPe(s,t.id,o):Sle(t.id);return u.meta=t,u}function nPe(t,e,r){var n=Sle(e);if(n.deferred=!0,rG.isMachine(t)){var i=n.state=Rqt.provide(void 0,function(){return(r?t.withContext(r):t).initialState});n.getSnapshot=function(){return i}}return n}function iPe(t){try{return typeof t.send=="function"}catch{return!1}}function Bqt(t){return iPe(t)&&"id"in t}function Nqt(t){var e;return Aqt.__assign((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},e[rG.symbolObservable]=function(){return this},e),t)}p5.createDeferredActor=nPe;p5.createInvocableActor=Tqt;p5.createNullActor=Sle;p5.isActor=iPe;p5.isSpawnedActor=Bqt;p5.toActorRef=Nqt});var wle=x(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var o4=I1(),Ele=j2(),xle=function(t){return t.type==="atomic"||t.type==="final"};function aPe(t){return Object.keys(t.states).map(function(e){return t.states[e]})}function iG(t){return aPe(t).filter(function(e){return e.type!=="history"})}function sPe(t){var e=[t];return xle(t)?e:e.concat(Ele.flatten(iG(t).map(sPe)))}function oPe(t,e){var r,n,i,a,s,o,u,l,f=new Set(t),h=cU(f),g=new Set(e);try{for(var _=o4.__values(g),w=_.next();!w.done;w=_.next())for(var T=w.value,D=T.parent;D&&!g.has(D);)g.add(D),D=D.parent}catch(ne){r={error:ne}}finally{try{w&&!w.done&&(n=_.return)&&n.call(_)}finally{if(r)throw r.error}}var G=cU(g);try{for(var O=o4.__values(g),Z=O.next();!Z.done;Z=O.next()){var T=Z.value;if(T.type==="compound"&&(!G.get(T)||!G.get(T).length))h.get(T)?h.get(T).forEach(function(Te){return g.add(Te)}):T.initialStateNodes.forEach(function(Te){return g.add(Te)});else if(T.type==="parallel")try{for(var X=(s=void 0,o4.__values(iG(T))),ue=X.next();!ue.done;ue=X.next()){var Q=ue.value;g.has(Q)||(g.add(Q),h.get(Q)?h.get(Q).forEach(function(Te){return g.add(Te)}):Q.initialStateNodes.forEach(function(Te){return g.add(Te)}))}}catch(Te){s={error:Te}}finally{try{ue&&!ue.done&&(o=X.return)&&o.call(X)}finally{if(s)throw s.error}}}}catch(ne){i={error:ne}}finally{try{Z&&!Z.done&&(a=O.return)&&a.call(O)}finally{if(i)throw i.error}}try{for(var ie=o4.__values(g),M=ie.next();!M.done;M=ie.next())for(var T=M.value,D=T.parent;D&&!g.has(D);)g.add(D),D=D.parent}catch(ne){u={error:ne}}finally{try{M&&!M.done&&(l=ie.return)&&l.call(ie)}finally{if(u)throw u.error}}return g}function uPe(t,e){var r=e.get(t);if(!r)return{};if(t.type==="compound"){var n=r[0];if(n){if(xle(n))return n.key}else return{}}var i={};return r.forEach(function(a){i[a.key]=uPe(a,e)}),i}function cU(t){var e,r,n=new Map;try{for(var i=o4.__values(t),a=i.next();!a.done;a=i.next()){var s=a.value;n.has(s)||n.set(s,[]),s.parent&&(n.has(s.parent)||n.set(s.parent,[]),n.get(s.parent).push(s))}}catch(o){e={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}function Dqt(t,e){var r=oPe([t],e);return uPe(t,cU(r))}function lPe(t,e){return Array.isArray(t)?t.some(function(r){return r===e}):t instanceof Set?t.has(e):!1}function Gqt(t){return o4.__spreadArray([],o4.__read(new Set(Ele.flatten(o4.__spreadArray([],o4.__read(t.map(function(e){return e.ownEvents})),!1)))),!1)}function cPe(t,e){return e.type==="compound"?iG(e).some(function(r){return r.type==="final"&&lPe(t,r)}):e.type==="parallel"?iG(e).every(function(r){return cPe(t,r)}):!1}function Fqt(t){return t===void 0&&(t=[]),t.reduce(function(e,r){return r.meta!==void 0&&(e[r.id]=r.meta),e},{})}function Oqt(t){return new Set(Ele.flatten(t.map(function(e){return e.tags})))}oh.getAdjList=cU;oh.getAllChildren=aPe;oh.getAllStateNodes=sPe;oh.getChildren=iG;oh.getConfiguration=oPe;oh.getMeta=Fqt;oh.getTagsFromConfiguration=Oqt;oh.getValue=Dqt;oh.has=lPe;oh.isInFinalState=cPe;oh.isLeafNode=xle;oh.nextEvents=Gqt});var sG=x(E3=>{"use strict";Object.defineProperty(E3,"__esModule",{value:!0});var S3=I1(),dPe=iU(),aG=j2(),fPe=wle(),pPe=Dx(),kqt=s4();function hPe(t,e){if(t===e)return!0;if(t===void 0||e===void 0)return!1;if(aG.isString(t)||aG.isString(e))return t===e;var r=Object.keys(t),n=Object.keys(e);return r.length===n.length&&r.every(function(i){return hPe(t[i],e[i])})}function mPe(t){return typeof t!="object"||t===null?!1:"value"in t&&"_event"in t}var Zqt=mPe;function Lqt(t,e){var r=t.exec,n=S3.__assign(S3.__assign({},t),{exec:r!==void 0?function(){return r(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0});return n}var Wqt=(function(){function t(e){var r=this,n;this.actions=[],this.activities=dPe.EMPTY_ACTIVITY_MAP,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||dPe.EMPTY_ACTIVITY_MAP,this.meta=fPe.getMeta(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=(n=Array.isArray(e.tags)?new Set(e.tags):e.tags)!==null&&n!==void 0?n:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return fPe.nextEvents(r.configuration)}})}return t.from=function(e,r){if(e instanceof t)return e.context!==r?new t({value:e.value,context:r,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):e;var n=pPe.initEvent;return new t({value:e,context:r,_event:n,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(e){return new t(e)},t.inert=function(e,r){if(e instanceof t){if(!e.actions.length)return e;var n=pPe.initEvent;return new t({value:e.value,context:r,_event:n,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,r)},t.prototype.toStrings=function(e,r){var n=this;if(e===void 0&&(e=this.value),r===void 0&&(r="."),aG.isString(e))return[e];var i=Object.keys(e);return i.concat.apply(i,S3.__spreadArray([],S3.__read(i.map(function(a){return n.toStrings(e[a],r).map(function(s){return a+r+s})})),!1))},t.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var r=e.tags;e.machine;var n=S3.__rest(e,["configuration","transitions","tags","machine"]);return S3.__assign(S3.__assign({},n),{tags:Array.from(r)})},t.prototype.matches=function(e){return aG.matchesState(e,this.value)},t.prototype.hasTag=function(e){return this.tags.has(e)},t.prototype.can=function(e){var r;kqt.IS_PRODUCTION&&aG.warn(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=(r=this.machine)===null||r===void 0?void 0:r.getTransitionData(this,e);return!!(n!=null&&n.transitions.length)&&n.transitions.some(function(i){return i.target!==void 0||i.actions.length})},t})();E3.State=Wqt;E3.bindActionToState=Lqt;E3.isState=Zqt;E3.isStateConfig=mPe;E3.stateValuesEqual=hPe});var vPe=x(Ale=>{"use strict";Object.defineProperty(Ale,"__esModule",{value:!0});var gPe=I1(),Vqt={deferEvents:!1},Pqt=(function(){function t(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=gPe.__assign(gPe.__assign({},Vqt),e)}return t.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents){this.schedule(e);return}this.process(e)}this.flushEvents()},t.prototype.schedule=function(e){if(!this.initialized||this.processingEvent){this.queue.push(e);return}if(this.queue.length!==0)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},t.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(r){throw this.clear(),r}finally{this.processingEvent=!1}},t})();Ale.Scheduler=Pqt});var yPe=x(Tle=>{"use strict";Object.defineProperty(Tle,"__esModule",{value:!0});var Rle=new Map,Hqt=0,Mqt={bookId:function(){return"x:".concat(Hqt++)},register:function(t,e){return Rle.set(t,e),t},get:function(t){return Rle.get(t)},free:function(t){Rle.delete(t)}};Tle.registry=Mqt});var bPe=x(dU=>{"use strict";Object.defineProperty(dU,"__esModule",{value:!0});var Uqt=s4();function Ble(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;Uqt.IS_PRODUCTION||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues")}function Yqt(){var t=Ble();if(t&&"__xstate__"in t)return t.__xstate__}function jqt(t){if(Ble()){var e=Yqt();e&&e.register(t)}}dU.getGlobal=Ble;dU.registerService=jqt});var Nle=x(oG=>{"use strict";Object.defineProperty(oG,"__esModule",{value:!0});var _Pe=Dx(),Xqt=nG(),qqt=j2();function zqt(t,e){return{transition:t,initialState:e}}function Kqt(t){var e={error:void 0,data:void 0,status:"pending"};return{transition:function(r,n,i){var a=i.parent,s=i.id,o=i.observers;switch(n.type){case"fulfill":return a==null||a.send(_Pe.doneInvoke(s,n.data)),{error:void 0,data:n.data,status:"fulfilled"};case"reject":return a==null||a.send(_Pe.error(s,n.error)),o.forEach(function(u){u.error(n.error)}),{error:n.error,data:void 0,status:"rejected"};default:return r}},initialState:e,start:function(r){var n=r.self;return t().then(function(i){n.send({type:"fulfill",data:i})},function(i){n.send({type:"reject",error:i})}),e}}}function $qt(t,e){e===void 0&&(e={});var r=t.initialState,n=new Set,i=[],a=!1,s=function(){if(!a){for(a=!0;i.length>0;){var l=i.shift();r=t.transition(r,l,u),n.forEach(function(f){return f.next(r)})}a=!1}},o=Xqt.toActorRef({id:e.id,send:function(l){i.push(l),s()},getSnapshot:function(){return r},subscribe:function(l,f,h){var g=qqt.toObserver(l,f,h);return n.add(g),g.next(r),{unsubscribe:function(){n.delete(g)}}}}),u={parent:e.parent,self:o,id:e.id||"anonymous",observers:n};return r=t.start?t.start(u):r,o}oG.fromPromise=Kqt;oG.fromReducer=zqt;oG.spawnBehavior=$qt});var xPe=x(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});var _a=I1(),Dle=I3(),fU=sG(),nb=Bx(),S1=Dx(),u4=s4(),dn=j2(),CPe=vPe(),Gle=nG(),uG=yPe(),IPe=bPe(),Gx=Ile(),Jqt=Nle(),Fle={sync:!1,autoForward:!1};yo.InterpreterStatus=void 0;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(yo.InterpreterStatus||(yo.InterpreterStatus={}));var SPe=(function(){function t(e,r){r===void 0&&(r=t.defaultOptions);var n=this;this.machine=e,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=yo.InterpreterStatus.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(f,h){if(dn.isArray(f))return n.batch(f),n.state;var g=dn.toSCXMLEvent(dn.toEventObject(f,h));if(n.status===yo.InterpreterStatus.Stopped)return u4.IS_PRODUCTION||dn.warn(!1,'Event "'.concat(g.name,'" was sent to stopped service "').concat(n.machine.id,`". This service has already reached its final state, and will not transition.
163
163
  Event: `).concat(JSON.stringify(g.data))),n.state;if(n.status!==yo.InterpreterStatus.Running&&!n.options.deferEvents)throw new Error('Event "'.concat(g.name,'" was sent to uninitialized service "').concat(n.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
164
164
  Event: `).concat(JSON.stringify(g.data)));return n.scheduler.schedule(function(){n.forward(g);var _=n._nextState(g);n.update(_,g)}),n._state},this.sendTo=function(f,h,g){var _=n.parent&&(h===Dle.SpecialTargets.Parent||n.parent.id===h),w=_?n.parent:dn.isString(h)?h===Dle.SpecialTargets.Internal?n:n.children.get(h)||uG.registry.get(h):dn.isActor(h)?h:void 0;if(!w){if(!_)throw new Error("Unable to send event to child '".concat(h,"' from service '").concat(n.id,"'."));u4.IS_PRODUCTION||dn.warn(!1,"Service '".concat(n.id,"' has no parent: unable to send event ").concat(f.type));return}if("machine"in w){if(n.status!==yo.InterpreterStatus.Stopped||n.parent!==w||n.state.done){var T=_a.__assign(_a.__assign({},f),{name:f.name===nb.error?"".concat(S1.error(n.id)):f.name,origin:n.sessionId});!g&&n.machine.config.predictableActionArguments?n._outgoingQueue.push([w,T]):w.send(T)}}else!g&&n.machine.config.predictableActionArguments?n._outgoingQueue.push([w,f.data]):w.send(f.data)},this._exec=function(f,h,g,_){_===void 0&&(_=n.machine.options.actions);var w=f.exec||S1.getActionFunction(f.type,_),T=dn.isFunction(w)?w:w?w.exec:f.exec;if(T)try{return T(h,g.data,n.machine.config.predictableActionArguments?{action:f,_event:g}:{action:f,state:n.state,_event:g})}catch(le){throw n.parent&&n.parent.send({type:"xstate.error",data:le}),le}switch(f.type){case nb.raise:{var D=f;n.defer(D);break}case nb.send:var G=f;if(typeof G.delay=="number"){n.defer(G);return}else G.to?n.sendTo(G._event,G.to,g===S1.initEvent):n.send(G._event);break;case nb.cancel:n.cancel(f.sendId);break;case nb.start:{if(n.status!==yo.InterpreterStatus.Running)return;var O=f.activity;if(!n.machine.config.predictableActionArguments&&!n.state.activities[O.id||O.type])break;if(O.type===Dle.ActionTypes.Invoke){var Z=dn.toInvokeSource(O.src),X=n.machine.options.services?n.machine.options.services[Z.type]:void 0,ue=O.id,Q=O.data;u4.IS_PRODUCTION||dn.warn(!("forward"in O),"`forward` property is deprecated (found in invocation of '".concat(O.src,"' in in machine '").concat(n.machine.id,"'). ")+"Please use `autoForward` instead.");var ie="autoForward"in O?O.autoForward:!!O.forward;if(!X){u4.IS_PRODUCTION||dn.warn(!1,"No service found for invocation '".concat(O.src,"' in machine '").concat(n.machine.id,"'."));return}var M=Q?dn.mapContext(Q,h,g):void 0;if(typeof X=="string")return;var ne=dn.isFunction(X)?X(h,g.data,{data:M,src:Z,meta:O.meta}):X;if(!ne)return;var Te=void 0;dn.isMachine(ne)&&(ne=M?ne.withContext(M):ne,Te={autoForward:ie}),n.spawn(ne,ue,Te)}else n.spawnActivity(O);break}case nb.stop:{n.stopChild(f.activity.id);break}case nb.log:var J=f,ke=J.label,xe=J.value;ke?n.logger(ke,xe):n.logger(xe);break;default:u4.IS_PRODUCTION||dn.warn(!1,"No implementation found for action type '".concat(f.type,"'"));break}};var i=_a.__assign(_a.__assign({},t.defaultOptions),r),a=i.clock,s=i.logger,o=i.parent,u=i.id,l=u!==void 0?u:e.id;this.id=l,this.logger=s,this.clock=a,this.parent=o,this.options=i,this.scheduler=new CPe.Scheduler({deferEvents:this.options.deferEvents}),this.sessionId=uG.registry.bookId()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:Gx.provide(this,function(){return e._initialState=e.machine.initialState,e._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return u4.IS_PRODUCTION||dn.warn(this.status!==yo.InterpreterStatus.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(e,r){var n,i;try{for(var a=_a.__values(e.actions),s=a.next();!s.done;s=a.next()){var o=s.value;this.exec(o,e,r)}}catch(u){n={error:u}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},t.prototype.update=function(e,r){var n,i,a,s,o,u,l,f,h=this;if(e._sessionid=this.sessionId,this._state=e,(!this.machine.config.predictableActionArguments||r===S1.initEvent)&&this.options.execute)this.execute(this.state);else for(var g=void 0;g=this._outgoingQueue.shift();)g[0].send(g[1]);if(this.children.forEach(function(ne){h.state.children[ne.id]=ne}),this.devTools&&this.devTools.send(r.data,e),e.event)try{for(var _=_a.__values(this.eventListeners),w=_.next();!w.done;w=_.next()){var T=w.value;T(e.event)}}catch(ne){n={error:ne}}finally{try{w&&!w.done&&(i=_.return)&&i.call(_)}finally{if(n)throw n.error}}try{for(var D=_a.__values(this.listeners),G=D.next();!G.done;G=D.next()){var T=G.value;T(e,e.event)}}catch(ne){a={error:ne}}finally{try{G&&!G.done&&(s=D.return)&&s.call(D)}finally{if(a)throw a.error}}try{for(var O=_a.__values(this.contextListeners),Z=O.next();!Z.done;Z=O.next()){var X=Z.value;X(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(ne){o={error:ne}}finally{try{Z&&!Z.done&&(u=O.return)&&u.call(O)}finally{if(o)throw o.error}}if(this.state.done){var ue=e.configuration.find(function(ne){return ne.type==="final"&&ne.parent===h.machine}),Q=ue&&ue.doneData?dn.mapContext(ue.doneData,e.context,r):void 0;this._doneEvent=S1.doneInvoke(this.id,Q);try{for(var ie=_a.__values(this.doneListeners),M=ie.next();!M.done;M=ie.next()){var T=M.value;T(this._doneEvent)}}catch(ne){l={error:ne}}finally{try{M&&!M.done&&(f=ie.return)&&f.call(ie)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),uG.registry.free(this.sessionId)}},t.prototype.onTransition=function(e){return this.listeners.add(e),this.status===yo.InterpreterStatus.Running&&e(this.state,this.state.event),this},t.prototype.subscribe=function(e,r,n){var i=this,a=dn.toObserver(e,r,n);this.listeners.add(a.next),this.status!==yo.InterpreterStatus.NotStarted&&a.next(this.state);var s=function(){i.doneListeners.delete(s),i.stopListeners.delete(s),a.complete()};return this.status===yo.InterpreterStatus.Stopped?a.complete():(this.onDone(s),this.onStop(s)),{unsubscribe:function(){i.listeners.delete(a.next),i.doneListeners.delete(s),i.stopListeners.delete(s)}}},t.prototype.onEvent=function(e){return this.eventListeners.add(e),this},t.prototype.onSend=function(e){return this.sendListeners.add(e),this},t.prototype.onChange=function(e){return this.contextListeners.add(e),this},t.prototype.onStop=function(e){return this.stopListeners.add(e),this},t.prototype.onDone=function(e){return this.status===yo.InterpreterStatus.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},t.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},t.prototype.start=function(e){var r=this;if(this.status===yo.InterpreterStatus.Running)return this;this.machine._init(),uG.registry.register(this.sessionId,this),this.initialized=!0,this.status=yo.InterpreterStatus.Running;var n=e===void 0?this.initialState:Gx.provide(this,function(){return fU.isStateConfig(e)?r.machine.resolveState(e):r.machine.resolveState(fU.State.from(e,r.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){r.update(n,S1.initEvent)}),this},t.prototype._stopChildren=function(){this.children.forEach(function(e){dn.isFunction(e.stop)&&e.stop()}),this.children.clear()},t.prototype._stop=function(){var e,r,n,i,a,s,o,u,l,f;try{for(var h=_a.__values(this.listeners),g=h.next();!g.done;g=h.next()){var _=g.value;this.listeners.delete(_)}}catch(ie){e={error:ie}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(e)throw e.error}}try{for(var w=_a.__values(this.stopListeners),T=w.next();!T.done;T=w.next()){var _=T.value;_(),this.stopListeners.delete(_)}}catch(ie){n={error:ie}}finally{try{T&&!T.done&&(i=w.return)&&i.call(w)}finally{if(n)throw n.error}}try{for(var D=_a.__values(this.contextListeners),G=D.next();!G.done;G=D.next()){var _=G.value;this.contextListeners.delete(_)}}catch(ie){a={error:ie}}finally{try{G&&!G.done&&(s=D.return)&&s.call(D)}finally{if(a)throw a.error}}try{for(var O=_a.__values(this.doneListeners),Z=O.next();!Z.done;Z=O.next()){var _=Z.value;this.doneListeners.delete(_)}}catch(ie){o={error:ie}}finally{try{Z&&!Z.done&&(u=O.return)&&u.call(O)}finally{if(o)throw o.error}}if(!this.initialized)return this;this.initialized=!1,this.status=yo.InterpreterStatus.Stopped,this._initialState=void 0;try{for(var X=_a.__values(Object.keys(this.delayedEventsMap)),ue=X.next();!ue.done;ue=X.next()){var Q=ue.value;this.clock.clearTimeout(this.delayedEventsMap[Q])}}catch(ie){l={error:ie}}finally{try{ue&&!ue.done&&(f=X.return)&&f.call(X)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new CPe.Scheduler({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var e=this,r=this.scheduler;return this._stop(),r.schedule(function(){var n;if(!(!((n=e._state)===null||n===void 0)&&n.done)){var i=dn.toSCXMLEvent({type:"xstate.stop"}),a=Gx.provide(e,function(){var s=dn.flatten(_a.__spreadArray([],_a.__read(e.state.configuration),!1).sort(function(h,g){return g.order-h.order}).map(function(h){return S1.toActionObjects(h.onExit,e.machine.options.actions)})),o=_a.__read(S1.resolveActions(e.machine,e.state,e.state.context,i,[{type:"exit",actions:s}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),u=o[0],l=o[1],f=new fU.State({value:e.state.value,context:l,_event:i,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:u.filter(function(h){return!dn.isRaisableAction(h)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return f.changed=!0,f});e.update(a,i),e._stopChildren(),uG.registry.free(e.sessionId)}}),this},t.prototype.batch=function(e){var r=this;if(this.status===yo.InterpreterStatus.NotStarted&&this.options.deferEvents)u4.IS_PRODUCTION||dn.warn(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,`" and are deferred. Make sure .start() is called for this service.
@@ -492,9 +492,9 @@ opening webpage using your browser.....
492
492
  `),console.log(EOe`If the web browser didn't open the window automatically, you can go to the following url:
493
493
  {whiteBright ${this.terraformLoginURL}}\n`);try{await wOe.default(this.terraformLoginURL,{allowNonzeroExitCode:!0,wait:!1})}catch(e){xD.logger.debug(`Ignored error while trying to open ${this.terraformLoginURL}`,e)}}async askForToken(){return await Gse({message:`Token for ${this.tfeHostname} \u{1F511}`,mask:"*"})}async saveTerraformCredentials(e){let r=await this.getTerraformCredentialsFile(),n=JSON.stringify({...r,credentials:{...r.credentials,[this.tfeHostname]:{token:e}}},void 0,2);sx.writeFileSync(ED,n)}async checkIfTerraformCredentialsExist(){return!!(sx.existsSync(ED)&&await this.getTokenFromTerraformCredentialsFile()!="")}async getTokenFromTerraformCredentialsFile(){let e=await this.getTerraformCredentialsFile();return this.tfeHostname in e.credentials?e.credentials[this.tfeHostname].token:""}async getTerraformCredentialsFile(){try{return JSON.parse(sx.readFileSync(ED).toString())}catch{return xD.logger.debug(`Could not find terraform credentials file at ${ED}`),{credentials:{}}}}async isTokenValid(e){try{return await QH(this.tfeHostname,e),!0}catch(r){if(r.statusCode===401)return!1;throw r}}async askToLogin(e){let n=await this.checkIfTerraformCredentialsExist()?await this.getTokenFromTerraformCredentialsFile():null;if(n&&await this.isTokenValid(n))return n;if(e)throw vWt(!!n);if(await this.askToContinue()){let a=await this.askForToken();return a==""&&(console.error(`
494
494
  ERROR: failed to gather token.
495
- `),process.exit(1)),this.saveTerraformCredentials(a),a}return""}};var mXe=vt(require("os")),Tu=vt(require("path"));var Qx=vt(m4()),ew=require("@cdktn/hcl2cdk"),gXe=vt(eD()),vXe=require("child_process");var pYe=vt(require("crypto")),iY=new Uint8Array(256),nY=iY.length;function Bde(){return nY>iY.length-16&&(pYe.default.randomFillSync(iY),nY=0),iY.slice(nY,nY+=16)}var hYe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Qtr(t){return typeof t=="string"&&hYe.test(t)}var mYe=Qtr;var qd=[];for(let t=0;t<256;++t)qd.push((t+256).toString(16).substr(1));function err(t,e=0){let r=(qd[t[e+0]]+qd[t[e+1]]+qd[t[e+2]]+qd[t[e+3]]+"-"+qd[t[e+4]]+qd[t[e+5]]+"-"+qd[t[e+6]]+qd[t[e+7]]+"-"+qd[t[e+8]]+qd[t[e+9]]+"-"+qd[t[e+10]]+qd[t[e+11]]+qd[t[e+12]]+qd[t[e+13]]+qd[t[e+14]]+qd[t[e+15]]).toLowerCase();if(!mYe(r))throw TypeError("Stringified UUID is invalid");return r}var gYe=err;function trr(t,e,r){t=t||{};let n=t.random||(t.rng||Bde)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return gYe(n)}var Nde=trr;var yXe=vt(S_()),no=vt(Ln()),LG=vt(m4()),bXe=vt(yYe());var ph=vt(kG()),Ba=vt(Ln());function $de(t,e,r){if(!r)throw Ba.Errors.Usage(`${t} version could not be determined`);let n=ph.coerce(r);if(!n||!ph.valid(n)){console.error(Ba.Errors.Internal(`Unable to parse ${t} version "${r}"`));return}ph.lt(n,e)&&console.error(Ba.Errors.Usage(`${t} version "${n}" is not supported. Please upgrade to at least ${e}`))}async function $ir(){let t=await(0,Ba.getGoVersion)();$de("Go","1.16.0",t)}async function Jir(){let t=await(0,Ba.getPythonVersion)();$de("Python","3.8.0",t)}async function Qir(){let t=await(0,Ba.getNodeVersion)();$de("Node.js","20.9.0",t)}async function g4(){switch(await Qir(),(0,Ba.getLanguage)()){case"go":await $ir();break;case"python":await Jir();break}}async function oXe(){if(Ba.DISABLE_VERSION_CHECK){Ba.logger.debug("Version check disabled via environment variable");return}let t=(0,Ba.getLanguage)();if(!t){Ba.logger.debug("Unable to detect language, skipping version check");return}let e=await(0,Ba.getPackageVersion)(t,"cdktn");if(e||(e=await(0,Ba.getPackageVersion)(t,"cdktf")),!e){Ba.logger.debug(`Unable to detect library version for ${t}`);return}let r=`${Ba.DISPLAY_VERSION}`;if(!e){Ba.logger.debug(`Unable to detect library version for ${t}`);return}if(Ba.logger.debug(`CLI version: ${r}`),Ba.logger.debug(`${t} package version: ${e}`),r==="0.0.0"||r.includes("-dev")){Ba.logger.debug("Running a development version of cdktn, skipping version check");return}if(r.includes(".dev")||r.includes("-pre.")){Ba.logger.debug("Running a pre-release version of cdktn-cli, skipping version compatibility check");return}if(e.includes(".dev")||e.includes("-pre.")){Ba.logger.debug("Running a pre-release version of cdktn, skipping version compatibility check");return}if(!ph.valid(e)){Ba.logger.info("Could not determine library version, skipping version compatibility check");return}if(!ph.valid(r)){Ba.logger.info("Could not determine CLI version, skipping version compatibility check");return}if(ph.major(e)!==ph.major(r))throw Ba.Errors.Usage(`The major version of the library (${e}) and the CLI (${r}) are different. Please update the library to the same major version and regenerate your provider bindings with 'cdktn get' and update your prebuilt providers. For more information see https://cdk.tf/troubleshooting/cdktf-version-mismatch`);if(ph.minor(e)!==ph.minor(r))throw Ba.Errors.Usage(`The minor version of the library (${e}) and the CLI (${r}) are different. Please update the library to the same minor version and regenerate your provider bindings with 'cdktn get' and update your prebuilt providers. For more information see https://cdk.tf/troubleshooting/cdktf-version-mismatch`)}function Jde(){return process.stdout.isTTY&&!process.env.CI}var lXe=vt(m4()),cXe=vt(Ln()),vY=vt(kG()),dXe=vt(Yl()),fXe=vt(require("path")),uXe="1.2.0",ear=/Terraform v\d+.\d+.\d+/,Qde=async()=>{try{let t={name:"",workingDirectory:"./",constructPath:"",content:"",synthesizedStackPath:"",stackMetadataPath:"",annotations:[],dependencies:[]},n=(await new lXe.TerraformCli(new AbortController().signal,t).version()).match(ear);return n===null?null:vY.clean(n[0].substring(n[0].indexOf("v")))}catch(t){return cXe.logger.info(`Unable to determine Terraform version: ${t}`),null}},ZG=async()=>{try{if((0,dXe.existsSync)(fXe.join(process.cwd(),"terraform.tfstate")))throw new Error(`
495
+ `),process.exit(1)),this.saveTerraformCredentials(a),a}return""}};var mXe=vt(require("os")),Tu=vt(require("path"));var Qx=vt(m4()),ew=require("@cdktn/hcl2cdk"),gXe=vt(eD()),vXe=require("child_process");var pYe=vt(require("crypto")),iY=new Uint8Array(256),nY=iY.length;function Bde(){return nY>iY.length-16&&(pYe.default.randomFillSync(iY),nY=0),iY.slice(nY,nY+=16)}var hYe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Qtr(t){return typeof t=="string"&&hYe.test(t)}var mYe=Qtr;var qd=[];for(let t=0;t<256;++t)qd.push((t+256).toString(16).substr(1));function err(t,e=0){let r=(qd[t[e+0]]+qd[t[e+1]]+qd[t[e+2]]+qd[t[e+3]]+"-"+qd[t[e+4]]+qd[t[e+5]]+"-"+qd[t[e+6]]+qd[t[e+7]]+"-"+qd[t[e+8]]+qd[t[e+9]]+"-"+qd[t[e+10]]+qd[t[e+11]]+qd[t[e+12]]+qd[t[e+13]]+qd[t[e+14]]+qd[t[e+15]]).toLowerCase();if(!mYe(r))throw TypeError("Stringified UUID is invalid");return r}var gYe=err;function trr(t,e,r){t=t||{};let n=t.random||(t.rng||Bde)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return gYe(n)}var Nde=trr;var yXe=vt(S_()),no=vt(Ln()),LG=vt(m4()),bXe=vt(yYe());var ph=vt(kG()),Ba=vt(Ln());function $de(t,e,r){if(!r)throw Ba.Errors.Usage(`${t} version could not be determined`);let n=ph.coerce(r);if(!n||!ph.valid(n)){console.error(Ba.Errors.Internal(`Unable to parse ${t} version "${r}"`));return}ph.lt(n,e)&&console.error(Ba.Errors.Usage(`${t} version "${n}" is not supported. Please upgrade to at least ${e}`))}async function $ir(){let t=await(0,Ba.getGoVersion)();$de("Go","1.16.0",t)}async function Jir(){let t=await(0,Ba.getPythonVersion)();$de("Python","3.8.0",t)}async function Qir(){let t=await(0,Ba.getNodeVersion)();$de("Node.js","20.9.0",t)}async function g4(){switch(await Qir(),(0,Ba.getLanguage)()){case"go":await $ir();break;case"python":await Jir();break}}async function oXe(){if(Ba.DISABLE_VERSION_CHECK){Ba.logger.debug("Version check disabled via environment variable");return}let t=(0,Ba.getLanguage)();if(!t){Ba.logger.debug("Unable to detect language, skipping version check");return}let e=await(0,Ba.getPackageVersion)(t,"cdktn");if(e||(e=await(0,Ba.getPackageVersion)(t,"cdktf")),!e){Ba.logger.debug(`Unable to detect library version for ${t}`);return}let r=`${Ba.DISPLAY_VERSION}`;if(!e){Ba.logger.debug(`Unable to detect library version for ${t}`);return}if(Ba.logger.debug(`CLI version: ${r}`),Ba.logger.debug(`${t} package version: ${e}`),r==="0.0.0"||r.includes("-dev")){Ba.logger.debug("Running a development version of cdktn, skipping version check");return}if(r.includes(".dev")||r.includes("-pre.")){Ba.logger.debug("Running a pre-release version of cdktn-cli, skipping version compatibility check");return}if(e.includes(".dev")||e.includes("-pre.")){Ba.logger.debug("Running a pre-release version of cdktn, skipping version compatibility check");return}if(!ph.valid(e)){Ba.logger.info("Could not determine library version, skipping version compatibility check");return}if(!ph.valid(r)){Ba.logger.info("Could not determine CLI version, skipping version compatibility check");return}if(ph.major(e)!==ph.major(r))throw Ba.Errors.Usage(`The major version of the library (${e}) and the CLI (${r}) are different. Please update the library to the same major version and regenerate your provider bindings with 'cdktn get' and update your prebuilt providers. For more information see https://cdktn.io/docs/test/debugging#cdktn-cli-and-library-on-different-versions`);if(ph.minor(e)!==ph.minor(r))throw Ba.Errors.Usage(`The minor version of the library (${e}) and the CLI (${r}) are different. Please update the library to the same minor version and regenerate your provider bindings with 'cdktn get' and update your prebuilt providers. For more information see https://cdktn.io/docs/test/debugging#cdktn-cli-and-library-on-different-versions`)}function Jde(){return process.stdout.isTTY&&!process.env.CI}var lXe=vt(m4()),cXe=vt(Ln()),vY=vt(kG()),dXe=vt(Yl()),fXe=vt(require("path")),uXe="1.2.0",ear=/Terraform v\d+.\d+.\d+/,Qde=async()=>{try{let t={name:"",workingDirectory:"./",constructPath:"",content:"",synthesizedStackPath:"",stackMetadataPath:"",annotations:[],dependencies:[]},n=(await new lXe.TerraformCli(new AbortController().signal,t).version()).match(ear);return n===null?null:vY.clean(n[0].substring(n[0].indexOf("v")))}catch(t){return cXe.logger.info(`Unable to determine Terraform version: ${t}`),null}},ZG=async()=>{try{if((0,dXe.existsSync)(fXe.join(process.cwd(),"terraform.tfstate")))throw new Error(`
496
496
  CDK Terrain now supports multiple stacks!
497
- Found 'terraform.tfstate' Terraform state file. Please rename it to match the stack name. Learn more https://cdk.tf/multiple-stacks
497
+ Found 'terraform.tfstate' Terraform state file. Please rename it to match the stack name. Learn more https://cdktn.io/docs/concepts/stacks#multiple-stacks
498
498
  `);let t=await Qde();if(t!==null&&t&&vY.lt(t,uXe)){let e=`Warning: unsupported Terraform version [${t}] - please upgrade to >=${uXe}`;console.warn(e)}}catch(t){console.error(t.message),process.exit(1)}};var _Xe=vt(kG());async function z2(){return await U_({message:"Do you want to send crash reports to the CDKTN team? Refer to https://cdktn.io/docs/create-and-deploy/configuration-file#enable-crash-reporting-for-the-cli for more information",default:!0})}var Pf=new pXe.Instance,tar=t=>t.toLowerCase()==="readme.md";function CXe(t){Sl.readdirSync(t).filter(e=>!e.startsWith(".")&&e!==no.logFileName&&!tar(e)).length>0&&(console.error(Pf`{redBright ERROR: Cannot initialize a project in a non-empty directory}`),process.exit(1))}var efe="app.terraform.io";async function IXe(t){var X;let e={},r=t.destination||".",n=t.tfeHostname||efe,i="";t.local?t.silent||console.log(Pf`{yellow Note: By supplying '--local' option you have chosen local storage mode for storing the state of your stack.
499
499
  This means that your Terraform state file will be stored locally on disk in a file 'terraform.<STACK NAME>.tfstate' in the root of your project.}`):i=await new ax(n).askToLogin(t.nonInteractive??!1);let a=i!="",s="";t.template&&(s=t.template);let o=await Qde();if(o&&_Xe.lt(o,"1.1.0")&&a)throw no.Errors.Usage(`Terraform version ${o} is not supported for remote configuration. We use the CloudBackend to configure the connection to Terraform Cloud, which is only supported in Terraform 1.1 and higher. Please upgrade to version 1.1.0 or higher or use the local mode by passing --local (afterwards you can use the RemoteBackend to work with Terraform Cloud without upgrading your Terraform version.`);let u=await sar(s,t.nonInteractive??!1);if(e.template=u.Name,!t.projectName&&t.nonInteractive)throw no.Errors.Usage("You are trying to initialize a project without specifying a project name in non-interactive mode. This can also happen when running cdktn convert against a project not using Typescript, since we need to create a temporary cdktn project for an accurate translation. If this happens using convert, please report it as a bug. Please specify a project name using the --project-name option.");if(!t.projectDescription&&t.nonInteractive)throw no.Errors.Usage("You are trying to initialize a project without specifying a project description in non-interactive mode. This can also happen when running cdktn convert against a project not using Typescript, since we need to create a temporary cdktn project for an accurate translation. If this happens using convert, please report it as a bug. Please specify a project name using the --project-description option.");let{projectInfo:l,useTerraformCloud:f}=await iar(i,n,t.projectName,t.projectDescription),h=Nde();e.projectId=h;let g=t.fromTerraformProject||void 0;if(g?g==="no"&&(g=void 0):u.Name==="typescript"&&(g=await aar(t.nonInteractive??!1)),!t.local&&f){if(!("OrganizationName"in l))throw new Error("Missing organization name in project info");if(!("WorkspaceName"in l))throw new Error("Missing workspace name in project info");a&&(e.isRemote=!!i,console.log(Pf`\n{whiteBright Setting up a Cloud Backend for your project.}`))}let _=(0,bXe.default)(),w=t.enableCrashReporting??(_?!1:await z2()),T=(X=t.providers)!=null&&X.length||t.nonInteractive?t.providers:await rar(),D,G;if(g){u.Name!=="typescript"&&console.error("The --from-terraform-project flag is only supported with the typescript template. The command will continue and ignore the flag."),G=Tu.resolve(process.cwd(),g);let ue=(0,ew.getTerraformConfigFromDir)(G),Q=await(0,ew.parseProviderRequirements)(ue),{providerSchema:ie}=await(0,yXe.readSchema)(Object.entries(Q).map(([M,ne])=>no.ConstructsMakerProviderTarget.from(new no.TerraformProviderConstraint(`${M}@${ne}`),no.LANGUAGES[0])));try{D=await(0,ew.convertProject)(ue,{language:"typescript",providerSchema:ie??{}})}catch(M){throw no.Errors.Internal(M.toString(),M,{fromTerraformProject:!0})}}let O=await(0,Qx.init)({cdktfVersion:t.cdktfVersion,destination:r,dist:t.dist,projectId:h,projectInfo:l,templatePath:u.Path,sendCrashReports:w,providers:T,providersForceLocal:t.providersForceLocal,silent:t.silent});if(D&&G){let{code:ue,cdktfJson:Q,stats:ie}=D,M=Sl.readFileSync(Tu.resolve(r,"main.ts"),"utf8");Sl.writeFileSync(Tu.resolve(r,"main.ts"),ue(M),"utf8");let ne=Q(JSON.parse(Sl.readFileSync(Tu.resolve(r,"cdktf.json"),"utf-8")));Sl.writeFileSync(Tu.resolve(r,"cdktf.json"),JSON.stringify(ne,null,2),"utf8");let{terraformModules:Te,terraformProviders:J}=ne;if(Te.length>0&&nar(Te,G,r),Te.length+J.length>0){let ke={cwd:r};t.silent&&(ke.stdio="ignore"),(0,vXe.execSync)("npm run get",{cwd:r})}e.conversionStats=ie}u.cleanupTemporaryFiles&&await u.cleanupTemporaryFiles();let Z=Qx.CdktfConfig.read(r);return T!=null&&T.length&&(e.addedProviders=T),await(0,no.sendTelemetry)("init",{...e,language:Z.language}),{needsGet:O,codeMakerOutput:Z.codeMakerOutput,language:Z.language}}async function rar(){if(!Jde())return Promise.resolve(void 0);let t=await(0,Qx.getAllPrebuiltProviders)(),e=Object.keys(t);console.log(Pf`{yellow Note: You can always add providers using 'cdktn provider add' later on}`);let r=await Hae({message:"What providers do you want to use?",choices:e.map(n=>({name:n,value:n}))});return Object.entries(t).filter(n=>r.includes(n[0])).map(n=>n[1].split("@")[0])}function nar(t,e,r){t.filter(n=>(0,gXe.isLocalModule)(n)).map(n=>Sl.copySync(Tu.resolve(e,n),Tu.resolve(r,n),{recursive:!0}))}async function iar(t,e,r,n){let i=Tu.basename(process.cwd()),a="A simple getting started project for cdktn.",s=r||await qI({message:"Project Name",default:i}),o=n||await qI({message:"Project Description",default:a}),u=t!=""&&e!=efe,l=!1;t!=""&&e===efe&&(l=await U_({message:"Would you like to use Terraform Cloud?",default:!0}));let f=l||u,h={Name:s,Description:o,OrganizationName:"",WorkspaceName:"",TerraformRemoteHostname:f?e:""};if(f){console.log(Pf`\nDetected {blueBright Terraform Cloud} token.`),console.log(Pf`\nWe will now set up {blueBright Terraform Cloud} for your project.\n`);let g=await IOe(e,t);if(g.length==0)throw no.Errors.Usage(`You must be part of an organization in Terraform Cloud in order to use it as a RemoteBackend or CloudBackend.
500
500
  You can create one here: https://${e}/app/organizations/new`);let _=await OH({message:"Terraform Cloud Organization Name",choices:g.map(T=>({name:T,value:T}))});console.log(Pf`\nWe are going to create a new {blueBright Terraform Cloud Workspace} for your project.\n`);let w;for(;!w;){let T=await qI({message:"Terraform Cloud Workspace Name",default:h.Name});if(!await SOe(e,_,T,t)){w=T;break}console.log(Pf`{redBright Error:} A workspace with the name {blueBright ${T}} already exists in the organization {blueBright ${_}}. Please choose a different name.`)}h.OrganizationName=_,h.WorkspaceName=w}return{projectInfo:h,useTerraformCloud:f}}async function aar(t){if(!Jde()||t)return Promise.resolve(void 0);if(!await U_({message:"Do you want to start from an existing Terraform project?",default:!1}))return;let r=await qI({message:"Please enter the path to the Terraform project",default:""});if(!(!r||r==="")){if(Tu.isAbsolute(r)||(r=Tu.resolve(process.cwd(),r)),!Sl.existsSync(r))throw no.Errors.Usage(`Could not find folder '${r}' to initialize from.`);return r}}async function sar(t,e){if(t==""){if(e)throw no.Errors.Usage("You are trying to initialize a project without specifying a template in non-interactive mode. This can also happen when running cdktn convert against a project not using Typescript, since we need to create a temporary cdktn project for an accurate translation. Please specify a template using the --template option in init or --language in convert.");let r="<remote zip file>",n=[...LG.templates,r],i=await OH({message:"What template do you want to use?",choices:n.map(a=>({name:a,value:a}))});i===r?t=await qI({message:"Please enter an URL pointing to the template zip file you want to use:",validate:s=>s===""?"Url can not be empty":!0}):(t=i,console.log(Pf`\n{whiteBright Initializing a project using the {greenBright ${t}} template.}`))}return LG.templates.includes(t)?{Name:t,Path:Tu.join(LG.templatesDir,t)}:oar(t)}async function oar(t){console.log(Pf`Fetching remote template from: {whiteBright ${t}}`);try{let e=new URL(t),r=Tu.basename(e.pathname)||"template.zip";no.logger.trace(`Detected remote file name to be "${r}" out of template URL "${t}"`);let n=await Sl.mkdtemp(Tu.join(mXe.tmpdir(),"cdktf.")),i=Tu.join(n,r),a=Tu.join(n,"extracted");no.logger.trace(`Downloading "${r}" to temporary directory "${n}"`),console.log(Pf`Downloading "{whiteBright ${r}}" to temporary directory`),await(0,no.downloadFile)(e.href,i),console.log("Extracting zip file"),await(0,hXe.default)(i,{dir:a}),console.log(Pf`Looking for directory containing {whiteBright cdktf.json}`);let s=await SXe(a);if(!s)throw no.Errors.Usage(Pf`Could not find a {whiteBright cdktf.json} in the extracted directory`,new Error,{});return{Name:Tu.parse(r).name,Path:s,cleanupTemporaryFiles:async()=>{console.log("Clearing up temporary directory of remote template"),await Sl.remove(n)}}}catch(e){e.code==="ERR_INVALID_URL"&&(console.error(Pf`Could not download template: {redBright the supplied url is invalid}`),console.error(Pf`Please supply a valid url (including the protocol) or use one of the built-in templates.`),process.exit(1)),e instanceof no.HttpError&&(console.error(Pf`Could not download template: {redBright ${e.message}}`),process.exit(1)),console.error(e),process.exit(1)}}async function SXe(t){let e=await Sl.readdir(t);if(e.includes("cdktf.json"))return t;for(let r of e){let n=Tu.join(t,r);if((await Sl.stat(n)).isDirectory()){let i=SXe(n);if(i)return i}}return null}var ZKe=vt(sd()),$Y=vt(Nn()),LKe=require("process");var gb=async t=>{await ZG();let{waitUntilExit:e}=(0,ZKe.render)($Y.default.createElement($Y.Fragment,{},t));try{await e()}catch(r){console.error(r.message),(0,LKe.exit)(1)}};var Ape=vt(Yl()),WKe=require("module"),VKe=vt(require("path")),Rpe=vt(ale()),IEr=(0,WKe.createRequire)(__filename),PKe=()=>{let t=Rpe.sync({cwd:__dirname});if(!t)throw new Error("unable to find package.json");return JSON.parse(Ape.readFileSync(t,"utf-8"))},HKe=()=>{let t=Rpe.sync({cwd:__dirname});if(!t)throw new Error("unable to find package.json");return VKe.default.dirname(t)};function Tpe(t){return new Promise((e,r)=>{if(t.isTTY)r();else{let n="";t.on("data",i=>n+=i.toString()),t.on("close",()=>e(n)),t.on("error",i=>r(i))}})}var MKe=require("child_process"),yb=vt(Yl()),vb=vt(require("path")),JY=vt(require("os")),QY=vt(kG()),UKe=require("util"),ej=vt(Ln()),plr=1440*60,hlr=(0,UKe.promisify)(MKe.exec),Bpe=class t{static timestampFilePath(){return vb.join(vlr(),"version")}constructor(e,r){this.file=e||t.timestampFilePath();try{yb.mkdirsSync(vb.dirname(this.file)),yb.accessSync(vb.dirname(this.file),yb.constants.W_OK)}catch{throw new Error(`Directory (${vb.dirname(this.file)}) is not writable.`)}this.ttlSecs=r||plr}async hasExpired(){try{let e=(await yb.stat(this.file)).mtimeMs;return(new Date().getTime()-e)/1e3>this.ttlSecs}catch(e){if(e.code==="ENOENT")return!0;throw e}}async update(e){e||(e=""),await yb.writeFile(this.file,e)}};async function mlr(t,e){if(!await e.hasExpired())return null;let{stdout:r,stderr:n}=await hlr("npm view cdktn-cli version");n&&n.trim().length>0&&console.error(`The 'npm view' command generated an error stream with content [${n.trim()}]`);let i=r.trim();if(!QY.valid(i))throw new Error(`npm returned an invalid semver ${i}`);let a=QY.gt(i,t);return await e.update(i),a?i:null}async function bg(){if(!(!process.stdout.isTTY||ej.DISABLE_VERSION_CHECK))try{let t=new Bpe,e=await mlr(`${ej.DISPLAY_VERSION}`,t);e&&console.log(`Newer version of CDK Terrain is available [${e}] - Upgrade recommended`)}catch(t){console.error(`Could not run version check - ${t.message}`)}}function glr(){return process.env.CDKTF_HOME?vb.resolve(process.env.CDKTF_HOME):vb.join((JY.userInfo().homedir??JY.homedir()).trim()||"/",".cdktf")}function vlr(){return vb.join(glr(),"cache")}var a0e=vt(Nn());var YKe=vt(sd()),W3=vt(Nn()),jKe=vt(m4());function _g(t,e){let{exit:r}=(0,YKe.useApp)(),[n,i]=(0,W3.useState)(0),[a,s]=(0,W3.useState)([]),[o,u]=(0,W3.useState)(),[l,f]=(0,W3.useState)({type:"starting"}),h=g=>{let _=g.stacksToRun.filter(D=>D.isRunning),w=g.stacksToRun.filter(D=>D.isDone),T=g.stacksToRun.filter(D=>D.isPending);f({type:"running",inProgress:_,finished:w,pending:T})};return(0,W3.useEffect)(()=>{let g=new jKe.CdktfProject({outDir:t.outDir,hcl:t.hcl,synthCommand:t.synthCommand,onUpdate:w=>{["synthesizing"].includes(w.type)?f({type:"synthesizing"}):w.type==="waiting for approval"?f({type:"waiting for approval of stack",stackName:w.stackName,approve:w.approve,dismiss:w.dismiss,stop:w.stop}):w.type==="waiting for sentinel override"?f({type:"waiting for override of sentinel policy check failure",stackName:w.stackName,override:w.override,reject:w.reject}):h(g)},onLog:({stackName:w,message:T,messageWithConstructPath:D})=>{s(G=>[...G,{id:`${w}-${n}`,stackName:w,content:D||T}]),i(G=>G+1),h(g)}}),_=()=>{g.hardAbort()};process.on("SIGINT",_),process.on("SIGTERM",_),process.on("SIGQUIT",_),e(g).then(w=>{u(w),f({type:"done"}),setTimeout(()=>{r(),process.platform==="win32"&&process.exit(0)},100)}).catch(w=>{r(new Error(w))})},[]),{logEntries:a,returnValue:o,status:l}}var _b=vt(Nn()),N$e=vt(Kpe()),E4=vt(sd()),$pe={approve:{label:"Approve",description:"Applies the changes outlined in the plan."},dismiss:{label:"Dismiss",description:"Does not apply the changes outlined in the plan. This will also prevent depending stacks from planning."},stop:{label:"Stop",description:"Does not apply the changes. Currently running stacks will be finished, but no new ones will be started."}};function hj({stackName:t,onApprove:e,onDismiss:r,onStop:n}){let i=Object.keys($pe).map(l=>({...$pe[l],value:l})),[a,s]=_b.default.useState(i[0].value);return _b.default.createElement(E4.Box,{flexDirection:"column"},_b.default.createElement(E4.Box,null,_b.default.createElement(E4.Text,null,"Please review the diff output above for "),_b.default.createElement(E4.Text,{bold:!0},t)),_b.default.createElement(E4.Box,null,_b.default.createElement(N$e.default,{items:i,onSelect:l=>{switch(l.value){case"approve":e();break;case"dismiss":r();break;case"stop":n();break}},onHighlight:l=>{s(l.value)}}),_b.default.createElement(E4.Box,{paddingLeft:2},_b.default.createElement(E4.Text,null,$pe[a].description))))}var mw=vt(Nn()),kF=vt(sd());var hh=vt(Nn()),Cb=vt(sd()),hw=vt(m4());function sdr(t){return typeof t=="object"?JSON.stringify(t,null,2):t}function odr({name:t,value:e}){return hh.default.createElement(Cb.Box,{key:t},hh.default.createElement(Cb.Text,null,t," = ",e.sensitive?"<sensitive>":sdr(e.value)))}var udr=t=>([e],[r])=>(0,hw.isTerraformOutput)(t[e])&&(0,hw.isTerraformOutput)(t[r])?e.localeCompare(r):(0,hw.isTerraformOutput)(t[e])?-1:(0,hw.isTerraformOutput)(t[r])?1:e.localeCompare(r);function D$e({name:t,value:e,indentationLevel:r=0}){return r>500?hh.default.createElement(hh.default.Fragment,null):(0,hw.isTerraformOutput)(e)?hh.default.createElement(Cb.Box,{key:t},hh.default.createElement(odr,{name:t,value:e})):hh.default.createElement(Cb.Box,{flexDirection:"column",key:t,marginLeft:2,marginBottom:1},hh.default.createElement(Cb.Text,{bold:!0},t),hh.default.createElement(Cb.Box,{marginLeft:r*2,flexDirection:"column"},Object.entries(e).sort(udr(e)).map(([n,i])=>hh.default.createElement(D$e,{indentationLevel:r+1,key:n,name:n,value:i}))))}var Jpe=({outputs:t})=>hh.default.createElement(Cb.Box,{flexDirection:"column"},Object.entries(t).map(([e,r])=>hh.default.createElement(Cb.Box,{key:e},hh.default.createElement(D$e,{name:e,value:r}))));function mj({outputs:t,outputsFile:e}){return t&&Object.keys(t).length>0?e?mw.default.createElement(kF.Box,{flexDirection:"column"},mw.default.createElement(Jpe,{outputs:t}),mw.default.createElement(kF.Text,null,"The outputs have been written to ",e)):mw.default.createElement(Jpe,{outputs:t}):mw.default.createElement(kF.Text,null,"No outputs found.")}var yi=vt(Nn()),ja=vt(sd()),gw=vt(e0e());function x4({status:t,children:e}){switch(t.type){case"done":return e||yi.default.createElement(yi.default.Fragment,null);case"waiting for approval of stack":return yi.default.createElement(yi.default.Fragment,null);case"starting":return yi.default.createElement(ja.Box,null,yi.default.createElement(ja.Box,{marginRight:2},yi.default.createElement(ja.Text,null,yi.default.createElement(gw.default,{type:"dots"}))),yi.default.createElement(ja.Box,null,yi.default.createElement(ja.Text,{bold:!0},"Starting")));case"synthesizing":return yi.default.createElement(ja.Box,null,yi.default.createElement(ja.Box,{marginRight:2},yi.default.createElement(ja.Text,null,yi.default.createElement(gw.default,{type:"dots"}))),yi.default.createElement(ja.Box,null,yi.default.createElement(ja.Text,{bold:!0},"Synthesizing")));case"running":return yi.default.createElement(ja.Box,null,yi.default.createElement(ja.Box,{marginRight:2},yi.default.createElement(ja.Text,null,yi.default.createElement(gw.default,{type:"dots"}))),yi.default.createElement(ja.Box,null,yi.default.createElement(ja.Text,{bold:!0},"Processing")))}}function t0e(t){return t===1?"1 Stack":`${t} Stacks`}function F$e({inProgress:t,finished:e,pending:r,actionName:n}){return yi.default.createElement(ja.Box,{marginTop:1},yi.default.createElement(ja.Box,{marginRight:5},yi.default.createElement(ja.Text,null,t0e(t.length)," ",n)),yi.default.createElement(ja.Box,{marginRight:5},yi.default.createElement(ja.Text,null,t0e(e.length)," done")),yi.default.createElement(ja.Box,null,yi.default.createElement(ja.Text,null,t0e(r.length)," waiting")))}function gj({status:t,children:e,actionName:r}){return(t==null?void 0:t.type)!=="running"?yi.default.createElement(x4,{status:t},e):yi.default.createElement(F$e,{inProgress:t.inProgress,finished:t.finished,pending:t.pending,actionName:r})}function O$e({currentState:t}){switch(t.type){case"waiting":return yi.default.createElement(ja.Box,{marginTop:1},yi.default.createElement(gw.default,null),yi.default.createElement(ja.Box,{marginLeft:1},yi.default.createElement(ja.Text,null,"Waiting for changes...")));case"stopped":return yi.default.createElement(ja.Box,{marginTop:1},yi.default.createElement(ja.Text,null,"Watch was stopped"));case"running":return t.inProgress.length+t.finished.length+t.pending.length===0?yi.default.createElement(ja.Box,{marginTop:1},yi.default.createElement(gw.default,null),yi.default.createElement(ja.Box,{marginLeft:1},yi.default.createElement(ja.Text,null,"Synthesizing..."))):yi.default.createElement(F$e,{inProgress:t.inProgress,finished:t.finished,pending:t.pending,actionName:"deploying"})}}var Ib=vt(Nn()),k$e=vt(Kpe()),w4=vt(sd()),r0e={override:{label:"Override",description:"Overrides the soft failed policy check"},reject:{label:"Reject",description:"Does not override the failed policy check, and stops the operation"}};function vj({stackName:t,onOverride:e,onReject:r}){let n=Object.keys(r0e).map(u=>({...r0e[u],value:u})),[i,a]=Ib.default.useState(n[0].value);return Ib.default.createElement(w4.Box,{flexDirection:"column"},Ib.default.createElement(w4.Box,null,Ib.default.createElement(w4.Text,null,"Please review the above failures for "),Ib.default.createElement(w4.Text,{bold:!0},t)),Ib.default.createElement(w4.Box,null,Ib.default.createElement(k$e.default,{items:n,onSelect:u=>{switch(u.value){case"override":e();break;case"reject":r();break}},onHighlight:u=>{a(u.value)}}),Ib.default.createElement(w4.Box,{paddingLeft:2},Ib.default.createElement(w4.Text,null,r0e[i].description))))}var rv=vt(Nn()),Cg=vt(sd()),Z$e=["yellow","blue","cyan","green","white","yellowBright","blueBright","cyanBright","greenBright","whiteBright"],n0e=0,i0e={};function pdr(t){if(i0e[t])return i0e[t];let e=Z$e[n0e];return n0e=(n0e+1)%Z$e.length,i0e[t]=e,e}function hdr({stackName:t}){return rv.default.createElement(Cg.Text,{bold:!0,color:pdr(t)},t)}function mh({logs:t,children:e}){return rv.default.createElement(Cg.Box,null,rv.default.createElement(Cg.Box,null,rv.default.createElement(Cg.Static,{items:t},({content:r,id:n,stackName:i})=>rv.default.createElement(Cg.Box,{key:n},rv.default.createElement(Cg.Box,{marginRight:2},rv.default.createElement(hdr,{stackName:i})),rv.default.createElement(Cg.Box,null,rv.default.createElement(Cg.Text,null,r.trim()))))),rv.default.createElement(Cg.Box,{marginTop:1},e))}var L$e=({outDir:t,targetStack:e,synthCommand:r,refreshOnly:n,terraformParallelism:i,vars:a,varFiles:s,noColor:o,migrateState:u,skipSynth:l,skipProviderLock:f})=>{let{status:h,logEntries:g}=_g({outDir:t,synthCommand:r},_=>_.diff({stackName:e,refreshOnly:n,terraformParallelism:i,vars:a,varFiles:s,noColor:o,migrateState:u,skipSynth:l,skipProviderLock:f}));return a0e.default.createElement(mh,{logs:g},a0e.default.createElement(x4,{status:h}))};var S5=vt(Nn()),W$e=vt(sd());var V$e=({outDir:t,targetStacks:e,synthCommand:r,autoApprove:n,onOutputsRetrieved:i,outputsPath:a,ignoreMissingStackDependencies:s,parallelism:o,refreshOnly:u,terraformParallelism:l,vars:f,varFiles:h,noColor:g,migrateState:_,skipSynth:w,skipProviderLock:T})=>{let[D,G]=(0,S5.useState)(),{status:O,logEntries:Z}=_g({outDir:t,synthCommand:r},async ue=>{await ue.deploy({stackNames:e,autoApprove:n,ignoreMissingStackDependencies:s,parallelism:o,refreshOnly:u,terraformParallelism:l,vars:f,varFiles:h,noColor:g,migrateState:_,skipSynth:w,skipProviderLock:T}),i&&i(ue.outputsByConstructId),G(ue.outputsByConstructId)}),X=O.type==="done"?S5.default.createElement(mj,{outputs:D,outputsFile:a}):(O==null?void 0:O.type)==="waiting for approval of stack"?S5.default.createElement(hj,{stackName:O.stackName,onApprove:O.approve,onDismiss:O.dismiss,onStop:O.stop}):(O==null?void 0:O.type)==="waiting for override of sentinel policy check failure"?S5.default.createElement(vj,{stackName:O.stackName,onOverride:O.override,onReject:O.reject}):S5.default.createElement(gj,{status:O,actionName:"deploying"});return S5.default.createElement(mh,{logs:Z},X)};var ZF=vt(Nn());var P$e=({outDir:t,targetStacks:e,synthCommand:r,autoApprove:n,ignoreMissingStackDependencies:i,parallelism:a,terraformParallelism:s,noColor:o,migrateState:u,vars:l,varFiles:f,skipSynth:h,skipProviderLock:g})=>{let{status:_,logEntries:w}=_g({outDir:t,synthCommand:r},D=>D.destroy({stackNames:e,autoApprove:n,ignoreMissingStackDependencies:i,parallelism:a,terraformParallelism:s,noColor:o,migrateState:u,vars:l,varFiles:f,skipSynth:h,skipProviderLock:g})),T=(_==null?void 0:_.type)==="waiting for approval of stack"?ZF.default.createElement(hj,{stackName:_.stackName,onApprove:_.approve,onDismiss:_.dismiss,onStop:_.stop}):(_==null?void 0:_.type)==="waiting for override of sentinel policy check failure"?ZF.default.createElement(vj,{stackName:_.stackName,onOverride:_.override,onReject:_.reject}):ZF.default.createElement(gj,{status:_,actionName:"destroying"});return ZF.default.createElement(mh,{logs:w},T)};var io=vt(Nn()),rc=vt(sd()),H$e=vt(e0e()),vw=vt(Ln()),Y3=vt(m4()),M$e=({codeMakerOutput:t,language:e,constraints:r,parallelism:n,force:i,silent:a=!1,providerSchemaCachePath:s,languageOptions:o})=>{let[u,l]=io.default.useState(Y3.GetStatus.STARTING),{exit:f}=(0,rc.useApp)(),h={codeMakerOutput:t,targetLanguage:e,jsiiParallelism:n,languageOptions:o};io.default.useEffect(()=>{(async()=>{try{await(0,Y3.get)({constraints:r,constructsOptions:h,cleanDirectory:i,onUpdate:l,providerSchemaCachePath:s,reportTelemetry:async D=>await(0,vw.sendTelemetry)("get",{language:D.targetLanguage,...D.trackingPayload})})}catch(D){(0,vw.IsErrorType)(D,"Usage")||console.error(D),f(new Error(D))}})()},[]),io.default.useEffect(()=>{u===Y3.GetStatus.DONE&&f(),u===Y3.GetStatus.ERROR&&f(new Error(`ERROR: synthesis failed, app expected to create "${t}"`))},[u,f,t]);let g=u!=Y3.GetStatus.DONE,_=`${u}...`,w=io.default.createElement(rc.Text,null,"Generated ",io.default.createElement(rc.Text,{color:"green"},e)," constructs in the output directory: ",io.default.createElement(rc.Text,{bold:!0},t),e===vw.Language.GO&&io.default.createElement(io.default.Fragment,null,io.default.createElement(rc.Newline,null),io.default.createElement(rc.Newline,null),io.default.createElement(rc.Text,null,"The generated code depends on"," ",io.default.createElement(rc.Text,{color:"cyan"},"jsii-runtime-go"),". If you haven't yet installed it, you can run"," ",io.default.createElement(rc.Text,{color:"blueBright"},"go mod tidy")," to automatically install it.")));return a?io.default.createElement(rc.Text,null):io.default.createElement(rc.Box,null,g?io.default.createElement(io.Fragment,null,io.default.createElement(rc.Text,{color:"green"},io.default.createElement(H$e.default,{type:"dots"})),io.default.createElement(rc.Box,{paddingLeft:1},io.default.createElement(rc.Text,null,_))):io.default.createElement(io.Fragment,null,io.default.createElement(rc.Box,null,w)))};var El=vt(Nn()),gh=vt(sd());var U$e=({outDir:t,synthCommand:e})=>{let{status:r,logEntries:n,returnValue:i}=_g({outDir:t,synthCommand:e},a=>a.synth());return El.default.createElement(mh,{logs:n},El.default.createElement(x4,{status:r},r.type==="done"?El.default.createElement(gh.Box,null,El.default.createElement(El.Fragment,null,El.default.createElement(gh.Box,{flexDirection:"column"},El.default.createElement(gh.Box,null,El.default.createElement(gh.Box,{width:"40%"},El.default.createElement(gh.Text,{bold:!0},"Stack name")),El.default.createElement(gh.Box,{width:"60%"},El.default.createElement(gh.Text,{bold:!0},"Path"))),i.map(a=>El.default.createElement(gh.Box,{key:a.name},El.default.createElement(gh.Box,{width:"40%",paddingRight:1},El.default.createElement(gh.Text,null,a.name)),El.default.createElement(gh.Box,{width:"60%"},El.default.createElement(gh.Text,null,a.workingDirectory))))))):El.default.createElement(El.default.Fragment,null)))};var LF=vt(Nn()),Y$e=vt(sd());var mdr=({stacks:t})=>LF.default.createElement(Y$e.Text,null,"Generated Terraform code for the stacks:"," ",t==null?void 0:t.map(e=>e.name).join(", ")),j$e=({outDir:t,synthCommand:e,hcl:r})=>{let{returnValue:n,logEntries:i,status:a}=_g({outDir:t,synthCommand:e,hcl:r},s=>s.synth());return LF.default.createElement(mh,{logs:i},LF.default.createElement(x4,{status:a},LF.default.createElement(mdr,{stacks:a.type==="done"?n:[]})))};var A4=vt(Nn()),X$e=vt(m4());var q$e=({targetDir:t,targetStacks:e,synthCommand:r,autoApprove:n,parallelism:i,terraformParallelism:a})=>{let[s,o]=(0,A4.useState)(0),[u,l]=(0,A4.useState)([]),[f,h]=(0,A4.useState)({type:"waiting"});return(0,A4.useEffect)(()=>{let g=new AbortController,_=()=>{g.abort()};process.on("SIGINT",_),process.on("SIGTERM",_),process.on("SIGQUIT",_),(0,X$e.watch)({synthCommand:r,outDir:t,onUpdate:()=>{},onLog:({stackName:w,message:T,messageWithConstructPath:D})=>{l(G=>[...G,{id:`${w}-${s}`,stackName:w,content:D||T}]),o(G=>G+1)}},{autoApprove:n,stackNames:e,parallelism:i,terraformParallelism:a},g.signal,w=>{h(w)})},[]),A4.default.createElement(mh,{logs:u},A4.default.createElement(O$e,{currentState:f}))};var aJe=vt(Nn()),sJe=vt(iJe()),oJe=({data:t})=>aJe.default.createElement(sJe.default,{data:t});var Xa=vt(m4());var yj=vt(Nn());var uJe=({outDir:t,targetStacks:e,synthCommand:r,onOutputsRetrieved:n,outputsPath:i,skipSynth:a,skipProviderLock:s})=>{let{status:o,logEntries:u,returnValue:l}=_g({outDir:t,synthCommand:r},async h=>{let g=await h.fetchOutputs({stackNames:e,skipSynth:a,skipProviderLock:s});return n(g),g}),f=o.type==="done"?yj.default.createElement(mj,{outputs:l,outputsFile:i}):yj.default.createElement(x4,{status:o});return yj.default.createElement(mh,{logs:u},f)};var lJe=vt(require("fs")),cJe=vt(require("path")),dJe=vt(Ln());function _dr(t){try{let e=cJe.join(t,"cdktf.json"),r=JSON.parse(lJe.readFileSync(e,"utf-8"));return r.language&&r.app}catch{return!1}}function R4(t=process.cwd()){if(!_dr(t))throw dJe.Errors.Usage(`${t} is not a cdktf/cdktn project directory, no cdktf.json found or cdktf.json is missing language / app keys`)}var RO=vt(Yl()),jj=vt(require("path")),Y0e=vt(Ln());var AJe=vt(uP(),1);var PF=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var Cdr={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},HF=t=>t.replace(/[[\]\\-]/g,"\\$&"),Idr=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),fJe=t=>t.join(""),pJe=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],a=r+1,s=!1,o=!1,u=!1,l=!1,f=r,h="";e:for(;a<t.length;){let T=t.charAt(a);if((T==="!"||T==="^")&&a===r+1){l=!0,a++;continue}if(T==="]"&&s&&!u){f=a+1;break}if(s=!0,T==="\\"&&!u){u=!0,a++;continue}if(T==="["&&!u){for(let[D,[G,O,Z]]of Object.entries(Cdr))if(t.startsWith(D,a)){if(h)return["$.",!1,t.length-r,!0];a+=D.length,Z?i.push(G):n.push(G),o=o||O;continue e}}if(u=!1,h){T>h?n.push(HF(h)+"-"+HF(T)):T===h&&n.push(HF(T)),h="",a++;continue}if(t.startsWith("-]",a+1)){n.push(HF(T+"-")),a+=2;continue}if(t.startsWith("-",a+1)){h=T,a+=2;continue}n.push(HF(T)),a++}if(f<a)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let T=n[0].length===2?n[0].slice(-1):n[0];return[Idr(T),!1,f-r,!1]}let g="["+(l?"^":"")+fJe(n)+"]",_="["+(l?"":"^")+fJe(i)+"]";return[n.length&&i.length?"("+g+"|"+_+")":n.length?g:_,o,f-r,!0]};var iv=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var vh,Sdr=new Set(["!","?","+","*","@"]),l0e=t=>Sdr.has(t),hJe=t=>l0e(t.type),Edr=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),xdr=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),wdr=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),mJe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Adr="(?!(?:^|/)\\.\\.?(?:$|/))",bj="(?!\\.)",Rdr=new Set(["[","."]),Tdr=new Set(["..","."]),Bdr=new Set("().*{}+?[]^$\\!"),Ndr=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),p0e="[^/]",gJe=p0e+"*?",vJe=p0e+"+?",nc,od,T4,Ti,Bu,E5,X3,x5,Sb,Eb,_w,os,yJe,A5,_j,bJe,c0e,Cj,_Je,d0e,CJe,IJe,SJe,Ij,f0e,EJe,w5=class{constructor(e,r,n={}){Be(this,os);Et(this,"type");Be(this,nc);Be(this,od);Be(this,T4,!1);Be(this,Ti,[]);Be(this,Bu);Be(this,E5);Be(this,X3);Be(this,x5,!1);Be(this,Sb);Be(this,Eb);Be(this,_w,!1);this.type=e,e&&de(this,od,!0),de(this,Bu,r),de(this,nc,I(this,Bu)?I(I(this,Bu),nc):this),de(this,Sb,I(this,nc)===this?n:I(I(this,nc),Sb)),de(this,X3,I(this,nc)===this?[]:I(I(this,nc),X3)),e==="!"&&!I(I(this,nc),x5)&&I(this,X3).push(this),de(this,E5,I(this,Bu)?I(I(this,Bu),Ti).length:0)}get hasMagic(){if(I(this,od)!==void 0)return I(this,od);for(let e of I(this,Ti))if(typeof e!="string"&&(e.type||e.hasMagic))return de(this,od,!0);return I(this,od)}toString(){return I(this,Eb)!==void 0?I(this,Eb):this.type?de(this,Eb,this.type+"("+I(this,Ti).map(e=>String(e)).join("|")+")"):de(this,Eb,I(this,Ti).map(e=>String(e)).join(""))}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof vh&&I(r,Bu)===this))throw new Error("invalid part: "+r);I(this,Ti).push(r)}}toJSON(){var r;let e=this.type===null?I(this,Ti).slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...I(this,Ti).map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===I(this,nc)||I(I(this,nc),x5)&&((r=I(this,Bu))==null?void 0:r.type)==="!")&&e.push({}),e}isStart(){var r;if(I(this,nc)===this)return!0;if(!((r=I(this,Bu))!=null&&r.isStart()))return!1;if(I(this,E5)===0)return!0;let e=I(this,Bu);for(let n=0;n<I(this,E5);n++){let i=I(e,Ti)[n];if(!(i instanceof vh&&i.type==="!"))return!1}return!0}isEnd(){var r,n,i;if(I(this,nc)===this||((r=I(this,Bu))==null?void 0:r.type)==="!")return!0;if(!((n=I(this,Bu))!=null&&n.isEnd()))return!1;if(!this.type)return(i=I(this,Bu))==null?void 0:i.isEnd();let e=I(this,Bu)?I(I(this,Bu),Ti).length:0;return I(this,E5)===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new vh(this.type,e);for(let n of I(this,Ti))r.copyIn(n);return r}static fromGlob(e,r={}){var i;let n=new vh(null,void 0,r);return he(i=vh,A5,_j).call(i,e,n,0,r,0),n}toMMPattern(){if(this!==I(this,nc))return I(this,nc).toMMPattern();let e=this.toString(),[r,n,i,a]=this.toRegExpSource();if(!(i||I(this,od)||I(this,Sb).nocase&&!I(this,Sb).nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let o=(I(this,Sb).nocase?"i":"")+(a?"u":"");return Object.assign(new RegExp(`^${r}$`,o),{_src:r,_glob:e})}get options(){return I(this,Sb)}toRegExpSource(e){var u;let r=e??!!I(this,Sb).dot;if(I(this,nc)===this&&(he(this,os,Ij).call(this),he(this,os,yJe).call(this)),!hJe(this)){let l=this.isStart()&&this.isEnd(),f=I(this,Ti).map(w=>{var Z;let[T,D,G,O]=typeof w=="string"?he(Z=vh,A5,EJe).call(Z,w,I(this,od),l):w.toRegExpSource(e);return de(this,od,I(this,od)||G),de(this,T4,I(this,T4)||O),T}).join(""),h="";if(this.isStart()&&typeof I(this,Ti)[0]=="string"&&!(I(this,Ti).length===1&&Tdr.has(I(this,Ti)[0]))){let T=Rdr,D=r&&T.has(f.charAt(0))||f.startsWith("\\.")&&T.has(f.charAt(2))||f.startsWith("\\.\\.")&&T.has(f.charAt(4)),G=!r&&!e&&T.has(f.charAt(0));h=D?Adr:G?bj:""}let g="";return this.isEnd()&&I(I(this,nc),x5)&&((u=I(this,Bu))==null?void 0:u.type)==="!"&&(g="(?:$|\\/)"),[h+f+g,iv(f),de(this,od,!!I(this,od)),I(this,T4)]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",a=he(this,os,f0e).call(this,r);if(this.isStart()&&this.isEnd()&&!a&&this.type!=="!"){let l=this.toString(),f=this;return de(f,Ti,[l]),f.type=null,de(f,od,void 0),[l,iv(this.toString()),!1,!1]}let s=!n||e||r||!bj?"":he(this,os,f0e).call(this,!0);s===a&&(s=""),s&&(a=`(?:${a})(?:${s})*?`);let o="";if(this.type==="!"&&I(this,_w))o=(this.isStart()&&!r?bj:"")+vJe;else{let l=this.type==="!"?"))"+(this.isStart()&&!r&&!e?bj:"")+gJe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`;o=i+a+l}return[o,iv(a),de(this,od,!!I(this,od)),I(this,T4)]}};nc=new WeakMap,od=new WeakMap,T4=new WeakMap,Ti=new WeakMap,Bu=new WeakMap,E5=new WeakMap,X3=new WeakMap,x5=new WeakMap,Sb=new WeakMap,Eb=new WeakMap,_w=new WeakMap,os=new WeakSet,yJe=function(){if(this!==I(this,nc))throw new Error("should only call on root");if(I(this,x5))return this;this.toString(),de(this,x5,!0);let e;for(;e=I(this,X3).pop();){if(e.type!=="!")continue;let r=e,n=I(r,Bu);for(;n;){for(let i=I(r,E5)+1;!n.type&&i<I(n,Ti).length;i++)for(let a of I(e,Ti)){if(typeof a=="string")throw new Error("string part in extglob AST??");a.copyIn(I(n,Ti)[i])}r=n,n=I(r,Bu)}}return this},A5=new WeakSet,_j=function(e,r,n,i,a){var T,D,G,O;let s=i.maxExtglobRecursion??2,o=!1,u=!1,l=-1,f=!1;if(r.type===null){let Z=n,X="";for(;Z<e.length;){let ue=e.charAt(Z++);if(o||ue==="\\"){o=!o,X+=ue;continue}if(u){Z===l+1?(ue==="^"||ue==="!")&&(f=!0):ue==="]"&&!(Z===l+2&&f)&&(u=!1),X+=ue;continue}else if(ue==="["){u=!0,l=Z,f=!1,X+=ue;continue}if(!i.noext&&l0e(ue)&&e.charAt(Z)==="("&&a<=s){r.push(X),X="";let ie=new vh(ue,r);Z=he(T=vh,A5,_j).call(T,e,ie,Z,i,a+1),r.push(ie);continue}X+=ue}return r.push(X),Z}let h=n+1,g=new vh(null,r),_=[],w="";for(;h<e.length;){let Z=e.charAt(h++);if(o||Z==="\\"){o=!o,w+=Z;continue}if(u){h===l+1?(Z==="^"||Z==="!")&&(f=!0):Z==="]"&&!(h===l+2&&f)&&(u=!1),w+=Z;continue}else if(Z==="["){u=!0,l=h,f=!1,w+=Z;continue}if(l0e(Z)&&e.charAt(h)==="("&&(a<=s||r&&he(D=r,os,Cj).call(D,Z))){let ue=r&&he(G=r,os,Cj).call(G,Z)?0:1;g.push(w),w="";let Q=new vh(Z,g);g.push(Q),h=he(O=vh,A5,_j).call(O,e,Q,h,i,a+ue);continue}if(Z==="|"){g.push(w),w="",_.push(g),g=new vh(null,r);continue}if(Z===")")return w===""&&I(r,Ti).length===0&&de(r,_w,!0),g.push(w),w="",r.push(..._,g),h;w+=Z}return r.type=null,de(r,od,void 0),de(r,Ti,[e.substring(n-1)]),h},bJe=function(e){return he(this,os,c0e).call(this,e,xdr)},c0e=function(e,r=Edr){if(!e||typeof e!="object"||e.type!==null||I(e,Ti).length!==1||this.type===null)return!1;let n=I(e,Ti)[0];return!n||typeof n!="object"||n.type===null?!1:he(this,os,Cj).call(this,n.type,r)},Cj=function(e,r=wdr){var n;return!!((n=r.get(this.type))!=null&&n.includes(e))},_Je=function(e,r){let n=I(e,Ti)[0],i=new vh(null,n,this.options);I(i,Ti).push(""),n.push(i),he(this,os,d0e).call(this,e,r)},d0e=function(e,r){let n=I(e,Ti)[0];I(this,Ti).splice(r,1,...I(n,Ti));for(let i of I(n,Ti))typeof i=="object"&&de(i,Bu,this);de(this,Eb,void 0)},CJe=function(e){let r=mJe.get(this.type);return!!(r!=null&&r.has(e))},IJe=function(e){if(!e||typeof e!="object"||e.type!==null||I(e,Ti).length!==1||this.type===null||I(this,Ti).length!==1)return!1;let r=I(e,Ti)[0];return!r||typeof r!="object"||r.type===null?!1:he(this,os,CJe).call(this,r.type)},SJe=function(e){let r=mJe.get(this.type),n=I(e,Ti)[0],i=r==null?void 0:r.get(n.type);if(!i)return!1;de(this,Ti,I(n,Ti));for(let a of I(this,Ti))typeof a=="object"&&de(a,Bu,this);this.type=i,de(this,Eb,void 0),de(this,_w,!1)},Ij=function(){var e,r;if(hJe(this)){let n=0,i=!1;do{i=!0;for(let a=0;a<I(this,Ti).length;a++){let s=I(this,Ti)[a];typeof s=="object"&&(he(r=s,os,Ij).call(r),he(this,os,c0e).call(this,s)?(i=!1,he(this,os,d0e).call(this,s,a)):he(this,os,bJe).call(this,s)?(i=!1,he(this,os,_Je).call(this,s,a)):he(this,os,IJe).call(this,s)&&(i=!1,he(this,os,SJe).call(this,s)))}}while(!i&&++n<10)}else for(let n of I(this,Ti))typeof n=="object"&&he(e=n,os,Ij).call(e);de(this,Eb,void 0)},f0e=function(e){return I(this,Ti).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,a,s]=r.toRegExpSource(e);return de(this,T4,I(this,T4)||s),n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")},EJe=function(e,r,n=!1){let i=!1,a="",s=!1,o=!1;for(let u=0;u<e.length;u++){let l=e.charAt(u);if(i){i=!1,a+=(Bdr.has(l)?"\\":"")+l,o=!1;continue}if(l==="\\"){u===e.length-1?a+="\\\\":i=!0;continue}if(l==="["){let[f,h,g,_]=pJe(e,u);if(g){a+=f,s=s||h,u+=g-1,r=r||_,o=!1;continue}}if(l==="*"){if(o)continue;o=!0,a+=n&&/^[*]+$/.test(e)?vJe:gJe,r=!0;continue}else o=!1;if(l==="?"){a+=p0e,r=!0;continue}a+=Ndr(l)}return[a,iv(e),!!r,s]},Be(w5,A5);vh=w5;var Cw=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var n0=(t,e,r={})=>(PF(e),!r.nocomment&&e.charAt(0)==="#"?!1:new G1(e,r).match(t)),Ddr=/^\*+([^+@!?\*\[\(]*)$/,Gdr=t=>e=>!e.startsWith(".")&&e.endsWith(t),Fdr=t=>e=>e.endsWith(t),Odr=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),kdr=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),Zdr=/^\*+\.\*+$/,Ldr=t=>!t.startsWith(".")&&t.includes("."),Wdr=t=>t!=="."&&t!==".."&&t.includes("."),Vdr=/^\.\*+$/,Pdr=t=>t!=="."&&t!==".."&&t.startsWith("."),Hdr=/^\*+$/,Mdr=t=>t.length!==0&&!t.startsWith("."),Udr=t=>t.length!==0&&t!=="."&&t!=="..",Ydr=/^\?+([^+@!?\*\[\(]*)?$/,jdr=([t,e=""])=>{let r=RJe([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},Xdr=([t,e=""])=>{let r=TJe([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},qdr=([t,e=""])=>{let r=TJe([t]);return e?n=>r(n)&&n.endsWith(e):r},zdr=([t,e=""])=>{let r=RJe([t]);return e?n=>r(n)&&n.endsWith(e):r},RJe=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},TJe=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},BJe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",xJe={win32:{sep:"\\"},posix:{sep:"/"}},Kdr=BJe==="win32"?xJe.win32.sep:xJe.posix.sep;n0.sep=Kdr;var Ku=Symbol("globstar **");n0.GLOBSTAR=Ku;var $dr="[^/]",Jdr=$dr+"*?",Qdr="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",efr="(?:(?!(?:\\/|^)\\.).)*?",tfr=(t,e={})=>r=>n0(r,t,e);n0.filter=tfr;var Sg=(t,e={})=>Object.assign({},t,e),rfr=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return n0;let e=n0;return Object.assign((n,i,a={})=>e(n,i,Sg(t,a)),{Minimatch:class extends e.Minimatch{constructor(i,a={}){super(i,Sg(t,a))}static defaults(i){return e.defaults(Sg(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,a,s={}){super(i,a,Sg(t,s))}static fromGlob(i,a={}){return e.AST.fromGlob(i,Sg(t,a))}},unescape:(n,i={})=>e.unescape(n,Sg(t,i)),escape:(n,i={})=>e.escape(n,Sg(t,i)),filter:(n,i={})=>e.filter(n,Sg(t,i)),defaults:n=>e.defaults(Sg(t,n)),makeRe:(n,i={})=>e.makeRe(n,Sg(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,Sg(t,i)),match:(n,i,a={})=>e.match(n,i,Sg(t,a)),sep:e.sep,GLOBSTAR:Ku})};n0.defaults=rfr;var NJe=(t,e={})=>(PF(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,AJe.default)(t));n0.braceExpand=NJe;var nfr=(t,e={})=>new G1(t,e).makeRe();n0.makeRe=nfr;var ifr=(t,e,r={})=>{let n=new G1(e,r);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};n0.match=ifr;var wJe=/[?*]|[+@!]\(.*?\)|\[|\]/,afr=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),D1,DJe,h0e,Iw,G1=class{constructor(e,r={}){Be(this,D1);Et(this,"options");Et(this,"set");Et(this,"pattern");Et(this,"windowsPathsNoEscape");Et(this,"nonegate");Et(this,"negate");Et(this,"comment");Et(this,"empty");Et(this,"preserveMultipleSlashes");Et(this,"partial");Et(this,"globSet");Et(this,"globParts");Et(this,"nocase");Et(this,"isWindows");Et(this,"platform");Et(this,"windowsNoMagicRoot");Et(this,"maxGlobstarRecursion");Et(this,"regexp");PF(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||BJe,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...a)=>console.error(...a)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(a=>this.slashSplit(a));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((a,s,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=a[0]===""&&a[1]===""&&(a[2]==="?"||!wJe.test(a[2]))&&!wJe.test(a[3]),l=/^[a-z]:/i.test(a[0]);if(u)return[...a.slice(0,4),...a.slice(4).map(f=>this.parse(f))];if(l)return[a[0],...a.slice(1).map(f=>this.parse(f))]}return a.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(a=>a.indexOf(!1)===-1),this.isWindows)for(let a=0;a<this.set.length;a++){let s=this.set[a];s[0]===""&&s[1]===""&&this.globParts[a][2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3])&&(s[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,i)=>{let a=n[n.length-1];return i==="**"&&a==="**"?n:i===".."&&a&&a!==".."&&a!=="."&&a!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let a=e[i];i===1&&a===""&&e[0]===""||(a==="."||a==="")&&(r=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,e.splice(n-1,2),n-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let s=i;for(;n[s+1]==="**";)s++;s>i&&n.splice(i+1,s-i);let o=n[i+1],u=n[i+2],l=n[i+3];if(o!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;r=!0,n.splice(i,1);let f=n.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let s=1;s<n.length-1;s++){let o=n[s];s===1&&o===""&&n[0]===""||(o==="."||o==="")&&(r=!0,n.splice(s,1),s--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let a=0;for(;(a=n.indexOf("..",a+1))!==-1;){let s=n[a-1];if(s&&s!=="."&&s!==".."&&s!=="**"){r=!0;let u=a===1&&n[a+1]==="**"?["."]:[];n.splice(a-1,2,...u),n.length===0&&n.push(""),a-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let n=r+1;n<e.length;n++){let i=this.partsMatch(e[r],e[n],!this.preserveMultipleSlashes);if(i){e[r]=[],e[n]=i;break}}return e.filter(r=>r.length)}partsMatch(e,r,n=!1){let i=0,a=0,s=[],o="";for(;i<e.length&&a<r.length;)if(e[i]===r[a])s.push(o==="b"?r[a]:e[i]),i++,a++;else if(n&&e[i]==="**"&&r[a]===e[i+1])s.push(e[i]),i++;else if(n&&r[a]==="**"&&e[i]===r[a+1])s.push(r[a]),a++;else if(e[i]==="*"&&r[a]&&(this.options.dot||!r[a].startsWith("."))&&r[a]!=="**"){if(o==="b")return!1;o="a",s.push(e[i]),i++,a++}else if(r[a]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(o==="a")return!1;o="b",s.push(r[a]),i++,a++}else return!1;return e.length===r.length&&s}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=e.slice(n)),this.negate=r}matchOne(e,r,n=!1){let i=0,a=0;if(this.isWindows){let o=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),u=!o&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),l=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),f=!l&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),h=u?3:o?0:void 0,g=f?3:l?0:void 0;if(typeof h=="number"&&typeof g=="number"){let[_,w]=[e[h],r[g]];_.toLowerCase()===w.toLowerCase()&&(r[g]=_,a=g,i=h)}}let{optimizationLevel:s=1}=this.options;return s>=2&&(e=this.levelTwoFileOptimize(e)),r.includes(Ku)?he(this,D1,DJe).call(this,e,r,n,i,a):he(this,D1,Iw).call(this,e,r,n,i,a)}braceExpand(){return NJe(this.pattern,this.options)}parse(e){PF(e);let r=this.options;if(e==="**")return Ku;if(e==="")return"";let n,i=null;(n=e.match(Hdr))?i=r.dot?Udr:Mdr:(n=e.match(Ddr))?i=(r.nocase?r.dot?kdr:Odr:r.dot?Fdr:Gdr)(n[1]):(n=e.match(Ydr))?i=(r.nocase?r.dot?Xdr:jdr:r.dot?qdr:zdr)(n):(n=e.match(Zdr))?i=r.dot?Wdr:Ldr:(n=e.match(Vdr))&&(i=Pdr);let a=w5.fromGlob(e,this.options).toMMPattern();return i&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:i}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?Jdr:r.dot?Qdr:efr,i=new Set(r.nocase?["i"]:[]),a=e.map(u=>{let l=u.map(f=>{if(f instanceof RegExp)for(let h of f.flags.split(""))i.add(h);return typeof f=="string"?afr(f):f===Ku?Ku:f._src});return l.forEach((f,h)=>{let g=l[h+1],_=l[h-1];f!==Ku||_===Ku||(_===void 0?g!==void 0&&g!==Ku?l[h+1]="(?:\\/|"+n+"\\/)?"+g:l[h]=n:g===void 0?l[h-1]=_+"(?:\\/|"+n+")?":g!==Ku&&(l[h-1]=_+"(?:\\/|\\/"+n+"\\/)"+g,l[h+1]=Ku))}),l.filter(f=>f!==Ku).join("/")}).join("|"),[s,o]=e.length>1?["(?:",")"]:["",""];a="^"+s+a+o+"$",this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let a=this.set;this.debug(this.pattern,"set",a);let s=i[i.length-1];if(!s)for(let o=i.length-2;!s&&o>=0;o--)s=i[o];for(let o=0;o<a.length;o++){let u=a[o],l=i;if(n.matchBase&&u.length===1&&(l=[s]),this.matchOne(l,u,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return n0.defaults(e).Minimatch}};D1=new WeakSet,DJe=function(e,r,n,i,a){let s=r.indexOf(Ku,a),o=r.lastIndexOf(Ku),[u,l,f]=n?[r.slice(a,s),r.slice(s+1),[]]:[r.slice(a,s),r.slice(s+1,o),r.slice(o+1)];if(u.length){let O=e.slice(i,i+u.length);if(!he(this,D1,Iw).call(this,O,u,n,0,0))return!1;i+=u.length}let h=0;if(f.length){if(f.length+i>e.length)return!1;let O=e.length-f.length;if(he(this,D1,Iw).call(this,e,f,n,O,0))h=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(O--,!he(this,D1,Iw).call(this,e,f,n,O,0)))return!1;h=f.length+1}}if(!l.length){let O=!!h;for(let Z=i;Z<e.length-h;Z++){let X=String(e[Z]);if(O=!0,X==="."||X===".."||!this.options.dot&&X.startsWith("."))return!1}return n||O}let g=[[[],0]],_=g[0],w=0,T=[0];for(let O of l)O===Ku?(T.push(w),_=[[],0],g.push(_)):(_[0].push(O),w++);let D=g.length-1,G=e.length-h;for(let O of g)O[1]=G-(T[D--]+O[0].length);return!!he(this,D1,h0e).call(this,e,g,i,0,n,0,!!h)},h0e=function(e,r,n,i,a,s,o){let u=r[i];if(!u){for(let h=n;h<e.length;h++){o=!0;let g=e[h];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1}return o}let[l,f]=u;for(;n<=f;){if(he(this,D1,Iw).call(this,e.slice(0,n+l.length),l,a,n,0)&&s<this.maxGlobstarRecursion){let _=he(this,D1,h0e).call(this,e,r,n+l.length,i+1,a,s+1,o);if(_!==!1)return _}let g=e[n];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1;n++}return a||null},Iw=function(e,r,n,i,a){let s,o,u,l;for(s=i,o=a,l=e.length,u=r.length;s<l&&o<u;s++,o++){this.debug("matchOne loop");let f=r[o],h=e[s];if(this.debug(r,f,h),f===!1||f===Ku)return!1;let g;if(typeof f=="string"?(g=h===f,this.debug("string match",f,h,g)):(g=f.test(h),this.debug("pattern match",f,h,g)),!g)return!1}if(s===l&&o===u)return!0;if(s===l)return n;if(o===u)return s===l-1&&e[s]==="";throw new Error("wtf?")};n0.AST=w5;n0.Minimatch=G1;n0.escape=Cw;n0.unescape=iv;var cQe=require("url");var Sw=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ZJe=new Set,m0e=typeof process=="object"&&process?process:{},LJe=(t,e,r,n)=>{typeof m0e.emitWarning=="function"?m0e.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},xj=globalThis.AbortController,GJe=globalThis.AbortSignal,FJe;if(typeof xj>"u"){GJe=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},xj=class{constructor(){e()}signal=new GJe;abort(n){var i,a;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);(a=(i=this.signal).onabort)==null||a.call(i,n)}}};let t=((FJe=m0e.env)==null?void 0:FJe.LRU_CACHE_IGNORE_AC_WARNING)!=="1",e=()=>{t&&(t=!1,LJe("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var sfr=t=>!ZJe.has(t);var R5=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),WJe=t=>R5(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ew:null:null,Ew=class extends Array{constructor(e){super(e),this.fill(0)}},g0e=class t{heap;length;static#e=!1;static create(e){let r=WJe(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},OJe,kJe,av,F1,sv,ov,xw,ww,ic,uv,xl,So,ui,i0,O1,Yf,ud,lv,ld,cv,dv,k1,fv,D5,a0,Sr,v0e,q3,B4,YF,Z1,VJe,z3,Aw,jF,T5,B5,y0e,Sj,Ej,Io,b0e,MF,N5,_0e,C0e=class C0e{constructor(e){Be(this,Sr);Be(this,av);Be(this,F1);Be(this,sv);Be(this,ov);Be(this,xw);Be(this,ww);Et(this,"ttl");Et(this,"ttlResolution");Et(this,"ttlAutopurge");Et(this,"updateAgeOnGet");Et(this,"updateAgeOnHas");Et(this,"allowStale");Et(this,"noDisposeOnSet");Et(this,"noUpdateTTL");Et(this,"maxEntrySize");Et(this,"sizeCalculation");Et(this,"noDeleteOnFetchRejection");Et(this,"noDeleteOnStaleGet");Et(this,"allowStaleOnFetchAbort");Et(this,"allowStaleOnFetchRejection");Et(this,"ignoreFetchAbort");Be(this,ic);Be(this,uv);Be(this,xl);Be(this,So);Be(this,ui);Be(this,i0);Be(this,O1);Be(this,Yf);Be(this,ud);Be(this,lv);Be(this,ld);Be(this,cv);Be(this,dv);Be(this,k1);Be(this,fv);Be(this,D5);Be(this,a0);Be(this,q3,()=>{});Be(this,B4,()=>{});Be(this,YF,()=>{});Be(this,Z1,()=>!1);Be(this,z3,e=>{});Be(this,Aw,(e,r,n)=>{});Be(this,jF,(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Et(this,OJe,"LRUCache");let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:u,dispose:l,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:g,maxSize:_=0,maxEntrySize:w=0,sizeCalculation:T,fetchMethod:D,memoMethod:G,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:Z,allowStaleOnFetchRejection:X,allowStaleOnFetchAbort:ue,ignoreFetchAbort:Q}=e;if(r!==0&&!R5(r))throw new TypeError("max option must be a nonnegative integer");let ie=r?WJe(r):Array;if(!ie)throw new Error("invalid max value: "+r);if(de(this,av,r),de(this,F1,_),this.maxEntrySize=w||I(this,F1),this.sizeCalculation=T,this.sizeCalculation){if(!I(this,F1)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(G!==void 0&&typeof G!="function")throw new TypeError("memoMethod must be a function if defined");if(de(this,ww,G),D!==void 0&&typeof D!="function")throw new TypeError("fetchMethod must be a function if specified");if(de(this,xw,D),de(this,D5,!!D),de(this,xl,new Map),de(this,So,new Array(r).fill(void 0)),de(this,ui,new Array(r).fill(void 0)),de(this,i0,new ie(r)),de(this,O1,new ie(r)),de(this,Yf,0),de(this,ud,0),de(this,lv,g0e.create(r)),de(this,ic,0),de(this,uv,0),typeof l=="function"&&de(this,sv,l),typeof f=="function"?(de(this,ov,f),de(this,ld,[])):(de(this,ov,void 0),de(this,ld,void 0)),de(this,fv,!!I(this,sv)),de(this,a0,!!I(this,ov)),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!X,this.allowStaleOnFetchAbort=!!ue,this.ignoreFetchAbort=!!Q,this.maxEntrySize!==0){if(I(this,F1)!==0&&!R5(I(this,F1)))throw new TypeError("maxSize must be a positive integer if specified");if(!R5(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");he(this,Sr,VJe).call(this)}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!Z,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=R5(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=n||0,this.ttl){if(!R5(this.ttl))throw new TypeError("ttl must be a positive integer if specified");he(this,Sr,v0e).call(this)}if(I(this,av)===0&&this.ttl===0&&I(this,F1)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!I(this,av)&&!I(this,F1)){let M="LRU_CACHE_UNBOUNDED";sfr(M)&&(ZJe.add(M),LJe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,C0e))}}static unsafeExposeInternals(e){return{starts:I(e,dv),ttls:I(e,k1),sizes:I(e,cv),keyMap:I(e,xl),keyList:I(e,So),valList:I(e,ui),next:I(e,i0),prev:I(e,O1),get head(){return I(e,Yf)},get tail(){return I(e,ud)},free:I(e,lv),isBackgroundFetch:r=>{var n;return he(n=e,Sr,Io).call(n,r)},backgroundFetch:(r,n,i,a)=>{var s;return he(s=e,Sr,Ej).call(s,r,n,i,a)},moveToTail:r=>{var n;return he(n=e,Sr,MF).call(n,r)},indexes:r=>{var n;return he(n=e,Sr,T5).call(n,r)},rindexes:r=>{var n;return he(n=e,Sr,B5).call(n,r)},isStale:r=>{var n;return I(n=e,Z1).call(n,r)}}}get max(){return I(this,av)}get maxSize(){return I(this,F1)}get calculatedSize(){return I(this,uv)}get size(){return I(this,ic)}get fetchMethod(){return I(this,xw)}get memoMethod(){return I(this,ww)}get dispose(){return I(this,sv)}get disposeAfter(){return I(this,ov)}getRemainingTTL(e){return I(this,xl).has(e)?1/0:0}*entries(){for(let e of he(this,Sr,T5).call(this))I(this,ui)[e]!==void 0&&I(this,So)[e]!==void 0&&!he(this,Sr,Io).call(this,I(this,ui)[e])&&(yield[I(this,So)[e],I(this,ui)[e]])}*rentries(){for(let e of he(this,Sr,B5).call(this))I(this,ui)[e]!==void 0&&I(this,So)[e]!==void 0&&!he(this,Sr,Io).call(this,I(this,ui)[e])&&(yield[I(this,So)[e],I(this,ui)[e]])}*keys(){for(let e of he(this,Sr,T5).call(this)){let r=I(this,So)[e];r!==void 0&&!he(this,Sr,Io).call(this,I(this,ui)[e])&&(yield r)}}*rkeys(){for(let e of he(this,Sr,B5).call(this)){let r=I(this,So)[e];r!==void 0&&!he(this,Sr,Io).call(this,I(this,ui)[e])&&(yield r)}}*values(){for(let e of he(this,Sr,T5).call(this))I(this,ui)[e]!==void 0&&!he(this,Sr,Io).call(this,I(this,ui)[e])&&(yield I(this,ui)[e])}*rvalues(){for(let e of he(this,Sr,B5).call(this))I(this,ui)[e]!==void 0&&!he(this,Sr,Io).call(this,I(this,ui)[e])&&(yield I(this,ui)[e])}[(kJe=Symbol.iterator,OJe=Symbol.toStringTag,kJe)](){return this.entries()}find(e,r={}){for(let n of he(this,Sr,T5).call(this)){let i=I(this,ui)[n],a=he(this,Sr,Io).call(this,i)?i.__staleWhileFetching:i;if(a!==void 0&&e(a,I(this,So)[n],this))return this.get(I(this,So)[n],r)}}forEach(e,r=this){for(let n of he(this,Sr,T5).call(this)){let i=I(this,ui)[n],a=he(this,Sr,Io).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(r,a,I(this,So)[n],this)}}rforEach(e,r=this){for(let n of he(this,Sr,B5).call(this)){let i=I(this,ui)[n],a=he(this,Sr,Io).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(r,a,I(this,So)[n],this)}}purgeStale(){let e=!1;for(let r of he(this,Sr,B5).call(this,{allowStale:!0}))I(this,Z1).call(this,r)&&(he(this,Sr,N5).call(this,I(this,So)[r],"expire"),e=!0);return e}info(e){let r=I(this,xl).get(e);if(r===void 0)return;let n=I(this,ui)[r],i=he(this,Sr,Io).call(this,n)?n.__staleWhileFetching:n;if(i===void 0)return;let a={value:i};if(I(this,k1)&&I(this,dv)){let s=I(this,k1)[r],o=I(this,dv)[r];if(s&&o){let u=s-(Sw.now()-o);a.ttl=u,a.start=Date.now()}}return I(this,cv)&&(a.size=I(this,cv)[r]),a}dump(){let e=[];for(let r of he(this,Sr,T5).call(this,{allowStale:!0})){let n=I(this,So)[r],i=I(this,ui)[r],a=he(this,Sr,Io).call(this,i)?i.__staleWhileFetching:i;if(a===void 0||n===void 0)continue;let s={value:a};if(I(this,k1)&&I(this,dv)){s.ttl=I(this,k1)[r];let o=Sw.now()-I(this,dv)[r];s.start=Math.floor(Date.now()-o)}I(this,cv)&&(s.size=I(this,cv)[r]),e.unshift([n,s])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=Sw.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){var g,_,w,T,D;if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:a,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:u}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,f=I(this,jF).call(this,e,r,n.size||0,o);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),he(this,Sr,N5).call(this,e,"set"),this;let h=I(this,ic)===0?void 0:I(this,xl).get(e);if(h===void 0)h=I(this,ic)===0?I(this,ud):I(this,lv).length!==0?I(this,lv).pop():I(this,ic)===I(this,av)?he(this,Sr,Sj).call(this,!1):I(this,ic),I(this,So)[h]=e,I(this,ui)[h]=r,I(this,xl).set(e,h),I(this,i0)[I(this,ud)]=h,I(this,O1)[h]=I(this,ud),de(this,ud,h),R9(this,ic)._++,I(this,Aw).call(this,h,f,u),u&&(u.set="add"),l=!1;else{he(this,Sr,MF).call(this,h);let G=I(this,ui)[h];if(r!==G){if(I(this,D5)&&he(this,Sr,Io).call(this,G)){G.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:O}=G;O!==void 0&&!s&&(I(this,fv)&&((g=I(this,sv))==null||g.call(this,O,e,"set")),I(this,a0)&&((_=I(this,ld))==null||_.push([O,e,"set"])))}else s||(I(this,fv)&&((w=I(this,sv))==null||w.call(this,G,e,"set")),I(this,a0)&&((T=I(this,ld))==null||T.push([G,e,"set"])));if(I(this,z3).call(this,h),I(this,Aw).call(this,h,f,u),I(this,ui)[h]=r,u){u.set="replace";let O=G&&he(this,Sr,Io).call(this,G)?G.__staleWhileFetching:G;O!==void 0&&(u.oldValue=O)}}else u&&(u.set="update")}if(i!==0&&!I(this,k1)&&he(this,Sr,v0e).call(this),I(this,k1)&&(l||I(this,YF).call(this,h,i,a),u&&I(this,B4).call(this,u,h)),!s&&I(this,a0)&&I(this,ld)){let G=I(this,ld),O;for(;O=G==null?void 0:G.shift();)(D=I(this,ov))==null||D.call(this,...O)}return this}pop(){var e;try{for(;I(this,ic);){let r=I(this,ui)[I(this,Yf)];if(he(this,Sr,Sj).call(this,!0),he(this,Sr,Io).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(I(this,a0)&&I(this,ld)){let r=I(this,ld),n;for(;n=r==null?void 0:r.shift();)(e=I(this,ov))==null||e.call(this,...n)}}}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,a=I(this,xl).get(e);if(a!==void 0){let s=I(this,ui)[a];if(he(this,Sr,Io).call(this,s)&&s.__staleWhileFetching===void 0)return!1;if(I(this,Z1).call(this,a))i&&(i.has="stale",I(this,B4).call(this,i,a));else return n&&I(this,q3).call(this,a),i&&(i.has="hit",I(this,B4).call(this,i,a)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=I(this,xl).get(e);if(i===void 0||!n&&I(this,Z1).call(this,i))return;let a=I(this,ui)[i];return he(this,Sr,Io).call(this,a)?a.__staleWhileFetching:a}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:T,forceRefresh:D=!1,status:G,signal:O}=r;if(!I(this,D5))return G&&(G.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:G});let Z={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:s,noDisposeOnSet:o,size:u,sizeCalculation:l,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:w,ignoreFetchAbort:_,status:G,signal:O},X=I(this,xl).get(e);if(X===void 0){G&&(G.fetch="miss");let ue=he(this,Sr,Ej).call(this,e,X,Z,T);return ue.__returned=ue}else{let ue=I(this,ui)[X];if(he(this,Sr,Io).call(this,ue)){let Te=n&&ue.__staleWhileFetching!==void 0;return G&&(G.fetch="inflight",Te&&(G.returnedStale=!0)),Te?ue.__staleWhileFetching:ue.__returned=ue}let Q=I(this,Z1).call(this,X);if(!D&&!Q)return G&&(G.fetch="hit"),he(this,Sr,MF).call(this,X),i&&I(this,q3).call(this,X),G&&I(this,B4).call(this,G,X),ue;let ie=he(this,Sr,Ej).call(this,e,X,Z,T),ne=ie.__staleWhileFetching!==void 0&&n;return G&&(G.fetch=Q?"stale":"refresh",ne&&Q&&(G.returnedStale=!0)),ne?ie.__staleWhileFetching:ie.__returned=ie}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=I(this,ww);if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:a,...s}=r,o=this.get(e,s);if(!a&&o!==void 0)return o;let u=n(e,o,{options:s,context:i});return this.set(e,u,s),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:s}=r,o=I(this,xl).get(e);if(o!==void 0){let u=I(this,ui)[o],l=he(this,Sr,Io).call(this,u);return s&&I(this,B4).call(this,s,o),I(this,Z1).call(this,o)?(s&&(s.get="stale"),l?(s&&n&&u.__staleWhileFetching!==void 0&&(s.returnedStale=!0),n?u.__staleWhileFetching:void 0):(a||he(this,Sr,N5).call(this,e,"expire"),s&&n&&(s.returnedStale=!0),n?u:void 0)):(s&&(s.get="hit"),l?u.__staleWhileFetching:(he(this,Sr,MF).call(this,o),i&&I(this,q3).call(this,o),u))}else s&&(s.get="miss")}delete(e){return he(this,Sr,N5).call(this,e,"delete")}clear(){return he(this,Sr,_0e).call(this,"delete")}};av=new WeakMap,F1=new WeakMap,sv=new WeakMap,ov=new WeakMap,xw=new WeakMap,ww=new WeakMap,ic=new WeakMap,uv=new WeakMap,xl=new WeakMap,So=new WeakMap,ui=new WeakMap,i0=new WeakMap,O1=new WeakMap,Yf=new WeakMap,ud=new WeakMap,lv=new WeakMap,ld=new WeakMap,cv=new WeakMap,dv=new WeakMap,k1=new WeakMap,fv=new WeakMap,D5=new WeakMap,a0=new WeakMap,Sr=new WeakSet,v0e=function(){let e=new Ew(I(this,av)),r=new Ew(I(this,av));de(this,k1,e),de(this,dv,r),de(this,YF,(a,s,o=Sw.now())=>{if(r[a]=s!==0?o:0,e[a]=s,s!==0&&this.ttlAutopurge){let u=setTimeout(()=>{I(this,Z1).call(this,a)&&he(this,Sr,N5).call(this,I(this,So)[a],"expire")},s+1);u.unref&&u.unref()}}),de(this,q3,a=>{r[a]=e[a]!==0?Sw.now():0}),de(this,B4,(a,s)=>{if(e[s]){let o=e[s],u=r[s];if(!o||!u)return;a.ttl=o,a.start=u,a.now=n||i();let l=a.now-u;a.remainingTTL=o-l}});let n=0,i=()=>{let a=Sw.now();if(this.ttlResolution>0){n=a;let s=setTimeout(()=>n=0,this.ttlResolution);s.unref&&s.unref()}return a};this.getRemainingTTL=a=>{let s=I(this,xl).get(a);if(s===void 0)return 0;let o=e[s],u=r[s];if(!o||!u)return 1/0;let l=(n||i())-u;return o-l},de(this,Z1,a=>{let s=r[a],o=e[a];return!!o&&!!s&&(n||i())-s>o})},q3=new WeakMap,B4=new WeakMap,YF=new WeakMap,Z1=new WeakMap,VJe=function(){let e=new Ew(I(this,av));de(this,uv,0),de(this,cv,e),de(this,z3,r=>{de(this,uv,I(this,uv)-e[r]),e[r]=0}),de(this,jF,(r,n,i,a)=>{if(he(this,Sr,Io).call(this,n))return 0;if(!R5(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(n,r),!R5(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),de(this,Aw,(r,n,i)=>{if(e[r]=n,I(this,F1)){let a=I(this,F1)-e[r];for(;I(this,uv)>a;)he(this,Sr,Sj).call(this,!0)}de(this,uv,I(this,uv)+e[r]),i&&(i.entrySize=n,i.totalCalculatedSize=I(this,uv))})},z3=new WeakMap,Aw=new WeakMap,jF=new WeakMap,T5=function*({allowStale:e=this.allowStale}={}){if(I(this,ic))for(let r=I(this,ud);!(!he(this,Sr,y0e).call(this,r)||((e||!I(this,Z1).call(this,r))&&(yield r),r===I(this,Yf)));)r=I(this,O1)[r]},B5=function*({allowStale:e=this.allowStale}={}){if(I(this,ic))for(let r=I(this,Yf);!(!he(this,Sr,y0e).call(this,r)||((e||!I(this,Z1).call(this,r))&&(yield r),r===I(this,ud)));)r=I(this,i0)[r]},y0e=function(e){return e!==void 0&&I(this,xl).get(I(this,So)[e])===e},Sj=function(e){var a,s;let r=I(this,Yf),n=I(this,So)[r],i=I(this,ui)[r];return I(this,D5)&&he(this,Sr,Io).call(this,i)?i.__abortController.abort(new Error("evicted")):(I(this,fv)||I(this,a0))&&(I(this,fv)&&((a=I(this,sv))==null||a.call(this,i,n,"evict")),I(this,a0)&&((s=I(this,ld))==null||s.push([i,n,"evict"]))),I(this,z3).call(this,r),e&&(I(this,So)[r]=void 0,I(this,ui)[r]=void 0,I(this,lv).push(r)),I(this,ic)===1?(de(this,Yf,de(this,ud,0)),I(this,lv).length=0):de(this,Yf,I(this,i0)[r]),I(this,xl).delete(n),R9(this,ic)._--,r},Ej=function(e,r,n,i){let a=r===void 0?void 0:I(this,ui)[r];if(he(this,Sr,Io).call(this,a))return a;let s=new xj,{signal:o}=n;o==null||o.addEventListener("abort",()=>s.abort(o.reason),{signal:s.signal});let u={signal:s.signal,options:n,context:i},l=(T,D=!1)=>{let{aborted:G}=s.signal,O=n.ignoreFetchAbort&&T!==void 0;if(n.status&&(G&&!D?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,O&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),G&&!O&&!D)return h(s.signal.reason);let Z=_;return I(this,ui)[r]===_&&(T===void 0?Z.__staleWhileFetching?I(this,ui)[r]=Z.__staleWhileFetching:he(this,Sr,N5).call(this,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,T,u.options))),T},f=T=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=T),h(T)),h=T=>{let{aborted:D}=s.signal,G=D&&n.allowStaleOnFetchAbort,O=G||n.allowStaleOnFetchRejection,Z=O||n.noDeleteOnFetchRejection,X=_;if(I(this,ui)[r]===_&&(!Z||X.__staleWhileFetching===void 0?he(this,Sr,N5).call(this,e,"fetch"):G||(I(this,ui)[r]=X.__staleWhileFetching)),O)return n.status&&X.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),X.__staleWhileFetching;if(X.__returned===X)throw T},g=(T,D)=>{var O;let G=(O=I(this,xw))==null?void 0:O.call(this,e,a,u);G&&G instanceof Promise&&G.then(Z=>T(Z===void 0?void 0:Z),D),s.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(T(void 0),n.allowStaleOnFetchAbort&&(T=Z=>l(Z,!0)))})};n.status&&(n.status.fetchDispatched=!0);let _=new Promise(g).then(l,f),w=Object.assign(_,{__abortController:s,__staleWhileFetching:a,__returned:void 0});return r===void 0?(this.set(e,w,{...u.options,status:void 0}),r=I(this,xl).get(e)):I(this,ui)[r]=w,w},Io=function(e){if(!I(this,D5))return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof xj},b0e=function(e,r){I(this,O1)[r]=e,I(this,i0)[e]=r},MF=function(e){e!==I(this,ud)&&(e===I(this,Yf)?de(this,Yf,I(this,i0)[e]):he(this,Sr,b0e).call(this,I(this,O1)[e],I(this,i0)[e]),he(this,Sr,b0e).call(this,I(this,ud),e),de(this,ud,e))},N5=function(e,r){var i,a,s,o;let n=!1;if(I(this,ic)!==0){let u=I(this,xl).get(e);if(u!==void 0)if(n=!0,I(this,ic)===1)he(this,Sr,_0e).call(this,r);else{I(this,z3).call(this,u);let l=I(this,ui)[u];if(he(this,Sr,Io).call(this,l)?l.__abortController.abort(new Error("deleted")):(I(this,fv)||I(this,a0))&&(I(this,fv)&&((i=I(this,sv))==null||i.call(this,l,e,r)),I(this,a0)&&((a=I(this,ld))==null||a.push([l,e,r]))),I(this,xl).delete(e),I(this,So)[u]=void 0,I(this,ui)[u]=void 0,u===I(this,ud))de(this,ud,I(this,O1)[u]);else if(u===I(this,Yf))de(this,Yf,I(this,i0)[u]);else{let f=I(this,O1)[u];I(this,i0)[f]=I(this,i0)[u];let h=I(this,i0)[u];I(this,O1)[h]=I(this,O1)[u]}R9(this,ic)._--,I(this,lv).push(u)}}if(I(this,a0)&&((s=I(this,ld))!=null&&s.length)){let u=I(this,ld),l;for(;l=u==null?void 0:u.shift();)(o=I(this,ov))==null||o.call(this,...l)}return n},_0e=function(e){var r,n,i;for(let a of he(this,Sr,B5).call(this,{allowStale:!0})){let s=I(this,ui)[a];if(he(this,Sr,Io).call(this,s))s.__abortController.abort(new Error("deleted"));else{let o=I(this,So)[a];I(this,fv)&&((r=I(this,sv))==null||r.call(this,s,o,e)),I(this,a0)&&((n=I(this,ld))==null||n.push([s,o,e]))}}if(I(this,xl).clear(),I(this,ui).fill(void 0),I(this,So).fill(void 0),I(this,k1)&&I(this,dv)&&(I(this,k1).fill(0),I(this,dv).fill(0)),I(this,cv)&&I(this,cv).fill(0),de(this,Yf,0),de(this,ud,0),I(this,lv).length=0,de(this,uv,0),de(this,ic,0),I(this,a0)&&I(this,ld)){let a=I(this,ld),s;for(;s=a==null?void 0:a.shift();)(i=I(this,ov))==null||i.call(this,...s)}};var UF=C0e;var Fw=require("path"),KJe=require("url"),Tb=require("fs"),gfr=vt(require("fs"),1),k5=require("fs/promises");var Dj=require("events"),R0e=vt(require("stream"),1),YJe=require("string_decoder"),PJe=typeof process=="object"&&process?process:{stdout:null,stderr:null},ofr=t=>!!t&&typeof t=="object"&&(t instanceof F5||t instanceof R0e.default||ufr(t)||lfr(t)),ufr=t=>!!t&&typeof t=="object"&&t instanceof Dj.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==R0e.default.Writable.prototype.pipe,lfr=t=>!!t&&typeof t=="object"&&t instanceof Dj.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",N4=Symbol("EOF"),D4=Symbol("maybeEmitEnd"),G5=Symbol("emittedEnd"),wj=Symbol("emittingEnd"),XF=Symbol("emittedError"),Aj=Symbol("closed"),HJe=Symbol("read"),Rj=Symbol("flush"),MJe=Symbol("flushChunk"),pv=Symbol("encoding"),Rw=Symbol("decoder"),cd=Symbol("flowing"),qF=Symbol("paused"),Tw=Symbol("resume"),dd=Symbol("buffer"),s0=Symbol("pipes"),fd=Symbol("bufferLength"),I0e=Symbol("bufferPush"),Tj=Symbol("bufferShift"),jf=Symbol("objectMode"),$u=Symbol("destroyed"),S0e=Symbol("error"),E0e=Symbol("emitData"),UJe=Symbol("emitEnd"),x0e=Symbol("emitEnd2"),xb=Symbol("async"),w0e=Symbol("abort"),Bj=Symbol("aborted"),zF=Symbol("signal"),K3=Symbol("dataListeners"),L1=Symbol("discarded"),KF=t=>Promise.resolve().then(t),cfr=t=>t(),dfr=t=>t==="end"||t==="finish"||t==="prefinish",ffr=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,pfr=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Nj=class{src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[Tw](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},A0e=class extends Nj{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}},hfr=t=>!!t.objectMode,mfr=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",F5=class extends Dj.EventEmitter{[cd]=!1;[qF]=!1;[s0]=[];[dd]=[];[jf];[pv];[xb];[Rw];[N4]=!1;[G5]=!1;[wj]=!1;[Aj]=!1;[XF]=null;[fd]=0;[$u]=!1;[zF];[Bj]=!1;[K3]=0;[L1]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");hfr(r)?(this[jf]=!0,this[pv]=null):mfr(r)?(this[pv]=r.encoding,this[jf]=!1):(this[jf]=!1,this[pv]=null),this[xb]=!!r.async,this[Rw]=this[pv]?new YJe.StringDecoder(this[pv]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[dd]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[s0]});let{signal:n}=r;n&&(this[zF]=n,n.aborted?this[w0e]():n.addEventListener("abort",()=>this[w0e]()))}get bufferLength(){return this[fd]}get encoding(){return this[pv]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[jf]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[xb]}set async(e){this[xb]=this[xb]||!!e}[w0e](){var e,r;this[Bj]=!0,this.emit("abort",(e=this[zF])==null?void 0:e.reason),this.destroy((r=this[zF])==null?void 0:r.reason)}get aborted(){return this[Bj]}set aborted(e){}write(e,r,n){var a;if(this[Bj])return!1;if(this[N4])throw new Error("write after end");if(this[$u])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[xb]?KF:cfr;if(!this[jf]&&!Buffer.isBuffer(e)){if(pfr(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(ffr(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[jf]?(this[cd]&&this[fd]!==0&&this[Rj](!0),this[cd]?this.emit("data",e):this[I0e](e),this[fd]!==0&&this.emit("readable"),n&&i(n),this[cd]):e.length?(typeof e=="string"&&!(r===this[pv]&&!((a=this[Rw])!=null&&a.lastNeed))&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[pv]&&(e=this[Rw].write(e)),this[cd]&&this[fd]!==0&&this[Rj](!0),this[cd]?this.emit("data",e):this[I0e](e),this[fd]!==0&&this.emit("readable"),n&&i(n),this[cd]):(this[fd]!==0&&this.emit("readable"),n&&i(n),this[cd])}read(e){if(this[$u])return null;if(this[L1]=!1,this[fd]===0||e===0||e&&e>this[fd])return this[D4](),null;this[jf]&&(e=null),this[dd].length>1&&!this[jf]&&(this[dd]=[this[pv]?this[dd].join(""):Buffer.concat(this[dd],this[fd])]);let r=this[HJe](e||null,this[dd][0]);return this[D4](),r}[HJe](e,r){if(this[jf])this[Tj]();else{let n=r;e===n.length||e===null?this[Tj]():typeof n=="string"?(this[dd][0]=n.slice(e),r=n.slice(0,e),this[fd]-=e):(this[dd][0]=n.subarray(e),r=n.subarray(0,e),this[fd]-=e)}return this.emit("data",r),!this[dd].length&&!this[N4]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[N4]=!0,this.writable=!1,(this[cd]||!this[qF])&&this[D4](),this}[Tw](){this[$u]||(!this[K3]&&!this[s0].length&&(this[L1]=!0),this[qF]=!1,this[cd]=!0,this.emit("resume"),this[dd].length?this[Rj]():this[N4]?this[D4]():this.emit("drain"))}resume(){return this[Tw]()}pause(){this[cd]=!1,this[qF]=!0,this[L1]=!1}get destroyed(){return this[$u]}get flowing(){return this[cd]}get paused(){return this[qF]}[I0e](e){this[jf]?this[fd]+=1:this[fd]+=e.length,this[dd].push(e)}[Tj](){return this[jf]?this[fd]-=1:this[fd]-=this[dd][0].length,this[dd].shift()}[Rj](e=!1){do;while(this[MJe](this[Tj]())&&this[dd].length);!e&&!this[dd].length&&!this[N4]&&this.emit("drain")}[MJe](e){return this.emit("data",e),this[cd]}pipe(e,r){if(this[$u])return e;this[L1]=!1;let n=this[G5];return r=r||{},e===PJe.stdout||e===PJe.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[s0].push(r.proxyErrors?new A0e(this,e,r):new Nj(this,e,r)),this[xb]?KF(()=>this[Tw]()):this[Tw]()),e}unpipe(e){let r=this[s0].find(n=>n.dest===e);r&&(this[s0].length===1?(this[cd]&&this[K3]===0&&(this[cd]=!1),this[s0]=[]):this[s0].splice(this[s0].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[L1]=!1,this[K3]++,!this[s0].length&&!this[cd]&&this[Tw]();else if(e==="readable"&&this[fd]!==0)super.emit("readable");else if(dfr(e)&&this[G5])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[XF]){let i=r;this[xb]?KF(()=>i.call(this,this[XF])):i.call(this,this[XF])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[K3]=this.listeners("data").length,this[K3]===0&&!this[L1]&&!this[s0].length&&(this[cd]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[K3]=0,!this[L1]&&!this[s0].length&&(this[cd]=!1)),r}get emittedEnd(){return this[G5]}[D4](){!this[wj]&&!this[G5]&&!this[$u]&&this[dd].length===0&&this[N4]&&(this[wj]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Aj]&&this.emit("close"),this[wj]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==$u&&this[$u])return!1;if(e==="data")return!this[jf]&&!n?!1:this[xb]?(KF(()=>this[E0e](n)),!0):this[E0e](n);if(e==="end")return this[UJe]();if(e==="close"){if(this[Aj]=!0,!this[G5]&&!this[$u])return!1;let a=super.emit("close");return this.removeAllListeners("close"),a}else if(e==="error"){this[XF]=n,super.emit(S0e,n);let a=!this[zF]||this.listeners("error").length?super.emit("error",n):!1;return this[D4](),a}else if(e==="resume"){let a=super.emit("resume");return this[D4](),a}else if(e==="finish"||e==="prefinish"){let a=super.emit(e);return this.removeAllListeners(e),a}let i=super.emit(e,...r);return this[D4](),i}[E0e](e){for(let n of this[s0])n.dest.write(e)===!1&&this.pause();let r=this[L1]?!1:super.emit("data",e);return this[D4](),r}[UJe](){return this[G5]?!1:(this[G5]=!0,this.readable=!1,this[xb]?(KF(()=>this[x0e]()),!0):this[x0e]())}[x0e](){if(this[Rw]){let r=this[Rw].end();if(r){for(let n of this[s0])n.dest.write(r);this[L1]||super.emit("data",r)}}for(let r of this[s0])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[jf]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[jf]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[jf])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[pv]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on($u,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[L1]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[N4])return r();let a,s,o=h=>{this.off("data",u),this.off("end",l),this.off($u,f),r(),s(h)},u=h=>{this.off("error",o),this.off("end",l),this.off($u,f),this.pause(),a({value:h,done:!!this[N4]})},l=()=>{this.off("error",o),this.off("data",u),this.off($u,f),r(),a({done:!0,value:void 0})},f=()=>o(new Error("stream destroyed"));return new Promise((h,g)=>{s=g,a=h,this.once($u,f),this.once("error",o),this.once("end",l),this.once("data",u)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[L1]=!1;let e=!1,r=()=>(this.pause(),this.off(S0e,r),this.off($u,r),this.off("end",r),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return r();let i=this.read();return i===null?r():{done:!1,value:i}};return this.once("end",r),this.once(S0e,r),this.once($u,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[$u])return e?this.emit("error",e):this.emit($u),this;this[$u]=!0,this[L1]=!0,this[dd].length=0,this[fd]=0;let r=this;return typeof r.close=="function"&&!this[Aj]&&r.close(),e?this.emit("error",e):this.emit($u),this}static get isStream(){return ofr}};var vfr=Tb.realpathSync.native,JF={lstatSync:Tb.lstatSync,readdir:Tb.readdir,readdirSync:Tb.readdirSync,readlinkSync:Tb.readlinkSync,realpathSync:vfr,promises:{lstat:k5.lstat,readdir:k5.readdir,readlink:k5.readlink,realpath:k5.realpath}},$Je=t=>!t||t===JF||t===gfr?JF:{...JF,...t,promises:{...JF.promises,...t.promises||{}}},JJe=/^\\\\\?\\([a-z]:)\\?$/i,yfr=t=>t.replace(/\//g,"\\").replace(JJe,"$1\\"),bfr=/[\\\/]/,xg=0,QJe=1,eQe=2,wb=4,tQe=6,rQe=8,$3=10,nQe=12,Eg=15,$F=~Eg,T0e=16,jJe=32,QF=64,hv=128,Gj=256,Oj=512,XJe=QF|hv|Oj,_fr=1023,B0e=t=>t.isFile()?rQe:t.isDirectory()?wb:t.isSymbolicLink()?$3:t.isCharacterDevice()?eQe:t.isBlockDevice()?tQe:t.isSocket()?nQe:t.isFIFO()?QJe:xg,qJe=new Map,eO=t=>{let e=qJe.get(t);if(e)return e;let r=t.normalize("NFKD");return qJe.set(t,r),r},zJe=new Map,Fj=t=>{let e=zJe.get(t);if(e)return e;let r=eO(t.toLowerCase());return zJe.set(t,r),r},Wj=class extends UF{constructor(){super({max:256})}},N0e=class extends UF{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},iQe=Symbol("PathScurry setAsCwd"),o0,iO,aO,sO,oO,uO,lO,cO,dO,fO,pO,hO,mO,gO,vO,yO,bO,_O,CO,O5,J3,Ab,G4,F4,O4,ri,Q3,k4,Rb,Tn,D0e,kj,tO,G0e,F0e,rO,Zj,O0e,k0e,Lj,aQe,sQe,oQe,Z0e,Bw,Nw,uQe,e8,Xf=class{constructor(e,r=xg,n,i,a,s,o){Be(this,Tn);Et(this,"name");Et(this,"root");Et(this,"roots");Et(this,"parent");Et(this,"nocase");Et(this,"isCWD",!1);Be(this,o0);Be(this,iO);Be(this,aO);Be(this,sO);Be(this,oO);Be(this,uO);Be(this,lO);Be(this,cO);Be(this,dO);Be(this,fO);Be(this,pO);Be(this,hO);Be(this,mO);Be(this,gO);Be(this,vO);Be(this,yO);Be(this,bO);Be(this,_O);Be(this,CO);Be(this,O5);Be(this,J3);Be(this,Ab);Be(this,G4);Be(this,F4);Be(this,O4);Be(this,ri);Be(this,Q3);Be(this,k4);Be(this,Rb);Be(this,Bw,[]);Be(this,Nw,!1);Be(this,e8);this.name=e,de(this,O5,a?Fj(e):eO(e)),de(this,ri,r&_fr),this.nocase=a,this.roots=i,this.root=n||this,de(this,Q3,s),de(this,Ab,o.fullpath),de(this,F4,o.relative),de(this,O4,o.relativePosix),this.parent=o.parent,this.parent?de(this,o0,I(this.parent,o0)):de(this,o0,$Je(o.fs))}get dev(){return I(this,iO)}get mode(){return I(this,aO)}get nlink(){return I(this,sO)}get uid(){return I(this,oO)}get gid(){return I(this,uO)}get rdev(){return I(this,lO)}get blksize(){return I(this,cO)}get ino(){return I(this,dO)}get size(){return I(this,fO)}get blocks(){return I(this,pO)}get atimeMs(){return I(this,hO)}get mtimeMs(){return I(this,mO)}get ctimeMs(){return I(this,gO)}get birthtimeMs(){return I(this,vO)}get atime(){return I(this,yO)}get mtime(){return I(this,bO)}get ctime(){return I(this,_O)}get birthtime(){return I(this,CO)}get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return I(this,J3)!==void 0?I(this,J3):this.parent?de(this,J3,this.parent.depth()+1):de(this,J3,0)}childrenCache(){return I(this,Q3)}resolve(e){var s;if(!e)return this;let r=this.getRootString(e),i=e.substring(r.length).split(this.splitSep);return r?he(s=this.getRoot(r),Tn,D0e).call(s,i):he(this,Tn,D0e).call(this,i)}children(){let e=I(this,Q3).get(this);if(e)return e;let r=Object.assign([],{provisional:0});return I(this,Q3).set(this,r),de(this,ri,I(this,ri)&~T0e),r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?Fj(e):eO(e);for(let u of n)if(I(u,O5)===i)return u;let a=this.parent?this.sep:"",s=I(this,Ab)?I(this,Ab)+a+e:void 0,o=this.newChild(e,xg,{...r,parent:this,fullpath:s});return this.canReaddir()||de(o,ri,I(o,ri)|hv),n.push(o),o}relative(){if(this.isCWD)return"";if(I(this,F4)!==void 0)return I(this,F4);let e=this.name,r=this.parent;if(!r)return de(this,F4,this.name);let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(I(this,O4)!==void 0)return I(this,O4);let e=this.name,r=this.parent;if(!r)return de(this,O4,this.fullpathPosix());let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(I(this,Ab)!==void 0)return I(this,Ab);let e=this.name,r=this.parent;if(!r)return de(this,Ab,this.name);let i=r.fullpath()+(r.parent?this.sep:"")+e;return de(this,Ab,i)}fullpathPosix(){if(I(this,G4)!==void 0)return I(this,G4);if(this.sep==="/")return de(this,G4,this.fullpath());if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?de(this,G4,`//?/${i}`):de(this,G4,i)}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return de(this,G4,n)}isUnknown(){return(I(this,ri)&Eg)===xg}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(I(this,ri)&Eg)===rQe}isDirectory(){return(I(this,ri)&Eg)===wb}isCharacterDevice(){return(I(this,ri)&Eg)===eQe}isBlockDevice(){return(I(this,ri)&Eg)===tQe}isFIFO(){return(I(this,ri)&Eg)===QJe}isSocket(){return(I(this,ri)&Eg)===nQe}isSymbolicLink(){return(I(this,ri)&$3)===$3}lstatCached(){return I(this,ri)&jJe?this:void 0}readlinkCached(){return I(this,k4)}realpathCached(){return I(this,Rb)}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(I(this,k4))return!0;if(!this.parent)return!1;let e=I(this,ri)&Eg;return!(e!==xg&&e!==$3||I(this,ri)&Gj||I(this,ri)&hv)}calledReaddir(){return!!(I(this,ri)&T0e)}isENOENT(){return!!(I(this,ri)&hv)}isNamed(e){return this.nocase?I(this,O5)===Fj(e):I(this,O5)===eO(e)}async readlink(){var r;let e=I(this,k4);if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await I(this,o0).promises.readlink(this.fullpath()),i=(r=await this.parent.realpath())==null?void 0:r.resolve(n);if(i)return de(this,k4,i)}catch(n){he(this,Tn,k0e).call(this,n.code);return}}readlinkSync(){var r;let e=I(this,k4);if(e)return e;if(this.canReadlink()&&this.parent)try{let n=I(this,o0).readlinkSync(this.fullpath()),i=(r=this.parent.realpathSync())==null?void 0:r.resolve(n);if(i)return de(this,k4,i)}catch(n){he(this,Tn,k0e).call(this,n.code);return}}async lstat(){if((I(this,ri)&hv)===0)try{return he(this,Tn,Z0e).call(this,await I(this,o0).promises.lstat(this.fullpath())),this}catch(e){he(this,Tn,O0e).call(this,e.code)}}lstatSync(){if((I(this,ri)&hv)===0)try{return he(this,Tn,Z0e).call(this,I(this,o0).lstatSync(this.fullpath())),this}catch(e){he(this,Tn,O0e).call(this,e.code)}}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let a=n.slice(0,n.provisional);r?e(null,a):queueMicrotask(()=>e(null,a));return}if(I(this,Bw).push(e),I(this,Nw))return;de(this,Nw,!0);let i=this.fullpath();I(this,o0).readdir(i,{withFileTypes:!0},(a,s)=>{if(a)he(this,Tn,Zj).call(this,a.code),n.provisional=0;else{for(let o of s)he(this,Tn,Lj).call(this,o,n);he(this,Tn,kj).call(this,n)}he(this,Tn,uQe).call(this,n.slice(0,n.provisional))})}async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(I(this,e8))await I(this,e8);else{let n=()=>{};de(this,e8,new Promise(i=>n=i));try{for(let i of await I(this,o0).promises.readdir(r,{withFileTypes:!0}))he(this,Tn,Lj).call(this,i,e);he(this,Tn,kj).call(this,e)}catch(i){he(this,Tn,Zj).call(this,i.code),e.provisional=0}de(this,e8,void 0),n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let n of I(this,o0).readdirSync(r,{withFileTypes:!0}))he(this,Tn,Lj).call(this,n,e);he(this,Tn,kj).call(this,e)}catch(n){he(this,Tn,Zj).call(this,n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(I(this,ri)&XJe)return!1;let e=Eg&I(this,ri);return e===xg||e===wb||e===$3}shouldWalk(e,r){return(I(this,ri)&wb)===wb&&!(I(this,ri)&XJe)&&!e.has(this)&&(!r||r(this))}async realpath(){if(I(this,Rb))return I(this,Rb);if(!((Oj|Gj|hv)&I(this,ri)))try{let e=await I(this,o0).promises.realpath(this.fullpath());return de(this,Rb,this.resolve(e))}catch{he(this,Tn,F0e).call(this)}}realpathSync(){if(I(this,Rb))return I(this,Rb);if(!((Oj|Gj|hv)&I(this,ri)))try{let e=I(this,o0).realpathSync(this.fullpath());return de(this,Rb,this.resolve(e))}catch{he(this,Tn,F0e).call(this)}}[iQe](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],i=this;for(;i&&i.parent;)r.add(i),de(i,F4,n.join(this.sep)),de(i,O4,n.join("/")),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!r.has(i);)de(i,F4,void 0),de(i,O4,void 0),i=i.parent}};o0=new WeakMap,iO=new WeakMap,aO=new WeakMap,sO=new WeakMap,oO=new WeakMap,uO=new WeakMap,lO=new WeakMap,cO=new WeakMap,dO=new WeakMap,fO=new WeakMap,pO=new WeakMap,hO=new WeakMap,mO=new WeakMap,gO=new WeakMap,vO=new WeakMap,yO=new WeakMap,bO=new WeakMap,_O=new WeakMap,CO=new WeakMap,O5=new WeakMap,J3=new WeakMap,Ab=new WeakMap,G4=new WeakMap,F4=new WeakMap,O4=new WeakMap,ri=new WeakMap,Q3=new WeakMap,k4=new WeakMap,Rb=new WeakMap,Tn=new WeakSet,D0e=function(e){let r=this;for(let n of e)r=r.child(n);return r},kj=function(e){var r;de(this,ri,I(this,ri)|T0e);for(let n=e.provisional;n<e.length;n++){let i=e[n];i&&he(r=i,Tn,tO).call(r)}},tO=function(){I(this,ri)&hv||(de(this,ri,(I(this,ri)|hv)&$F),he(this,Tn,G0e).call(this))},G0e=function(){var r;let e=this.children();e.provisional=0;for(let n of e)he(r=n,Tn,tO).call(r)},F0e=function(){de(this,ri,I(this,ri)|Oj),he(this,Tn,rO).call(this)},rO=function(){if(I(this,ri)&QF)return;let e=I(this,ri);(e&Eg)===wb&&(e&=$F),de(this,ri,e|QF),he(this,Tn,G0e).call(this)},Zj=function(e=""){e==="ENOTDIR"||e==="EPERM"?he(this,Tn,rO).call(this):e==="ENOENT"?he(this,Tn,tO).call(this):this.children().provisional=0},O0e=function(e=""){var r;if(e==="ENOTDIR"){let n=this.parent;he(r=n,Tn,rO).call(r)}else e==="ENOENT"&&he(this,Tn,tO).call(this)},k0e=function(e=""){var n;let r=I(this,ri);r|=Gj,e==="ENOENT"&&(r|=hv),(e==="EINVAL"||e==="UNKNOWN")&&(r&=$F),de(this,ri,r),e==="ENOTDIR"&&this.parent&&he(n=this.parent,Tn,rO).call(n)},Lj=function(e,r){return he(this,Tn,sQe).call(this,e,r)||he(this,Tn,aQe).call(this,e,r)},aQe=function(e,r){let n=B0e(e),i=this.newChild(e.name,n,{parent:this}),a=I(i,ri)&Eg;return a!==wb&&a!==$3&&a!==xg&&de(i,ri,I(i,ri)|QF),r.unshift(i),r.provisional++,i},sQe=function(e,r){for(let n=r.provisional;n<r.length;n++){let i=r[n];if((this.nocase?Fj(e.name):eO(e.name))===I(i,O5))return he(this,Tn,oQe).call(this,e,i,n,r)}},oQe=function(e,r,n,i){let a=r.name;return de(r,ri,I(r,ri)&$F|B0e(e)),a!==e.name&&(r.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(r)),i.provisional++,r},Z0e=function(e){let{atime:r,atimeMs:n,birthtime:i,birthtimeMs:a,blksize:s,blocks:o,ctime:u,ctimeMs:l,dev:f,gid:h,ino:g,mode:_,mtime:w,mtimeMs:T,nlink:D,rdev:G,size:O,uid:Z}=e;de(this,yO,r),de(this,hO,n),de(this,CO,i),de(this,vO,a),de(this,cO,s),de(this,pO,o),de(this,_O,u),de(this,gO,l),de(this,iO,f),de(this,uO,h),de(this,dO,g),de(this,aO,_),de(this,bO,w),de(this,mO,T),de(this,sO,D),de(this,lO,G),de(this,fO,O),de(this,oO,Z);let X=B0e(e);de(this,ri,I(this,ri)&$F|X|jJe),X!==xg&&X!==wb&&X!==$3&&de(this,ri,I(this,ri)|QF)},Bw=new WeakMap,Nw=new WeakMap,uQe=function(e){de(this,Nw,!1);let r=I(this,Bw).slice();I(this,Bw).length=0,r.forEach(n=>n(null,e))},e8=new WeakMap;var Vj=class t extends Xf{sep="\\";splitSep=bfr;constructor(e,r=xg,n,i,a,s,o){super(e,r,n,i,a,s,o)}newChild(e,r=xg,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Fw.win32.parse(e).root}getRoot(e){if(e=yfr(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new Ow(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(JJe,"$1\\"),e===r}},Pj=class t extends Xf{splitSep="/";sep="/";constructor(e,r=xg,n,i,a,s,o){super(e,r,n,i,a,s,o)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=xg,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Dw,Gw,IO,SO,Hj=class{constructor(e=process.cwd(),r,n,{nocase:i,childrenCacheSize:a=16*1024,fs:s=JF}={}){Et(this,"root");Et(this,"rootPath");Et(this,"roots");Et(this,"cwd");Be(this,Dw);Be(this,Gw);Be(this,IO);Et(this,"nocase");Be(this,SO);de(this,SO,$Je(s)),(e instanceof URL||e.startsWith("file://"))&&(e=(0,KJe.fileURLToPath)(e));let o=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),de(this,Dw,new Wj),de(this,Gw,new Wj),de(this,IO,new N0e(a));let u=o.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(I(this,SO)),this.roots[this.rootPath]=this.root;let l=this.root,f=u.length-1,h=r.sep,g=this.rootPath,_=!1;for(let w of u){let T=f--;l=l.child(w,{relative:new Array(T).fill("..").join(h),relativePosix:new Array(T).fill("..").join("/"),fullpath:g+=(_?"":h)+w}),_=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return I(this,IO)}resolve(...e){let r="";for(let a=e.length-1;a>=0;a--){let s=e[a];if(!(!s||s===".")&&(r=r?`${s}/${r}`:s,this.isAbsolute(s)))break}let n=I(this,Dw).get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpath();return I(this,Dw).set(r,i),i}resolvePosix(...e){let r="";for(let a=e.length-1;a>=0;a--){let s=e[a];if(!(!s||s===".")&&(r=r?`${s}/${r}`:s,this.isAbsolute(s)))break}let n=I(this,Gw).get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpathPosix();return I(this,Gw).set(r,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(a=>a.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n==null?void 0:n.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n==null?void 0:n.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n==null?void 0:n.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n==null?void 0:n.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:a,walkFilter:s}=r,o=[];(!a||a(e))&&o.push(n?e:e.fullpath());let u=new Set,l=(h,g)=>{u.add(h),h.readdirCB((_,w)=>{if(_)return g(_);let T=w.length;if(!T)return g();let D=()=>{--T===0&&g()};for(let G of w)(!a||a(G))&&o.push(n?G:G.fullpath()),i&&G.isSymbolicLink()?G.realpath().then(O=>O!=null&&O.isUnknown()?O.lstat():O).then(O=>O!=null&&O.shouldWalk(u,s)?l(O,D):D()):G.shouldWalk(u,s)?l(G,D):D()},!0)},f=e;return new Promise((h,g)=>{l(f,_=>{if(_)return g(_);h(o)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:a,walkFilter:s}=r,o=[];(!a||a(e))&&o.push(n?e:e.fullpath());let u=new Set([e]);for(let l of u){let f=l.readdirSync();for(let h of f){(!a||a(h))&&o.push(n?h:h.fullpath());let g=h;if(h.isSymbolicLink()){if(!(i&&(g=h.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(u,s)&&u.add(g)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:a,walkFilter:s}=r;(!a||a(e))&&(yield n?e:e.fullpath());let o=new Set([e]);for(let u of o){let l=u.readdirSync();for(let f of l){(!a||a(f))&&(yield n?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(i&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(o,s)&&o.add(h)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:a,walkFilter:s}=r,o=new F5({objectMode:!0});(!a||a(e))&&o.write(n?e:e.fullpath());let u=new Set,l=[e],f=0,h=()=>{let g=!1;for(;!g;){let _=l.shift();if(!_){f===0&&o.end();return}f++,u.add(_);let w=(D,G,O=!1)=>{if(D)return o.emit("error",D);if(i&&!O){let Z=[];for(let X of G)X.isSymbolicLink()&&Z.push(X.realpath().then(ue=>ue!=null&&ue.isUnknown()?ue.lstat():ue));if(Z.length){Promise.all(Z).then(()=>w(null,G,!0));return}}for(let Z of G)Z&&(!a||a(Z))&&(o.write(n?Z:Z.fullpath())||(g=!0));f--;for(let Z of G){let X=Z.realpathCached()||Z;X.shouldWalk(u,s)&&l.push(X)}g&&!o.flowing?o.once("drain",h):T||h()},T=!0;_.readdirCB(w,!0),T=!1}};return h(),o}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Xf||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:a,walkFilter:s}=r,o=new F5({objectMode:!0}),u=new Set;(!a||a(e))&&o.write(n?e:e.fullpath());let l=[e],f=0,h=()=>{let g=!1;for(;!g;){let _=l.shift();if(!_){f===0&&o.end();return}f++,u.add(_);let w=_.readdirSync();for(let T of w)(!a||a(T))&&(o.write(n?T:T.fullpath())||(g=!0));f--;for(let T of w){let D=T;if(T.isSymbolicLink()){if(!(i&&(D=T.realpathSync())))continue;D.isUnknown()&&D.lstatSync()}D.shouldWalk(u,s)&&l.push(D)}}g&&!o.flowing&&o.once("drain",h)};return h(),o}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[iQe](r)}};Dw=new WeakMap,Gw=new WeakMap,IO=new WeakMap,SO=new WeakMap;var Ow=class extends Hj{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,Fw.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Fw.win32.parse(e).root.toUpperCase()}newRoot(e){return new Vj(this.rootPath,wb,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},kw=class extends Hj{sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,Fw.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Pj(this.rootPath,wb,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},nO=class extends kw{constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},Kxr=process.platform==="win32"?Vj:Pj,lQe=process.platform==="win32"?Ow:process.platform==="darwin"?nO:kw;var Cfr=t=>t.length>=1,Ifr=t=>t.length>=1,ac,W1,pd,t8,mv,EO,Z5,L5,W5,Zw,L0e=class L0e{constructor(e,r,n,i){Be(this,ac);Be(this,W1);Be(this,pd);Et(this,"length");Be(this,t8);Be(this,mv);Be(this,EO);Be(this,Z5);Be(this,L5);Be(this,W5);Be(this,Zw,!0);if(!Cfr(e))throw new TypeError("empty pattern list");if(!Ifr(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(de(this,ac,e),de(this,W1,r),de(this,pd,n),de(this,t8,i),I(this,pd)===0){if(this.isUNC()){let[a,s,o,u,...l]=I(this,ac),[f,h,g,_,...w]=I(this,W1);l[0]===""&&(l.shift(),w.shift());let T=[a,s,o,u,""].join("/"),D=[f,h,g,_,""].join("/");de(this,ac,[T,...l]),de(this,W1,[D,...w]),this.length=I(this,ac).length}else if(this.isDrive()||this.isAbsolute()){let[a,...s]=I(this,ac),[o,...u]=I(this,W1);s[0]===""&&(s.shift(),u.shift());let l=a+"/",f=o+"/";de(this,ac,[l,...s]),de(this,W1,[f,...u]),this.length=I(this,ac).length}}}pattern(){return I(this,ac)[I(this,pd)]}isString(){return typeof I(this,ac)[I(this,pd)]=="string"}isGlobstar(){return I(this,ac)[I(this,pd)]===Ku}isRegExp(){return I(this,ac)[I(this,pd)]instanceof RegExp}globString(){return de(this,EO,I(this,EO)||(I(this,pd)===0?this.isAbsolute()?I(this,W1)[0]+I(this,W1).slice(1).join("/"):I(this,W1).join("/"):I(this,W1).slice(I(this,pd)).join("/")))}hasMore(){return this.length>I(this,pd)+1}rest(){return I(this,mv)!==void 0?I(this,mv):this.hasMore()?(de(this,mv,new L0e(I(this,ac),I(this,W1),I(this,pd)+1,I(this,t8))),de(I(this,mv),W5,I(this,W5)),de(I(this,mv),L5,I(this,L5)),de(I(this,mv),Z5,I(this,Z5)),I(this,mv)):de(this,mv,null)}isUNC(){let e=I(this,ac);return I(this,L5)!==void 0?I(this,L5):de(this,L5,I(this,t8)==="win32"&&I(this,pd)===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3])}isDrive(){let e=I(this,ac);return I(this,Z5)!==void 0?I(this,Z5):de(this,Z5,I(this,t8)==="win32"&&I(this,pd)===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]))}isAbsolute(){let e=I(this,ac);return I(this,W5)!==void 0?I(this,W5):de(this,W5,e[0]===""&&e.length>1||this.isDrive()||this.isUNC())}root(){let e=I(this,ac)[0];return typeof e=="string"&&this.isAbsolute()&&I(this,pd)===0?e:""}checkFollowGlobstar(){return!(I(this,pd)===0||!this.isGlobstar()||!I(this,Zw))}markFollowGlobstar(){return I(this,pd)===0||!this.isGlobstar()||!I(this,Zw)?!1:(de(this,Zw,!1),!0)}};ac=new WeakMap,W1=new WeakMap,pd=new WeakMap,t8=new WeakMap,mv=new WeakMap,EO=new WeakMap,Z5=new WeakMap,L5=new WeakMap,W5=new WeakMap,Zw=new WeakMap;var Lw=L0e;var Sfr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ww=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:i,noglobstar:a,platform:s=Sfr}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=s,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:i,noglobstar:a,optimizationLevel:2,platform:s,nocomment:!0,nonegate:!0};for(let o of e)this.add(o)}add(e){let r=new G1(e,this.mmopts);for(let n=0;n<r.set.length;n++){let i=r.set[n],a=r.globParts[n];if(!i||!a)throw new Error("invalid pattern object");for(;i[0]==="."&&a[0]===".";)i.shift(),a.shift();let s=new Lw(i,a,0,this.platform),o=new G1(s.globString(),this.mmopts),u=a[a.length-1]==="**",l=s.isAbsolute();l?this.absolute.push(o):this.relative.push(o),u&&(l?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(e){let r=e.fullpath(),n=`${r}/`,i=e.relative()||".",a=`${i}/`;for(let s of this.relative)if(s.match(i)||s.match(a))return!0;for(let s of this.absolute)if(s.match(r)||s.match(n))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(r))return!0;return!1}};var W0e=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){var n;return(n=this.store.get(e.fullpath()))==null?void 0:n.has(r.globString())}storeWalked(e,r){let n=e.fullpath(),i=this.store.get(n);i?i.add(r.globString()):this.store.set(n,new Set([r.globString()]))}},V0e=class{store=new Map;add(e,r,n){let i=(r?2:0)|(n?1:0),a=this.store.get(e);this.store.set(e,a===void 0?i:i&a)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},P0e=class{store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},xO=class t{hasWalkedCache;matches=new V0e;subwalks=new P0e;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new W0e}processPatterns(e,r){this.patterns=r;let n=r.map(i=>[e,i]);for(let[i,a]of n){this.hasWalkedCache.storeWalked(i,a);let s=a.root(),o=a.isAbsolute()&&this.opts.absolute!==!1;if(s){i=i.resolve(s==="/"&&this.opts.root!==void 0?this.opts.root:s);let h=a.rest();if(h)a=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,l,f=!1;for(;typeof(u=a.pattern())=="string"&&(l=a.rest());)i=i.resolve(u),a=l,f=!0;if(u=a.pattern(),l=a.rest(),f){if(this.hasWalkedCache.hasWalked(i,a))continue;this.hasWalkedCache.storeWalked(i,a)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(i.resolve(u),o,h);continue}else if(u===Ku){(!i.isSymbolicLink()||this.follow||a.checkFollowGlobstar())&&this.subwalks.add(i,a);let h=l==null?void 0:l.pattern(),g=l==null?void 0:l.rest();if(!l||(h===""||h===".")&&!g)this.matches.add(i,o,h===""||h===".");else if(h===".."){let _=i.parent||i;g?this.hasWalkedCache.hasWalked(_,g)||this.subwalks.add(_,g):this.matches.add(_,o,!0)}}else u instanceof RegExp&&this.subwalks.add(i,a)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),i=this.child();for(let a of r)for(let s of n){let o=s.isAbsolute(),u=s.pattern(),l=s.rest();u===Ku?i.testGlobstar(a,s,l,o):u instanceof RegExp?i.testRegExp(a,u,l,o):i.testString(a,u,l,o)}return i}testGlobstar(e,r,n,i){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let a=n.pattern();if(typeof a=="string"&&a!==".."&&a!==""&&a!==".")this.testString(e,a,n.rest(),i);else if(a===".."){let s=e.parent||e;this.subwalks.add(s,n)}else a instanceof RegExp&&this.testRegExp(e,a,n.rest(),i)}}testRegExp(e,r,n,i){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,r,n,i){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}};var Efr=(t,e)=>typeof t=="string"?new Ww([t],e):Array.isArray(t)?new Ww(t,e):t,Vw,Z4,n8,wg,r8,H0e,Mj=class{constructor(e,r,n){Be(this,wg);Et(this,"path");Et(this,"patterns");Et(this,"opts");Et(this,"seen",new Set);Et(this,"paused",!1);Et(this,"aborted",!1);Be(this,Vw,[]);Be(this,Z4);Be(this,n8);Et(this,"signal");Et(this,"maxDepth");Et(this,"includeChildMatches");if(this.patterns=e,this.path=r,this.opts=n,de(this,n8,!n.posix&&n.platform==="win32"?"\\":"/"),this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(de(this,Z4,Efr(n.ignore??[],n)),!this.includeChildMatches&&typeof I(this,Z4).add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{I(this,Vw).length=0}))}pause(){this.paused=!0}resume(){var r;if((r=this.signal)!=null&&r.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=I(this,Vw).shift());)e()}onResume(e){var r;(r=this.signal)!=null&&r.aborted||(this.paused?I(this,Vw).push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let a=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&(a!=null&&a.isSymbolicLink())){let s=await a.realpath();s&&(s.isUnknown()||this.opts.stat)&&await s.lstat()}return this.matchCheckTest(a,r)}matchCheckTest(e,r){var n;return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!((n=e.realpathCached())!=null&&n.isDirectory()))&&!he(this,wg,r8).call(this,e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let a=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&(a!=null&&a.isSymbolicLink())){let s=a.realpathSync();s&&(s!=null&&s.isUnknown()||this.opts.stat)&&s.lstatSync()}return this.matchCheckTest(a,r)}matchFinish(e,r){var a;if(he(this,wg,r8).call(this,e))return;if(!this.includeChildMatches&&((a=I(this,Z4))!=null&&a.add)){let s=`${e.relativePosix()}/**`;I(this,Z4).add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?I(this,n8):"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+I(this,n8))?"."+I(this,n8):"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,r,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,r)}matchSync(e,r,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,r)}walkCB(e,r,n){var i;(i=this.signal)!=null&&i.aborted&&n(),this.walkCB2(e,r,new xO(this.opts),n)}walkCB2(e,r,n,i){var o;if(he(this,wg,H0e).call(this,e))return i();if((o=this.signal)!=null&&o.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,i));return}n.processPatterns(e,r);let a=1,s=()=>{--a===0&&i()};for(let[u,l,f]of n.matches.entries())he(this,wg,r8).call(this,u)||(a++,this.match(u,l,f).then(()=>s()));for(let u of n.subwalkTargets()){if(this.maxDepth!==1/0&&u.depth()>=this.maxDepth)continue;a++;let l=u.readdirCached();u.calledReaddir()?this.walkCB3(u,l,n,s):u.readdirCB((f,h)=>this.walkCB3(u,h,n,s),!0)}s()}walkCB3(e,r,n,i){n=n.filterEntries(e,r);let a=1,s=()=>{--a===0&&i()};for(let[o,u,l]of n.matches.entries())he(this,wg,r8).call(this,o)||(a++,this.match(o,u,l).then(()=>s()));for(let[o,u]of n.subwalks.entries())a++,this.walkCB2(o,u,n.child(),s);s()}walkCBSync(e,r,n){var i;(i=this.signal)!=null&&i.aborted&&n(),this.walkCB2Sync(e,r,new xO(this.opts),n)}walkCB2Sync(e,r,n,i){var o;if(he(this,wg,H0e).call(this,e))return i();if((o=this.signal)!=null&&o.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,i));return}n.processPatterns(e,r);let a=1,s=()=>{--a===0&&i()};for(let[u,l,f]of n.matches.entries())he(this,wg,r8).call(this,u)||this.matchSync(u,l,f);for(let u of n.subwalkTargets()){if(this.maxDepth!==1/0&&u.depth()>=this.maxDepth)continue;a++;let l=u.readdirSync();this.walkCB3Sync(u,l,n,s)}s()}walkCB3Sync(e,r,n,i){n=n.filterEntries(e,r);let a=1,s=()=>{--a===0&&i()};for(let[o,u,l]of n.matches.entries())he(this,wg,r8).call(this,o)||this.matchSync(o,u,l);for(let[o,u]of n.subwalks.entries())a++,this.walkCB2Sync(o,u,n.child(),s);s()}};Vw=new WeakMap,Z4=new WeakMap,n8=new WeakMap,wg=new WeakSet,r8=function(e){var r,n;return this.seen.has(e)||!!((n=(r=I(this,Z4))==null?void 0:r.ignored)!=null&&n.call(r,e))},H0e=function(e){var r,n;return!!((n=(r=I(this,Z4))==null?void 0:r.childrenIgnored)!=null&&n.call(r,e))};var wO=class extends Mj{matches=new Set;constructor(e,r,n){super(e,r,n)}matchEmit(e){this.matches.add(e)}async walk(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((r,n)=>{this.walkCB(this.path,this.patterns,()=>{var i;(i=this.signal)!=null&&i.aborted?n(this.signal.reason):r(this.matches)})}),this.matches}walkSync(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var r;if((r=this.signal)!=null&&r.aborted)throw this.signal.reason}),this.matches}},AO=class extends Mj{results;constructor(e,r,n){super(e,r,n),this.results=new F5({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var xfr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",gv=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,cQe.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=r.platform||xfr,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=r.platform==="win32"?Ow:r.platform==="darwin"?nO:r.platform?kw:lQe;this.scurry=new u(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},a=this.pattern.map(u=>new G1(u,i)),[s,o]=a.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=s.map((u,l)=>{let f=o[l];if(!f)throw new Error("invalid pattern object");return new Lw(u,f,0,this.platform)})}async walk(){return[...await new wO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new wO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new AO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new AO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var M0e=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new G1(r,e).hasMagic())return!0;return!1};function Uj(t,e={}){return new gv(t,e).streamSync()}function pQe(t,e={}){return new gv(t,e).stream()}function hQe(t,e={}){return new gv(t,e).walkSync()}async function dQe(t,e={}){return new gv(t,e).walk()}function Yj(t,e={}){return new gv(t,e).iterateSync()}function mQe(t,e={}){return new gv(t,e).iterate()}var wfr=Uj,Afr=Object.assign(pQe,{sync:Uj}),Rfr=Yj,Tfr=Object.assign(mQe,{sync:Yj}),U0e=Object.assign(hQe,{stream:Uj,iterate:Yj}),fQe=Object.assign(dQe,{glob:dQe,globSync:hQe,sync:U0e,globStream:pQe,stream:Afr,globStreamSync:Uj,streamSync:wfr,globIterate:mQe,iterate:Tfr,globIterateSync:Yj,iterateSync:Rfr,Glob:gv,hasMagic:M0e,escape:Cw,unescape:iv});fQe.glob=fQe;var Nfr=["terraform.tfvars","terraform.tfvars.json"],Dfr=[".auto.tfvars",".auto.tfvars.json"];function Xj(t,e=process.cwd()){let r=[];return Nfr.forEach(n=>{let i=jj.resolve(e,n);RO.existsSync(i)&&r.push(i)}),Dfr.forEach(n=>{U0e(`*${n}`,{cwd:e}).forEach(a=>{r.push(jj.resolve(e,a))})}),t.forEach(n=>{let i=jj.resolve(e,n);if(!RO.existsSync(i))throw Y0e.Errors.Usage(`Could not find var-file ${n} at ${i}`);if(!RO.lstatSync(i).isFile())throw Y0e.Errors.Usage(`The var-file ${n} at ${i} is no file.`);r.push(i)}),r}var fet=vt(Ln()),pet=vt(TQe()),het=vt(det());async function Ipr(t=process.pid){let e=await(0,pet.default)(t,{root:!0}),r=await(0,het.default)(e);return Object.values(r).reduce((n,i)=>i&&"memory"in i?n+i.memory:n,0)}function rhe(){let t=Date.now(),e=[],r=setInterval(async()=>{let n=await Ipr();e.push(n/1024/1024/1024)},1e3);return()=>{let n=(Date.now()-t)/1e3;clearInterval(r);let i=e.reduce((s,o)=>s+o,0)/e.length,a=Math.max(...e);fet.logger.info(`Command took ${n.toFixed(2)}s with ${i.toFixed(2)}Gb of memory on average and ${a.toFixed(2)}Gb of memory at peak`)}}var Kj=vt(require("path")),yet=vt(require("os"));var bet=vt(S_());var DO=new get.default.Instance,met=(0,bi.readConfigSync)();async function Spr(t){let e=[];try{e=Xa.CdktfConfig.read().terraformProviders}catch(r){if(!(0,bi.IsErrorType)(r,"External"))throw r}return[...t,...e]}async function Epr({language:t,provider:e,stack:r,experimentalProviderSchemaCachePath:n}){await(0,Xa.initializErrorReporting)(),await bg();let i=PKe(),a=await Spr(e),{providerSchema:s}=await(0,bet.readSchema)(a.map(h=>bi.ConstructsMakerProviderTarget.from(new Hw.TerraformProviderConstraint(h),bi.LANGUAGES[0])),n),o;try{o=await Tpe(process.stdin)}catch{bi.logger.debug("No TTY stream passed to convert, using interactive input");try{o=await Nse({message:"Enter your Terrafrom code to convert to cdktn (or run the command again and pass it as stdin):",postfix:".tf",waitForUseInput:!0})}catch{throw bi.Errors.Usage("No Terraform code to convert was provided. Please provide Terraform code to convert as stdin or run the command again and let the CLI open the editor.")}}let u=t!=="typescript",l=process.cwd();if(u){let h=await $j.mkdtemp(Kj.default.join(yet.default.tmpdir(),"cdktf-convert-"));process.chdir(h);let g=HKe(),_=Kj.default.resolve(g,"../../dist");bi.logger.setLevel("ERROR"),await _et({template:"typescript",providers:e||[],projectName:Kj.default.basename(h),projectDescription:"Temporary project for conversion",local:!0,enableCrashReporting:!1,fromTerraformProject:"no",dist:i.version==="0.0.0"?_:void 0,cdktfVersion:i.version,silent:!0,nonInteractive:!0}),bi.logger.useDefaultLevel()}let f;try{let{all:h,stats:g}=await(0,vet.convert)(o,{language:t,providerSchema:s??{},codeContainer:r?"cdktn.TerraformStack":"constructs.Construct"});f=h,await(0,bi.sendTelemetry)("convert",{...g,error:!1})}catch(h){throw bi.Errors.Internal(h.message,h,{language:t})}u&&process.chdir(l),console.log(f)}async function xpr(t){await(0,Xa.initializErrorReporting)(z2),R4(),await bg(),await g4();let e=t.app,r=t.output,n=t.autoApprove,i=t.stacks,a=t.outputsFileIncludeSensitiveOutputs,s=t.refreshOnly,o=t.terraformParallelism,u=t.ignoreMissingStackDependencies||!1,l=t.parallelism,f=t.var,h=Xj(t.varFile),g=t.noColor,_=t.migrateState,w=t.skipSynth,T=t.skipProviderLock,D,G=()=>{};t.outputsFile&&(D=(0,Xa.normalizeOutputPath)(t.outputsFile),G=O=>(0,Xa.saveOutputs)(D,O,a)),await gb(Db.default.createElement(V$e,{outDir:r,targetStacks:i,synthCommand:e,autoApprove:n,onOutputsRetrieved:G,outputsPath:D,ignoreMissingStackDependencies:u,parallelism:l,refreshOnly:s,terraformParallelism:o,vars:f,varFiles:h,noColor:g,migrateState:_,skipSynth:w,skipProviderLock:T}))}async function wpr(t){await(0,Xa.initializErrorReporting)(z2),R4(),await bg(),await g4();let e=t.app,r=t.output,n=t.autoApprove,i=t.stacks,a=t.ignoreMissingStackDependencies||!1,s=t.parallelism,o=t.terraformParallelism,u=t.var,l=Xj(t.varFile),f=t.noColor,h=t.migrateState,g=t.skipSynth,_=t.skipProviderLock;await gb(Db.default.createElement(P$e,{outDir:r,targetStacks:i,synthCommand:e,autoApprove:n,ignoreMissingStackDependencies:a,parallelism:s,terraformParallelism:o,vars:u,varFiles:l,noColor:f,migrateState:h,skipSynth:g,skipProviderLock:_}))}async function Apr(t){await(0,Xa.initializErrorReporting)(z2),R4(),await bg(),await g4();let e=t.app,r=t.output,n=t.stack,i=t.refreshOnly,a=t.terraformParallelism,s=t.var,o=Xj(t.varFile),u=t.noColor,l=t.migrateState,f=t.skipSynth,h=t.skipProviderLock;await gb(Db.default.createElement(L$e,{outDir:r,refreshOnly:i,targetStack:n,synthCommand:e,terraformParallelism:a,vars:s,varFiles:o,noColor:u,migrateState:l,skipSynth:f,skipProviderLock:h}))}async function nhe(t){let e=t.showPerformanceInfo?rhe():()=>{};try{R4(),await bg(),await(0,Xa.initializErrorReporting)(z2),await g4(),await oXe();let r=(0,bi.readConfigSync)(),n=r.terraformProviders??[],i=r.terraformModules??[],{output:a,language:s,parallelism:o,force:u}=t,l=[...n.map(f=>new Hw.TerraformProviderConstraint(f)),...i.map(f=>new Hw.TerraformModuleConstraint(f))];if(l.length===0){bi.logger.warn('WARNING: No providers or modules found in "cdktf.json" config file, therefore cdktn get does nothing.');return}await gb(Db.default.createElement(M$e,{codeMakerOutput:a,language:s,constraints:l,parallelism:o,force:u,silent:t.silent,providerSchemaCachePath:t.experimentalProviderSchemaCachePath,languageOptions:r.languageOptions}))}finally{t.silent||e()}}async function _et(t){if(await ZG(),await bg(),await g4(),["",".",process.cwd()].includes(t.fromTerraformProject))throw bi.Errors.Usage("--from-terraform-project requires a path to an existing Terraform project to be set, e.g. --from-terraform-project=../my-tf-codebase This folder can not be the same as the current working directory since cdktn init will initialize the new project in that folder.");CXe(".");let{needsGet:e,codeMakerOutput:r,language:n}=await IXe(t);e&&(t.silent||console.log("Local providers have been updated. Running cdktn get to update..."),await nhe({language:n,output:r,parallelism:1,silent:t.silent})),n===bi.Language.GO&&console.log("Run 'go mod tidy' after adding imports for any needed modules such as prebuilt providers")}async function Rpr(t){await(0,Xa.initializErrorReporting)(z2),R4(),await bg(),await g4();let e=t.app,r=t.output;await gb(Db.default.createElement(U$e,{outDir:r,synthCommand:e}))}async function Tpr(t){await ZG(),await bg();async function e(i){let a=await QH(t.tfeHostname,i);if(a){let s=a.data.attributes.username;console.log(DO`\n{greenBright cdktn has successfully configured Terraform Cloud credentials!}`),console.log(DO`\nWelcome {bold ${s}}!`)}else throw bi.Errors.Usage("Configured Terraform Cloud token is invalid.")}let r=new ax(t.tfeHostname),n="";try{n=await Tpe(process.stdin),n=n.replace(/\n/g,"")}catch{bi.logger.debug("No TTY stream passed to login")}if(!n&&(n=await r.askToLogin(!1),n===""))throw bi.Errors.Usage("No Terraform Cloud token was provided.");await r.saveTerraformCredentials(n),await e(n)}async function Bpr(t){let e=t.showPerformanceInfo?rhe():()=>{};try{await(0,Xa.initializErrorReporting)(z2),R4(),await bg(),await g4();let r=t.checkCodeMakerOutput,n=t.app,i=t.output,a=t.hcl;r&&!await $j.pathExists(met.codeMakerOutput)&&(console.error(`ERROR: synthesis failed, run "cdktn get" to generate providers in ${met.codeMakerOutput}`),process.exit(1)),await gb(Db.default.createElement(j$e,{outDir:i,synthCommand:n,hcl:a}))}finally{e()}}async function Npr(t){await(0,Xa.initializErrorReporting)(z2),R4(),await bg();let e=t.app,r=t.output,n=t.autoApprove,i=t.stacks,a=t.terraformParallelism,s=t.parallelism;n||(console.error(DO`{redBright ERROR: The watch command always automatically deploys and approves changes. To make this behaviour explicit the --auto-approve flag must be set}`),process.exit(1)),await gb(Db.default.createElement(q$e,{targetDir:r,targetStacks:i,synthCommand:e,autoApprove:n,terraformParallelism:a,parallelism:s}))}async function Dpr(t){await(0,Xa.initializErrorReporting)(z2),R4(),await bg(),await g4();let e=t.app,r=t.output,n=t.stacks,i=t.outputsFileIncludeSensitiveOutputs,a=t.skipSynth,s=t.skipProviderLock,o,u=()=>{};t.outputsFile&&(o=(0,Xa.normalizeOutputPath)(t.outputsFile),u=l=>(0,Xa.saveOutputs)(o,l,i)),await gb(Db.default.createElement(uJe,{outDir:r,targetStacks:n,synthCommand:e,onOutputsRetrieved:u,outputsPath:o,skipSynth:a,skipProviderLock:s}))}async function Gpr(t){let e=Xa.CdktfConfig.read(),r=e.language,n=await(0,bi.getPackageVersion)(r,"cdktn"),i=await(0,bi.getPackageVersion)(r,"cdktf");if(!n&&!i)throw bi.Errors.External("Could not determine cdktf/cdktn version. Please make sure you are in a directory containing a cdktn project and have all dependencies installed.");let s=await new Xa.DependencyManager(r,i??n,e.projectDirectory).allProviders(),o=await(0,bi.collectDebugInformation)();if(t.json)console.log(JSON.stringify({...o,providers:{local:s.local.map(u=>({provider:`${u.providerName}@${u.providerConstraint}`,terraformProviderVersion:u.providerVersion})),prebuilt:s.prebuilt.map(u=>({provider:u.packageName,terraformProviderVersion:u.providerVersion,prebuiltProviderVersion:u.packageVersion,cdktfVersion:u.cdktfVersion,cdktnVersion:u.cdktnVersion}))}},null,2));else{console.log(DO`{bold {greenBright cdktn debug}}`),Object.entries(o).forEach(([u,l])=>{console.log(`${u}: ${l===null?"null":l}`)}),console.log(DO`{bold {yellowBright providers}}`);for(let u of s.local)console.log(`${u.providerName}@${u.providerConstraint} (LOCAL)