twenty-sdk 2.19.0-alpha.1 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{catalog-sync-wgNckz1h.mjs → catalog-sync-COKCJ_xf.mjs} +1 -1
- package/dist/{catalog-sync-CzxQqSTp.js → catalog-sync-DHopgolZ.js} +1 -1
- package/dist/cli.cjs +3 -3
- package/dist/cli.mjs +4 -4
- package/dist/define/index.cjs +2 -2
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +0 -71
- package/dist/define/index.mjs +12 -34
- package/dist/define/index.mjs.map +1 -1
- package/dist/front-component/index.cjs.map +1 -1
- package/dist/front-component/index.mjs +1 -1
- package/dist/front-component/index.mjs.map +1 -1
- package/dist/{get-function-input-schema-GNk3NRLJ-VtCYmX8G.mjs → get-function-input-schema-GNk3NRLJ-BoFRwEYV.mjs} +1 -1
- package/dist/{login-D0JZTucw.mjs → login-Dasbw3em.mjs} +14 -36
- package/dist/{login-BJysdHYg.js → login-eEfUoaiV.js} +3 -3
- package/dist/operations.cjs +1 -1
- package/dist/operations.mjs +1 -1
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./get-front-component-build-plugins-Dqpyup2W.js"),t=require("./login-BJysdHYg.js"),n=require("./isDefined-Dtu5EYqP-Dp026Ry1.js");let r=require("path");r=e.i(r);let i=require("node:fs/promises"),a=require("uuid"),o=require("react");o=e.i(o);let s=require("node:path");s=e.i(s);let c=require("crypto");c=e.i(c);let l=require("node:child_process"),u=require("chalk");u=e.i(u);let d=require("inquirer");d=e.i(d);let f=require("chokidar");f=e.i(f);let p=require("react/jsx-runtime"),m=require("commander"),h=require("util");var g=e=>e&&!e?.startsWith(`/`)?(0,r.join)(t.Et,e):e,_=(e,t)=>t!==void 0&&t.length>0?`${t}${e}`:e,v=e=>e.replace(/\s+/g,` `).trim(),y=async e=>{let n=(0,r.join)(e,`package.json`);if(await t.lt(n))try{let e=await(0,i.readFile)(n,`utf-8`),t=JSON.parse(e);return t.dependencies?.[`twenty-sdk`]??t.devDependencies?.[`twenty-sdk`]??void 0}catch{return}},b=e=>{let t=e.match(/(\d+)\./);if(t)return parseInt(t[1],10);let n=e.match(/^[~^>=<]*(\d+)$/);return n?parseInt(n[1],10):null},x=async e=>{let n=t.I.version,r=await y(e);if(!n||!r)return;let i=b(n),a=b(r);i===null||a===null||i!==a&&(console.warn(u.default.yellow(`⚠ Version mismatch: your app requires twenty-sdk@${a}.x but the CLI running is v${n}. Major version mismatches may cause unexpected behavior.\n Update with: npm install -g twenty-sdk@${a}`)),console.warn(``))},S=class{async execute(e){e.private?await this.executePrivate(e):await this.executeNpm(e)}async executeNpm(e){let n=e.appPath??t.Et;await x(n),console.log(u.default.blue(`Publishing to npm...`)),console.log(u.default.gray(`App path: ${n}\n`));let r=await t.L({appPath:n,npmTag:e.tag,onProgress:e=>console.log(u.default.gray(e))});r.success||(console.error(u.default.red(r.error.message)),process.exit(1)),console.log(u.default.green(`✓ Published to npm successfully`))}async executePrivate(e){let n=e.appPath??t.Et;await x(n);let i=e.remote??t.U.getActiveRemote();console.log(u.default.blue(`Deploying application on ${i}...`)),console.log(u.default.gray(`App path: ${n}\n`));let a=e=>console.log(u.default.gray(e)),o=await t.G({appPath:n,tarball:!0,onProgress:a});o.success||(console.error(u.default.red(o.error.message)),process.exit(1));let s=await t.R({tarballPath:o.data.tarballPath,remote:e.remote,onProgress:a});s.success||(console.error(u.default.red(s.error.message)),process.exit(1));let c=await t.ut(r.default.join(n,`package.json`)).catch(()=>void 0),l=c?.name??s.data.name,d=c?.version??`unknown`;console.log(u.default.green(`\n✓ Published ${l} v${d} to ${i}\n`)),console.log(" To install deployed application: `yarn twenty app:install`")}},C=class{async execute(e){let n=e.appPath??t.Et;await x(n),await t.y();let r=e.remote??t.U.getActiveRemote();console.log(u.default.blue(`Installing application on ${r}...`)),console.log(u.default.gray(`App path: ${n}\n`));let i=await t.N({appPath:n,remote:e.remote});i.success||(console.error(u.default.red(i.error.message)),process.exit(1)),console.log(u.default.green(`✓ Application installed`))}},w=class{async execute({appPath:e=t.Et,askForConfirmation:n}){let r=t.U.getActiveRemote();console.log(u.default.blue(`🚀 Uninstall Twenty Application on ${r}`)),console.log(u.default.gray(`📁 App Path: ${e}\n`)),n&&!await this.confirmationPrompt()&&(console.error(u.default.red(`⛔️ Aborting uninstall`)),process.exit(1));let i=await t.v({appPath:e});return i.success?(console.log(u.default.green(`✅ Application uninstalled successfully`)),{success:!0,data:void 0}):(console.error(u.default.red(`❌ Uninstall failed:`),i.error.message),{success:!1,error:i.error.message})}async confirmationPrompt(){let{confirmation:e}=await d.default.prompt([{type:`confirm`,name:`confirmation`,message:`Are you sure you want to uninstall this application?`,default:!1}]);return e}},T=e=>{let t=new S,n=new C,r=new w;e.command(`app:publish [appPath]`).description(`Build and publish to npm (default) or server registry`).option(`--private`,`Push to a Twenty server's registry instead of npm`).option(`-r, --remote <name>`,`Publish to a specific remote (with --private)`).option(`--tag <tag>`,`npm dist-tag (e.g. beta, next)`).action(async(e,n)=>{await t.execute({appPath:g(e),private:n.private,remote:n.remote,tag:n.tag})}),e.command(`app:install [appPath]`).description(`Install a deployed app on the server`).option(`-r, --remote <name>`,`Install on a specific remote`).action(async(e,t)=>{await n.execute({appPath:g(e),remote:t.remote})}),e.command(`app:uninstall [appPath]`).description(`Uninstall app from server`).option(`-y, --yes`,`Skip confirmation prompt`).action(async(e,t)=>{try{let n=await r.execute({appPath:g(e),askForConfirmation:!t?.yes});process.exit(+!n.success)}catch{process.exit(1)}})},E=[`src/application.config.ts`,`src/application-config.ts`,`src/applicationConfig.ts`],D=async e=>{for(let n of E){let i=(0,r.join)(e,n);if(await t.lt(i))return i}return null},O=async e=>{let n=await D(e);if(n===null)throw Error(`Could not find the application config file (expected one of: ${E.join(`, `)}). Create it with defineApplication({ universalIdentifier: ... }) before generating entities.`);let{config:r}=await t.et({appPath:e,filePath:n});if(!r?.universalIdentifier)throw Error(`defineApplication in ${n} must declare a universalIdentifier before generating entities.`);return r.universalIdentifier},ee=e.n(((e,t)=>{(function(){var n,r=`4.18.1`,i=200,a=`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`,o=`Expected a function`,s="Invalid `variable` option passed into `_.template`",c="Invalid `imports` option passed into `_.template`",l=`__lodash_hash_undefined__`,u=500,d=`__lodash_placeholder__`,f=1,p=2,m=4,h=1,g=2,_=1,v=2,y=4,b=8,x=16,S=32,C=64,w=128,T=256,E=512,D=30,O=`...`,ee=800,k=16,te=1,ne=2,re=3,A=1/0,j=9007199254740991,M=17976931348623157e292,N=NaN,P=4294967295,F=P-1,ie=P>>>1,ae=[[`ary`,w],[`bind`,_],[`bindKey`,v],[`curry`,b],[`curryRight`,x],[`flip`,E],[`partial`,S],[`partialRight`,C],[`rearg`,T]],oe=`[object Arguments]`,se=`[object Array]`,ce=`[object AsyncFunction]`,le=`[object Boolean]`,I=`[object Date]`,ue=`[object DOMException]`,de=`[object Error]`,fe=`[object Function]`,pe=`[object GeneratorFunction]`,me=`[object Map]`,he=`[object Number]`,ge=`[object Null]`,_e=`[object Object]`,ve=`[object Promise]`,ye=`[object Proxy]`,be=`[object RegExp]`,xe=`[object Set]`,Se=`[object String]`,Ce=`[object Symbol]`,we=`[object Undefined]`,Te=`[object WeakMap]`,Ee=`[object WeakSet]`,L=`[object ArrayBuffer]`,De=`[object DataView]`,Oe=`[object Float32Array]`,ke=`[object Float64Array]`,Ae=`[object Int8Array]`,je=`[object Int16Array]`,Me=`[object Int32Array]`,Ne=`[object Uint8Array]`,Pe=`[object Uint8ClampedArray]`,Fe=`[object Uint16Array]`,Ie=`[object Uint32Array]`,Le=/\b__p \+= '';/g,Re=/\b(__p \+=) '' \+/g,ze=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Be=/&(?:amp|lt|gt|quot|#39);/g,Ve=/[&<>"']/g,He=RegExp(Be.source),Ue=RegExp(Ve.source),We=/<%-([\s\S]+?)%>/g,Ge=/<%([\s\S]+?)%>/g,Ke=/<%=([\s\S]+?)%>/g,qe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Je=/^\w*$/,Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/[\\^$.*+?()[\]{}|]/g,Ze=RegExp(Xe.source),Qe=/^\s+/,$e=/\s/,et=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,tt=/\{\n\/\* \[wrapped with (.+)\] \*/,nt=/,? & /,rt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,it=/[()=,{}\[\]\/\s]/,at=/\\(\\)?/g,ot=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,st=/\w*$/,ct=/^[-+]0x[0-9a-f]+$/i,lt=/^0b[01]+$/i,ut=/^\[object .+?Constructor\]$/,R=/^0o[0-7]+$/i,dt=/^(?:0|[1-9]\d*)$/,z=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ft=/($^)/,pt=/['\n\r\u2028\u2029\\]/g,mt=`\\ud800-\\udfff`,ht=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,gt=`\\u2700-\\u27bf`,_t=`a-z\\xdf-\\xf6\\xf8-\\xff`,vt=`\\xac\\xb1\\xd7\\xf7`,yt=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,bt=`\\u2000-\\u206f`,xt=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,St=`A-Z\\xc0-\\xd6\\xd8-\\xde`,Ct=`\\ufe0e\\ufe0f`,wt=vt+yt+bt+xt,Tt=`['’]`,Et=`[`+mt+`]`,Dt=`[`+wt+`]`,Ot=`[`+ht+`]`,kt=`\\d+`,At=`[`+gt+`]`,jt=`[`+_t+`]`,Mt=`[^`+mt+wt+kt+gt+_t+St+`]`,Nt=`\\ud83c[\\udffb-\\udfff]`,Pt=`(?:`+Ot+`|`+Nt+`)`,Ft=`[^`+mt+`]`,It=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Lt=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Rt=`[`+St+`]`,zt=`\\u200d`,Bt=`(?:`+jt+`|`+Mt+`)`,Vt=`(?:`+Rt+`|`+Mt+`)`,Ht=`(?:`+Tt+`(?:d|ll|m|re|s|t|ve))?`,Ut=`(?:`+Tt+`(?:D|LL|M|RE|S|T|VE))?`,Wt=Pt+`?`,Gt=`[`+Ct+`]?`,Kt=`(?:`+zt+`(?:`+[Ft,It,Lt].join(`|`)+`)`+Gt+Wt+`)*`,qt=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,Jt=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,Yt=Gt+Wt+Kt,Xt=`(?:`+[At,It,Lt].join(`|`)+`)`+Yt,Zt=`(?:`+[Ft+Ot+`?`,Ot,It,Lt,Et].join(`|`)+`)`,B=RegExp(Tt,`g`),Qt=RegExp(Ot,`g`),$t=RegExp(Nt+`(?=`+Nt+`)|`+Zt+Yt,`g`),en=RegExp([Rt+`?`+jt+`+`+Ht+`(?=`+[Dt,Rt,`$`].join(`|`)+`)`,Vt+`+`+Ut+`(?=`+[Dt,Rt+Bt,`$`].join(`|`)+`)`,Rt+`?`+Bt+`+`+Ht,Rt+`+`+Ut,Jt,qt,kt,Xt].join(`|`),`g`),tn=RegExp(`[`+zt+mt+ht+Ct+`]`),nn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rn=`Array.Buffer.DataView.Date.Error.Float32Array.Float64Array.Function.Int8Array.Int16Array.Int32Array.Map.Math.Object.Promise.RegExp.Set.String.Symbol.TypeError.Uint8Array.Uint8ClampedArray.Uint16Array.Uint32Array.WeakMap._.clearTimeout.isFinite.parseInt.setTimeout`.split(`.`),an=-1,on={};on[Oe]=on[ke]=on[Ae]=on[je]=on[Me]=on[Ne]=on[Pe]=on[Fe]=on[Ie]=!0,on[oe]=on[se]=on[L]=on[le]=on[De]=on[I]=on[de]=on[fe]=on[me]=on[he]=on[_e]=on[be]=on[xe]=on[Se]=on[Te]=!1;var sn={};sn[oe]=sn[se]=sn[L]=sn[De]=sn[le]=sn[I]=sn[Oe]=sn[ke]=sn[Ae]=sn[je]=sn[Me]=sn[me]=sn[he]=sn[_e]=sn[be]=sn[xe]=sn[Se]=sn[Ce]=sn[Ne]=sn[Pe]=sn[Fe]=sn[Ie]=!0,sn[de]=sn[fe]=sn[Te]=!1;var cn={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`s`},ln={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},un={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`},dn={"\\":`\\`,"'":`'`,"\n":`n`,"\r":`r`,"\u2028":`u2028`,"\u2029":`u2029`},fn=parseFloat,pn=parseInt,V=typeof global==`object`&&global&&global.Object===Object&&global,mn=typeof self==`object`&&self&&self.Object===Object&&self,hn=V||mn||Function(`return this`)(),gn=typeof e==`object`&&e&&!e.nodeType&&e,_n=gn&&typeof t==`object`&&t&&!t.nodeType&&t,vn=_n&&_n.exports===gn,yn=vn&&V.process,bn=function(){try{return _n&&_n.require&&_n.require(`util`).types||yn&&yn.binding&&yn.binding(`util`)}catch{}}(),xn=bn&&bn.isArrayBuffer,Sn=bn&&bn.isDate,Cn=bn&&bn.isMap,wn=bn&&bn.isRegExp,Tn=bn&&bn.isSet,En=bn&&bn.isTypedArray;function Dn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function On(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function H(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function kn(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}function An(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function jn(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function Mn(e,t){return!!(e!=null&&e.length)&&Wn(e,t,0)>-1}function Nn(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Pn(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Fn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function In(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Ln(e,t,n,r){var i=e==null?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Rn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var zn=Jn(`length`);function Bn(e){return e.split(``)}function Vn(e){return e.match(rt)||[]}function Hn(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Un(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function Wn(e,t,n){return t===t?br(e,t,n):Un(e,Kn,n)}function Gn(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function Kn(e){return e!==e}function qn(e,t){var n=e==null?0:e.length;return n?Qn(e,t)/n:N}function Jn(e){return function(t){return t==null?n:t[e]}}function Yn(e){return function(t){return e==null?n:e[t]}}function Xn(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function Zn(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Qn(e,t){for(var r,i=-1,a=e.length;++i<a;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function $n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function er(e,t){return Pn(t,function(t){return[t,e[t]]})}function tr(e){return e&&e.slice(0,wr(e)+1).replace(Qe,``)}function nr(e){return function(t){return e(t)}}function rr(e,t){return Pn(t,function(t){return e[t]})}function ir(e,t){return e.has(t)}function ar(e,t){for(var n=-1,r=e.length;++n<r&&Wn(t,e[n],0)>-1;);return n}function or(e,t){for(var n=e.length;n--&&Wn(t,e[n],0)>-1;);return n}function sr(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var cr=Yn(cn),lr=Yn(ln);function ur(e){return`\\`+dn[e]}function dr(e,t){return e==null?n:e[t]}function fr(e){return tn.test(e)}function pr(e){return nn.test(e)}function mr(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function hr(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function gr(e,t){return function(n){return e(t(n))}}function _r(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n];(o===t||o===d)&&(e[n]=d,a[i++]=n)}return a}function vr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function yr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function br(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function xr(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function Sr(e){return fr(e)?Er(e):zn(e)}function Cr(e){return fr(e)?Dr(e):Bn(e)}function wr(e){for(var t=e.length;t--&&$e.test(e.charAt(t)););return t}var Tr=Yn(un);function Er(e){for(var t=$t.lastIndex=0;$t.test(e);)++t;return t}function Dr(e){return e.match($t)||[]}function Or(e){return e.match(en)||[]}var kr=(function e(t){t=t==null?hn:kr.defaults(hn.Object(),t,kr.pick(hn,rn));var $e=t.Array,rt=t.Date,mt=t.Error,ht=t.Function,gt=t.Math,_t=t.Object,vt=t.RegExp,yt=t.String,bt=t.TypeError,xt=$e.prototype,St=ht.prototype,Ct=_t.prototype,wt=t[`__core-js_shared__`],Tt=St.toString,Et=Ct.hasOwnProperty,Dt=0,Ot=function(){var e=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),kt=Ct.toString,At=Tt.call(_t),jt=hn._,Mt=vt(`^`+Tt.call(Et).replace(Xe,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Nt=vn?t.Buffer:n,Pt=t.Symbol,Ft=t.Uint8Array,It=Nt?Nt.allocUnsafe:n,Lt=gr(_t.getPrototypeOf,_t),Rt=_t.create,zt=Ct.propertyIsEnumerable,Bt=xt.splice,Vt=Pt?Pt.isConcatSpreadable:n,Ht=Pt?Pt.iterator:n,Ut=Pt?Pt.toStringTag:n,Wt=function(){try{var e=ts(_t,`defineProperty`);return e({},``,{}),e}catch{}}(),Gt=t.clearTimeout!==hn.clearTimeout&&t.clearTimeout,Kt=rt&&rt.now!==hn.Date.now&&rt.now,qt=t.setTimeout!==hn.setTimeout&&t.setTimeout,Jt=gt.ceil,Yt=gt.floor,Xt=_t.getOwnPropertySymbols,Zt=Nt?Nt.isBuffer:n,$t=t.isFinite,en=xt.join,tn=gr(_t.keys,_t),nn=gt.max,cn=gt.min,ln=rt.now,un=t.parseInt,dn=gt.random,V=xt.reverse,mn=ts(t,`DataView`),gn=ts(t,`Map`),_n=ts(t,`Promise`),yn=ts(t,`Set`),bn=ts(t,`WeakMap`),zn=ts(_t,`create`),Bn=bn&&new bn,Yn={},br=Bs(mn),Er=Bs(gn),Dr=Bs(_n),Ar=Bs(yn),jr=Bs(bn),Mr=Pt?Pt.prototype:n,Nr=Mr?Mr.valueOf:n,Pr=Mr?Mr.toString:n;function U(e){if(Mu(e)&&!hu(e)&&!(e instanceof Rr)){if(e instanceof Lr)return e;if(Et.call(e,`__wrapped__`))return Hs(e)}return new Lr(e)}var Fr=function(){function e(){}return function(t){if(!ju(t))return{};if(Rt)return Rt(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Ir(){}function Lr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}U.templateSettings={escape:We,evaluate:Ge,interpolate:Ke,variable:``,imports:{_:U}},U.prototype=Ir.prototype,U.prototype.constructor=U,Lr.prototype=Fr(Ir.prototype),Lr.prototype.constructor=Lr;function Rr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=P,this.__views__=[]}function zr(){var e=new Rr(this.__wrapped__);return e.__actions__=mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mo(this.__views__),e}function Br(){if(this.__filtered__){var e=new Rr(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Vr(){var e=this.__wrapped__.value(),t=this.__dir__,n=hu(e),r=t<0,i=n?e.length:0,a=os(0,i,this.__views__),o=a.start,s=a.end,c=s-o,l=r?s:o-1,u=this.__iteratees__,d=u.length,f=0,p=cn(c,this.__takeCount__);if(!n||!r&&i==c&&p==c)return Ja(e,this.__actions__);var m=[];outer:for(;c--&&f<p;){l+=t;for(var h=-1,g=e[l];++h<d;){var _=u[h],v=_.iteratee,y=_.type,b=v(g);if(y==ne)g=b;else if(!b){if(y==te)continue outer;break outer}}m[f++]=g}return m}Rr.prototype=Fr(Ir.prototype),Rr.prototype.constructor=Rr;function Hr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ur(){this.__data__=zn?zn(null):{},this.size=0}function Wr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function Gr(e){var t=this.__data__;if(zn){var r=t[e];return r===l?n:r}return Et.call(t,e)?t[e]:n}function Kr(e){var t=this.__data__;return zn?t[e]!==n:Et.call(t,e)}function qr(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=zn&&t===n?l:t,this}Hr.prototype.clear=Ur,Hr.prototype.delete=Wr,Hr.prototype.get=Gr,Hr.prototype.has=Kr,Hr.prototype.set=qr;function Jr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yr(){this.__data__=[],this.size=0}function Xr(e){var t=this.__data__,n=xi(t,e);return n<0?!1:(n==t.length-1?t.pop():Bt.call(t,n,1),--this.size,!0)}function Zr(e){var t=this.__data__,r=xi(t,e);return r<0?n:t[r][1]}function Qr(e){return xi(this.__data__,e)>-1}function $r(e,t){var n=this.__data__,r=xi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}Jr.prototype.clear=Yr,Jr.prototype.delete=Xr,Jr.prototype.get=Zr,Jr.prototype.has=Qr,Jr.prototype.set=$r;function ei(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ti(){this.size=0,this.__data__={hash:new Hr,map:new(gn||Jr),string:new Hr}}function ni(e){var t=$o(this,e).delete(e);return this.size-=+!!t,t}function ri(e){return $o(this,e).get(e)}function ii(e){return $o(this,e).has(e)}function ai(e,t){var n=$o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}ei.prototype.clear=ti,ei.prototype.delete=ni,ei.prototype.get=ri,ei.prototype.has=ii,ei.prototype.set=ai;function oi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ei;++t<n;)this.add(e[t])}function si(e){return this.__data__.set(e,l),this}function ci(e){return this.__data__.has(e)}oi.prototype.add=oi.prototype.push=si,oi.prototype.has=ci;function li(e){var t=this.__data__=new Jr(e);this.size=t.size}function ui(){this.__data__=new Jr,this.size=0}function di(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function fi(e){return this.__data__.get(e)}function pi(e){return this.__data__.has(e)}function mi(e,t){var n=this.__data__;if(n instanceof Jr){var r=n.__data__;if(!gn||r.length<i-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ei(r)}return n.set(e,t),this.size=n.size,this}li.prototype.clear=ui,li.prototype.delete=di,li.prototype.get=fi,li.prototype.has=pi,li.prototype.set=mi;function hi(e,t){var n=hu(e),r=!n&&mu(e),i=!n&&!r&&bu(e),a=!n&&!r&&!i&&qu(e),o=n||r||i||a,s=o?$n(e.length,yt):[],c=s.length;for(var l in e)(t||Et.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||ms(l,c)))&&s.push(l);return s}function gi(e){var t=e.length;return t?e[Oa(0,t-1)]:n}function _i(e,t){return Ls(mo(e),Di(t,0,e.length))}function vi(e){return Ls(mo(e))}function yi(e,t,r){(r!==n&&!du(e[t],r)||r===n&&!(t in e))&&Ti(e,t,r)}function bi(e,t,r){var i=e[t];(!(Et.call(e,t)&&du(i,r))||r===n&&!(t in e))&&Ti(e,t,r)}function xi(e,t){for(var n=e.length;n--;)if(du(e[n][0],t))return n;return-1}function Si(e,t,n,r){return Ni(e,function(e,i,a){t(r,e,n(e),a)}),r}function Ci(e,t){return e&&ho(t,Od(t),e)}function wi(e,t){return e&&ho(t,kd(t),e)}function Ti(e,t,n){t==`__proto__`&&Wt?Wt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ei(e,t){for(var r=-1,i=t.length,a=$e(i),o=e==null;++r<i;)a[r]=o?n:Sd(e,t[r]);return a}function Di(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function Oi(e,t,r,i,a,o){var s,c=t&f,l=t&p,u=t&m;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!ju(e))return e;var d=hu(e);if(d){if(s=ls(e),!c)return mo(e,s)}else{var h=as(e),g=h==fe||h==pe;if(bu(e))return ro(e,c);if(h==_e||h==oe||g&&!a){if(s=l||g?{}:us(e),!c)return l?_o(e,wi(s,e)):go(e,Ci(s,e))}else{if(!sn[h])return a?e:{};s=ds(e,h,c)}}o||=new li;var _=o.get(e);if(_)return _;o.set(e,s),Wu(e)?e.forEach(function(n){s.add(Oi(n,t,r,n,e,o))}):Nu(e)&&e.forEach(function(n,i){s.set(i,Oi(n,t,r,i,e,o))});var v=d?n:(u?l?Jo:qo:l?kd:Od)(e);return H(v||e,function(n,i){v&&(i=n,n=e[i]),bi(s,i,Oi(n,t,r,i,e,o))}),s}function ki(e){var t=Od(e);return function(n){return Ai(n,e,t)}}function Ai(e,t,r){var i=r.length;if(e==null)return!i;for(e=_t(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function ji(e,t,r){if(typeof e!=`function`)throw new bt(o);return Ns(function(){e.apply(n,r)},t)}function Mi(e,t,n,r){var a=-1,o=Mn,s=!0,c=e.length,l=[],u=t.length;if(!c)return l;n&&(t=Pn(t,nr(n))),r?(o=Nn,s=!1):t.length>=i&&(o=ir,s=!1,t=new oi(t));outer:for(;++a<c;){var d=e[a],f=n==null?d:n(d);if(d=r||d!==0?d:0,s&&f===f){for(var p=u;p--;)if(t[p]===f)continue outer;l.push(d)}else o(t,f,r)||l.push(d)}return l}var Ni=bo(Hi),Pi=bo(Ui,!0);function Fi(e,t){var n=!0;return Ni(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function Ii(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===n?s===s&&!Ku(s):r(s,c)))var c=s,l=o}return l}function Li(e,t,r,i){var a=e.length;for(r=td(r),r<0&&(r=-r>a?0:a+r),i=i===n||i>a?a:td(i),i<0&&(i+=a),i=r>i?0:nd(i);r<i;)e[r++]=t;return e}function Ri(e,t){var n=[];return Ni(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function zi(e,t,n,r,i){var a=-1,o=e.length;for(n||=ps,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?zi(s,t-1,n,r,i):Fn(i,s):r||(i[i.length]=s)}return i}var Bi=xo(),Vi=xo(!0);function Hi(e,t){return e&&Bi(e,t,Od)}function Ui(e,t){return e&&Vi(e,t,Od)}function Wi(e,t){return jn(t,function(t){return Ou(e[t])})}function Gi(e,t){t=$a(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[zs(t[r++])];return r&&r==i?e:n}function Ki(e,t,n){var r=t(e);return hu(e)?r:Fn(r,n(e))}function qi(e){return e==null?e===n?we:ge:Ut&&Ut in _t(e)?ns(e):Ds(e)}function Ji(e,t){return e>t}function Yi(e,t){return e!=null&&Et.call(e,t)}function Xi(e,t){return e!=null&&t in _t(e)}function Zi(e,t,n){return e>=cn(t,n)&&e<nn(t,n)}function Qi(e,t,r){for(var i=r?Nn:Mn,a=e[0].length,o=e.length,s=o,c=$e(o),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Pn(d,nr(t))),l=cn(d.length,l),c[s]=!r&&(t||a>=120&&d.length>=120)?new oi(s&&d):n}d=e[0];var f=-1,p=c[0];outer:for(;++f<a&&u.length<l;){var m=d[f],h=t?t(m):m;if(m=r||m!==0?m:0,!(p?ir(p,h):i(u,h,r))){for(s=o;--s;){var g=c[s];if(!(g?ir(g,h):i(e[s],h,r)))continue outer}p&&p.push(h),u.push(m)}}return u}function $i(e,t,n,r){return Hi(e,function(e,i,a){t(r,n(e),i,a)}),r}function ea(e,t,r){t=$a(t,e),e=ks(e,t);var i=e==null?e:e[zs(pc(t))];return i==null?n:Dn(i,e,r)}function ta(e){return Mu(e)&&qi(e)==oe}function na(e){return Mu(e)&&qi(e)==L}function ra(e){return Mu(e)&&qi(e)==I}function ia(e,t,n,r,i){return e===t?!0:e==null||t==null||!Mu(e)&&!Mu(t)?e!==e&&t!==t:aa(e,t,n,r,ia,i)}function aa(e,t,n,r,i,a){var o=hu(e),s=hu(t),c=o?se:as(e),l=s?se:as(t);c=c==oe?_e:c,l=l==oe?_e:l;var u=c==_e,d=l==_e,f=c==l;if(f&&bu(e)){if(!bu(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new li,o||qu(e)?Uo(e,t,n,r,i,a):Wo(e,t,c,n,r,i,a);if(!(n&h)){var p=u&&Et.call(e,`__wrapped__`),m=d&&Et.call(t,`__wrapped__`);if(p||m){var g=p?e.value():e,_=m?t.value():t;return a||=new li,i(g,_,n,r,a)}}return f?(a||=new li,Go(e,t,n,r,i,a)):!1}function oa(e){return Mu(e)&&as(e)==me}function sa(e,t,r,i){var a=r.length,o=a,s=!i;if(e==null)return!o;for(e=_t(e);a--;){var c=r[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){c=r[a];var l=c[0],u=e[l],d=c[1];if(s&&c[2]){if(u===n&&!(l in e))return!1}else{var f=new li;if(i)var p=i(u,d,l,e,t,f);if(!(p===n?ia(d,u,h|g,i,f):p))return!1}}return!0}function ca(e){return!ju(e)||ys(e)?!1:(Ou(e)?Mt:ut).test(Bs(e))}function la(e){return Mu(e)&&qi(e)==be}function ua(e){return Mu(e)&&as(e)==xe}function da(e){return Mu(e)&&Au(e.length)&&!!on[qi(e)]}function fa(e){return typeof e==`function`?e:e==null?Lf:typeof e==`object`?hu(e)?va(e[0],e[1]):_a(e):Xf(e)}function pa(e){if(!xs(e))return tn(e);var t=[];for(var n in _t(e))Et.call(e,n)&&n!=`constructor`&&t.push(n);return t}function ma(e){if(!ju(e))return Es(e);var t=xs(e),n=[];for(var r in e)r==`constructor`&&(t||!Et.call(e,r))||n.push(r);return n}function ha(e,t){return e<t}function ga(e,t){var n=-1,r=_u(e)?$e(e.length):[];return Ni(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function _a(e){var t=es(e);return t.length==1&&t[0][2]?Cs(t[0][0],t[0][1]):function(n){return n===e||sa(n,e,t)}}function va(e,t){return gs(e)&&Ss(t)?Cs(zs(e),t):function(r){var i=Sd(r,e);return i===n&&i===t?wd(r,e):ia(t,i,h|g)}}function ya(e,t,r,i,a){e!==t&&Bi(t,function(o,s){if(a||=new li,ju(o))ba(e,t,s,r,ya,i,a);else{var c=i?i(js(e,s),o,s+``,e,t,a):n;c===n&&(c=o),yi(e,s,c)}},kd)}function ba(e,t,r,i,a,o,s){var c=js(e,r),l=js(t,r),u=s.get(l);if(u){yi(e,r,u);return}var d=o?o(c,l,r+``,e,t,s):n,f=d===n;if(f){var p=hu(l),m=!p&&bu(l),h=!p&&!m&&qu(l);d=l,p||m||h?hu(c)?d=c:vu(c)?d=mo(c):m?(f=!1,d=ro(l,!0)):h?(f=!1,d=co(l,!0)):d=[]:Vu(l)||mu(l)?(d=c,mu(c)?d=id(c):(!ju(c)||Ou(c))&&(d=us(l))):f=!1}f&&(s.set(l,d),a(d,l,i,o,s),s.delete(l)),yi(e,r,d)}function xa(e,t){var r=e.length;if(r)return t+=t<0?r:0,ms(t,r)?e[t]:n}function Sa(e,t,n){t=t.length?Pn(t,function(e){return hu(e)?function(t){return Gi(t,e.length===1?e[0]:e)}:e}):[Lf];var r=-1;return t=Pn(t,nr(Qo())),Zn(ga(e,function(e,n,i){return{criteria:Pn(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return uo(e,t,n)})}function Ca(e,t){return wa(e,t,function(t,n){return wd(e,n)})}function wa(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=Gi(e,o);n(s,o)&&Pa(a,$a(o,e),s)}return a}function Ta(e){return function(t){return Gi(t,e)}}function Ea(e,t,n,r){var i=r?Gn:Wn,a=-1,o=t.length,s=e;for(e===t&&(t=mo(t)),n&&(s=Pn(e,nr(n)));++a<o;)for(var c=0,l=t[a],u=n?n(l):l;(c=i(s,u,c,r))>-1;)s!==e&&Bt.call(s,c,1),Bt.call(e,c,1);return e}function Da(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;ms(i)?Bt.call(e,i,1):Ga(e,i)}}return e}function Oa(e,t){return e+Yt(dn()*(t-e+1))}function ka(e,t,n,r){for(var i=-1,a=nn(Jt((t-e)/(n||1)),0),o=$e(a);a--;)o[r?a:++i]=e,e+=n;return o}function Aa(e,t){var n=``;if(!e||t<1||t>j)return n;do t%2&&(n+=e),t=Yt(t/2),t&&(e+=e);while(t);return n}function ja(e,t){return Ps(Os(e,t,Lf),e+``)}function Ma(e){return gi(qd(e))}function Na(e,t){var n=qd(e);return Ls(n,Di(t,0,n.length))}function Pa(e,t,r,i){if(!ju(e))return e;t=$a(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=zs(t[a]),u=r;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];u=i?i(d,l,c):n,u===n&&(u=ju(d)?d:ms(t[a+1])?[]:{})}bi(c,l,u),c=c[l]}return e}var Fa=Bn?function(e,t){return Bn.set(e,t),e}:Lf,Ia=Wt?function(e,t){return Wt(e,`toString`,{configurable:!0,enumerable:!1,value:Nf(t),writable:!0})}:Lf;function La(e){return Ls(qd(e))}function Ra(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=$e(i);++r<i;)a[r]=e[r+t];return a}function za(e,t){var n;return Ni(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function Ba(e,t,n){var r=0,i=e==null?r:e.length;if(typeof t==`number`&&t===t&&i<=ie){for(;r<i;){var a=r+i>>>1,o=e[a];o!==null&&!Ku(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return Va(e,t,Lf,n)}function Va(e,t,r,i){var a=0,o=e==null?0:e.length;if(o===0)return 0;t=r(t);for(var s=t!==t,c=t===null,l=Ku(t),u=t===n;a<o;){var d=Yt((a+o)/2),f=r(e[d]),p=f!==n,m=f===null,h=f===f,g=Ku(f);if(s)var _=i||h;else _=u?h&&(i||p):c?h&&p&&(i||!m):l?h&&p&&!m&&(i||!g):m||g?!1:i?f<=t:f<t;_?a=d+1:o=d}return cn(o,F)}function W(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!du(s,c)){var c=s;a[i++]=o===0?0:o}}return a}function Ha(e){return typeof e==`number`?e:Ku(e)?N:+e}function Ua(e){if(typeof e==`string`)return e;if(hu(e))return Pn(e,Ua)+``;if(Ku(e))return Pr?Pr.call(e):``;var t=e+``;return t==`0`&&1/e==-A?`-0`:t}function Wa(e,t,n){var r=-1,a=Mn,o=e.length,s=!0,c=[],l=c;if(n)s=!1,a=Nn;else if(o>=i){var u=t?null:Lo(e);if(u)return vr(u);s=!1,a=ir,l=new oi}else l=t?[]:c;outer:for(;++r<o;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,s&&f===f){for(var p=l.length;p--;)if(l[p]===f)continue outer;t&&l.push(f),c.push(d)}else a(l,f,n)||(l!==c&&l.push(f),c.push(d))}return c}function Ga(e,t){t=$a(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=zs(t[n]);if(i===`__proto__`&&!Et.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=ks(e,t);return a==null||delete a[zs(pc(t))]}function Ka(e,t,n,r){return Pa(e,t,n(Gi(e,t)),r)}function qa(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?Ra(e,r?0:a,r?a+1:i):Ra(e,r?a+1:0,r?i:a)}function Ja(e,t){var n=e;return n instanceof Rr&&(n=n.value()),In(t,function(e,t){return t.func.apply(t.thisArg,Fn([e],t.args))},n)}function Ya(e,t,n){var r=e.length;if(r<2)return r?Wa(e[0]):[];for(var i=-1,a=$e(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=Mi(a[i]||o,e[s],t,n));return Wa(zi(a,1),t,n)}function Xa(e,t,r){for(var i=-1,a=e.length,o=t.length,s={};++i<a;){var c=i<o?t[i]:n;r(s,e[i],c)}return s}function Za(e){return vu(e)?e:[]}function Qa(e){return typeof e==`function`?e:Lf}function $a(e,t){return hu(e)?e:gs(e,t)?[e]:Rs(od(e))}var eo=ja;function to(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Ra(e,t,r)}var no=Gt||function(e){return hn.clearTimeout(e)};function ro(e,t){if(t)return e.slice();var n=e.length,r=It?It(n):new e.constructor(n);return e.copy(r),r}function io(e){var t=new e.constructor(e.byteLength);return new Ft(t).set(new Ft(e)),t}function ao(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function oo(e){var t=new e.constructor(e.source,st.exec(e));return t.lastIndex=e.lastIndex,t}function so(e){return Nr?_t(Nr.call(e)):{}}function co(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function lo(e,t){if(e!==t){var r=e!==n,i=e===null,a=e===e,o=Ku(e),s=t!==n,c=t===null,l=t===t,u=Ku(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}function uo(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=lo(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function fo(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=nn(a-o,0),u=$e(c+l),d=!r;++s<c;)u[s]=t[s];for(;++i<o;)(d||i<a)&&(u[n[i]]=e[i]);for(;l--;)u[s++]=e[i++];return u}function po(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,c=-1,l=t.length,u=nn(a-s,0),d=$e(u+l),f=!r;++i<u;)d[i]=e[i];for(var p=i;++c<l;)d[p+c]=t[c];for(;++o<s;)(f||i<a)&&(d[p+n[o]]=e[i++]);return d}function mo(e,t){var n=-1,r=e.length;for(t||=$e(r);++n<r;)t[n]=e[n];return t}function ho(e,t,r,i){var a=!r;r||={};for(var o=-1,s=t.length;++o<s;){var c=t[o],l=i?i(r[c],e[c],c,r,e):n;l===n&&(l=e[c]),a?Ti(r,c,l):bi(r,c,l)}return r}function go(e,t){return ho(e,rs(e),t)}function _o(e,t){return ho(e,is(e),t)}function vo(e,t){return function(n,r){var i=hu(n)?On:Si,a=t?t():{};return i(n,e,Qo(r,2),a)}}function yo(e){return ja(function(t,r){var i=-1,a=r.length,o=a>1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&typeof o==`function`?(a--,o):n,s&&hs(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=_t(t);++i<a;){var c=r[i];c&&e(t,c,i,o)}return t})}function bo(e,t){return function(n,r){if(n==null)return n;if(!_u(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=_t(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function xo(e){return function(t,n,r){for(var i=-1,a=_t(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function So(e,t,n){var r=t&_,i=To(e);function a(){return(this&&this!==hn&&this instanceof a?i:e).apply(r?n:this,arguments)}return a}function Co(e){return function(t){t=od(t);var r=fr(t)?Cr(t):n,i=r?r[0]:t.charAt(0),a=r?to(r,1).join(``):t.slice(1);return i[e]()+a}}function wo(e){return function(t){return In(Of(ef(t).replace(B,``)),e,``)}}function To(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Fr(e.prototype),r=e.apply(n,t);return ju(r)?r:n}}function Eo(e,t,r){var i=To(e);function a(){for(var o=arguments.length,s=$e(o),c=o,l=Zo(a);c--;)s[c]=arguments[c];var u=o<3&&s[0]!==l&&s[o-1]!==l?[]:_r(s,l);return o-=u.length,o<r?G(e,t,ko,a.placeholder,n,s,u,n,n,r-o):Dn(this&&this!==hn&&this instanceof a?i:e,this,s)}return a}function Do(e){return function(t,r,i){var a=_t(t);if(!_u(t)){var o=Qo(r,3);t=Od(t),r=function(e){return o(a[e],e,a)}}var s=e(t,r,i);return s>-1?a[o?t[s]:s]:n}}function Oo(e){return Ko(function(t){var r=t.length,i=r,a=Lr.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if(typeof s!=`function`)throw new bt(o);if(a&&!c&&Xo(s)==`wrapper`)var c=new Lr([],!0)}for(i=c?i:r;++i<r;){s=t[i];var l=Xo(s),u=l==`wrapper`?Yo(s):n;c=u&&vs(u[0])&&u[1]==(w|b|S|T)&&!u[4].length&&u[9]==1?c[Xo(u[0])].apply(c,u[3]):s.length==1&&vs(s)?c[l]():c.thru(s)}return function(){var e=arguments,n=e[0];if(c&&e.length==1&&hu(n))return c.plant(n).value();for(var i=0,a=r?t[i].apply(this,e):n;++i<r;)a=t[i].call(this,a);return a}})}function ko(e,t,r,i,a,o,s,c,l,u){var d=t&w,f=t&_,p=t&v,m=t&(b|x),h=t&E,g=p?n:To(e);function y(){for(var n=arguments.length,_=$e(n),v=n;v--;)_[v]=arguments[v];if(m)var b=Zo(y),x=sr(_,b);if(i&&(_=fo(_,i,a,m)),o&&(_=po(_,o,s,m)),n-=x,m&&n<u){var S=_r(_,b);return G(e,t,ko,y.placeholder,r,_,S,c,l,u-n)}var C=f?r:this,w=p?C[e]:e;return n=_.length,c?_=As(_,c):h&&n>1&&_.reverse(),d&&l<n&&(_.length=l),this&&this!==hn&&this instanceof y&&(w=g||To(w)),w.apply(C,_)}return y}function Ao(e,t){return function(n,r){return $i(n,e,t(r),{})}}function jo(e,t){return function(r,i){var a;if(r===n&&i===n)return t;if(r!==n&&(a=r),i!==n){if(a===n)return i;typeof r==`string`||typeof i==`string`?(r=Ua(r),i=Ua(i)):(r=Ha(r),i=Ha(i)),a=e(r,i)}return a}}function Mo(e){return Ko(function(t){return t=Pn(t,nr(Qo())),ja(function(n){var r=this;return e(t,function(e){return Dn(e,r,n)})})})}function No(e,t){t=t===n?` `:Ua(t);var r=t.length;if(r<2)return r?Aa(t,e):t;var i=Aa(t,Jt(e/Sr(t)));return fr(t)?to(Cr(i),0,e).join(``):i.slice(0,e)}function Po(e,t,n,r){var i=t&_,a=To(e);function o(){for(var t=-1,s=arguments.length,c=-1,l=r.length,u=$e(l+s),d=this&&this!==hn&&this instanceof o?a:e;++c<l;)u[c]=r[c];for(;s--;)u[c++]=arguments[++t];return Dn(d,i?n:this,u)}return o}function Fo(e){return function(t,r,i){return i&&typeof i!=`number`&&hs(t,r,i)&&(r=i=n),t=ed(t),r===n?(r=t,t=0):r=ed(r),i=i===n?t<r?1:-1:ed(i),ka(t,r,i,e)}}function Io(e){return function(t,n){return typeof t==`string`&&typeof n==`string`||(t=rd(t),n=rd(n)),e(t,n)}}function G(e,t,r,i,a,o,s,c,l,u){var d=t&b,f=d?s:n,p=d?n:s,m=d?o:n,h=d?n:o;t|=d?S:C,t&=~(d?C:S),t&y||(t&=~(_|v));var g=[e,t,a,m,f,h,p,c,l,u],x=r.apply(n,g);return vs(e)&&Ms(x,g),x.placeholder=i,Fs(x,e,t)}function K(e){var t=gt[e];return function(e,n){if(e=rd(e),n=n==null?0:cn(td(n),292),n&&$t(e)){var r=(od(e)+`e`).split(`e`);return r=(od(t(r[0]+`e`+(+r[1]+n)))+`e`).split(`e`),+(r[0]+`e`+(+r[1]-n))}return t(e)}}var Lo=yn&&1/vr(new yn([,-0]))[1]==A?function(e){return new yn(e)}:Gf;function Ro(e){return function(t){var n=as(t);return n==me?hr(t):n==xe?yr(t):er(t,e(t))}}function zo(e,t,r,i,a,s,c,l){var u=t&v;if(!u&&typeof e!=`function`)throw new bt(o);var d=i?i.length:0;if(d||(t&=~(S|C),i=a=n),c=c===n?c:nn(td(c),0),l=l===n?l:td(l),d-=a?a.length:0,t&C){var f=i,p=a;i=a=n}var m=u?n:Yo(e),h=[e,t,r,i,a,f,p,s,c,l];if(m&&Ts(h,m),e=h[0],t=h[1],r=h[2],i=h[3],a=h[4],l=h[9]=h[9]===n?u?0:e.length:nn(h[9]-d,0),!l&&t&(b|x)&&(t&=~(b|x)),!t||t==_)var g=So(e,t,r);else g=t==b||t==x?Eo(e,t,l):(t==S||t==(_|S))&&!a.length?Po(e,t,r,i):ko.apply(n,h);return Fs((m?Fa:Ms)(g,h),e,t)}function Bo(e,t,r,i){return e===n||du(e,Ct[r])&&!Et.call(i,r)?t:e}function Vo(e,t,r,i,a,o){return ju(e)&&ju(t)&&(o.set(t,e),ya(e,t,n,Vo,o),o.delete(t)),e}function Ho(e){return Vu(e)?n:e}function Uo(e,t,r,i,a,o){var s=r&h,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=r&g?new oi:n;for(o.set(e,t),o.set(t,e);++f<c;){var _=e[f],v=t[f];if(i)var y=s?i(v,_,f,t,e,o):i(_,v,f,e,t,o);if(y!==n){if(y)continue;p=!1;break}if(m){if(!Rn(t,function(e,t){if(!ir(m,t)&&(_===e||a(_,e,r,i,o)))return m.push(t)})){p=!1;break}}else if(!(_===v||a(_,v,r,i,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function Wo(e,t,n,r,i,a,o){switch(n){case De:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case L:return!(e.byteLength!=t.byteLength||!a(new Ft(e),new Ft(t)));case le:case I:case he:return du(+e,+t);case de:return e.name==t.name&&e.message==t.message;case be:case Se:return e==t+``;case me:var s=hr;case xe:var c=r&h;if(s||=vr,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=g,o.set(e,t);var u=Uo(s(e),s(t),r,i,a,o);return o.delete(e),u;case Ce:if(Nr)return Nr.call(e)==Nr.call(t)}return!1}function Go(e,t,r,i,a,o){var s=r&h,c=qo(e),l=c.length;if(l!=qo(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:Et.call(t,d)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var g=s;++u<l;){d=c[u];var _=e[d],v=t[d];if(i)var y=s?i(v,_,d,t,e,o):i(_,v,d,e,t,o);if(!(y===n?_===v||a(_,v,r,i,o):y)){m=!1;break}g||=d==`constructor`}if(m&&!g){var b=e.constructor,x=t.constructor;b!=x&&`constructor`in e&&`constructor`in t&&!(typeof b==`function`&&b instanceof b&&typeof x==`function`&&x instanceof x)&&(m=!1)}return o.delete(e),o.delete(t),m}function Ko(e){return Ps(Os(e,n,nc),e+``)}function qo(e){return Ki(e,Od,rs)}function Jo(e){return Ki(e,kd,is)}var Yo=Bn?function(e){return Bn.get(e)}:Gf;function Xo(e){for(var t=e.name+``,n=Yn[t],r=Et.call(Yn,t)?n.length:0;r--;){var i=n[r],a=i.func;if(a==null||a==e)return i.name}return t}function Zo(e){return(Et.call(U,`placeholder`)?U:e).placeholder}function Qo(){var e=U.iteratee||Rf;return e=e===Rf?fa:e,arguments.length?e(arguments[0],arguments[1]):e}function $o(e,t){var n=e.__data__;return _s(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function es(e){for(var t=Od(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Ss(i)]}return t}function ts(e,t){var r=dr(e,t);return ca(r)?r:n}function ns(e){var t=Et.call(e,Ut),r=e[Ut];try{e[Ut]=n;var i=!0}catch{}var a=kt.call(e);return i&&(t?e[Ut]=r:delete e[Ut]),a}var rs=Xt?function(e){return e==null?[]:(e=_t(e),jn(Xt(e),function(t){return zt.call(e,t)}))}:ep,is=Xt?function(e){for(var t=[];e;)Fn(t,rs(e)),e=Lt(e);return t}:ep,as=qi;(mn&&as(new mn(new ArrayBuffer(1)))!=De||gn&&as(new gn)!=me||_n&&as(_n.resolve())!=ve||yn&&as(new yn)!=xe||bn&&as(new bn)!=Te)&&(as=function(e){var t=qi(e),r=t==_e?e.constructor:n,i=r?Bs(r):``;if(i)switch(i){case br:return De;case Er:return me;case Dr:return ve;case Ar:return xe;case jr:return Te}return t});function os(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case`drop`:e+=o;break;case`dropRight`:t-=o;break;case`take`:t=cn(t,e+o);break;case`takeRight`:e=nn(e,t-o);break}}return{start:e,end:t}}function ss(e){var t=e.match(tt);return t?t[1].split(nt):[]}function cs(e,t,n){t=$a(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=zs(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Au(i)&&ms(o,i)&&(hu(e)||mu(e)))}function ls(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&Et.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function us(e){return typeof e.constructor==`function`&&!xs(e)?Fr(Lt(e)):{}}function ds(e,t,n){var r=e.constructor;switch(t){case L:return io(e);case le:case I:return new r(+e);case De:return ao(e,n);case Oe:case ke:case Ae:case je:case Me:case Ne:case Pe:case Fe:case Ie:return co(e,n);case me:return new r;case he:case Se:return new r(e);case be:return oo(e);case xe:return new r;case Ce:return so(e)}}function fs(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?`& `:``)+t[r],t=t.join(n>2?`, `:` `),e.replace(et,`{
|
|
2
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./get-front-component-build-plugins-Dqpyup2W.js"),t=require("./login-eEfUoaiV.js"),n=require("./isDefined-Dtu5EYqP-Dp026Ry1.js");let r=require("path");r=e.i(r);let i=require("node:fs/promises"),a=require("uuid"),o=require("react");o=e.i(o);let s=require("node:path");s=e.i(s);let c=require("crypto");c=e.i(c);let l=require("node:child_process"),u=require("chalk");u=e.i(u);let d=require("inquirer");d=e.i(d);let f=require("chokidar");f=e.i(f);let p=require("react/jsx-runtime"),m=require("commander"),h=require("util");var g=e=>e&&!e?.startsWith(`/`)?(0,r.join)(t.Et,e):e,_=(e,t)=>t!==void 0&&t.length>0?`${t}${e}`:e,v=e=>e.replace(/\s+/g,` `).trim(),y=async e=>{let n=(0,r.join)(e,`package.json`);if(await t.lt(n))try{let e=await(0,i.readFile)(n,`utf-8`),t=JSON.parse(e);return t.dependencies?.[`twenty-sdk`]??t.devDependencies?.[`twenty-sdk`]??void 0}catch{return}},b=e=>{let t=e.match(/(\d+)\./);if(t)return parseInt(t[1],10);let n=e.match(/^[~^>=<]*(\d+)$/);return n?parseInt(n[1],10):null},x=async e=>{let n=t.I.version,r=await y(e);if(!n||!r)return;let i=b(n),a=b(r);i===null||a===null||i!==a&&(console.warn(u.default.yellow(`⚠ Version mismatch: your app requires twenty-sdk@${a}.x but the CLI running is v${n}. Major version mismatches may cause unexpected behavior.\n Update with: npm install -g twenty-sdk@${a}`)),console.warn(``))},S=class{async execute(e){e.private?await this.executePrivate(e):await this.executeNpm(e)}async executeNpm(e){let n=e.appPath??t.Et;await x(n),console.log(u.default.blue(`Publishing to npm...`)),console.log(u.default.gray(`App path: ${n}\n`));let r=await t.L({appPath:n,npmTag:e.tag,onProgress:e=>console.log(u.default.gray(e))});r.success||(console.error(u.default.red(r.error.message)),process.exit(1)),console.log(u.default.green(`✓ Published to npm successfully`))}async executePrivate(e){let n=e.appPath??t.Et;await x(n);let i=e.remote??t.U.getActiveRemote();console.log(u.default.blue(`Deploying application on ${i}...`)),console.log(u.default.gray(`App path: ${n}\n`));let a=e=>console.log(u.default.gray(e)),o=await t.G({appPath:n,tarball:!0,onProgress:a});o.success||(console.error(u.default.red(o.error.message)),process.exit(1));let s=await t.R({tarballPath:o.data.tarballPath,remote:e.remote,onProgress:a});s.success||(console.error(u.default.red(s.error.message)),process.exit(1));let c=await t.ut(r.default.join(n,`package.json`)).catch(()=>void 0),l=c?.name??s.data.name,d=c?.version??`unknown`;console.log(u.default.green(`\n✓ Published ${l} v${d} to ${i}\n`)),console.log(" To install deployed application: `yarn twenty app:install`")}},C=class{async execute(e){let n=e.appPath??t.Et;await x(n),await t.y();let r=e.remote??t.U.getActiveRemote();console.log(u.default.blue(`Installing application on ${r}...`)),console.log(u.default.gray(`App path: ${n}\n`));let i=await t.N({appPath:n,remote:e.remote});i.success||(console.error(u.default.red(i.error.message)),process.exit(1)),console.log(u.default.green(`✓ Application installed`))}},w=class{async execute({appPath:e=t.Et,askForConfirmation:n}){let r=t.U.getActiveRemote();console.log(u.default.blue(`🚀 Uninstall Twenty Application on ${r}`)),console.log(u.default.gray(`📁 App Path: ${e}\n`)),n&&!await this.confirmationPrompt()&&(console.error(u.default.red(`⛔️ Aborting uninstall`)),process.exit(1));let i=await t.v({appPath:e});return i.success?(console.log(u.default.green(`✅ Application uninstalled successfully`)),{success:!0,data:void 0}):(console.error(u.default.red(`❌ Uninstall failed:`),i.error.message),{success:!1,error:i.error.message})}async confirmationPrompt(){let{confirmation:e}=await d.default.prompt([{type:`confirm`,name:`confirmation`,message:`Are you sure you want to uninstall this application?`,default:!1}]);return e}},T=e=>{let t=new S,n=new C,r=new w;e.command(`app:publish [appPath]`).description(`Build and publish to npm (default) or server registry`).option(`--private`,`Push to a Twenty server's registry instead of npm`).option(`-r, --remote <name>`,`Publish to a specific remote (with --private)`).option(`--tag <tag>`,`npm dist-tag (e.g. beta, next)`).action(async(e,n)=>{await t.execute({appPath:g(e),private:n.private,remote:n.remote,tag:n.tag})}),e.command(`app:install [appPath]`).description(`Install a deployed app on the server`).option(`-r, --remote <name>`,`Install on a specific remote`).action(async(e,t)=>{await n.execute({appPath:g(e),remote:t.remote})}),e.command(`app:uninstall [appPath]`).description(`Uninstall app from server`).option(`-y, --yes`,`Skip confirmation prompt`).action(async(e,t)=>{try{let n=await r.execute({appPath:g(e),askForConfirmation:!t?.yes});process.exit(+!n.success)}catch{process.exit(1)}})},E=[`src/application.config.ts`,`src/application-config.ts`,`src/applicationConfig.ts`],D=async e=>{for(let n of E){let i=(0,r.join)(e,n);if(await t.lt(i))return i}return null},O=async e=>{let n=await D(e);if(n===null)throw Error(`Could not find the application config file (expected one of: ${E.join(`, `)}). Create it with defineApplication({ universalIdentifier: ... }) before generating entities.`);let{config:r}=await t.et({appPath:e,filePath:n});if(!r?.universalIdentifier)throw Error(`defineApplication in ${n} must declare a universalIdentifier before generating entities.`);return r.universalIdentifier},ee=e.n(((e,t)=>{(function(){var n,r=`4.18.1`,i=200,a=`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`,o=`Expected a function`,s="Invalid `variable` option passed into `_.template`",c="Invalid `imports` option passed into `_.template`",l=`__lodash_hash_undefined__`,u=500,d=`__lodash_placeholder__`,f=1,p=2,m=4,h=1,g=2,_=1,v=2,y=4,b=8,x=16,S=32,C=64,w=128,T=256,E=512,D=30,O=`...`,ee=800,k=16,te=1,ne=2,re=3,A=1/0,j=9007199254740991,M=17976931348623157e292,N=NaN,P=4294967295,F=P-1,ie=P>>>1,ae=[[`ary`,w],[`bind`,_],[`bindKey`,v],[`curry`,b],[`curryRight`,x],[`flip`,E],[`partial`,S],[`partialRight`,C],[`rearg`,T]],oe=`[object Arguments]`,se=`[object Array]`,ce=`[object AsyncFunction]`,le=`[object Boolean]`,I=`[object Date]`,ue=`[object DOMException]`,de=`[object Error]`,fe=`[object Function]`,pe=`[object GeneratorFunction]`,me=`[object Map]`,he=`[object Number]`,ge=`[object Null]`,_e=`[object Object]`,ve=`[object Promise]`,ye=`[object Proxy]`,be=`[object RegExp]`,xe=`[object Set]`,Se=`[object String]`,Ce=`[object Symbol]`,we=`[object Undefined]`,Te=`[object WeakMap]`,Ee=`[object WeakSet]`,L=`[object ArrayBuffer]`,De=`[object DataView]`,Oe=`[object Float32Array]`,ke=`[object Float64Array]`,Ae=`[object Int8Array]`,je=`[object Int16Array]`,Me=`[object Int32Array]`,Ne=`[object Uint8Array]`,Pe=`[object Uint8ClampedArray]`,Fe=`[object Uint16Array]`,Ie=`[object Uint32Array]`,Le=/\b__p \+= '';/g,Re=/\b(__p \+=) '' \+/g,ze=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Be=/&(?:amp|lt|gt|quot|#39);/g,Ve=/[&<>"']/g,He=RegExp(Be.source),Ue=RegExp(Ve.source),We=/<%-([\s\S]+?)%>/g,Ge=/<%([\s\S]+?)%>/g,Ke=/<%=([\s\S]+?)%>/g,qe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Je=/^\w*$/,Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/[\\^$.*+?()[\]{}|]/g,Ze=RegExp(Xe.source),Qe=/^\s+/,$e=/\s/,et=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,tt=/\{\n\/\* \[wrapped with (.+)\] \*/,nt=/,? & /,rt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,it=/[()=,{}\[\]\/\s]/,at=/\\(\\)?/g,ot=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,st=/\w*$/,ct=/^[-+]0x[0-9a-f]+$/i,lt=/^0b[01]+$/i,ut=/^\[object .+?Constructor\]$/,R=/^0o[0-7]+$/i,dt=/^(?:0|[1-9]\d*)$/,z=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ft=/($^)/,pt=/['\n\r\u2028\u2029\\]/g,mt=`\\ud800-\\udfff`,ht=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,gt=`\\u2700-\\u27bf`,_t=`a-z\\xdf-\\xf6\\xf8-\\xff`,vt=`\\xac\\xb1\\xd7\\xf7`,yt=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,bt=`\\u2000-\\u206f`,xt=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,St=`A-Z\\xc0-\\xd6\\xd8-\\xde`,Ct=`\\ufe0e\\ufe0f`,wt=vt+yt+bt+xt,Tt=`['’]`,Et=`[`+mt+`]`,Dt=`[`+wt+`]`,Ot=`[`+ht+`]`,kt=`\\d+`,At=`[`+gt+`]`,jt=`[`+_t+`]`,Mt=`[^`+mt+wt+kt+gt+_t+St+`]`,Nt=`\\ud83c[\\udffb-\\udfff]`,Pt=`(?:`+Ot+`|`+Nt+`)`,Ft=`[^`+mt+`]`,It=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Lt=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Rt=`[`+St+`]`,zt=`\\u200d`,Bt=`(?:`+jt+`|`+Mt+`)`,Vt=`(?:`+Rt+`|`+Mt+`)`,Ht=`(?:`+Tt+`(?:d|ll|m|re|s|t|ve))?`,Ut=`(?:`+Tt+`(?:D|LL|M|RE|S|T|VE))?`,Wt=Pt+`?`,Gt=`[`+Ct+`]?`,Kt=`(?:`+zt+`(?:`+[Ft,It,Lt].join(`|`)+`)`+Gt+Wt+`)*`,qt=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,Jt=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,Yt=Gt+Wt+Kt,Xt=`(?:`+[At,It,Lt].join(`|`)+`)`+Yt,Zt=`(?:`+[Ft+Ot+`?`,Ot,It,Lt,Et].join(`|`)+`)`,B=RegExp(Tt,`g`),Qt=RegExp(Ot,`g`),$t=RegExp(Nt+`(?=`+Nt+`)|`+Zt+Yt,`g`),en=RegExp([Rt+`?`+jt+`+`+Ht+`(?=`+[Dt,Rt,`$`].join(`|`)+`)`,Vt+`+`+Ut+`(?=`+[Dt,Rt+Bt,`$`].join(`|`)+`)`,Rt+`?`+Bt+`+`+Ht,Rt+`+`+Ut,Jt,qt,kt,Xt].join(`|`),`g`),tn=RegExp(`[`+zt+mt+ht+Ct+`]`),nn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rn=`Array.Buffer.DataView.Date.Error.Float32Array.Float64Array.Function.Int8Array.Int16Array.Int32Array.Map.Math.Object.Promise.RegExp.Set.String.Symbol.TypeError.Uint8Array.Uint8ClampedArray.Uint16Array.Uint32Array.WeakMap._.clearTimeout.isFinite.parseInt.setTimeout`.split(`.`),an=-1,on={};on[Oe]=on[ke]=on[Ae]=on[je]=on[Me]=on[Ne]=on[Pe]=on[Fe]=on[Ie]=!0,on[oe]=on[se]=on[L]=on[le]=on[De]=on[I]=on[de]=on[fe]=on[me]=on[he]=on[_e]=on[be]=on[xe]=on[Se]=on[Te]=!1;var sn={};sn[oe]=sn[se]=sn[L]=sn[De]=sn[le]=sn[I]=sn[Oe]=sn[ke]=sn[Ae]=sn[je]=sn[Me]=sn[me]=sn[he]=sn[_e]=sn[be]=sn[xe]=sn[Se]=sn[Ce]=sn[Ne]=sn[Pe]=sn[Fe]=sn[Ie]=!0,sn[de]=sn[fe]=sn[Te]=!1;var cn={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`s`},ln={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},un={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`},dn={"\\":`\\`,"'":`'`,"\n":`n`,"\r":`r`,"\u2028":`u2028`,"\u2029":`u2029`},fn=parseFloat,pn=parseInt,V=typeof global==`object`&&global&&global.Object===Object&&global,mn=typeof self==`object`&&self&&self.Object===Object&&self,hn=V||mn||Function(`return this`)(),gn=typeof e==`object`&&e&&!e.nodeType&&e,_n=gn&&typeof t==`object`&&t&&!t.nodeType&&t,vn=_n&&_n.exports===gn,yn=vn&&V.process,bn=function(){try{return _n&&_n.require&&_n.require(`util`).types||yn&&yn.binding&&yn.binding(`util`)}catch{}}(),xn=bn&&bn.isArrayBuffer,Sn=bn&&bn.isDate,Cn=bn&&bn.isMap,wn=bn&&bn.isRegExp,Tn=bn&&bn.isSet,En=bn&&bn.isTypedArray;function Dn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function On(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function H(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function kn(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}function An(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function jn(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function Mn(e,t){return!!(e!=null&&e.length)&&Wn(e,t,0)>-1}function Nn(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Pn(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Fn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function In(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Ln(e,t,n,r){var i=e==null?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Rn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var zn=Jn(`length`);function Bn(e){return e.split(``)}function Vn(e){return e.match(rt)||[]}function Hn(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Un(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function Wn(e,t,n){return t===t?br(e,t,n):Un(e,Kn,n)}function Gn(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function Kn(e){return e!==e}function qn(e,t){var n=e==null?0:e.length;return n?Qn(e,t)/n:N}function Jn(e){return function(t){return t==null?n:t[e]}}function Yn(e){return function(t){return e==null?n:e[t]}}function Xn(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function Zn(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Qn(e,t){for(var r,i=-1,a=e.length;++i<a;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function $n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function er(e,t){return Pn(t,function(t){return[t,e[t]]})}function tr(e){return e&&e.slice(0,wr(e)+1).replace(Qe,``)}function nr(e){return function(t){return e(t)}}function rr(e,t){return Pn(t,function(t){return e[t]})}function ir(e,t){return e.has(t)}function ar(e,t){for(var n=-1,r=e.length;++n<r&&Wn(t,e[n],0)>-1;);return n}function or(e,t){for(var n=e.length;n--&&Wn(t,e[n],0)>-1;);return n}function sr(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var cr=Yn(cn),lr=Yn(ln);function ur(e){return`\\`+dn[e]}function dr(e,t){return e==null?n:e[t]}function fr(e){return tn.test(e)}function pr(e){return nn.test(e)}function mr(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function hr(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function gr(e,t){return function(n){return e(t(n))}}function _r(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n];(o===t||o===d)&&(e[n]=d,a[i++]=n)}return a}function vr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function yr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function br(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function xr(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function Sr(e){return fr(e)?Er(e):zn(e)}function Cr(e){return fr(e)?Dr(e):Bn(e)}function wr(e){for(var t=e.length;t--&&$e.test(e.charAt(t)););return t}var Tr=Yn(un);function Er(e){for(var t=$t.lastIndex=0;$t.test(e);)++t;return t}function Dr(e){return e.match($t)||[]}function Or(e){return e.match(en)||[]}var kr=(function e(t){t=t==null?hn:kr.defaults(hn.Object(),t,kr.pick(hn,rn));var $e=t.Array,rt=t.Date,mt=t.Error,ht=t.Function,gt=t.Math,_t=t.Object,vt=t.RegExp,yt=t.String,bt=t.TypeError,xt=$e.prototype,St=ht.prototype,Ct=_t.prototype,wt=t[`__core-js_shared__`],Tt=St.toString,Et=Ct.hasOwnProperty,Dt=0,Ot=function(){var e=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),kt=Ct.toString,At=Tt.call(_t),jt=hn._,Mt=vt(`^`+Tt.call(Et).replace(Xe,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Nt=vn?t.Buffer:n,Pt=t.Symbol,Ft=t.Uint8Array,It=Nt?Nt.allocUnsafe:n,Lt=gr(_t.getPrototypeOf,_t),Rt=_t.create,zt=Ct.propertyIsEnumerable,Bt=xt.splice,Vt=Pt?Pt.isConcatSpreadable:n,Ht=Pt?Pt.iterator:n,Ut=Pt?Pt.toStringTag:n,Wt=function(){try{var e=ts(_t,`defineProperty`);return e({},``,{}),e}catch{}}(),Gt=t.clearTimeout!==hn.clearTimeout&&t.clearTimeout,Kt=rt&&rt.now!==hn.Date.now&&rt.now,qt=t.setTimeout!==hn.setTimeout&&t.setTimeout,Jt=gt.ceil,Yt=gt.floor,Xt=_t.getOwnPropertySymbols,Zt=Nt?Nt.isBuffer:n,$t=t.isFinite,en=xt.join,tn=gr(_t.keys,_t),nn=gt.max,cn=gt.min,ln=rt.now,un=t.parseInt,dn=gt.random,V=xt.reverse,mn=ts(t,`DataView`),gn=ts(t,`Map`),_n=ts(t,`Promise`),yn=ts(t,`Set`),bn=ts(t,`WeakMap`),zn=ts(_t,`create`),Bn=bn&&new bn,Yn={},br=Bs(mn),Er=Bs(gn),Dr=Bs(_n),Ar=Bs(yn),jr=Bs(bn),Mr=Pt?Pt.prototype:n,Nr=Mr?Mr.valueOf:n,Pr=Mr?Mr.toString:n;function U(e){if(Mu(e)&&!hu(e)&&!(e instanceof Rr)){if(e instanceof Lr)return e;if(Et.call(e,`__wrapped__`))return Hs(e)}return new Lr(e)}var Fr=function(){function e(){}return function(t){if(!ju(t))return{};if(Rt)return Rt(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Ir(){}function Lr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}U.templateSettings={escape:We,evaluate:Ge,interpolate:Ke,variable:``,imports:{_:U}},U.prototype=Ir.prototype,U.prototype.constructor=U,Lr.prototype=Fr(Ir.prototype),Lr.prototype.constructor=Lr;function Rr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=P,this.__views__=[]}function zr(){var e=new Rr(this.__wrapped__);return e.__actions__=mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mo(this.__views__),e}function Br(){if(this.__filtered__){var e=new Rr(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Vr(){var e=this.__wrapped__.value(),t=this.__dir__,n=hu(e),r=t<0,i=n?e.length:0,a=os(0,i,this.__views__),o=a.start,s=a.end,c=s-o,l=r?s:o-1,u=this.__iteratees__,d=u.length,f=0,p=cn(c,this.__takeCount__);if(!n||!r&&i==c&&p==c)return Ja(e,this.__actions__);var m=[];outer:for(;c--&&f<p;){l+=t;for(var h=-1,g=e[l];++h<d;){var _=u[h],v=_.iteratee,y=_.type,b=v(g);if(y==ne)g=b;else if(!b){if(y==te)continue outer;break outer}}m[f++]=g}return m}Rr.prototype=Fr(Ir.prototype),Rr.prototype.constructor=Rr;function Hr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ur(){this.__data__=zn?zn(null):{},this.size=0}function Wr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function Gr(e){var t=this.__data__;if(zn){var r=t[e];return r===l?n:r}return Et.call(t,e)?t[e]:n}function Kr(e){var t=this.__data__;return zn?t[e]!==n:Et.call(t,e)}function qr(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=zn&&t===n?l:t,this}Hr.prototype.clear=Ur,Hr.prototype.delete=Wr,Hr.prototype.get=Gr,Hr.prototype.has=Kr,Hr.prototype.set=qr;function Jr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yr(){this.__data__=[],this.size=0}function Xr(e){var t=this.__data__,n=xi(t,e);return n<0?!1:(n==t.length-1?t.pop():Bt.call(t,n,1),--this.size,!0)}function Zr(e){var t=this.__data__,r=xi(t,e);return r<0?n:t[r][1]}function Qr(e){return xi(this.__data__,e)>-1}function $r(e,t){var n=this.__data__,r=xi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}Jr.prototype.clear=Yr,Jr.prototype.delete=Xr,Jr.prototype.get=Zr,Jr.prototype.has=Qr,Jr.prototype.set=$r;function ei(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ti(){this.size=0,this.__data__={hash:new Hr,map:new(gn||Jr),string:new Hr}}function ni(e){var t=$o(this,e).delete(e);return this.size-=+!!t,t}function ri(e){return $o(this,e).get(e)}function ii(e){return $o(this,e).has(e)}function ai(e,t){var n=$o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}ei.prototype.clear=ti,ei.prototype.delete=ni,ei.prototype.get=ri,ei.prototype.has=ii,ei.prototype.set=ai;function oi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ei;++t<n;)this.add(e[t])}function si(e){return this.__data__.set(e,l),this}function ci(e){return this.__data__.has(e)}oi.prototype.add=oi.prototype.push=si,oi.prototype.has=ci;function li(e){var t=this.__data__=new Jr(e);this.size=t.size}function ui(){this.__data__=new Jr,this.size=0}function di(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function fi(e){return this.__data__.get(e)}function pi(e){return this.__data__.has(e)}function mi(e,t){var n=this.__data__;if(n instanceof Jr){var r=n.__data__;if(!gn||r.length<i-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ei(r)}return n.set(e,t),this.size=n.size,this}li.prototype.clear=ui,li.prototype.delete=di,li.prototype.get=fi,li.prototype.has=pi,li.prototype.set=mi;function hi(e,t){var n=hu(e),r=!n&&mu(e),i=!n&&!r&&bu(e),a=!n&&!r&&!i&&qu(e),o=n||r||i||a,s=o?$n(e.length,yt):[],c=s.length;for(var l in e)(t||Et.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||ms(l,c)))&&s.push(l);return s}function gi(e){var t=e.length;return t?e[Oa(0,t-1)]:n}function _i(e,t){return Ls(mo(e),Di(t,0,e.length))}function vi(e){return Ls(mo(e))}function yi(e,t,r){(r!==n&&!du(e[t],r)||r===n&&!(t in e))&&Ti(e,t,r)}function bi(e,t,r){var i=e[t];(!(Et.call(e,t)&&du(i,r))||r===n&&!(t in e))&&Ti(e,t,r)}function xi(e,t){for(var n=e.length;n--;)if(du(e[n][0],t))return n;return-1}function Si(e,t,n,r){return Ni(e,function(e,i,a){t(r,e,n(e),a)}),r}function Ci(e,t){return e&&ho(t,Od(t),e)}function wi(e,t){return e&&ho(t,kd(t),e)}function Ti(e,t,n){t==`__proto__`&&Wt?Wt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ei(e,t){for(var r=-1,i=t.length,a=$e(i),o=e==null;++r<i;)a[r]=o?n:Sd(e,t[r]);return a}function Di(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function Oi(e,t,r,i,a,o){var s,c=t&f,l=t&p,u=t&m;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!ju(e))return e;var d=hu(e);if(d){if(s=ls(e),!c)return mo(e,s)}else{var h=as(e),g=h==fe||h==pe;if(bu(e))return ro(e,c);if(h==_e||h==oe||g&&!a){if(s=l||g?{}:us(e),!c)return l?_o(e,wi(s,e)):go(e,Ci(s,e))}else{if(!sn[h])return a?e:{};s=ds(e,h,c)}}o||=new li;var _=o.get(e);if(_)return _;o.set(e,s),Wu(e)?e.forEach(function(n){s.add(Oi(n,t,r,n,e,o))}):Nu(e)&&e.forEach(function(n,i){s.set(i,Oi(n,t,r,i,e,o))});var v=d?n:(u?l?Jo:qo:l?kd:Od)(e);return H(v||e,function(n,i){v&&(i=n,n=e[i]),bi(s,i,Oi(n,t,r,i,e,o))}),s}function ki(e){var t=Od(e);return function(n){return Ai(n,e,t)}}function Ai(e,t,r){var i=r.length;if(e==null)return!i;for(e=_t(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function ji(e,t,r){if(typeof e!=`function`)throw new bt(o);return Ns(function(){e.apply(n,r)},t)}function Mi(e,t,n,r){var a=-1,o=Mn,s=!0,c=e.length,l=[],u=t.length;if(!c)return l;n&&(t=Pn(t,nr(n))),r?(o=Nn,s=!1):t.length>=i&&(o=ir,s=!1,t=new oi(t));outer:for(;++a<c;){var d=e[a],f=n==null?d:n(d);if(d=r||d!==0?d:0,s&&f===f){for(var p=u;p--;)if(t[p]===f)continue outer;l.push(d)}else o(t,f,r)||l.push(d)}return l}var Ni=bo(Hi),Pi=bo(Ui,!0);function Fi(e,t){var n=!0;return Ni(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function Ii(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===n?s===s&&!Ku(s):r(s,c)))var c=s,l=o}return l}function Li(e,t,r,i){var a=e.length;for(r=td(r),r<0&&(r=-r>a?0:a+r),i=i===n||i>a?a:td(i),i<0&&(i+=a),i=r>i?0:nd(i);r<i;)e[r++]=t;return e}function Ri(e,t){var n=[];return Ni(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function zi(e,t,n,r,i){var a=-1,o=e.length;for(n||=ps,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?zi(s,t-1,n,r,i):Fn(i,s):r||(i[i.length]=s)}return i}var Bi=xo(),Vi=xo(!0);function Hi(e,t){return e&&Bi(e,t,Od)}function Ui(e,t){return e&&Vi(e,t,Od)}function Wi(e,t){return jn(t,function(t){return Ou(e[t])})}function Gi(e,t){t=$a(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[zs(t[r++])];return r&&r==i?e:n}function Ki(e,t,n){var r=t(e);return hu(e)?r:Fn(r,n(e))}function qi(e){return e==null?e===n?we:ge:Ut&&Ut in _t(e)?ns(e):Ds(e)}function Ji(e,t){return e>t}function Yi(e,t){return e!=null&&Et.call(e,t)}function Xi(e,t){return e!=null&&t in _t(e)}function Zi(e,t,n){return e>=cn(t,n)&&e<nn(t,n)}function Qi(e,t,r){for(var i=r?Nn:Mn,a=e[0].length,o=e.length,s=o,c=$e(o),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Pn(d,nr(t))),l=cn(d.length,l),c[s]=!r&&(t||a>=120&&d.length>=120)?new oi(s&&d):n}d=e[0];var f=-1,p=c[0];outer:for(;++f<a&&u.length<l;){var m=d[f],h=t?t(m):m;if(m=r||m!==0?m:0,!(p?ir(p,h):i(u,h,r))){for(s=o;--s;){var g=c[s];if(!(g?ir(g,h):i(e[s],h,r)))continue outer}p&&p.push(h),u.push(m)}}return u}function $i(e,t,n,r){return Hi(e,function(e,i,a){t(r,n(e),i,a)}),r}function ea(e,t,r){t=$a(t,e),e=ks(e,t);var i=e==null?e:e[zs(pc(t))];return i==null?n:Dn(i,e,r)}function ta(e){return Mu(e)&&qi(e)==oe}function na(e){return Mu(e)&&qi(e)==L}function ra(e){return Mu(e)&&qi(e)==I}function ia(e,t,n,r,i){return e===t?!0:e==null||t==null||!Mu(e)&&!Mu(t)?e!==e&&t!==t:aa(e,t,n,r,ia,i)}function aa(e,t,n,r,i,a){var o=hu(e),s=hu(t),c=o?se:as(e),l=s?se:as(t);c=c==oe?_e:c,l=l==oe?_e:l;var u=c==_e,d=l==_e,f=c==l;if(f&&bu(e)){if(!bu(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new li,o||qu(e)?Uo(e,t,n,r,i,a):Wo(e,t,c,n,r,i,a);if(!(n&h)){var p=u&&Et.call(e,`__wrapped__`),m=d&&Et.call(t,`__wrapped__`);if(p||m){var g=p?e.value():e,_=m?t.value():t;return a||=new li,i(g,_,n,r,a)}}return f?(a||=new li,Go(e,t,n,r,i,a)):!1}function oa(e){return Mu(e)&&as(e)==me}function sa(e,t,r,i){var a=r.length,o=a,s=!i;if(e==null)return!o;for(e=_t(e);a--;){var c=r[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){c=r[a];var l=c[0],u=e[l],d=c[1];if(s&&c[2]){if(u===n&&!(l in e))return!1}else{var f=new li;if(i)var p=i(u,d,l,e,t,f);if(!(p===n?ia(d,u,h|g,i,f):p))return!1}}return!0}function ca(e){return!ju(e)||ys(e)?!1:(Ou(e)?Mt:ut).test(Bs(e))}function la(e){return Mu(e)&&qi(e)==be}function ua(e){return Mu(e)&&as(e)==xe}function da(e){return Mu(e)&&Au(e.length)&&!!on[qi(e)]}function fa(e){return typeof e==`function`?e:e==null?Lf:typeof e==`object`?hu(e)?va(e[0],e[1]):_a(e):Xf(e)}function pa(e){if(!xs(e))return tn(e);var t=[];for(var n in _t(e))Et.call(e,n)&&n!=`constructor`&&t.push(n);return t}function ma(e){if(!ju(e))return Es(e);var t=xs(e),n=[];for(var r in e)r==`constructor`&&(t||!Et.call(e,r))||n.push(r);return n}function ha(e,t){return e<t}function ga(e,t){var n=-1,r=_u(e)?$e(e.length):[];return Ni(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function _a(e){var t=es(e);return t.length==1&&t[0][2]?Cs(t[0][0],t[0][1]):function(n){return n===e||sa(n,e,t)}}function va(e,t){return gs(e)&&Ss(t)?Cs(zs(e),t):function(r){var i=Sd(r,e);return i===n&&i===t?wd(r,e):ia(t,i,h|g)}}function ya(e,t,r,i,a){e!==t&&Bi(t,function(o,s){if(a||=new li,ju(o))ba(e,t,s,r,ya,i,a);else{var c=i?i(js(e,s),o,s+``,e,t,a):n;c===n&&(c=o),yi(e,s,c)}},kd)}function ba(e,t,r,i,a,o,s){var c=js(e,r),l=js(t,r),u=s.get(l);if(u){yi(e,r,u);return}var d=o?o(c,l,r+``,e,t,s):n,f=d===n;if(f){var p=hu(l),m=!p&&bu(l),h=!p&&!m&&qu(l);d=l,p||m||h?hu(c)?d=c:vu(c)?d=mo(c):m?(f=!1,d=ro(l,!0)):h?(f=!1,d=co(l,!0)):d=[]:Vu(l)||mu(l)?(d=c,mu(c)?d=id(c):(!ju(c)||Ou(c))&&(d=us(l))):f=!1}f&&(s.set(l,d),a(d,l,i,o,s),s.delete(l)),yi(e,r,d)}function xa(e,t){var r=e.length;if(r)return t+=t<0?r:0,ms(t,r)?e[t]:n}function Sa(e,t,n){t=t.length?Pn(t,function(e){return hu(e)?function(t){return Gi(t,e.length===1?e[0]:e)}:e}):[Lf];var r=-1;return t=Pn(t,nr(Qo())),Zn(ga(e,function(e,n,i){return{criteria:Pn(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return uo(e,t,n)})}function Ca(e,t){return wa(e,t,function(t,n){return wd(e,n)})}function wa(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=Gi(e,o);n(s,o)&&Pa(a,$a(o,e),s)}return a}function Ta(e){return function(t){return Gi(t,e)}}function Ea(e,t,n,r){var i=r?Gn:Wn,a=-1,o=t.length,s=e;for(e===t&&(t=mo(t)),n&&(s=Pn(e,nr(n)));++a<o;)for(var c=0,l=t[a],u=n?n(l):l;(c=i(s,u,c,r))>-1;)s!==e&&Bt.call(s,c,1),Bt.call(e,c,1);return e}function Da(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;ms(i)?Bt.call(e,i,1):Ga(e,i)}}return e}function Oa(e,t){return e+Yt(dn()*(t-e+1))}function ka(e,t,n,r){for(var i=-1,a=nn(Jt((t-e)/(n||1)),0),o=$e(a);a--;)o[r?a:++i]=e,e+=n;return o}function Aa(e,t){var n=``;if(!e||t<1||t>j)return n;do t%2&&(n+=e),t=Yt(t/2),t&&(e+=e);while(t);return n}function ja(e,t){return Ps(Os(e,t,Lf),e+``)}function Ma(e){return gi(qd(e))}function Na(e,t){var n=qd(e);return Ls(n,Di(t,0,n.length))}function Pa(e,t,r,i){if(!ju(e))return e;t=$a(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=zs(t[a]),u=r;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];u=i?i(d,l,c):n,u===n&&(u=ju(d)?d:ms(t[a+1])?[]:{})}bi(c,l,u),c=c[l]}return e}var Fa=Bn?function(e,t){return Bn.set(e,t),e}:Lf,Ia=Wt?function(e,t){return Wt(e,`toString`,{configurable:!0,enumerable:!1,value:Nf(t),writable:!0})}:Lf;function La(e){return Ls(qd(e))}function Ra(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=$e(i);++r<i;)a[r]=e[r+t];return a}function za(e,t){var n;return Ni(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function Ba(e,t,n){var r=0,i=e==null?r:e.length;if(typeof t==`number`&&t===t&&i<=ie){for(;r<i;){var a=r+i>>>1,o=e[a];o!==null&&!Ku(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return Va(e,t,Lf,n)}function Va(e,t,r,i){var a=0,o=e==null?0:e.length;if(o===0)return 0;t=r(t);for(var s=t!==t,c=t===null,l=Ku(t),u=t===n;a<o;){var d=Yt((a+o)/2),f=r(e[d]),p=f!==n,m=f===null,h=f===f,g=Ku(f);if(s)var _=i||h;else _=u?h&&(i||p):c?h&&p&&(i||!m):l?h&&p&&!m&&(i||!g):m||g?!1:i?f<=t:f<t;_?a=d+1:o=d}return cn(o,F)}function W(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!du(s,c)){var c=s;a[i++]=o===0?0:o}}return a}function Ha(e){return typeof e==`number`?e:Ku(e)?N:+e}function Ua(e){if(typeof e==`string`)return e;if(hu(e))return Pn(e,Ua)+``;if(Ku(e))return Pr?Pr.call(e):``;var t=e+``;return t==`0`&&1/e==-A?`-0`:t}function Wa(e,t,n){var r=-1,a=Mn,o=e.length,s=!0,c=[],l=c;if(n)s=!1,a=Nn;else if(o>=i){var u=t?null:Lo(e);if(u)return vr(u);s=!1,a=ir,l=new oi}else l=t?[]:c;outer:for(;++r<o;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,s&&f===f){for(var p=l.length;p--;)if(l[p]===f)continue outer;t&&l.push(f),c.push(d)}else a(l,f,n)||(l!==c&&l.push(f),c.push(d))}return c}function Ga(e,t){t=$a(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=zs(t[n]);if(i===`__proto__`&&!Et.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=ks(e,t);return a==null||delete a[zs(pc(t))]}function Ka(e,t,n,r){return Pa(e,t,n(Gi(e,t)),r)}function qa(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?Ra(e,r?0:a,r?a+1:i):Ra(e,r?a+1:0,r?i:a)}function Ja(e,t){var n=e;return n instanceof Rr&&(n=n.value()),In(t,function(e,t){return t.func.apply(t.thisArg,Fn([e],t.args))},n)}function Ya(e,t,n){var r=e.length;if(r<2)return r?Wa(e[0]):[];for(var i=-1,a=$e(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=Mi(a[i]||o,e[s],t,n));return Wa(zi(a,1),t,n)}function Xa(e,t,r){for(var i=-1,a=e.length,o=t.length,s={};++i<a;){var c=i<o?t[i]:n;r(s,e[i],c)}return s}function Za(e){return vu(e)?e:[]}function Qa(e){return typeof e==`function`?e:Lf}function $a(e,t){return hu(e)?e:gs(e,t)?[e]:Rs(od(e))}var eo=ja;function to(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Ra(e,t,r)}var no=Gt||function(e){return hn.clearTimeout(e)};function ro(e,t){if(t)return e.slice();var n=e.length,r=It?It(n):new e.constructor(n);return e.copy(r),r}function io(e){var t=new e.constructor(e.byteLength);return new Ft(t).set(new Ft(e)),t}function ao(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function oo(e){var t=new e.constructor(e.source,st.exec(e));return t.lastIndex=e.lastIndex,t}function so(e){return Nr?_t(Nr.call(e)):{}}function co(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function lo(e,t){if(e!==t){var r=e!==n,i=e===null,a=e===e,o=Ku(e),s=t!==n,c=t===null,l=t===t,u=Ku(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}function uo(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=lo(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function fo(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=nn(a-o,0),u=$e(c+l),d=!r;++s<c;)u[s]=t[s];for(;++i<o;)(d||i<a)&&(u[n[i]]=e[i]);for(;l--;)u[s++]=e[i++];return u}function po(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,c=-1,l=t.length,u=nn(a-s,0),d=$e(u+l),f=!r;++i<u;)d[i]=e[i];for(var p=i;++c<l;)d[p+c]=t[c];for(;++o<s;)(f||i<a)&&(d[p+n[o]]=e[i++]);return d}function mo(e,t){var n=-1,r=e.length;for(t||=$e(r);++n<r;)t[n]=e[n];return t}function ho(e,t,r,i){var a=!r;r||={};for(var o=-1,s=t.length;++o<s;){var c=t[o],l=i?i(r[c],e[c],c,r,e):n;l===n&&(l=e[c]),a?Ti(r,c,l):bi(r,c,l)}return r}function go(e,t){return ho(e,rs(e),t)}function _o(e,t){return ho(e,is(e),t)}function vo(e,t){return function(n,r){var i=hu(n)?On:Si,a=t?t():{};return i(n,e,Qo(r,2),a)}}function yo(e){return ja(function(t,r){var i=-1,a=r.length,o=a>1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&typeof o==`function`?(a--,o):n,s&&hs(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=_t(t);++i<a;){var c=r[i];c&&e(t,c,i,o)}return t})}function bo(e,t){return function(n,r){if(n==null)return n;if(!_u(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=_t(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function xo(e){return function(t,n,r){for(var i=-1,a=_t(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function So(e,t,n){var r=t&_,i=To(e);function a(){return(this&&this!==hn&&this instanceof a?i:e).apply(r?n:this,arguments)}return a}function Co(e){return function(t){t=od(t);var r=fr(t)?Cr(t):n,i=r?r[0]:t.charAt(0),a=r?to(r,1).join(``):t.slice(1);return i[e]()+a}}function wo(e){return function(t){return In(Of(ef(t).replace(B,``)),e,``)}}function To(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Fr(e.prototype),r=e.apply(n,t);return ju(r)?r:n}}function Eo(e,t,r){var i=To(e);function a(){for(var o=arguments.length,s=$e(o),c=o,l=Zo(a);c--;)s[c]=arguments[c];var u=o<3&&s[0]!==l&&s[o-1]!==l?[]:_r(s,l);return o-=u.length,o<r?G(e,t,ko,a.placeholder,n,s,u,n,n,r-o):Dn(this&&this!==hn&&this instanceof a?i:e,this,s)}return a}function Do(e){return function(t,r,i){var a=_t(t);if(!_u(t)){var o=Qo(r,3);t=Od(t),r=function(e){return o(a[e],e,a)}}var s=e(t,r,i);return s>-1?a[o?t[s]:s]:n}}function Oo(e){return Ko(function(t){var r=t.length,i=r,a=Lr.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if(typeof s!=`function`)throw new bt(o);if(a&&!c&&Xo(s)==`wrapper`)var c=new Lr([],!0)}for(i=c?i:r;++i<r;){s=t[i];var l=Xo(s),u=l==`wrapper`?Yo(s):n;c=u&&vs(u[0])&&u[1]==(w|b|S|T)&&!u[4].length&&u[9]==1?c[Xo(u[0])].apply(c,u[3]):s.length==1&&vs(s)?c[l]():c.thru(s)}return function(){var e=arguments,n=e[0];if(c&&e.length==1&&hu(n))return c.plant(n).value();for(var i=0,a=r?t[i].apply(this,e):n;++i<r;)a=t[i].call(this,a);return a}})}function ko(e,t,r,i,a,o,s,c,l,u){var d=t&w,f=t&_,p=t&v,m=t&(b|x),h=t&E,g=p?n:To(e);function y(){for(var n=arguments.length,_=$e(n),v=n;v--;)_[v]=arguments[v];if(m)var b=Zo(y),x=sr(_,b);if(i&&(_=fo(_,i,a,m)),o&&(_=po(_,o,s,m)),n-=x,m&&n<u){var S=_r(_,b);return G(e,t,ko,y.placeholder,r,_,S,c,l,u-n)}var C=f?r:this,w=p?C[e]:e;return n=_.length,c?_=As(_,c):h&&n>1&&_.reverse(),d&&l<n&&(_.length=l),this&&this!==hn&&this instanceof y&&(w=g||To(w)),w.apply(C,_)}return y}function Ao(e,t){return function(n,r){return $i(n,e,t(r),{})}}function jo(e,t){return function(r,i){var a;if(r===n&&i===n)return t;if(r!==n&&(a=r),i!==n){if(a===n)return i;typeof r==`string`||typeof i==`string`?(r=Ua(r),i=Ua(i)):(r=Ha(r),i=Ha(i)),a=e(r,i)}return a}}function Mo(e){return Ko(function(t){return t=Pn(t,nr(Qo())),ja(function(n){var r=this;return e(t,function(e){return Dn(e,r,n)})})})}function No(e,t){t=t===n?` `:Ua(t);var r=t.length;if(r<2)return r?Aa(t,e):t;var i=Aa(t,Jt(e/Sr(t)));return fr(t)?to(Cr(i),0,e).join(``):i.slice(0,e)}function Po(e,t,n,r){var i=t&_,a=To(e);function o(){for(var t=-1,s=arguments.length,c=-1,l=r.length,u=$e(l+s),d=this&&this!==hn&&this instanceof o?a:e;++c<l;)u[c]=r[c];for(;s--;)u[c++]=arguments[++t];return Dn(d,i?n:this,u)}return o}function Fo(e){return function(t,r,i){return i&&typeof i!=`number`&&hs(t,r,i)&&(r=i=n),t=ed(t),r===n?(r=t,t=0):r=ed(r),i=i===n?t<r?1:-1:ed(i),ka(t,r,i,e)}}function Io(e){return function(t,n){return typeof t==`string`&&typeof n==`string`||(t=rd(t),n=rd(n)),e(t,n)}}function G(e,t,r,i,a,o,s,c,l,u){var d=t&b,f=d?s:n,p=d?n:s,m=d?o:n,h=d?n:o;t|=d?S:C,t&=~(d?C:S),t&y||(t&=~(_|v));var g=[e,t,a,m,f,h,p,c,l,u],x=r.apply(n,g);return vs(e)&&Ms(x,g),x.placeholder=i,Fs(x,e,t)}function K(e){var t=gt[e];return function(e,n){if(e=rd(e),n=n==null?0:cn(td(n),292),n&&$t(e)){var r=(od(e)+`e`).split(`e`);return r=(od(t(r[0]+`e`+(+r[1]+n)))+`e`).split(`e`),+(r[0]+`e`+(+r[1]-n))}return t(e)}}var Lo=yn&&1/vr(new yn([,-0]))[1]==A?function(e){return new yn(e)}:Gf;function Ro(e){return function(t){var n=as(t);return n==me?hr(t):n==xe?yr(t):er(t,e(t))}}function zo(e,t,r,i,a,s,c,l){var u=t&v;if(!u&&typeof e!=`function`)throw new bt(o);var d=i?i.length:0;if(d||(t&=~(S|C),i=a=n),c=c===n?c:nn(td(c),0),l=l===n?l:td(l),d-=a?a.length:0,t&C){var f=i,p=a;i=a=n}var m=u?n:Yo(e),h=[e,t,r,i,a,f,p,s,c,l];if(m&&Ts(h,m),e=h[0],t=h[1],r=h[2],i=h[3],a=h[4],l=h[9]=h[9]===n?u?0:e.length:nn(h[9]-d,0),!l&&t&(b|x)&&(t&=~(b|x)),!t||t==_)var g=So(e,t,r);else g=t==b||t==x?Eo(e,t,l):(t==S||t==(_|S))&&!a.length?Po(e,t,r,i):ko.apply(n,h);return Fs((m?Fa:Ms)(g,h),e,t)}function Bo(e,t,r,i){return e===n||du(e,Ct[r])&&!Et.call(i,r)?t:e}function Vo(e,t,r,i,a,o){return ju(e)&&ju(t)&&(o.set(t,e),ya(e,t,n,Vo,o),o.delete(t)),e}function Ho(e){return Vu(e)?n:e}function Uo(e,t,r,i,a,o){var s=r&h,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=r&g?new oi:n;for(o.set(e,t),o.set(t,e);++f<c;){var _=e[f],v=t[f];if(i)var y=s?i(v,_,f,t,e,o):i(_,v,f,e,t,o);if(y!==n){if(y)continue;p=!1;break}if(m){if(!Rn(t,function(e,t){if(!ir(m,t)&&(_===e||a(_,e,r,i,o)))return m.push(t)})){p=!1;break}}else if(!(_===v||a(_,v,r,i,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function Wo(e,t,n,r,i,a,o){switch(n){case De:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case L:return!(e.byteLength!=t.byteLength||!a(new Ft(e),new Ft(t)));case le:case I:case he:return du(+e,+t);case de:return e.name==t.name&&e.message==t.message;case be:case Se:return e==t+``;case me:var s=hr;case xe:var c=r&h;if(s||=vr,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=g,o.set(e,t);var u=Uo(s(e),s(t),r,i,a,o);return o.delete(e),u;case Ce:if(Nr)return Nr.call(e)==Nr.call(t)}return!1}function Go(e,t,r,i,a,o){var s=r&h,c=qo(e),l=c.length;if(l!=qo(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:Et.call(t,d)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var g=s;++u<l;){d=c[u];var _=e[d],v=t[d];if(i)var y=s?i(v,_,d,t,e,o):i(_,v,d,e,t,o);if(!(y===n?_===v||a(_,v,r,i,o):y)){m=!1;break}g||=d==`constructor`}if(m&&!g){var b=e.constructor,x=t.constructor;b!=x&&`constructor`in e&&`constructor`in t&&!(typeof b==`function`&&b instanceof b&&typeof x==`function`&&x instanceof x)&&(m=!1)}return o.delete(e),o.delete(t),m}function Ko(e){return Ps(Os(e,n,nc),e+``)}function qo(e){return Ki(e,Od,rs)}function Jo(e){return Ki(e,kd,is)}var Yo=Bn?function(e){return Bn.get(e)}:Gf;function Xo(e){for(var t=e.name+``,n=Yn[t],r=Et.call(Yn,t)?n.length:0;r--;){var i=n[r],a=i.func;if(a==null||a==e)return i.name}return t}function Zo(e){return(Et.call(U,`placeholder`)?U:e).placeholder}function Qo(){var e=U.iteratee||Rf;return e=e===Rf?fa:e,arguments.length?e(arguments[0],arguments[1]):e}function $o(e,t){var n=e.__data__;return _s(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function es(e){for(var t=Od(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Ss(i)]}return t}function ts(e,t){var r=dr(e,t);return ca(r)?r:n}function ns(e){var t=Et.call(e,Ut),r=e[Ut];try{e[Ut]=n;var i=!0}catch{}var a=kt.call(e);return i&&(t?e[Ut]=r:delete e[Ut]),a}var rs=Xt?function(e){return e==null?[]:(e=_t(e),jn(Xt(e),function(t){return zt.call(e,t)}))}:ep,is=Xt?function(e){for(var t=[];e;)Fn(t,rs(e)),e=Lt(e);return t}:ep,as=qi;(mn&&as(new mn(new ArrayBuffer(1)))!=De||gn&&as(new gn)!=me||_n&&as(_n.resolve())!=ve||yn&&as(new yn)!=xe||bn&&as(new bn)!=Te)&&(as=function(e){var t=qi(e),r=t==_e?e.constructor:n,i=r?Bs(r):``;if(i)switch(i){case br:return De;case Er:return me;case Dr:return ve;case Ar:return xe;case jr:return Te}return t});function os(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case`drop`:e+=o;break;case`dropRight`:t-=o;break;case`take`:t=cn(t,e+o);break;case`takeRight`:e=nn(e,t-o);break}}return{start:e,end:t}}function ss(e){var t=e.match(tt);return t?t[1].split(nt):[]}function cs(e,t,n){t=$a(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=zs(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Au(i)&&ms(o,i)&&(hu(e)||mu(e)))}function ls(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&Et.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function us(e){return typeof e.constructor==`function`&&!xs(e)?Fr(Lt(e)):{}}function ds(e,t,n){var r=e.constructor;switch(t){case L:return io(e);case le:case I:return new r(+e);case De:return ao(e,n);case Oe:case ke:case Ae:case je:case Me:case Ne:case Pe:case Fe:case Ie:return co(e,n);case me:return new r;case he:case Se:return new r(e);case be:return oo(e);case xe:return new r;case Ce:return so(e)}}function fs(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?`& `:``)+t[r],t=t.join(n>2?`, `:` `),e.replace(et,`{
|
|
3
3
|
/* [wrapped with `+t+`] */
|
|
4
4
|
`)}function ps(e){return hu(e)||mu(e)||!!(Vt&&e&&e[Vt])}function ms(e,t){var n=typeof e;return t??=j,!!t&&(n==`number`||n!=`symbol`&&dt.test(e))&&e>-1&&e%1==0&&e<t}function hs(e,t,n){if(!ju(n))return!1;var r=typeof t;return(r==`number`?_u(n)&&ms(t,n.length):r==`string`&&t in n)?du(n[t],e):!1}function gs(e,t){if(hu(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Ku(e)?!0:Je.test(e)||!qe.test(e)||t!=null&&e in _t(t)}function _s(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function vs(e){var t=Xo(e),n=U[t];if(typeof n!=`function`||!(t in Rr.prototype))return!1;if(e===n)return!0;var r=Yo(n);return!!r&&e===r[0]}function ys(e){return!!Ot&&Ot in e}var bs=wt?Ou:tp;function xs(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||Ct)}function Ss(e){return e===e&&!ju(e)}function Cs(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==n||e in _t(r))}}function ws(e){var t=ql(e,function(e){return n.size===u&&n.clear(),e}),n=t.cache;return t}function Ts(e,t){var n=e[1],r=t[1],i=n|r,a=i<(_|v|w),o=r==w&&n==b||r==w&&n==T&&e[7].length<=t[8]||r==(w|T)&&t[7].length<=t[8]&&n==b;if(!(a||o))return e;r&_&&(e[2]=t[2],i|=n&_?0:y);var s=t[3];if(s){var c=e[3];e[3]=c?fo(c,s,t[4]):s,e[4]=c?_r(e[3],d):t[4]}return s=t[5],s&&(c=e[5],e[5]=c?po(c,s,t[6]):s,e[6]=c?_r(e[5],d):t[6]),s=t[7],s&&(e[7]=s),r&w&&(e[8]=e[8]==null?t[8]:cn(e[8],t[8])),e[9]??=t[9],e[0]=t[0],e[1]=i,e}function Es(e){var t=[];if(e!=null)for(var n in _t(e))t.push(n);return t}function Ds(e){return kt.call(e)}function Os(e,t,r){return t=nn(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=nn(n.length-t,0),o=$e(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=$e(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),Dn(e,this,s)}}function ks(e,t){return t.length<2?e:Gi(e,Ra(t,0,-1))}function As(e,t){for(var r=e.length,i=cn(t.length,r),a=mo(e);i--;){var o=t[i];e[i]=ms(o,r)?a[o]:n}return e}function js(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}var Ms=Is(Fa),Ns=qt||function(e,t){return hn.setTimeout(e,t)},Ps=Is(Ia);function Fs(e,t,n){var r=t+``;return Ps(e,fs(r,Vs(ss(r),n)))}function Is(e){var t=0,r=0;return function(){var i=ln(),a=k-(i-r);if(r=i,a>0){if(++t>=ee)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ls(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r<t;){var o=Oa(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var Rs=ws(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Ye,function(e,n,r,i){t.push(r?i.replace(at,`$1`):n||e)}),t});function zs(e){if(typeof e==`string`||Ku(e))return e;var t=e+``;return t==`0`&&1/e==-A?`-0`:t}function Bs(e){if(e!=null){try{return Tt.call(e)}catch{}try{return e+``}catch{}}return``}function Vs(e,t){return H(ae,function(n){var r=`_.`+n[0];t&n[1]&&!Mn(e,r)&&e.push(r)}),e.sort()}function Hs(e){if(e instanceof Rr)return e.clone();var t=new Lr(e.__wrapped__,e.__chain__);return t.__actions__=mo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Us(e,t,r){t=(r?hs(e,t,r):t===n)?1:nn(td(t),0);var i=e==null?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=$e(Jt(i/t));a<i;)s[o++]=Ra(e,a,a+=t);return s}function Ws(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}function Gs(){var e=arguments.length;if(!e)return[];for(var t=$e(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Fn(hu(n)?mo(n):[n],zi(t,1))}var Ks=ja(function(e,t){return vu(e)?Mi(e,zi(t,1,vu,!0)):[]}),qs=ja(function(e,t){var r=pc(t);return vu(r)&&(r=n),vu(e)?Mi(e,zi(t,1,vu,!0),Qo(r,2)):[]}),Js=ja(function(e,t){var r=pc(t);return vu(r)&&(r=n),vu(e)?Mi(e,zi(t,1,vu,!0),n,r):[]});function Ys(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:td(t),Ra(e,t<0?0:t,i)):[]}function Xs(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:td(t),t=i-t,Ra(e,0,t<0?0:t)):[]}function Zs(e,t){return e&&e.length?qa(e,Qo(t,3),!0,!0):[]}function Qs(e,t){return e&&e.length?qa(e,Qo(t,3),!0):[]}function $s(e,t,n,r){var i=e==null?0:e.length;return i?(n&&typeof n!=`number`&&hs(e,t,n)&&(n=0,r=i),Li(e,t,n,r)):[]}function ec(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:td(n);return i<0&&(i=nn(r+i,0)),Un(e,Qo(t,3),i)}function tc(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i-1;return r!==n&&(a=td(r),a=r<0?nn(i+a,0):cn(a,i-1)),Un(e,Qo(t,3),a,!0)}function nc(e){return e!=null&&e.length?zi(e,1):[]}function rc(e){return e!=null&&e.length?zi(e,A):[]}function ic(e,t){return e!=null&&e.length?(t=t===n?1:td(t),zi(e,t)):[]}function ac(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];Ti(r,i[0],i[1])}return r}function oc(e){return e&&e.length?e[0]:n}function sc(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:td(n);return i<0&&(i=nn(r+i,0)),Wn(e,t,i)}function cc(e){return e!=null&&e.length?Ra(e,0,-1):[]}var lc=ja(function(e){var t=Pn(e,Za);return t.length&&t[0]===e[0]?Qi(t):[]}),uc=ja(function(e){var t=pc(e),r=Pn(e,Za);return t===pc(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Qi(r,Qo(t,2)):[]}),dc=ja(function(e){var t=pc(e),r=Pn(e,Za);return t=typeof t==`function`?t:n,t&&r.pop(),r.length&&r[0]===e[0]?Qi(r,n,t):[]});function fc(e,t){return e==null?``:en.call(e,t)}function pc(e){var t=e==null?0:e.length;return t?e[t-1]:n}function mc(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i;return r!==n&&(a=td(r),a=a<0?nn(i+a,0):cn(a,i-1)),t===t?xr(e,t,a):Un(e,Kn,a,!0)}function hc(e,t){return e&&e.length?xa(e,td(t)):n}var gc=ja(_c);function _c(e,t){return e&&e.length&&t&&t.length?Ea(e,t):e}function vc(e,t,n){return e&&e.length&&t&&t.length?Ea(e,t,Qo(n,2)):e}function yc(e,t,r){return e&&e.length&&t&&t.length?Ea(e,t,n,r):e}var bc=Ko(function(e,t){var n=e==null?0:e.length,r=Ei(e,t);return Da(e,Pn(t,function(e){return ms(e,n)?+e:e}).sort(lo)),r});function xc(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,i=[],a=e.length;for(t=Qo(t,3);++r<a;){var o=e[r];t(o,r,e)&&(n.push(o),i.push(r))}return Da(e,i),n}function Sc(e){return e==null?e:V.call(e)}function Cc(e,t,r){var i=e==null?0:e.length;return i?(r&&typeof r!=`number`&&hs(e,t,r)?(t=0,r=i):(t=t==null?0:td(t),r=r===n?i:td(r)),Ra(e,t,r)):[]}function wc(e,t){return Ba(e,t)}function Tc(e,t,n){return Va(e,t,Qo(n,2))}function Ec(e,t){var n=e==null?0:e.length;if(n){var r=Ba(e,t);if(r<n&&du(e[r],t))return r}return-1}function Dc(e,t){return Ba(e,t,!0)}function Oc(e,t,n){return Va(e,t,Qo(n,2),!0)}function kc(e,t){if(e!=null&&e.length){var n=Ba(e,t,!0)-1;if(du(e[n],t))return n}return-1}function Ac(e){return e&&e.length?W(e):[]}function jc(e,t){return e&&e.length?W(e,Qo(t,2)):[]}function Mc(e){var t=e==null?0:e.length;return t?Ra(e,1,t):[]}function Nc(e,t,r){return e&&e.length?(t=r||t===n?1:td(t),Ra(e,0,t<0?0:t)):[]}function Pc(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:td(t),t=i-t,Ra(e,t<0?0:t,i)):[]}function Fc(e,t){return e&&e.length?qa(e,Qo(t,3),!1,!0):[]}function Ic(e,t){return e&&e.length?qa(e,Qo(t,3)):[]}var Lc=ja(function(e){return Wa(zi(e,1,vu,!0))}),Rc=ja(function(e){var t=pc(e);return vu(t)&&(t=n),Wa(zi(e,1,vu,!0),Qo(t,2))}),q=ja(function(e){var t=pc(e);return t=typeof t==`function`?t:n,Wa(zi(e,1,vu,!0),n,t)});function zc(e){return e&&e.length?Wa(e):[]}function Bc(e,t){return e&&e.length?Wa(e,Qo(t,2)):[]}function Vc(e,t){return t=typeof t==`function`?t:n,e&&e.length?Wa(e,n,t):[]}function Hc(e){if(!(e&&e.length))return[];var t=0;return e=jn(e,function(e){if(vu(e))return t=nn(e.length,t),!0}),$n(t,function(t){return Pn(e,Jn(t))})}function Uc(e,t){if(!(e&&e.length))return[];var r=Hc(e);return t==null?r:Pn(r,function(e){return Dn(t,n,e)})}var Wc=ja(function(e,t){return vu(e)?Mi(e,t):[]}),Gc=ja(function(e){return Ya(jn(e,vu))}),Kc=ja(function(e){var t=pc(e);return vu(t)&&(t=n),Ya(jn(e,vu),Qo(t,2))}),qc=ja(function(e){var t=pc(e);return t=typeof t==`function`?t:n,Ya(jn(e,vu),n,t)}),Jc=ja(Hc);function Yc(e,t){return Xa(e||[],t||[],bi)}function Xc(e,t){return Xa(e||[],t||[],Pa)}var Zc=ja(function(e){var t=e.length,r=t>1?e[t-1]:n;return r=typeof r==`function`?(e.pop(),r):n,Uc(e,r)});function Qc(e){var t=U(e);return t.__chain__=!0,t}function $c(e,t){return t(e),e}function el(e,t){return t(e)}var tl=Ko(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return Ei(t,e)};return t>1||this.__actions__.length||!(i instanceof Rr)||!ms(r)?this.thru(a):(i=i.slice(r,+r+ +!!t),i.__actions__.push({func:el,args:[a],thisArg:n}),new Lr(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e}))});function nl(){return Qc(this)}function rl(){return new Lr(this.value(),this.__chain__)}function il(){this.__values__===n&&(this.__values__=$u(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}}function al(){return this}function ol(e){for(var t,r=this;r instanceof Ir;){var i=Hs(r);i.__index__=0,i.__values__=n,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t}function sl(){var e=this.__wrapped__;if(e instanceof Rr){var t=e;return this.__actions__.length&&(t=new Rr(this)),t=t.reverse(),t.__actions__.push({func:el,args:[Sc],thisArg:n}),new Lr(t,this.__chain__)}return this.thru(Sc)}function cl(){return Ja(this.__wrapped__,this.__actions__)}var ll=vo(function(e,t,n){Et.call(e,n)?++e[n]:Ti(e,n,1)});function ul(e,t,r){var i=hu(e)?An:Fi;return r&&hs(e,t,r)&&(t=n),i(e,Qo(t,3))}function dl(e,t){return(hu(e)?jn:Ri)(e,Qo(t,3))}var fl=Do(ec),pl=Do(tc);function ml(e,t){return zi(Cl(e,t),1)}function hl(e,t){return zi(Cl(e,t),A)}function gl(e,t,r){return r=r===n?1:td(r),zi(Cl(e,t),r)}function _l(e,t){return(hu(e)?H:Ni)(e,Qo(t,3))}function vl(e,t){return(hu(e)?kn:Pi)(e,Qo(t,3))}var yl=vo(function(e,t,n){Et.call(e,n)?e[n].push(t):Ti(e,n,[t])});function bl(e,t,n,r){e=_u(e)?e:qd(e),n=n&&!r?td(n):0;var i=e.length;return n<0&&(n=nn(i+n,0)),Gu(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Wn(e,t,n)>-1}var xl=ja(function(e,t,n){var r=-1,i=typeof t==`function`,a=_u(e)?$e(e.length):[];return Ni(e,function(e){a[++r]=i?Dn(t,e,n):ea(e,t,n)}),a}),Sl=vo(function(e,t,n){Ti(e,n,t)});function Cl(e,t){return(hu(e)?Pn:ga)(e,Qo(t,3))}function wl(e,t,r,i){return e==null?[]:(hu(t)||(t=t==null?[]:[t]),r=i?n:r,hu(r)||(r=r==null?[]:[r]),Sa(e,t,r))}var Tl=vo(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]});function El(e,t,n){var r=hu(e)?In:Xn,i=arguments.length<3;return r(e,Qo(t,4),n,i,Ni)}function Dl(e,t,n){var r=hu(e)?Ln:Xn,i=arguments.length<3;return r(e,Qo(t,4),n,i,Pi)}function Ol(e,t){return(hu(e)?jn:Ri)(e,Jl(Qo(t,3)))}function kl(e){return(hu(e)?gi:Ma)(e)}function Al(e,t,r){return t=(r?hs(e,t,r):t===n)?1:td(t),(hu(e)?_i:Na)(e,t)}function jl(e){return(hu(e)?vi:La)(e)}function Ml(e){if(e==null)return 0;if(_u(e))return Gu(e)?Sr(e):e.length;var t=as(e);return t==me||t==xe?e.size:pa(e).length}function Nl(e,t,r){var i=hu(e)?Rn:za;return r&&hs(e,t,r)&&(t=n),i(e,Qo(t,3))}var Pl=ja(function(e,t){if(e==null)return[];var n=t.length;return n>1&&hs(e,t[0],t[1])?t=[]:n>2&&hs(t[0],t[1],t[2])&&(t=[t[0]]),Sa(e,zi(t,1),[])}),Fl=Kt||function(){return hn.Date.now()};function Il(e,t){if(typeof t!=`function`)throw new bt(o);return e=td(e),function(){if(--e<1)return t.apply(this,arguments)}}function Ll(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,zo(e,w,n,n,n,n,t)}function Rl(e,t){var r;if(typeof t!=`function`)throw new bt(o);return e=td(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var zl=ja(function(e,t,n){var r=_;if(n.length){var i=_r(n,Zo(zl));r|=S}return zo(e,r,t,n,i)}),Bl=ja(function(e,t,n){var r=_|v;if(n.length){var i=_r(n,Zo(Bl));r|=S}return zo(t,r,e,n,i)});function Vl(e,t,r){t=r?n:t;var i=zo(e,b,n,n,n,n,n,t);return i.placeholder=Vl.placeholder,i}function Hl(e,t,r){t=r?n:t;var i=zo(e,x,n,n,n,n,n,t);return i.placeholder=Hl.placeholder,i}function Ul(e,t,r){var i,a,s,c,l,u,d=0,f=!1,p=!1,m=!0;if(typeof e!=`function`)throw new bt(o);t=rd(t)||0,ju(r)&&(f=!!r.leading,p=`maxWait`in r,s=p?nn(rd(r.maxWait)||0,t):s,m=`trailing`in r?!!r.trailing:m);function h(t){var r=i,o=a;return i=a=n,d=t,c=e.apply(o,r),c}function g(e){return d=e,l=Ns(y,t),f?h(e):c}function _(e){var n=e-u,r=e-d,i=t-n;return p?cn(i,s-r):i}function v(e){var r=e-u,i=e-d;return u===n||r>=t||r<0||p&&i>=s}function y(){var e=Fl();if(v(e))return b(e);l=Ns(y,_(e))}function b(e){return l=n,m&&i?h(e):(i=a=n,c)}function x(){l!==n&&no(l),d=0,i=u=a=l=n}function S(){return l===n?c:b(Fl())}function C(){var e=Fl(),r=v(e);if(i=arguments,a=this,u=e,r){if(l===n)return g(u);if(p)return no(l),l=Ns(y,t),h(u)}return l===n&&(l=Ns(y,t)),c}return C.cancel=x,C.flush=S,C}var Wl=ja(function(e,t){return ji(e,1,t)}),Gl=ja(function(e,t,n){return ji(e,rd(t)||0,n)});function Kl(e){return zo(e,E)}function ql(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw new bt(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(ql.Cache||ei),n}ql.Cache=ei;function Jl(e){if(typeof e!=`function`)throw new bt(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Yl(e){return Rl(2,e)}var Xl=eo(function(e,t){t=t.length==1&&hu(t[0])?Pn(t[0],nr(Qo())):Pn(zi(t,1),nr(Qo()));var n=t.length;return ja(function(r){for(var i=-1,a=cn(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return Dn(e,this,r)})}),Zl=ja(function(e,t){return zo(e,S,n,t,_r(t,Zo(Zl)))}),Ql=ja(function(e,t){return zo(e,C,n,t,_r(t,Zo(Ql)))}),$l=Ko(function(e,t){return zo(e,T,n,n,n,t)});function eu(e,t){if(typeof e!=`function`)throw new bt(o);return t=t===n?t:td(t),ja(e,t)}function tu(e,t){if(typeof e!=`function`)throw new bt(o);return t=t==null?0:nn(td(t),0),ja(function(n){var r=n[t],i=to(n,0,t);return r&&Fn(i,r),Dn(e,this,i)})}function nu(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw new bt(o);return ju(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),Ul(e,t,{leading:r,maxWait:t,trailing:i})}function ru(e){return Ll(e,1)}function iu(e,t){return Zl(Qa(t),e)}function au(){if(!arguments.length)return[];var e=arguments[0];return hu(e)?e:[e]}function ou(e){return Oi(e,m)}function su(e,t){return t=typeof t==`function`?t:n,Oi(e,m,t)}function cu(e){return Oi(e,f|m)}function lu(e,t){return t=typeof t==`function`?t:n,Oi(e,f|m,t)}function uu(e,t){return t==null||Ai(e,t,Od(t))}function du(e,t){return e===t||e!==e&&t!==t}var fu=Io(Ji),pu=Io(function(e,t){return e>=t}),mu=ta(function(){return arguments}())?ta:function(e){return Mu(e)&&Et.call(e,`callee`)&&!zt.call(e,`callee`)},hu=$e.isArray,gu=xn?nr(xn):na;function _u(e){return e!=null&&Au(e.length)&&!Ou(e)}function vu(e){return Mu(e)&&_u(e)}function yu(e){return e===!0||e===!1||Mu(e)&&qi(e)==le}var bu=Zt||tp,xu=Sn?nr(Sn):ra;function Su(e){return Mu(e)&&e.nodeType===1&&!Vu(e)}function Cu(e){if(e==null)return!0;if(_u(e)&&(hu(e)||typeof e==`string`||typeof e.splice==`function`||bu(e)||qu(e)||mu(e)))return!e.length;var t=as(e);if(t==me||t==xe)return!e.size;if(xs(e))return!pa(e).length;for(var n in e)if(Et.call(e,n))return!1;return!0}function wu(e,t){return ia(e,t)}function Tu(e,t,r){r=typeof r==`function`?r:n;var i=r?r(e,t):n;return i===n?ia(e,t,n,r):!!i}function Eu(e){if(!Mu(e))return!1;var t=qi(e);return t==de||t==ue||typeof e.message==`string`&&typeof e.name==`string`&&!Vu(e)}function Du(e){return typeof e==`number`&&$t(e)}function Ou(e){if(!ju(e))return!1;var t=qi(e);return t==fe||t==pe||t==ce||t==ye}function ku(e){return typeof e==`number`&&e==td(e)}function Au(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=j}function ju(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function Mu(e){return typeof e==`object`&&!!e}var Nu=Cn?nr(Cn):oa;function Pu(e,t){return e===t||sa(e,t,es(t))}function Fu(e,t,r){return r=typeof r==`function`?r:n,sa(e,t,es(t),r)}function Iu(e){return Bu(e)&&e!=+e}function Lu(e){if(bs(e))throw new mt(a);return ca(e)}function Ru(e){return e===null}function zu(e){return e==null}function Bu(e){return typeof e==`number`||Mu(e)&&qi(e)==he}function Vu(e){if(!Mu(e)||qi(e)!=_e)return!1;var t=Lt(e);if(t===null)return!0;var n=Et.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Tt.call(n)==At}var Hu=wn?nr(wn):la;function Uu(e){return ku(e)&&e>=-j&&e<=j}var Wu=Tn?nr(Tn):ua;function Gu(e){return typeof e==`string`||!hu(e)&&Mu(e)&&qi(e)==Se}function Ku(e){return typeof e==`symbol`||Mu(e)&&qi(e)==Ce}var qu=En?nr(En):da;function Ju(e){return e===n}function Yu(e){return Mu(e)&&as(e)==Te}function Xu(e){return Mu(e)&&qi(e)==Ee}var Zu=Io(ha),Qu=Io(function(e,t){return e<=t});function $u(e){if(!e)return[];if(_u(e))return Gu(e)?Cr(e):mo(e);if(Ht&&e[Ht])return mr(e[Ht]());var t=as(e);return(t==me?hr:t==xe?vr:qd)(e)}function ed(e){return e?(e=rd(e),e===A||e===-A?(e<0?-1:1)*M:e===e?e:0):e===0?e:0}function td(e){var t=ed(e),n=t%1;return t===t?n?t-n:t:0}function nd(e){return e?Di(td(e),0,P):0}function rd(e){if(typeof e==`number`)return e;if(Ku(e))return N;if(ju(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=ju(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=tr(e);var n=lt.test(e);return n||R.test(e)?pn(e.slice(2),n?2:8):ct.test(e)?N:+e}function id(e){return ho(e,kd(e))}function ad(e){return e?Di(td(e),-j,j):e===0?e:0}function od(e){return e==null?``:Ua(e)}var sd=yo(function(e,t){if(xs(t)||_u(t)){ho(t,Od(t),e);return}for(var n in t)Et.call(t,n)&&bi(e,n,t[n])}),cd=yo(function(e,t){ho(t,kd(t),e)}),ld=yo(function(e,t,n,r){ho(t,kd(t),e,r)}),ud=yo(function(e,t,n,r){ho(t,Od(t),e,r)}),dd=Ko(Ei);function fd(e,t){var n=Fr(e);return t==null?n:Ci(n,t)}var pd=ja(function(e,t){e=_t(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&hs(t[0],t[1],a)&&(i=1);++r<i;)for(var o=t[r],s=kd(o),c=-1,l=s.length;++c<l;){var u=s[c],d=e[u];(d===n||du(d,Ct[u])&&!Et.call(e,u))&&(e[u]=o[u])}return e}),md=ja(function(e){return e.push(n,Vo),Dn(Nd,n,e)});function hd(e,t){return Hn(e,Qo(t,3),Hi)}function gd(e,t){return Hn(e,Qo(t,3),Ui)}function _d(e,t){return e==null?e:Bi(e,Qo(t,3),kd)}function J(e,t){return e==null?e:Vi(e,Qo(t,3),kd)}function vd(e,t){return e&&Hi(e,Qo(t,3))}function yd(e,t){return e&&Ui(e,Qo(t,3))}function bd(e){return e==null?[]:Wi(e,Od(e))}function xd(e){return e==null?[]:Wi(e,kd(e))}function Sd(e,t,r){var i=e==null?n:Gi(e,t);return i===n?r:i}function Cd(e,t){return e!=null&&cs(e,t,Yi)}function wd(e,t){return e!=null&&cs(e,t,Xi)}var Td=Ao(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=kt.call(t)),e[t]=n},Nf(Lf)),Ed=Ao(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=kt.call(t)),Et.call(e,t)?e[t].push(n):e[t]=[n]},Qo),Dd=ja(ea);function Od(e){return _u(e)?hi(e):pa(e)}function kd(e){return _u(e)?hi(e,!0):ma(e)}function Ad(e,t){var n={};return t=Qo(t,3),Hi(e,function(e,r,i){Ti(n,t(e,r,i),e)}),n}function jd(e,t){var n={};return t=Qo(t,3),Hi(e,function(e,r,i){Ti(n,r,t(e,r,i))}),n}var Md=yo(function(e,t,n){ya(e,t,n)}),Nd=yo(function(e,t,n,r){ya(e,t,n,r)}),Pd=Ko(function(e,t){var n={};if(e==null)return n;var r=!1;t=Pn(t,function(t){return t=$a(t,e),r||=t.length>1,t}),ho(e,Jo(e),n),r&&(n=Oi(n,f|p|m,Ho));for(var i=t.length;i--;)Ga(n,t[i]);return n});function Fd(e,t){return Ld(e,Jl(Qo(t)))}var Id=Ko(function(e,t){return e==null?{}:Ca(e,t)});function Ld(e,t){if(e==null)return{};var n=Pn(Jo(e),function(e){return[e]});return t=Qo(t),wa(e,n,function(e,n){return t(e,n[0])})}function Rd(e,t,r){t=$a(t,e);var i=-1,a=t.length;for(a||(a=1,e=n);++i<a;){var o=e==null?n:e[zs(t[i])];o===n&&(i=a,o=r),e=Ou(o)?o.call(e):o}return e}function zd(e,t,n){return e==null?e:Pa(e,t,n)}function Bd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:Pa(e,t,r,i)}var Vd=Ro(Od),Hd=Ro(kd);function Ud(e,t,n){var r=hu(e),i=r||bu(e)||qu(e);if(t=Qo(t,4),n==null){var a=e&&e.constructor;n=i?r?new a:[]:ju(e)&&Ou(a)?Fr(Lt(e)):{}}return(i?H:Hi)(e,function(e,r,i){return t(n,e,r,i)}),n}function Wd(e,t){return e==null?!0:Ga(e,t)}function Gd(e,t,n){return e==null?e:Ka(e,t,Qa(n))}function Kd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:Ka(e,t,Qa(r),i)}function qd(e){return e==null?[]:rr(e,Od(e))}function Jd(e){return e==null?[]:rr(e,kd(e))}function Yd(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=rd(r),r=r===r?r:0),t!==n&&(t=rd(t),t=t===t?t:0),Di(rd(e),t,r)}function Xd(e,t,r){return t=ed(t),r===n?(r=t,t=0):r=ed(r),e=rd(e),Zi(e,t,r)}function Zd(e,t,r){if(r&&typeof r!=`boolean`&&hs(e,t,r)&&(t=r=n),r===n&&(typeof t==`boolean`?(r=t,t=n):typeof e==`boolean`&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=ed(e),t===n?(t=e,e=0):t=ed(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var a=dn();return cn(e+a*(t-e+fn(`1e-`+((a+``).length-1))),t)}return Oa(e,t)}var Qd=wo(function(e,t,n){return t=t.toLowerCase(),e+(n?$d(t):t)});function $d(e){return Df(od(e).toLowerCase())}function ef(e){return e=od(e),e&&e.replace(z,cr).replace(Qt,``)}function tf(e,t,r){e=od(e),t=Ua(t);var i=e.length;r=r===n?i:Di(td(r),0,i);var a=r;return r-=t.length,r>=0&&e.slice(r,a)==t}function nf(e){return e=od(e),e&&Ue.test(e)?e.replace(Ve,lr):e}function rf(e){return e=od(e),e&&Ze.test(e)?e.replace(Xe,`\\$&`):e}var af=wo(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),of=wo(function(e,t,n){return e+(n?` `:``)+t.toLowerCase()}),sf=Co(`toLowerCase`);function cf(e,t,n){e=od(e),t=td(t);var r=t?Sr(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return No(Yt(i),n)+e+No(Jt(i),n)}function lf(e,t,n){e=od(e),t=td(t);var r=t?Sr(e):0;return t&&r<t?e+No(t-r,n):e}function uf(e,t,n){e=od(e),t=td(t);var r=t?Sr(e):0;return t&&r<t?No(t-r,n)+e:e}function df(e,t,n){return n||t==null?t=0:t&&=+t,un(od(e).replace(Qe,``),t||0)}function ff(e,t,r){return t=(r?hs(e,t,r):t===n)?1:td(t),Aa(od(e),t)}function pf(){var e=arguments,t=od(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var mf=wo(function(e,t,n){return e+(n?`_`:``)+t.toLowerCase()});function hf(e,t,r){return r&&typeof r!=`number`&&hs(e,t,r)&&(t=r=n),r=r===n?P:r>>>0,r?(e=od(e),e&&(typeof t==`string`||t!=null&&!Hu(t))&&(t=Ua(t),!t&&fr(e))?to(Cr(e),0,r):e.split(t,r)):[]}var gf=wo(function(e,t,n){return e+(n?` `:``)+Df(t)});function _f(e,t,n){return e=od(e),n=n==null?0:Di(td(n),0,e.length),t=Ua(t),e.slice(n,n+t.length)==t}function vf(e,t,r){var i=U.templateSettings;r&&hs(e,t,r)&&(t=n),e=od(e),t=ud({},t,i,Bo);var a=ud({},t.imports,i.imports,Bo),o=Od(a),l=rr(a,o);H(o,function(e){if(it.test(e))throw new mt(c)});var u,d,f=0,p=t.interpolate||ft,m=`__p += '`,h=vt((t.escape||ft).source+`|`+p.source+`|`+(p===Ke?ot:ft).source+`|`+(t.evaluate||ft).source+`|$`,`g`),g=`//# sourceURL=`+(Et.call(t,`sourceURL`)?(t.sourceURL+``).replace(/\s/g,` `):`lodash.templateSources[`+ ++an+`]`)+`
|
|
5
5
|
`;e.replace(h,function(t,n,r,i,a,o){return r||=i,m+=e.slice(f,o).replace(pt,ur),n&&(u=!0,m+=`' +
|
|
@@ -337,7 +337,7 @@ export default defineViewField({
|
|
|
337
337
|
`,ge=`src/application.config.ts`,_e=`src`,ve=class{async execute(e,n){try{let a=await O(t.Et),o=e??await this.getEntity(),s=this.getFolderName(o),c=n?(0,r.join)(t.Et,n):(0,r.join)(t.Et,_e,s);await t.ct(c);let{name:l,file:d}=await this.getEntityData(o,a),f=(0,r.join)(c,this.getFileName(l,o));if(await t.lt(f)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,i.writeFile)(f,d),console.log(u.default.green(`✓ Created ${s}:`),u.default.cyan((0,r.relative)(t.Et,f))),o===t.pt.Object&&await this.promptAndCreateObjectCompanions({objectName:l,applicationUniversalIdentifier:a,customPath:n}),o===t.pt.ConnectionProvider&&await this.registerConnectionProviderServerVariables(l)}catch(e){console.error(u.default.red(`Add new entity failed:`),e instanceof Error?e.message:e),process.exit(1)}}async getEntityData(e,n){switch(e){case t.pt.Object:{let e=await this.getObjectData(),t=e.nameSingular,n=(0,a.v4)(),r=(0,a.v4)();return this.lastObjectUniversalIdentifier=n,this.lastNameFieldUniversalIdentifier=r,this.lastObjectLabelSingular=e.labelSingular,{name:t,file:ae({data:e,name:t,universalIdentifier:n,nameFieldUniversalIdentifier:r})}}case t.pt.Field:{let e=await this.getFieldData(),t=e.name;return{name:t,file:M({data:e,name:t})}}case t.pt.LogicFunction:{let t=await this.getEntityName(e);return{name:t,file:F({name:t})}}case t.pt.FrontComponent:{let t=await this.getEntityName(e);return{name:t,file:P({name:t})}}case t.pt.Role:{let t=await this.getEntityName(e);return{name:t,file:I({name:t})}}case t.pt.Skill:{let t=await this.getEntityName(e);return{name:t,file:fe({name:t})}}case t.pt.Agent:{let t=await this.getEntityName(e);return{name:t,file:ue({name:t})}}case t.pt.ConnectionProvider:{let t=await this.getEntityName(e);return{name:t,file:de({name:t})}}case t.pt.View:{let e=(await this.getViewData()).name;return{name:e,file:me({name:e,applicationUniversalIdentifier:n})}}case t.pt.ViewField:return{name:await this.getEntityName(e),file:he({})};case t.pt.NavigationMenuItem:{let t=await this.getEntityName(e);return{name:t,file:ie({name:t})}}case t.pt.PageLayout:{let n=await this.getEntityName(e),{type:r}=await d.default.prompt([{type:`select`,name:`type`,message:`Select the page layout type:`,choices:Object.values(t.Ct)}]);return{name:n,file:se({name:n,type:r})}}case t.pt.PageLayoutTab:{let t=await this.getEntityName(e);return{name:t,file:ce({name:t})}}case t.pt.CommandMenuItem:{let t=await this.getEntityName(e);return{name:t,file:oe({name:t})}}default:t._t(e)}}async promptAndCreateObjectCompanions({objectName:e,applicationUniversalIdentifier:n,customPath:o}){let{createCompanions:s}=await d.default.prompt([{type:`confirm`,name:`createCompanions`,message:`Also create a view, navigation menu item, and record page layout for this object? (recommended)`,default:!0}]);if(!s||!this.lastObjectUniversalIdentifier)return;let c=(0,a.v4)(),l=(0,a.v4)(),f=me({name:`all-${N(e)}`,universalIdentifier:c,objectUniversalIdentifier:this.lastObjectUniversalIdentifier,applicationUniversalIdentifier:n,fields:this.lastNameFieldUniversalIdentifier?[{fieldMetadataUniversalIdentifier:this.lastNameFieldUniversalIdentifier,position:0,isVisible:!0,size:200}]:[]}),p=o?(0,r.join)(t.Et,o):(0,r.join)(t.Et,_e,this.getFolderName(t.pt.View));await t.ct(p);let m=(0,r.join)(p,`all-${N(e)}.ts`);if(await t.lt(m)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,i.writeFile)(m,f),console.log(u.default.green(`✓ Created view:`),u.default.cyan((0,r.relative)(t.Et,m)));let h=this.buildRecordPageFieldsViewFields(this.lastNameFieldUniversalIdentifier),g=me({name:`${N(e)}-record-page-fields`,universalIdentifier:l,objectUniversalIdentifier:this.lastObjectUniversalIdentifier,applicationUniversalIdentifier:n,type:t.bt.FIELDS_WIDGET,fields:h}),_=(0,r.join)(p,`${N(e)}-record-page-fields.ts`);if(await t.lt(_)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,i.writeFile)(_,g),console.log(u.default.green(`✓ Created record-page-fields view:`),u.default.cyan((0,r.relative)(t.Et,_)));let v=ie({name:e,type:`OBJECT`,targetObjectUniversalIdentifier:this.lastObjectUniversalIdentifier}),y=o?(0,r.join)(t.Et,o):(0,r.join)(t.Et,_e,this.getFolderName(t.pt.NavigationMenuItem));await t.ct(y);let b=(0,r.join)(y,`${N(e)}.ts`);if(await t.lt(b)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,i.writeFile)(b,v),console.log(u.default.green(`✓ Created navigation menu item:`),u.default.cyan((0,r.relative)(t.Et,b)));let x=le({objectLabelSingular:this.lastObjectLabelSingular??e,objectUniversalIdentifier:this.lastObjectUniversalIdentifier,fieldsWidgetViewUniversalIdentifier:l}),S=o?(0,r.join)(t.Et,o):(0,r.join)(t.Et,_e,this.getFolderName(t.pt.PageLayout));await t.ct(S);let C=(0,r.join)(S,`${N(e)}-record-page-layout.ts`);if(await t.lt(C)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,i.writeFile)(C,x),console.log(u.default.green(`✓ Created record page layout:`),u.default.cyan((0,r.relative)(t.Et,C)))}async registerConnectionProviderServerVariables(e){let n=N(e).toUpperCase().replace(/-/g,`_`),i=[{name:`${n}_CLIENT_ID`,description:`OAuth client ID issued by the third-party provider. Filled in once by the server admin on the application registration.`,isSecret:!1},{name:`${n}_CLIENT_SECRET`,description:`OAuth client secret issued by the third-party provider. Stored encrypted; never echoed in API responses.`,isSecret:!0}],a=await re({projectRoot:t.Et,variables:i});switch(a.status){case`appended`:case`created`:console.log(u.default.green(`✓ Added ${i.map(e=>e.name).join(` + `)} to defineApplication.serverVariables:`),u.default.cyan((0,r.relative)(t.Et,a.file)));break;case`skipped-existing`:console.log(u.default.dim(` (${i.map(e=>e.name).join(` / `)} already declared on defineApplication.serverVariables)`));break;case`skipped-no-config`:case`skipped-no-app-call`:console.log(u.default.yellow(`! Couldn't auto-update ${ge}. Add these manually to defineApplication.serverVariables:\n`+i.map(e=>` ${e.name}: { description: '...', isSecret: ${e.isSecret}, isRequired: true },`).join(`
|
|
338
338
|
`)));break}}buildRecordPageFieldsViewFields(e){let t=[`createdAt`,`updatedAt`,`createdBy`,`updatedBy`].map(e=>({defaultFieldName:e,isVisible:!0,size:200}));return(e?[{fieldMetadataUniversalIdentifier:e,isVisible:!0,size:200},...t]:t).map((e,t)=>({...e,position:t}))}async getEntity(){let{entity:e}=await d.default.prompt([{type:`select`,name:`entity`,message:`What entity do you want to create?`,default:``,choices:Object.values(t.pt)}]);return e}async handleFileExist(){return await d.default.prompt([{type:`confirm`,name:`overwrite`,message:`File already exists. Do you want to overwrite it?`,default:!1}])}async getEntityName(e){let{name:t}=await d.default.prompt([{type:`input`,name:`name`,message:`Enter a name for your new ${e}:`,default:``,validate:t=>t.length===0?`${e} name is required`:!0}]);return t}async getFieldData(){let e=e=>e===t.Tt.RELATION||e===t.Tt.MORPH_RELATION;return d.default.prompt([{type:`input`,name:`name`,message:`Enter a name for your field:`,default:``,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`label`,message:`Enter a label for your field:`,default:e=>k(e.name),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`select`,name:`type`,message:`Select the field type:`,choices:Object.values(t.Tt),default:t.Tt.TEXT},{type:`input`,name:`objectUniversalIdentifier`,message:`Enter the universalIdentifier of the object this field belongs to:`,default:`fill-later`,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`description`,message:`Enter a description for your field (optional):`,default:``},{type:`input`,name:`relationTargetObjectMetadataUniversalIdentifier`,message:`Enter the universalIdentifier of the target object of the relation:`,default:`fill-later`,when:t=>e(t.type),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`relationTargetFieldMetadataUniversalIdentifier`,message:`Enter the universalIdentifier of the target field on the related object:`,default:`fill-later`,when:t=>e(t.type),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`select`,name:`relationType`,message:`Select the relation type:`,choices:Object.values(t.wt),default:t.wt.ONE_TO_MANY,when:t=>e(t.type)},{type:`select`,name:`onDelete`,message:`Select the onDelete behavior:`,choices:Object.values(t.St),default:t.St.CASCADE,when:t=>e(t.type)}])}async getObjectData(){return d.default.prompt([{type:`input`,name:`nameSingular`,message:`Enter a name singular for your object (eg: company):`,default:``,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`namePlural`,message:`Enter a name plural for your object (eg: companies):`,default:``,validate:(e,t)=>e.trim()===t?.nameSingular.trim()?`Name plural must be different from name singular`:!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`labelSingular`,message:`Enter a label singular for your object:`,default:e=>k(e.nameSingular),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`labelPlural`,message:`Enter a label plural for your object:`,default:e=>k(e.namePlural),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0}])}async getViewData(){return d.default.prompt([{type:`input`,name:`name`,message:`Enter a name for your view:`,default:``,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`objectUniversalIdentifier`,message:`Enter the universalIdentifier of the object this view belongs to:`,default:`fill-later`,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0}])}getFolderName(e){return`${N(e)}s`}getFileName(e,n){switch(n){case t.pt.FrontComponent:return`${N(e)}.tsx`;default:return`${N(e)}.ts`}}},ye=class{async execute(e){let n=e.appPath??t.Et;await x(n),console.log(u.default.blue(`Building application...`)),console.log(u.default.gray(`App path: ${n}\n`));let r=await t.G({appPath:n,tarball:e.tarball,onProgress:e=>console.log(u.default.gray(e))});r.success||(console.error(u.default.red(r.error.message)),process.exit(1)),console.log(u.default.green(`✓ Build succeeded (${r.data.fileCount} file${r.data.fileCount===1?``:`s`})`)),console.log(u.default.gray(`Output: ${r.data.outputDir}`)),r.data.tarballPath&&console.log(u.default.gray(`Tarball: ${r.data.tarballPath}`))}},be=class{async execute({appPath:e=t.Et,postInstall:r=!1,preInstall:i=!1,functionUniversalIdentifier:a,functionName:o,payload:s=`{}`}){let c;try{c=JSON.parse(s)}catch{console.error(u.default.red(`Invalid JSON payload. Please provide valid JSON.`)),process.exit(1)}let l=r?`post install`:i?`pre install`:a??o,d=t.U.getActiveRemote();console.log(u.default.blue(`🚀 Executing function "${l}" on ${d}...`)),console.log(u.default.gray(` Payload: ${JSON.stringify(c)}\n`));let f=await t._(r?{appPath:e,postInstall:!0,payload:c}:i?{appPath:e,preInstall:!0,payload:c}:a?{appPath:e,functionUniversalIdentifier:a,payload:c}:{appPath:e,functionName:o,payload:c});if(!f.success){switch(f.error.code){case t.K.MANIFEST_NOT_FOUND:console.error(u.default.red(`Failed to build manifest.`));break;case t.J.FETCH_FUNCTIONS_FAILED:console.error(u.default.red(`Failed to fetch functions:`),f.error.message);break;case t.J.FUNCTION_NOT_FOUND:{console.error(u.default.red(f.error.message),`
|
|
339
339
|
`);let e=f.error.details?.availableFunctions??[];e.length>0?(console.log(u.default.cyan(`Available functions:`)),e.forEach(e=>{console.log(` - ${u.default.white(e.name)} (${e.universalIdentifier})`)})):console.log(u.default.yellow("No functions found for this application. Have you synced your app with `twenty dev`?"));break}case t.J.EXECUTION_FAILED:console.error(u.default.red(`Execution failed:`),f.error.message);break;default:console.error(u.default.red(f.error.message))}process.exit(1)}let p=f.data;console.log(u.default.cyan(`─`.repeat(60))),console.log(u.default.cyan(`Execution Result`)),console.log(u.default.cyan(`─`.repeat(60)));let m=p.status===`SUCCESS`?u.default.green:u.default.red;console.log(`${u.default.bold(`Status:`)} ${m(p.status)}`),console.log(`${u.default.bold(`Duration:`)} ${p.duration}ms\n`),n.t(p.data)&&(console.log(u.default.bold(`Data:`)),console.log(u.default.white(JSON.stringify(p.data,null,2)))),p.error&&(console.log(u.default.bold.red(`Error:`)),console.log(u.default.red(` Type: ${p.error.errorType}`)),console.log(u.default.red(` Message: ${p.error.errorMessage}\n`)),p.error.stackTrace&&(console.log(u.default.gray(`Stack trace:`)),console.log(u.default.gray(p.error.stackTrace)))),p.logs&&(console.log(u.default.bold(`Logs:`)),console.log(u.default.gray(p.logs))),console.log(u.default.cyan(`─`.repeat(60))),p.status!==`SUCCESS`&&process.exit(1)}},xe=class{constructor(){this.apiService=new t.z}async execute({appPath:e=t.Et,functionUniversalIdentifier:n,functionName:r}){try{let i=await t.F(e);i||process.exit(1),this.logWatchInfo({appName:i.application.displayName,functionUniversalIdentifier:n,functionName:r}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:i.application.universalIdentifier,functionUniversalIdentifier:n,functionName:r})}catch(e){console.error(u.default.red(`Watch logs failed:`),e instanceof Error?e.message:e),process.exit(1)}}logWatchInfo({appName:e,functionUniversalIdentifier:n,functionName:r}){let i=e??`Twenty Application`,a=n||r?`function "${n||r}"`:`functions`,o=t.U.getActiveRemote();console.log(u.default.blue(`🚀 Watching ${i} ${a} logs on ${o}:\n`))}},Se=e=>`${u.default.cyan(e.file)}:${u.default.yellow(String(e.line))}:${u.default.yellow(String(e.column+1))} - ${u.default.red(`error`)} ${e.text}`,Ce=class{async execute(e){let n=e.appPath??t.Et;console.log(u.default.blue(`Running type check...`)),console.log(u.default.gray(`App path: ${n}\n`));let r=await t.at(n);r.length===0&&(console.log(u.default.green(`✓ No type errors found`)),process.exit(0));for(let e of r)console.log(Se(e));console.log(`
|
|
340
|
-
`,u.default.red(`✗ Found ${r.length} type error${r.length===1?``:`s`}`)),process.exit(1)}},we=(e,t)=>console.warn(u.default.yellow(`⚠ \`twenty ${e}\` is deprecated. Use \`twenty ${t}\` instead.`)),Te=e=>{let t=new ye,n=new Ce,r=new xe,i=new be,a=new ve,o=new S,s=new C,c=new w;e.command(`build [appPath]`,{hidden:!0}).option(`--tarball`,`Also pack into a .tgz tarball`).action(async(e,n)=>{we(`build`,`dev:build`),await t.execute({appPath:g(e),tarball:n.tarball})}),e.command(`typecheck [appPath]`,{hidden:!0}).action(async e=>{we(`typecheck`,`dev:typecheck`),await n.execute({appPath:g(e)})}),e.command(`logs [appPath]`,{hidden:!0}).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Only show logs for the function with this universal ID`).option(`-n, --functionName <functionName>`,`Only show logs for the function with this name`).action(async(e,t)=>{we(`logs`,`dev:function:logs`),await r.execute({...t,appPath:g(e)})}),e.command(`exec [appPath]`,{hidden:!0}).option(`--postInstall`,`Execute post-install logic function if defined`).option(`--preInstall`,`Execute pre-install logic function if defined`).option(`-p, --payload <payload>`,`JSON payload to send to the function`,`{}`).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Universal ID of the function to execute`).option(`-n, --functionName <functionName>`,`Name of the function to execute`).action(async(e,t)=>{we(`exec`,`dev:function:exec`),!t?.postInstall&&!t?.preInstall&&!t?.functionUniversalIdentifier&&!t?.functionName&&(console.error(u.default.red(`Error: Either --postInstall, --preInstall, --functionName (-n), or --functionUniversalIdentifier (-u) is required.`)),process.exit(1)),await i.execute({...t,payload:t?.payload??`{}`,appPath:g(e)})}),e.command(`add [entityType]`,{hidden:!0}).option(`--path <path>`,`Path in which the entity should be created.`).action(async(e,t)=>{we(`add`,`dev:add`),await a.execute(e,t?.path)}),e.command(`publish [appPath]`,{hidden:!0}).option(`--tag <tag>`,`npm dist-tag (e.g. beta, next)`).action(async(e,t)=>{we(`publish`,`app:publish`),await o.execute({appPath:g(e),tag:t.tag})}),e.command(`deploy [appPath]`,{hidden:!0}).option(`-r, --remote <name>`,`Deploy to a specific remote`).action(async(e,t)=>{we(`deploy`,`app:publish --private`),await o.execute({appPath:g(e),private:!0,remote:t.remote})}),e.command(`install [appPath]`,{hidden:!0}).option(`-r, --remote <name>`,`Install on a specific remote`).action(async(e,t)=>{we(`install`,`app:install`),await s.execute({appPath:g(e),remote:t.remote})}),e.command(`uninstall [appPath]`,{hidden:!0}).option(`-y, --yes`,`Skip confirmation prompt`).action(async(e,t)=>{we(`uninstall`,`app:uninstall`);try{let n=await c.execute({appPath:g(e),askForConfirmation:!t?.yes});process.exit(+!n.success)}catch{process.exit(1)}}),e.command(`catalog-sync`,{hidden:!0}).option(`-r, --remote <name>`,`Sync on a specific remote`).action(async e=>{we(`catalog-sync`,`dev:catalog-sync`);let{CatalogSyncCommand:t}=await Promise.resolve().then(()=>require("./catalog-sync-
|
|
340
|
+
`,u.default.red(`✗ Found ${r.length} type error${r.length===1?``:`s`}`)),process.exit(1)}},we=(e,t)=>console.warn(u.default.yellow(`⚠ \`twenty ${e}\` is deprecated. Use \`twenty ${t}\` instead.`)),Te=e=>{let t=new ye,n=new Ce,r=new xe,i=new be,a=new ve,o=new S,s=new C,c=new w;e.command(`build [appPath]`,{hidden:!0}).option(`--tarball`,`Also pack into a .tgz tarball`).action(async(e,n)=>{we(`build`,`dev:build`),await t.execute({appPath:g(e),tarball:n.tarball})}),e.command(`typecheck [appPath]`,{hidden:!0}).action(async e=>{we(`typecheck`,`dev:typecheck`),await n.execute({appPath:g(e)})}),e.command(`logs [appPath]`,{hidden:!0}).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Only show logs for the function with this universal ID`).option(`-n, --functionName <functionName>`,`Only show logs for the function with this name`).action(async(e,t)=>{we(`logs`,`dev:function:logs`),await r.execute({...t,appPath:g(e)})}),e.command(`exec [appPath]`,{hidden:!0}).option(`--postInstall`,`Execute post-install logic function if defined`).option(`--preInstall`,`Execute pre-install logic function if defined`).option(`-p, --payload <payload>`,`JSON payload to send to the function`,`{}`).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Universal ID of the function to execute`).option(`-n, --functionName <functionName>`,`Name of the function to execute`).action(async(e,t)=>{we(`exec`,`dev:function:exec`),!t?.postInstall&&!t?.preInstall&&!t?.functionUniversalIdentifier&&!t?.functionName&&(console.error(u.default.red(`Error: Either --postInstall, --preInstall, --functionName (-n), or --functionUniversalIdentifier (-u) is required.`)),process.exit(1)),await i.execute({...t,payload:t?.payload??`{}`,appPath:g(e)})}),e.command(`add [entityType]`,{hidden:!0}).option(`--path <path>`,`Path in which the entity should be created.`).action(async(e,t)=>{we(`add`,`dev:add`),await a.execute(e,t?.path)}),e.command(`publish [appPath]`,{hidden:!0}).option(`--tag <tag>`,`npm dist-tag (e.g. beta, next)`).action(async(e,t)=>{we(`publish`,`app:publish`),await o.execute({appPath:g(e),tag:t.tag})}),e.command(`deploy [appPath]`,{hidden:!0}).option(`-r, --remote <name>`,`Deploy to a specific remote`).action(async(e,t)=>{we(`deploy`,`app:publish --private`),await o.execute({appPath:g(e),private:!0,remote:t.remote})}),e.command(`install [appPath]`,{hidden:!0}).option(`-r, --remote <name>`,`Install on a specific remote`).action(async(e,t)=>{we(`install`,`app:install`),await s.execute({appPath:g(e),remote:t.remote})}),e.command(`uninstall [appPath]`,{hidden:!0}).option(`-y, --yes`,`Skip confirmation prompt`).action(async(e,t)=>{we(`uninstall`,`app:uninstall`);try{let n=await c.execute({appPath:g(e),askForConfirmation:!t?.yes});process.exit(+!n.success)}catch{process.exit(1)}}),e.command(`catalog-sync`,{hidden:!0}).option(`-r, --remote <name>`,`Sync on a specific remote`).action(async e=>{we(`catalog-sync`,`dev:catalog-sync`);let{CatalogSyncCommand:t}=await Promise.resolve().then(()=>require("./catalog-sync-DHopgolZ.js"));await new t().execute({remote:e.remote})})},Ee=class{constructor({state:e,notify:t}){this.state=e,this.notify=t}async execute(e){let n=this.state.steps.buildManifest;n.status=`in_progress`,this.state.updatePipeline({status:`building`});let r=[{message:`Building manifest`,status:`info`}],i=await t.$(e.appPath);if(!i.success){for(let e of i.errors)r.push({message:e,status:`error`});return n.output={result:null},n.status=`error`,this.state.updatePipeline({status:`error`}),this.state.applyStepEvents(r),null}if(i.warnings.length>0)for(let e of i.warnings)r.push({message:`⚠ ${e}`,status:`warning`});r.push({message:`Successfully built manifest`,status:`success`});let a={manifest:i.manifest,filePaths:i.filePaths};return n.output={result:a},n.status=`done`,this.state.updatePipeline({appName:i.manifest.application.displayName}),this.state.updateEntitiesFromManifest(i.filePaths),this.state.applyStepEvents(r),a}},L=class{constructor({apiService:e,state:t,notify:n}){this.hasRetried=!1,this.apiService=e,this.state=t,this.notify=n}async execute(){let e=this.state.steps.checkServer,r=await this.apiService.validateAuth();if(!r.serverUp){let n=await t.h();return n&&!this.hasRetried?(this.hasRetried=!0,await new t.U().setConfig({apiUrl:n}),this.execute()):(e.output.errorLogged||(e.output={isReady:!1,errorLogged:!0},e.status=`error`,this.state.applyStepEvents([{message:`Cannot reach Twenty server.
|
|
341
341
|
|
|
342
342
|
Start a local server:
|
|
343
343
|
yarn twenty docker:start
|
|
@@ -31388,6 +31388,6 @@ Stack: `+n.stack;r.length>0&&o(`Manipulation error: A syntax error was inserted.
|
|
|
31388
31388
|
`);function n(e){for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===o.ASTERISK)return n;if(!t.StringUtils.isWhitespaceCharCode(r))break}return-1}}var $l=V,eu=class extends $l{isMultiLine(){return this.getText().includes(`
|
|
31389
31389
|
`)}getTags(){return this.compilerNode.tags?.map(e=>this._getNodeFromCompilerNode(e))??[]}getInnerText(){return Ql(this.getText())}getComment(){if(this.compilerNode.comment!=null)return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:this.compilerNode.comment.map(e=>this._getNodeFromCompilerNodeIfExists(e))}getCommentText(){return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:t.ts.getTextOfJSDocComment(this.compilerNode.comment)}getDescription(){let e=this.getSourceFile().getFullText(),n=this.getTags()[0]?.getStart()??this.getEnd()-2,r=i(this);return Ql(e.substring(r,Math.max(r,a())));function i(t){let n=t.getStart()+3;return e.charCodeAt(n)===o.SPACE?n+1:n}function a(){return Ne(e,Ne(e,n,e=>e===o.NEWLINE||!t.StringUtils.isWhitespaceCharCode(e)&&e!==o.ASTERISK),e=>e!==o.NEWLINE&&e!==o.CARRIAGE_RETURN)}}setDescription(e){let t=this.getTags(),n=this.getStart()+3,r=t.length>0?Ne(this._sourceFile.getFullText(),t[0].getStart(),e=>e===o.ASTERISK)-1:this.getEnd()-2;return nn({parent:this,newText:i.call(this),replacePos:n,replacingLength:r-n}),this;function i(){let t=this.getIndentationText(),n=this._context.manipulationSettings.getNewLineKindAsString(),r=F(this._getWriter(),e).split(/\r?\n/),i=r[0].length===0,a=r.length===1&&(this.compilerNode.tags?.length??0)===0,o=a?r[0]:r.map(e=>e.length===0?`${t} *`:`${t} * ${e}`).slice(+!!i).join(n);return a?` `+o+` `:n+o+n+t+` `}}addTag(e){return this.addTags([e])[0]}addTags(e){return this.insertTags(this.compilerNode.tags?.length??0,e)}insertTag(e,t){return this.insertTags(e,[t])[0]}insertTags(e,n){if(t.ArrayUtils.isNullOrEmpty(n))return[];let r=this._getWriterWithQueuedIndentation(),i=this.getTags();if(e=tt(e,i.length),i.length===0&&!this.isMultiLine()){let e=this._context.structurePrinterFactory.forJSDoc();this.replaceWithText(t=>{e.printText(t,{description:this.getDescription(),tags:n})})}else{let t=this._context.structurePrinterFactory.forJSDocTag({printStarsOnNewLine:!0});r.newLine().write(` * `),t.printTexts(r,n),r.newLine().write(` *`),r.conditionalWrite(e<i.length,` `);let o=a.call(this),c=s.call(this);At({parent:this,insertPos:o,replacing:{textLength:c-o},newText:r.toString()})}return Xe(i,this.getTags(),e,!1);function a(){let n=e<i.length?i[e].getStart():this.getEnd()-2,r=this.getStart()+3;return Math.max(r,Ne(this.getSourceFile().getFullText(),n,e=>!t.StringUtils.isWhitespaceCharCode(e)&&e!==o.ASTERISK))}function s(){return e<i.length?i[e].getStart():this.getEnd()-1}}remove(){Lt({children:[this],removeFollowingSpaces:!0,removeFollowingNewLines:!0})}set(e){return ge($l.prototype,this,e),e.tags==null?(e.description!=null&&this.setDescription(e.description),this):this.replaceWithText(t=>{this._context.structurePrinterFactory.forJSDoc().printText(t,{description:e.description??this.getDescription(),tags:e.tags})})}getStructure(){return he($l.prototype,this,{kind:e.StructureKind.JSDoc,description:this.getDescription(),tags:this.getTags().map(e=>e.getStructure())})}},tu=class extends V{},nu=ba(tu),ru=class extends nu{},iu=class extends tu{getElementTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.elementType)}},au=class extends tu{getCheckType(){return this._getNodeFromCompilerNode(this.compilerNode.checkType)}getExtendsType(){return this._getNodeFromCompilerNode(this.compilerNode.extendsType)}getTrueType(){return this._getNodeFromCompilerNode(this.compilerNode.trueType)}getFalseType(){return this._getNodeFromCompilerNode(this.compilerNode.falseType)}},ou=ga(tu),su=class extends ou{},cu=Ma(Gi(su)),lu=class extends cu{},uu=Ya(ru),du=class extends uu{},fu=Ta(su),pu=class extends fu{},mu=class extends ru{setArgument(e){let t=this.getArgument();if(V.isLiteralTypeNode(t)){let n=t.getLiteral();if(V.isStringLiteral(n))return n.setLiteralValue(e),this}return t.replaceWithText(t=>t.quote(e),this._getWriterWithQueuedChildIndentation()),this}getArgument(){return this._getNodeFromCompilerNode(this.compilerNode.argument)}setQualifier(e){let n=this.getQualifier();return n==null?At({insertPos:this.getFirstChildByKindOrThrow(t.SyntaxKind.CloseParenToken).getEnd(),parent:this,newText:this._getWriterWithQueuedIndentation().write(`.`).write(e).toString()}):n.replaceWithText(e,this._getWriterWithQueuedChildIndentation()),this}getQualifierOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getQualifier(),e??(()=>`Expected to find a qualifier for the import type: ${this.getText()}`),this)}getQualifier(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.qualifier)}getAttributes(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.attributes)}getAttributesOrThrow(e){return t.errors.throwIfNullOrUndefined(this._getNodeFromCompilerNodeIfExists(this.compilerNode.attributes),e??`Could not find import type assertion container.`,this)}},hu=class extends tu{getObjectTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.objectType)}getIndexTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.indexType)}},gu=class extends tu{getTypeParameter(){return this._getNodeFromCompilerNode(this.compilerNode.typeParameter)}},_u=class extends tu{getTypeNodes(){return this.compilerNode.types.map(e=>this._getNodeFromCompilerNode(e))}},vu=class extends tu{getLiteral(){let e=this.compilerNode.literal;return this._getNodeFromCompilerNode(e)}},yu=class extends tu{getNameTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.nameType)}getNameTypeNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getNameTypeNode(),e??`Type did not exist.`,this)}getReadonlyToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.readonlyToken)}getReadonlyTokenOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getReadonlyToken(),e??`Readonly token did not exist.`,this)}getQuestionToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.questionToken)}getQuestionTokenOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getQuestionToken(),e??`Question token did not exist.`,this)}getTypeParameter(){return this._getNodeFromCompilerNode(this.compilerNode.typeParameter)}getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTypeNode(),e??`Type did not exist, but was expected to exist.`,this)}},bu=(e=>xa(la(kn(Ui(ia(e))))))(tu),xu=class extends bu{getTypeNode(){return super.getTypeNode()}removeType(){throw new t.errors.InvalidOperationError(`Cannot remove the type of a named tuple member.`)}},Su=class extends tu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}setType(e){return this.getTypeNode().replaceWithText(e),this}},Cu=class extends tu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},wu=class extends tu{getHead(){return this._getNodeFromCompilerNode(this.compilerNode.head)}getTemplateSpans(){return this.compilerNode.templateSpans.map(e=>this._getNodeFromCompilerNode(e))}setLiteralValue(e){let t=this.getChildIndex(),n=this.getParentSyntaxList()??this.getParentOrThrow();return Qt({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:e}),n.getChildAtIndex(t)}},Tu=class extends tu{},Eu=class extends tu{getElements(){return this.compilerNode.elements.map(e=>this._getNodeFromCompilerNode(e))}},Du=(e=>Ta(xa(Ui(_e(Nn(Gi(ia(e))))))))(fs),Ou=class extends Du{set(e){return ge(Du.prototype,this,e),this}getStructure(){return he(Du.prototype,this,{kind:e.StructureKind.TypeAlias,type:this.getTypeNodeOrThrow().getText()})}},ku=Ca(tu),Au=class extends ku{},ju=class extends tu{getOperator(){return this.compilerNode.operator}getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}};e.TypeParameterVariance=void 0,(function(e){e[e.None=0]=`None`,e[e.In=1]=`In`,e[e.Out=2]=`Out`,e[e.InOut=3]=`InOut`})(e.TypeParameterVariance||={});var Mu=(e=>Gi(ia(e)))(V),Nu=class extends Mu{isConst(){return this.hasModifier(t.SyntaxKind.ConstKeyword)}setIsConst(e){return this.toggleModifier(`const`,e)}getConstraint(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.constraint)}getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected to find the type parameter's constraint.`,this)}setConstraint(e){if(e=this.getParentOrThrow()._getTextWithQueuedChildIndentation(e),t.StringUtils.isNullOrWhitespace(e))return this.removeConstraint(),this;let n=this.getConstraint();if(n!=null)return n.replaceWithText(e),this;let r=this.getNameNode();return At({parent:this,insertPos:r.getEnd(),newText:` extends ${e}`}),this}removeConstraint(){return Pu(this.getConstraint(),t.SyntaxKind.ExtendsKeyword),this}getDefault(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.default)}getDefaultOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefault(),e??`Expected to find the type parameter's default.`,this)}setDefault(e){if(e=this.getParentOrThrow()._getTextWithQueuedChildIndentation(e),t.StringUtils.isNullOrWhitespace(e))return this.removeDefault(),this;let n=this.getDefault();if(n!=null)return n.replaceWithText(e),this;let r=this.getConstraint()||this.getNameNode();return At({parent:this,insertPos:r.getEnd(),newText:` = ${e}`}),this}removeDefault(){return Pu(this.getDefault(),t.SyntaxKind.EqualsToken),this}setVariance(t){return this.toggleModifier(`in`,(t&e.TypeParameterVariance.In)!==0),this.toggleModifier(`out`,(t&e.TypeParameterVariance.Out)!==0),this}getVariance(){let n=e.TypeParameterVariance.None;return this.hasModifier(t.SyntaxKind.InKeyword)&&(n|=e.TypeParameterVariance.In),this.hasModifier(t.SyntaxKind.OutKeyword)&&(n|=e.TypeParameterVariance.Out),n}remove(){let e=this.getParentSyntaxListOrThrow();e.getChildrenOfKind(t.SyntaxKind.TypeParameter).length===1?n():Wt(this);function n(){Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.LessThanToken),e,e.getNextSiblingIfKindOrThrow(t.SyntaxKind.GreaterThanToken)]})}}set(e){return ge(Mu.prototype,this,e),e.isConst!=null&&this.setIsConst(e.isConst),e.constraint==null?e.hasOwnProperty(t.nameof(e,`constraint`))&&this.removeConstraint():this.setConstraint(e.constraint),e.default==null?e.hasOwnProperty(t.nameof(e,`default`))&&this.removeDefault():this.setDefault(e.default),e.variance!=null&&this.setVariance(e.variance),this}getStructure(){let t=this.getConstraint(),n=this.getDefault();return he(Mu.prototype,this,{kind:e.StructureKind.TypeParameter,isConst:this.isConst(),constraint:t?.getText({trimLeadingIndentation:!0}),default:n?n.getText({trimLeadingIndentation:!0}):void 0,variance:this.getVariance()})}};function Pu(e,t){e!=null&&Lt({children:[e.getPreviousSiblingIfKindOrThrow(t),e],removePrecedingSpaces:!0})}var Fu=class extends tu{getParameterNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.parameterName)}hasAssertsModifier(){return this.compilerNode.assertsModifier!=null}getAssertsModifier(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.assertsModifier)}getAssertsModifierOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAssertsModifier(),e??`Expected to find an asserts modifier.`,this)}getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTypeNode(),e??`Expected to find a type node.`,this)}},Iu=class extends ru{getExprName(){return this._getNodeFromCompilerNode(this.compilerNode.exprName)}},Lu=class extends ru{getTypeName(){return this._getNodeFromCompilerNode(this.compilerNode.typeName)}},Ru=class extends tu{getTypeNodes(){return this.compilerNode.types.map(e=>this._getNodeFromCompilerNode(e))}},zu=class extends tu{},Bu=class extends zu{},Vu=V,Hu=class extends Vu{getTagName(){return this.getTagNameNode().getText()}getTagNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.tagName)}setTagName(e){return this.set({tagName:e})}getComment(){if(this.compilerNode.comment!=null)return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:this.compilerNode.comment.map(e=>this._getNodeFromCompilerNodeIfExists(e))}getCommentText(){return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:t.ts.getTextOfJSDocComment(this.compilerNode.comment)}remove(){let e=this.getParentOrThrow().getStart()+3,t=Ku(this),n=t==null,r=i.call(this);Lt({children:[this],customRemovalPos:r,customRemovalEnd:Gu(this,t),replaceTrivia:a.call(this)});function i(){return Math.max(e,qu(this,this.getStart()))}function a(){return r===e&&n?``:`${this._context.manipulationSettings.getNewLineKindAsString()}${this.getParentOrThrow().getIndentationText()} `+(n?``:`* `)}}set(e){return ge(Vu.prototype,this,e),e.text!=null||e.tagName!=null?this.replaceWithText(t=>{this._context.structurePrinterFactory.forJSDocTag({printStarsOnNewLine:!0}).printText(t,{tagName:e.tagName??this.getTagName(),text:e.text==null?Uu(this):e.text})}):this}replaceWithText(e){let t=F(this._getWriterWithQueuedIndentation(),e),n=this.getParentOrThrow(),r=this.getChildIndex(),i=this.getStart();return At({parent:n,insertPos:i,newText:t,replacing:{textLength:Wu(this)-i}}),n.getChildren()[r]}getStructure(){let t=Uu(this);return he(Vu.prototype,this,{kind:e.StructureKind.JSDocTag,tagName:this.getTagName(),text:t.length===0?void 0:t})}};function Uu(e){let t=e.getSourceFile().getFullText(),n=e.getTagNameNode().getEnd(),r=Wu(e),i=Math.min(t.charCodeAt(n)===o.SPACE?n+1:n,r);return Ql(t.substring(i,r))}function Wu(e){return qu(e,Gu(e))}function Gu(e,t){return t??=Ku(e),t==null?e.getParentOrThrow().getEnd()-2:t.getStart()}function Ku(e){let n=e.getParentIfKindOrThrow(t.SyntaxKind.JSDoc).getTags();return n[n.indexOf(e)+1]}function qu(e,n){return Ne(e.getSourceFile().getFullText(),n,e=>e!==o.ASTERISK&&!t.StringUtils.isWhitespaceCharCode(e))}var Ju=class extends Hu{},Yu=class extends Hu{},Xu=class extends Hu{},Zu=class extends Hu{},Qu=class extends Hu{},$u=class extends Hu{},ed=ga(zu),td=class extends ed{},nd=class extends Hu{},rd=class extends V{},id=class extends V{},ad=class extends V{},od=class extends V{},sd=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},cd=class extends V{getName(){return this._getNodeFromCompilerNode(this.compilerNode.name)}},ld=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}isPostfix(){return this.compilerNode.postfix}},ud=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}isPostfix(){return this.compilerNode.postfix}},dd=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},fd=Xl(Hu),pd=class extends fd{},md=class extends Hu{},hd=Yl(Hu),gd=class extends hd{},_d=class extends Hu{},J=Yl(Hu),vd=class extends J{},yd=class extends Hu{},bd=class extends Hu{},xd=class extends Hu{},Sd=Xl(Hu),Cd=class extends Sd{},wd=Xl(Hu),Td=class extends wd{},Ed=Xl(Hu),Dd=class extends Ed{},Od=class extends zu{getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}},kd=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getName(){return this.compilerObject.name}getText(){return this.compilerObject.text??[]}},Ad=Zl(Hu),jd=class extends Ad{getConstraint(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.constraint)}getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected to find the JS doc template tag's constraint.`,this)}},Md=class extends V{},Nd=Xl(Hu),Pd=class extends Nd{},Fd=Xl(Hu),Id=class extends Fd{},Ld=class extends Hu{},Rd=class extends tu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},zd=class extends zu{isArrayType(){return this.compilerNode.isArrayType}getPropertyTags(){return this.compilerNode.jsDocPropertyTags?this.compilerNode.jsDocPropertyTags.map(e=>this._getNodeFromCompilerNode(e)):void 0}},Bd=class extends Hu{getTypeExpression(){let e=this.compilerNode.typeExpression;if(!(e!=null&&e.pos===e.end))return this._getNodeFromCompilerNodeIfExists(this.compilerNode.typeExpression)}},Vd=class extends Hu{},Hd=class extends zu{},Ud=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},Wd=class extends V{remove(){zt({children:[this],getSiblingFormatting:()=>ve.Newline})}},Gd=(e=>va(Oc(Ui(_e(Nn(Gi(ia(e))))))))(fs),Kd=class extends Gd{set(e){return ge(Gd.prototype,this,e),e.isConst!=null&&this.setIsConstEnum(e.isConst),e.members!=null&&(this.getMembers().forEach(e=>e.remove()),this.addMembers(e.members)),this}addMember(e){return this.addMembers([e])[0]}addMembers(e){return this.insertMembers(this.getMembers().length,e)}insertMember(e,t){return this.insertMembers(e,[t])[0]}insertMembers(e,t){if(t.length===0)return[];let n=this.getMembersWithComments();e=tt(e,n.length);let r=this._getWriterWithChildIndentation();return this._context.structurePrinterFactory.forEnumMember().printTexts(r,t),Mt({parent:this.getChildSyntaxListOrThrow(),currentNodes:n,insertIndex:e,newText:r.toString(),useNewLines:!0,useTrailingCommas:this._context.manipulationSettings.getUseTrailingCommas()}),Xe(n,this.getMembersWithComments(),e,!i());function i(){return t instanceof Array?t.every(e=>typeof e==`object`):!1}}getMember(e){return s(this.getMembers(),e)}getMemberOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getMember(e),()=>l(`enum member`,e))}getMembers(){return this.compilerNode.members.map(e=>this._getNodeFromCompilerNode(e))}getMembersWithComments(){let e=this.compilerNode;return T.getContainerArray(e,this.getSourceFile().compilerNode).map(e=>this._getNodeFromCompilerNode(e))}setIsConstEnum(e){return this.toggleModifier(`const`,e)}isConstEnum(){return this.getConstKeyword()!=null}getConstKeyword(){return this.getFirstModifierByKind(t.SyntaxKind.ConstKeyword)}getStructure(){return he(Gd.prototype,this,{kind:e.StructureKind.Enum,isConst:this.isConstEnum(),members:this.getMembers().map(e=>e.getStructure())})}},qd=(e=>Ui(Vi(aa(e))))(V),Jd=class extends qd{getValue(){return this._context.typeChecker.getConstantValue(this)}setValue(e){let n;if(typeof e==`string`){let r=this._context.manipulationSettings.getQuoteKind();n=r+t.StringUtils.escapeForWithinString(e,r)+r}else n=e.toString();return this.setInitializer(n),this}remove(){let e=[this],n=this.getNextSiblingIfKind(t.SyntaxKind.CommaToken);n!=null&&e.push(n),zt({children:e,getSiblingFormatting:()=>ve.Newline})}set(e){return ge(qd.prototype,this,e),e.value==null?e.hasOwnProperty(t.nameof(e,`value`))&&e.initializer==null&&this.removeInitializer():this.setValue(e.value),this}getStructure(){return he(qd.prototype,this,{kind:e.StructureKind.EnumMember,value:void 0})}},Yd=class extends V{getTypeNodes(){return this.compilerNode.types?.map(e=>this._getNodeFromCompilerNode(e))??[]}getToken(){return this.compilerNode.token}removeExpression(e){let t=this.getTypeNodes(),n=typeof e==`number`?r(e):e;if(t.length===1){let e=this.getParentSyntaxListOrThrow().getChildren();e.length===1?Lt({children:[e[0].getParentSyntaxListOrThrow()],removePrecedingSpaces:!0}):Lt({children:[this],removePrecedingSpaces:!0})}else Wt(n);return this;function r(e){return t[tt(e,t.length-1)]}}},Xd=class extends V{remove(){Ht(this)}},Zd=(e=>Ta(wn(Ui(ga(e)))))(Xd),Qd=class extends Zd{set(e){return ge(Zd.prototype,this,e),this}getStructure(){return he(Zd.prototype,this,{kind:e.StructureKind.CallSignature})}},$d=class extends Xd{},ef=(e=>Ta(wn(Ui(ga(e)))))(Xd),tf=class extends ef{set(e){return ge(ef.prototype,this,e),this}getStructure(){return he(ef.prototype,this,{kind:e.StructureKind.ConstructSignature})}},nf=(e=>da(wn(Ui(ua(Gi(e))))))(Xd),rf=class extends nf{getKeyName(){return this.getKeyNameNode().getText()}setKeyName(e){t.errors.throwIfWhitespaceOrNotString(e,`name`),this.getKeyName()!==e&&this.getKeyNameNode().replaceWithText(e,this._getWriterWithQueuedChildIndentation())}getKeyNameNode(){let e=this.compilerNode.parameters[0];return this._getNodeFromCompilerNode(e.name)}getKeyType(){return this.getKeyNameNode().getType()}setKeyType(e){t.errors.throwIfWhitespaceOrNotString(e,`type`);let n=this.getKeyTypeNode();return n.getText()===e||n.replaceWithText(e,this._getWriterWithQueuedChildIndentation()),this}getKeyTypeNode(){let e=this.compilerNode.parameters[0];return this._getNodeFromCompilerNode(e.type)}set(e){return ge(nf.prototype,this,e),e.keyName!=null&&this.setKeyName(e.keyName),e.keyType!=null&&this.setKeyType(e.keyType),this}getStructure(){let t=this.getKeyTypeNode();return he(nf.prototype,this,{kind:e.StructureKind.IndexSignature,keyName:this.getKeyName(),keyType:t.getText()})}},af=(e=>Ca(va(Fi(Ri(Ta(Ui(_e(Oc(Nn(Gi(ia(e))))))))))))(fs),of=class extends af{getBaseTypes(){return this.getType().getBaseTypes()}getBaseDeclarations(){return this.getType().getBaseTypes().map(e=>e.getSymbol()?.getDeclarations()??[]).flat()}getImplementations(){return this.getNameNode().getImplementations()}set(e){return ge(af.prototype,this,e),this}getStructure(){return he(af.prototype,this,{kind:e.StructureKind.Interface})}},sf=(e=>wn(Ui(la(Ta(ga(aa(e)))))))(Xd),cf=class extends sf{set(e){return ge(sf.prototype,this,e),this}getStructure(){return he(sf.prototype,this,{kind:e.StructureKind.MethodSignature})}},lf=(e=>wn(Ui(ua(la(Vi(xa(aa(Gi(e)))))))))(Xd),uf=class extends lf{set(e){return ge(lf.prototype,this,e),this}getStructure(){return he(lf.prototype,this,{kind:e.StructureKind.PropertySignature})}};function df(e){return class extends e{getAttributes(){return this.compilerNode.attributes.properties.map(e=>this._getNodeFromCompilerNode(e))}getAttributeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAttribute(e),()=>l(`attribute`,e))}getAttribute(e){return s(this.getAttributes(),e)}addAttribute(e){return this.addAttributes([e])[0]}addAttributes(e){return this.insertAttributes(this.compilerNode.attributes.properties.length,e)}insertAttribute(e,t){return this.insertAttributes(e,[t])[0]}insertAttributes(e,n){if(n.length===0)return[];let r=this.compilerNode.attributes.properties.length;e=tt(e,r);let i=e===0?this.getTagNameNode().getEnd():this.getAttributes()[e-1].getEnd(),a=this._getWriterWithQueuedChildIndentation();return new Gn(this._context.structurePrinterFactory.forJsxAttributeDecider()).printText(a,n),At({insertPos:i,newText:` `+a.toString(),parent:this.getNodeProperty(`attributes`).getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList)}),Xe(r,this.getAttributes(),e,!1)}set(t){return ge(e.prototype,this,t),t.attributes!=null&&(this.getAttributes().forEach(e=>e.remove()),this.addAttributes(t.attributes)),this}getStructure(){return he(e.prototype,this,{attributes:this.getAttributes().map(e=>e.getStructure())})}}}function ff(e){return class extends e{getTagNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.tagName)}set(t){return ge(e.prototype,this,t),t.name!=null&&this.getTagNameNode().replaceWithText(t.name),this}getStructure(){return he(e.prototype,this,{name:this.getTagNameNode().getText()})}}}function pf(e){return class extends e{getText(){return this.compilerNode.text}getDefinitionNodes(){return this.getDefinitions().map(e=>e.getDeclarationNode()).filter(e=>e!=null)}getDefinitions(){return this._context.languageService.getDefinitions(this)}}}var mf=qa(V),hf=class extends mf{},gf=pf(Yi(Zi(Ua))),_f=class extends gf{getImplementations(){return this._context.languageService.getImplementations(this)}},vf=pf(Yi(Zi(V))),yf=class extends vf{},bf=class extends V{getLeft(){return this._getNodeFromCompilerNode(this.compilerNode.left)}getRight(){return this._getNodeFromCompilerNode(this.compilerNode.right)}},xf=V,Sf=class extends xf{getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}setName(e){return this.getNameNode().replaceWithText(t=>{typeof e==`object`?this._context.structurePrinterFactory.forJsxNamespacedName().printText(t,e):t.write(e)}),this}getInitializerOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getInitializer(),e??`Expected to find an initializer for the JSX attribute '${this.getNameNode().getText()}'`,this)}getInitializer(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.initializer)}setInitializer(e){let n=F(this._getWriterWithQueuedIndentation(),e);if(t.StringUtils.isNullOrWhitespace(n))return this.removeInitializer(),this;let r=this.getInitializer();return r==null?(At({insertPos:this.getNameNode().getEnd(),parent:this,newText:`=${n}`}),this):(r.replaceWithText(n),this)}removeInitializer(){let e=this.getInitializer();return e==null||Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.EqualsToken),e],removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this}remove(){Lt({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}set(e){return ge(xf.prototype,this,e),e.name!=null&&this.setName(e.name),e.initializer==null?e.hasOwnProperty(t.nameof(e,`initializer`))&&this.removeInitializer():this.setInitializer(e.initializer),this}getStructure(){let t=this.getInitializer(),n=this.getNameNode();return he(xf.prototype,this,{name:n instanceof _f?n.getText():n.getStructure(),kind:e.StructureKind.JsxAttribute,initializer:t?.getText()})}},Cf=(e=>ff(e))(V),wf=class extends Cf{},Tf=class extends Na{},Ef=Ua,Df=class extends Ef{getJsxChildren(){return this.compilerNode.children.map(e=>this._getNodeFromCompilerNode(e))}getOpeningElement(){return this._getNodeFromCompilerNode(this.compilerNode.openingElement)}getClosingElement(){return this._getNodeFromCompilerNode(this.compilerNode.closingElement)}setBodyText(e){let t=un(this._getWriterWithIndentation(),e);return Of(this,t),this}setBodyTextInline(e){let t=this._getWriterWithQueuedChildIndentation();return ie(t,e),t.isLastNewLine()&&(t.setIndentationLevel(Math.max(0,this.getIndentationLevel()-1)),t.write(``)),Of(this,t.toString()),this}set(e){if(ge(Ef.prototype,this,e),e.attributes!=null){let t=this.getOpeningElement();t.getAttributes().forEach(e=>e.remove()),t.addAttributes(e.attributes)}if(e.children!=null)throw new t.errors.NotImplementedError(`Setting JSX children is currently not implemented. Please open an issue if you need this.`);return e.bodyText==null?e.hasOwnProperty(t.nameof(e,`bodyText`))&&this.setBodyTextInline(``):this.setBodyText(e.bodyText),e.name!=null&&(this.getOpeningElement().getTagNameNode().replaceWithText(e.name),this.getClosingElement().getTagNameNode().replaceWithText(e.name)),this}getStructure(){let t=this.getOpeningElement(),n=he(Ef.prototype,this,{kind:e.StructureKind.JsxElement,name:t.getTagNameNode().getText(),attributes:t.getAttributes().map(e=>e.getStructure()),children:void 0,bodyText:dn(this)});return delete n.children,n}};function Of(e,t){let n=e.getOpeningElement(),r=e.getClosingElement();At({insertPos:n.getEnd(),newText:t,parent:e.getChildSyntaxListOrThrow(),replacing:{textLength:r.getStart()-n.getEnd()}})}var kf=Ga(kn(Na)),Af=class extends kf{},jf=class extends Ua{getJsxChildren(){return this.compilerNode.children.map(e=>this._getNodeFromCompilerNode(e))}getOpeningFragment(){return this._getNodeFromCompilerNode(this.compilerNode.openingFragment)}getClosingFragment(){return this._getNodeFromCompilerNode(this.compilerNode.closingFragment)}},Mf=V,Nf=class extends Mf{getNamespaceNode(){return this._getNodeFromCompilerNode(this.compilerNode.namespace)}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}set(e){return this.getNamespaceNode().replaceWithText(e.namespace),this.getNameNode().replaceWithText(e.name),this}getStructure(){return{namespace:this.getNamespaceNode().getText(),name:this.getNameNode().getText()}}},Pf=(e=>df(ff(e)))(Na),Ff=class extends Pf{},If=class extends Na{},Lf=(e=>df(ff(e)))(Ua),Rf=class extends Lf{set(e){return ge(Lf.prototype,this,e),this}getStructure(){return he(Lf.prototype,this,{kind:e.StructureKind.JsxSelfClosingElement})}},zf=qa(V),Bf=class extends zf{remove(){Lt({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}set(e){return ge(zf.prototype,this,e),e.expression!=null&&this.setExpression(e.expression),this}getStructure(){return he(zf.prototype,this,{kind:e.StructureKind.JsxSpreadAttribute,expression:this.getExpression().getText()})}},Vf=Wi(V),Hf=class extends Vf{containsOnlyTriviaWhiteSpaces(){let e=this.compilerNode;return typeof e.containsOnlyWhiteSpaces==`boolean`?e.containsOnlyWhiteSpaces:this.compilerNode.containsOnlyTriviaWhiteSpaces}},Uf=go,Wf=class extends Uf{getLiteralValue(){let e=this.compilerNode.text;if(typeof BigInt>`u`)throw new t.errors.InvalidOperationError(`Runtime environment does not support BigInts. Perhaps work with the text instead?`);let n=e.substring(0,e.length-1);return BigInt(n)}setLiteralValue(e){if(typeof e!=`bigint`)throw new t.errors.ArgumentTypeError(`value`,`bigint`,typeof e);return Qt({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:e.toString()+`n`}),this}},Gf=Ua,Kf=class extends Gf{getLiteralValue(){return Xf(this)}setLiteralValue(e){return Yf(this,e)}},qf=Ua,Jf=class extends qf{getLiteralValue(){return Xf(this)}setLiteralValue(e){return Yf(this,e)}};function Yf(e,t){if(Xf(e)===t)return e;let n=e.getParentSyntaxList()||e.getParentOrThrow(),r=e.getChildIndex();return e.replaceWithText(t?`true`:`false`),n.getChildAtIndex(r)}function Xf(e){return e.getKind()===t.SyntaxKind.TrueKeyword}var Zf=Ua,Qf=class extends Zf{},$f=go,ep=class extends $f{getLiteralValue(){let e=this.compilerNode.text;return e.indexOf(`.`)>=0?parseFloat(e):parseInt(e,10)}setLiteralValue(e){return Qt({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:e.toString(10)}),this}};e.QuoteKind=void 0,(function(e){e.Single=`'`,e.Double=`"`})(e.QuoteKind||={});var tp=go,np=class extends tp{getLiteralValue(){let e=/^\/(.*)\/([^\/]*)$/,t=this.compilerNode.text,n=e.exec(t);return new RegExp(n[1],n[2])}setLiteralValue(e,t){let n;return typeof e==`string`?n=e:(n=e.source,t=e.flags),Qt({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:`/${n}/${t||``}`}),this}},rp=go,ip=class extends rp{getLiteralValue(){return this.compilerNode.text}setLiteralValue(e){return Qt({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:t.StringUtils.escapeForWithinString(e,this.getQuoteKind())}),this}getQuoteKind(){return this.getText()[0]===`'`?e.QuoteKind.Single:e.QuoteKind.Double}},ap=go,op=class extends ap{getLiteralValue(){return this.compilerNode.text}setLiteralValue(e){let t=this.getChildIndex(),n=this.getParentSyntaxList()||this.getParentOrThrow();return Qt({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:e}),n.getChildAtIndex(t)}},sp=class extends Ha{getTag(){return this._getNodeFromCompilerNode(this.compilerNode.tag)}getTemplate(){return this._getNodeFromCompilerNode(this.compilerNode.template)}removeTag(){let e=this.getParentSyntaxList()??this.getParentOrThrow(),t=this.getChildIndex(),n=this.getTemplate();return At({customMappings:(e,r)=>[{currentNode:n,newNode:e.getChildren(r)[t]}],parent:e,insertPos:this.getStart(),newText:this.getTemplate().getText(),replacing:{textLength:this.getWidth(),nodes:[this]}}),e.getChildAtIndex(t)}},cp=Ua,lp=class extends cp{getHead(){return this._getNodeFromCompilerNode(this.compilerNode.head)}getTemplateSpans(){return this.compilerNode.templateSpans.map(e=>this._getNodeFromCompilerNode(e))}setLiteralValue(e){let t=this.getChildIndex(),n=this.getParentSyntaxList()??this.getParentOrThrow();return Qt({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:e}),n.getChildAtIndex(t)}},up=Wi(V),dp=class extends up{},fp=Wi(V),pp=class extends fp{},mp=qa(V),hp=class extends mp{getLiteral(){return this._getNodeFromCompilerNode(this.compilerNode.literal)}},gp=Wi(V),_p=class extends gp{},vp=(e=>jn(An(xa(Vi(Qi(e))))))(V),yp=class extends vp{remove(){let e=this.getParentOrThrow();switch(e.getKind()){case t.SyntaxKind.VariableDeclarationList:n(this);break;case t.SyntaxKind.CatchClause:r(this);break;default:throw new t.errors.NotImplementedError(`Not implemented for syntax kind: ${e.getKindName()}`)}function n(n){let r=e.getParentIfKindOrThrow(t.SyntaxKind.VariableStatement);r.getDeclarations().length===1?r.remove():Wt(n)}function r(e){Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.OpenParenToken),e,e.getNextSiblingIfKindOrThrow(t.SyntaxKind.CloseParenToken)],removePrecedingSpaces:!0})}}getVariableStatementOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getVariableStatement(),e??`Expected the grandparent to be a variable statement.`,this)}getVariableStatement(){let e=this.getParentOrThrow().getParentOrThrow();return V.isVariableStatement(e)?e:void 0}set(e){return ge(vp.prototype,this,e),this}getStructure(){return he(vp.prototype,this,{kind:e.StructureKind.VariableDeclaration})}},bp=Gi(V),xp=class extends bp{getDeclarations(){return this.compilerNode.declarations.map(e=>this._getNodeFromCompilerNode(e))}getDeclarationKind(){let n=this.compilerNode.flags;return n&t.ts.NodeFlags.Let?e.VariableDeclarationKind.Let:(n&t.ts.NodeFlags.AwaitUsing)===t.ts.NodeFlags.AwaitUsing?e.VariableDeclarationKind.AwaitUsing:(n&t.ts.NodeFlags.Using)===t.ts.NodeFlags.Using?e.VariableDeclarationKind.Using:n&t.ts.NodeFlags.Const?e.VariableDeclarationKind.Const:e.VariableDeclarationKind.Var}getDeclarationKindKeywords(){let n=this.getDeclarationKind();switch(n){case e.VariableDeclarationKind.Const:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.ConstKeyword)];case e.VariableDeclarationKind.Let:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.LetKeyword)];case e.VariableDeclarationKind.Var:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.VarKeyword)];case e.VariableDeclarationKind.Using:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.UsingKeyword)];case e.VariableDeclarationKind.AwaitUsing:let r=this.getFirstChildByKindOrThrow(t.SyntaxKind.AwaitKeyword);return[r,r.getNextSiblingIfKindOrThrow(t.SyntaxKind.UsingKeyword)];default:return t.errors.throwNotImplementedForNeverValueError(n)}}setDeclarationKind(e){if(this.getDeclarationKind()===e)return this;let t=this.getDeclarationKindKeywords(),n=t[0].getStart(),r=t[t.length-1].getEnd();return At({insertPos:n,newText:e,parent:this,replacing:{textLength:r-n}}),this}addDeclaration(e){return this.addDeclarations([e])[0]}addDeclarations(e){return this.insertDeclarations(this.getDeclarations().length,e)}insertDeclaration(e,t){return this.insertDeclarations(e,[t])[0]}insertDeclarations(e,n){let r=this._getWriterWithQueuedChildIndentation(),i=new Vn(this._context.structurePrinterFactory.forVariableDeclaration()),a=this.compilerNode.declarations.length;return e=tt(e,a),i.printText(r,n),Mt({parent:this.getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList),currentNodes:this.getDeclarations(),insertIndex:e,newText:r.toString(),useTrailingCommas:!1}),Xe(a,this.getDeclarations(),e,!1)}},Sp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerSignature(){return this.#t}getTypeParameters(){return(this.compilerSignature.typeParameters||[]).map(e=>this.#e.compilerFactory.getTypeParameter(e))}getParameters(){return this.compilerSignature.parameters.map(e=>this.#e.compilerFactory.getSymbol(e))}getReturnType(){return this.#e.compilerFactory.getType(this.compilerSignature.getReturnType())}getDocumentationComments(){return this.compilerSignature.getDocumentationComment(this.#e.typeChecker.compilerObject).map(e=>this.#e.compilerFactory.getSymbolDisplayPart(e))}getJsDocTags(){return this.compilerSignature.getJsDocTags().map(e=>this.#e.compilerFactory.getJSDocTagInfo(e))}getDeclaration(){let{compilerFactory:e}=this.#e,t=this.compilerSignature.getDeclaration();return e.getNodeFromCompilerNode(t,e.getSourceFileForNode(t))}},Cp=class{#e;#t;get compilerSymbol(){return this.#t}constructor(e,t){this.#e=e,this.#t=t,this.getValueDeclaration(),this.getDeclarations()}getName(){return this.compilerSymbol.getName()}getEscapedName(){return this.compilerSymbol.getEscapedName()}getAliasedSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAliasedSymbol(),e??`Expected to find an aliased symbol.`)}getImmediatelyAliasedSymbol(){return this.#e.typeChecker.getImmediatelyAliasedSymbol(this)}getImmediatelyAliasedSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getImmediatelyAliasedSymbol(),e??`Expected to find an immediately aliased symbol.`)}getAliasedSymbol(){return this.#e.typeChecker.getAliasedSymbol(this)}getExportSymbol(){return this.#e.typeChecker.getExportSymbolOfSymbol(this)}isAlias(){return(this.getFlags()&t.SymbolFlags.Alias)===t.SymbolFlags.Alias}isOptional(){return(this.getFlags()&t.SymbolFlags.Optional)===t.SymbolFlags.Optional}getFlags(){return this.compilerSymbol.getFlags()}hasFlags(e){return(this.compilerSymbol.flags&e)===e}getValueDeclarationOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getValueDeclaration(),e??(()=>`Expected to find the value declaration of symbol '${this.getName()}'.`))}getValueDeclaration(){let e=this.compilerSymbol.valueDeclaration;if(e!=null)return this.#e.compilerFactory.getNodeFromCompilerNode(e,this.#e.compilerFactory.getSourceFileForNode(e))}getDeclarations(){return(this.compilerSymbol.declarations??[]).map(e=>this.#e.compilerFactory.getNodeFromCompilerNode(e,this.#e.compilerFactory.getSourceFileForNode(e)))}getExportOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getExport(e),n??(()=>`Expected to find export with name: ${e}`))}getExport(e){if(this.compilerSymbol.exports==null)return;let n=this.compilerSymbol.exports.get(t.ts.escapeLeadingUnderscores(e));return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getExports(){return this.compilerSymbol.exports==null?[]:Array.from(this.compilerSymbol.exports.values()).map(e=>this.#e.compilerFactory.getSymbol(e))}getGlobalExportOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getGlobalExport(e),n??(()=>`Expected to find global export with name: ${e}`))}getGlobalExport(e){if(this.compilerSymbol.globalExports==null)return;let n=this.compilerSymbol.globalExports.get(t.ts.escapeLeadingUnderscores(e));return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getGlobalExports(){return this.compilerSymbol.globalExports==null?[]:Array.from(this.compilerSymbol.globalExports.values()).map(e=>this.#e.compilerFactory.getSymbol(e))}getMemberOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getMember(e),n??`Expected to find member with name: ${e}`)}getMember(e){if(this.compilerSymbol.members==null)return;let n=this.compilerSymbol.members.get(t.ts.escapeLeadingUnderscores(e));return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getMembers(){return this.compilerSymbol.members==null?[]:Array.from(this.compilerSymbol.members.values()).map(e=>this.#e.compilerFactory.getSymbol(e))}getDeclaredType(){return this.#e.typeChecker.getDeclaredTypeOfSymbol(this)}getTypeAtLocation(e){return this.#e.typeChecker.getTypeOfSymbolAtLocation(this,e)}getFullyQualifiedName(){return this.#e.typeChecker.getFullyQualifiedName(this)}getJsDocTags(){return this.compilerSymbol.getJsDocTags(this.#e.typeChecker.compilerObject).map(e=>new kd(e))}},wp=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getStart(){return this.compilerObject.start}getEnd(){return this.compilerObject.start+this.compilerObject.length}getLength(){return this.compilerObject.length}},Tp=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getSpan(){return new wp(this.compilerObject.span)}getNewText(){return this.compilerObject.newText}};Vc([t.Memoize],Tp.prototype,`getSpan`,null);var Ep=class{#e;#t;#n;#r;#i;constructor(e,t){this.#e=e,this.#t=t;let n=e.compilerFactory.addOrGetSourceFileFromFilePath(e.fileSystemWrapper.getStandardizedAbsolutePath(t.fileName),{markInProject:!1,scriptKind:void 0});this.#r=n!=null,t.isNewFile||(this.#n=n)}getFilePath(){return this.#t.fileName}getSourceFile(){return this.#n}getTextChanges(){return this.#t.textChanges.map(e=>new Tp(e))}applyChanges(e={}){if(this.#i)return;if(this.isNewFile()&&this.#r&&!e.overwrite)throw new t.errors.InvalidOperationError(`Cannot apply file text change for creating a new file when the file exists at path ${this.getFilePath()}. Did you mean to provide the overwrite option?`);let n;if(n=this.isNewFile()?this.#e.project.createSourceFile(this.getFilePath(),``,{overwrite:e.overwrite}):this.getSourceFile(),n==null)throw new t.errors.InvalidOperationError(`Cannot apply file text change to modify existing file that doesn't exist at path: ${this.getFilePath()}`);return n.applyTextChanges(this.getTextChanges()),n._markAsInProject(),this.#i=!0,this}isNewFile(){return!!this.#t.isNewFile}};Vc([t.Memoize],Ep.prototype,`getTextChanges`,null);var Dp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getDescription(){return this.compilerObject.description}getChanges(){return this.compilerObject.changes.map(e=>new Ep(this.#e,e))}},Op=class extends Dp{getFixName(){return this.compilerObject.fixName}getFixId(){return this.compilerObject.fixId}getFixAllDescription(){return this.compilerObject.fixAllDescription}},kp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getChanges(){return this.compilerObject.changes.map(e=>new Ep(this.#e,e))}applyChanges(e){for(let t of this.getChanges())t.applyChanges(e);return this}};Vc([t.Memoize],kp.prototype,`getChanges`,null);var Ap=class{_context;_compilerObject;_sourceFile;constructor(e,t){this._context=e,this._compilerObject=t,this._sourceFile=this._context.compilerFactory.addOrGetSourceFileFromFilePath(e.fileSystemWrapper.getStandardizedAbsolutePath(this.compilerObject.fileName),{markInProject:!1,scriptKind:void 0}),this._sourceFile._doActionPreNextModification(()=>this.getNode())}get compilerObject(){return this._compilerObject}getSourceFile(){return this._sourceFile}getTextSpan(){return new wp(this.compilerObject.textSpan)}getNode(){let e=this.getTextSpan(),t=this.getSourceFile(),n=e.getStart(),r=e.getEnd();return i();function i(){let e;return t._context.compilerFactory.forgetNodesCreatedInBlock(i=>{let a,o=t;for(;o!=null;){if(a??(e=o),o.getStart()===n&&o.getWidth()===r)e=a=o;else if(a!=null)break;o=o.getChildAtPos(n)}e!=null&&i(e)}),e}}getOriginalTextSpan(){let{originalTextSpan:e}=this.compilerObject;return e==null?void 0:new wp(e)}getOriginalFileName(){return this.compilerObject.originalFileName}};Vc([t.Memoize],Ap.prototype,`getTextSpan`,null),Vc([t.Memoize],Ap.prototype,`getNode`,null),Vc([t.Memoize],Ap.prototype,`getOriginalTextSpan`,null);var jp=class extends Ap{constructor(e,t){super(e,t),this.getSourceFile()._doActionPreNextModification(()=>this.getDeclarationNode())}getKind(){return this.compilerObject.kind}getName(){return this.compilerObject.name}getContainerKind(){return this.compilerObject.containerKind}getContainerName(){return this.compilerObject.containerName}getDeclarationNode(){if(this.getKind()===`module`&&this.getTextSpan().getLength()===this.getSourceFile().getFullWidth())return this.getSourceFile();let e=this.getTextSpan().getStart();return n(this.getSourceFile())?.getParentOrThrow();function n(r){if(r.getKind()===t.SyntaxKind.Identifier&&r.getStart()===e)return r;for(let t of r._getChildrenIterator())if(t.getPos()<=e&&t.getEnd()>e)return n(t)}}};Vc([t.Memoize],jp.prototype,`getDeclarationNode`,null);var Mp=class e{_compilerObject;constructor(e){this._compilerObject=e}get compilerObject(){return this._compilerObject}getMessageText(){return this.compilerObject.messageText}getNext(){let t=this.compilerObject.next;if(t!=null)return t instanceof Array?t.map(t=>new e(t)):[new e(t)]}getCode(){return this.compilerObject.code}getCategory(){return this.compilerObject.category}},Np=class{_context;_compilerObject;constructor(e,t){this._context=e,this._compilerObject=t,this.getSourceFile()}get compilerObject(){return this._compilerObject}getSourceFile(){if(this._context==null)return;let e=this.compilerObject.file;return e==null?void 0:this._context.compilerFactory.getSourceFile(e,{markInProject:!1})}getMessageText(){let e=this._compilerObject.messageText;return typeof e==`string`?e:this._context==null?new Mp(e):this._context.compilerFactory.getDiagnosticMessageChain(e)}getLineNumber(){let e=this.getSourceFile(),n=this.getStart();if(!(e==null||n==null))return t.StringUtils.getLineNumberAtPos(e.getFullText(),n)}getStart(){return this.compilerObject.start}getLength(){return this.compilerObject.length}getCategory(){return this.compilerObject.category}getCode(){return this.compilerObject.code}getSource(){return this.compilerObject.source}};Vc([t.Memoize],Np.prototype,`getSourceFile`,null);var Pp=class extends Np{constructor(e,t){super(e,t)}getLineNumber(){return super.getLineNumber()}getStart(){return super.getStart()}getLength(){return super.getLength()}getSourceFile(){return super.getSourceFile()}},Fp=class{#e;#t;constructor(e,t){this.#e=t,this.#t=e}get compilerObject(){return this.#e}getFilePath(){return this.#t.fileSystemWrapper.getStandardizedAbsolutePath(this.compilerObject.name)}getWriteByteOrderMark(){return this.compilerObject.writeByteOrderMark||!1}getText(){return this.compilerObject.text}},Ip=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getDiagnostics(){return this.compilerObject.diagnostics.map(e=>this.#e.compilerFactory.getDiagnostic(e))}getEmitSkipped(){return this.compilerObject.emitSkipped}getOutputFiles(){return this.compilerObject.outputFiles.map(e=>new Fp(this.#e,e))}};Vc([t.Memoize],Ip.prototype,`getDiagnostics`,null),Vc([t.Memoize],Ip.prototype,`getOutputFiles`,null);var Lp=class{_context;_compilerObject;constructor(e,t){this._context=e,this._compilerObject=t,this.getDiagnostics()}get compilerObject(){return this._compilerObject}getEmitSkipped(){return this.compilerObject.emitSkipped}getDiagnostics(){return this.compilerObject.diagnostics.map(e=>this._context.compilerFactory.getDiagnostic(e))}};Vc([t.Memoize],Lp.prototype,`getDiagnostics`,null);var Rp=class extends Ap{constructor(e,t){super(e,t)}getKind(){return this.compilerObject.kind}getDisplayParts(){return this.compilerObject.displayParts.map(e=>this._context.compilerFactory.getSymbolDisplayPart(e))}};Vc([t.Memoize],Rp.prototype,`getDisplayParts`,null);var zp=class extends Lp{#e;constructor(e,t,n){super(e,t),this.#e=n}getFiles(){return this.#e}saveFiles(){let e=this._context.fileSystemWrapper,t=this.#e.map(t=>e.writeFile(t.filePath,t.writeByteOrderMark?``+t.text:t.text));return Promise.all(t)}saveFilesSync(){let e=this._context.fileSystemWrapper;for(let t of this.#e)e.writeFileSync(t.filePath,t.writeByteOrderMark?``+t.text:t.text)}},Bp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getEdits(){return this.compilerObject.edits.map(e=>new Ep(this.#e,e))}getRenameFilePath(){return this.compilerObject.renameFilename}getRenameLocation(){return this.compilerObject.renameLocation}applyChanges(e){for(let t of this.getEdits())t.applyChanges(e);return this}};Vc([t.Memoize],Bp.prototype,`getEdits`,null);var Vp=class{_context;#e;#t;constructor(e,t){this._context=e,this.#e=t,this.#t=this.compilerObject.references.map(t=>e.compilerFactory.getReferencedSymbolEntry(t))}get compilerObject(){return this.#e}getDefinition(){return this._context.compilerFactory.getReferencedSymbolDefinitionInfo(this.compilerObject.definition)}getReferences(){return this.#t}};Vc([t.Memoize],Vp.prototype,`getDefinition`,null);var Hp=class extends jp{constructor(e,t){super(e,t)}getDisplayParts(){return this.compilerObject.displayParts.map(e=>this._context.compilerFactory.getSymbolDisplayPart(e))}};Vc([t.Memoize],Hp.prototype,`getDisplayParts`,null);var Up=class extends Ap{constructor(e,t){super(e,t)}isWriteAccess(){return this.compilerObject.isWriteAccess}isInString(){return this.compilerObject.isInString}},Wp=class extends Up{constructor(e,t){super(e,t)}isDefinition(){return this.compilerObject.isDefinition}},Gp=class extends Ap{getPrefixText(){return this._compilerObject.prefixText}getSuffixText(){return this._compilerObject.suffixText}},Kp=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getText(){return this.compilerObject.text}getKind(){return this.compilerObject.kind}},qp=class{#e;#t;constructor(e){this.#e=e}get compilerObject(){return this.#t()}_reset(e){this.#t=e}getAmbientModules(){return this.compilerObject.getAmbientModules().map(e=>this.#e.compilerFactory.getSymbol(e))}getApparentType(e){return this.#e.compilerFactory.getType(this.compilerObject.getApparentType(e.compilerType))}getConstantValue(e){return this.compilerObject.getConstantValue(e.compilerNode)}getFullyQualifiedName(e){return this.compilerObject.getFullyQualifiedName(e.compilerSymbol)}getTypeAtLocation(e){return this.#e.compilerFactory.getType(this.compilerObject.getTypeAtLocation(e.compilerNode))}getContextualType(e){let t=this.compilerObject.getContextualType(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getType(t)}getTypeOfSymbolAtLocation(e,t){return this.#e.compilerFactory.getType(this.compilerObject.getTypeOfSymbolAtLocation(e.compilerSymbol,t.compilerNode))}getDeclaredTypeOfSymbol(e){return this.#e.compilerFactory.getType(this.compilerObject.getDeclaredTypeOfSymbol(e.compilerSymbol))}getSymbolAtLocation(e){let t=this.compilerObject.getSymbolAtLocation(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getSymbol(t)}getAliasedSymbol(e){if(!e.hasFlags(t.SymbolFlags.Alias))return;let n=this.compilerObject.getAliasedSymbol(e.compilerSymbol);return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getImmediatelyAliasedSymbol(e){let t=this.compilerObject.getImmediateAliasedSymbol(e.compilerSymbol);return t==null?void 0:this.#e.compilerFactory.getSymbol(t)}getExportSymbolOfSymbol(e){return this.#e.compilerFactory.getSymbol(this.compilerObject.getExportSymbolOfSymbol(e.compilerSymbol))}getPropertiesOfType(e){return this.compilerObject.getPropertiesOfType(e.compilerType).map(e=>this.#e.compilerFactory.getSymbol(e))}getTypeText(e,t,n){return n??=this.#n(t),this.compilerObject.typeToString(e.compilerType,t?.compilerNode,n)}getReturnTypeOfSignature(e){return this.#e.compilerFactory.getType(this.compilerObject.getReturnTypeOfSignature(e.compilerSignature))}getSignatureFromNode(e){let t=this.compilerObject.getSignatureFromDeclaration(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getSignature(t)}getExportsOfModule(e){return(this.compilerObject.getExportsOfModule(e.compilerSymbol)||[]).map(e=>this.#e.compilerFactory.getSymbol(e))}getExportSpecifierLocalTargetSymbol(e){let t=this.compilerObject.getExportSpecifierLocalTargetSymbol(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getSymbol(t)}getResolvedSignature(e){let t=this.compilerObject.getResolvedSignature(e.compilerNode);if(!(!t||!t.declaration))return this.#e.compilerFactory.getSignature(t)}getResolvedSignatureOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getResolvedSignature(e),n??`Signature could not be resolved.`,e)}getBaseTypeOfLiteralType(e){return this.#e.compilerFactory.getType(this.compilerObject.getBaseTypeOfLiteralType(e.compilerType))}getSymbolsInScope(e,t){return this.compilerObject.getSymbolsInScope(e.compilerNode,t).map(e=>this.#e.compilerFactory.getSymbol(e))}getTypeArguments(e){return this.compilerObject.getTypeArguments(e.compilerType).map(e=>this.#e.compilerFactory.getType(e))}isTypeAssignableTo(e,t){return this.compilerObject.isTypeAssignableTo(e.compilerType,t.compilerType)}#n(e){let n=t.TypeFormatFlags.UseTypeOfFunction|t.TypeFormatFlags.NoTruncation|t.TypeFormatFlags.UseFullyQualifiedType|t.TypeFormatFlags.WriteTypeArgumentsOfSignature;return e!=null&&e.getKind()===t.SyntaxKind.TypeAliasDeclaration&&(n|=t.TypeFormatFlags.InTypeAlias),n}getShorthandAssignmentValueSymbol(e){let t=this.compilerObject.getShorthandAssignmentValueSymbol(e.compilerNode);return t?this.#e.compilerFactory.getSymbol(t):void 0}resolveName(e,t,n,r){let i=this.compilerObject.resolveName(e,t?.compilerNode,n,r);return i?this.#e.compilerFactory.getSymbol(i):void 0}},Jp=class{#e;#t;#n;#r;#i;#a;constructor(e){this.#e=e.context,this.#a=e.configFileParsingDiagnostics,this.#t=new qp(this.#e),this._reset(e.rootNames,e.host)}get compilerObject(){return this.#i()}_isCompilerProgramCreated(){return this.#n!=null}_reset(e,n){let r=this.#e.compilerOptions.get();this.#i=()=>(this.#n??(this.#n=t.ts.createProgram(e,r,n,this.#r,this.#a),this.#r=void 0),this.#n),this.#n!=null&&(this.#r=this.#n,this.#n=void 0),this.#t._reset(()=>this.compilerObject.getTypeChecker())}getTypeChecker(){return this.#t}async emit(e={}){if(e.writeFile){let n=`Cannot specify a ${t.nameof(e,`writeFile`)} option when emitting asynchrously. Use ${t.nameof(this,`emitSync`)}() instead.`;throw new t.errors.InvalidOperationError(n)}let{fileSystemWrapper:n}=this.#e,r=[],i=this.#o({writeFile:(e,t,i)=>{r.push(n.writeFile(n.getStandardizedAbsolutePath(e),i?``+t:t))},...e});return await Promise.all(r),new Lp(this.#e,i)}emitSync(e={}){return new Lp(this.#e,this.#o(e))}emitToMemory(e={}){let t=[],{fileSystemWrapper:n}=this.#e,r=this.#o({writeFile:(e,r,i)=>{t.push({filePath:n.getStandardizedAbsolutePath(e),text:r,writeByteOrderMark:i||!1})},...e});return new zp(this.#e,r,t)}#o(e={}){let t=e.targetSourceFile==null?void 0:e.targetSourceFile.compilerNode,{emitOnlyDtsFiles:n,customTransformers:r,writeFile:i}=e;return this.compilerObject.emit(t,i,void 0,n,r)}getSyntacticDiagnostics(e){return this.compilerObject.getSyntacticDiagnostics(e?.compilerNode).map(e=>this.#e.compilerFactory.getDiagnosticWithLocation(e))}getSemanticDiagnostics(e){return this.compilerObject.getSemanticDiagnostics(e?.compilerNode).map(e=>this.#e.compilerFactory.getDiagnostic(e))}getDeclarationDiagnostics(e){return this.compilerObject.getDeclarationDiagnostics(e?.compilerNode).map(e=>this.#e.compilerFactory.getDiagnosticWithLocation(e))}getGlobalDiagnostics(){return this.compilerObject.getGlobalDiagnostics().map(e=>this.#e.compilerFactory.getDiagnostic(e))}getConfigFileParsingDiagnostics(){return this.compilerObject.getConfigFileParsingDiagnostics().map(e=>this.#e.compilerFactory.getDiagnostic(e))}getEmitModuleResolutionKind(){return t.getEmitModuleResolutionKind(this.compilerObject.getCompilerOptions())}isSourceFileFromExternalLibrary(e){return e.isFromExternalLibrary()}},Yp=class{#e;#t;#n;#r;#i=0;get compilerObject(){return this.#e}constructor(e){this.#r=e.context;let{languageServiceHost:n,compilerHost:r}=t.createHosts({transactionalFileSystem:this.#r.fileSystemWrapper,sourceFileContainer:this.#r.getSourceFileContainer(),compilerOptions:this.#r.compilerOptions,getNewLine:()=>this.#r.manipulationSettings.getNewLineKindAsString(),getProjectVersion:()=>`${this.#i}`,resolutionHost:e.resolutionHost??{},libFolderPath:e.libFolderPath,skipLoadingLibFiles:e.skipLoadingLibFiles});this.#t=r,this.#e=t.ts.createLanguageService(n,this.#r.compilerFactory.documentRegistry),this.#n=new Jp({context:this.#r,rootNames:Array.from(this.#r.compilerFactory.getSourceFilePaths()),host:this.#t,configFileParsingDiagnostics:e.configFileParsingDiagnostics}),this.#r.compilerFactory.onSourceFileAdded(e=>{e._isInProject()&&this._reset()}),this.#r.compilerFactory.onSourceFileRemoved(()=>this._reset())}_reset(){this.#i+=1,this.#n._reset(Array.from(this.#r.compilerFactory.getSourceFilePaths()),this.#t)}getProgram(){return this.#n}getDefinitions(e){return this.getDefinitionsAtPosition(e._sourceFile,e.getStart())}getDefinitionsAtPosition(e,t){return(this.compilerObject.getDefinitionAtPosition(e.getFilePath(),t)||[]).map(e=>this.#r.compilerFactory.getDefinitionInfo(e))}getImplementations(e){return this.getImplementationsAtPosition(e._sourceFile,e.getStart())}getImplementationsAtPosition(e,t){return(this.compilerObject.getImplementationAtPosition(e.getFilePath(),t)||[]).map(e=>new Rp(this.#r,e))}findReferences(e){return this.findReferencesAtPosition(e._sourceFile,e.getStart())}findReferencesAsNodes(e){let n=this.findReferences(e);return Array.from(r());function*r(){for(let e of n){let n=e.getDefinition().getKind()===t.ts.ScriptElementKind.alias,r=e.getReferences();for(let e=0;e<r.length;e++){let t=r[e];(n||!t.isDefinition()||e>0)&&(yield t.getNode())}}}}findReferencesAtPosition(e,t){return(this.compilerObject.findReferences(e.getFilePath(),t)||[]).map(e=>this.#r.compilerFactory.getReferencedSymbol(e))}findRenameLocations(e,t={}){let n=t.usePrefixAndSuffixText==null?this.#r.manipulationSettings.getUsePrefixAndSuffixTextForRename():t.usePrefixAndSuffixText;return(this.compilerObject.findRenameLocations(e._sourceFile.getFilePath(),e.getStart(),t.renameInStrings||!1,t.renameInComments||!1,n)||[]).map(e=>new Gp(this.#r,e))}getSuggestionDiagnostics(e){let t=this.#a(e);return this.compilerObject.getSuggestionDiagnostics(t).map(e=>this.#r.compilerFactory.getDiagnosticWithLocation(e))}getFormattingEditsForRange(e,t,n){return(this.compilerObject.getFormattingEditsForRange(e,t[0],t[1],this.#o(n))||[]).map(e=>new Tp(e))}getFormattingEditsForDocument(e,t){let n=this.#r.fileSystemWrapper.getStandardizedAbsolutePath(e);return(this.compilerObject.getFormattingEditsForDocument(n,this.#o(t))||[]).map(e=>new Tp(e))}getFormattedDocumentText(e,n){let r=this.#r.fileSystemWrapper.getStandardizedAbsolutePath(e),i=this.#r.compilerFactory.getSourceFileFromCacheFromFilePath(r);if(i==null)throw new t.errors.FileNotFoundError(r);n=this.#o(n);let a=L(i,this.getFormattingEditsForDocument(r,n)),o=n.newLineCharacter;return n.ensureNewLineAtEndOfFile&&!a.endsWith(o)&&(a+=o),a.replace(/\r?\n/g,o)}getEmitOutput(e,t){let n=this.#a(e),r=this.compilerObject;return new Ip(this.#r,i());function i(){let e=r.getProgram();return e==null||e.getSourceFile(n)==null?{emitSkipped:!0,outputFiles:[],diagnostics:[]}:r.getEmitOutput(n,t)}}getIdentationAtPosition(e,t,n){let r=this.#a(e);return n==null?n=this.#r.manipulationSettings.getEditorSettings():N(n,this.#r.manipulationSettings),this.compilerObject.getIndentationAtPosition(r,t,n)}organizeImports(e,t={},n={}){let r={type:`file`,fileName:this.#a(e)};return this.compilerObject.organizeImports(r,this.#o(t),this.#s(n)).map(e=>new Ep(this.#r,e))}getEditsForRefactor(e,t,n,r,i,a={}){let o=this.#a(e),s=typeof n==`number`?n:{pos:n.getPos(),end:n.getEnd()},c=this.compilerObject.getEditsForRefactor(o,this.#o(t),s,r,i,this.#s(a));return c==null?void 0:new Bp(this.#r,c)}getCombinedCodeFix(e,t,n={},r={}){let i=this.compilerObject.getCombinedCodeFix({type:`file`,fileName:this.#a(e)},t,this.#o(n),this.#s(r||{}));return new kp(this.#r,i)}getCodeFixesAtPosition(e,t,n,r,i={},a={}){let o=this.#a(e);return this.compilerObject.getCodeFixesAtPosition(o,t,n,r,this.#o(i),this.#s(a||{})).map(e=>new Op(this.#r,e))}#a(e){let n=typeof e==`string`?this.#r.fileSystemWrapper.getStandardizedAbsolutePath(e):e.getFilePath();if(!this.#r.compilerFactory.containsSourceFileAtPath(n))throw new t.errors.FileNotFoundError(n);return n}#o(e){return e._filled?e:(e=Object.assign(this.#r.getFormatCodeSettings(),e),P(e,this.#r.manipulationSettings),e._filled=!0,e)}#s(e){return Object.assign(this.#r.getUserPreferences(),e)}},Xp=class{_context;#e;get compilerType(){return this.#e}constructor(e,t){this._context=e,this.#e=t}getText(e,t){return this._context.typeChecker.getTypeText(this,e,t)}getAliasSymbol(){return this.compilerType.aliasSymbol==null?void 0:this._context.compilerFactory.getSymbol(this.compilerType.aliasSymbol)}getAliasSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAliasSymbol(),`Expected to find an alias symbol.`)}getAliasTypeArguments(){return(this.compilerType.aliasTypeArguments||[]).map(e=>this._context.compilerFactory.getType(e))}getApparentType(){return this._context.typeChecker.getApparentType(this)}getArrayElementTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getArrayElementType(),e??`Expected to find an array element type.`)}getArrayElementType(){if(this.isArray())return this.getTypeArguments()[0]}getBaseTypes(){return(this.compilerType.getBaseTypes()||[]).map(e=>this._context.compilerFactory.getType(e))}getBaseTypeOfLiteralType(){return this._context.typeChecker.getBaseTypeOfLiteralType(this)}getCallSignatures(){return this.compilerType.getCallSignatures().map(e=>this._context.compilerFactory.getSignature(e))}getConstructSignatures(){return this.compilerType.getConstructSignatures().map(e=>this._context.compilerFactory.getSignature(e))}getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected to find a constraint.`)}getConstraint(){let e=this.compilerType.getConstraint();return e==null?void 0:this._context.compilerFactory.getType(e)}getDefaultOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefault(),e??`Expected to find a default type.`)}getDefault(){let e=this.compilerType.getDefault();return e==null?void 0:this._context.compilerFactory.getType(e)}getProperties(){return this.compilerType.getProperties().map(e=>this._context.compilerFactory.getSymbol(e))}getPropertyOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getProperty(e),()=>l(`symbol property`,e))}getProperty(e){return ee(this.getProperties(),e)}getApparentProperties(){return this.compilerType.getApparentProperties().map(e=>this._context.compilerFactory.getSymbol(e))}getApparentProperty(e){return ee(this.getApparentProperties(),e)}isNullable(){return this.getUnionTypes().some(e=>e.isNull()||e.isUndefined())}getNonNullableType(){return this._context.compilerFactory.getType(this.compilerType.getNonNullableType())}getNumberIndexType(){let e=this.compilerType.getNumberIndexType();return e==null?void 0:this._context.compilerFactory.getType(e)}getStringIndexType(){let e=this.compilerType.getStringIndexType();return e==null?void 0:this._context.compilerFactory.getType(e)}getTargetType(){let e=this.compilerType.target||void 0;return e==null?void 0:this._context.compilerFactory.getType(e)}getTargetTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTargetType(),e??`Expected to find the target type.`)}getTypeArguments(){return this._context.typeChecker.getTypeArguments(this)}getTupleElements(){return this.isTuple()?this.getTypeArguments():[]}getUnionTypes(){return this.isUnion()?this.compilerType.types.map(e=>this._context.compilerFactory.getType(e)):[]}getIntersectionTypes(){return this.isIntersection()?this.compilerType.types.map(e=>this._context.compilerFactory.getType(e)):[]}getLiteralValue(){return this.compilerType?.value}getLiteralValueOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLiteralValue(),e??`Type was not a literal type.`)}getLiteralFreshType(){let e=this.compilerType?.freshType;return e==null?void 0:this._context.compilerFactory.getType(e)}getLiteralFreshTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLiteralFreshType(),e??`Type was not a literal type.`)}getLiteralRegularType(){let e=this.compilerType?.regularType;return e==null?void 0:this._context.compilerFactory.getType(e)}getLiteralRegularTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLiteralRegularType(),e??`Type was not a literal type.`)}getSymbol(){let e=this.compilerType.getSymbol();return e==null?void 0:this._context.compilerFactory.getSymbol(e)}getSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getSymbol(),e??`Expected to find a symbol.`)}isAssignableTo(e){return this._context.typeChecker.isTypeAssignableTo(this,e)}isAnonymous(){return this.#n(t.ObjectFlags.Anonymous)}isAny(){return this.#t(t.TypeFlags.Any)}isNever(){return this.#t(t.TypeFlags.Never)}isArray(){let e=this.getSymbol();return e==null?!1:(e.getName()===`Array`||e.getName()===`ReadonlyArray`)&&this.getTypeArguments().length===1}isReadonlyArray(){let e=this.getSymbol();return e==null?!1:e.getName()===`ReadonlyArray`&&this.getTypeArguments().length===1}isTemplateLiteral(){return this.#t(t.TypeFlags.TemplateLiteral)}isBoolean(){return this.#t(t.TypeFlags.Boolean)}isString(){return this.#t(t.TypeFlags.String)}isNumber(){return this.#t(t.TypeFlags.Number)}isBigInt(){return this.#t(t.TypeFlags.BigInt)}isLiteral(){let e=this.isBooleanLiteral();return this.compilerType.isLiteral()||e}isBooleanLiteral(){return this.#t(t.TypeFlags.BooleanLiteral)}isBigIntLiteral(){return this.#t(t.TypeFlags.BigIntLiteral)}isEnumLiteral(){return this.#t(t.TypeFlags.EnumLiteral)&&!this.isUnion()}isNumberLiteral(){return this.#t(t.TypeFlags.NumberLiteral)}isStringLiteral(){return this.compilerType.isStringLiteral()}isClass(){return this.compilerType.isClass()}isClassOrInterface(){return this.compilerType.isClassOrInterface()}isEnum(){if(this.#t(t.TypeFlags.Enum))return!0;if(this.isEnumLiteral()&&!this.isUnion())return!1;let e=this.getSymbol();if(e==null)return!1;let n=e.getValueDeclaration();return n!=null&&V.isEnumDeclaration(n)}isInterface(){return this.#n(t.ObjectFlags.Interface)}isObject(){return this.#t(t.TypeFlags.Object)}isTypeParameter(){return this.compilerType.isTypeParameter()}isTuple(){let e=this.getTargetType();return e==null?!1:e.#n(t.ObjectFlags.Tuple)}isUnion(){return this.compilerType.isUnion()}isIntersection(){return this.compilerType.isIntersection()}isUnionOrIntersection(){return this.compilerType.isUnionOrIntersection()}isUnknown(){return this.#t(t.TypeFlags.Unknown)}isNull(){return this.#t(t.TypeFlags.Null)}isUndefined(){return this.#t(t.TypeFlags.Undefined)}isVoid(){return this.#t(t.TypeFlags.Void)}getFlags(){return this.compilerType.flags}getObjectFlags(){return this.isObject()&&this.compilerType.objectFlags||0}#t(e){return(this.compilerType.flags&e)===e}#n(e){return(this.getObjectFlags()&e)===e}},Zp=class extends Xp{getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected type parameter to have a constraint.`)}getConstraint(){let e=this.#e();if(e==null)return;let t=e.getConstraint();if(t!=null)return this._context.typeChecker.getTypeAtLocation(t)}getDefaultOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefault(),e??`Expected type parameter to have a default type.`)}getDefault(){let e=this.#e();if(e==null)return;let t=e.getDefault();if(t!=null)return this._context.typeChecker.getTypeAtLocation(t)}#e(){let e=this.getSymbol();if(e==null)return;let t=e.getDeclarations()[0];if(t!=null&&V.isTypeParameterDeclaration(t))return t}},Qp=class{#e;#t;constructor(e,t){this.#t=e,this.#e=t}getSkippedFilePaths(){return this.#t}getOutputFilePaths(){return this.#e}},$p=class e{#e;#t;#n;constructor(e,t){this.#e=e,this._setPathInternal(t)}_setPathInternal(e){this.#t=e,this.#n=e.split(`/`).filter(e=>e.length>0)}get _context(){return this.#s(),this.#e}isAncestorOf(t){return e.#u(this,t)}isDescendantOf(t){return e.#u(t,this)}_getDepth(){return this.#n.length}getPath(){return this.#s(),this.#t}getBaseName(){return this.#n[this.#n.length-1]}getParentOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getParent(),e??(()=>`Parent directory of ${this.getPath()} does not exist or was never added.`))}getParent(){if(!t.FileUtils.isRootDirPath(this.getPath()))return this.addDirectoryAtPathIfExists(t.FileUtils.getDirPath(this.getPath()))}getDirectoryOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDirectory(e),()=>typeof e==`string`?`Could not find a directory at path '${this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath())}'.`:`Could not find child directory that matched condition.`)}getDirectory(e){if(typeof e==`string`){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.compilerFactory.getDirectoryFromCache(t)}return this.getDirectories().find(e)}getSourceFileOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getSourceFile(e),()=>typeof e==`string`?`Could not find child source file at path '${this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath())}'.`:`Could not find child source file that matched condition.`)}getSourceFile(e){if(typeof e==`string`){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.compilerFactory.getSourceFileFromCacheFromFilePath(t)}for(let t of this._getSourceFilesIterator())if(e(t))return t}getDirectories(){return Array.from(this._getDirectoriesIterator())}_getDirectoriesIterator(){return this._context.compilerFactory.getChildDirectoriesOfDirectory(this.getPath())}getSourceFiles(e){let{compilerFactory:n,fileSystemWrapper:r}=this._context,i=this;if(typeof e==`string`||e instanceof Array){let t=typeof e==`string`?[e]:e;return Array.from(a(t))}else return Array.from(this._getSourceFilesIterator());function*a(e){let a=Array.from(s()),o=t.matchGlobs(a,e,i.getPath());for(let e of o)yield n.getSourceFileFromCacheFromFilePath(r.getStandardizedAbsolutePath(e));function*s(){for(let e of i._getDescendantSourceFilesIterator())yield e.getFilePath()}}}_getSourceFilesIterator(){return this._context.compilerFactory.getChildSourceFilesOfDirectory(this.getPath())}getDescendantSourceFiles(){return Array.from(this._getDescendantSourceFilesIterator())}*_getDescendantSourceFilesIterator(){for(let e of this._getSourceFilesIterator())yield e;for(let e of this._getDirectoriesIterator())yield*e._getDescendantSourceFilesIterator()}getDescendantDirectories(){return Array.from(this._getDescendantDirectoriesIterator())}*_getDescendantDirectoriesIterator(){for(let e of this.getDirectories())yield e,yield*e._getDescendantDirectoriesIterator()}addSourceFilesAtPaths(e){return e=typeof e==`string`?[e]:e,e=e.map(e=>t.FileUtils.pathIsAbsolute(e)?e:t.FileUtils.pathJoin(this.getPath(),e)),this._context.directoryCoordinator.addSourceFilesAtPaths(e,{markInProject:this._isInProject()})}addDirectoryAtPathIfExists(e,t={}){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addDirectoryAtPathIfExists(n,{...t,markInProject:this._isInProject()})}addDirectoryAtPath(e,t={}){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addDirectoryAtPath(n,{...t,markInProject:this._isInProject()})}createDirectory(e){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.createDirectoryOrAddIfExists(t,{markInProject:this._isInProject()})}createSourceFile(e,t,n){let r=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.compilerFactory.createSourceFile(r,t||``,{...n||{},markInProject:this._isInProject()})}addSourceFileAtPathIfExists(e){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addSourceFileAtPathIfExists(t,{markInProject:this._isInProject()})}addSourceFileAtPath(e){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addSourceFileAtPath(t,{markInProject:this._isInProject()})}async emit(e={}){let{fileSystemWrapper:t}=this._context,n=[],r=[],i=[];for(let a of this.#r(e))tm(a)?i.push(a):(n.push(t.writeFile(a.filePath,a.fileText)),r.push(a.filePath));return await Promise.all(n),new Qp(i,r)}emitSync(e={}){let{fileSystemWrapper:t}=this._context,n=[],r=[];for(let i of this.#r(e))tm(i)?r.push(i):(t.writeFileSync(i.filePath,i.fileText),n.push(i.filePath));return new Qp(r,n)}#r(e={}){let{emitOnlyDtsFiles:n=!1}=e,r=e.outDir==null?void 0:/\.js$/i,i=e.outDir==null?void 0:/\.js\.map$/i,a=e.declarationDir==null&&e.outDir==null?void 0:/\.d\.ts$/i,o=e=>e==null?void 0:this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath()),s=(e,n)=>e==null?void 0:t.FileUtils.pathJoin(e,n.getBaseName()),c=this._context.compilerOptions.get().declarationDir!=null||e.declarationDir!=null;return l(this,o(e.outDir),o(e.declarationDir));function*l(e,o,u){for(let s of e.getSourceFiles()){let e=s.getEmitOutput({emitOnlyDtsFiles:n});if(e.getEmitSkipped()){yield s.getFilePath();continue}for(let n of e.getOutputFiles()){let e=n.getFilePath(),s=n.getWriteByteOrderMark()?t.FileUtils.getTextWithByteOrderMark(n.getText()):n.getText();o!=null&&(r.test(e)||i.test(e)||!c&&a.test(e))?e=t.FileUtils.pathJoin(o,t.FileUtils.getBaseName(e)):u!=null&&a.test(e)&&(e=t.FileUtils.pathJoin(u,t.FileUtils.getBaseName(e))),yield{filePath:e,fileText:s}}}for(let t of e.getDirectories())yield*l(t,s(o,t),s(u,t))}}copyToDirectory(e,n){let r=typeof e==`string`?e:e.getPath();return this.copy(t.FileUtils.pathJoin(r,this.getBaseName()),n)}copy(e,t){let n=this.getPath(),r=this._context.fileSystemWrapper,i=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return n===i?this:(t=em(t),t.includeUntrackedFiles&&r.queueCopyDirectory(n,i),this.#i(i,t))}async copyImmediately(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);if(r===i)return await this.save(),this;t=em(t);let a=this.#i(i,t);return t.includeUntrackedFiles&&await n.copyDirectoryImmediately(r,i),await a.save(),a}copyImmediatelySync(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);if(r===i)return this.saveSync(),this;t=em(t);let a=this.#i(i,t);return t.includeUntrackedFiles&&n.copyDirectoryImmediatelySync(r,i),a.saveSync(),a}#i(e,t){if(this.getPath()===e)return this;let{fileSystemWrapper:n,compilerFactory:r}=this._context,i=[this,...this.getDescendantDirectories()].map(t=>({newDirPath:t===this?e:n.getStandardizedAbsolutePath(this.getRelativePathTo(t),e)})),a=this.getDescendantSourceFiles().map(t=>({sourceFile:t,newFilePath:n.getStandardizedAbsolutePath(this.getRelativePathTo(t),e),references:this.#c(t)}));for(let{newDirPath:e}of i)this._context.compilerFactory.createDirectoryOrAddIfExists(e,{markInProject:this._isInProject()});for(let{sourceFile:e,newFilePath:n}of a)e._copyInternal(n,t);for(let{references:e,newFilePath:t}of a)this.getSourceFileOrThrow(t)._updateReferencesForCopyInternal(e);return r.getDirectoryFromCache(e)}moveToDirectory(e,n){let r=typeof e==`string`?e:e.getPath();return this.move(t.FileUtils.pathJoin(r,this.getBaseName()),n)}move(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);return r===i?this:this.#a(i,t,()=>n.queueMoveDirectory(r,i))}async moveImmediately(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);return r===i?(await this.save(),this):(this.#a(i,t),await n.moveDirectoryImmediately(r,i),await this.save(),this)}moveImmediatelySync(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);return r===i?(this.saveSync(),this):(this.#a(i,t),n.moveDirectoryImmediatelySync(r,i),this.saveSync(),this)}#a(e,t,n){let r=this.getPath();if(r===e)return this;let i=this._context.compilerFactory.getDirectoryFromCacheOnlyIfInCache(e),a=i!=null&&i._isInProject();n&&n();let o=this._context.fileSystemWrapper,s=this._context.compilerFactory,c=[this,...this.getDescendantDirectories()].map(t=>({directory:t,oldPath:t.getPath(),newDirPath:t===this?e:o.getStandardizedAbsolutePath(this.getRelativePathTo(t),e)})),l=this.getDescendantSourceFiles().map(t=>({sourceFile:t,newFilePath:o.getStandardizedAbsolutePath(this.getRelativePathTo(t),e),references:this.#l(t)}));for(let{directory:e,oldPath:t,newDirPath:n}of c)s.removeDirectoryFromCache(t),s.getDirectoryFromCache(n)?._forgetOnlyThis(),e._setPathInternal(n),s.addDirectoryToCache(e);for(let{sourceFile:e,newFilePath:n}of l)e._moveInternal(n,t);for(let{sourceFile:e,references:t}of l)e._updateReferencesForMoveInternal(t,r);return a&&this._markAsInProject(),this}clear(){let e=this.getPath();this.#o(),this._context.fileSystemWrapper.queueDirectoryDelete(e),this._context.fileSystemWrapper.queueMkdir(e)}async clearImmediately(){let e=this.getPath();this.#o(),await this._context.fileSystemWrapper.clearDirectoryImmediately(e)}clearImmediatelySync(){let e=this.getPath();this.#o(),this._context.fileSystemWrapper.clearDirectoryImmediatelySync(e)}delete(){let e=this.getPath();this.#o(),this._context.fileSystemWrapper.queueDirectoryDelete(e),this.forget()}#o(){for(let e of this.getSourceFiles())e.delete();for(let e of this.getDirectories())e.delete()}async deleteImmediately(){let{fileSystemWrapper:e}=this._context,t=this.getPath();this.forget(),await e.deleteDirectoryImmediately(t)}deleteImmediatelySync(){let{fileSystemWrapper:e}=this._context,t=this.getPath();this.forget(),e.deleteDirectoryImmediatelySync(t)}forget(){if(!this.wasForgotten()){for(let e of this.getSourceFiles())e.forget();for(let e of this.getDirectories())e.forget();this._forgetOnlyThis()}}_forgetOnlyThis(){this.wasForgotten()||(this._context.compilerFactory.removeDirectoryFromCache(this.getPath()),this.#e=void 0)}async save(){await this._context.fileSystemWrapper.saveForDirectory(this.getPath());let e=this.getDescendantSourceFiles().filter(e=>!e.isSaved());await Promise.all(e.map(e=>e.save()))}saveSync(){this._context.fileSystemWrapper.saveForDirectorySync(this.getPath()),this.getDescendantSourceFiles().filter(e=>!e.isSaved()).forEach(e=>e.saveSync())}getRelativePathTo(n){let r=this;return t.FileUtils.getRelativePathTo(this.getPath(),i());function i(){return n instanceof Uc?n.getFilePath():n instanceof e?n.getPath():r._context.fileSystemWrapper.getStandardizedAbsolutePath(n,r.getPath())}}getRelativePathAsModuleSpecifierTo(n){let r=this._context.program.getEmitModuleResolutionKind(),i=this,a=t.FileUtils.getRelativePathTo(this.getPath(),o()).replace(/((\.d\.ts$)|(\.[^/.]+$))/i,``);return a.startsWith(`../`)?a:`./`+a;function o(){return n instanceof Uc?a(n):n instanceof e?o(n):s(i._context.fileSystemWrapper.getStandardizedAbsolutePath(n,i.getPath()));function a(e){return s(e.getFilePath())}function o(e){switch(r){case t.ModuleResolutionKind.Node10:return e===i?t.FileUtils.pathJoin(e.getPath(),`index.ts`):e.getPath();case t.ModuleResolutionKind.Classic:case t.ModuleResolutionKind.Node16:case t.ModuleResolutionKind.NodeNext:case t.ModuleResolutionKind.Bundler:return t.FileUtils.pathJoin(e.getPath(),`index.ts`);default:return t.errors.throwNotImplementedForNeverValueError(r)}}function s(e){let n=t.FileUtils.getDirPath(e);switch(r){case t.ModuleResolutionKind.Node10:return n===i.getPath()?e:e.replace(/\/index?(\.d\.ts|\.ts|\.js)$/i,``);case t.ModuleResolutionKind.Classic:case t.ModuleResolutionKind.Node16:case t.ModuleResolutionKind.NodeNext:case t.ModuleResolutionKind.Bundler:return e;default:return t.errors.throwNotImplementedForNeverValueError(r)}}}}getProject(){return this._context.project}wasForgotten(){return this.#e==null}_isInProject(){return this._context.inProjectCoordinator.isDirectoryInProject(this)}_markAsInProject(){this._context.inProjectCoordinator.markDirectoryAsInProject(this)}_hasLoadedParent(){return this._context.compilerFactory.containsDirectoryAtPath(t.FileUtils.getDirPath(this.getPath()))}#s(){if(this.wasForgotten())throw new t.errors.InvalidOperationError(`Cannot use a directory that was deleted, removed, or overwritten.`)}#c(e){return e._getReferencesForCopyInternal().filter(e=>!this.isAncestorOf(e[1]))}#l(e){let{literalReferences:t,referencingLiterals:n}=e._getReferencesForMoveInternal();return{literalReferences:t.filter(e=>!this.isAncestorOf(e[1])),referencingLiterals:n.filter(e=>!this.isAncestorOf(e._sourceFile))}}static#u(e,t){if(t instanceof Uc&&(t=t.getDirectory(),e===t))return!0;if(e.#n.length>=t.#n.length)return!1;for(let n=e.#n.length-1;n>=0;n--)if(e.#n[n]!==t.#n[n])return!1;return!0}};function em(e){return e=t.ObjectUtils.clone(e||{}),M(e,`includeUntrackedFiles`,!0),e}function tm(e){return typeof e==`string`}var nm=class{#e;#t;constructor(e,t){this.#t=e,this.#e=t}addDirectoryAtPathIfExists(e,n){let r=this.#t.getDirectoryFromPath(e,n);if(r!=null){if(n.recursive)for(let r of t.FileUtils.getDescendantDirectories(this.#e,e))this.#t.createDirectoryOrAddIfExists(r,n);return r}}addDirectoryAtPath(e,n){let r=this.addDirectoryAtPathIfExists(e,n);if(r==null)throw new t.errors.DirectoryNotFoundError(e);return r}createDirectoryOrAddIfExists(e,t){return this.#t.createDirectoryOrAddIfExists(e,t)}addSourceFileAtPathIfExists(e,t){return this.#t.addOrGetSourceFileFromFilePath(e,{markInProject:t.markInProject,scriptKind:void 0})}addSourceFileAtPath(e,n){let r=this.addSourceFileAtPathIfExists(e,n);if(r==null)throw new t.errors.FileNotFoundError(this.#e.getStandardizedAbsolutePath(e));return r}addSourceFilesAtPaths(e,n){typeof e==`string`&&(e=[e]);let r=[],i=new Set;for(let a of this.#e.globSync(e)){let e=this.addSourceFileAtPathIfExists(a,n);e!=null&&r.push(e),i.add(t.FileUtils.getDirPath(a))}for(let e of t.FileUtils.getParentMostPaths(Array.from(i)))this.addDirectoryAtPathIfExists(e,{recursive:!0,markInProject:n.markInProject});return r}},rm=class{#e;#t=new t.KeyValueCache;#n=new t.KeyValueCache;#r=new t.KeyValueCache;#i=new t.KeyValueCache;constructor(e){this.#e=e}has(e){return this.#t.has(e)}get(e){if(!this.#t.has(e)){for(let n of this.#i.getValues())if(t.FileUtils.pathStartsWith(n.getPath(),e))return this.createOrAddIfExists(e);return}return this.#t.get(e)}getOrphans(){return this.#i.getValues()}getAll(){return this.#t.getValuesAsArray()}*getAllByDepth(){let e=new t.KeyValueCache,n=0;for(let e of this.getOrphans())r(e);for(n=Math.min(...Array.from(e.getKeys()));e.getSize()>0;){for(let t of e.get(n)||[])yield t,t.getDirectories().forEach(r);e.removeByKey(n),n++}function r(t){let r=t._getDepth();if(n>r)throw Error(`For some reason a subdirectory had a lower depth than the parent directory: ${t.getPath()}`);e.getOrCreate(r,()=>[]).push(t)}}remove(e){this.#s(e),this.#t.removeByKey(e),this.#i.removeByKey(e)}*getChildDirectoriesOfDirectory(e){let t=this.#r.get(e)?.entries();if(t!=null)for(let e of t)yield e}*getChildSourceFilesOfDirectory(e){let t=this.#n.get(e)?.entries();if(t!=null)for(let e of t)yield e}addSourceFile(e){let n=e.getDirectoryPath();this.createOrAddIfExists(n),this.#n.getOrCreate(n,()=>new t.SortedKeyValueArray(e=>e.getBaseName(),t.LocaleStringComparer.instance)).set(e)}removeSourceFile(e){let n=t.FileUtils.getDirPath(e),r=this.#n.get(n);r!=null&&(r.removeByKey(t.FileUtils.getBaseName(e)),r.hasItems()||this.#n.removeByKey(n))}createOrAddIfExists(e){return this.has(e)?this.get(e):(this.#c(e),this.#a(e))}#a(e){let t=new $p(this.#e,e);return this.addDirectory(t),t}addDirectory(e){let n=e.getPath(),r=t.FileUtils.getDirPath(n),i=r===n;for(let e of this.#i.getValues()){let r=e.getPath(),i=t.FileUtils.getDirPath(r);i!==r&&i===n&&this.#i.removeByKey(r)}i||this.#o(e),this.has(r)||this.#i.set(n,e),this.#t.set(n,e),this.#e.fileSystemWrapper.directoryExistsSync(n)||this.#e.fileSystemWrapper.queueMkdir(n);for(let t of this.#i.getValues())e.isAncestorOf(t)&&this.#c(t.getPath())}#o(e){if(t.FileUtils.isRootDirPath(e.getPath()))return;let n=t.FileUtils.getDirPath(e.getPath());this.#r.getOrCreate(n,()=>new t.SortedKeyValueArray(e=>e.getBaseName(),t.LocaleStringComparer.instance)).set(e)}#s(e){if(t.FileUtils.isRootDirPath(e))return;let n=t.FileUtils.getDirPath(e),r=this.#r.get(n);r!=null&&(r.removeByKey(t.FileUtils.getBaseName(e)),r.hasItems()||this.#r.removeByKey(n))}#c(e){let n=[],r=t.FileUtils.getDirPath(e);for(;e!==r;){if(e=r,r=t.FileUtils.getDirPath(e),this.#t.has(e)){for(let e of n)this.#a(e);break}n.unshift(e)}}},im=class extends t.KeyValueCache{#e=[];getOrCreate(e,t){return super.getOrCreate(e,()=>{let e=t();return this.#e.length>0&&this.#e[this.#e.length-1].add(e),e})}setForgetPoint(){this.#e.push(new Set)}forgetLastPoint(){let e=this.#e.pop();e!=null&&this.#n(e.values())}rememberNode(e){if(e.wasForgotten())throw new t.errors.InvalidOperationError(`Cannot remember a node that was removed or forgotten.`);let n=!1;for(let t of this.#e)if(t.delete(e)){n=!0;break}return n&&this.#t(e),n}#t(e){let t=e.getParentSyntaxList()||e.getParent();t!=null&&this.rememberNode(t)}#n(e){for(let n of e)n.wasForgotten()||n.getKind()===t.SyntaxKind.SourceFile||n._forgetOnlyThis()}},am={[t.SyntaxKind.SourceFile]:Uc,[t.SyntaxKind.ArrayBindingPattern]:Oa,[t.SyntaxKind.ArrayLiteralExpression]:Wa,[t.SyntaxKind.ArrayType]:iu,[t.SyntaxKind.ArrowFunction]:el,[t.SyntaxKind.AsExpression]:$a,[t.SyntaxKind.AwaitExpression]:to,[t.SyntaxKind.BigIntLiteral]:Wf,[t.SyntaxKind.BindingElement]:Aa,[t.SyntaxKind.BinaryExpression]:Fa,[t.SyntaxKind.Block]:gs,[t.SyntaxKind.BreakStatement]:_s,[t.SyntaxKind.CallExpression]:ro,[t.SyntaxKind.CallSignature]:Qd,[t.SyntaxKind.CaseBlock]:ys,[t.SyntaxKind.CaseClause]:xs,[t.SyntaxKind.CatchClause]:Cs,[t.SyntaxKind.ClassDeclaration]:El,[t.SyntaxKind.ClassExpression]:Pl,[t.SyntaxKind.ClassStaticBlockDeclaration]:Il,[t.SyntaxKind.ConditionalType]:au,[t.SyntaxKind.Constructor]:Bl,[t.SyntaxKind.ConstructorType]:lu,[t.SyntaxKind.ConstructSignature]:tf,[t.SyntaxKind.ContinueStatement]:Ts,[t.SyntaxKind.CommaListExpression]:ao,[t.SyntaxKind.ComputedPropertyName]:hf,[t.SyntaxKind.ConditionalExpression]:so,[t.SyntaxKind.DebuggerStatement]:Ds,[t.SyntaxKind.Decorator]:Jl,[t.SyntaxKind.DefaultClause]:ks,[t.SyntaxKind.DeleteExpression]:lo,[t.SyntaxKind.DoStatement]:Ms,[t.SyntaxKind.ElementAccessExpression]:fo,[t.SyntaxKind.EmptyStatement]:Ps,[t.SyntaxKind.EnumDeclaration]:Kd,[t.SyntaxKind.EnumMember]:Jd,[t.SyntaxKind.ExportAssignment]:ic,[t.SyntaxKind.ExportDeclaration]:oc,[t.SyntaxKind.ExportSpecifier]:lc,[t.SyntaxKind.ExpressionWithTypeArguments]:du,[t.SyntaxKind.ExpressionStatement]:Is,[t.SyntaxKind.ExternalModuleReference]:dc,[t.SyntaxKind.QualifiedName]:bf,[t.SyntaxKind.ForInStatement]:Rs,[t.SyntaxKind.ForOfStatement]:Bs,[t.SyntaxKind.ForStatement]:Hs,[t.SyntaxKind.FunctionDeclaration]:cl,[t.SyntaxKind.FunctionExpression]:ul,[t.SyntaxKind.FunctionType]:pu,[t.SyntaxKind.GetAccessor]:Hl,[t.SyntaxKind.HeritageClause]:Yd,[t.SyntaxKind.Identifier]:_f,[t.SyntaxKind.IfStatement]:Ws,[t.SyntaxKind.ImportClause]:_c,[t.SyntaxKind.ImportDeclaration]:yc,[t.SyntaxKind.ImportEqualsDeclaration]:Cc,[t.SyntaxKind.ImportSpecifier]:Tc,[t.SyntaxKind.ImportType]:mu,[t.SyntaxKind.ImportAttribute]:pc,[t.SyntaxKind.ImportAttributes]:hc,[t.SyntaxKind.IndexedAccessType]:hu,[t.SyntaxKind.IndexSignature]:rf,[t.SyntaxKind.InferType]:gu,[t.SyntaxKind.InterfaceDeclaration]:of,[t.SyntaxKind.IntersectionType]:_u,[t.SyntaxKind.JSDocAllType]:Bu,[t.SyntaxKind.JSDocAugmentsTag]:Ju,[t.SyntaxKind.JSDocAuthorTag]:Yu,[t.SyntaxKind.JSDocCallbackTag]:Xu,[t.SyntaxKind.JSDocClassTag]:Zu,[t.SyntaxKind.JSDocDeprecatedTag]:Qu,[t.SyntaxKind.JSDocEnumTag]:$u,[t.SyntaxKind.JSDocFunctionType]:td,[t.SyntaxKind.JSDocImplementsTag]:nd,[t.SyntaxKind.JSDocLink]:rd,[t.SyntaxKind.JSDocLinkCode]:id,[t.SyntaxKind.JSDocLinkPlain]:ad,[t.SyntaxKind.JSDocMemberName]:od,[t.SyntaxKind.JSDocNamepathType]:sd,[t.SyntaxKind.JSDocNameReference]:cd,[t.SyntaxKind.JSDocNonNullableType]:ld,[t.SyntaxKind.JSDocNullableType]:ud,[t.SyntaxKind.JSDocOptionalType]:dd,[t.SyntaxKind.JSDocOverrideTag]:md,[t.SyntaxKind.JSDocParameterTag]:gd,[t.SyntaxKind.JSDocPrivateTag]:_d,[t.SyntaxKind.JSDocPropertyTag]:vd,[t.SyntaxKind.JSDocProtectedTag]:yd,[t.SyntaxKind.JSDocPublicTag]:bd,[t.SyntaxKind.JSDocReturnTag]:Cd,[t.SyntaxKind.JSDocReadonlyTag]:xd,[t.SyntaxKind.JSDocThrowsTag]:Id,[t.SyntaxKind.JSDocOverloadTag]:pd,[t.SyntaxKind.JSDocSatisfiesTag]:Td,[t.SyntaxKind.JSDocSeeTag]:Dd,[t.SyntaxKind.JSDocSignature]:Od,[t.SyntaxKind.JSDocTag]:Vd,[t.SyntaxKind.JSDocTemplateTag]:jd,[t.SyntaxKind.JSDocText]:Md,[t.SyntaxKind.JSDocThisTag]:Pd,[t.SyntaxKind.JSDocTypeExpression]:Rd,[t.SyntaxKind.JSDocTypeLiteral]:zd,[t.SyntaxKind.JSDocTypeTag]:Bd,[t.SyntaxKind.JSDocTypedefTag]:Ld,[t.SyntaxKind.JSDocUnknownType]:Hd,[t.SyntaxKind.JSDocVariadicType]:Ud,[t.SyntaxKind.JsxAttribute]:Sf,[t.SyntaxKind.JsxClosingElement]:wf,[t.SyntaxKind.JsxClosingFragment]:Tf,[t.SyntaxKind.JsxElement]:Df,[t.SyntaxKind.JsxExpression]:Af,[t.SyntaxKind.JsxFragment]:jf,[t.SyntaxKind.JsxNamespacedName]:Nf,[t.SyntaxKind.JsxOpeningElement]:Ff,[t.SyntaxKind.JsxOpeningFragment]:If,[t.SyntaxKind.JsxSelfClosingElement]:Rf,[t.SyntaxKind.JsxSpreadAttribute]:Bf,[t.SyntaxKind.JsxText]:Hf,[t.SyntaxKind.LabeledStatement]:Ks,[t.SyntaxKind.LiteralType]:vu,[t.SyntaxKind.MappedType]:yu,[t.SyntaxKind.MetaProperty]:vo,[t.SyntaxKind.MethodDeclaration]:_l,[t.SyntaxKind.MethodSignature]:cf,[t.SyntaxKind.ModuleBlock]:Dc,[t.SyntaxKind.ModuleDeclaration]:Ac,[t.SyntaxKind.NamedExports]:Pc,[t.SyntaxKind.NamedImports]:Ic,[t.SyntaxKind.NamedTupleMember]:xu,[t.SyntaxKind.NamespaceExport]:Rc,[t.SyntaxKind.NamespaceImport]:zc,[t.SyntaxKind.NewExpression]:bo,[t.SyntaxKind.NonNullExpression]:So,[t.SyntaxKind.NotEmittedStatement]:Js,[t.SyntaxKind.NoSubstitutionTemplateLiteral]:op,[t.SyntaxKind.NumericLiteral]:ep,[t.SyntaxKind.ObjectBindingPattern]:ja,[t.SyntaxKind.ObjectLiteralExpression]:Oo,[t.SyntaxKind.OmittedExpression]:Io,[t.SyntaxKind.Parameter]:fl,[t.SyntaxKind.ParenthesizedExpression]:K,[t.SyntaxKind.ParenthesizedType]:Su,[t.SyntaxKind.PartiallyEmittedExpression]:Ro,[t.SyntaxKind.PostfixUnaryExpression]:Bo,[t.SyntaxKind.PrefixUnaryExpression]:Ho,[t.SyntaxKind.PrivateIdentifier]:yf,[t.SyntaxKind.PropertyAccessExpression]:Wo,[t.SyntaxKind.PropertyAssignment]:Ao,[t.SyntaxKind.PropertyDeclaration]:Wl,[t.SyntaxKind.PropertySignature]:uf,[t.SyntaxKind.RegularExpressionLiteral]:np,[t.SyntaxKind.RestType]:Cu,[t.SyntaxKind.ReturnStatement]:Xs,[t.SyntaxKind.SatisfiesExpression]:Ko,[t.SyntaxKind.SetAccessor]:Kl,[t.SyntaxKind.ShorthandPropertyAssignment]:Mo,[t.SyntaxKind.SpreadAssignment]:Po,[t.SyntaxKind.SpreadElement]:Jo,[t.SyntaxKind.StringLiteral]:ip,[t.SyntaxKind.SwitchStatement]:Qs,[t.SyntaxKind.SyntaxList]:yn,[t.SyntaxKind.TaggedTemplateExpression]:sp,[t.SyntaxKind.TemplateExpression]:lp,[t.SyntaxKind.TemplateHead]:dp,[t.SyntaxKind.TemplateLiteralType]:wu,[t.SyntaxKind.TemplateMiddle]:pp,[t.SyntaxKind.TemplateSpan]:hp,[t.SyntaxKind.TemplateTail]:_p,[t.SyntaxKind.ThisType]:Tu,[t.SyntaxKind.ThrowStatement]:ec,[t.SyntaxKind.TryStatement]:nc,[t.SyntaxKind.TupleType]:Eu,[t.SyntaxKind.TypeAliasDeclaration]:Ou,[t.SyntaxKind.TypeAssertionExpression]:is,[t.SyntaxKind.TypeLiteral]:Au,[t.SyntaxKind.TypeOperator]:ju,[t.SyntaxKind.TypeParameter]:Nu,[t.SyntaxKind.TypePredicate]:Fu,[t.SyntaxKind.TypeQuery]:Iu,[t.SyntaxKind.TypeReference]:Lu,[t.SyntaxKind.UnionType]:Ru,[t.SyntaxKind.VariableDeclaration]:yp,[t.SyntaxKind.VariableDeclarationList]:xp,[t.SyntaxKind.VariableStatement]:qc,[t.SyntaxKind.JSDoc]:eu,[t.SyntaxKind.TypeOfExpression]:os,[t.SyntaxKind.WhileStatement]:Yc,[t.SyntaxKind.WithStatement]:Zc,[t.SyntaxKind.YieldExpression]:us,[t.SyntaxKind.SemicolonToken]:V,[t.SyntaxKind.AnyKeyword]:Na,[t.SyntaxKind.BooleanKeyword]:Na,[t.SyntaxKind.FalseKeyword]:Jf,[t.SyntaxKind.ImportKeyword]:mo,[t.SyntaxKind.InferKeyword]:V,[t.SyntaxKind.NeverKeyword]:V,[t.SyntaxKind.NullKeyword]:Qf,[t.SyntaxKind.NumberKeyword]:Na,[t.SyntaxKind.ObjectKeyword]:Na,[t.SyntaxKind.StringKeyword]:Na,[t.SyntaxKind.SymbolKeyword]:Na,[t.SyntaxKind.SuperKeyword]:Qo,[t.SyntaxKind.ThisKeyword]:ns,[t.SyntaxKind.TrueKeyword]:Kf,[t.SyntaxKind.UndefinedKeyword]:Na,[t.SyntaxKind.VoidExpression]:cs},om=class{#e;#t=new Map;#n=new t.WeakCache;#r=new t.WeakCache;#i=new t.WeakCache;#a=new t.WeakCache;#o=new t.WeakCache;#s=new t.WeakCache;#c=new t.WeakCache;#l=new t.WeakCache;#u=new t.WeakCache;#d=new t.WeakCache;#f=new t.WeakCache;#p=new t.WeakCache;#m=new t.WeakCache;#h=new im;#g;#_=new t.EventContainer;#v=new t.EventContainer;documentRegistry;constructor(e){this.documentRegistry=new t.DocumentRegistry(e.fileSystemWrapper),this.#g=new rm(e),e.compilerOptions.onModified(()=>{let e=Array.from(this.#t.values());for(let t of e)an(t)}),this.#e=e}*getSourceFilesByDirectoryDepth(){for(let e of this.getDirectoriesByDepth())yield*e.getSourceFiles()}getSourceFilePaths(){return this.#t.keys()}getChildDirectoriesOfDirectory(e){return this.#g.getChildDirectoriesOfDirectory(e)}getChildSourceFilesOfDirectory(e){return this.#g.getChildSourceFilesOfDirectory(e)}onSourceFileAdded(e,t=!0){t?this.#_.subscribe(e):this.#_.unsubscribe(e)}onSourceFileRemoved(e){this.#v.subscribe(e)}createSourceFile(e,n,r){if(n=n instanceof Function?F(this.#e.createWriter(),n):n||``,typeof n==`string`)return this.createSourceFileFromText(e,n,r);let i=this.#e.createWriter();return this.#e.structurePrinterFactory.forSourceFile({isAmbient:t.FileUtils.getExtension(e)===`.d.ts`}).printText(i,n),this.createSourceFileFromText(e,i.toString(),r)}createSourceFileFromText(e,t,n){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),n.overwrite===!0?this.#y(e,t,n):(this.throwIfFileExists(e,`Did you mean to provide the overwrite option?`),this.#b(e,t,n))}throwIfFileExists(e,n){if(!(!this.containsSourceFileAtPath(e)&&!this.#e.fileSystemWrapper.fileExistsSync(e)))throw n=n==null?``:n+` `,new t.errors.InvalidOperationError(`${n}A source file already exists at the provided file path: ${e}`)}#y(e,t,n){e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e);let r=this.addOrGetSourceFileFromFilePath(e,n);return r==null?this.#b(e,t,n):(r.getChildren().forEach(e=>e.forget()),this.replaceCompilerNode(r,this.createCompilerSourceFileFromText(e,t,n.scriptKind)),r)}getSourceFileFromCacheFromFilePath(e){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),this.#t.get(e)}addOrGetSourceFileFromFilePath(e,t){e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e);let n=this.#t.get(e);if(n==null){let r=this.#e.fileSystemWrapper.readFileIfExistsSync(e,this.#e.getEncoding());r!=null&&(this.#e.logger.log(`Loaded file: ${e}`),n=this.#b(e,r,t),n._setIsSaved(!0))}return n!=null&&t.markInProject&&n._markAsInProject(),n}containsSourceFileAtPath(e){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),this.#t.has(e)}containsDirectoryAtPath(e){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),this.#g.has(e)}getSourceFileForNode(e){let n=e;for(;n.kind!==t.SyntaxKind.SourceFile;){if(n.parent==null)return;n=n.parent}return this.getSourceFile(n,{markInProject:!1})}hasCompilerNode(e){return this.#h.has(e)}getExistingNodeFromCompilerNode(e){return this.#h.get(e)}getNodeFromCompilerNode(e,n){if(e.kind===t.SyntaxKind.SourceFile)return this.getSourceFile(e,{markInProject:!1});return this.#h.getOrCreate(e,()=>{let e=r.call(this);return a.call(this,e),e});function r(){return i(e)?y.isCommentStatement(e)?new ws(this.#e,e,n):y.isCommentClassElement(e)?new Ll(this.#e,e,n):y.isCommentTypeElement(e)?new $d(this.#e,e,n):y.isCommentObjectLiteralElement(e)?new wo(this.#e,e,n):y.isCommentEnumMember(e)?new Wd(this.#e,e,n):t.errors.throwNotImplementedForNeverValueError(e):new(am[e.kind]||V)(this.#e,e,n)}function i(e){return e._commentKind!=null}function a(r){if(e.parent!=null){let t=this.getNodeFromCompilerNode(e.parent,n);t._wrappedChildCount++}let i=r._getParentSyntaxListIfWrapped();if(i!=null&&i._wrappedChildCount++,e.kind===t.SyntaxKind.SyntaxList){let e=0;for(let t of r._getChildrenInCacheIterator())e++;r._wrappedChildCount=e}}}#b(e,n,r){let i=t.StringUtils.hasBom(n);i&&(n=t.StringUtils.stripBom(n));let a=this.getSourceFile(this.createCompilerSourceFileFromText(e,n,r.scriptKind),r);return i&&(a._hasBom=!0),a}createCompilerSourceFileFromText(e,n,r){return this.documentRegistry.createOrUpdateSourceFile(e,this.#e.compilerOptions.get(),t.ts.ScriptSnapshot.fromString(n),r)}getSourceFile(e,t){let n=!1,r=this.#t.get(e.fileName)??this.#h.getOrCreate(e,()=>{let r=new Uc(this.#e,e);return t.markInProject||this.#e.inProjectCoordinator.setSourceFileNotInProject(r),this.#x(r),n=!0,r});return t.markInProject&&r._markAsInProject(),n&&this.#_.fire(r),r}#x(e){this.#t.set(e.getFilePath(),e),this.#e.fileSystemWrapper.removeFileDelete(e.getFilePath()),this.#g.addSourceFile(e)}getDirectoryFromPath(e,t){e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e);let n=this.#g.get(e);return n==null&&this.#e.fileSystemWrapper.directoryExistsSync(e)&&(n=this.#g.createOrAddIfExists(e)),n!=null&&t.markInProject&&n._markAsInProject(),n}createDirectoryOrAddIfExists(e,t){let n=this.#g.createOrAddIfExists(e);return n!=null&&t.markInProject&&n._markAsInProject(),n}getDirectoryFromCache(e){return this.#g.get(e)}getDirectoryFromCacheOnlyIfInCache(e){return this.#g.has(e)?this.#g.get(e):void 0}getDirectoriesByDepth(){return this.#g.getAllByDepth()}getOrphanDirectories(){return this.#g.getOrphans()}getSymbolDisplayPart(e){return this.#l.getOrCreate(e,()=>new Kp(e))}getType(e){return(e.flags&t.TypeFlags.TypeParameter)===t.TypeFlags.TypeParameter?this.getTypeParameter(e):this.#p.getOrCreate(e,()=>new Xp(this.#e,e))}getTypeParameter(e){return this.#m.getOrCreate(e,()=>new Zp(this.#e,e))}getSignature(e){return this.#s.getOrCreate(e,()=>new Sp(this.#e,e))}getSymbol(e){return this.#c.getOrCreate(e,()=>new Cp(this.#e,e))}getDefinitionInfo(e){return this.#r.getOrCreate(e,()=>new jp(this.#e,e))}getDocumentSpan(e){return this.#i.getOrCreate(e,()=>new Ap(this.#e,e))}getReferencedSymbolEntry(e){return this.#u.getOrCreate(e,()=>new Wp(this.#e,e))}getReferencedSymbol(e){return this.#d.getOrCreate(e,()=>new Vp(this.#e,e))}getReferencedSymbolDefinitionInfo(e){return this.#f.getOrCreate(e,()=>new Hp(this.#e,e))}getDiagnostic(e){return this.#n.getOrCreate(e,()=>e.start==null?new Np(this.#e,e):new Pp(this.#e,e))}getDiagnosticWithLocation(e){return this.#n.getOrCreate(e,()=>new Pp(this.#e,e))}getDiagnosticMessageChain(e){return this.#a.getOrCreate(e,()=>new Mp(e))}getJSDocTagInfo(e){return this.#o.getOrCreate(e,()=>new kd(e))}replaceCompilerNode(e,n){let r=e instanceof V?e.compilerNode:e,i=e instanceof V?e:this.#h.get(e);if(r.kind===t.SyntaxKind.SourceFile&&r.fileName!==n.fileName){let e=i;this.#S(r),e._replaceCompilerNodeFromFactory(n),this.#h.set(n,e),this.#x(e),this.#_.fire(e)}else this.#h.replaceKey(r,n),i?._replaceCompilerNodeFromFactory(n)}removeNodeFromCache(e){this.#S(e.compilerNode)}#S(e){if(this.#h.removeByKey(e),e.kind===t.SyntaxKind.SourceFile){let t=e,n=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(t.fileName);this.#g.removeSourceFile(n);let r=this.#t.get(n);this.#t.delete(n),this.documentRegistry.removeSourceFile(n),r!=null&&this.#v.fire(r)}}addDirectoryToCache(e){this.#g.addDirectory(e)}removeDirectoryFromCache(e){this.#g.remove(e)}forgetNodesCreatedInBlock(e){this.#h.setForgetPoint();let t=!1,n;try{if(n=e((...e)=>{for(let t of e)this.#h.rememberNode(t)}),V.isNode(n)&&this.#h.rememberNode(n),r(n))return t=!0,n.then(e=>(V.isNode(e)&&this.#h.rememberNode(e),this.#h.forgetLastPoint(),e))}finally{t||this.#h.forgetLastPoint()}return n;function r(e){return e!=null&&typeof e.then==`function`}}},sm=class{#e;#t=new Set;constructor(e){e.onSourceFileRemoved(e=>{this.#t.delete(e)}),this.#e=e}setSourceFileNotInProject(e){this.#t.add(e),e._inProject=!1}markSourceFileAsInProject(e){this.isSourceFileInProject(e)||(this.#n(e),this.#t.delete(e))}markSourceFilesAsInProjectForResolution(){let e=this.#e,n=[],r=[];for(let e of[...this.#t.values()])i(e)?(this.#n(e),this.#t.delete(e),n.push(e)):r.push(e);return{changedSourceFiles:n,unchangedSourceFiles:r};function i(n){let r=n.getFilePath(),i=r.toLowerCase().lastIndexOf(`/node_modules/`);if(i===-1)return!0;let a=r.substring(0,i+14-1),o=e.getDirectoryFromCacheOnlyIfInCache(a);if(o!=null&&o._isInProject())return!0;let s=n.getDirectory();for(;s!=null&&s.getPath()!==a;){if(s._isInProject())return!0;s=e.getDirectoryFromCacheOnlyIfInCache(t.FileUtils.getDirPath(s.getPath()))}return!1}}#n(e){e._inProject=!0,this.markDirectoryAsInProject(e.getDirectory())}isSourceFileInProject(e){return e._inProject===!0}setDirectoryAndFilesAsNotInProjectForTesting(e){for(let t of e.getDirectories())this.setDirectoryAndFilesAsNotInProjectForTesting(t);for(let t of e.getSourceFiles())delete t._inProject,this.#t.add(t);delete e._inProject}markDirectoryAsInProject(e){if(this.isDirectoryInProject(e))return;let n=this,r=this.#e;e._inProject=!0,i(e);function i(e){let t=Array.from(a(e)),r=t[t.length-1];if(!(r==null||!n.isDirectoryInProject(r)))for(let e of t)e._inProject=!0}function*a(e){if(t.FileUtils.isRootDirPath(e.getPath()))return;let i=t.FileUtils.getDirPath(e.getPath()),o=r.getDirectoryFromCacheOnlyIfInCache(i);o!=null&&(yield o,n.isDirectoryInProject(o)||(yield*a(o)))}}isDirectoryInProject(e){return e._inProject===!0}},cm=class{_getFormatCodeSettings;constructor(e){this._getFormatCodeSettings=e}getFormatCodeSettings(){return this._getFormatCodeSettings()}forInitializerExpressionableNode(){return new In}forModifierableNode(){return new Ln}forReturnTypedNode(e){return new Rn(e)}forTypedNode(e,t){return new zn(e,t)}forClassDeclaration(e){return new Jn(this,e)}forClassMember(e){return new Hr(this,e)}forClassStaticBlockDeclaration(){return new Ur(this)}forConstructorDeclaration(e){return new Wr(this,e)}forGetAccessorDeclaration(e){return new Gr(this,e)}forMethodDeclaration(e){return new Kr(this,e)}forPropertyDeclaration(){return new qr(this)}forSetAccessorDeclaration(e){return new Jr(this,e)}forDecorator(){return new Xr(this)}forJSDoc(){return new Zr(this)}forJSDocTag(e){return new Qr(this,e)}forEnumDeclaration(){return new $r(this)}forEnumMember(){return new ei(this)}forObjectLiteralExpressionProperty(){return new ti(this)}forPropertyAssignment(){return new ni(this)}forShorthandPropertyAssignment(){return new ri(this)}forSpreadAssignment(){return new ii(this)}forFunctionDeclaration(e){return new ai(this,e)}forParameterDeclaration(){return new oi(this)}forCallSignatureDeclaration(){return new si(this)}forConstructSignatureDeclaration(){return new ci(this)}forIndexSignatureDeclaration(){return new li(this)}forInterfaceDeclaration(){return new ui(this)}forMethodSignature(){return new di(this)}forPropertySignature(){return new fi(this)}forTypeElementMemberedNode(){return new pi(this)}forTypeElementMember(){return new mi(this)}forJsxAttributeDecider(){return new hi(this)}forJsxAttribute(){return new gi(this)}forJsxChildDecider(){return new _i(this)}forJsxElement(){return new vi(this)}forJsxNamespacedName(){return new yi(this)}forJsxSelfClosingElement(){return new bi(this)}forJsxSpreadAttribute(){return new xi(this)}forExportAssignment(){return new Si(this)}forExportDeclaration(){return new Ci(this)}forImportAttribute(){return new wi(this)}forImportDeclaration(){return new Ti(this)}forModuleDeclaration(e){return new Ei(this,e)}forNamedImportExportSpecifier(){return new Di(this)}forSourceFile(e){return new Oi(this,e)}forStatementedNode(e){return new ki(this,e)}forStatement(e){return new Ai(this,e)}forVariableStatement(){return new ji(this)}forTypeAliasDeclaration(){return new Mi(this)}forTypeParameterDeclaration(){return new Ni(this)}forVariableDeclaration(){return new Pi(this)}};Vc([t.Memoize],cm.prototype,`forInitializerExpressionableNode`,null),Vc([t.Memoize],cm.prototype,`forModifierableNode`,null),Vc([t.Memoize],cm.prototype,`forReturnTypedNode`,null),Vc([t.Memoize],cm.prototype,`forTypedNode`,null),Vc([t.Memoize],cm.prototype,`forClassDeclaration`,null),Vc([t.Memoize],cm.prototype,`forClassMember`,null),Vc([t.Memoize],cm.prototype,`forClassStaticBlockDeclaration`,null),Vc([t.Memoize],cm.prototype,`forConstructorDeclaration`,null),Vc([t.Memoize],cm.prototype,`forGetAccessorDeclaration`,null),Vc([t.Memoize],cm.prototype,`forMethodDeclaration`,null),Vc([t.Memoize],cm.prototype,`forPropertyDeclaration`,null),Vc([t.Memoize],cm.prototype,`forSetAccessorDeclaration`,null),Vc([t.Memoize],cm.prototype,`forDecorator`,null),Vc([t.Memoize],cm.prototype,`forJSDoc`,null),Vc([t.Memoize],cm.prototype,`forJSDocTag`,null),Vc([t.Memoize],cm.prototype,`forEnumDeclaration`,null),Vc([t.Memoize],cm.prototype,`forEnumMember`,null),Vc([t.Memoize],cm.prototype,`forObjectLiteralExpressionProperty`,null),Vc([t.Memoize],cm.prototype,`forPropertyAssignment`,null),Vc([t.Memoize],cm.prototype,`forShorthandPropertyAssignment`,null),Vc([t.Memoize],cm.prototype,`forSpreadAssignment`,null),Vc([t.Memoize],cm.prototype,`forFunctionDeclaration`,null),Vc([t.Memoize],cm.prototype,`forParameterDeclaration`,null),Vc([t.Memoize],cm.prototype,`forCallSignatureDeclaration`,null),Vc([t.Memoize],cm.prototype,`forConstructSignatureDeclaration`,null),Vc([t.Memoize],cm.prototype,`forIndexSignatureDeclaration`,null),Vc([t.Memoize],cm.prototype,`forInterfaceDeclaration`,null),Vc([t.Memoize],cm.prototype,`forMethodSignature`,null),Vc([t.Memoize],cm.prototype,`forPropertySignature`,null),Vc([t.Memoize],cm.prototype,`forTypeElementMemberedNode`,null),Vc([t.Memoize],cm.prototype,`forTypeElementMember`,null),Vc([t.Memoize],cm.prototype,`forJsxAttributeDecider`,null),Vc([t.Memoize],cm.prototype,`forJsxAttribute`,null),Vc([t.Memoize],cm.prototype,`forJsxChildDecider`,null),Vc([t.Memoize],cm.prototype,`forJsxElement`,null),Vc([t.Memoize],cm.prototype,`forJsxNamespacedName`,null),Vc([t.Memoize],cm.prototype,`forJsxSelfClosingElement`,null),Vc([t.Memoize],cm.prototype,`forJsxSpreadAttribute`,null),Vc([t.Memoize],cm.prototype,`forExportAssignment`,null),Vc([t.Memoize],cm.prototype,`forExportDeclaration`,null),Vc([t.Memoize],cm.prototype,`forImportAttribute`,null),Vc([t.Memoize],cm.prototype,`forImportDeclaration`,null),Vc([t.Memoize],cm.prototype,`forModuleDeclaration`,null),Vc([t.Memoize],cm.prototype,`forNamedImportExportSpecifier`,null),Vc([t.Memoize],cm.prototype,`forSourceFile`,null),Vc([t.Memoize],cm.prototype,`forStatementedNode`,null),Vc([t.Memoize],cm.prototype,`forStatement`,null),Vc([t.Memoize],cm.prototype,`forVariableStatement`,null),Vc([t.Memoize],cm.prototype,`forTypeAliasDeclaration`,null),Vc([t.Memoize],cm.prototype,`forTypeParameterDeclaration`,null),Vc([t.Memoize],cm.prototype,`forVariableDeclaration`,null);var lm=class{#e;#t;#n;#r;get project(){if(this.#r==null)throw new t.errors.InvalidOperationError(`This operation is not permitted in this context.`);return this.#r}logger=new oe;lazyReferenceCoordinator;directoryCoordinator;fileSystemWrapper;manipulationSettings=new j;structurePrinterFactory;compilerFactory;inProjectCoordinator;constructor(e){this.#r=e.project,this.fileSystemWrapper=e.fileSystemWrapper,this.#t=e.compilerOptionsContainer,this.compilerFactory=new om(this),this.inProjectCoordinator=new sm(this.compilerFactory),this.structurePrinterFactory=new cm(()=>this.manipulationSettings.getFormatCodeSettings()),this.lazyReferenceCoordinator=new de(this.compilerFactory),this.directoryCoordinator=new nm(this.compilerFactory,e.fileSystemWrapper),this.#e=e.createLanguageService?new Yp({context:this,configFileParsingDiagnostics:e.configFileParsingDiagnostics,resolutionHost:e.resolutionHost&&e.resolutionHost(this.getModuleResolutionHost(),()=>this.compilerOptions.get()),skipLoadingLibFiles:e.skipLoadingLibFiles,libFolderPath:e.libFolderPath}):void 0,e.typeChecker!=null&&(t.errors.throwIfTrue(e.createLanguageService,`Cannot specify a type checker and create a language service.`),this.#n=new qp(this),this.#n._reset(()=>e.typeChecker))}get compilerOptions(){return this.#t}get languageService(){if(this.#e==null)throw this.#i(`language service`);return this.#e}get program(){if(this.#e==null)throw this.#i(`program`);return this.languageService.getProgram()}get typeChecker(){if(this.#n!=null)return this.#n;if(this.#e==null)throw this.#i(`type checker`);return this.program.getTypeChecker()}hasLanguageService(){return this.#e!=null}getEncoding(){return this.compilerOptions.getEncoding()}getFormatCodeSettings(){return this.manipulationSettings.getFormatCodeSettings()}getUserPreferences(){return this.manipulationSettings.getUserPreferences()}resetProgram(){this.languageService._reset()}createWriter(){let t=this.manipulationSettings.getIndentationText();return new i.default({newLine:this.manipulationSettings.getNewLineKindAsString(),indentNumberOfSpaces:t===e.IndentationText.Tab?void 0:t.length,useTabs:t===e.IndentationText.Tab,useSingleQuote:this.manipulationSettings.getQuoteKind()===e.QuoteKind.Single})}getPreEmitDiagnostics(e){return t.ts.getPreEmitDiagnostics(this.program.compilerObject,e?.compilerNode).map(e=>this.compilerFactory.getDiagnostic(e))}getSourceFileContainer(){return{addOrGetSourceFileFromFilePath:(e,t)=>Promise.resolve(this.compilerFactory.addOrGetSourceFileFromFilePath(e,t)?.compilerNode),addOrGetSourceFileFromFilePathSync:(e,t)=>this.compilerFactory.addOrGetSourceFileFromFilePath(e,t)?.compilerNode,containsDirectoryAtPath:e=>this.compilerFactory.containsDirectoryAtPath(e),containsSourceFileAtPath:e=>this.compilerFactory.containsSourceFileAtPath(e),getSourceFileFromCacheFromFilePath:e=>this.compilerFactory.getSourceFileFromCacheFromFilePath(e)?.compilerNode,getSourceFilePaths:()=>this.compilerFactory.getSourceFilePaths(),getSourceFileVersion:e=>this.compilerFactory.documentRegistry.getSourceFileVersion(e),getChildDirectoriesOfDirectory:e=>{let t=[];for(let n of this.compilerFactory.getChildDirectoriesOfDirectory(e))t.push(n.getPath());return t}}}getModuleResolutionHost(){return t.createModuleResolutionHost({transactionalFileSystem:this.fileSystemWrapper,getEncoding:()=>this.getEncoding(),sourceFileContainer:this.getSourceFileContainer()})}#i(e){return new t.errors.InvalidOperationError(`A ${e} is required for this operation. This might occur when manipulating or getting type information from a node that was not added to a Project object and created via createWrappedNode. Please submit a bug report if you don't believe a ${e} should be required for this operation.`)}};Vc([t.Memoize],lm.prototype,`getSourceFileContainer`,null),Vc([t.Memoize],lm.prototype,`getModuleResolutionHost`,null);var um=class{_context;constructor(e={}){s();let n=c(),r=new t.TransactionalFileSystem({fileSystem:n,skipLoadingLibFiles:e.skipLoadingLibFiles,libFolderPath:e.libFolderPath}),i=e.tsConfigFilePath==null?void 0:new t.TsConfigResolver(r,r.getStandardizedAbsolutePath(e.tsConfigFilePath),d()),a=l(),o=new t.CompilerOptionsContainer(e.defaultCompilerOptions);o.set(a),this._context=new lm({project:this,compilerOptionsContainer:o,fileSystemWrapper:r,createLanguageService:!0,resolutionHost:e.resolutionHost,configFileParsingDiagnostics:i?.getErrors()??[],skipLoadingLibFiles:e.skipLoadingLibFiles,libFolderPath:e.libFolderPath}),e.manipulationSettings!=null&&this._context.manipulationSettings.set(e.manipulationSettings),i!=null&&e.skipAddingFilesFromTsConfig!==!0&&(this.#e(i,a),e.skipFileDependencyResolution||this.resolveSourceFileDependencies());function s(){if(e.fileSystem!=null&&e.useInMemoryFileSystem)throw new t.errors.InvalidOperationError(`Cannot provide a file system when specifying to use an in-memory file system.`)}function c(){return e.useInMemoryFileSystem?new t.InMemoryFileSystemHost:e.fileSystem??new t.RealFileSystemHost}function l(){return{...u(),...e.compilerOptions??{}}}function u(){return i?.getCompilerOptions()??{}}function d(){let t=`utf-8`;return e.compilerOptions==null?t:e.compilerOptions.charset??t}}get manipulationSettings(){return this._context.manipulationSettings}get compilerOptions(){return this._context.compilerOptions}resolveSourceFileDependencies(){let e=new Set,t=t=>e.add(t),{compilerFactory:n,inProjectCoordinator:r}=this._context;n.onSourceFileAdded(t);try{this.getProgram().compilerObject}finally{n.onSourceFileAdded(t,!1)}let i=r.markSourceFilesAsInProjectForResolution();for(let t of i.changedSourceFiles)e.add(t);for(let t of i.unchangedSourceFiles)e.delete(t);return Array.from(e.values())}addDirectoryAtPathIfExists(e,t={}){return this._context.directoryCoordinator.addDirectoryAtPathIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{...t,markInProject:!0})}addDirectoryAtPath(e,t={}){return this._context.directoryCoordinator.addDirectoryAtPath(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{...t,markInProject:!0})}createDirectory(e){return this._context.directoryCoordinator.createDirectoryOrAddIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{markInProject:!0})}getDirectoryOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getDirectory(e),n??(()=>`Could not find a directory at the specified path: ${this._context.fileSystemWrapper.getStandardizedAbsolutePath(e)}`))}getDirectory(e){let{compilerFactory:t}=this._context;return t.getDirectoryFromCache(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e))}getDirectories(){return Array.from(this.#n())}getRootDirectories(){let{inProjectCoordinator:e}=this._context,t=[];for(let e of this._context.compilerFactory.getOrphanDirectories())for(let r of n(e))t.push(r);return t;function*n(t){if(e.isDirectoryInProject(t)){yield t;return}for(let e of t._getDirectoriesIterator())yield*n(e)}}addSourceFilesAtPaths(e){return this._context.directoryCoordinator.addSourceFilesAtPaths(e,{markInProject:!0})}addSourceFileAtPathIfExists(e){return this._context.directoryCoordinator.addSourceFileAtPathIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{markInProject:!0})}addSourceFileAtPath(e){return this._context.directoryCoordinator.addSourceFileAtPath(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{markInProject:!0})}addSourceFilesFromTsConfig(e){let n=new t.TsConfigResolver(this._context.fileSystemWrapper,this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),this._context.getEncoding());return this.#e(n,n.getCompilerOptions())}#e(e,t){let n=e.getPaths(t),r=n.filePaths.map(e=>this.addSourceFileAtPath(e));for(let e of n.directoryPaths)this.addDirectoryAtPathIfExists(e);return r}createSourceFile(e,t,n){return this._context.compilerFactory.createSourceFile(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),t??``,{...n??{},markInProject:!0})}removeSourceFile(e){let t=e.wasForgotten();return e.forget(),!t}getSourceFileOrThrow(e){let n=this.getSourceFile(e);if(n!=null)return n;if(typeof e==`string`){let n=t.FileUtils.standardizeSlashes(e);if(t.FileUtils.pathIsAbsolute(n)||n.indexOf(`/`)>=0){let e=this._context.fileSystemWrapper.getStandardizedAbsolutePath(n);throw new t.errors.InvalidOperationError(`Could not find source file in project at the provided path: ${e}`)}else throw new t.errors.InvalidOperationError(`Could not find source file in project with the provided file name: ${e}`)}else throw new t.errors.InvalidOperationError(`Could not find source file in project based on the provided condition.`)}getSourceFile(e){let n=r(this._context.fileSystemWrapper);if(i(n))return this._context.compilerFactory.getSourceFileFromCacheFromFilePath(n);return t.IterableUtils.find(this.#t(),n);function r(n){if(e instanceof Function)return e;let r=t.FileUtils.standardizeSlashes(e);return t.FileUtils.pathIsAbsolute(r)||r.indexOf(`/`)>=0?n.getStandardizedAbsolutePath(r):e=>t.FileUtils.pathEndsWith(e.getFilePath(),r)}function i(e){return typeof e==`string`}}getSourceFiles(e){let{compilerFactory:n,fileSystemWrapper:r}=this._context,i=this.#t();if(typeof e==`string`||e instanceof Array)return Array.from(a());return Array.from(i);function*a(){let a=Array.from(s()),o=t.matchGlobs(a,e,r.getCurrentDirectory());for(let e of o)yield n.getSourceFileFromCacheFromFilePath(r.getStandardizedAbsolutePath(e));function*s(){for(let e of i)yield e.getFilePath()}}}*#t(){let{compilerFactory:e,inProjectCoordinator:t}=this._context;for(let n of e.getSourceFilesByDirectoryDepth())t.isSourceFileInProject(n)&&(yield n)}*#n(){let{compilerFactory:e,inProjectCoordinator:t}=this._context;for(let n of e.getDirectoriesByDepth())t.isDirectoryInProject(n)&&(yield n)}getAmbientModule(e){return e=dm(e),this.getAmbientModules().find(t=>t.getName()===e)}getAmbientModuleOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getAmbientModule(e),n??(()=>`Could not find ambient module with name: ${dm(e)}`))}getAmbientModules(){return this.getTypeChecker().getAmbientModules()}async save(){await this._context.fileSystemWrapper.flush(),await Promise.all(this.#r().map(e=>e.save()))}saveSync(){this._context.fileSystemWrapper.flushSync();for(let e of this.#r())e.saveSync()}enableLogging(e=!0){this._context.logger.setEnabled(e)}#r(){return Array.from(e(this._context.compilerFactory.getSourceFilesByDirectoryDepth()));function*e(e){for(let t of e)t.isSaved()||(yield t)}}getPreEmitDiagnostics(){return this._context.getPreEmitDiagnostics()}getLanguageService(){return this._context.languageService}getProgram(){return this._context.program}getTypeChecker(){return this._context.typeChecker}getFileSystem(){return this._context.fileSystemWrapper.getFileSystem()}emit(e={}){return this._context.program.emit(e)}emitSync(e={}){return this._context.program.emitSync(e)}emitToMemory(e={}){return this._context.program.emitToMemory(e)}getCompilerOptions(){return this._context.compilerOptions.get()}getConfigFileParsingDiagnostics(){return this.getProgram().getConfigFileParsingDiagnostics()}createWriter(){return this._context.createWriter()}forgetNodesCreatedInBlock(e){return this._context.compilerFactory.forgetNodesCreatedInBlock(e)}formatDiagnosticsWithColorAndContext(e,n={}){return t.ts.formatDiagnosticsWithColorAndContext(e.map(e=>e.compilerObject),{getCurrentDirectory:()=>this._context.fileSystemWrapper.getCurrentDirectory(),getCanonicalFileName:e=>e,getNewLine:()=>n.newLineChar??t.runtime.getEndOfLine()})}getModuleResolutionHost(){return this._context.getModuleResolutionHost()}};function dm(e){return t(e[0])&&t(e[e.length-1])&&(e=e.substring(1,e.length-1)),`"${e}"`;function t(e){return e===`"`||e===`'`}}function fm(e,n={}){let{compilerOptions:r={},sourceFile:i,typeChecker:a}=n,o=new t.CompilerOptionsContainer;o.set(r);let s=new lm({project:void 0,fileSystemWrapper:new t.TransactionalFileSystem({fileSystem:new t.RealFileSystemHost,skipLoadingLibFiles:!0,libFolderPath:void 0}),compilerOptionsContainer:o,createLanguageService:!1,typeChecker:a,configFileParsingDiagnostics:[],skipLoadingLibFiles:!0,libFolderPath:void 0}),c=s.compilerFactory.getSourceFile(l(),{markInProject:!0});return s.compilerFactory.getNodeFromCompilerNode(e,c);function l(){return i??u(e)}function u(e){if(e.kind===t.SyntaxKind.SourceFile)return e;if(e.parent==null)throw new t.errors.InvalidOperationError(`Please ensure the node was created from a source file with 'setParentNodes' set to 'true'.`);let n=e;for(;n.parent!=null;)n=n.parent;if(n.kind!==t.SyntaxKind.SourceFile)throw new t.errors.NotImplementedError(`For some reason the top parent was not a source file.`);return n}}var pm=new cm(()=>{throw new t.errors.NotImplementedError(`Not implemented scenario for getting code format settings when using a writer function. Please open an issue.`)}),mm=class{constructor(){}static object(e){return t=>{let n=Object.keys(e);t.write(`{`),n.length>0&&t.indent(()=>{r()}),t.write(`}`);function r(){for(let r=0;r<n.length;r++){r>0&&t.write(`,`).newLine();let i=n[r],a=e[i];t.write(i),a!=null&&(t.write(`: `),vm(t,a))}t.newLine()}}}static objectType(e){return t=>{t.write(`{`),gm(e)&&t.indent(()=>{pm.forTypeElementMemberedNode().printText(t,e)}),t.write(`}`)}}static unionType(e,t,...n){return hm(`|`,[e,t,...n])}static intersectionType(e,t,...n){return hm(`&`,[e,t,...n])}static assertion(e,t){return n=>{vm(n,e),n.spaceIfLastNot().write(`as `),vm(n,t)}}static returnStatement(e){return t=>{t.write(`return `),t.hangingIndentUnlessBlock(()=>{vm(t,e),t.write(`;`)})}}};function hm(e,t){return n=>{_m(n,` ${e} `,t)}}function gm(e){for(let t of Object.keys(e))if(e[t]!=null&&!(e[t]instanceof Array&&e[t].length===0))return!0;return!1}function _m(e,t,n){for(let r=0;r<n.length;r++)e.conditionalWrite(r>0,t),vm(e,n[r])}function vm(e,t){t instanceof Function?t(e):e.write(t.toString())}var{InvalidOperationError:ym,FileNotFoundError:bm,ArgumentError:xm,ArgumentNullOrWhitespaceError:Sm,ArgumentOutOfRangeError:Cm,ArgumentTypeError:wm,BaseError:Tm,DirectoryNotFoundError:Em,NotImplementedError:Dm,NotSupportedError:Om,PathNotFoundError:km}=t.errors;Object.defineProperty(e,"CompilerOptionsContainer",{enumerable:!0,get:function(){return t.CompilerOptionsContainer}}),Object.defineProperty(e,"DiagnosticCategory",{enumerable:!0,get:function(){return t.DiagnosticCategory}}),Object.defineProperty(e,"EmitHint",{enumerable:!0,get:function(){return t.EmitHint}}),Object.defineProperty(e,"InMemoryFileSystemHost",{enumerable:!0,get:function(){return t.InMemoryFileSystemHost}}),Object.defineProperty(e,"LanguageVariant",{enumerable:!0,get:function(){return t.LanguageVariant}}),Object.defineProperty(e,"ModuleKind",{enumerable:!0,get:function(){return t.ModuleKind}}),Object.defineProperty(e,"ModuleResolutionKind",{enumerable:!0,get:function(){return t.ModuleResolutionKind}}),Object.defineProperty(e,"NewLineKind",{enumerable:!0,get:function(){return t.NewLineKind}}),Object.defineProperty(e,"NodeFlags",{enumerable:!0,get:function(){return t.NodeFlags}}),Object.defineProperty(e,"ObjectFlags",{enumerable:!0,get:function(){return t.ObjectFlags}}),Object.defineProperty(e,"ResolutionHosts",{enumerable:!0,get:function(){return t.ResolutionHosts}}),Object.defineProperty(e,"ScriptKind",{enumerable:!0,get:function(){return t.ScriptKind}}),Object.defineProperty(e,"ScriptTarget",{enumerable:!0,get:function(){return t.ScriptTarget}}),Object.defineProperty(e,"SettingsContainer",{enumerable:!0,get:function(){return t.SettingsContainer}}),Object.defineProperty(e,"SymbolFlags",{enumerable:!0,get:function(){return t.SymbolFlags}}),Object.defineProperty(e,"SyntaxKind",{enumerable:!0,get:function(){return t.SyntaxKind}}),Object.defineProperty(e,"TypeFlags",{enumerable:!0,get:function(){return t.TypeFlags}}),Object.defineProperty(e,"TypeFormatFlags",{enumerable:!0,get:function(){return t.TypeFormatFlags}}),Object.defineProperty(e,"ts",{enumerable:!0,get:function(){return t.ts}}),Object.defineProperty(e,"CodeBlockWriter",{enumerable:!0,get:function(){return i.default}}),e.AbstractableNode=Ma,e.AmbientableNode=_e,e.ArgumentError=xm,e.ArgumentNullOrWhitespaceError=Sm,e.ArgumentOutOfRangeError=Cm,e.ArgumentTypeError=wm,e.ArgumentedNode=on,e.ArrayBindingPattern=Oa,e.ArrayDestructuringAssignment=za,e.ArrayDestructuringAssignmentBase=Ra,e.ArrayLiteralExpression=Wa,e.ArrayTypeNode=iu,e.ArrowFunction=el,e.ArrowFunctionBase=$c,e.AsExpression=$a,e.AsExpressionBase=Qa,e.AssignmentExpression=La,e.AssignmentExpressionBase=Ia,e.AsyncableNode=sn,e.AwaitExpression=to,e.AwaitExpressionBase=eo,e.AwaitableNode=cn,e.BaseError=Tm,e.BaseExpressionedNode=Ka,e.BigIntLiteral=Wf,e.BigIntLiteralBase=Uf,e.BinaryExpression=Fa,e.BinaryExpressionBase=Pa,e.BindingElement=Aa,e.BindingElementBase=ka,e.BindingNamedNode=Qi,e.Block=gs,e.BlockBase=hs,e.BodiedNode=Sn,e.BodyableNode=Cn,e.BreakStatement=_s,e.CallExpression=ro,e.CallExpressionBase=no,e.CallSignatureDeclaration=Qd,e.CallSignatureDeclarationBase=Zd,e.CaseBlock=ys,e.CaseBlockBase=vs,e.CaseClause=xs,e.CaseClauseBase=bs,e.CatchClause=Cs,e.CatchClauseBase=Ss,e.ChildOrderableNode=wn,e.ClassDeclaration=El,e.ClassDeclarationBase=Tl,e.ClassElement=ml,e.ClassExpression=Pl,e.ClassExpressionBase=Nl,e.ClassLikeDeclarationBase=vl,e.ClassLikeDeclarationBaseSpecific=yl,e.ClassStaticBlockDeclaration=Il,e.ClassStaticBlockDeclarationBase=Fl,e.CodeAction=Dp,e.CodeFixAction=Op,e.CombinedCodeActions=kp,e.CommaListExpression=ao,e.CommaListExpressionBase=io,e.CommentClassElement=Ll,e.CommentEnumMember=Wd,e.CommentObjectLiteralElement=wo,e.CommentRange=pn,e.CommentStatement=ws,e.CommentTypeElement=$d,e.CommonIdentifierBase=pf,e.CompilerCommentClassElement=f,e.CompilerCommentEnumMember=h,e.CompilerCommentNode=u,e.CompilerCommentObjectLiteralElement=m,e.CompilerCommentStatement=d,e.CompilerCommentTypeElement=p,e.ComputedPropertyName=hf,e.ComputedPropertyNameBase=mf,e.ConditionalExpression=so,e.ConditionalExpressionBase=oo,e.ConditionalTypeNode=au,e.ConstructSignatureDeclaration=tf,e.ConstructSignatureDeclarationBase=ef,e.ConstructorDeclaration=Bl,e.ConstructorDeclarationBase=Rl,e.ConstructorDeclarationOverloadBase=zl,e.ConstructorTypeNode=lu,e.ConstructorTypeNodeBase=cu,e.ContinueStatement=Ts,e.DebuggerStatement=Ds,e.DebuggerStatementBase=Es,e.DecoratableNode=Tn,e.Decorator=Jl,e.DecoratorBase=ql,e.DefaultClause=ks,e.DefaultClauseBase=Os,e.DefinitionInfo=jp,e.DeleteExpression=lo,e.DeleteExpressionBase=co,e.Diagnostic=Np,e.DiagnosticMessageChain=Mp,e.DiagnosticWithLocation=Pp,e.Directory=$p,e.DirectoryEmitResult=Qp,e.DirectoryNotFoundError=Em,e.DoStatement=Ms,e.DoStatementBase=js,e.DocumentSpan=Ap,e.DotDotDotTokenableNode=kn,e.ElementAccessExpression=fo,e.ElementAccessExpressionBase=uo,e.EmitOutput=Ip,e.EmitResult=Lp,e.EmptyStatement=Ps,e.EmptyStatementBase=Ns,e.EnumDeclaration=Kd,e.EnumDeclarationBase=Gd,e.EnumMember=Jd,e.EnumMemberBase=qd,e.ExclamationTokenableNode=An,e.ExportAssignment=ic,e.ExportAssignmentBase=rc,e.ExportDeclaration=oc,e.ExportDeclarationBase=ac,e.ExportGetableNode=jn,e.ExportSpecifier=lc,e.ExportSpecifierBase=cc,e.ExportableNode=Nn,e.Expression=Na,e.ExpressionStatement=Is,e.ExpressionStatementBase=Fs,e.ExpressionWithTypeArguments=du,e.ExpressionWithTypeArgumentsBase=uu,e.ExpressionableNode=Ga,e.ExpressionedNode=qa,e.ExtendsClauseableNode=Fi,e.ExternalModuleReference=dc,e.ExternalModuleReferenceBase=uc,e.FalseLiteral=Jf,e.FalseLiteralBase=qf,e.FileNotFoundError=bm,e.FileReference=Bc,e.FileTextChanges=Ep,e.ForInStatement=Rs,e.ForInStatementBase=Ls,e.ForOfStatement=Bs,e.ForOfStatementBase=zs,e.ForStatement=Hs,e.ForStatementBase=Vs,e.FunctionDeclaration=cl,e.FunctionDeclarationBase=ol,e.FunctionDeclarationOverloadBase=sl,e.FunctionExpression=ul,e.FunctionExpressionBase=ll,e.FunctionLikeDeclaration=Qc,e.FunctionOrConstructorTypeNodeBase=su,e.FunctionOrConstructorTypeNodeBaseBase=ou,e.FunctionTypeNode=pu,e.FunctionTypeNodeBase=fu,e.GeneratorableNode=Ii,e.GetAccessorDeclaration=Hl,e.GetAccessorDeclarationBase=Vl,e.HeritageClause=Yd,e.HeritageClauseableNode=Ri,e.Identifier=_f,e.IdentifierBase=gf,e.IfStatement=Ws,e.IfStatementBase=Us,e.ImplementationLocation=Rp,e.ImplementsClauseableNode=zi,e.ImportAttribute=pc,e.ImportAttributeBase=fc,e.ImportAttributeNamedNode=$i,e.ImportAttributes=hc,e.ImportAttributesBase=mc,e.ImportClause=_c,e.ImportClauseBase=gc,e.ImportDeclaration=yc,e.ImportDeclarationBase=vc,e.ImportEqualsDeclaration=Cc,e.ImportEqualsDeclarationBase=Sc,e.ImportExpression=mo,e.ImportExpressionBase=po,e.ImportExpressionedNode=Ja,e.ImportSpecifier=Tc,e.ImportSpecifierBase=wc,e.ImportTypeNode=mu,e.IndexSignatureDeclaration=rf,e.IndexSignatureDeclarationBase=nf,e.IndexedAccessTypeNode=hu,e.InferTypeNode=gu,e.InitializerExpressionGetableNode=Bi,e.InitializerExpressionableNode=Vi,e.InterfaceDeclaration=of,e.InterfaceDeclarationBase=af,e.IntersectionTypeNode=_u,e.InvalidOperationError=ym,e.IterationStatement=As,e.JSDoc=eu,e.JSDocAllType=Bu,e.JSDocAugmentsTag=Ju,e.JSDocAuthorTag=Yu,e.JSDocBase=$l,e.JSDocCallbackTag=Xu,e.JSDocClassTag=Zu,e.JSDocDeprecatedTag=Qu,e.JSDocEnumTag=$u,e.JSDocFunctionType=td,e.JSDocFunctionTypeBase=ed,e.JSDocImplementsTag=nd,e.JSDocLink=rd,e.JSDocLinkCode=id,e.JSDocLinkPlain=ad,e.JSDocMemberName=od,e.JSDocNameReference=cd,e.JSDocNamepathType=sd,e.JSDocNonNullableType=ld,e.JSDocNullableType=ud,e.JSDocOptionalType=dd,e.JSDocOverloadTag=pd,e.JSDocOverloadTagBase=fd,e.JSDocOverrideTag=md,e.JSDocParameterTag=gd,e.JSDocParameterTagBase=hd,e.JSDocPrivateTag=_d,e.JSDocPropertyLikeTag=Yl,e.JSDocPropertyTag=vd,e.JSDocPropertyTagBase=J,e.JSDocProtectedTag=yd,e.JSDocPublicTag=bd,e.JSDocReadonlyTag=xd,e.JSDocReturnTag=Cd,e.JSDocReturnTagBase=Sd,e.JSDocSatisfiesTag=Td,e.JSDocSatisfiesTagBase=wd,e.JSDocSeeTag=Dd,e.JSDocSeeTagBase=Ed,e.JSDocSignature=Od,e.JSDocTag=Hu,e.JSDocTagBase=Vu,e.JSDocTagInfo=kd,e.JSDocTemplateTag=jd,e.JSDocTemplateTagBase=Ad,e.JSDocText=Md,e.JSDocThisTag=Pd,e.JSDocThisTagBase=Nd,e.JSDocThrowsTag=Id,e.JSDocThrowsTagBase=Fd,e.JSDocType=zu,e.JSDocTypeExpression=Rd,e.JSDocTypeExpressionableTag=Xl,e.JSDocTypeLiteral=zd,e.JSDocTypeParameteredTag=Zl,e.JSDocTypeTag=Bd,e.JSDocTypedefTag=Ld,e.JSDocUnknownTag=Vd,e.JSDocUnknownType=Hd,e.JSDocVariadicType=Ud,e.JSDocableNode=Ui,e.JsxAttribute=Sf,e.JsxAttributeBase=xf,e.JsxAttributedNode=df,e.JsxClosingElement=wf,e.JsxClosingElementBase=Cf,e.JsxClosingFragment=Tf,e.JsxElement=Df,e.JsxElementBase=Ef,e.JsxExpression=Af,e.JsxExpressionBase=kf,e.JsxFragment=jf,e.JsxNamespacedName=Nf,e.JsxNamespacedNameBase=Mf,e.JsxOpeningElement=Ff,e.JsxOpeningElementBase=Pf,e.JsxOpeningFragment=If,e.JsxSelfClosingElement=Rf,e.JsxSelfClosingElementBase=Lf,e.JsxSpreadAttribute=Bf,e.JsxSpreadAttributeBase=zf,e.JsxTagNamedNode=ff,e.JsxText=Hf,e.JsxTextBase=Vf,e.LabeledStatement=Ks,e.LabeledStatementBase=Gs,e.LanguageService=Yp,e.LeftHandSideExpression=W,e.LeftHandSideExpressionedNode=Ya,e.LiteralExpression=go,e.LiteralExpressionBase=ho,e.LiteralLikeNode=Wi,e.LiteralTypeNode=vu,e.ManipulationError=Dt,e.ManipulationSettingsContainer=j,e.MappedTypeNode=yu,e.MemberExpression=Ha,e.MemoryEmitResult=zp,e.MetaProperty=vo,e.MetaPropertyBase=_o,e.MethodDeclaration=_l,e.MethodDeclarationBase=hl,e.MethodDeclarationOverloadBase=gl,e.MethodSignature=cf,e.MethodSignatureBase=sf,e.ModifierableNode=Gi,e.ModuleBlock=Dc,e.ModuleBlockBase=Ec,e.ModuleChildableNode=Oc,e.ModuleDeclaration=Ac,e.ModuleDeclarationBase=kc,e.ModuleNamedNode=ea,e.ModuledNode=qi,e.NameableNode=ta,e.NamedExports=Pc,e.NamedExportsBase=Nc,e.NamedImports=Ic,e.NamedImportsBase=Fc,e.NamedNode=ia,e.NamedNodeBase=Ji,e.NamedTupleMember=xu,e.NamedTupleMemberBase=bu,e.NamespaceExport=Rc,e.NamespaceExportBase=Lc,e.NamespaceImport=zc,e.NamespaceImportBase=q,e.NewExpression=bo,e.NewExpressionBase=yo,e.NoSubstitutionTemplateLiteral=op,e.NoSubstitutionTemplateLiteralBase=ap,e.Node=V,e.NodeWithTypeArguments=ru,e.NodeWithTypeArgumentsBase=nu,e.NonNullExpression=So,e.NonNullExpressionBase=xo,e.NotEmittedStatement=Js,e.NotEmittedStatementBase=qs,e.NotImplementedError=Dm,e.NotSupportedError=Om,e.NullLiteral=Qf,e.NullLiteralBase=Zf,e.NumericLiteral=ep,e.NumericLiteralBase=$f,e.ObjectBindingPattern=ja,e.ObjectDestructuringAssignment=Eo,e.ObjectDestructuringAssignmentBase=To,e.ObjectLiteralElement=Co,e.ObjectLiteralExpression=Oo,e.ObjectLiteralExpressionBase=Do,e.OmittedExpression=Io,e.OmittedExpressionBase=Fo,e.OutputFile=Fp,e.OverloadableNode=tl,e.OverrideableNode=oa,e.ParameterDeclaration=fl,e.ParameterDeclarationBase=dl,e.ParameteredNode=sa,e.ParenthesizedExpression=K,e.ParenthesizedExpressionBase=G,e.ParenthesizedTypeNode=Su,e.PartiallyEmittedExpression=Ro,e.PartiallyEmittedExpressionBase=Lo,e.PathNotFoundError=km,e.PostfixUnaryExpression=Bo,e.PostfixUnaryExpressionBase=zo,e.PrefixUnaryExpression=Ho,e.PrefixUnaryExpressionBase=Vo,e.PrimaryExpression=Ua,e.PrivateIdentifier=yf,e.PrivateIdentifierBase=vf,e.Program=Jp,e.Project=um,e.PropertyAccessExpression=Wo,e.PropertyAccessExpressionBase=Uo,e.PropertyAssignment=Ao,e.PropertyAssignmentBase=ko,e.PropertyDeclaration=Wl,e.PropertyDeclarationBase=Ul,e.PropertyNamedNode=aa,e.PropertySignature=uf,e.PropertySignatureBase=lf,e.QualifiedName=bf,e.QuestionDotTokenableNode=ca,e.QuestionTokenableNode=la,e.ReadonlyableNode=ua,e.RefactorEditInfo=Bp,e.ReferenceEntry=Up,e.ReferenceFindableNode=Yi,e.ReferencedSymbol=Vp,e.ReferencedSymbolDefinitionInfo=Hp,e.ReferencedSymbolEntry=Wp,e.RegularExpressionLiteral=np,e.RegularExpressionLiteralBase=tp,e.RenameLocation=Gp,e.RenameableNode=Zi,e.RestTypeNode=Cu,e.ReturnStatement=Xs,e.ReturnStatementBase=Ys,e.ReturnTypedNode=da,e.SatisfiesExpression=Ko,e.SatisfiesExpressionBase=Go,e.ScopeableNode=fa,e.ScopedNode=ha,e.SetAccessorDeclaration=Kl,e.SetAccessorDeclarationBase=Gl,e.ShorthandPropertyAssignment=Mo,e.ShorthandPropertyAssignmentBase=jo,e.Signature=Sp,e.SignaturedDeclaration=ga,e.SourceFile=Uc,e.SourceFileBase=Hc,e.SpreadAssignment=Po,e.SpreadAssignmentBase=No,e.SpreadElement=Jo,e.SpreadElementBase=qo,e.Statement=fs,e.StatementBase=ds,e.StatementedNode=ps,e.StaticableNode=_a,e.StringLiteral=ip,e.StringLiteralBase=rp,e.Structure=Yn,e.SuperElementAccessExpression=Xo,e.SuperElementAccessExpressionBase=Yo,e.SuperExpression=Qo,e.SuperExpressionBase=Zo,e.SuperExpressionedNode=Xa,e.SuperPropertyAccessExpression=es,e.SuperPropertyAccessExpressionBase=$o,e.SwitchStatement=Qs,e.SwitchStatementBase=Zs,e.Symbol=Cp,e.SymbolDisplayPart=Kp,e.SyntaxList=yn,e.TaggedTemplateExpression=sp,e.TemplateExpression=lp,e.TemplateExpressionBase=cp,e.TemplateHead=dp,e.TemplateHeadBase=up,e.TemplateLiteralTypeNode=wu,e.TemplateMiddle=pp,e.TemplateMiddleBase=fp,e.TemplateSpan=hp,e.TemplateSpanBase=mp,e.TemplateTail=_p,e.TemplateTailBase=gp,e.TextChange=Tp,e.TextInsertableNode=va,e.TextRange=fn,e.TextSpan=wp,e.ThisExpression=ns,e.ThisExpressionBase=ts,e.ThisTypeNode=Tu,e.ThrowStatement=ec,e.ThrowStatementBase=$s,e.TrueLiteral=Kf,e.TrueLiteralBase=Gf,e.TryStatement=nc,e.TryStatementBase=tc,e.TupleTypeNode=Eu,e.Type=Xp,e.TypeAliasDeclaration=Ou,e.TypeAliasDeclarationBase=Du,e.TypeArgumentedNode=ba,e.TypeAssertion=is,e.TypeAssertionBase=rs,e.TypeChecker=qp,e.TypeElement=Xd,e.TypeElementMemberedNode=Ca,e.TypeLiteralNode=Au,e.TypeLiteralNodeBase=ku,e.TypeNode=tu,e.TypeOfExpression=os,e.TypeOfExpressionBase=as,e.TypeOperatorTypeNode=ju,e.TypeParameter=Zp,e.TypeParameterDeclaration=Nu,e.TypeParameterDeclarationBase=Mu,e.TypeParameteredNode=Ta,e.TypePredicateNode=Fu,e.TypeQueryNode=Iu,e.TypeReferenceNode=Lu,e.TypedNode=xa,e.UnaryExpression=Ba,e.UnaryExpressionedNode=Za,e.UnionTypeNode=Ru,e.UnwrappableNode=Da,e.UpdateExpression=Va,e.VariableDeclaration=yp,e.VariableDeclarationBase=vp,e.VariableDeclarationList=xp,e.VariableDeclarationListBase=bp,e.VariableStatement=qc,e.VariableStatementBase=Kc,e.VoidExpression=cs,e.VoidExpressionBase=ss,e.WhileStatement=Yc,e.WhileStatementBase=Jc,e.WithStatement=Zc,e.WithStatementBase=Xc,e.Writers=mm,e.YieldExpression=us,e.YieldExpressionBase=ls,e.createWrappedNode=fm,e.forEachStructureChild=Xn,e.getCompilerOptionsFromTsConfig=pe,e.getScopeForNode=pa,e.insertOverloads=al,e.printNode=A,e.setScopeForNode=ma}))(),B=new Set([`t`,`msg`]),Qt=`Trans`,$t=e=>{if(e!==void 0&&(Zt.Node.isStringLiteral(e)||Zt.Node.isNoSubstitutionTemplateLiteral(e)))return e.getLiteralText()},en=e=>{if(e===void 0)return;let t=$t(e);if(t!==void 0)return{message:t};if(!Zt.Node.isObjectLiteralExpression(e))return;let n=e.getProperty(`message`);if(n===void 0||!Zt.Node.isPropertyAssignment(n))return;let r=$t(n.getInitializer());if(r===void 0)return;let i=e.getProperty(`context`),a=i!==void 0&&Zt.Node.isPropertyAssignment(i)?$t(i.getInitializer()):void 0;return a===void 0?{message:r}:{message:r,context:a}},tn=(e,t)=>{let n=e.getAttribute(t);if(n===void 0||!Zt.Node.isJsxAttribute(n))return;let r=n.getInitializer();if(r!==void 0){if(Zt.Node.isStringLiteral(r))return r.getLiteralText();if(Zt.Node.isJsxExpression(r))return $t(r.getExpression())}},nn=e=>{let t=e.getJsxChildren();if(t.some(e=>Zt.Node.isJsxExpression(e)||Zt.Node.isJsxElement(e)||Zt.Node.isJsxSelfClosingElement(e)))return;let n=v(t.filter(e=>Zt.Node.isJsxText(e)).map(e=>e.getText()).join(``));return n.length>0?n:void 0},rn=e=>{let t=new Map;for(let n of e)t.set(_(n.message,n.context),n);return[...t.values()]},an=async e=>{if(e.length===0)return[];let t=new Zt.Project({useInMemoryFileSystem:!0,skipFileDependencyResolution:!0}),n=[];for(let r=0;r<e.length;r++){let a;try{a=await(0,i.readFile)(e[r],`utf8`)}catch{continue}t.createSourceFile(`front-component-${r}.tsx`,a,{overwrite:!0}).forEachDescendant(e=>{if(Zt.Node.isCallExpression(e)){let t=e.getExpression();if(Zt.Node.isIdentifier(t)&&B.has(t.getText())){let t=en(e.getArguments()[0]);t!==void 0&&n.push(t)}return}if(Zt.Node.isJsxSelfClosingElement(e)){if(e.getTagNameNode().getText()!==Qt)return;let t=tn(e,`message`);if(t!==void 0&&t.length>0){let r=tn(e,`context`);n.push(r===void 0?{message:t}:{message:t,context:r})}return}if(Zt.Node.isJsxElement(e)){let t=e.getOpeningElement();if(t.getTagNameNode().getText()!==Qt)return;let r=tn(t,`message`)??nn(e);if(r!==void 0&&r.length>0){let e=tn(t,`context`);n.push(e===void 0?{message:r}:{message:r,context:e})}}})}return rn(n)},on={objects:[`labelSingular`,`labelPlural`,`description`],fields:[`label`,`description`],views:[`name`],pageLayoutTabs:[`title`],commandMenuItems:[`label`,`shortLabel`],navigationMenuItems:[`name`]},sn=e=>{let t=new Set,n=e=>{typeof e==`string`&&e.length>0&&t.add(e)};for(let[t,r]of Object.entries(on)){let i=e[t];if(Array.isArray(i)){for(let e of i)if(!(typeof e!=`object`||!e))for(let t of r)n(e[t])}}for(let t of e.pageLayouts??[])for(let e of t.tabs??[]){n(e.title);for(let t of e.widgets??[])n(t.title)}return[...t].sort()},cn=async({manifest:e,frontComponentSourcePaths:t})=>{let n=sn(e).map(e=>({message:e})),r=await an(t),i=new Map;for(let e of[...n,...r])i.set(_(e.message,e.context),e);return i},ln=async({appPath:e,manifest:a,frontComponentSourcePaths:o=[],scaffoldLocale:s})=>{let c=await cn({manifest:a,frontComponentSourcePaths:o}),l=[...c.keys()].sort(),u=r.default.join(e,t.tt);await t.ct(u);let d={};for(let e of l){let t=c.get(e);n.t(t)&&(d[e]=t.message)}if(await t.ft(r.default.join(u,`en.json`),d),s!==void 0&&s!==`en`){let e=r.default.join(u,`${s}.json`);await t.lt(e)||await t.ft(e,{})}let f=(await(0,i.readdir)(u)).filter(e=>e.endsWith(`.json`)&&e!==`en.json`);for(let e of f){let n=r.default.join(u,e),i=await t.ut(n)??{},a={};for(let e of l){let t=i[e];a[e]=typeof t==`string`?t:``}await t.ft(n,a)}return{sourceCount:l.length,updatedLocaleFiles:f}},un=e=>Object.prototype.hasOwnProperty.call(t.yt,e),dn=class{async execute(e){let n=e.appPath??t.Et,i;e.locale!==void 0&&((e.locale===`en`||!un(e.locale))&&(console.error(u.default.red(`"${e.locale}" is not a supported target locale. Choose one of: ${Object.keys(t.yt).filter(e=>e!==`en`).join(`, `)}`)),process.exit(1)),i=e.locale),console.log(u.default.blue(`Extracting translatable strings...`));let a=await t.$(n);a.success||(console.error(u.default.red(a.errors.join(`
|
|
31390
31390
|
`))),process.exit(1)),a.warnings.length>0&&console.warn(u.default.yellow(a.warnings.join(`
|
|
31391
|
-
`)));let o=a.filePaths.frontComponents.map(e=>r.default.join(n,e)),{sourceCount:s,updatedLocaleFiles:c}=await ln({appPath:n,manifest:a.manifest,frontComponentSourcePaths:o,scaffoldLocale:i});console.log(u.default.green(`✓ Extracted ${s} string${s===1?``:`s`} to locales/`)),c.length>0&&console.log(u.default.gray(`Updated: ${c.join(`, `)}`))}},fn=e=>{let n=new ye,r=new Nt,i=new Ft,a=new Ce,o=new ve,s=new Lt,c=new dn;e.command(`dev [appPath]`).description(`Build and sync local changes`).option(`-o, --once`,"Build and sync once, then exit (deprecated: use `twenty apply`)").option(`--dry-run`,"Preview the metadata changes without applying them (deprecated: use `twenty plan`)").option(`-f, --force`,`Apply destructive changes (deletes) without confirmation`).option(`--debounceMs <ms>`,`Debounce in ms (default: 1 000)`).option(`-v, --verbose`,`Show detailed logs`).option(`-d, --debug`,`Show detailed logs (alias for --verbose)`).action(async(e,t)=>{t.dryRun&&!t.once&&console.warn(u.default.yellow("--dry-run only applies with --once. Ignoring it; run `yarn twenty plan` to preview changes."));let n=t.verbose||t.debug;if(t.once){console.warn(u.default.yellow(t.dryRun?"⚠ `twenty dev --once --dry-run` is deprecated. Use `twenty plan` instead.":"⚠ `twenty dev --once` is deprecated. Use `twenty apply` instead.")),await i.execute({appPath:g(e),verbose:n,apply:!t.dryRun,force:t.force});return}await r.execute({appPath:g(e),verbose:n,debounceMs:t.debounceMs?parseInt(t.debounceMs,10):void 0,force:t.force})}),e.command(`plan [appPath]`).description(`Preview metadata changes without applying them`).option(`-v, --verbose`,`Show detailed logs`).action(async(e,t)=>{await i.execute({appPath:g(e),verbose:t.verbose,apply:!1})}),e.command(`apply [appPath]`).description(`Apply local metadata changes after showing the plan`).option(`-f, --force`,`Apply destructive changes (deletes) without confirmation`).option(`-v, --verbose`,`Show detailed logs`).action(async(e,t)=>{await i.execute({appPath:g(e),verbose:t.verbose,apply:!0,force:t.force})}),e.command(`dev:build [appPath]`).description(`Build and generate API client`).option(`--tarball`,`Also pack into a .tgz tarball`).action(async(e,t)=>{await n.execute({appPath:g(e),tarball:t.tarball})}),e.command(`dev:typecheck [appPath]`).description(`Run TypeScript type checking`).action(async e=>{await a.execute({appPath:g(e)})}),e.command(`dev:add [entityType]`).description(`Scaffold a new entity (${Object.values(t.pt).join(`|`)})`).option(`--path <path>`,`Path in which the entity should be created.`).action(async(e,t)=>{await o.execute(e,t?.path)}),e.command(`dev:catalog-sync`).description(`Trigger marketplace catalog sync`).option(`-r, --remote <name>`,`Sync on a specific remote`).action(async e=>{let{CatalogSyncCommand:t}=await Promise.resolve().then(()=>require("./catalog-sync-
|
|
31391
|
+
`)));let o=a.filePaths.frontComponents.map(e=>r.default.join(n,e)),{sourceCount:s,updatedLocaleFiles:c}=await ln({appPath:n,manifest:a.manifest,frontComponentSourcePaths:o,scaffoldLocale:i});console.log(u.default.green(`✓ Extracted ${s} string${s===1?``:`s`} to locales/`)),c.length>0&&console.log(u.default.gray(`Updated: ${c.join(`, `)}`))}},fn=e=>{let n=new ye,r=new Nt,i=new Ft,a=new Ce,o=new ve,s=new Lt,c=new dn;e.command(`dev [appPath]`).description(`Build and sync local changes`).option(`-o, --once`,"Build and sync once, then exit (deprecated: use `twenty apply`)").option(`--dry-run`,"Preview the metadata changes without applying them (deprecated: use `twenty plan`)").option(`-f, --force`,`Apply destructive changes (deletes) without confirmation`).option(`--debounceMs <ms>`,`Debounce in ms (default: 1 000)`).option(`-v, --verbose`,`Show detailed logs`).option(`-d, --debug`,`Show detailed logs (alias for --verbose)`).action(async(e,t)=>{t.dryRun&&!t.once&&console.warn(u.default.yellow("--dry-run only applies with --once. Ignoring it; run `yarn twenty plan` to preview changes."));let n=t.verbose||t.debug;if(t.once){console.warn(u.default.yellow(t.dryRun?"⚠ `twenty dev --once --dry-run` is deprecated. Use `twenty plan` instead.":"⚠ `twenty dev --once` is deprecated. Use `twenty apply` instead.")),await i.execute({appPath:g(e),verbose:n,apply:!t.dryRun,force:t.force});return}await r.execute({appPath:g(e),verbose:n,debounceMs:t.debounceMs?parseInt(t.debounceMs,10):void 0,force:t.force})}),e.command(`plan [appPath]`).description(`Preview metadata changes without applying them`).option(`-v, --verbose`,`Show detailed logs`).action(async(e,t)=>{await i.execute({appPath:g(e),verbose:t.verbose,apply:!1})}),e.command(`apply [appPath]`).description(`Apply local metadata changes after showing the plan`).option(`-f, --force`,`Apply destructive changes (deletes) without confirmation`).option(`-v, --verbose`,`Show detailed logs`).action(async(e,t)=>{await i.execute({appPath:g(e),verbose:t.verbose,apply:!0,force:t.force})}),e.command(`dev:build [appPath]`).description(`Build and generate API client`).option(`--tarball`,`Also pack into a .tgz tarball`).action(async(e,t)=>{await n.execute({appPath:g(e),tarball:t.tarball})}),e.command(`dev:typecheck [appPath]`).description(`Run TypeScript type checking`).action(async e=>{await a.execute({appPath:g(e)})}),e.command(`dev:add [entityType]`).description(`Scaffold a new entity (${Object.values(t.pt).join(`|`)})`).option(`--path <path>`,`Path in which the entity should be created.`).action(async(e,t)=>{await o.execute(e,t?.path)}),e.command(`dev:catalog-sync`).description(`Trigger marketplace catalog sync`).option(`-r, --remote <name>`,`Sync on a specific remote`).action(async e=>{let{CatalogSyncCommand:t}=await Promise.resolve().then(()=>require("./catalog-sync-DHopgolZ.js"));await new t().execute({remote:e.remote})}),e.command(`dev:generate-client [appPath]`).description(`Generate the typed API client from the active remote (no app definition required)`).action(async e=>{await s.execute({appPath:g(e)})}),e.command(`dev:translations-extract [appPath]`).description(`Extract translatable strings into locales/ catalogs`).option(`--locale <locale>`,`Scaffold an empty catalog for a target locale (e.g. fr-FR)`).action(async(e,t)=>{await c.execute({appPath:g(e),locale:t.locale})}),It(e)},pn=async(e,n)=>{let r=n.test?t.C:t.S,i=n.port?parseInt(n.port,10):r;(isNaN(i)||i<1||i>65535)&&(console.error(u.default.red(`Invalid port number.`)),process.exit(1));let a=await t.n({port:i,test:n.test,version:e,onProgress:e=>console.log(u.default.gray(e))});a.success||(console.error(u.default.red(a.error.message)),process.exit(1))},V=e=>{let n=e.test?t.w:t.x;if(!t.E(n)){console.log(u.default.yellow(`No Twenty server container found.`));return}(0,l.execSync)(`docker stop ${n}`,{stdio:`ignore`}),console.log(u.default.green(`Twenty server stopped.`))},mn=e=>{let n=e.test?t.w:t.x;if(!t.E(n)){console.log(u.default.yellow(`No Twenty server container found.`));return}try{(0,l.spawnSync)(`docker`,[`logs`,`-f`,`--tail`,e.lines,n],{stdio:`inherit`})}catch{}},hn=async e=>{let n=e.test?t.w:t.x,r=e.test?t.C:t.S;if(!t.E(n)){console.log(` Status: ${u.default.gray(`not created`)}`),console.log(u.default.gray(` Run 'yarn twenty docker:start${e.test?` --test`:``}' to create one.`));return}let i=t.M(n),a=i?t.k(n):r,o=i?await t.m(a):!1,s=o?u.default.green(`running (healthy)`):i?u.default.yellow(`running (starting...)`):u.default.gray(`stopped`),c=t.O(`APP_VERSION`,n);console.log(` Status: ${s}`),console.log(` URL: http://localhost:${a}`),c&&console.log(` Version: ${u.default.gray(c)}`),o&&console.log(u.default.gray(` Login: tim@apple.dev / tim@apple.dev`))},gn=e=>{let n=e.test?t.w:t.x,r=e.test?`twenty-app-dev-test-data`:`twenty-app-dev-data`,i=e.test?`twenty-app-dev-test-storage`:`twenty-app-dev-storage`;t.E(n)&&(0,l.execSync)(`docker rm -f ${n}`,{stdio:`ignore`});try{(0,l.execSync)(`docker volume rm ${r} ${i}`,{stdio:`ignore`})}catch{}console.log(u.default.green(`Twenty server data reset.`)),console.log(u.default.gray(`Run 'yarn twenty docker:start${e.test?` --test`:``}' to start a fresh instance.`))},_n=async(e,n)=>{let r=await t.a({version:e??`latest`,test:n.test,onProgress:e=>console.log(u.default.gray(e))});r.success||(console.error(u.default.red(r.error.message)),process.exit(1));let{data:i}=r;if(!i.imageUpdated){console.log(u.default.green(` Already up to date (${i.image}).`));return}console.log(u.default.green(` Upgraded to: ${i.image}`)),i.containerRecreated&&console.log(u.default.gray(` Run 'yarn twenty docker:start${n.test?` --test`:``}' to wait for the server to be ready.`))},vn=e=>{e.command(`docker:start [version]`).description("Start the local Twenty container (version defaults to the app `engines.twenty` range, then `latest`)").option(`-p, --port <port>`,`HTTP port`).option(`--test`,`Start a separate test instance (port 2021)`).action(pn),e.command(`docker:stop`).description(`Stop the local Twenty container`).option(`--test`,`Stop the test instance`).action(V),e.command(`docker:logs`).description(`Stream container logs`).option(`-n, --lines <lines>`,`Number of lines to show`,`50`).option(`--test`,`Show logs for the test instance`).action(mn),e.command(`docker:status`).description(`Show container status`).option(`--test`,`Show status of the test instance`).action(hn),e.command(`docker:reset`).description(`Delete all data and start fresh`).option(`--test`,`Reset the test instance`).action(gn),e.command(`docker:upgrade [version]`).description(`Upgrade the Docker image`).option(`--test`,`Upgrade the test instance`).action(_n);let t=e.command(`server`,{hidden:!0}).description(`Manage a Twenty server (local instance and server-side actions)`),n=(e,t)=>console.warn(u.default.yellow(`⚠ \`twenty server ${e}\` is deprecated. Use \`twenty ${t}\` instead.`));t.command(`start [version]`).option(`-p, --port <port>`,`HTTP port`).option(`--test`,`Start a separate test instance (port 2021)`).action(async(e,t)=>{n(`start`,`docker:start`),await pn(e,t)}),t.command(`stop`).option(`--test`,`Stop the test instance`).action(e=>{n(`stop`,`docker:stop`),V(e)}),t.command(`logs`).option(`-n, --lines <lines>`,`Number of lines to show`,`50`).option(`--test`,`Show logs for the test instance`).action(e=>{n(`logs`,`docker:logs`),mn(e)}),t.command(`status`).option(`--test`,`Show status of the test instance`).action(async e=>{n(`status`,`docker:status`),await hn(e)}),t.command(`reset`).option(`--test`,`Reset the test instance`).action(e=>{n(`reset`,`docker:reset`),gn(e)}),t.command(`upgrade [version]`).option(`--test`,`Upgrade the test instance`).action(async(e,t)=>{n(`upgrade`,`docker:upgrade`),await _n(e,t)}),t.command(`catalog-sync`).option(`-r, --remote <name>`,`Sync on a specific remote`).action(async e=>{n(`catalog-sync`,`dev:catalog-sync`);let{CatalogSyncCommand:t}=await Promise.resolve().then(()=>require("./catalog-sync-DHopgolZ.js"));await new t().execute({remote:e.remote})})},yn=/^(\d{1,3}\.){3}\d{1,3}$/,bn=e=>{try{let{hostname:t}=new URL(e);if(yn.test(t))return t.replace(/\./g,`-`);let n=t.split(`.`);return n.length>2?n.slice(0,-2).join(`-`):n.length===2?n[0]:n.join(`-`)}catch{return`remote`}},xn=async(e,n)=>n?((await t.t({apiKey:n,apiUrl:e})).success||(console.error(u.default.red(`✗ Authentication failed.`)),process.exit(1)),`API key`):Sn(e),Sn=async e=>{console.log(u.default.gray(`Opening browser for authentication...`));let n=await t.H({apiUrl:e});return n.success?`OAuth`:(console.log(u.default.yellow(n.error.message)),(await t.t({apiKey:(await d.default.prompt([{type:`password`,name:`apiKey`,message:`API Key:`,mask:`*`,validate:e=>e.length>0||`API key is required`}])).apiKey,apiUrl:e})).success||(console.error(u.default.red(`✗ Authentication failed.`)),process.exit(1)),`API key`)},Cn=async e=>{e.apiUrl&&console.warn(u.default.yellow(`⚠ --api-url is deprecated. Use --url instead.`));let n=e.test?t.W(!0):void 0,r=new t.U(n?{configPath:n}:void 0),i=await r.getRemotes();if(e.as!==void 0&&i.includes(e.as)){let n=await r.getConfigForRemote(e.as);t.U.setActiveRemote(e.as);let i=await xn(n.apiUrl,e.apiKey);console.log(u.default.green(`✓ Re-authenticated "${e.as}" via ${i}.`)),await r.setDefaultRemote(e.as),console.log(u.default.green(`✓ Default remote set to "${e.as}".`));return}let a=e.url??e.apiUrl;if(a)a=t.gt(a);else{let n=await t.h();e.local?(n||(console.error(u.default.red(`No local Twenty server found.
|
|
31392
31392
|
Start one with: yarn twenty docker:start`)),process.exit(1)),console.log(u.default.gray(`Found local server at ${n}`)),a=n):a=t.gt((await d.default.prompt([{type:`input`,name:`serverUrl`,message:`Twenty server URL:`,validate:e=>{try{return new URL(e),!0}catch{return`Please enter a valid URL`}}}])).serverUrl)}let o=e.as??bn(a);t.U.setActiveRemote(o);let s=await xn(a,e.apiKey);console.log(u.default.green(`✓ Remote "${o}" added (${a}) via ${s}.`)),await r.setDefaultRemote(o),console.log(u.default.green(`✓ Default remote set to "${o}".`))},wn=async()=>{let e=new t.U,n=await e.getRemotes(),r=await e.getDefaultRemote();if(n.length===0){console.log(`No remotes configured.`),console.log(`Use 'twenty remote:add' to add one.`);return}console.log(``);for(let t of n){let n=await e.getConfigForRemote(t),i=n.twentyCLIAccessToken?`oauth`:n.apiKey?`api-key`:`none`,a=t===r,o=a?`* `:` `,s=a?u.default.bold(t):t;console.log(`${o}${s} ${u.default.gray(n.apiUrl)} [${i}]`)}console.log(`
|
|
31393
31393
|
`,u.default.gray(`Use 'twenty remote:use <name>' to change default`))},Tn=async e=>{let n=new t.U,r=e??(await d.default.prompt([{type:`select`,name:`remote`,message:`Select default remote:`,choices:await n.getRemotes()}])).remote;(await n.getRemotes()).includes(r)||(console.error(u.default.red(`Remote "${r}" not found.`)),process.exit(1)),await n.setDefaultRemote(r),console.log(u.default.green(`✓ Default remote set to "${r}".`))},En=async()=>{let e=new t.U,n=new t.z,r=t.U.getActiveRemote(),i=await e.getConfig(),a=i.twentyCLIAccessToken?`oauth`:i.apiKey?`api-key`:`none`;if(console.log(` Remote: ${u.default.bold(r)}`),console.log(` Server: ${i.apiUrl}`),a===`none`){console.log(` Auth: ${u.default.yellow(`not configured`)}`);return}let{authValid:o}=await n.validateAuth(),s=o?u.default.green(`${a} (valid)`):u.default.red(`${a} (invalid)`);console.log(` Auth: ${s}`)},Dn=async e=>{let n=new t.U;(await n.getRemotes()).includes(e)||(console.error(u.default.red(`Remote "${e}" not found.`)),process.exit(1)),t.U.setActiveRemote(e),await n.clearConfig(),console.log(u.default.green(`✓ Remote "${e}" removed.`))},On=e=>{e.command(`remote:add`).description(`Add or re-authenticate a remote`).option(`--as <name>`,`Name for this remote`).option(`--api-key <apiKey>`,`API key for non-interactive auth`).option(`--url <url>`,`Server URL`).option(`--api-url <apiUrl>`,`[deprecated: use --url]`).option(`--local`,`Connect to a local Twenty server (auto-detect)`).option(`--test`,`Write to config.test.json (for integration tests)`).action(Cn),e.command(`remote:list`).description(`List all configured remotes`).action(wn),e.command(`remote:use [name]`).description(`Set the default remote`).action(Tn),e.command(`remote:status`).description(`Show active remote auth status`).action(En),e.command(`remote:remove <name>`).description(`Remove a remote`).action(Dn);let t=e.command(`remote`,{hidden:!0}).description(`Manage remote Twenty servers`),n=(e,t)=>console.warn(u.default.yellow(`⚠ \`twenty remote ${e}\` is deprecated. Use \`twenty ${t}\` instead.`));t.command(`add`).option(`--as <name>`,`Name for this remote`).option(`--api-key <apiKey>`,`API key for non-interactive auth`).option(`--url <url>`,`Server URL`).option(`--api-url <apiUrl>`,`[deprecated: use --url]`).option(`--local`,`Connect to a local Twenty server (auto-detect)`).option(`--test`,`Write to config.test.json (for integration tests)`).action(async e=>{n(`add`,`remote:add`),await Cn(e)}),t.command(`list`).action(async()=>{n(`list`,`remote:list`),await wn()}),t.command(`switch [name]`).action(async e=>{n(`switch`,`remote:use`),await Tn(e)}),t.command(`status`).action(async()=>{n(`status`,`remote:status`),await En()}),t.command(`remove <name>`).action(async e=>{n(`remove`,`remote:remove`),await Dn(e)})},H=e=>{fn(e),T(e),vn(e),On(e),Te(e)};h.inspect.defaultOptions.depth=10;var kn=new m.Command;kn.name(`twenty`).description(`CLI for Twenty application development`).version(t.I.version),kn.option(`-r, --remote <name>`,`Use a specific remote (overrides the default set by remote:use)`),kn.hook(`preAction`,async e=>{let n=(e.optsWithGlobals?e.optsWithGlobals():e.opts()).remote;n?console.log(u.default.gray(`Using remote: ${n}`)):n=await new t.U().getDefaultRemote(),t.U.setActiveRemote(n)}),H(kn),kn.exitOverride();try{kn.parse()}catch(e){e instanceof m.CommanderError&&process.exit(e.exitCode),e instanceof Error&&(console.error(u.default.red(`Error:`),e.message),process.exit(1))}
|