twenty-sdk 0.4.1 → 0.4.2
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/AllIcons-CGPKtPQS-DNCqqVPl.js +18986 -0
- package/dist/AllIcons-CGPKtPQS-pnhRwY6h.mjs +30768 -0
- package/dist/README.md +282 -0
- package/dist/{cli.cjs → cli/index.cjs} +33 -33
- package/dist/{cli.mjs → cli/index.mjs} +14 -17
- package/dist/front-component/index.cjs +1 -0
- package/dist/front-component/index.mjs +2668 -0
- package/dist/front-component-constants/index.cjs +1 -0
- package/dist/{front-component-constants.mjs → front-component-constants/index.mjs} +1 -1
- package/dist/input-CCBkYU6b.mjs +28020 -0
- package/dist/input-QArI9uHN.js +402 -0
- package/dist/isValidCountryCode-B7MxBtRC-BNPnBggZ.js +25 -0
- package/dist/{jsx-runtime-C9ldtZbm.mjs → isValidCountryCode-B7MxBtRC-BsdyqBLg.mjs} +4054 -4685
- package/dist/jsx-runtime-BdMIAavf.mjs +639 -0
- package/dist/jsx-runtime-Bglt9wWZ.js +30 -0
- package/dist/package.json +87 -0
- package/dist/ui/index.cjs +2015 -0
- package/dist/ui/index.d.ts +11 -0
- package/dist/ui/index.mjs +9941 -0
- package/dist/vendor/twenty-shared/{isValidCountryCode-Dyji5s5r.mjs → isValidCountryCode-B7MxBtRC.mjs} +963 -939
- package/dist/vendor/twenty-shared/{isValidCountryCode-D-UqlXRW.js → isValidCountryCode-BXhYkDye.js} +3 -3
- package/dist/vendor/twenty-shared/types/FilterableFieldType.d.ts +1 -1
- package/dist/vendor/twenty-shared/types/FilterableFieldType.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/types/RecordGqlOperationFilter.d.ts +5 -1
- package/dist/vendor/twenty-shared/types/RecordGqlOperationFilter.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/types/index.d.ts +1 -1
- package/dist/vendor/twenty-shared/types/index.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/types.cjs +1 -1
- package/dist/vendor/twenty-shared/types.mjs +3 -2
- package/dist/vendor/twenty-shared/utils/filter/index.d.ts +1 -0
- package/dist/vendor/twenty-shared/utils/filter/index.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/filter/turnRecordFilterIntoGqlOperationFilter.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/filter/utils/getEmptyRecordGqlOperationFilter.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/filter/utils/getFilterTypeFromFieldType.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingFilesFilter.d.ts +7 -0
- package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingFilesFilter.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/index.d.ts +1 -0
- package/dist/vendor/twenty-shared/utils/index.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils.cjs +2 -2
- package/dist/vendor/twenty-shared/utils.mjs +171 -151
- package/dist/vendor/twenty-shared/workflow.cjs +1 -1
- package/dist/vendor/twenty-shared/workflow.mjs +1 -1
- package/dist/vendor/twenty-ui/{Avatar-zyamQwOj.cjs → Avatar-CRldFv_0.cjs} +1 -1
- package/dist/vendor/twenty-ui/{Avatar-Cg4dvBA_.js → Avatar-q9sRncB5.js} +2 -2
- package/dist/vendor/twenty-ui/{Button-BChGSHVB.js → Button-C4mFr9D-.js} +2 -2
- package/dist/vendor/twenty-ui/{Button-PLd38fEI.cjs → Button-DglXLX4t.cjs} +2 -2
- package/dist/vendor/twenty-ui/{ColorSample-BEUix7Ah.cjs → ColorSample-D9DM-_ee.cjs} +1 -1
- package/dist/vendor/twenty-ui/{ColorSample-Bp-he5lO.js → ColorSample-IEHpxKsX.js} +1 -1
- package/dist/vendor/twenty-ui/MainColorNames-C1tU0n7M.cjs +1 -0
- package/dist/vendor/twenty-ui/MainColorNames-CH_C4JeD.js +5 -0
- package/dist/vendor/twenty-ui/{MainColorsLight-x_vjLhiq.js → MainColorsLight--0X05KcO.js} +1 -1
- package/dist/vendor/twenty-ui/{MainColorsLight-GOpmobTe.cjs → MainColorsLight-CpgC1-1i.cjs} +1 -1
- package/dist/vendor/twenty-ui/{OverflowingTextWithTooltip-1P96Lw-o.cjs → OverflowingTextWithTooltip-C4x0j2AD.cjs} +1 -1
- package/dist/vendor/twenty-ui/{OverflowingTextWithTooltip-F-KEqUMB.js → OverflowingTextWithTooltip-FRJL71ks.js} +2 -2
- package/dist/vendor/twenty-ui/{Tag-CfX8tARK.js → Tag-C0nqcoLd.js} +3 -3
- package/dist/vendor/twenty-ui/{Tag-DIE1bmT7.cjs → Tag-C6YGTe8G.cjs} +1 -1
- package/dist/vendor/twenty-ui/{ThemeCommon-BiQXECTo.cjs → ThemeCommon-DMvprlEs.cjs} +1 -1
- package/dist/vendor/twenty-ui/{ThemeCommon-CUpBXrDJ.js → ThemeCommon-RVLgB4Pa.js} +1 -1
- package/dist/vendor/twenty-ui/components.cjs +1 -1
- package/dist/vendor/twenty-ui/components.mjs +5 -5
- package/dist/vendor/twenty-ui/{config-D3RPmuwk.cjs → config-2EfZqKOo.cjs} +1 -1
- package/dist/vendor/twenty-ui/{config-D9UgCg2c.js → config-wKIVPAkA.js} +1 -1
- package/dist/vendor/twenty-ui/display.cjs +1 -1
- package/dist/vendor/twenty-ui/display.mjs +9 -9
- package/dist/vendor/twenty-ui/feedback.cjs +1 -1
- package/dist/vendor/twenty-ui/feedback.mjs +1 -1
- package/dist/vendor/twenty-ui/{getDisplayValueByUrlType-BMzTxZmB.cjs → getDisplayValueByUrlType-DwG-FZ1p.cjs} +1 -1
- package/dist/vendor/twenty-ui/{getDisplayValueByUrlType-BqPVhhu2.js → getDisplayValueByUrlType-DxqXD84p.js} +1 -1
- package/dist/vendor/twenty-ui/input.cjs +4 -4
- package/dist/vendor/twenty-ui/input.mjs +6 -6
- package/dist/vendor/twenty-ui/{isValidCountryCode-Dyji5s5r-MH68p3NE.cjs → isValidCountryCode-B7MxBtRC-BroSlnrA.cjs} +6 -6
- package/dist/vendor/twenty-ui/{isValidCountryCode-Dyji5s5r-B7O5eJvP.js → isValidCountryCode-B7MxBtRC-DyiZn2sl.js} +647 -647
- package/dist/vendor/twenty-ui/json-visualizer.cjs +2 -2
- package/dist/vendor/twenty-ui/json-visualizer.mjs +1 -1
- package/dist/vendor/twenty-ui/layout.cjs +2 -2
- package/dist/vendor/twenty-ui/layout.mjs +1 -1
- package/dist/vendor/twenty-ui/navigation.cjs +5 -5
- package/dist/vendor/twenty-ui/navigation.mjs +6 -6
- package/dist/vendor/twenty-ui/testing.cjs +2 -2
- package/dist/vendor/twenty-ui/testing.mjs +2 -2
- package/dist/vendor/twenty-ui/theme.cjs +1 -1
- package/dist/vendor/twenty-ui/theme.mjs +6 -6
- package/dist/vendor/twenty-ui/{themeColorSchema-CgAr-Bzv.js → themeColorSchema-DVfjPoxx.js} +1 -1
- package/dist/vendor/twenty-ui/{themeColorSchema-DSPsU2O5.cjs → themeColorSchema-DfeeV1pm.cjs} +1 -1
- package/dist/vendor/twenty-ui/{useMouseDownNavigation-C_8Q5KFZ.cjs → useMouseDownNavigation-Dr9ganU0.cjs} +1 -1
- package/dist/vendor/twenty-ui/{useMouseDownNavigation-qpLZC7wJ.js → useMouseDownNavigation-QLT907PP.js} +1 -1
- package/dist/vendor/twenty-ui/utilities.cjs +1 -1
- package/dist/vendor/twenty-ui/utilities.mjs +3 -3
- package/package.json +20 -9
- package/dist/front-component-constants.cjs +0 -1
- package/dist/front-component.cjs +0 -155
- package/dist/front-component.mjs +0 -23453
- package/dist/jsx-runtime-CfccAQK_.js +0 -54
- package/dist/vendor/twenty-ui/MainColorNames-DNUaoKmR.cjs +0 -1
- package/dist/vendor/twenty-ui/MainColorNames-O_b9E7H3.js +0 -5
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var fy=Object.create;var hc=Object.defineProperty;var py=Object.getOwnPropertyDescriptor;var dy=Object.getOwnPropertyNames;var hy=Object.getPrototypeOf,gy=Object.prototype.hasOwnProperty;var my=(n,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of dy(r))!gy.call(n,u)&&u!==i&&hc(n,u,{get:()=>r[u],enumerable:!(o=py(r,u))||o.enumerable});return n};var gc=(n,r,i)=>(i=n!=null?fy(hy(n)):{},my(r||!n||!n.__esModule?hc(i,"default",{value:n,enumerable:!0}):i,n));const ge=require("path"),yy=require("chalk"),Fc=require("fs-extra"),vy=require("crypto"),_y=require("node:fs/promises"),
|
|
3
|
-
${
|
|
2
|
+
"use strict";var fy=Object.create;var hc=Object.defineProperty;var py=Object.getOwnPropertyDescriptor;var dy=Object.getOwnPropertyNames;var hy=Object.getPrototypeOf,gy=Object.prototype.hasOwnProperty;var my=(n,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of dy(r))!gy.call(n,u)&&u!==i&&hc(n,u,{get:()=>r[u],enumerable:!(o=py(r,u))||o.enumerable});return n};var gc=(n,r,i)=>(i=n!=null?fy(hy(n)):{},my(r||!n||!n.__esModule?hc(i,"default",{value:n,enumerable:!0}):i,n));const ge=require("path"),yy=require("chalk"),Fc=require("fs-extra"),vy=require("crypto"),_y=require("node:fs/promises"),kt=require("../isValidCountryCode-B7MxBtRC-BNPnBggZ.js"),xy=require("@sniptt/guards"),Ty=require("lodash.camelcase"),mc=require("../RatingValues-CT-y6O0b-D7JSZAMu.js"),Dc=require("../HtmlTagToRemoteComponent-Bd5sgek2.js"),wy=require("fs/promises"),Ey=require("esbuild"),mn=require("../types-DqLnNRPE.js"),Sy=require("chokidar"),Ay=require("os"),Iy=require("axios"),by=require("fs"),Ny=require("graphql-sse"),Oy=require("typescript"),Ry=require("module"),Pc=require("fast-glob"),B=require("../jsx-runtime-Bglt9wWZ.js"),Cy=require("@genql/cli"),Ly=require("inquirer"),pi=require("uuid"),kc=require("commander"),Fy=require("util"),di=n=>n&&n.__esModule?n:{default:n};function wn(n){if(n&&n.__esModule)return n;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const i in n)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}return r.default=n,Object.freeze(r)}const we=wn(ge),R=di(yy),de=wn(Fc),Uc=di(vy),Dy=wn(_y),Py=di(Ty),ky=wn(wy),Mc=wn(Ey),$c=di(Sy),Bc=wn(Ay),Mr=di(Iy),yc=wn(by),ui=wn(Oy),Qt=di(Ly),Yt=process.env.INIT_CWD||process.cwd(),Pi=n=>n&&!n?.startsWith("/")?ge.join(Yt,n):n,Uy=async(n,r,i)=>{const o=new Set(i),u=r.filter(f=>!o.has(f));for(const f of u){const g=f.replace(/\.tsx?$/,".mjs"),v=we.default.join(n,g),w=`${v}.map`;await de.remove(v),await de.remove(w)}},My=async({result:n,appPath:r,fileFolder:i,lastChecksums:o,onFileBuilt:u})=>{const f=Object.keys(n.metafile?.outputs??{}).filter(g=>g.endsWith(".mjs"));for(const g of f){const v=we.default.resolve(g),w=we.default.relative(r,v),b=n.metafile?.outputs?.[g]?.entryPoint||"",O=we.default.relative(r,b),D=await de.readFile(v),P=Uc.default.createHash("md5").update(D).digest("hex");o.get(w)!==P&&(o.set(w,P),u&&await u({fileFolder:i,builtPath:w,sourcePath:O,checksum:P}))}},$y=n=>xy.isNonEmptyString(n)?n[0].toUpperCase()+n.slice(1):"",By=n=>$y(Py.default(n)),jy=n=>typeof n=="object"&&n!==null&&!Array.isArray(n),Wy="RemoteComponents",Gy=()=>{const n=Object.keys(Dc.HTML_TAG_TO_REMOTE_COMPONENT).join("|");return new RegExp(`(<\\/?)\\b(${n})\\b(?=[\\s>\\/>])`,"g")},Vy=Gy(),qy=n=>n.replace(Vy,(r,i,o)=>{const u=Dc.HTML_TAG_TO_REMOTE_COMPONENT[o];return kt.Tr(u)?`${i}${Wy}.${u}`:r}),Jy=/import\s*\{\s*defineFrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g,vc=/export\s+default\s+defineFrontComponent\s*\(\s*\{[^}]*component\s*:\s*(\w+)[^}]*\}\s*\)\s*;?/s,zy=n=>{let r=n.replace(Jy,"");const i=r.match(vc);if(i){const o=i[1],u=new RegExp(`export\\s+(const|function)\\s+${o}\\b`);r=r.replace(u,`$1 ${o}`),r=r.replace(vc,`export default globalThis.jsx(${o}, {});`)}return r},Qy={name:"jsx-transform-to-remote-dom-worker-format-plugin",setup:n=>{n.onLoad({filter:/\.tsx$/},async({path:r})=>{try{const i=await Dy.readFile(r,"utf8"),o=qy(i);return{contents:`var RemoteComponents = globalThis.RemoteComponents;
|
|
3
|
+
${zy(o)}`,loader:"tsx"}}catch(i){return{errors:[{text:`Failed to transform front component: ${i instanceof Error?i.message:String(i)}`,location:{file:r}}]}}})}},Hy=/^(\w+)\s+as\s+(\w+)$/,Yy=n=>{const r=n.trim(),i=r.match(Hy);if(kt.Tr(i)){const[,o,u]=i;return{originalName:o,aliasName:u}}return{originalName:r,aliasName:r}},_c=/import\s+(?:(\w+)\s*,?\s*)?(?:\{([^}]*)\})?\s*from\s*['"]react['"];?/g,Xy=/^react(\/jsx-runtime)?$/,Ky=`
|
|
4
4
|
export var jsx = globalThis.jsx;
|
|
5
5
|
export var jsxs = globalThis.jsxs;
|
|
6
6
|
export var Fragment = globalThis.React.Fragment;
|
|
7
|
-
`.trim(),
|
|
8
|
-
`)},
|
|
7
|
+
`.trim(),Zy=n=>{const r=new Set;let i;for(;kt.Tr(i=_c.exec(n));){const o=i[1],u=i[2];o&&r.add("default"),u&&u.split(",").filter(f=>f.trim()).forEach(f=>{const{originalName:g}=Yy(f);r.add(g)})}return _c.lastIndex=0,r},ev=n=>{const r=[];for(const i of n)i==="default"?r.push("export default globalThis.React;"):r.push(`export var ${i} = globalThis.React.${i};`);return r.join(`
|
|
8
|
+
`)},tv={name:"react-globals",setup:async n=>{const r=new Map;n.onStart(()=>{r.clear()}),n.onResolve({filter:Xy},async({importer:i,path:o})=>{if(i&&!r.has(i))try{const u=await ky.readFile(i,"utf-8");r.set(i,Zy(u))}catch{r.set(i,new Set)}return{path:o,namespace:"react-globals",pluginData:{importer:i}}}),n.onLoad({filter:/.*/,namespace:"react-globals"},({pluginData:i,path:o})=>{const u=i?.importer||"",f=r.get(u)||new Set;return o==="react/jsx-runtime"?{contents:Ky,loader:"js"}:o==="react"?{contents:ev(f),loader:"js"}:null})}},La="public",nv="TWENTY_API_KEY",iv="TWENTY_API_URL",vn=".twenty/output";var De=(n=>(n.Object="object",n.Field="field",n.LogicFunction="logicFunction",n.FrontComponent="frontComponent",n.Role="role",n))(De||{});const rv=["path","fs","crypto","stream","util","os","url","http","https","events","buffer","querystring","assert","zlib","net","tls","child_process","worker_threads","twenty-sdk","twenty-sdk/*","twenty-shared","twenty-shared/*"],sv=["react-dom","twenty-sdk","twenty-sdk/*","twenty-shared","twenty-shared/*"];class jc{constructor(r){this.esBuildContext=null,this.isRestarting=!1,this.lastChecksums=new Map,this.buildCompletePromise=Promise.resolve(),this.resolveBuildComplete=null,this.appPath=r.appPath,this.sourcePaths=r.sourcePaths,this.watchMode=r.watch??!0,this.onFileBuilt=r.handleFileBuilt,this.onBuildError=r.handleBuildError,this.config=r.config}shouldRestart(r){const i=this.sourcePaths.sort().join(","),o=[...r].sort().join(",");return i!==o}async start(){this.sourcePaths.length>0&&await this.createContext()}async close(){await this.esBuildContext?.dispose(),this.esBuildContext=null}async restart(r){if(!this.isRestarting){this.isRestarting=!0;try{await this.close();const i=we.default.join(this.appPath,vn);await Uy(i,this.sourcePaths,r),this.sourcePaths=r,this.lastChecksums.clear(),this.sourcePaths.length>0&&await this.createContext()}finally{this.isRestarting=!1}}}async createContext(){const r=we.default.join(this.appPath,vn),i={};for(const f of this.sourcePaths){const g=f.replace(/\.tsx?$/,"");i[g]=we.default.join(this.appPath,f)}const o=this,u=[...this.config.extraPlugins??[],{name:"build-notifications",setup:f=>{f.onEnd(async g=>{try{if(g.errors.length>0){g.errors[0].text.includes("Could not resolve")||await this.onBuildError?.(g.errors.map(v=>({error:v.text,location:v.location})));return}await My({result:g,appPath:this.appPath,fileFolder:this.config.fileFolder,lastChecksums:o.lastChecksums,onFileBuilt:o.onFileBuilt})}finally{o.resolveBuildComplete?.()}})}}];this.esBuildContext=await Mc.context({entryPoints:i,bundle:!0,splitting:!1,format:"esm",platform:this.config.platform,outdir:r,outExtension:{".js":".mjs"},external:this.config.externalModules,tsconfig:we.default.join(this.appPath,"tsconfig.json"),jsx:this.config.jsx,sourcemap:!0,metafile:!0,logLevel:"silent",minify:this.config.minify,plugins:u}),this.buildCompletePromise=new Promise(f=>{this.resolveBuildComplete=f}),await this.esBuildContext.rebuild(),await this.buildCompletePromise,this.watchMode&&await this.esBuildContext.watch()}}const av={name:"external-patterns",setup:n=>{n.onResolve({filter:/(?:^|\/)generated(?:\/|$)/},r=>({path:r.path,external:!0}))}},ov=n=>new jc({...n,config:{externalModules:rv,fileFolder:mn.i.BuiltLogicFunction,platform:"node",extraPlugins:[av]}}),uv=n=>new jc({...n,config:{externalModules:sv,fileFolder:mn.i.BuiltFrontComponent,jsx:"automatic",extraPlugins:[tv,Qy]}});class cv{constructor(r){this.watcher=null,this.appPath=r.appPath,this.handleChangeDetected=r.handleChangeDetected}async start(){this.watcher=$c.default.watch(this.appPath,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",async(r,i)=>{if(r==="addDir")return;const o=ge.relative(this.appPath,i),u=o.startsWith("node_modules")||o.startsWith("generated")||o.startsWith("dist"),f=o.startsWith(La),g=["package.json","yarn.lock"].includes(o),v=o.endsWith(".ts")||o.endsWith(".tsx"),w=o.startsWith(".");(u||!v||w)&&!f&&!g||this.handleChangeDetected(o,r)})}async close(){await this.watcher?.close()}}const lv=({manifest:n,builtFileInfos:r})=>{let i=structuredClone(n);for(const[o,{fileFolder:u,checksum:f}]of r.entries()){const g=ge.relative(vn,o);if(u===mn.i.BuiltLogicFunction){const v=i.logicFunctions,w=v.findIndex(b=>b.builtHandlerPath===g);if(w===-1)continue;i={...i,logicFunctions:v.map((b,O)=>O===w?{...b,builtHandlerChecksum:f}:b)}}if(u===mn.i.PublicAsset){const v=i.publicAssets,w=v.findIndex(b=>b.filePath===g);if(w===-1)continue;i={...i,publicAssets:v.map((b,O)=>O===w?{...b,checksum:f}:b)};continue}if(u===mn.i.BuiltFrontComponent){const v=i.frontComponents,w=v.findIndex(b=>b.builtComponentPath===g)??-1;if(w===-1)continue;i={...i,frontComponents:v.map((b,O)=>O===w?{...b,builtComponentChecksum:f}:b)}}u===mn.i.Source&&(g==="package.json"&&(i.application.packageJsonChecksum=f),g==="yarn.lock"&&(i.application.yarnLockChecksum=f))}return i},fv=async(n,r)=>{const i=we.default.join(n,vn);await de.ensureDir(i);const o=we.default.join(i,"manifest.json");return await de.writeJSON(o,r,{spaces:2}),o},zt="default",Vr=class Vr{constructor(){this.configPath=we.join(Bc.homedir(),".twenty","config.json")}static setActiveWorkspace(r){this.activeWorkspace=r??zt}static getActiveWorkspace(){return this.activeWorkspace}getActiveWorkspaceName(){return Vr.getActiveWorkspace()}async readRawConfig(){await de.ensureFile(this.configPath);const r=await de.readFile(this.configPath,"utf8");return JSON.parse(r||"{}")}async getConfig(){return this.getConfigForWorkspace(this.getActiveWorkspaceName())}async getConfigForWorkspace(r){const i=this.getDefaultConfig();try{const o=await this.readRawConfig(),u=r===zt&&!o.profiles?.[zt]?o:o.profiles?.[r],f=u?.apiUrl??i.apiUrl,g=u?.apiKey;return{apiUrl:f,apiKey:g}}catch{return i}}async setConfig(r){const i=await this.readRawConfig(),o=this.getActiveWorkspaceName();i.profiles||(i.profiles={});const u=i.profiles[o]||{apiUrl:""};i.profiles[o]={...u,...r},await de.ensureDir(we.dirname(this.configPath)),await de.writeFile(this.configPath,JSON.stringify(i,null,2))}async clearConfig(){const r=await this.readRawConfig(),i=this.getActiveWorkspaceName();if(r.profiles||(r.profiles={}),r.profiles[i]&&delete r.profiles[i],i===zt){const o=this.getDefaultConfig();delete r.apiKey,r.apiUrl=o.apiUrl}await de.ensureDir(we.dirname(this.configPath)),await de.writeFile(this.configPath,JSON.stringify(r,null,2))}getDefaultConfig(){return{apiUrl:"http://localhost:3000"}}async getAvailableWorkspaces(){try{const r=await this.readRawConfig(),i=new Set;return i.add(zt),r.profiles&&Object.keys(r.profiles).forEach(o=>i.add(o)),Array.from(i).sort()}catch{return[zt]}}async getDefaultWorkspace(){try{return(await this.readRawConfig()).defaultWorkspace??zt}catch{return zt}}async setDefaultWorkspace(r){const i=await this.readRawConfig();i.defaultWorkspace=r,await de.ensureDir(we.dirname(this.configPath)),await de.writeFile(this.configPath,JSON.stringify(i,null,2))}};Vr.activeWorkspace=zt;let je=Vr;function ue(n,r){if(!!!n)throw new Error(r)}function Kt(n){return typeof n=="object"&&n!==null}function ji(n,r){if(!!!n)throw new Error(r??"Unexpected invariant triggered.")}const pv=/\r\n|[\n\r]/g;function ba(n,r){let i=0,o=1;for(const u of n.body.matchAll(pv)){if(typeof u.index=="number"||ji(!1),u.index>=r)break;i=u.index+u[0].length,o+=1}return{line:o,column:r+1-i}}function dv(n){return Wc(n.source,ba(n.source,n.start))}function Wc(n,r){const i=n.locationOffset.column-1,o="".padStart(i)+n.body,u=r.line-1,f=n.locationOffset.line-1,g=r.line+f,v=r.line===1?i:0,w=r.column+v,b=`${n.name}:${g}:${w}
|
|
9
9
|
`,O=o.split(/\r\n|[\n\r]/g),D=O[u];if(D.length>120){const P=Math.floor(w/80),M=w%80,$=[];for(let he=0;he<D.length;he+=80)$.push(D.slice(he,he+80));return b+xc([[`${g} |`,$[0]],...$.slice(1,P+1).map(he=>["|",he]),["|","^".padStart(M)],["|",$[P+1]]])}return b+xc([[`${g-1} |`,O[u-1]],[`${g} |`,D],["|","^".padStart(w)],[`${g+1} |`,O[u+1]]])}function xc(n){const r=n.filter(([o,u])=>u!==void 0),i=Math.max(...r.map(([o])=>o.length));return r.map(([o,u])=>o.padStart(i)+(u?" "+u:"")).join(`
|
|
10
|
-
`)}function
|
|
10
|
+
`)}function hv(n){const r=n[0];return r==null||"kind"in r||"length"in r?{nodes:r,source:n[1],positions:n[2],path:n[3],originalError:n[4],extensions:n[5]}:r}class fe extends Error{constructor(r,...i){var o,u,f;const{nodes:g,source:v,positions:w,path:b,originalError:O,extensions:D}=hv(i);super(r),this.name="GraphQLError",this.path=b??void 0,this.originalError=O??void 0,this.nodes=Tc(Array.isArray(g)?g:g?[g]:void 0);const P=Tc((o=this.nodes)===null||o===void 0?void 0:o.map($=>$.loc).filter($=>$!=null));this.source=v??(P==null||(u=P[0])===null||u===void 0?void 0:u.source),this.positions=w??P?.map($=>$.start),this.locations=w&&v?w.map($=>ba(v,$)):P?.map($=>ba($.source,$.start));const M=Kt(O?.extensions)?O?.extensions:void 0;this.extensions=(f=D??M)!==null&&f!==void 0?f:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),O!=null&&O.stack?Object.defineProperty(this,"stack",{value:O.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,fe):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let r=this.message;if(this.nodes)for(const i of this.nodes)i.loc&&(r+=`
|
|
11
11
|
|
|
12
|
-
`+
|
|
12
|
+
`+dv(i.loc));else if(this.source&&this.locations)for(const i of this.locations)r+=`
|
|
13
13
|
|
|
14
|
-
`+Wc(this.source,i);return r}toJSON(){const r={message:this.message};return this.locations!=null&&(r.locations=this.locations),this.path!=null&&(r.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(r.extensions=this.extensions),r}}function Tc(n){return n===void 0||n.length===0?void 0:n}function ke(n,r,i){return new fe(`Syntax Error: ${i}`,{source:n,positions:[r]})}class
|
|
14
|
+
`+Wc(this.source,i);return r}toJSON(){const r={message:this.message};return this.locations!=null&&(r.locations=this.locations),this.path!=null&&(r.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(r.extensions=this.extensions),r}}function Tc(n){return n===void 0||n.length===0?void 0:n}function ke(n,r,i){return new fe(`Syntax Error: ${i}`,{source:n,positions:[r]})}class gv{constructor(r,i,o){this.start=r.start,this.end=i.end,this.startToken=r,this.endToken=i,this.source=o}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Gc{constructor(r,i,o,u,f,g){this.kind=r,this.start=i,this.end=o,this.line=u,this.column=f,this.value=g,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Vc={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},mv=new Set(Object.keys(Vc));function wc(n){const r=n?.kind;return typeof r=="string"&&mv.has(r)}var Ht;(function(n){n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription"})(Ht||(Ht={}));var se;(function(n){n.QUERY="QUERY",n.MUTATION="MUTATION",n.SUBSCRIPTION="SUBSCRIPTION",n.FIELD="FIELD",n.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",n.FRAGMENT_SPREAD="FRAGMENT_SPREAD",n.INLINE_FRAGMENT="INLINE_FRAGMENT",n.VARIABLE_DEFINITION="VARIABLE_DEFINITION",n.SCHEMA="SCHEMA",n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.FIELD_DEFINITION="FIELD_DEFINITION",n.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.ENUM_VALUE="ENUM_VALUE",n.INPUT_OBJECT="INPUT_OBJECT",n.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(se||(se={}));var N;(function(n){n.NAME="Name",n.DOCUMENT="Document",n.OPERATION_DEFINITION="OperationDefinition",n.VARIABLE_DEFINITION="VariableDefinition",n.SELECTION_SET="SelectionSet",n.FIELD="Field",n.ARGUMENT="Argument",n.FRAGMENT_SPREAD="FragmentSpread",n.INLINE_FRAGMENT="InlineFragment",n.FRAGMENT_DEFINITION="FragmentDefinition",n.VARIABLE="Variable",n.INT="IntValue",n.FLOAT="FloatValue",n.STRING="StringValue",n.BOOLEAN="BooleanValue",n.NULL="NullValue",n.ENUM="EnumValue",n.LIST="ListValue",n.OBJECT="ObjectValue",n.OBJECT_FIELD="ObjectField",n.DIRECTIVE="Directive",n.NAMED_TYPE="NamedType",n.LIST_TYPE="ListType",n.NON_NULL_TYPE="NonNullType",n.SCHEMA_DEFINITION="SchemaDefinition",n.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",n.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",n.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",n.FIELD_DEFINITION="FieldDefinition",n.INPUT_VALUE_DEFINITION="InputValueDefinition",n.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",n.UNION_TYPE_DEFINITION="UnionTypeDefinition",n.ENUM_TYPE_DEFINITION="EnumTypeDefinition",n.ENUM_VALUE_DEFINITION="EnumValueDefinition",n.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",n.DIRECTIVE_DEFINITION="DirectiveDefinition",n.SCHEMA_EXTENSION="SchemaExtension",n.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",n.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",n.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",n.UNION_TYPE_EXTENSION="UnionTypeExtension",n.ENUM_TYPE_EXTENSION="EnumTypeExtension",n.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(N||(N={}));function Na(n){return n===9||n===32}function Bi(n){return n>=48&&n<=57}function qc(n){return n>=97&&n<=122||n>=65&&n<=90}function Fa(n){return qc(n)||n===95}function Jc(n){return qc(n)||Bi(n)||n===95}function yv(n){var r;let i=Number.MAX_SAFE_INTEGER,o=null,u=-1;for(let g=0;g<n.length;++g){var f;const v=n[g],w=vv(v);w!==v.length&&(o=(f=o)!==null&&f!==void 0?f:g,u=g,g!==0&&w<i&&(i=w))}return n.map((g,v)=>v===0?g:g.slice(i)).slice((r=o)!==null&&r!==void 0?r:0,u+1)}function vv(n){let r=0;for(;r<n.length&&Na(n.charCodeAt(r));)++r;return r}function _v(n){if(n==="")return!0;let r=!0,i=!1,o=!0,u=!1;for(let f=0;f<n.length;++f)switch(n.codePointAt(f)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(r&&!u)return!1;u=!0,r=!0,i=!1;break;case 9:case 32:i||(i=r);break;default:o&&(o=i),r=!1}return!(r||o&&u)}function xv(n,r){const i=n.replace(/"""/g,'\\"""'),o=i.split(/\r\n|[\n\r]/g),u=o.length===1,f=o.length>1&&o.slice(1).every(M=>M.length===0||Na(M.charCodeAt(0))),g=i.endsWith('\\"""'),v=n.endsWith('"')&&!g,w=n.endsWith("\\"),b=v||w,O=!u||n.length>70||b||f||g;let D="";const P=u&&Na(n.charCodeAt(0));return(O&&!P||f)&&(D+=`
|
|
15
15
|
`),D+=i,(O||b)&&(D+=`
|
|
16
|
-
`),'"""'+D+'"""'}var A;(function(n){n.SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment"})(A||(A={}));class
|
|
17
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw ke(n.source,r,`Invalid character escape sequence: "${i.slice(r,r+2)}".`)}function
|
|
18
|
-
`));return n.line+=w.length-1,n.lineStart=u,O}if(b===92&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34&&i.charCodeAt(f+3)===34){v+=i.slice(g,f),g=f+1,f+=4;continue}if(b===10||b===13){v+=i.slice(g,f),w.push(v),b===13&&i.charCodeAt(f+1)===10?f+=2:++f,v="",g=f,u=f;continue}if(hi(b))++f;else if(qr(i,f))f+=2;else throw ke(n.source,f,`Invalid character within String: ${Bn(n,f)}.`)}throw ke(n.source,f,"Unterminated string.")}function
|
|
16
|
+
`),'"""'+D+'"""'}var A;(function(n){n.SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment"})(A||(A={}));class Tv{constructor(r){const i=new Gc(A.SOF,0,0,0,0);this.source=r,this.lastToken=i,this.token=i,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let r=this.token;if(r.kind!==A.EOF)do if(r.next)r=r.next;else{const i=Ev(this,r.end);r.next=i,i.prev=r,r=i}while(r.kind===A.COMMENT);return r}}function wv(n){return n===A.BANG||n===A.DOLLAR||n===A.AMP||n===A.PAREN_L||n===A.PAREN_R||n===A.SPREAD||n===A.COLON||n===A.EQUALS||n===A.AT||n===A.BRACKET_L||n===A.BRACKET_R||n===A.BRACE_L||n===A.PIPE||n===A.BRACE_R}function hi(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function qr(n,r){return zc(n.charCodeAt(r))&&Qc(n.charCodeAt(r+1))}function zc(n){return n>=55296&&n<=56319}function Qc(n){return n>=56320&&n<=57343}function Bn(n,r){const i=n.source.body.codePointAt(r);if(i===void 0)return A.EOF;if(i>=32&&i<=126){const o=String.fromCodePoint(i);return o==='"'?`'"'`:`"${o}"`}return"U+"+i.toString(16).toUpperCase().padStart(4,"0")}function Re(n,r,i,o,u){const f=n.line,g=1+i-n.lineStart;return new Gc(r,i,o,f,g,u)}function Ev(n,r){const i=n.source.body,o=i.length;let u=r;for(;u<o;){const f=i.charCodeAt(u);switch(f){case 65279:case 9:case 32:case 44:++u;continue;case 10:++u,++n.line,n.lineStart=u;continue;case 13:i.charCodeAt(u+1)===10?u+=2:++u,++n.line,n.lineStart=u;continue;case 35:return Sv(n,u);case 33:return Re(n,A.BANG,u,u+1);case 36:return Re(n,A.DOLLAR,u,u+1);case 38:return Re(n,A.AMP,u,u+1);case 40:return Re(n,A.PAREN_L,u,u+1);case 41:return Re(n,A.PAREN_R,u,u+1);case 46:if(i.charCodeAt(u+1)===46&&i.charCodeAt(u+2)===46)return Re(n,A.SPREAD,u,u+3);break;case 58:return Re(n,A.COLON,u,u+1);case 61:return Re(n,A.EQUALS,u,u+1);case 64:return Re(n,A.AT,u,u+1);case 91:return Re(n,A.BRACKET_L,u,u+1);case 93:return Re(n,A.BRACKET_R,u,u+1);case 123:return Re(n,A.BRACE_L,u,u+1);case 124:return Re(n,A.PIPE,u,u+1);case 125:return Re(n,A.BRACE_R,u,u+1);case 34:return i.charCodeAt(u+1)===34&&i.charCodeAt(u+2)===34?Rv(n,u):Iv(n,u)}if(Bi(f)||f===45)return Av(n,u,f);if(Fa(f))return Cv(n,u);throw ke(n.source,u,f===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:hi(f)||qr(i,u)?`Unexpected character: ${Bn(n,u)}.`:`Invalid character: ${Bn(n,u)}.`)}return Re(n,A.EOF,o,o)}function Sv(n,r){const i=n.source.body,o=i.length;let u=r+1;for(;u<o;){const f=i.charCodeAt(u);if(f===10||f===13)break;if(hi(f))++u;else if(qr(i,u))u+=2;else break}return Re(n,A.COMMENT,r,u,i.slice(r+1,u))}function Av(n,r,i){const o=n.source.body;let u=r,f=i,g=!1;if(f===45&&(f=o.charCodeAt(++u)),f===48){if(f=o.charCodeAt(++u),Bi(f))throw ke(n.source,u,`Invalid number, unexpected digit after 0: ${Bn(n,u)}.`)}else u=Ta(n,u,f),f=o.charCodeAt(u);if(f===46&&(g=!0,f=o.charCodeAt(++u),u=Ta(n,u,f),f=o.charCodeAt(u)),(f===69||f===101)&&(g=!0,f=o.charCodeAt(++u),(f===43||f===45)&&(f=o.charCodeAt(++u)),u=Ta(n,u,f),f=o.charCodeAt(u)),f===46||Fa(f))throw ke(n.source,u,`Invalid number, expected digit but got: ${Bn(n,u)}.`);return Re(n,g?A.FLOAT:A.INT,r,u,o.slice(r,u))}function Ta(n,r,i){if(!Bi(i))throw ke(n.source,r,`Invalid number, expected digit but got: ${Bn(n,r)}.`);const o=n.source.body;let u=r+1;for(;Bi(o.charCodeAt(u));)++u;return u}function Iv(n,r){const i=n.source.body,o=i.length;let u=r+1,f=u,g="";for(;u<o;){const v=i.charCodeAt(u);if(v===34)return g+=i.slice(f,u),Re(n,A.STRING,r,u+1,g);if(v===92){g+=i.slice(f,u);const w=i.charCodeAt(u+1)===117?i.charCodeAt(u+2)===123?bv(n,u):Nv(n,u):Ov(n,u);g+=w.value,u+=w.size,f=u;continue}if(v===10||v===13)break;if(hi(v))++u;else if(qr(i,u))u+=2;else throw ke(n.source,u,`Invalid character within String: ${Bn(n,u)}.`)}throw ke(n.source,u,"Unterminated string.")}function bv(n,r){const i=n.source.body;let o=0,u=3;for(;u<12;){const f=i.charCodeAt(r+u++);if(f===125){if(u<5||!hi(o))break;return{value:String.fromCodePoint(o),size:u}}if(o=o<<4|Ui(f),o<0)break}throw ke(n.source,r,`Invalid Unicode escape sequence: "${i.slice(r,r+u)}".`)}function Nv(n,r){const i=n.source.body,o=Ec(i,r+2);if(hi(o))return{value:String.fromCodePoint(o),size:6};if(zc(o)&&i.charCodeAt(r+6)===92&&i.charCodeAt(r+7)===117){const u=Ec(i,r+8);if(Qc(u))return{value:String.fromCodePoint(o,u),size:12}}throw ke(n.source,r,`Invalid Unicode escape sequence: "${i.slice(r,r+6)}".`)}function Ec(n,r){return Ui(n.charCodeAt(r))<<12|Ui(n.charCodeAt(r+1))<<8|Ui(n.charCodeAt(r+2))<<4|Ui(n.charCodeAt(r+3))}function Ui(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function Ov(n,r){const i=n.source.body;switch(i.charCodeAt(r+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
17
|
+
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw ke(n.source,r,`Invalid character escape sequence: "${i.slice(r,r+2)}".`)}function Rv(n,r){const i=n.source.body,o=i.length;let u=n.lineStart,f=r+3,g=f,v="";const w=[];for(;f<o;){const b=i.charCodeAt(f);if(b===34&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34){v+=i.slice(g,f),w.push(v);const O=Re(n,A.BLOCK_STRING,r,f+3,yv(w).join(`
|
|
18
|
+
`));return n.line+=w.length-1,n.lineStart=u,O}if(b===92&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34&&i.charCodeAt(f+3)===34){v+=i.slice(g,f),g=f+1,f+=4;continue}if(b===10||b===13){v+=i.slice(g,f),w.push(v),b===13&&i.charCodeAt(f+1)===10?f+=2:++f,v="",g=f,u=f;continue}if(hi(b))++f;else if(qr(i,f))f+=2;else throw ke(n.source,f,`Invalid character within String: ${Bn(n,f)}.`)}throw ke(n.source,f,"Unterminated string.")}function Cv(n,r){const i=n.source.body,o=i.length;let u=r+1;for(;u<o;){const f=i.charCodeAt(u);if(Jc(f))++u;else break}return Re(n,A.NAME,r,u,i.slice(r,u))}const Lv=10,Hc=2;function J(n){return Jr(n,[])}function Jr(n,r){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return Fv(n,r);default:return String(n)}}function Fv(n,r){if(n===null)return"null";if(r.includes(n))return"[Circular]";const i=[...r,n];if(Dv(n)){const o=n.toJSON();if(o!==n)return typeof o=="string"?o:Jr(o,i)}else if(Array.isArray(n))return kv(n,i);return Pv(n,i)}function Dv(n){return typeof n.toJSON=="function"}function Pv(n,r){const i=Object.entries(n);return i.length===0?"{}":r.length>Hc?"["+Uv(n)+"]":"{ "+i.map(([u,f])=>u+": "+Jr(f,r)).join(", ")+" }"}function kv(n,r){if(n.length===0)return"[]";if(r.length>Hc)return"[Array]";const i=Math.min(Lv,n.length),o=n.length-i,u=[];for(let f=0;f<i;++f)u.push(Jr(n[f],r));return o===1?u.push("... 1 more item"):o>1&&u.push(`... ${o} more items`),"["+u.join(", ")+"]"}function Uv(n){const r=Object.prototype.toString.call(n).replace(/^\[object /,"").replace(/]$/,"");if(r==="Object"&&typeof n.constructor=="function"){const i=n.constructor.name;if(typeof i=="string"&&i!=="")return i}return r}const Ut=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(r,i){return r instanceof i}:function(r,i){if(r instanceof i)return!0;if(typeof r=="object"&&r!==null){var o;const u=i.prototype[Symbol.toStringTag],f=Symbol.toStringTag in r?r[Symbol.toStringTag]:(o=r.constructor)===null||o===void 0?void 0:o.name;if(u===f){const g=J(r);throw new Error(`Cannot use ${u} "${g}" from another module or realm.
|
|
19
19
|
|
|
20
20
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
21
21
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -26,12 +26,12 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
26
26
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
27
27
|
versions may have different capabilities and behavior. The data from one
|
|
28
28
|
version used in the function from another could produce confusing and
|
|
29
|
-
spurious results.`)}}return!1};class Yc{constructor(r,i="GraphQL request",o={line:1,column:1}){typeof r=="string"||ue(!1,`Body must be a string. Received: ${J(r)}.`),this.body=r,this.name=i,this.locationOffset=o,this.locationOffset.line>0||ue(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ue(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function $v(n){return kt(n,Yc)}function Bv(n,r){const i=new jv(n,r);i.expectToken(A.SOF);const o=i.parseValueLiteral(!1);return i.expectToken(A.EOF),o}class jv{constructor(r,i={}){const o=$v(r)?r:new Yc(r);this._lexer=new wv(o),this._options=i,this._tokenCounter=0}parseName(){const r=this.expectToken(A.NAME);return this.node(r,{kind:N.NAME,value:r.value})}parseDocument(){return this.node(this._lexer.token,{kind:N.DOCUMENT,definitions:this.many(A.SOF,this.parseDefinition,A.EOF)})}parseDefinition(){if(this.peek(A.BRACE_L))return this.parseOperationDefinition();const r=this.peekDescription(),i=r?this._lexer.lookahead():this._lexer.token;if(i.kind===A.NAME){switch(i.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(r)throw ke(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(i.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(i)}parseOperationDefinition(){const r=this._lexer.token;if(this.peek(A.BRACE_L))return this.node(r,{kind:N.OPERATION_DEFINITION,operation:Qt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const i=this.parseOperationType();let o;return this.peek(A.NAME)&&(o=this.parseName()),this.node(r,{kind:N.OPERATION_DEFINITION,operation:i,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const r=this.expectToken(A.NAME);switch(r.value){case"query":return Qt.QUERY;case"mutation":return Qt.MUTATION;case"subscription":return Qt.SUBSCRIPTION}throw this.unexpected(r)}parseVariableDefinitions(){return this.optionalMany(A.PAREN_L,this.parseVariableDefinition,A.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:N.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(A.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(A.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const r=this._lexer.token;return this.expectToken(A.DOLLAR),this.node(r,{kind:N.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:N.SELECTION_SET,selections:this.many(A.BRACE_L,this.parseSelection,A.BRACE_R)})}parseSelection(){return this.peek(A.SPREAD)?this.parseFragment():this.parseField()}parseField(){const r=this._lexer.token,i=this.parseName();let o,u;return this.expectOptionalToken(A.COLON)?(o=i,u=this.parseName()):u=i,this.node(r,{kind:N.FIELD,alias:o,name:u,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(A.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(r){const i=r?this.parseConstArgument:this.parseArgument;return this.optionalMany(A.PAREN_L,i,A.PAREN_R)}parseArgument(r=!1){const i=this._lexer.token,o=this.parseName();return this.expectToken(A.COLON),this.node(i,{kind:N.ARGUMENT,name:o,value:this.parseValueLiteral(r)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const r=this._lexer.token;this.expectToken(A.SPREAD);const i=this.expectOptionalKeyword("on");return!i&&this.peek(A.NAME)?this.node(r,{kind:N.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(r,{kind:N.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const r=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(r,{kind:N.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(r,{kind:N.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(r){const i=this._lexer.token;switch(i.kind){case A.BRACKET_L:return this.parseList(r);case A.BRACE_L:return this.parseObject(r);case A.INT:return this.advanceLexer(),this.node(i,{kind:N.INT,value:i.value});case A.FLOAT:return this.advanceLexer(),this.node(i,{kind:N.FLOAT,value:i.value});case A.STRING:case A.BLOCK_STRING:return this.parseStringLiteral();case A.NAME:switch(this.advanceLexer(),i.value){case"true":return this.node(i,{kind:N.BOOLEAN,value:!0});case"false":return this.node(i,{kind:N.BOOLEAN,value:!1});case"null":return this.node(i,{kind:N.NULL});default:return this.node(i,{kind:N.ENUM,value:i.value})}case A.DOLLAR:if(r)if(this.expectToken(A.DOLLAR),this._lexer.token.kind===A.NAME){const o=this._lexer.token.value;throw ke(this._lexer.source,i.start,`Unexpected variable "$${o}" in constant value.`)}else throw this.unexpected(i);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const r=this._lexer.token;return this.advanceLexer(),this.node(r,{kind:N.STRING,value:r.value,block:r.kind===A.BLOCK_STRING})}parseList(r){const i=()=>this.parseValueLiteral(r);return this.node(this._lexer.token,{kind:N.LIST,values:this.any(A.BRACKET_L,i,A.BRACKET_R)})}parseObject(r){const i=()=>this.parseObjectField(r);return this.node(this._lexer.token,{kind:N.OBJECT,fields:this.any(A.BRACE_L,i,A.BRACE_R)})}parseObjectField(r){const i=this._lexer.token,o=this.parseName();return this.expectToken(A.COLON),this.node(i,{kind:N.OBJECT_FIELD,name:o,value:this.parseValueLiteral(r)})}parseDirectives(r){const i=[];for(;this.peek(A.AT);)i.push(this.parseDirective(r));return i}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(r){const i=this._lexer.token;return this.expectToken(A.AT),this.node(i,{kind:N.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(r)})}parseTypeReference(){const r=this._lexer.token;let i;if(this.expectOptionalToken(A.BRACKET_L)){const o=this.parseTypeReference();this.expectToken(A.BRACKET_R),i=this.node(r,{kind:N.LIST_TYPE,type:o})}else i=this.parseNamedType();return this.expectOptionalToken(A.BANG)?this.node(r,{kind:N.NON_NULL_TYPE,type:i}):i}parseNamedType(){return this.node(this._lexer.token,{kind:N.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(A.STRING)||this.peek(A.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");const o=this.parseConstDirectives(),u=this.many(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);return this.node(r,{kind:N.SCHEMA_DEFINITION,description:i,directives:o,operationTypes:u})}parseOperationTypeDefinition(){const r=this._lexer.token,i=this.parseOperationType();this.expectToken(A.COLON);const o=this.parseNamedType();return this.node(r,{kind:N.OPERATION_TYPE_DEFINITION,operation:i,type:o})}parseScalarTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");const o=this.parseName(),u=this.parseConstDirectives();return this.node(r,{kind:N.SCALAR_TYPE_DEFINITION,description:i,name:o,directives:u})}parseObjectTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.OBJECT_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(A.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(A.BRACE_L,this.parseFieldDefinition,A.BRACE_R)}parseFieldDefinition(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseName(),u=this.parseArgumentDefs();this.expectToken(A.COLON);const f=this.parseTypeReference(),g=this.parseConstDirectives();return this.node(r,{kind:N.FIELD_DEFINITION,description:i,name:o,arguments:u,type:f,directives:g})}parseArgumentDefs(){return this.optionalMany(A.PAREN_L,this.parseInputValueDef,A.PAREN_R)}parseInputValueDef(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseName();this.expectToken(A.COLON);const u=this.parseTypeReference();let f;this.expectOptionalToken(A.EQUALS)&&(f=this.parseConstValueLiteral());const g=this.parseConstDirectives();return this.node(r,{kind:N.INPUT_VALUE_DEFINITION,description:i,name:o,type:u,defaultValue:f,directives:g})}parseInterfaceTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.INTERFACE_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}parseUnionTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseUnionMemberTypes();return this.node(r,{kind:N.UNION_TYPE_DEFINITION,description:i,name:o,directives:u,types:f})}parseUnionMemberTypes(){return this.expectOptionalToken(A.EQUALS)?this.delimitedMany(A.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseEnumValuesDefinition();return this.node(r,{kind:N.ENUM_TYPE_DEFINITION,description:i,name:o,directives:u,values:f})}parseEnumValuesDefinition(){return this.optionalMany(A.BRACE_L,this.parseEnumValueDefinition,A.BRACE_R)}parseEnumValueDefinition(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseEnumValueName(),u=this.parseConstDirectives();return this.node(r,{kind:N.ENUM_VALUE_DEFINITION,description:i,name:o,directives:u})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw ke(this._lexer.source,this._lexer.token.start,`${$r(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseInputFieldsDefinition();return this.node(r,{kind:N.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:o,directives:u,fields:f})}parseInputFieldsDefinition(){return this.optionalMany(A.BRACE_L,this.parseInputValueDef,A.BRACE_R)}parseTypeSystemExtension(){const r=this._lexer.lookahead();if(r.kind===A.NAME)switch(r.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(r)}parseSchemaExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const i=this.parseConstDirectives(),o=this.optionalMany(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);if(i.length===0&&o.length===0)throw this.unexpected();return this.node(r,{kind:N.SCHEMA_EXTENSION,directives:i,operationTypes:o})}parseScalarTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const i=this.parseName(),o=this.parseConstDirectives();if(o.length===0)throw this.unexpected();return this.node(r,{kind:N.SCALAR_TYPE_EXTENSION,name:i,directives:o})}parseObjectTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const i=this.parseName(),o=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),f=this.parseFieldsDefinition();if(o.length===0&&u.length===0&&f.length===0)throw this.unexpected();return this.node(r,{kind:N.OBJECT_TYPE_EXTENSION,name:i,interfaces:o,directives:u,fields:f})}parseInterfaceTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const i=this.parseName(),o=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),f=this.parseFieldsDefinition();if(o.length===0&&u.length===0&&f.length===0)throw this.unexpected();return this.node(r,{kind:N.INTERFACE_TYPE_EXTENSION,name:i,interfaces:o,directives:u,fields:f})}parseUnionTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseUnionMemberTypes();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.UNION_TYPE_EXTENSION,name:i,directives:o,types:u})}parseEnumTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseEnumValuesDefinition();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.ENUM_TYPE_EXTENSION,name:i,directives:o,values:u})}parseInputObjectTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseInputFieldsDefinition();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:o,fields:u})}parseDirectiveDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(A.AT);const o=this.parseName(),u=this.parseArgumentDefs(),f=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const g=this.parseDirectiveLocations();return this.node(r,{kind:N.DIRECTIVE_DEFINITION,description:i,name:o,arguments:u,repeatable:f,locations:g})}parseDirectiveLocations(){return this.delimitedMany(A.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const r=this._lexer.token,i=this.parseName();if(Object.prototype.hasOwnProperty.call(se,i.value))return i;throw this.unexpected(r)}node(r,i){return this._options.noLocation!==!0&&(i.loc=new mv(r,this._lexer.lastToken,this._lexer.source)),i}peek(r){return this._lexer.token.kind===r}expectToken(r){const i=this._lexer.token;if(i.kind===r)return this.advanceLexer(),i;throw ke(this._lexer.source,i.start,`Expected ${Xc(r)}, found ${$r(i)}.`)}expectOptionalToken(r){return this._lexer.token.kind===r?(this.advanceLexer(),!0):!1}expectKeyword(r){const i=this._lexer.token;if(i.kind===A.NAME&&i.value===r)this.advanceLexer();else throw ke(this._lexer.source,i.start,`Expected "${r}", found ${$r(i)}.`)}expectOptionalKeyword(r){const i=this._lexer.token;return i.kind===A.NAME&&i.value===r?(this.advanceLexer(),!0):!1}unexpected(r){const i=r??this._lexer.token;return ke(this._lexer.source,i.start,`Unexpected ${$r(i)}.`)}any(r,i,o){this.expectToken(r);const u=[];for(;!this.expectOptionalToken(o);)u.push(i.call(this));return u}optionalMany(r,i,o){if(this.expectOptionalToken(r)){const u=[];do u.push(i.call(this));while(!this.expectOptionalToken(o));return u}return[]}many(r,i,o){this.expectToken(r);const u=[];do u.push(i.call(this));while(!this.expectOptionalToken(o));return u}delimitedMany(r,i){this.expectOptionalToken(r);const o=[];do o.push(i.call(this));while(this.expectOptionalToken(r));return o}advanceLexer(){const{maxTokens:r}=this._options,i=this._lexer.advance();if(r!==void 0&&i.kind!==A.EOF&&(++this._tokenCounter,this._tokenCounter>r))throw ke(this._lexer.source,i.start,`Document contains more that ${r} tokens. Parsing aborted.`)}}function $r(n){const r=n.value;return Xc(n.kind)+(r!=null?` "${r}"`:"")}function Xc(n){return Ev(n)?`"${n}"`:n}const Wv=5;function Gv(n,r){const[i,o]=r?[n,r]:[void 0,n];let u=" Did you mean ";i&&(u+=i+" ");const f=o.map(w=>`"${w}"`);switch(f.length){case 0:return"";case 1:return u+f[0]+"?";case 2:return u+f[0]+" or "+f[1]+"?"}const g=f.slice(0,Wv),v=g.pop();return u+g.join(", ")+", or "+v+"?"}function Sc(n){return n}function Kc(n,r){const i=Object.create(null);for(const o of n)i[r(o)]=o;return i}function $n(n,r,i){const o=Object.create(null);for(const u of n)o[r(u)]=i(u);return o}function zr(n,r){const i=Object.create(null);for(const o of Object.keys(n))i[o]=r(n[o],o);return i}function Vv(n,r){let i=0,o=0;for(;i<n.length&&o<r.length;){let u=n.charCodeAt(i),f=r.charCodeAt(o);if(Br(u)&&Br(f)){let g=0;do++i,g=g*10+u-Oa,u=n.charCodeAt(i);while(Br(u)&&g>0);let v=0;do++o,v=v*10+f-Oa,f=r.charCodeAt(o);while(Br(f)&&v>0);if(g<v)return-1;if(g>v)return 1}else{if(u<f)return-1;if(u>f)return 1;++i,++o}}return n.length-r.length}const Oa=48,qv=57;function Br(n){return!isNaN(n)&&Oa<=n&&n<=qv}function Jv(n,r){const i=Object.create(null),o=new zv(n),u=Math.floor(n.length*.4)+1;for(const f of r){const g=o.measure(f,u);g!==void 0&&(i[f]=g)}return Object.keys(i).sort((f,g)=>{const v=i[f]-i[g];return v!==0?v:Vv(f,g)})}class zv{constructor(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=Ac(this._inputLowerCase),this._rows=[new Array(r.length+1).fill(0),new Array(r.length+1).fill(0),new Array(r.length+1).fill(0)]}measure(r,i){if(this._input===r)return 0;const o=r.toLowerCase();if(this._inputLowerCase===o)return 1;let u=Ac(o),f=this._inputArray;if(u.length<f.length){const O=u;u=f,f=O}const g=u.length,v=f.length;if(g-v>i)return;const w=this._rows;for(let O=0;O<=v;O++)w[0][O]=O;for(let O=1;O<=g;O++){const D=w[(O-1)%3],P=w[O%3];let M=P[0]=O;for(let $=1;$<=v;$++){const he=u[O-1]===f[$-1]?0:1;let ae=Math.min(D[$]+1,P[$-1]+1,D[$-1]+he);if(O>1&&$>1&&u[O-1]===f[$-2]&&u[O-2]===f[$-1]){const me=w[(O-2)%3][$-2];ae=Math.min(ae,me+1)}ae<M&&(M=ae),P[$]=ae}if(M>i)return}const b=w[g%3][v];return b<=i?b:void 0}}function Ac(n){const r=n.length,i=new Array(r);for(let o=0;o<r;++o)i[o]=n.charCodeAt(o);return i}function _t(n){if(n==null)return Object.create(null);if(Object.getPrototypeOf(n)===null)return n;const r=Object.create(null);for(const[i,o]of Object.entries(n))r[i]=o;return r}function Qv(n){return`"${n.replace(Hv,Yv)}"`}const Hv=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Yv(n){return Xv[n.charCodeAt(0)]}const Xv=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Kv=Object.freeze({});function Zv(n,r,i=Vc){const o=new Map;for(const me of Object.values(N))o.set(me,e_(r,me));let u,f=Array.isArray(n),g=[n],v=-1,w=[],b=n,O,D;const P=[],M=[];do{v++;const me=v===g.length,Ye=me&&w.length!==0;if(me){if(O=M.length===0?void 0:P[P.length-1],b=D,D=M.pop(),Ye)if(f){b=b.slice();let L=0;for(const[ee,H]of w){const ce=ee-L;H===null?(b.splice(ce,1),L++):b[ce]=H}}else{b=Object.defineProperties({},Object.getOwnPropertyDescriptors(b));for(const[L,ee]of w)b[L]=ee}v=u.index,g=u.keys,w=u.edits,f=u.inArray,u=u.prev}else if(D){if(O=f?v:g[v],b=D[O],b==null)continue;P.push(O)}let xe;if(!Array.isArray(b)){var $,he;wc(b)||ue(!1,`Invalid AST Node: ${J(b)}.`);const L=me?($=o.get(b.kind))===null||$===void 0?void 0:$.leave:(he=o.get(b.kind))===null||he===void 0?void 0:he.enter;if(xe=L?.call(r,b,O,D,P,M),xe===Kv)break;if(xe===!1){if(!me){P.pop();continue}}else if(xe!==void 0&&(w.push([O,xe]),!me))if(wc(xe))b=xe;else{P.pop();continue}}if(xe===void 0&&Ye&&w.push([O,b]),me)P.pop();else{var ae;u={inArray:f,index:v,keys:g,edits:w,prev:u},f=Array.isArray(b),g=f?b:(ae=i[b.kind])!==null&&ae!==void 0?ae:[],v=-1,w=[],D&&M.push(D),D=b}}while(u!==void 0);return w.length!==0?w[w.length-1][1]:n}function e_(n,r){const i=n[r];return typeof i=="object"?i:typeof i=="function"?{enter:i,leave:void 0}:{enter:n.enter,leave:n.leave}}function yt(n){return Zv(n,n_)}const t_=80,n_={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>k(n.definitions,`
|
|
29
|
+
spurious results.`)}}return!1};class Yc{constructor(r,i="GraphQL request",o={line:1,column:1}){typeof r=="string"||ue(!1,`Body must be a string. Received: ${J(r)}.`),this.body=r,this.name=i,this.locationOffset=o,this.locationOffset.line>0||ue(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ue(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Mv(n){return Ut(n,Yc)}function $v(n,r){const i=new Bv(n,r);i.expectToken(A.SOF);const o=i.parseValueLiteral(!1);return i.expectToken(A.EOF),o}class Bv{constructor(r,i={}){const o=Mv(r)?r:new Yc(r);this._lexer=new Tv(o),this._options=i,this._tokenCounter=0}parseName(){const r=this.expectToken(A.NAME);return this.node(r,{kind:N.NAME,value:r.value})}parseDocument(){return this.node(this._lexer.token,{kind:N.DOCUMENT,definitions:this.many(A.SOF,this.parseDefinition,A.EOF)})}parseDefinition(){if(this.peek(A.BRACE_L))return this.parseOperationDefinition();const r=this.peekDescription(),i=r?this._lexer.lookahead():this._lexer.token;if(i.kind===A.NAME){switch(i.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(r)throw ke(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(i.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(i)}parseOperationDefinition(){const r=this._lexer.token;if(this.peek(A.BRACE_L))return this.node(r,{kind:N.OPERATION_DEFINITION,operation:Ht.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const i=this.parseOperationType();let o;return this.peek(A.NAME)&&(o=this.parseName()),this.node(r,{kind:N.OPERATION_DEFINITION,operation:i,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const r=this.expectToken(A.NAME);switch(r.value){case"query":return Ht.QUERY;case"mutation":return Ht.MUTATION;case"subscription":return Ht.SUBSCRIPTION}throw this.unexpected(r)}parseVariableDefinitions(){return this.optionalMany(A.PAREN_L,this.parseVariableDefinition,A.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:N.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(A.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(A.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const r=this._lexer.token;return this.expectToken(A.DOLLAR),this.node(r,{kind:N.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:N.SELECTION_SET,selections:this.many(A.BRACE_L,this.parseSelection,A.BRACE_R)})}parseSelection(){return this.peek(A.SPREAD)?this.parseFragment():this.parseField()}parseField(){const r=this._lexer.token,i=this.parseName();let o,u;return this.expectOptionalToken(A.COLON)?(o=i,u=this.parseName()):u=i,this.node(r,{kind:N.FIELD,alias:o,name:u,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(A.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(r){const i=r?this.parseConstArgument:this.parseArgument;return this.optionalMany(A.PAREN_L,i,A.PAREN_R)}parseArgument(r=!1){const i=this._lexer.token,o=this.parseName();return this.expectToken(A.COLON),this.node(i,{kind:N.ARGUMENT,name:o,value:this.parseValueLiteral(r)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const r=this._lexer.token;this.expectToken(A.SPREAD);const i=this.expectOptionalKeyword("on");return!i&&this.peek(A.NAME)?this.node(r,{kind:N.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(r,{kind:N.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const r=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(r,{kind:N.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(r,{kind:N.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(r){const i=this._lexer.token;switch(i.kind){case A.BRACKET_L:return this.parseList(r);case A.BRACE_L:return this.parseObject(r);case A.INT:return this.advanceLexer(),this.node(i,{kind:N.INT,value:i.value});case A.FLOAT:return this.advanceLexer(),this.node(i,{kind:N.FLOAT,value:i.value});case A.STRING:case A.BLOCK_STRING:return this.parseStringLiteral();case A.NAME:switch(this.advanceLexer(),i.value){case"true":return this.node(i,{kind:N.BOOLEAN,value:!0});case"false":return this.node(i,{kind:N.BOOLEAN,value:!1});case"null":return this.node(i,{kind:N.NULL});default:return this.node(i,{kind:N.ENUM,value:i.value})}case A.DOLLAR:if(r)if(this.expectToken(A.DOLLAR),this._lexer.token.kind===A.NAME){const o=this._lexer.token.value;throw ke(this._lexer.source,i.start,`Unexpected variable "$${o}" in constant value.`)}else throw this.unexpected(i);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const r=this._lexer.token;return this.advanceLexer(),this.node(r,{kind:N.STRING,value:r.value,block:r.kind===A.BLOCK_STRING})}parseList(r){const i=()=>this.parseValueLiteral(r);return this.node(this._lexer.token,{kind:N.LIST,values:this.any(A.BRACKET_L,i,A.BRACKET_R)})}parseObject(r){const i=()=>this.parseObjectField(r);return this.node(this._lexer.token,{kind:N.OBJECT,fields:this.any(A.BRACE_L,i,A.BRACE_R)})}parseObjectField(r){const i=this._lexer.token,o=this.parseName();return this.expectToken(A.COLON),this.node(i,{kind:N.OBJECT_FIELD,name:o,value:this.parseValueLiteral(r)})}parseDirectives(r){const i=[];for(;this.peek(A.AT);)i.push(this.parseDirective(r));return i}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(r){const i=this._lexer.token;return this.expectToken(A.AT),this.node(i,{kind:N.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(r)})}parseTypeReference(){const r=this._lexer.token;let i;if(this.expectOptionalToken(A.BRACKET_L)){const o=this.parseTypeReference();this.expectToken(A.BRACKET_R),i=this.node(r,{kind:N.LIST_TYPE,type:o})}else i=this.parseNamedType();return this.expectOptionalToken(A.BANG)?this.node(r,{kind:N.NON_NULL_TYPE,type:i}):i}parseNamedType(){return this.node(this._lexer.token,{kind:N.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(A.STRING)||this.peek(A.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");const o=this.parseConstDirectives(),u=this.many(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);return this.node(r,{kind:N.SCHEMA_DEFINITION,description:i,directives:o,operationTypes:u})}parseOperationTypeDefinition(){const r=this._lexer.token,i=this.parseOperationType();this.expectToken(A.COLON);const o=this.parseNamedType();return this.node(r,{kind:N.OPERATION_TYPE_DEFINITION,operation:i,type:o})}parseScalarTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");const o=this.parseName(),u=this.parseConstDirectives();return this.node(r,{kind:N.SCALAR_TYPE_DEFINITION,description:i,name:o,directives:u})}parseObjectTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.OBJECT_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(A.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(A.BRACE_L,this.parseFieldDefinition,A.BRACE_R)}parseFieldDefinition(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseName(),u=this.parseArgumentDefs();this.expectToken(A.COLON);const f=this.parseTypeReference(),g=this.parseConstDirectives();return this.node(r,{kind:N.FIELD_DEFINITION,description:i,name:o,arguments:u,type:f,directives:g})}parseArgumentDefs(){return this.optionalMany(A.PAREN_L,this.parseInputValueDef,A.PAREN_R)}parseInputValueDef(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseName();this.expectToken(A.COLON);const u=this.parseTypeReference();let f;this.expectOptionalToken(A.EQUALS)&&(f=this.parseConstValueLiteral());const g=this.parseConstDirectives();return this.node(r,{kind:N.INPUT_VALUE_DEFINITION,description:i,name:o,type:u,defaultValue:f,directives:g})}parseInterfaceTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.INTERFACE_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}parseUnionTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseUnionMemberTypes();return this.node(r,{kind:N.UNION_TYPE_DEFINITION,description:i,name:o,directives:u,types:f})}parseUnionMemberTypes(){return this.expectOptionalToken(A.EQUALS)?this.delimitedMany(A.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseEnumValuesDefinition();return this.node(r,{kind:N.ENUM_TYPE_DEFINITION,description:i,name:o,directives:u,values:f})}parseEnumValuesDefinition(){return this.optionalMany(A.BRACE_L,this.parseEnumValueDefinition,A.BRACE_R)}parseEnumValueDefinition(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseEnumValueName(),u=this.parseConstDirectives();return this.node(r,{kind:N.ENUM_VALUE_DEFINITION,description:i,name:o,directives:u})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw ke(this._lexer.source,this._lexer.token.start,`${$r(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseInputFieldsDefinition();return this.node(r,{kind:N.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:o,directives:u,fields:f})}parseInputFieldsDefinition(){return this.optionalMany(A.BRACE_L,this.parseInputValueDef,A.BRACE_R)}parseTypeSystemExtension(){const r=this._lexer.lookahead();if(r.kind===A.NAME)switch(r.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(r)}parseSchemaExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const i=this.parseConstDirectives(),o=this.optionalMany(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);if(i.length===0&&o.length===0)throw this.unexpected();return this.node(r,{kind:N.SCHEMA_EXTENSION,directives:i,operationTypes:o})}parseScalarTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const i=this.parseName(),o=this.parseConstDirectives();if(o.length===0)throw this.unexpected();return this.node(r,{kind:N.SCALAR_TYPE_EXTENSION,name:i,directives:o})}parseObjectTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const i=this.parseName(),o=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),f=this.parseFieldsDefinition();if(o.length===0&&u.length===0&&f.length===0)throw this.unexpected();return this.node(r,{kind:N.OBJECT_TYPE_EXTENSION,name:i,interfaces:o,directives:u,fields:f})}parseInterfaceTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const i=this.parseName(),o=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),f=this.parseFieldsDefinition();if(o.length===0&&u.length===0&&f.length===0)throw this.unexpected();return this.node(r,{kind:N.INTERFACE_TYPE_EXTENSION,name:i,interfaces:o,directives:u,fields:f})}parseUnionTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseUnionMemberTypes();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.UNION_TYPE_EXTENSION,name:i,directives:o,types:u})}parseEnumTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseEnumValuesDefinition();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.ENUM_TYPE_EXTENSION,name:i,directives:o,values:u})}parseInputObjectTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseInputFieldsDefinition();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:o,fields:u})}parseDirectiveDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(A.AT);const o=this.parseName(),u=this.parseArgumentDefs(),f=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const g=this.parseDirectiveLocations();return this.node(r,{kind:N.DIRECTIVE_DEFINITION,description:i,name:o,arguments:u,repeatable:f,locations:g})}parseDirectiveLocations(){return this.delimitedMany(A.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const r=this._lexer.token,i=this.parseName();if(Object.prototype.hasOwnProperty.call(se,i.value))return i;throw this.unexpected(r)}node(r,i){return this._options.noLocation!==!0&&(i.loc=new gv(r,this._lexer.lastToken,this._lexer.source)),i}peek(r){return this._lexer.token.kind===r}expectToken(r){const i=this._lexer.token;if(i.kind===r)return this.advanceLexer(),i;throw ke(this._lexer.source,i.start,`Expected ${Xc(r)}, found ${$r(i)}.`)}expectOptionalToken(r){return this._lexer.token.kind===r?(this.advanceLexer(),!0):!1}expectKeyword(r){const i=this._lexer.token;if(i.kind===A.NAME&&i.value===r)this.advanceLexer();else throw ke(this._lexer.source,i.start,`Expected "${r}", found ${$r(i)}.`)}expectOptionalKeyword(r){const i=this._lexer.token;return i.kind===A.NAME&&i.value===r?(this.advanceLexer(),!0):!1}unexpected(r){const i=r??this._lexer.token;return ke(this._lexer.source,i.start,`Unexpected ${$r(i)}.`)}any(r,i,o){this.expectToken(r);const u=[];for(;!this.expectOptionalToken(o);)u.push(i.call(this));return u}optionalMany(r,i,o){if(this.expectOptionalToken(r)){const u=[];do u.push(i.call(this));while(!this.expectOptionalToken(o));return u}return[]}many(r,i,o){this.expectToken(r);const u=[];do u.push(i.call(this));while(!this.expectOptionalToken(o));return u}delimitedMany(r,i){this.expectOptionalToken(r);const o=[];do o.push(i.call(this));while(this.expectOptionalToken(r));return o}advanceLexer(){const{maxTokens:r}=this._options,i=this._lexer.advance();if(r!==void 0&&i.kind!==A.EOF&&(++this._tokenCounter,this._tokenCounter>r))throw ke(this._lexer.source,i.start,`Document contains more that ${r} tokens. Parsing aborted.`)}}function $r(n){const r=n.value;return Xc(n.kind)+(r!=null?` "${r}"`:"")}function Xc(n){return wv(n)?`"${n}"`:n}const jv=5;function Wv(n,r){const[i,o]=r?[n,r]:[void 0,n];let u=" Did you mean ";i&&(u+=i+" ");const f=o.map(w=>`"${w}"`);switch(f.length){case 0:return"";case 1:return u+f[0]+"?";case 2:return u+f[0]+" or "+f[1]+"?"}const g=f.slice(0,jv),v=g.pop();return u+g.join(", ")+", or "+v+"?"}function Sc(n){return n}function Kc(n,r){const i=Object.create(null);for(const o of n)i[r(o)]=o;return i}function $n(n,r,i){const o=Object.create(null);for(const u of n)o[r(u)]=i(u);return o}function zr(n,r){const i=Object.create(null);for(const o of Object.keys(n))i[o]=r(n[o],o);return i}function Gv(n,r){let i=0,o=0;for(;i<n.length&&o<r.length;){let u=n.charCodeAt(i),f=r.charCodeAt(o);if(Br(u)&&Br(f)){let g=0;do++i,g=g*10+u-Oa,u=n.charCodeAt(i);while(Br(u)&&g>0);let v=0;do++o,v=v*10+f-Oa,f=r.charCodeAt(o);while(Br(f)&&v>0);if(g<v)return-1;if(g>v)return 1}else{if(u<f)return-1;if(u>f)return 1;++i,++o}}return n.length-r.length}const Oa=48,Vv=57;function Br(n){return!isNaN(n)&&Oa<=n&&n<=Vv}function qv(n,r){const i=Object.create(null),o=new Jv(n),u=Math.floor(n.length*.4)+1;for(const f of r){const g=o.measure(f,u);g!==void 0&&(i[f]=g)}return Object.keys(i).sort((f,g)=>{const v=i[f]-i[g];return v!==0?v:Gv(f,g)})}class Jv{constructor(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=Ac(this._inputLowerCase),this._rows=[new Array(r.length+1).fill(0),new Array(r.length+1).fill(0),new Array(r.length+1).fill(0)]}measure(r,i){if(this._input===r)return 0;const o=r.toLowerCase();if(this._inputLowerCase===o)return 1;let u=Ac(o),f=this._inputArray;if(u.length<f.length){const O=u;u=f,f=O}const g=u.length,v=f.length;if(g-v>i)return;const w=this._rows;for(let O=0;O<=v;O++)w[0][O]=O;for(let O=1;O<=g;O++){const D=w[(O-1)%3],P=w[O%3];let M=P[0]=O;for(let $=1;$<=v;$++){const he=u[O-1]===f[$-1]?0:1;let ae=Math.min(D[$]+1,P[$-1]+1,D[$-1]+he);if(O>1&&$>1&&u[O-1]===f[$-2]&&u[O-2]===f[$-1]){const me=w[(O-2)%3][$-2];ae=Math.min(ae,me+1)}ae<M&&(M=ae),P[$]=ae}if(M>i)return}const b=w[g%3][v];return b<=i?b:void 0}}function Ac(n){const r=n.length,i=new Array(r);for(let o=0;o<r;++o)i[o]=n.charCodeAt(o);return i}function _t(n){if(n==null)return Object.create(null);if(Object.getPrototypeOf(n)===null)return n;const r=Object.create(null);for(const[i,o]of Object.entries(n))r[i]=o;return r}function zv(n){return`"${n.replace(Qv,Hv)}"`}const Qv=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Hv(n){return Yv[n.charCodeAt(0)]}const Yv=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Xv=Object.freeze({});function Kv(n,r,i=Vc){const o=new Map;for(const me of Object.values(N))o.set(me,Zv(r,me));let u,f=Array.isArray(n),g=[n],v=-1,w=[],b=n,O,D;const P=[],M=[];do{v++;const me=v===g.length,Ye=me&&w.length!==0;if(me){if(O=M.length===0?void 0:P[P.length-1],b=D,D=M.pop(),Ye)if(f){b=b.slice();let L=0;for(const[ee,H]of w){const ce=ee-L;H===null?(b.splice(ce,1),L++):b[ce]=H}}else{b=Object.defineProperties({},Object.getOwnPropertyDescriptors(b));for(const[L,ee]of w)b[L]=ee}v=u.index,g=u.keys,w=u.edits,f=u.inArray,u=u.prev}else if(D){if(O=f?v:g[v],b=D[O],b==null)continue;P.push(O)}let xe;if(!Array.isArray(b)){var $,he;wc(b)||ue(!1,`Invalid AST Node: ${J(b)}.`);const L=me?($=o.get(b.kind))===null||$===void 0?void 0:$.leave:(he=o.get(b.kind))===null||he===void 0?void 0:he.enter;if(xe=L?.call(r,b,O,D,P,M),xe===Xv)break;if(xe===!1){if(!me){P.pop();continue}}else if(xe!==void 0&&(w.push([O,xe]),!me))if(wc(xe))b=xe;else{P.pop();continue}}if(xe===void 0&&Ye&&w.push([O,b]),me)P.pop();else{var ae;u={inArray:f,index:v,keys:g,edits:w,prev:u},f=Array.isArray(b),g=f?b:(ae=i[b.kind])!==null&&ae!==void 0?ae:[],v=-1,w=[],D&&M.push(D),D=b}}while(u!==void 0);return w.length!==0?w[w.length-1][1]:n}function Zv(n,r){const i=n[r];return typeof i=="object"?i:typeof i=="function"?{enter:i,leave:void 0}:{enter:n.enter,leave:n.leave}}function yt(n){return Kv(n,t_)}const e_=80,t_={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>k(n.definitions,`
|
|
30
30
|
|
|
31
|
-
`)},OperationDefinition:{leave(n){const r=ne("(",k(n.variableDefinitions,", "),")"),i=k([n.operation,k([n.name,r]),k(n.directives," ")]," ");return(i==="query"?"":i+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:r,defaultValue:i,directives:o})=>n+": "+r+ne(" = ",i)+ne(" ",k(o," "))},SelectionSet:{leave:({selections:n})=>bt(n)},Field:{leave({alias:n,name:r,arguments:i,directives:o,selectionSet:u}){const f=ne("",n,": ")+r;let g=f+ne("(",k(i,", "),")");return g.length>
|
|
31
|
+
`)},OperationDefinition:{leave(n){const r=ne("(",k(n.variableDefinitions,", "),")"),i=k([n.operation,k([n.name,r]),k(n.directives," ")]," ");return(i==="query"?"":i+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:r,defaultValue:i,directives:o})=>n+": "+r+ne(" = ",i)+ne(" ",k(o," "))},SelectionSet:{leave:({selections:n})=>bt(n)},Field:{leave({alias:n,name:r,arguments:i,directives:o,selectionSet:u}){const f=ne("",n,": ")+r;let g=f+ne("(",k(i,", "),")");return g.length>e_&&(g=f+ne(`(
|
|
32
32
|
`,Gr(k(i,`
|
|
33
33
|
`)),`
|
|
34
|
-
)`)),k([g,k(o," "),u]," ")}},Argument:{leave:({name:n,value:r})=>n+": "+r},FragmentSpread:{leave:({name:n,directives:r})=>"..."+n+ne(" ",k(r," "))},InlineFragment:{leave:({typeCondition:n,directives:r,selectionSet:i})=>k(["...",ne("on ",n),k(r," "),i]," ")},FragmentDefinition:{leave:({name:n,typeCondition:r,variableDefinitions:i,directives:o,selectionSet:u})=>`fragment ${n}${ne("(",k(i,", "),")")} on ${r} ${ne("",k(o," ")," ")}`+u},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:r})=>r?
|
|
34
|
+
)`)),k([g,k(o," "),u]," ")}},Argument:{leave:({name:n,value:r})=>n+": "+r},FragmentSpread:{leave:({name:n,directives:r})=>"..."+n+ne(" ",k(r," "))},InlineFragment:{leave:({typeCondition:n,directives:r,selectionSet:i})=>k(["...",ne("on ",n),k(r," "),i]," ")},FragmentDefinition:{leave:({name:n,typeCondition:r,variableDefinitions:i,directives:o,selectionSet:u})=>`fragment ${n}${ne("(",k(i,", "),")")} on ${r} ${ne("",k(o," ")," ")}`+u},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:r})=>r?xv(n):zv(n)},BooleanValue:{leave:({value:n})=>n?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:n})=>n},ListValue:{leave:({values:n})=>"["+k(n,", ")+"]"},ObjectValue:{leave:({fields:n})=>"{"+k(n,", ")+"}"},ObjectField:{leave:({name:n,value:r})=>n+": "+r},Directive:{leave:({name:n,arguments:r})=>"@"+n+ne("(",k(r,", "),")")},NamedType:{leave:({name:n})=>n},ListType:{leave:({type:n})=>"["+n+"]"},NonNullType:{leave:({type:n})=>n+"!"},SchemaDefinition:{leave:({description:n,directives:r,operationTypes:i})=>ne("",n,`
|
|
35
35
|
`)+k(["schema",k(r," "),bt(i)]," ")},OperationTypeDefinition:{leave:({operation:n,type:r})=>n+": "+r},ScalarTypeDefinition:{leave:({description:n,name:r,directives:i})=>ne("",n,`
|
|
36
36
|
`)+k(["scalar",r,k(i," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:r,interfaces:i,directives:o,fields:u})=>ne("",n,`
|
|
37
37
|
`)+k(["type",r,ne("implements ",k(i," & ")),k(o," "),bt(u)]," ")},FieldDefinition:{leave:({description:n,name:r,arguments:i,type:o,directives:u})=>ne("",n,`
|
|
@@ -53,9 +53,9 @@ spurious results.`)}}return!1};class Yc{constructor(r,i="GraphQL request",o={lin
|
|
|
53
53
|
`)),`
|
|
54
54
|
}`)}function ne(n,r,i=""){return r!=null&&r!==""?n+r+i:""}function Gr(n){return ne(" ",n.replace(/\n/g,`
|
|
55
55
|
`))}function Ic(n){var r;return(r=n?.some(i=>i.includes(`
|
|
56
|
-
`)))!==null&&r!==void 0?r:!1}function Ra(n,r){switch(n.kind){case N.NULL:return null;case N.INT:return parseInt(n.value,10);case N.FLOAT:return parseFloat(n.value);case N.STRING:case N.ENUM:case N.BOOLEAN:return n.value;case N.LIST:return n.values.map(i=>Ra(i,r));case N.OBJECT:return $n(n.fields,i=>i.name.value,i=>Ra(i.value,r));case N.VARIABLE:return r?.[n.name.value]}}function Ot(n){if(n!=null||ue(!1,"Must provide name."),typeof n=="string"||ue(!1,"Expected name to be a string."),n.length===0)throw new fe("Expected name to be a non-empty string.");for(let r=1;r<n.length;++r)if(!Jc(n.charCodeAt(r)))throw new fe(`Names must only contain [_a-zA-Z0-9] but "${n}" does not.`);if(!Fa(n.charCodeAt(0)))throw new fe(`Names must start with [_a-zA-Z] but "${n}" does not.`);return n}function i_(n){if(n==="true"||n==="false"||n==="null")throw new fe(`Enum values cannot be named: ${n}`);return Ot(n)}function Zc(n){return gi(n)||Yt(n)||gt(n)||_n(n)||xn(n)||Tn(n)||Wi(n)||yn(n)}function gi(n){return kt(n,jn)}function Yt(n){return kt(n,En)}function r_(n){if(!Yt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Object type.`);return n}function gt(n){return kt(n,fl)}function s_(n){if(!gt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Interface type.`);return n}function _n(n){return kt(n,pl)}function xn(n){return kt(n,Qr)}function Tn(n){return kt(n,dl)}function Wi(n){return kt(n,ht)}function yn(n){return kt(n,re)}function el(n){return gi(n)||xn(n)||Tn(n)||Da(n)&&el(n.ofType)}function tl(n){return gi(n)||Yt(n)||gt(n)||_n(n)||xn(n)||Da(n)&&tl(n.ofType)}function nl(n){return gi(n)||xn(n)}function a_(n){return gt(n)||_n(n)}class ht{constructor(r){Zc(r)||ue(!1,`Expected ${J(r)} to be a GraphQL type.`),this.ofType=r}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class re{constructor(r){il(r)||ue(!1,`Expected ${J(r)} to be a GraphQL nullable type.`),this.ofType=r}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function Da(n){return Wi(n)||yn(n)}function il(n){return Zc(n)&&!yn(n)}function o_(n){if(!il(n))throw new Error(`Expected ${J(n)} to be a GraphQL nullable type.`);return n}function u_(n){if(n){let r=n;for(;Da(r);)r=r.ofType;return r}}function rl(n){return typeof n=="function"?n():n}function sl(n){return typeof n=="function"?n():n}class jn{constructor(r){var i,o,u,f;const g=(i=r.parseValue)!==null&&i!==void 0?i:Sc;this.name=Ot(r.name),this.description=r.description,this.specifiedByURL=r.specifiedByURL,this.serialize=(o=r.serialize)!==null&&o!==void 0?o:Sc,this.parseValue=g,this.parseLiteral=(u=r.parseLiteral)!==null&&u!==void 0?u:(v,w)=>g(Ra(v,w)),this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(f=r.extensionASTNodes)!==null&&f!==void 0?f:[],r.specifiedByURL==null||typeof r.specifiedByURL=="string"||ue(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${J(r.specifiedByURL)}.`),r.serialize==null||typeof r.serialize=="function"||ue(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),r.parseLiteral&&(typeof r.parseValue=="function"&&typeof r.parseLiteral=="function"||ue(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class En{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=()=>ol(r),this._interfaces=()=>al(r),r.isTypeOf==null||typeof r.isTypeOf=="function"||ue(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${J(r.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:cl(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function al(n){var r;const i=rl((r=n.interfaces)!==null&&r!==void 0?r:[]);return Array.isArray(i)||ue(!1,`${n.name} interfaces must be an Array or a function which returns an Array.`),i}function ol(n){const r=sl(n.fields);return li(r)||ue(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),zr(r,(i,o)=>{var u;li(i)||ue(!1,`${n.name}.${o} field config must be an object.`),i.resolve==null||typeof i.resolve=="function"||ue(!1,`${n.name}.${o} field resolver must be a function if provided, but got: ${J(i.resolve)}.`);const f=(u=i.args)!==null&&u!==void 0?u:{};return li(f)||ue(!1,`${n.name}.${o} args must be an object with argument names as keys.`),{name:Ot(o),description:i.description,type:i.type,args:ul(f),resolve:i.resolve,subscribe:i.subscribe,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}})}function ul(n){return Object.entries(n).map(([r,i])=>({name:Ot(r),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}function li(n){return Xt(n)&&!Array.isArray(n)}function cl(n){return zr(n,r=>({description:r.description,type:r.type,args:ll(r.args),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}function ll(n){return $n(n,r=>r.name,r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}class fl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=ol.bind(void 0,r),this._interfaces=al.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${J(r.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:cl(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class pl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._types=c_.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${J(r.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function c_(n){const r=rl(n.types);return Array.isArray(r)||ue(!1,`Must provide Array of types or a function which returns such an array for Union ${n.name}.`),r}class Qr{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._values=l_(this.name,r.values),this._valueLookup=new Map(this._values.map(o=>[o.value,o])),this._nameLookup=Kc(this._values,o=>o.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(r){return this._nameLookup[r]}serialize(r){const i=this._valueLookup.get(r);if(i===void 0)throw new fe(`Enum "${this.name}" cannot represent value: ${J(r)}`);return i.name}parseValue(r){if(typeof r!="string"){const o=J(r);throw new fe(`Enum "${this.name}" cannot represent non-string value: ${o}.`+jr(this,o))}const i=this.getValue(r);if(i==null)throw new fe(`Value "${r}" does not exist in "${this.name}" enum.`+jr(this,r));return i.value}parseLiteral(r,i){if(r.kind!==N.ENUM){const u=yt(r);throw new fe(`Enum "${this.name}" cannot represent non-enum value: ${u}.`+jr(this,u),{nodes:r})}const o=this.getValue(r.value);if(o==null){const u=yt(r);throw new fe(`Value "${u}" does not exist in "${this.name}" enum.`+jr(this,u),{nodes:r})}return o.value}toConfig(){const r=$n(this.getValues(),i=>i.name,i=>({description:i.description,value:i.value,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}));return{name:this.name,description:this.description,values:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function jr(n,r){const i=n.getValues().map(u=>u.name),o=Jv(r,i);return Gv("the enum value",o)}function l_(n,r){return li(r)||ue(!1,`${n} values must be an object with value names as keys.`),Object.entries(r).map(([i,o])=>(li(o)||ue(!1,`${n}.${i} must refer to an object with a "value" key representing an internal value but got: ${J(o)}.`),{name:i_(i),description:o.description,value:o.value!==void 0?o.value:i,deprecationReason:o.deprecationReason,extensions:_t(o.extensions),astNode:o.astNode}))}class dl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=f_.bind(void 0,r)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const r=zr(this.getFields(),i=>({description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}));return{name:this.name,description:this.description,fields:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function f_(n){const r=sl(n.fields);return li(r)||ue(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),zr(r,(i,o)=>(!("resolve"in i)||ue(!1,`${n.name}.${o} field has a resolve property, but Input Types cannot define resolvers.`),{name:Ot(o),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}const wa=2147483647,Ea=-2147483648,p_=new jn({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r?1:0;let i=r;if(typeof r=="string"&&r!==""&&(i=Number(r)),typeof i!="number"||!Number.isInteger(i))throw new fe(`Int cannot represent non-integer value: ${J(r)}`);if(i>wa||i<Ea)throw new fe("Int cannot represent non 32-bit signed integer value: "+J(r));return i},parseValue(n){if(typeof n!="number"||!Number.isInteger(n))throw new fe(`Int cannot represent non-integer value: ${J(n)}`);if(n>wa||n<Ea)throw new fe(`Int cannot represent non 32-bit signed integer value: ${n}`);return n},parseLiteral(n){if(n.kind!==N.INT)throw new fe(`Int cannot represent non-integer value: ${yt(n)}`,{nodes:n});const r=parseInt(n.value,10);if(r>wa||r<Ea)throw new fe(`Int cannot represent non 32-bit signed integer value: ${n.value}`,{nodes:n});return r}}),d_=new jn({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r?1:0;let i=r;if(typeof r=="string"&&r!==""&&(i=Number(r)),typeof i!="number"||!Number.isFinite(i))throw new fe(`Float cannot represent non numeric value: ${J(r)}`);return i},parseValue(n){if(typeof n!="number"||!Number.isFinite(n))throw new fe(`Float cannot represent non numeric value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.FLOAT&&n.kind!==N.INT)throw new fe(`Float cannot represent non numeric value: ${yt(n)}`,n);return parseFloat(n.value)}}),Oe=new jn({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(n){const r=Gi(n);if(typeof r=="string")return r;if(typeof r=="boolean")return r?"true":"false";if(typeof r=="number"&&Number.isFinite(r))return r.toString();throw new fe(`String cannot represent value: ${J(n)}`)},parseValue(n){if(typeof n!="string")throw new fe(`String cannot represent a non string value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.STRING)throw new fe(`String cannot represent a non string value: ${yt(n)}`,{nodes:n});return n.value}}),mt=new jn({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r;if(Number.isFinite(r))return r!==0;throw new fe(`Boolean cannot represent a non boolean value: ${J(r)}`)},parseValue(n){if(typeof n!="boolean")throw new fe(`Boolean cannot represent a non boolean value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.BOOLEAN)throw new fe(`Boolean cannot represent a non boolean value: ${yt(n)}`,{nodes:n});return n.value}}),hl=new jn({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(n){const r=Gi(n);if(typeof r=="string")return r;if(Number.isInteger(r))return String(r);throw new fe(`ID cannot represent value: ${J(n)}`)},parseValue(n){if(typeof n=="string")return n;if(typeof n=="number"&&Number.isInteger(n))return n.toString();throw new fe(`ID cannot represent value: ${J(n)}`)},parseLiteral(n){if(n.kind!==N.STRING&&n.kind!==N.INT)throw new fe("ID cannot represent a non-string and non-integer value: "+yt(n),{nodes:n});return n.value}}),gl=Object.freeze([Oe,p_,d_,mt,hl]);function h_(n){return gl.some(({name:r})=>n.name===r)}function Gi(n){if(Xt(n)){if(typeof n.valueOf=="function"){const r=n.valueOf();if(!Xt(r))return r}if(typeof n.toJSON=="function")return n.toJSON()}return n}function g_(n){return kt(n,mi)}class mi{constructor(r){var i,o;this.name=Ot(r.name),this.description=r.description,this.locations=r.locations,this.isRepeatable=(i=r.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=_t(r.extensions),this.astNode=r.astNode,Array.isArray(r.locations)||ue(!1,`@${r.name} locations must be an Array.`);const u=(o=r.args)!==null&&o!==void 0?o:{};Xt(u)&&!Array.isArray(u)||ue(!1,`@${r.name} args must be an object with argument names as keys.`),this.args=ul(u)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:ll(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const m_=new mi({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[se.FIELD,se.FRAGMENT_SPREAD,se.INLINE_FRAGMENT],args:{if:{type:new re(mt),description:"Included when true."}}}),y_=new mi({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[se.FIELD,se.FRAGMENT_SPREAD,se.INLINE_FRAGMENT],args:{if:{type:new re(mt),description:"Skipped when true."}}}),ml="No longer supported",v_=new mi({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[se.FIELD_DEFINITION,se.ARGUMENT_DEFINITION,se.INPUT_FIELD_DEFINITION,se.ENUM_VALUE],args:{reason:{type:Oe,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:ml}}}),__=new mi({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[se.SCALAR],args:{url:{type:new re(Oe),description:"The URL that specifies the behavior of this scalar."}}}),yl=Object.freeze([m_,y_,v_,__]);function x_(n){return yl.some(({name:r})=>r===n.name)}function T_(n){return typeof n=="object"&&typeof n?.[Symbol.iterator]=="function"}function ci(n,r){if(yn(r)){const i=ci(n,r.ofType);return i?.kind===N.NULL?null:i}if(n===null)return{kind:N.NULL};if(n===void 0)return null;if(Wi(r)){const i=r.ofType;if(T_(n)){const o=[];for(const u of n){const f=ci(u,i);f!=null&&o.push(f)}return{kind:N.LIST,values:o}}return ci(n,i)}if(Tn(r)){if(!Xt(n))return null;const i=[];for(const o of Object.values(r.getFields())){const u=ci(n[o.name],o.type);u&&i.push({kind:N.OBJECT_FIELD,name:{kind:N.NAME,value:o.name},value:u})}return{kind:N.OBJECT,fields:i}}if(nl(r)){const i=r.serialize(n);if(i==null)return null;if(typeof i=="boolean")return{kind:N.BOOLEAN,value:i};if(typeof i=="number"&&Number.isFinite(i)){const o=String(i);return bc.test(o)?{kind:N.INT,value:o}:{kind:N.FLOAT,value:o}}if(typeof i=="string")return xn(r)?{kind:N.ENUM,value:i}:r===hl&&bc.test(i)?{kind:N.INT,value:i}:{kind:N.STRING,value:i};throw new TypeError(`Cannot convert value to AST: ${J(i)}.`)}ji(!1,"Unexpected input type: "+J(r))}const bc=/^-?(?:0|[1-9][0-9]*)$/,Pa=new En({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Oe,resolve:n=>n.description},types:{description:"A list of all types supported by this server.",type:new re(new ht(new re(Pt))),resolve(n){return Object.values(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new re(Pt),resolve:n=>n.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Pt,resolve:n=>n.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Pt,resolve:n=>n.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new re(new ht(new re(vl))),resolve:n=>n.getDirectives()}})}),vl=new En({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
56
|
+
`)))!==null&&r!==void 0?r:!1}function Ra(n,r){switch(n.kind){case N.NULL:return null;case N.INT:return parseInt(n.value,10);case N.FLOAT:return parseFloat(n.value);case N.STRING:case N.ENUM:case N.BOOLEAN:return n.value;case N.LIST:return n.values.map(i=>Ra(i,r));case N.OBJECT:return $n(n.fields,i=>i.name.value,i=>Ra(i.value,r));case N.VARIABLE:return r?.[n.name.value]}}function Ot(n){if(n!=null||ue(!1,"Must provide name."),typeof n=="string"||ue(!1,"Expected name to be a string."),n.length===0)throw new fe("Expected name to be a non-empty string.");for(let r=1;r<n.length;++r)if(!Jc(n.charCodeAt(r)))throw new fe(`Names must only contain [_a-zA-Z0-9] but "${n}" does not.`);if(!Fa(n.charCodeAt(0)))throw new fe(`Names must start with [_a-zA-Z] but "${n}" does not.`);return n}function n_(n){if(n==="true"||n==="false"||n==="null")throw new fe(`Enum values cannot be named: ${n}`);return Ot(n)}function Zc(n){return gi(n)||Xt(n)||gt(n)||_n(n)||xn(n)||Tn(n)||Wi(n)||yn(n)}function gi(n){return Ut(n,jn)}function Xt(n){return Ut(n,En)}function i_(n){if(!Xt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Object type.`);return n}function gt(n){return Ut(n,fl)}function r_(n){if(!gt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Interface type.`);return n}function _n(n){return Ut(n,pl)}function xn(n){return Ut(n,Qr)}function Tn(n){return Ut(n,dl)}function Wi(n){return Ut(n,ht)}function yn(n){return Ut(n,re)}function el(n){return gi(n)||xn(n)||Tn(n)||Da(n)&&el(n.ofType)}function tl(n){return gi(n)||Xt(n)||gt(n)||_n(n)||xn(n)||Da(n)&&tl(n.ofType)}function nl(n){return gi(n)||xn(n)}function s_(n){return gt(n)||_n(n)}class ht{constructor(r){Zc(r)||ue(!1,`Expected ${J(r)} to be a GraphQL type.`),this.ofType=r}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class re{constructor(r){il(r)||ue(!1,`Expected ${J(r)} to be a GraphQL nullable type.`),this.ofType=r}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function Da(n){return Wi(n)||yn(n)}function il(n){return Zc(n)&&!yn(n)}function a_(n){if(!il(n))throw new Error(`Expected ${J(n)} to be a GraphQL nullable type.`);return n}function o_(n){if(n){let r=n;for(;Da(r);)r=r.ofType;return r}}function rl(n){return typeof n=="function"?n():n}function sl(n){return typeof n=="function"?n():n}class jn{constructor(r){var i,o,u,f;const g=(i=r.parseValue)!==null&&i!==void 0?i:Sc;this.name=Ot(r.name),this.description=r.description,this.specifiedByURL=r.specifiedByURL,this.serialize=(o=r.serialize)!==null&&o!==void 0?o:Sc,this.parseValue=g,this.parseLiteral=(u=r.parseLiteral)!==null&&u!==void 0?u:(v,w)=>g(Ra(v,w)),this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(f=r.extensionASTNodes)!==null&&f!==void 0?f:[],r.specifiedByURL==null||typeof r.specifiedByURL=="string"||ue(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${J(r.specifiedByURL)}.`),r.serialize==null||typeof r.serialize=="function"||ue(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),r.parseLiteral&&(typeof r.parseValue=="function"&&typeof r.parseLiteral=="function"||ue(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class En{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=()=>ol(r),this._interfaces=()=>al(r),r.isTypeOf==null||typeof r.isTypeOf=="function"||ue(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${J(r.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:cl(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function al(n){var r;const i=rl((r=n.interfaces)!==null&&r!==void 0?r:[]);return Array.isArray(i)||ue(!1,`${n.name} interfaces must be an Array or a function which returns an Array.`),i}function ol(n){const r=sl(n.fields);return li(r)||ue(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),zr(r,(i,o)=>{var u;li(i)||ue(!1,`${n.name}.${o} field config must be an object.`),i.resolve==null||typeof i.resolve=="function"||ue(!1,`${n.name}.${o} field resolver must be a function if provided, but got: ${J(i.resolve)}.`);const f=(u=i.args)!==null&&u!==void 0?u:{};return li(f)||ue(!1,`${n.name}.${o} args must be an object with argument names as keys.`),{name:Ot(o),description:i.description,type:i.type,args:ul(f),resolve:i.resolve,subscribe:i.subscribe,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}})}function ul(n){return Object.entries(n).map(([r,i])=>({name:Ot(r),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}function li(n){return Kt(n)&&!Array.isArray(n)}function cl(n){return zr(n,r=>({description:r.description,type:r.type,args:ll(r.args),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}function ll(n){return $n(n,r=>r.name,r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}class fl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=ol.bind(void 0,r),this._interfaces=al.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${J(r.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:cl(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class pl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._types=u_.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${J(r.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function u_(n){const r=rl(n.types);return Array.isArray(r)||ue(!1,`Must provide Array of types or a function which returns such an array for Union ${n.name}.`),r}class Qr{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._values=c_(this.name,r.values),this._valueLookup=new Map(this._values.map(o=>[o.value,o])),this._nameLookup=Kc(this._values,o=>o.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(r){return this._nameLookup[r]}serialize(r){const i=this._valueLookup.get(r);if(i===void 0)throw new fe(`Enum "${this.name}" cannot represent value: ${J(r)}`);return i.name}parseValue(r){if(typeof r!="string"){const o=J(r);throw new fe(`Enum "${this.name}" cannot represent non-string value: ${o}.`+jr(this,o))}const i=this.getValue(r);if(i==null)throw new fe(`Value "${r}" does not exist in "${this.name}" enum.`+jr(this,r));return i.value}parseLiteral(r,i){if(r.kind!==N.ENUM){const u=yt(r);throw new fe(`Enum "${this.name}" cannot represent non-enum value: ${u}.`+jr(this,u),{nodes:r})}const o=this.getValue(r.value);if(o==null){const u=yt(r);throw new fe(`Value "${u}" does not exist in "${this.name}" enum.`+jr(this,u),{nodes:r})}return o.value}toConfig(){const r=$n(this.getValues(),i=>i.name,i=>({description:i.description,value:i.value,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}));return{name:this.name,description:this.description,values:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function jr(n,r){const i=n.getValues().map(u=>u.name),o=qv(r,i);return Wv("the enum value",o)}function c_(n,r){return li(r)||ue(!1,`${n} values must be an object with value names as keys.`),Object.entries(r).map(([i,o])=>(li(o)||ue(!1,`${n}.${i} must refer to an object with a "value" key representing an internal value but got: ${J(o)}.`),{name:n_(i),description:o.description,value:o.value!==void 0?o.value:i,deprecationReason:o.deprecationReason,extensions:_t(o.extensions),astNode:o.astNode}))}class dl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=l_.bind(void 0,r)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const r=zr(this.getFields(),i=>({description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}));return{name:this.name,description:this.description,fields:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function l_(n){const r=sl(n.fields);return li(r)||ue(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),zr(r,(i,o)=>(!("resolve"in i)||ue(!1,`${n.name}.${o} field has a resolve property, but Input Types cannot define resolvers.`),{name:Ot(o),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}const wa=2147483647,Ea=-2147483648,f_=new jn({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r?1:0;let i=r;if(typeof r=="string"&&r!==""&&(i=Number(r)),typeof i!="number"||!Number.isInteger(i))throw new fe(`Int cannot represent non-integer value: ${J(r)}`);if(i>wa||i<Ea)throw new fe("Int cannot represent non 32-bit signed integer value: "+J(r));return i},parseValue(n){if(typeof n!="number"||!Number.isInteger(n))throw new fe(`Int cannot represent non-integer value: ${J(n)}`);if(n>wa||n<Ea)throw new fe(`Int cannot represent non 32-bit signed integer value: ${n}`);return n},parseLiteral(n){if(n.kind!==N.INT)throw new fe(`Int cannot represent non-integer value: ${yt(n)}`,{nodes:n});const r=parseInt(n.value,10);if(r>wa||r<Ea)throw new fe(`Int cannot represent non 32-bit signed integer value: ${n.value}`,{nodes:n});return r}}),p_=new jn({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r?1:0;let i=r;if(typeof r=="string"&&r!==""&&(i=Number(r)),typeof i!="number"||!Number.isFinite(i))throw new fe(`Float cannot represent non numeric value: ${J(r)}`);return i},parseValue(n){if(typeof n!="number"||!Number.isFinite(n))throw new fe(`Float cannot represent non numeric value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.FLOAT&&n.kind!==N.INT)throw new fe(`Float cannot represent non numeric value: ${yt(n)}`,n);return parseFloat(n.value)}}),Oe=new jn({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(n){const r=Gi(n);if(typeof r=="string")return r;if(typeof r=="boolean")return r?"true":"false";if(typeof r=="number"&&Number.isFinite(r))return r.toString();throw new fe(`String cannot represent value: ${J(n)}`)},parseValue(n){if(typeof n!="string")throw new fe(`String cannot represent a non string value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.STRING)throw new fe(`String cannot represent a non string value: ${yt(n)}`,{nodes:n});return n.value}}),mt=new jn({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r;if(Number.isFinite(r))return r!==0;throw new fe(`Boolean cannot represent a non boolean value: ${J(r)}`)},parseValue(n){if(typeof n!="boolean")throw new fe(`Boolean cannot represent a non boolean value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.BOOLEAN)throw new fe(`Boolean cannot represent a non boolean value: ${yt(n)}`,{nodes:n});return n.value}}),hl=new jn({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(n){const r=Gi(n);if(typeof r=="string")return r;if(Number.isInteger(r))return String(r);throw new fe(`ID cannot represent value: ${J(n)}`)},parseValue(n){if(typeof n=="string")return n;if(typeof n=="number"&&Number.isInteger(n))return n.toString();throw new fe(`ID cannot represent value: ${J(n)}`)},parseLiteral(n){if(n.kind!==N.STRING&&n.kind!==N.INT)throw new fe("ID cannot represent a non-string and non-integer value: "+yt(n),{nodes:n});return n.value}}),gl=Object.freeze([Oe,f_,p_,mt,hl]);function d_(n){return gl.some(({name:r})=>n.name===r)}function Gi(n){if(Kt(n)){if(typeof n.valueOf=="function"){const r=n.valueOf();if(!Kt(r))return r}if(typeof n.toJSON=="function")return n.toJSON()}return n}function h_(n){return Ut(n,mi)}class mi{constructor(r){var i,o;this.name=Ot(r.name),this.description=r.description,this.locations=r.locations,this.isRepeatable=(i=r.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=_t(r.extensions),this.astNode=r.astNode,Array.isArray(r.locations)||ue(!1,`@${r.name} locations must be an Array.`);const u=(o=r.args)!==null&&o!==void 0?o:{};Kt(u)&&!Array.isArray(u)||ue(!1,`@${r.name} args must be an object with argument names as keys.`),this.args=ul(u)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:ll(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const g_=new mi({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[se.FIELD,se.FRAGMENT_SPREAD,se.INLINE_FRAGMENT],args:{if:{type:new re(mt),description:"Included when true."}}}),m_=new mi({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[se.FIELD,se.FRAGMENT_SPREAD,se.INLINE_FRAGMENT],args:{if:{type:new re(mt),description:"Skipped when true."}}}),ml="No longer supported",y_=new mi({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[se.FIELD_DEFINITION,se.ARGUMENT_DEFINITION,se.INPUT_FIELD_DEFINITION,se.ENUM_VALUE],args:{reason:{type:Oe,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:ml}}}),v_=new mi({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[se.SCALAR],args:{url:{type:new re(Oe),description:"The URL that specifies the behavior of this scalar."}}}),yl=Object.freeze([g_,m_,y_,v_]);function __(n){return yl.some(({name:r})=>r===n.name)}function x_(n){return typeof n=="object"&&typeof n?.[Symbol.iterator]=="function"}function ci(n,r){if(yn(r)){const i=ci(n,r.ofType);return i?.kind===N.NULL?null:i}if(n===null)return{kind:N.NULL};if(n===void 0)return null;if(Wi(r)){const i=r.ofType;if(x_(n)){const o=[];for(const u of n){const f=ci(u,i);f!=null&&o.push(f)}return{kind:N.LIST,values:o}}return ci(n,i)}if(Tn(r)){if(!Kt(n))return null;const i=[];for(const o of Object.values(r.getFields())){const u=ci(n[o.name],o.type);u&&i.push({kind:N.OBJECT_FIELD,name:{kind:N.NAME,value:o.name},value:u})}return{kind:N.OBJECT,fields:i}}if(nl(r)){const i=r.serialize(n);if(i==null)return null;if(typeof i=="boolean")return{kind:N.BOOLEAN,value:i};if(typeof i=="number"&&Number.isFinite(i)){const o=String(i);return bc.test(o)?{kind:N.INT,value:o}:{kind:N.FLOAT,value:o}}if(typeof i=="string")return xn(r)?{kind:N.ENUM,value:i}:r===hl&&bc.test(i)?{kind:N.INT,value:i}:{kind:N.STRING,value:i};throw new TypeError(`Cannot convert value to AST: ${J(i)}.`)}ji(!1,"Unexpected input type: "+J(r))}const bc=/^-?(?:0|[1-9][0-9]*)$/,Pa=new En({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Oe,resolve:n=>n.description},types:{description:"A list of all types supported by this server.",type:new re(new ht(new re(Pt))),resolve(n){return Object.values(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new re(Pt),resolve:n=>n.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Pt,resolve:n=>n.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Pt,resolve:n=>n.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new re(new ht(new re(vl))),resolve:n=>n.getDirectives()}})}),vl=new En({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
57
57
|
|
|
58
|
-
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},isRepeatable:{type:new re(mt),resolve:n=>n.isRepeatable},locations:{type:new re(new ht(new re(_l))),resolve:n=>n.locations},args:{type:new re(new ht(new re(Hr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}}})}),_l=new Qr({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:se.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:se.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:se.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:se.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:se.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:se.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:se.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:se.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:se.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:se.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:se.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:se.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:se.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:se.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:se.UNION,description:"Location adjacent to a union definition."},ENUM:{value:se.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:se.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:se.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:se.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Pt=new En({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new re(wl),resolve(n){if(gi(n))return ve.SCALAR;if(Yt(n))return ve.OBJECT;if(gt(n))return ve.INTERFACE;if(_n(n))return ve.UNION;if(xn(n))return ve.ENUM;if(Tn(n))return ve.INPUT_OBJECT;if(Wi(n))return ve.LIST;if(yn(n))return ve.NON_NULL;ji(!1,`Unexpected type: "${J(n)}".`)}},name:{type:Oe,resolve:n=>"name"in n?n.name:void 0},description:{type:Oe,resolve:n=>"description"in n?n.description:void 0},specifiedByURL:{type:Oe,resolve:n=>"specifiedByURL"in n?n.specifiedByURL:void 0},fields:{type:new ht(new re(xl)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Yt(n)||gt(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},interfaces:{type:new ht(new re(Pt)),resolve(n){if(Yt(n)||gt(n))return n.getInterfaces()}},possibleTypes:{type:new ht(new re(Pt)),resolve(n,r,i,{schema:o}){if(a_(n))return o.getPossibleTypes(n)}},enumValues:{type:new ht(new re(Tl)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(xn(n)){const i=n.getValues();return r?i:i.filter(o=>o.deprecationReason==null)}}},inputFields:{type:new ht(new re(Hr)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Tn(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},ofType:{type:Pt,resolve:n=>"ofType"in n?n.ofType:void 0}})}),xl=new En({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},args:{type:new re(new ht(new re(Hr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}},type:{type:new re(Pt),resolve:n=>n.type},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),Hr=new En({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},type:{type:new re(Pt),resolve:n=>n.type},defaultValue:{type:Oe,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(n){const{type:r,defaultValue:i}=n,o=ci(i,r);return o?yt(o):null}},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),Tl=new En({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})});var ve;(function(n){n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.INPUT_OBJECT="INPUT_OBJECT",n.LIST="LIST",n.NON_NULL="NON_NULL"})(ve||(ve={}));const wl=new Qr({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ve.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:ve.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ve.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ve.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ve.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ve.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ve.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ve.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new re(Pa);new re(Oe);new re(Oe);const El=Object.freeze([Pa,vl,_l,Pt,xl,Hr,Tl,wl]);function w_(n){return El.some(({name:r})=>n.name===r)}class E_{constructor(r){var i,o;this.__validationErrors=r.assumeValid===!0?[]:void 0,Xt(r)||ue(!1,"Must provide configuration object."),!r.types||Array.isArray(r.types)||ue(!1,`"types" must be Array if provided but got: ${J(r.types)}.`),!r.directives||Array.isArray(r.directives)||ue(!1,`"directives" must be Array if provided but got: ${J(r.directives)}.`),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._queryType=r.query,this._mutationType=r.mutation,this._subscriptionType=r.subscription,this._directives=(o=r.directives)!==null&&o!==void 0?o:yl;const u=new Set(r.types);if(r.types!=null)for(const f of r.types)u.delete(f),Nt(f,u);this._queryType!=null&&Nt(this._queryType,u),this._mutationType!=null&&Nt(this._mutationType,u),this._subscriptionType!=null&&Nt(this._subscriptionType,u);for(const f of this._directives)if(g_(f))for(const g of f.args)Nt(g.type,u);Nt(Pa,u),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const f of u){if(f==null)continue;const g=f.name;if(g||ue(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[g]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${g}".`);if(this._typeMap[g]=f,gt(f)){for(const v of f.getInterfaces())if(gt(v)){let w=this._implementationsMap[v.name];w===void 0&&(w=this._implementationsMap[v.name]={objects:[],interfaces:[]}),w.interfaces.push(f)}}else if(Yt(f)){for(const v of f.getInterfaces())if(gt(v)){let w=this._implementationsMap[v.name];w===void 0&&(w=this._implementationsMap[v.name]={objects:[],interfaces:[]}),w.objects.push(f)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(r){switch(r){case Qt.QUERY:return this.getQueryType();case Qt.MUTATION:return this.getMutationType();case Qt.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(r){return this.getTypeMap()[r]}getPossibleTypes(r){return _n(r)?r.getTypes():this.getImplementations(r).objects}getImplementations(r){const i=this._implementationsMap[r.name];return i??{objects:[],interfaces:[]}}isSubType(r,i){let o=this._subTypeMap[r.name];if(o===void 0){if(o=Object.create(null),_n(r))for(const u of r.getTypes())o[u.name]=!0;else{const u=this.getImplementations(r);for(const f of u.objects)o[f.name]=!0;for(const f of u.interfaces)o[f.name]=!0}this._subTypeMap[r.name]=o}return o[i.name]!==void 0}getDirectives(){return this._directives}getDirective(r){return this.getDirectives().find(i=>i.name===r)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function Nt(n,r){const i=u_(n);if(!r.has(i)){if(r.add(i),_n(i))for(const o of i.getTypes())Nt(o,r);else if(Yt(i)||gt(i)){for(const o of i.getInterfaces())Nt(o,r);for(const o of Object.values(i.getFields())){Nt(o.type,r);for(const u of o.args)Nt(u.type,r)}}else if(Tn(i))for(const o of Object.values(i.getFields()))Nt(o.type,r)}return r}function Mi(n,r,i){if(n){if(n.kind===N.VARIABLE){n.name.value;return}if(yn(r))return n.kind===N.NULL?void 0:Mi(n,r.ofType,i);if(n.kind===N.NULL)return null;if(Wi(r)){const o=r.ofType;if(n.kind===N.LIST){const f=[];for(const g of n.values)if(Nc(g,i)){if(yn(o))return;f.push(null)}else{const v=Mi(g,o,i);if(v===void 0)return;f.push(v)}return f}const u=Mi(n,o,i);return u===void 0?void 0:[u]}if(Tn(r)){if(n.kind!==N.OBJECT)return;const o=Object.create(null),u=Kc(n.fields,f=>f.name.value);for(const f of Object.values(r.getFields())){const g=u[f.name];if(!g||Nc(g.value,i)){if(f.defaultValue!==void 0)o[f.name]=f.defaultValue;else if(yn(f.type))return;continue}const v=Mi(g.value,f.type,i);if(v===void 0)return;o[f.name]=v}return o}if(nl(r)){let o;try{o=r.parseLiteral(n,i)}catch{return}return o===void 0?void 0:o}ji(!1,"Unexpected input type: "+J(r))}}function Nc(n,r){return n.kind===N.VARIABLE&&r==null}function S_(n){const r={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...n},i=r.descriptions?"description":"",o=r.specifiedByUrl?"specifiedByURL":"",u=r.directiveIsRepeatable?"isRepeatable":"",f=r.schemaDescription?i:"";function g(v){return r.inputValueDeprecation?v:""}return`
|
|
58
|
+
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},isRepeatable:{type:new re(mt),resolve:n=>n.isRepeatable},locations:{type:new re(new ht(new re(_l))),resolve:n=>n.locations},args:{type:new re(new ht(new re(Hr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}}})}),_l=new Qr({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:se.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:se.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:se.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:se.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:se.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:se.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:se.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:se.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:se.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:se.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:se.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:se.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:se.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:se.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:se.UNION,description:"Location adjacent to a union definition."},ENUM:{value:se.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:se.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:se.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:se.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Pt=new En({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new re(wl),resolve(n){if(gi(n))return ve.SCALAR;if(Xt(n))return ve.OBJECT;if(gt(n))return ve.INTERFACE;if(_n(n))return ve.UNION;if(xn(n))return ve.ENUM;if(Tn(n))return ve.INPUT_OBJECT;if(Wi(n))return ve.LIST;if(yn(n))return ve.NON_NULL;ji(!1,`Unexpected type: "${J(n)}".`)}},name:{type:Oe,resolve:n=>"name"in n?n.name:void 0},description:{type:Oe,resolve:n=>"description"in n?n.description:void 0},specifiedByURL:{type:Oe,resolve:n=>"specifiedByURL"in n?n.specifiedByURL:void 0},fields:{type:new ht(new re(xl)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Xt(n)||gt(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},interfaces:{type:new ht(new re(Pt)),resolve(n){if(Xt(n)||gt(n))return n.getInterfaces()}},possibleTypes:{type:new ht(new re(Pt)),resolve(n,r,i,{schema:o}){if(s_(n))return o.getPossibleTypes(n)}},enumValues:{type:new ht(new re(Tl)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(xn(n)){const i=n.getValues();return r?i:i.filter(o=>o.deprecationReason==null)}}},inputFields:{type:new ht(new re(Hr)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Tn(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},ofType:{type:Pt,resolve:n=>"ofType"in n?n.ofType:void 0}})}),xl=new En({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},args:{type:new re(new ht(new re(Hr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}},type:{type:new re(Pt),resolve:n=>n.type},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),Hr=new En({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},type:{type:new re(Pt),resolve:n=>n.type},defaultValue:{type:Oe,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(n){const{type:r,defaultValue:i}=n,o=ci(i,r);return o?yt(o):null}},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),Tl=new En({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})});var ve;(function(n){n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.INPUT_OBJECT="INPUT_OBJECT",n.LIST="LIST",n.NON_NULL="NON_NULL"})(ve||(ve={}));const wl=new Qr({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ve.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:ve.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ve.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ve.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ve.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ve.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ve.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ve.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new re(Pa);new re(Oe);new re(Oe);const El=Object.freeze([Pa,vl,_l,Pt,xl,Hr,Tl,wl]);function T_(n){return El.some(({name:r})=>n.name===r)}class w_{constructor(r){var i,o;this.__validationErrors=r.assumeValid===!0?[]:void 0,Kt(r)||ue(!1,"Must provide configuration object."),!r.types||Array.isArray(r.types)||ue(!1,`"types" must be Array if provided but got: ${J(r.types)}.`),!r.directives||Array.isArray(r.directives)||ue(!1,`"directives" must be Array if provided but got: ${J(r.directives)}.`),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._queryType=r.query,this._mutationType=r.mutation,this._subscriptionType=r.subscription,this._directives=(o=r.directives)!==null&&o!==void 0?o:yl;const u=new Set(r.types);if(r.types!=null)for(const f of r.types)u.delete(f),Nt(f,u);this._queryType!=null&&Nt(this._queryType,u),this._mutationType!=null&&Nt(this._mutationType,u),this._subscriptionType!=null&&Nt(this._subscriptionType,u);for(const f of this._directives)if(h_(f))for(const g of f.args)Nt(g.type,u);Nt(Pa,u),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const f of u){if(f==null)continue;const g=f.name;if(g||ue(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[g]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${g}".`);if(this._typeMap[g]=f,gt(f)){for(const v of f.getInterfaces())if(gt(v)){let w=this._implementationsMap[v.name];w===void 0&&(w=this._implementationsMap[v.name]={objects:[],interfaces:[]}),w.interfaces.push(f)}}else if(Xt(f)){for(const v of f.getInterfaces())if(gt(v)){let w=this._implementationsMap[v.name];w===void 0&&(w=this._implementationsMap[v.name]={objects:[],interfaces:[]}),w.objects.push(f)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(r){switch(r){case Ht.QUERY:return this.getQueryType();case Ht.MUTATION:return this.getMutationType();case Ht.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(r){return this.getTypeMap()[r]}getPossibleTypes(r){return _n(r)?r.getTypes():this.getImplementations(r).objects}getImplementations(r){const i=this._implementationsMap[r.name];return i??{objects:[],interfaces:[]}}isSubType(r,i){let o=this._subTypeMap[r.name];if(o===void 0){if(o=Object.create(null),_n(r))for(const u of r.getTypes())o[u.name]=!0;else{const u=this.getImplementations(r);for(const f of u.objects)o[f.name]=!0;for(const f of u.interfaces)o[f.name]=!0}this._subTypeMap[r.name]=o}return o[i.name]!==void 0}getDirectives(){return this._directives}getDirective(r){return this.getDirectives().find(i=>i.name===r)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function Nt(n,r){const i=o_(n);if(!r.has(i)){if(r.add(i),_n(i))for(const o of i.getTypes())Nt(o,r);else if(Xt(i)||gt(i)){for(const o of i.getInterfaces())Nt(o,r);for(const o of Object.values(i.getFields())){Nt(o.type,r);for(const u of o.args)Nt(u.type,r)}}else if(Tn(i))for(const o of Object.values(i.getFields()))Nt(o.type,r)}return r}function Mi(n,r,i){if(n){if(n.kind===N.VARIABLE){n.name.value;return}if(yn(r))return n.kind===N.NULL?void 0:Mi(n,r.ofType,i);if(n.kind===N.NULL)return null;if(Wi(r)){const o=r.ofType;if(n.kind===N.LIST){const f=[];for(const g of n.values)if(Nc(g,i)){if(yn(o))return;f.push(null)}else{const v=Mi(g,o,i);if(v===void 0)return;f.push(v)}return f}const u=Mi(n,o,i);return u===void 0?void 0:[u]}if(Tn(r)){if(n.kind!==N.OBJECT)return;const o=Object.create(null),u=Kc(n.fields,f=>f.name.value);for(const f of Object.values(r.getFields())){const g=u[f.name];if(!g||Nc(g.value,i)){if(f.defaultValue!==void 0)o[f.name]=f.defaultValue;else if(yn(f.type))return;continue}const v=Mi(g.value,f.type,i);if(v===void 0)return;o[f.name]=v}return o}if(nl(r)){let o;try{o=r.parseLiteral(n,i)}catch{return}return o===void 0?void 0:o}ji(!1,"Unexpected input type: "+J(r))}}function Nc(n,r){return n.kind===N.VARIABLE&&r==null}function E_(n){const r={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...n},i=r.descriptions?"description":"",o=r.specifiedByUrl?"specifiedByURL":"",u=r.directiveIsRepeatable?"isRepeatable":"",f=r.schemaDescription?i:"";function g(v){return r.inputValueDeprecation?v:""}return`
|
|
59
59
|
query IntrospectionQuery {
|
|
60
60
|
__schema {
|
|
61
61
|
${f}
|
|
@@ -160,21 +160,21 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
`}function
|
|
163
|
+
`}function S_(n,r){Kt(n)&&Kt(n.__schema)||ue(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${J(n)}.`);const i=n.__schema,o=$n(i.types,x=>x.name,x=>P(x));for(const x of[...gl,...El])o[x.name]&&(o[x.name]=x);const u=i.queryType?O(i.queryType):null,f=i.mutationType?O(i.mutationType):null,g=i.subscriptionType?O(i.subscriptionType):null,v=i.directives?i.directives.map(qe):[];return new w_({description:i.description,query:u,mutation:f,subscription:g,types:Object.values(o),directives:v,assumeValid:void 0});function w(x){if(x.kind===ve.LIST){const q=x.ofType;if(!q)throw new Error("Decorated type deeper than introspection query.");return new ht(w(q))}if(x.kind===ve.NON_NULL){const q=x.ofType;if(!q)throw new Error("Decorated type deeper than introspection query.");const Se=w(q);return new re(a_(Se))}return b(x)}function b(x){const q=x.name;if(!q)throw new Error(`Unknown type reference: ${J(x)}.`);const Se=o[q];if(!Se)throw new Error(`Invalid or incomplete schema, unknown type: ${q}. Ensure that a full introspection query is used in order to build a client schema.`);return Se}function O(x){return i_(b(x))}function D(x){return r_(b(x))}function P(x){if(x!=null&&x.name!=null&&x.kind!=null)switch(x.kind){case ve.SCALAR:return M(x);case ve.OBJECT:return he(x);case ve.INTERFACE:return ae(x);case ve.UNION:return me(x);case ve.ENUM:return Ye(x);case ve.INPUT_OBJECT:return xe(x)}const q=J(x);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${q}.`)}function M(x){return new jn({name:x.name,description:x.description,specifiedByURL:x.specifiedByURL})}function $(x){if(x.interfaces===null&&x.kind===ve.INTERFACE)return[];if(!x.interfaces){const q=J(x);throw new Error(`Introspection result missing interfaces: ${q}.`)}return x.interfaces.map(D)}function he(x){return new En({name:x.name,description:x.description,interfaces:()=>$(x),fields:()=>L(x)})}function ae(x){return new fl({name:x.name,description:x.description,interfaces:()=>$(x),fields:()=>L(x)})}function me(x){if(!x.possibleTypes){const q=J(x);throw new Error(`Introspection result missing possibleTypes: ${q}.`)}return new pl({name:x.name,description:x.description,types:()=>x.possibleTypes.map(O)})}function Ye(x){if(!x.enumValues){const q=J(x);throw new Error(`Introspection result missing enumValues: ${q}.`)}return new Qr({name:x.name,description:x.description,values:$n(x.enumValues,q=>q.name,q=>({description:q.description,deprecationReason:q.deprecationReason}))})}function xe(x){if(!x.inputFields){const q=J(x);throw new Error(`Introspection result missing inputFields: ${q}.`)}return new dl({name:x.name,description:x.description,fields:()=>H(x.inputFields)})}function L(x){if(!x.fields)throw new Error(`Introspection result missing fields: ${J(x)}.`);return $n(x.fields,q=>q.name,ee)}function ee(x){const q=w(x.type);if(!tl(q)){const Se=J(q);throw new Error(`Introspection must provide output type for fields, but received: ${Se}.`)}if(!x.args){const Se=J(x);throw new Error(`Introspection result missing field args: ${Se}.`)}return{description:x.description,deprecationReason:x.deprecationReason,type:q,args:H(x.args)}}function H(x){return $n(x,q=>q.name,ce)}function ce(x){const q=w(x.type);if(!el(q)){const xt=J(q);throw new Error(`Introspection must provide input type for arguments, but received: ${xt}.`)}const Se=x.defaultValue!=null?Mi($v(x.defaultValue),q):void 0;return{description:x.description,type:q,defaultValue:Se,deprecationReason:x.deprecationReason}}function qe(x){if(!x.args){const q=J(x);throw new Error(`Introspection result missing directive args: ${q}.`)}if(!x.locations){const q=J(x);throw new Error(`Introspection result missing directive locations: ${q}.`)}return new mi({name:x.name,description:x.description,isRepeatable:x.isRepeatable,locations:x.locations.slice(),args:H(x.args)})}}function A_(n){return b_(n,r=>!__(r),I_)}function I_(n){return!d_(n)&&!T_(n)}function b_(n,r,i){const o=n.getDirectives().filter(r),u=Object.values(n.getTypeMap()).filter(i);return[N_(n),...o.map(f=>U_(f)),...u.map(f=>R_(f))].filter(Boolean).join(`
|
|
164
164
|
|
|
165
|
-
`)}function
|
|
165
|
+
`)}function N_(n){if(n.description==null&&O_(n))return;const r=[],i=n.getQueryType();i&&r.push(` query: ${i.name}`);const o=n.getMutationType();o&&r.push(` mutation: ${o.name}`);const u=n.getSubscriptionType();return u&&r.push(` subscription: ${u.name}`),vt(n)+`schema {
|
|
166
166
|
${r.join(`
|
|
167
167
|
`)}
|
|
168
|
-
}`}function
|
|
168
|
+
}`}function O_(n){const r=n.getQueryType();if(r&&r.name!=="Query")return!1;const i=n.getMutationType();if(i&&i.name!=="Mutation")return!1;const o=n.getSubscriptionType();return!(o&&o.name!=="Subscription")}function R_(n){if(gi(n))return C_(n);if(Xt(n))return L_(n);if(gt(n))return F_(n);if(_n(n))return D_(n);if(xn(n))return P_(n);if(Tn(n))return k_(n);ji(!1,"Unexpected type: "+J(n))}function C_(n){return vt(n)+`scalar ${n.name}`+M_(n)}function Sl(n){const r=n.getInterfaces();return r.length?" implements "+r.map(i=>i.name).join(" & "):""}function L_(n){return vt(n)+`type ${n.name}`+Sl(n)+Al(n)}function F_(n){return vt(n)+`interface ${n.name}`+Sl(n)+Al(n)}function D_(n){const r=n.getTypes(),i=r.length?" = "+r.join(" | "):"";return vt(n)+"union "+n.name+i}function P_(n){const r=n.getValues().map((i,o)=>vt(i," ",!o)+" "+i.name+Ua(i.deprecationReason));return vt(n)+`enum ${n.name}`+ka(r)}function k_(n){const r=Object.values(n.getFields()).map((i,o)=>vt(i," ",!o)+" "+Ca(i));return vt(n)+`input ${n.name}`+ka(r)}function Al(n){const r=Object.values(n.getFields()).map((i,o)=>vt(i," ",!o)+" "+i.name+Il(i.args," ")+": "+String(i.type)+Ua(i.deprecationReason));return ka(r)}function ka(n){return n.length!==0?` {
|
|
169
169
|
`+n.join(`
|
|
170
170
|
`)+`
|
|
171
171
|
}`:""}function Il(n,r=""){return n.length===0?"":n.every(i=>!i.description)?"("+n.map(Ca).join(", ")+")":`(
|
|
172
172
|
`+n.map((i,o)=>vt(i," "+r,!o)+" "+r+Ca(i)).join(`
|
|
173
173
|
`)+`
|
|
174
|
-
`+r+")"}function Ca(n){const r=ci(n.defaultValue,n.type);let i=n.name+": "+String(n.type);return r&&(i+=` = ${yt(r)}`),i+Ua(n.deprecationReason)}function
|
|
174
|
+
`+r+")"}function Ca(n){const r=ci(n.defaultValue,n.type);let i=n.name+": "+String(n.type);return r&&(i+=` = ${yt(r)}`),i+Ua(n.deprecationReason)}function U_(n){return vt(n)+"directive @"+n.name+Il(n.args)+(n.isRepeatable?" repeatable":"")+" on "+n.locations.join(" | ")}function Ua(n){return n==null?"":n!==ml?` @deprecated(reason: ${yt({kind:N.STRING,value:n})})`:" @deprecated"}function M_(n){return n.specifiedByURL==null?"":` @specifiedBy(url: ${yt({kind:N.STRING,value:n.specifiedByURL})})`}function vt(n,r="",i=!0){const{description:o}=n;if(o==null)return"";const u=yt({kind:N.STRING,value:o,block:_v(o)});return(r&&!i?`
|
|
175
175
|
`+r:r)+u.replace(/\n/g,`
|
|
176
176
|
`+r)+`
|
|
177
|
-
`}class
|
|
177
|
+
`}class Zt{constructor(r){const{disableInterceptors:i=!1}=r||{};this.configService=new je,this.client=Mr.default.create(),this.client.interceptors.request.use(async o=>{const u=await this.configService.getConfig();return o.baseURL=u.apiUrl,u.apiKey&&(o.headers.Authorization=`Bearer ${u.apiKey}`),o}),!i&&this.client.interceptors.response.use(o=>o,o=>{throw o.response?.status===401?console.error(R.default.red("Authentication failed. Please run `twenty auth:login` first.")):o.response?.status===403?console.error(R.default.red("Access denied. Check your API key and workspace permissions.")):o.code==="ECONNREFUSED"&&console.error(R.default.red("Cannot connect to Twenty server. Is it running?")),o})}async validateAuth(){try{const i=await this.client.post("/metadata",{query:`
|
|
178
178
|
query CurrentWorkspace {
|
|
179
179
|
currentWorkspace {
|
|
180
180
|
id
|
|
@@ -199,7 +199,7 @@ ${r.join(`
|
|
|
199
199
|
mutation UninstallApplication($universalIdentifier: String!) {
|
|
200
200
|
uninstallApplication(universalIdentifier: $universalIdentifier)
|
|
201
201
|
}
|
|
202
|
-
`,o={universalIdentifier:r},u=await this.client.post("/metadata",{query:i,variables:o},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return u.data.errors?{success:!1,error:u.data.errors[0]?.message||"Failed to delete application"}:{success:!0,data:u.data.data.uninstallApplication,message:"Successfully uninstalled application"}}catch(i){if(Mr.default.isAxiosError(i)&&i.response)return{success:!1,error:i.response.data?.errors?.[0]?.message||i.message};throw i}}async getSchema(){try{const r=
|
|
202
|
+
`,o={universalIdentifier:r},u=await this.client.post("/metadata",{query:i,variables:o},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return u.data.errors?{success:!1,error:u.data.errors[0]?.message||"Failed to delete application"}:{success:!0,data:u.data.data.uninstallApplication,message:"Successfully uninstalled application"}}catch(i){if(Mr.default.isAxiosError(i)&&i.response)return{success:!1,error:i.response.data?.errors?.[0]?.message||i.message};throw i}}async getSchema(){try{const r=E_(),i=await this.client.post("/graphql",{query:r},{headers:{"Content-Type":"application/json",Accept:"*/*"}});if(i.data.errors)return{success:!1,error:`GraphQL introspection errors: ${JSON.stringify(i.data.errors)}`};const o=S_(i.data.data);return{success:!0,data:A_(o),message:"Successfully load schema"}}catch(r){if(Mr.default.isAxiosError(r)&&r.response)return{success:!1,error:r.response.data.errors[0]?.message||"Failed to load graphql Schema"};throw r}}async findLogicFunctions(){try{const i=await this.client.post("/metadata",{query:`
|
|
203
203
|
query FindManyLogicFunctions {
|
|
204
204
|
findManyLogicFunctions {
|
|
205
205
|
id
|
|
@@ -229,17 +229,17 @@ ${r.join(`
|
|
|
229
229
|
uploadApplicationFile(file: $file, applicationUniversalIdentifier: $applicationUniversalIdentifier, fileFolder: $fileFolder, filePath: $filePath)
|
|
230
230
|
{ path }
|
|
231
231
|
}
|
|
232
|
-
`,O=jy(o),D=JSON.stringify({query:b,variables:{file:null,applicationUniversalIdentifier:u,filePath:i,fileFolder:O}}),P=JSON.stringify({0:["variables.file"]}),M=new FormData;M.append("operations",D),M.append("map",P),M.append("0",new Blob([new Uint8Array(v)],{type:w}),g);const $=await this.client.post("/graphql",M);return $.data.errors?{success:!1,error:$.data.errors[0]?.message||"Failed to upload file"}:{success:!0,data:$.data.data.uploadApplicationFile,message:`Successfully uploaded ${g}`}}catch(f){return Mr.default.isAxiosError(f)&&f.response?{success:!1,error:f.response.data?.errors?.[0]?.message||f.message}:{success:!1,error:f}}}getMimeType(r){const i=we.extname(r).toLowerCase();return{".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".bmp":"image/bmp",".ico":"image/x-icon",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".txt":"text/plain",".csv":"text/csv",".json":"application/json",".xml":"application/xml",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".mp3":"audio/mpeg",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".js":"application/javascript",".ts":"application/typescript",".jsx":"application/javascript",".tsx":"application/typescript",".html":"text/html",".css":"text/css"}[i]||"application/octet-stream"}}class B_{constructor(r){this.apiService=new Kt,this.applicationUniversalIdentifier=r.applicationUniversalIdentifier,this.appPath=r.appPath}async uploadFile({builtPath:r,fileFolder:i}){const o=ge.relative(vn,r);return await this.apiService.uploadFile({filePath:we.default.join(this.appPath,r),builtHandlerPath:o,fileFolder:i,applicationUniversalIdentifier:this.applicationUniversalIdentifier})}}var bl=(n=>(n.DefineApplication="defineApplication",n.DefineField="defineField",n.DefineLogicFunction="defineLogicFunction",n.DefineObject="defineObject",n.DefineRole="defineRole",n.DefineFrontComponent="defineFrontComponent",n))(bl||{}),hn=(n=>(n.Application="application",n.Fields="fields",n.LogicFunctions="logicFunctions",n.Objects="objects",n.Roles="roles",n.FrontComponents="frontComponents",n.PublicAssets="publicAssets",n))(hn||{});const j_={defineApplication:"application",defineField:"fields",defineLogicFunction:"logicFunctions",defineObject:"objects",defineRole:"roles",defineFrontComponent:"frontComponents"},W_=n=>{if(!ui.isCallExpression(n))return;const r=n.expression;if(ui.isIdentifier(r)&&Object.values(bl).includes(r.text))return r.text},G_=n=>{const r=ui.createSourceFile("temp.ts",n,ui.ScriptTarget.Latest,!0),i=[];ui.forEachChild(r,o=>{i.push(o)});for(const o of i)if(ui.isExportAssignment(o)){if(o.isExportEquals||!o.expression)return;const u=W_(o.expression);if(u)return u}},oi=async({filePath:n,appPath:r})=>{const i=await V_({filePath:n,appPath:r});return q_(i,n)},V_=async({filePath:n,appPath:r})=>{const i=we.default.join(r,"tsconfig.json"),o=await de.pathExists(i),u=Ry.createRequire(we.default.join(r,"package.json"));let f,g;try{f=we.default.dirname(u.resolve("react/package.json")),g=we.default.dirname(u.resolve("react-dom/package.json"))}catch{}const w=(await Mc.build({entryPoints:[n],bundle:!0,write:!1,format:"cjs",platform:"node",target:"node18",jsx:"automatic",tsconfig:o?i:void 0,alias:{...f&&{react:f},...g&&{"react-dom":g}},logLevel:"silent"})).outputFiles[0].text,b=await de.mkdtemp(we.default.join(Bc.default.tmpdir(),"twenty-manifest-")),O=we.default.join(b,"module.cjs");try{return await de.writeFile(O,w),require(O)}finally{await de.remove(b)}},q_=(n,r)=>{if(B.Tr(n.default)&&Wy(n.default))return n.default;throw new Error(`Config file ${r} must export a config object default export`)},J_=async n=>await Pc.glob(["**/*.ts","**/*.tsx"],{cwd:n,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**","**/.twenty/**"],onlyFiles:!0}),z_=async n=>await Pc.glob([`${La}/**/*`],{cwd:n,onlyFiles:!0}),Q_=async(n,r)=>{const i={};for(const o of r){const f=ge.relative(n,o).split(ge.sep),g=await de.readFile(o,"utf8");let v=i;for(let w=0;w<f.length;w++){const b=f[w];w===f.length-1?v[b]=g:(v[b]=v[b]??{},v=v[b])}}return i},Yr=async n=>{const r=await J_(n),i=[];let o;const u=[],f=[],g=[],v=[],w=[],b=[],O=[],D=[],P=[],M=[],$=[],he=[],ae=[];for(const L of r){const ee=await Fc.readFile(L,"utf-8"),H=ge.relative(n,L),ce=G_(ee);if(!ce)continue;switch(j_[ce]){case hn.Application:{const x=await oi({appPath:n,filePath:L});o={...x.config,yarnLockChecksum:null,packageJsonChecksum:null},i.push(...x.errors),O.push(H);break}case hn.Objects:{const x=await oi({appPath:n,filePath:L});u.push(x.config),i.push(...x.errors),D.push(H);break}case hn.Fields:{const x=await oi({appPath:n,filePath:L});f.push(x.config),i.push(...x.errors),P.push(H);break}case hn.Roles:{const x=await oi({appPath:n,filePath:L});g.push(x.config),i.push(...x.errors),M.push(H);break}case hn.LogicFunctions:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{handler:q,...Se}=x.config,xt=ge.relative(n,L),Zt={...Se,handlerName:"default.handler",sourceHandlerPath:xt,builtHandlerPath:xt.replace(/\.tsx?$/,".mjs"),builtHandlerChecksum:null};v.push(Zt),$.push(H);break}case hn.FrontComponents:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{component:q,...Se}=x.config,xt=ge.relative(n,L),Zt={...Se,componentName:q.name,sourceComponentPath:xt,builtComponentPath:xt.replace(/\.tsx?$/,".mjs"),builtComponentChecksum:null};w.push(Zt),he.push(H);break}case hn.PublicAssets:break;default:B.ln()}}const me=await z_(n);for(const L of me)b.push({filePath:L,fileName:ge.basename(L),fileType:ge.extname(L).replace(/^\./,""),checksum:null}),ae.push(ge.relative(n,L));return o||i.push("Cannot build application, please export default defineApplication() to define an application"),{manifest:o?{application:o,objects:u,fields:f,roles:g,logicFunctions:v,frontComponents:w,publicAssets:b,sources:await Q_(n,r)}:null,filePaths:{application:O,objects:D,fields:P,roles:M,logicFunctions:$,frontComponents:he,publicAssets:ae},errors:i}},H_=n=>{const r=new Set,i=new Set;for(const o of n)r.has(o)?i.add(o):r.add(o);return Array.from(i)},Nl=n=>{const r=[];if(!n)return[];for(const[i,o]of Object.entries(n))i==="universalIdentifier"&&typeof o=="string"&&r.push(o),typeof o=="object"&&r.push(...Nl(o));return r},Y_=n=>{const r=[],i=[],o=H_(Nl(n));return o.length>0&&r.push(`Duplicate universal identifiers: ${o.join(", ")}`),B.Zo(n.objects)||i.push("No object defined"),B.Zo(n.logicFunctions)||i.push("No logic function defined"),B.Zo(n.frontComponents)||i.push("No front component defined"),{errors:r,warnings:i,isValid:r.length===0}};class X_{constructor(r){this.builtFileInfos=new Map,this.fileUploader=null,this.apiService=new Kt({disableInterceptors:!0}),this.activeUploads=new Set,this.syncTimer=null,this.isSyncing=!1,this.serverReady=!1,this.serverErrorLogged=!1,this.appPath=r.appPath,this.debounceMs=r.debounceMs??200,this.handleManifestBuilt=r.handleManifestBuilt,this.uiStateManager=r.uiStateManager}async checkServer(){const r=await this.apiService.validateAuth();if(!r.serverUp){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Cannot reach server",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Cannot connect to Twenty server. Is it running?"}),this.serverErrorLogged=!0);return}if(!r.authValid){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Authentication failed",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:'Cannot authenticate. Check your credentials are correct with "yarn auth:login"'}),this.serverErrorLogged=!0);return}this.serverErrorLogged=!1,this.serverReady=!0}async handleChangeDetected(r,i){this.serverReady||await this.checkServer(),this.serverReady&&(this.uiStateManager.addEvent({message:`Change detected: ${r}`,status:"info"}),i==="unlink"?this.uiStateManager.removeEntity(r):this.uiStateManager.updateFileStatus(r,"building"),this.scheduleSync())}handleFileBuildError(r){this.uiStateManager.addEvent({message:"Build failed:",status:"error"});for(const i of r)this.uiStateManager.addEvent({message:i.error,status:"error"})}handleFileBuilt({fileFolder:r,builtPath:i,sourcePath:o,checksum:u}){this.uiStateManager.addEvent({message:`Successfully built ${i}`,status:"success"}),this.builtFileInfos.set(i,{checksum:u,builtPath:i,sourcePath:o,fileFolder:r}),this.fileUploader&&this.uploadFile(i,o,r),this.scheduleSync()}uploadFile(r,i,o){this.uiStateManager.addEvent({message:`Uploading ${r}`,status:"info"}),this.uiStateManager.updateFileStatus(i,"uploading");const u=this.fileUploader.uploadFile({builtPath:r,fileFolder:o}).then(f=>{f.success?(this.uiStateManager.addEvent({message:`Successfully uploaded ${r}`,status:"success"}),this.uiStateManager.updateFileStatus(i,"success")):this.uiStateManager.addEvent({message:`Failed to upload ${r}: ${f.error}`,status:"error"})}).catch(f=>{this.uiStateManager.addEvent({message:`Upload failed for ${r}: ${f}`,status:"error"})}).finally(()=>{this.activeUploads.delete(u)});this.activeUploads.add(u)}cancelPendingSync(){this.syncTimer&&(clearTimeout(this.syncTimer),this.syncTimer=null)}scheduleSync(){this.cancelPendingSync(),this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.performSync()},this.debounceMs)}async performSync(){if(!this.isSyncing){this.isSyncing=!0;try{this.uiStateManager.addEvent({message:"Building manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"building"});const r=await Yr(this.appPath);if(r.errors.length>0||!r.manifest){for(const f of r.errors)this.uiStateManager.addEvent({message:f,status:"error"});this.uiStateManager.updateManifestState({manifestStatus:"error",error:r.errors[r.errors.length-1]});return}const i=Y_(r.manifest);if(!i.isValid){for(const f of i.errors)this.uiStateManager.addEvent({message:f,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:f});return}if(this.uiStateManager.updateManifestState({appName:r.manifest.application.displayName}),this.uiStateManager.updateAllFilesTypes({manifestFilePaths:r.filePaths}),i.warnings.length>0)for(const f of i.warnings)this.uiStateManager.addEvent({message:`⚠ ${f}`,status:"warning"});if(this.uiStateManager.addEvent({message:"Successfully built manifest",status:"success"}),await this.handleManifestBuilt(r),!this.fileUploader){const f=await this.apiService.checkApplicationExist(r.manifest.application.universalIdentifier);if(!f.success){this.uiStateManager.addEvent({message:`Failed to check if application ${r.manifest.application.universalIdentifier} already exists`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Failed to check if application already exists"});return}if(!f.data){this.uiStateManager.addEvent({message:"Creating application",status:"info"});const v=await this.apiService.createApplication(r.manifest);if(v.success)this.uiStateManager.addEvent({message:"Application created",status:"success"});else{this.uiStateManager.addEvent({message:`Application creation failed with error ${JSON.stringify(v.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:`Application creation failed with error ${JSON.stringify(v.error,null,2)}`});return}}this.fileUploader=new B_({appPath:this.appPath,applicationUniversalIdentifier:r.manifest.application.universalIdentifier});for(const[v,{fileFolder:w,sourcePath:b}]of this.builtFileInfos.entries())this.uploadFile(v,b,w)}for(;this.activeUploads.size>0;)await Promise.all(this.activeUploads);const o=fv({manifest:r.manifest,builtFileInfos:this.builtFileInfos});this.uiStateManager.addEvent({message:"Manifest checksums set",status:"info"}),await pv(this.appPath,o),this.uiStateManager.addEvent({message:"Manifest saved to output directory",status:"info"}),this.uiStateManager.addEvent({message:"Syncing manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"syncing"});const u=await this.apiService.syncApplication(o);this.uiStateManager.updateAllFilesStatus("success"),u.success?(this.uiStateManager.addEvent({message:"✓ Synced",status:"success"}),this.uiStateManager.updateManifestState({manifestStatus:"synced"})):(this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(u.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"}))}catch(r){this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(r,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"})}finally{this.isSyncing=!1}}}}const K_={pending:["building","uploading","success"],building:["pending","uploading","success"],uploading:["pending","success"],success:["pending","building","uploading"]};class Z_{constructor({appPath:r,frontendUrl:i}){this.eventIdCounter=0,this.listeners=new Set,this.state={appPath:r,frontendUrl:i,appName:null,appDescription:null,appUniversalIdentifier:null,manifestStatus:"idle",entities:new Map,events:[]}}getSnapshot(){return this.state}subscribe(r){return this.listeners.add(r),r(this.getSnapshot()),()=>this.listeners.delete(r)}notify(){for(const r of this.listeners)r(this.state)}addEvent({message:r,status:i="info"}){const o={id:++this.eventIdCounter,timestamp:new Date,message:r.slice(0,5e3),status:i};this.state={...this.state,events:[...this.state.events.slice(-201),o]},this.notify()}updateManifestState({manifestStatus:r,appName:i,error:o}){this.state={...this.state,...r?{manifestStatus:r}:{},...i?{appName:i}:{},...o?{error:o.slice(0,5e3)}:{error:void 0}},this.notify()}convertEntityTypeToSyncableEntity(r){switch(r){case"objects":return De.Object;case"fields":return De.Field;case"logicFunctions":return De.LogicFunction;case"frontComponents":return De.FrontComponent;case"roles":return De.Role;default:return}}updateAllFilesTypes({manifestFilePaths:r}){const i=new Map;Object.entries(r).forEach(([u,f])=>{f.forEach(g=>{const v=this.convertEntityTypeToSyncableEntity(u);v&&i.set(g,v)})});const o=new Map(this.state.entities);for(const[u,f]of o)o.set(u,{...f,type:i.get(u)});this.state={...this.state,entities:o},this.notify()}updateAllFilesStatus(r){const i=new Map(this.state.entities);for(const[o,u]of i)i.set(o,{...u,status:r});this.state={...this.state,entities:i},this.notify()}removeEntity(r){const i=new Map(this.state.entities);i.delete(r),this.state={...this.state,entities:i}}updateFileStatus(r,i){const o=new Map(this.state.entities),u=o.get(r);u?.status&&!K_[u.status].find(f=>f===i)||(o.set(r,u?{...u,status:i}:{name:r,path:r,status:i}),this.state={...this.state,entities:o},this.notify())}}const Sa=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],Oc=["↑","⇡","↟","⤒"],Wr={pending:"○",success:"✓"},ki={pending:"gray",building:"yellow",uploading:"cyan",success:"green"},Ol={[De.Object]:"Objects",[De.Field]:"Fields",[De.LogicFunction]:"Logic functions",[De.FrontComponent]:"Front components",[De.Role]:"Roles"},Rl=Object.keys(Ol),ex={info:"gray",success:"green",error:"red",warning:"yellow"},tx=n=>{const r=new Map;for(const i of Rl)r.set(i,[]);for(const i of n.values()){if(!i.type)continue;const o=r.get(i.type)??[];o.push(i),r.set(i.type,o)}return r},nx=n=>n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),ix=(n,r=40)=>{if(n.length<=r)return n;const i=n.split("/");return i.length<=2?n:`.../${i.slice(-2).join("/")}`},rx=n=>!n.frontendUrl||!n.appUniversalIdentifier?null:`${n.frontendUrl}/settings/applications`,sx=async n=>{const[r,i]=await Promise.all([import("react"),import("ink")]),{useState:o,useEffect:u}=r,{render:f,Box:g,Text:v,Static:w}=i,b=(L,ee=80)=>{const[H,ce]=o(0);return u(()=>{const qe=setInterval(()=>{ce(x=>(x+1)%L.length)},ee);return()=>clearInterval(qe)},[L.length,ee]),L[H]},O=({event:L})=>{const ee=ex[L.status],H=nx(L.timestamp);return B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[H," "]}),B.jsxRuntimeExports.jsx(v,{color:ee,children:L.message})]})},D=({status:L})=>{const ee=b(Sa,200),H=b(Oc,200),ce={building:ee,uploading:H,pending:Wr.pending,success:Wr.success};return B.jsxRuntimeExports.jsxs(v,{color:ki[L],children:[ce[L]," "]})},P=({entity:L})=>B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(D,{status:L.status}),B.jsxRuntimeExports.jsx(v,{children:L.name}),L.path!==L.name&&B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[" (",ix(L.path),")"]})]}),M=({type:L,entities:ee})=>ee.length===0?null:B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",marginTop:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,dimColor:!0,children:Ol[L]}),ee.map(H=>B.jsxRuntimeExports.jsx(P,{entity:H},H.path))]}),$={synced:{color:"green",icon:"✓",text:"Synced"},building:{color:"yellow",icon:"spinner",text:"Building..."},syncing:{color:"yellow",icon:"spinner",text:"Syncing..."},error:{color:"red",icon:null,text:"Error"},idle:{color:"gray",icon:null,text:"Idle"}},he=({snapshot:L})=>{const ee=b(Sa,80),H=$[L.manifestStatus],ce=H.icon==="spinner"?ee:H.icon;return B.jsxRuntimeExports.jsxs(v,{color:H.color,children:[ce?`${ce} `:"",H.text,L.error&&`: ${L.error}`]})},ae=({snapshot:L})=>{const ee=tx(L.entities),H=rx(L);return B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",borderStyle:"classic",borderColor:"gray",paddingX:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,color:"cyan",children:"Application"}),B.jsxRuntimeExports.jsxs(g,{marginLeft:2,flexDirection:"column",children:[B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Name: "}),B.jsxRuntimeExports.jsx(v,{bold:!0,children:L.appName??"Loading..."})]}),L.appDescription&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Description: "}),B.jsxRuntimeExports.jsx(v,{children:L.appDescription})]}),B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Status: "}),B.jsxRuntimeExports.jsx(he,{snapshot:L})]}),H&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Open:"}),B.jsxRuntimeExports.jsxs(v,{bold:!0,color:"cyan",children:[" ",H]})]})]}),B.jsxRuntimeExports.jsx(g,{marginLeft:2,flexDirection:"column",children:Rl.map(ce=>{const qe=ee.get(ce)??[];return B.jsxRuntimeExports.jsx(M,{type:ce,entities:qe},ce)})})]})},me=()=>B.jsxRuntimeExports.jsx(g,{marginTop:1,children:B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[B.jsxRuntimeExports.jsx(v,{color:ki.pending,children:Wr.pending})," ","pending ",B.jsxRuntimeExports.jsx(v,{color:ki.building,children:Sa[0]})," ","building ",B.jsxRuntimeExports.jsx(v,{color:ki.uploading,children:Oc[0]})," ","uploading"," ",B.jsxRuntimeExports.jsx(v,{color:ki.success,children:Wr.success})," ","success"]})}),Ye=()=>{const[L,ee]=o(n.getSnapshot());return u(()=>n.subscribe(ee),[]),B.jsxRuntimeExports.jsxs(B.jsxRuntimeExports.Fragment,{children:[B.jsxRuntimeExports.jsx(w,{items:L.events,children:H=>B.jsxRuntimeExports.jsx(O,{event:H},H.id)}),B.jsxRuntimeExports.jsxs(g,{marginTop:1,flexDirection:"column",children:[B.jsxRuntimeExports.jsx(ae,{snapshot:L}),B.jsxRuntimeExports.jsx(me,{})]})]})},{unmount:xe}=f(B.jsxRuntimeExports.jsx(Ye,{}));return{unmount:xe}};class Rc{constructor(r){this.watcher=null,this.appPath=r.appPath,this.fileFolder=r.fileFolder,this.watchPaths=r.watchPaths,this.handleFileBuilt=r.handleFileBuilt}async start(){const r=this.watchPaths.map(i=>ge.join(this.appPath,i));for(const i of r)if(!await de.pathExists(i))return;this.watcher=$c.default.watch(r,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",(i,o)=>{i!=="addDir"&&((i==="add"||i==="change")&&this.copyAndNotify(o),i==="unlink"&&this.handleUnlink(o))})}async close(){await this.watcher?.close()}async copyAndNotify(r){const i=ge.relative(this.appPath,r),o=ge.join(vn,i),u=ge.join(this.appPath,o);await de.ensureDir(ge.dirname(u)),await de.copy(r,u);const f=await de.readFile(u),g=Uc.default.createHash("md5").update(f).digest("hex");this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:o,sourcePath:i,checksum:g})}async handleUnlink(r){const i=ge.relative(this.appPath,r),o=ge.join(vn,i),u=ge.join(this.appPath,o);await de.remove(u)}}class ax{constructor(){this.appPath="",this.orchestrator=null,this.manifestWatcher=null,this.logicFunctionsWatcher=null,this.frontComponentsWatcher=null,this.assetWatcher=null,this.dependencyWatcher=null,this.watchersStarted=!1,this.uiStateManager=null,this.unmountUI=null}async execute(r){this.appPath=r.appPath??Ht,await this.cleanOutputDir(),this.uiStateManager=new Z_({appPath:this.appPath,frontendUrl:process.env.FRONTEND_URL});const{unmount:i}=await sx(this.uiStateManager);this.unmountUI=i,this.orchestrator=new X_({appPath:this.appPath,handleManifestBuilt:this.handleWatcherRestarts.bind(this),uiStateManager:this.uiStateManager}),await this.startManifestWatcher(),this.setupGracefulShutdown()}async cleanOutputDir(){const r=we.default.join(this.appPath,vn);await de.ensureDir(r),await de.emptyDir(r)}async startManifestWatcher(){this.manifestWatcher=new lv({appPath:this.appPath,handleChangeDetected:this.orchestrator.handleChangeDetected.bind(this.orchestrator)}),await this.manifestWatcher.start()}async handleWatcherRestarts(r){const{logicFunctions:i,frontComponents:o}=r.filePaths;if(!this.watchersStarted){this.watchersStarted=!0,await this.startFileWatchers(i,o);return}this.logicFunctionsWatcher?.shouldRestart(i)&&await this.logicFunctionsWatcher.restart(i),this.frontComponentsWatcher?.shouldRestart(o)&&await this.frontComponentsWatcher.restart(o)}async startFileWatchers(r,i){await Promise.all([this.startLogicFunctionsWatcher(r),this.startFrontComponentsWatcher(i),this.startAssetWatcher(),this.startDependencyWatcher()])}async startLogicFunctionsWatcher(r){this.logicFunctionsWatcher=uv({appPath:this.appPath,sourcePaths:r,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.logicFunctionsWatcher.start()}async startFrontComponentsWatcher(r){this.frontComponentsWatcher=cv({appPath:this.appPath,sourcePaths:r,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.frontComponentsWatcher.start()}async startAssetWatcher(){this.assetWatcher=new Rc({appPath:this.appPath,fileFolder:gn.i.PublicAsset,watchPaths:[La],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new Rc({appPath:this.appPath,fileFolder:gn.i.Source,watchPaths:["package.json","yarn.lock"],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),this.dependencyWatcher.start()}setupGracefulShutdown(){const r=async()=>{this.unmountUI?.(),await Promise.all([this.manifestWatcher?.close(),this.logicFunctionsWatcher?.close(),this.frontComponentsWatcher?.close(),this.assetWatcher?.close(),this.dependencyWatcher?.close()]),process.exit(0)};process.on("SIGINT",()=>void r()),process.on("SIGTERM",()=>void r())}}const ox="generated";class ux{constructor(){this.configService=new je,this.apiService=new Kt}async generate(r){const i=ge.join(r,ox);console.log(R.default.blue("📦 Generating Twenty client...")),console.log(R.default.gray(`📁 Output Path: ${i}`)),console.log("");const o=await this.configService.getConfig(),u=o.apiUrl,f=o.apiKey;if(!u||!f){console.log(R.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(R.default.gray(`API URL: ${u}`)),console.log(R.default.gray(`Output: ${i}`));const g=await this.apiService.getSchema();if(!g.success)return;const{data:v}=g,w=ge.resolve(i);await Cy.generate({schema:v,output:w,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(w),console.log(R.default.green("✓ Client generated successfully!")),console.log(R.default.gray(`Generated files at: ${i}`))}async injectTwentyClient(r){const i=`
|
|
232
|
+
`,O=By(o),D=JSON.stringify({query:b,variables:{file:null,applicationUniversalIdentifier:u,filePath:i,fileFolder:O}}),P=JSON.stringify({0:["variables.file"]}),M=new FormData;M.append("operations",D),M.append("map",P),M.append("0",new Blob([new Uint8Array(v)],{type:w}),g);const $=await this.client.post("/graphql",M);return $.data.errors?{success:!1,error:$.data.errors[0]?.message||"Failed to upload file"}:{success:!0,data:$.data.data.uploadApplicationFile,message:`Successfully uploaded ${g}`}}catch(f){return Mr.default.isAxiosError(f)&&f.response?{success:!1,error:f.response.data?.errors?.[0]?.message||f.message}:{success:!1,error:f}}}getMimeType(r){const i=we.extname(r).toLowerCase();return{".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".bmp":"image/bmp",".ico":"image/x-icon",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".txt":"text/plain",".csv":"text/csv",".json":"application/json",".xml":"application/xml",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".mp3":"audio/mpeg",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".js":"application/javascript",".ts":"application/typescript",".jsx":"application/javascript",".tsx":"application/typescript",".html":"text/html",".css":"text/css"}[i]||"application/octet-stream"}}class $_{constructor(r){this.apiService=new Zt,this.applicationUniversalIdentifier=r.applicationUniversalIdentifier,this.appPath=r.appPath}async uploadFile({builtPath:r,fileFolder:i}){const o=ge.relative(vn,r);return await this.apiService.uploadFile({filePath:we.default.join(this.appPath,r),builtHandlerPath:o,fileFolder:i,applicationUniversalIdentifier:this.applicationUniversalIdentifier})}}var bl=(n=>(n.DefineApplication="defineApplication",n.DefineField="defineField",n.DefineLogicFunction="defineLogicFunction",n.DefineObject="defineObject",n.DefineRole="defineRole",n.DefineFrontComponent="defineFrontComponent",n))(bl||{}),gn=(n=>(n.Application="application",n.Fields="fields",n.LogicFunctions="logicFunctions",n.Objects="objects",n.Roles="roles",n.FrontComponents="frontComponents",n.PublicAssets="publicAssets",n))(gn||{});const B_={defineApplication:"application",defineField:"fields",defineLogicFunction:"logicFunctions",defineObject:"objects",defineRole:"roles",defineFrontComponent:"frontComponents"},j_=n=>{if(!ui.isCallExpression(n))return;const r=n.expression;if(ui.isIdentifier(r)&&Object.values(bl).includes(r.text))return r.text},W_=n=>{const r=ui.createSourceFile("temp.ts",n,ui.ScriptTarget.Latest,!0),i=[];ui.forEachChild(r,o=>{i.push(o)});for(const o of i)if(ui.isExportAssignment(o)){if(o.isExportEquals||!o.expression)return;const u=j_(o.expression);if(u)return u}},oi=async({filePath:n,appPath:r})=>{const i=await G_({filePath:n,appPath:r});return V_(i,n)},G_=async({filePath:n,appPath:r})=>{const i=we.default.join(r,"tsconfig.json"),o=await de.pathExists(i),u=Ry.createRequire(we.default.join(r,"package.json"));let f,g;try{f=we.default.dirname(u.resolve("react/package.json")),g=we.default.dirname(u.resolve("react-dom/package.json"))}catch{}const w=(await Mc.build({entryPoints:[n],bundle:!0,write:!1,format:"cjs",platform:"node",target:"node18",jsx:"automatic",tsconfig:o?i:void 0,alias:{...f&&{react:f},...g&&{"react-dom":g}},logLevel:"silent"})).outputFiles[0].text,b=await de.mkdtemp(we.default.join(Bc.default.tmpdir(),"twenty-manifest-")),O=we.default.join(b,"module.cjs");try{return await de.writeFile(O,w),require(O)}finally{await de.remove(b)}},V_=(n,r)=>{if(kt.Tr(n.default)&&jy(n.default))return n.default;throw new Error(`Config file ${r} must export a config object default export`)},q_=async n=>await Pc.glob(["**/*.ts","**/*.tsx"],{cwd:n,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**","**/.twenty/**"],onlyFiles:!0}),J_=async n=>await Pc.glob([`${La}/**/*`],{cwd:n,onlyFiles:!0}),z_=async(n,r)=>{const i={};for(const o of r){const f=ge.relative(n,o).split(ge.sep),g=await de.readFile(o,"utf8");let v=i;for(let w=0;w<f.length;w++){const b=f[w];w===f.length-1?v[b]=g:(v[b]=v[b]??{},v=v[b])}}return i},Yr=async n=>{const r=await q_(n),i=[];let o;const u=[],f=[],g=[],v=[],w=[],b=[],O=[],D=[],P=[],M=[],$=[],he=[],ae=[];for(const L of r){const ee=await Fc.readFile(L,"utf-8"),H=ge.relative(n,L),ce=W_(ee);if(!ce)continue;switch(B_[ce]){case gn.Application:{const x=await oi({appPath:n,filePath:L});o={...x.config,yarnLockChecksum:null,packageJsonChecksum:null},i.push(...x.errors),O.push(H);break}case gn.Objects:{const x=await oi({appPath:n,filePath:L});u.push(x.config),i.push(...x.errors),D.push(H);break}case gn.Fields:{const x=await oi({appPath:n,filePath:L});f.push(x.config),i.push(...x.errors),P.push(H);break}case gn.Roles:{const x=await oi({appPath:n,filePath:L});g.push(x.config),i.push(...x.errors),M.push(H);break}case gn.LogicFunctions:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{handler:q,...Se}=x.config,xt=ge.relative(n,L),en={...Se,handlerName:"default.handler",sourceHandlerPath:xt,builtHandlerPath:xt.replace(/\.tsx?$/,".mjs"),builtHandlerChecksum:null};v.push(en),$.push(H);break}case gn.FrontComponents:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{component:q,...Se}=x.config,xt=ge.relative(n,L),en={...Se,componentName:q.name,sourceComponentPath:xt,builtComponentPath:xt.replace(/\.tsx?$/,".mjs"),builtComponentChecksum:null};w.push(en),he.push(H);break}case gn.PublicAssets:break;default:kt.ln()}}const me=await J_(n);for(const L of me)b.push({filePath:L,fileName:ge.basename(L),fileType:ge.extname(L).replace(/^\./,""),checksum:null}),ae.push(ge.relative(n,L));return o||i.push("Cannot build application, please export default defineApplication() to define an application"),{manifest:o?{application:o,objects:u,fields:f,roles:g,logicFunctions:v,frontComponents:w,publicAssets:b,sources:await z_(n,r)}:null,filePaths:{application:O,objects:D,fields:P,roles:M,logicFunctions:$,frontComponents:he,publicAssets:ae},errors:i}},Q_=n=>{const r=new Set,i=new Set;for(const o of n)r.has(o)?i.add(o):r.add(o);return Array.from(i)},Nl=n=>{const r=[];if(!n)return[];for(const[i,o]of Object.entries(n))i==="universalIdentifier"&&typeof o=="string"&&r.push(o),typeof o=="object"&&r.push(...Nl(o));return r},H_=n=>{const r=[],i=[],o=Q_(Nl(n));return o.length>0&&r.push(`Duplicate universal identifiers: ${o.join(", ")}`),kt.Zo(n.objects)||i.push("No object defined"),kt.Zo(n.logicFunctions)||i.push("No logic function defined"),kt.Zo(n.frontComponents)||i.push("No front component defined"),{errors:r,warnings:i,isValid:r.length===0}};class Y_{constructor(r){this.builtFileInfos=new Map,this.fileUploader=null,this.apiService=new Zt({disableInterceptors:!0}),this.activeUploads=new Set,this.syncTimer=null,this.isSyncing=!1,this.serverReady=!1,this.serverErrorLogged=!1,this.appPath=r.appPath,this.debounceMs=r.debounceMs??200,this.handleManifestBuilt=r.handleManifestBuilt,this.uiStateManager=r.uiStateManager}async checkServer(){const r=await this.apiService.validateAuth();if(!r.serverUp){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Cannot reach server",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Cannot connect to Twenty server. Is it running?"}),this.serverErrorLogged=!0);return}if(!r.authValid){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Authentication failed",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:'Cannot authenticate. Check your credentials are correct with "yarn auth:login"'}),this.serverErrorLogged=!0);return}this.serverErrorLogged=!1,this.serverReady=!0}async handleChangeDetected(r,i){this.serverReady||await this.checkServer(),this.serverReady&&(this.uiStateManager.addEvent({message:`Change detected: ${r}`,status:"info"}),i==="unlink"?this.uiStateManager.removeEntity(r):this.uiStateManager.updateFileStatus(r,"building"),this.scheduleSync())}handleFileBuildError(r){this.uiStateManager.addEvent({message:"Build failed:",status:"error"});for(const i of r)this.uiStateManager.addEvent({message:i.error,status:"error"})}handleFileBuilt({fileFolder:r,builtPath:i,sourcePath:o,checksum:u}){this.uiStateManager.addEvent({message:`Successfully built ${i}`,status:"success"}),this.builtFileInfos.set(i,{checksum:u,builtPath:i,sourcePath:o,fileFolder:r}),this.fileUploader&&this.uploadFile(i,o,r),this.scheduleSync()}uploadFile(r,i,o){this.uiStateManager.addEvent({message:`Uploading ${r}`,status:"info"}),this.uiStateManager.updateFileStatus(i,"uploading");const u=this.fileUploader.uploadFile({builtPath:r,fileFolder:o}).then(f=>{f.success?(this.uiStateManager.addEvent({message:`Successfully uploaded ${r}`,status:"success"}),this.uiStateManager.updateFileStatus(i,"success")):this.uiStateManager.addEvent({message:`Failed to upload ${r}: ${f.error}`,status:"error"})}).catch(f=>{this.uiStateManager.addEvent({message:`Upload failed for ${r}: ${f}`,status:"error"})}).finally(()=>{this.activeUploads.delete(u)});this.activeUploads.add(u)}cancelPendingSync(){this.syncTimer&&(clearTimeout(this.syncTimer),this.syncTimer=null)}scheduleSync(){this.cancelPendingSync(),this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.performSync()},this.debounceMs)}async performSync(){if(!this.isSyncing){this.isSyncing=!0;try{this.uiStateManager.addEvent({message:"Building manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"building"});const r=await Yr(this.appPath);if(r.errors.length>0||!r.manifest){for(const f of r.errors)this.uiStateManager.addEvent({message:f,status:"error"});this.uiStateManager.updateManifestState({manifestStatus:"error",error:r.errors[r.errors.length-1]});return}const i=H_(r.manifest);if(!i.isValid){for(const f of i.errors)this.uiStateManager.addEvent({message:f,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:f});return}if(this.uiStateManager.updateManifestState({appName:r.manifest.application.displayName}),this.uiStateManager.updateAllFilesTypes({manifestFilePaths:r.filePaths}),i.warnings.length>0)for(const f of i.warnings)this.uiStateManager.addEvent({message:`⚠ ${f}`,status:"warning"});if(this.uiStateManager.addEvent({message:"Successfully built manifest",status:"success"}),await this.handleManifestBuilt(r),!this.fileUploader){const f=await this.apiService.checkApplicationExist(r.manifest.application.universalIdentifier);if(!f.success){this.uiStateManager.addEvent({message:`Failed to check if application ${r.manifest.application.universalIdentifier} already exists`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Failed to check if application already exists"});return}if(!f.data){this.uiStateManager.addEvent({message:"Creating application",status:"info"});const v=await this.apiService.createApplication(r.manifest);if(v.success)this.uiStateManager.addEvent({message:"Application created",status:"success"});else{this.uiStateManager.addEvent({message:`Application creation failed with error ${JSON.stringify(v.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:`Application creation failed with error ${JSON.stringify(v.error,null,2)}`});return}}this.fileUploader=new $_({appPath:this.appPath,applicationUniversalIdentifier:r.manifest.application.universalIdentifier});for(const[v,{fileFolder:w,sourcePath:b}]of this.builtFileInfos.entries())this.uploadFile(v,b,w)}for(;this.activeUploads.size>0;)await Promise.all(this.activeUploads);const o=lv({manifest:r.manifest,builtFileInfos:this.builtFileInfos});this.uiStateManager.addEvent({message:"Manifest checksums set",status:"info"}),await fv(this.appPath,o),this.uiStateManager.addEvent({message:"Manifest saved to output directory",status:"info"}),this.uiStateManager.addEvent({message:"Syncing manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"syncing"});const u=await this.apiService.syncApplication(o);this.uiStateManager.updateAllFilesStatus("success"),u.success?(this.uiStateManager.addEvent({message:"✓ Synced",status:"success"}),this.uiStateManager.updateManifestState({manifestStatus:"synced"})):(this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(u.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"}))}catch(r){this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(r,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"})}finally{this.isSyncing=!1}}}}const X_={pending:["building","uploading","success"],building:["pending","uploading","success"],uploading:["pending","success"],success:["pending","building","uploading"]};class K_{constructor({appPath:r,frontendUrl:i}){this.eventIdCounter=0,this.listeners=new Set,this.state={appPath:r,frontendUrl:i,appName:null,appDescription:null,appUniversalIdentifier:null,manifestStatus:"idle",entities:new Map,events:[]}}getSnapshot(){return this.state}subscribe(r){return this.listeners.add(r),r(this.getSnapshot()),()=>this.listeners.delete(r)}notify(){for(const r of this.listeners)r(this.state)}addEvent({message:r,status:i="info"}){const o={id:++this.eventIdCounter,timestamp:new Date,message:r.slice(0,5e3),status:i};this.state={...this.state,events:[...this.state.events.slice(-201),o]},this.notify()}updateManifestState({manifestStatus:r,appName:i,error:o}){this.state={...this.state,...r?{manifestStatus:r}:{},...i?{appName:i}:{},...o?{error:o.slice(0,5e3)}:{error:void 0}},this.notify()}convertEntityTypeToSyncableEntity(r){switch(r){case"objects":return De.Object;case"fields":return De.Field;case"logicFunctions":return De.LogicFunction;case"frontComponents":return De.FrontComponent;case"roles":return De.Role;default:return}}updateAllFilesTypes({manifestFilePaths:r}){const i=new Map;Object.entries(r).forEach(([u,f])=>{f.forEach(g=>{const v=this.convertEntityTypeToSyncableEntity(u);v&&i.set(g,v)})});const o=new Map(this.state.entities);for(const[u,f]of o)o.set(u,{...f,type:i.get(u)});this.state={...this.state,entities:o},this.notify()}updateAllFilesStatus(r){const i=new Map(this.state.entities);for(const[o,u]of i)i.set(o,{...u,status:r});this.state={...this.state,entities:i},this.notify()}removeEntity(r){const i=new Map(this.state.entities);i.delete(r),this.state={...this.state,entities:i}}updateFileStatus(r,i){const o=new Map(this.state.entities),u=o.get(r);u?.status&&!X_[u.status].find(f=>f===i)||(o.set(r,u?{...u,status:i}:{name:r,path:r,status:i}),this.state={...this.state,entities:o},this.notify())}}const Sa=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],Oc=["↑","⇡","↟","⤒"],Wr={pending:"○",success:"✓"},ki={pending:"gray",building:"yellow",uploading:"cyan",success:"green"},Ol={[De.Object]:"Objects",[De.Field]:"Fields",[De.LogicFunction]:"Logic functions",[De.FrontComponent]:"Front components",[De.Role]:"Roles"},Rl=Object.keys(Ol),Z_={info:"gray",success:"green",error:"red",warning:"yellow"},ex=n=>{const r=new Map;for(const i of Rl)r.set(i,[]);for(const i of n.values()){if(!i.type)continue;const o=r.get(i.type)??[];o.push(i),r.set(i.type,o)}return r},tx=n=>n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),nx=(n,r=40)=>{if(n.length<=r)return n;const i=n.split("/");return i.length<=2?n:`.../${i.slice(-2).join("/")}`},ix=n=>!n.frontendUrl||!n.appUniversalIdentifier?null:`${n.frontendUrl}/settings/applications`,rx=async n=>{const[r,i]=await Promise.all([import("react"),import("ink")]),{useState:o,useEffect:u}=r,{render:f,Box:g,Text:v,Static:w}=i,b=(L,ee=80)=>{const[H,ce]=o(0);return u(()=>{const qe=setInterval(()=>{ce(x=>(x+1)%L.length)},ee);return()=>clearInterval(qe)},[L.length,ee]),L[H]},O=({event:L})=>{const ee=Z_[L.status],H=tx(L.timestamp);return B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[H," "]}),B.jsxRuntimeExports.jsx(v,{color:ee,children:L.message})]})},D=({status:L})=>{const ee=b(Sa,200),H=b(Oc,200),ce={building:ee,uploading:H,pending:Wr.pending,success:Wr.success};return B.jsxRuntimeExports.jsxs(v,{color:ki[L],children:[ce[L]," "]})},P=({entity:L})=>B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(D,{status:L.status}),B.jsxRuntimeExports.jsx(v,{children:L.name}),L.path!==L.name&&B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[" (",nx(L.path),")"]})]}),M=({type:L,entities:ee})=>ee.length===0?null:B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",marginTop:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,dimColor:!0,children:Ol[L]}),ee.map(H=>B.jsxRuntimeExports.jsx(P,{entity:H},H.path))]}),$={synced:{color:"green",icon:"✓",text:"Synced"},building:{color:"yellow",icon:"spinner",text:"Building..."},syncing:{color:"yellow",icon:"spinner",text:"Syncing..."},error:{color:"red",icon:null,text:"Error"},idle:{color:"gray",icon:null,text:"Idle"}},he=({snapshot:L})=>{const ee=b(Sa,80),H=$[L.manifestStatus],ce=H.icon==="spinner"?ee:H.icon;return B.jsxRuntimeExports.jsxs(v,{color:H.color,children:[ce?`${ce} `:"",H.text,L.error&&`: ${L.error}`]})},ae=({snapshot:L})=>{const ee=ex(L.entities),H=ix(L);return B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",borderStyle:"classic",borderColor:"gray",paddingX:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,color:"cyan",children:"Application"}),B.jsxRuntimeExports.jsxs(g,{marginLeft:2,flexDirection:"column",children:[B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Name: "}),B.jsxRuntimeExports.jsx(v,{bold:!0,children:L.appName??"Loading..."})]}),L.appDescription&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Description: "}),B.jsxRuntimeExports.jsx(v,{children:L.appDescription})]}),B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Status: "}),B.jsxRuntimeExports.jsx(he,{snapshot:L})]}),H&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Open:"}),B.jsxRuntimeExports.jsxs(v,{bold:!0,color:"cyan",children:[" ",H]})]})]}),B.jsxRuntimeExports.jsx(g,{marginLeft:2,flexDirection:"column",children:Rl.map(ce=>{const qe=ee.get(ce)??[];return B.jsxRuntimeExports.jsx(M,{type:ce,entities:qe},ce)})})]})},me=()=>B.jsxRuntimeExports.jsx(g,{marginTop:1,children:B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[B.jsxRuntimeExports.jsx(v,{color:ki.pending,children:Wr.pending})," ","pending ",B.jsxRuntimeExports.jsx(v,{color:ki.building,children:Sa[0]})," ","building ",B.jsxRuntimeExports.jsx(v,{color:ki.uploading,children:Oc[0]})," ","uploading"," ",B.jsxRuntimeExports.jsx(v,{color:ki.success,children:Wr.success})," ","success"]})}),Ye=()=>{const[L,ee]=o(n.getSnapshot());return u(()=>n.subscribe(ee),[]),B.jsxRuntimeExports.jsxs(B.jsxRuntimeExports.Fragment,{children:[B.jsxRuntimeExports.jsx(w,{items:L.events,children:H=>B.jsxRuntimeExports.jsx(O,{event:H},H.id)}),B.jsxRuntimeExports.jsxs(g,{marginTop:1,flexDirection:"column",children:[B.jsxRuntimeExports.jsx(ae,{snapshot:L}),B.jsxRuntimeExports.jsx(me,{})]})]})},{unmount:xe}=f(B.jsxRuntimeExports.jsx(Ye,{}));return{unmount:xe}};class Rc{constructor(r){this.watcher=null,this.appPath=r.appPath,this.fileFolder=r.fileFolder,this.watchPaths=r.watchPaths,this.handleFileBuilt=r.handleFileBuilt}async start(){const r=this.watchPaths.map(i=>ge.join(this.appPath,i));for(const i of r)if(!await de.pathExists(i))return;this.watcher=$c.default.watch(r,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",(i,o)=>{i!=="addDir"&&((i==="add"||i==="change")&&this.copyAndNotify(o),i==="unlink"&&this.handleUnlink(o))})}async close(){await this.watcher?.close()}async copyAndNotify(r){const i=ge.relative(this.appPath,r),o=ge.join(vn,i),u=ge.join(this.appPath,o);await de.ensureDir(ge.dirname(u)),await de.copy(r,u);const f=await de.readFile(u),g=Uc.default.createHash("md5").update(f).digest("hex");this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:o,sourcePath:i,checksum:g})}async handleUnlink(r){const i=ge.relative(this.appPath,r),o=ge.join(vn,i),u=ge.join(this.appPath,o);await de.remove(u)}}class sx{constructor(){this.appPath="",this.orchestrator=null,this.manifestWatcher=null,this.logicFunctionsWatcher=null,this.frontComponentsWatcher=null,this.assetWatcher=null,this.dependencyWatcher=null,this.watchersStarted=!1,this.uiStateManager=null,this.unmountUI=null}async execute(r){this.appPath=r.appPath??Yt,await this.cleanOutputDir(),this.uiStateManager=new K_({appPath:this.appPath,frontendUrl:process.env.FRONTEND_URL});const{unmount:i}=await rx(this.uiStateManager);this.unmountUI=i,this.orchestrator=new Y_({appPath:this.appPath,handleManifestBuilt:this.handleWatcherRestarts.bind(this),uiStateManager:this.uiStateManager}),await this.startManifestWatcher(),this.setupGracefulShutdown()}async cleanOutputDir(){const r=we.default.join(this.appPath,vn);await de.ensureDir(r),await de.emptyDir(r)}async startManifestWatcher(){this.manifestWatcher=new cv({appPath:this.appPath,handleChangeDetected:this.orchestrator.handleChangeDetected.bind(this.orchestrator)}),await this.manifestWatcher.start()}async handleWatcherRestarts(r){const{logicFunctions:i,frontComponents:o}=r.filePaths;if(!this.watchersStarted){this.watchersStarted=!0,await this.startFileWatchers(i,o);return}this.logicFunctionsWatcher?.shouldRestart(i)&&await this.logicFunctionsWatcher.restart(i),this.frontComponentsWatcher?.shouldRestart(o)&&await this.frontComponentsWatcher.restart(o)}async startFileWatchers(r,i){await Promise.all([this.startLogicFunctionsWatcher(r),this.startFrontComponentsWatcher(i),this.startAssetWatcher(),this.startDependencyWatcher()])}async startLogicFunctionsWatcher(r){this.logicFunctionsWatcher=ov({appPath:this.appPath,sourcePaths:r,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.logicFunctionsWatcher.start()}async startFrontComponentsWatcher(r){this.frontComponentsWatcher=uv({appPath:this.appPath,sourcePaths:r,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.frontComponentsWatcher.start()}async startAssetWatcher(){this.assetWatcher=new Rc({appPath:this.appPath,fileFolder:mn.i.PublicAsset,watchPaths:[La],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new Rc({appPath:this.appPath,fileFolder:mn.i.Source,watchPaths:["package.json","yarn.lock"],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),this.dependencyWatcher.start()}setupGracefulShutdown(){const r=async()=>{this.unmountUI?.(),await Promise.all([this.manifestWatcher?.close(),this.logicFunctionsWatcher?.close(),this.frontComponentsWatcher?.close(),this.assetWatcher?.close(),this.dependencyWatcher?.close()]),process.exit(0)};process.on("SIGINT",()=>void r()),process.on("SIGTERM",()=>void r())}}const ax="generated";class ox{constructor(){this.configService=new je,this.apiService=new Zt}async generate(r){const i=ge.join(r,ax);console.log(R.default.blue("📦 Generating Twenty client...")),console.log(R.default.gray(`📁 Output Path: ${i}`)),console.log("");const o=await this.configService.getConfig(),u=o.apiUrl,f=o.apiKey;if(!u||!f){console.log(R.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(R.default.gray(`API URL: ${u}`)),console.log(R.default.gray(`Output: ${i}`));const g=await this.apiService.getSchema();if(!g.success)return;const{data:v}=g,w=ge.resolve(i);await Cy.generate({schema:v,output:w,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(w),console.log(R.default.green("✓ Client generated successfully!")),console.log(R.default.gray(`Generated files at: ${i}`))}async injectTwentyClient(r){const i=`
|
|
233
233
|
|
|
234
234
|
// ----------------------------------------------------
|
|
235
235
|
// ✨ Custom Twenty client (auto-injected)
|
|
236
236
|
// ----------------------------------------------------
|
|
237
237
|
|
|
238
238
|
const defaultOptions: ClientOptions = {
|
|
239
|
-
url: \`\${process.env.${
|
|
239
|
+
url: \`\${process.env.${iv}}/graphql\`,
|
|
240
240
|
headers: {
|
|
241
241
|
'Content-Type': 'application/json',
|
|
242
|
-
Authorization: \`Bearer \${process.env.${
|
|
242
|
+
Authorization: \`Bearer \${process.env.${nv}}\`,
|
|
243
243
|
},
|
|
244
244
|
}
|
|
245
245
|
|
|
@@ -307,8 +307,8 @@ export default class Twenty {
|
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
`;await de.appendFile(ge.join(r,"index.ts"),i)}}class
|
|
311
|
-
`));for(const o of r){const u=await this.configService.getConfigForWorkspace(o),f=!!u.apiKey,v=o===i?R.default.green(" (default)"):"",w=f?R.default.green("●"):R.default.gray("○");console.log(` ${w} ${o}${v}`),console.log(R.default.gray(` API URL: ${u.apiUrl}`))}console.log(""),console.log(R.default.gray("● = authenticated, ○ = no credentials")),console.log(R.default.gray("Use `twenty auth:switch <workspace>` to change default"))}catch(r){console.error(R.default.red("List failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class px{constructor(){this.configService=new je,this.apiService=new Kt}async execute(r){try{let{apiKey:i,apiUrl:o}=r;const u=await this.configService.getConfig();if(o||(o=(await zt.default.prompt([{type:"input",name:"apiUrl",message:"Twenty API URL:",default:u.apiUrl,validate:v=>{try{return new URL(v),!0}catch{return"Please enter a valid URL"}}}])).apiUrl),i||(i=(await zt.default.prompt([{type:"password",name:"apiKey",message:"API Key:",mask:"*",validate:v=>v.length>0||"API key is required"}])).apiKey),await this.configService.setConfig({apiUrl:o,apiKey:i}),(await this.apiService.validateAuth()).authValid){const g=je.getActiveWorkspace();console.log(R.default.green(`✓ Successfully authenticated with Twenty (workspace: ${g})`))}else console.log(R.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(i){console.error(R.default.red("Login failed:"),i instanceof Error?i.message:i),process.exit(1)}}}class dx{constructor(){this.configService=new je}async execute(){try{await this.configService.clearConfig();const r=je.getActiveWorkspace();console.log(R.default.green(`✓ Successfully logged out (workspace: ${r})`))}catch(r){console.error(R.default.red("Logout failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class hx{constructor(){this.configService=new je,this.apiService=new Kt}async execute(){try{const r=je.getActiveWorkspace(),i=await this.configService.getConfig();if(console.log(R.default.blue("Authentication Status:")),console.log(`Workspace: ${r}`),console.log(`API URL: ${i.apiUrl}`),console.log(`API Key: ${i.apiKey?"***"+i.apiKey.slice(-4):"Not set"}`),i.apiKey){const o=await this.apiService.validateAuth();console.log(`Status: ${o.authValid?R.default.green("✓ Valid"):R.default.red("✗ Invalid")}`)}else console.log(`Status: ${R.default.yellow("⚠ Not authenticated")}`)}catch(r){console.error(R.default.red("Status check failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class gx{constructor(){this.apiService=new Kt}async execute({appPath:r=Ht,functionUniversalIdentifier:i,functionName:o,payload:u="{}"}){try{let f;try{f=JSON.parse(u)}catch{console.error(R.default.red("Invalid JSON payload. Please provide valid JSON.")),process.exit(1)}const{manifest:g}=await Yr(r);g||(console.error(R.default.red("Failed to build manifest.")),process.exit(1));const v=await this.apiService.findLogicFunctions();v.success||(console.error(R.default.red("Failed to fetch functions:"),v.error instanceof Error?v.error.message:v.error),process.exit(1));const w=v.data.filter(M=>M.universalIdentifier&&this.belongsToApplication(M,g)),b=w.find(M=>i?M.universalIdentifier===i:o?M.name===o:!1);if(!b){const M=i||o;console.error(R.default.red(`Function "${M}" not found in application.`)),console.log(""),w.length>0?(console.log(R.default.cyan("Available functions:")),w.forEach($=>{console.log(` - ${R.default.white($.name)} (${$.universalIdentifier})`)})):console.log(R.default.yellow("No functions found for this application. Have you synced your app with `yarn app:sync`?")),process.exit(1)}console.log(R.default.blue(`🚀 Executing function "${b.name}"...`)),console.log(R.default.gray(` Payload: ${JSON.stringify(f)}`)),console.log("");const O=await this.apiService.executeLogicFunction({functionId:b.id,payload:f});O.success||(console.error(R.default.red("Execution failed:"),O.error instanceof Error?O.error.message:O.error),process.exit(1));const D=O.data;console.log(R.default.cyan("─".repeat(60))),console.log(R.default.cyan("Execution Result")),console.log(R.default.cyan("─".repeat(60)));const P=D.status==="SUCCESS"?R.default.green:R.default.red;console.log(`${R.default.bold("Status:")} ${P(D.status)}`),console.log(`${R.default.bold("Duration:")} ${D.duration}ms`),B.Tr(D.data)&&(console.log(""),console.log(R.default.bold("Data:")),console.log(R.default.white(JSON.stringify(D.data,null,2)))),D.error&&(console.log(""),console.log(R.default.bold.red("Error:")),console.log(R.default.red(` Type: ${D.error.errorType}`)),console.log(R.default.red(` Message: ${D.error.errorMessage}`)),D.error.stackTrace&&(console.log(""),console.log(R.default.gray("Stack trace:")),console.log(R.default.gray(D.error.stackTrace)))),D.logs&&(console.log(""),console.log(R.default.bold("Logs:")),console.log(R.default.gray(D.logs))),console.log(R.default.cyan("─".repeat(60))),D.status!=="SUCCESS"&&process.exit(1)}catch(f){console.error(R.default.red("Execution failed:"),f instanceof Error?f.message:f),process.exit(1)}}belongsToApplication(r,i){return i.logicFunctions.some(o=>o.universalIdentifier===r.universalIdentifier)}}class mx{constructor(){this.apiService=new Kt}async execute({appPath:r=Ht,functionUniversalIdentifier:i,functionName:o}){try{const{manifest:u}=await Yr(r);u||process.exit(1),this.logWatchInfo({appName:u.application.displayName,functionUniversalIdentifier:i,functionName:o}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:u.application.universalIdentifier,functionUniversalIdentifier:i,functionName:o})}catch(u){console.error(R.default.red("Watch logs failed:"),u instanceof Error?u.message:u),process.exit(1)}}logWatchInfo({appName:r,functionUniversalIdentifier:i,functionName:o}){const u=r??"Twenty Application",f=i||o?`function "${i||o}"`:"functions";console.log(R.default.blue(`🚀 Watching ${u} ${f} logs:`)),console.log("")}}class yx{constructor(){this.configService=new je,this.apiService=new Kt}async execute(r){try{let{workspace:i}=r;const o=await this.configService.getAvailableWorkspaces(),u=await this.configService.getDefaultWorkspace();if(o.length===0){console.log(R.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}if(!i){const v=o.map(b=>({name:b===u?`${b} (current default)`:b,value:b}));i=(await zt.default.prompt([{type:"list",name:"workspace",message:"Select a workspace to set as default:",choices:v,default:u}])).workspace}if(o.includes(i)||(console.log(R.default.red(`✗ Workspace "${i}" not found. Available workspaces: ${o.join(", ")}`)),process.exit(1)),i===u){console.log(R.default.blue(`ℹ "${i}" is already the default workspace.`));return}await this.configService.setDefaultWorkspace(i),je.setActiveWorkspace(i);const g=!!(await this.configService.getConfig()).apiKey;console.log(R.default.green(`✓ Switched default workspace to "${i}"`)),g?(await this.apiService.validateAuth()).authValid?console.log(R.default.green("✓ Authentication is valid")):console.log(R.default.yellow("⚠ Authentication credentials exist but are invalid. Run `twenty auth:login` to re-authenticate.")):console.log(R.default.yellow("⚠ No credentials configured for this workspace. Run `twenty auth:login` to authenticate."))}catch(i){console.error(R.default.red("Switch failed:"),i instanceof Error?i.message:i),process.exit(1)}}}var Aa,Cc;function vx(){if(Cc)return Aa;Cc=1;var n="[object Symbol]",r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o="\\ud800-\\udfff",u="\\u0300-\\u036f\\ufe20-\\ufe23",f="\\u20d0-\\u20f0",g="\\u2700-\\u27bf",v="a-z\\xdf-\\xf6\\xf8-\\xff",w="\\xac\\xb1\\xd7\\xf7",b="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",O="\\u2000-\\u206f",D=" \\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",P="A-Z\\xc0-\\xd6\\xd8-\\xde",M="\\ufe0e\\ufe0f",$=w+b+O+D,he="['’]",ae="["+$+"]",me="["+u+f+"]",Ye="\\d+",xe="["+g+"]",L="["+v+"]",ee="[^"+o+$+Ye+g+v+P+"]",H="\\ud83c[\\udffb-\\udfff]",ce="(?:"+me+"|"+H+")",qe="[^"+o+"]",x="(?:\\ud83c[\\udde6-\\uddff]){2}",q="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="["+P+"]",xt="\\u200d",Zt="(?:"+L+"|"+ee+")",Vi="(?:"+Se+"|"+ee+")",qi="(?:"+he+"(?:d|ll|m|re|s|t|ve))?",Ji="(?:"+he+"(?:D|LL|M|RE|S|T|VE))?",Rt=ce+"?",Tt="["+M+"]?",Xr="(?:"+xt+"(?:"+[qe,x,q].join("|")+")"+Tt+Rt+")*",Wn=Tt+Rt+Xr,st="(?:"+[xe,x,q].join("|")+")"+Wn,Kr=RegExp(he,"g"),Zr=RegExp(me,"g"),es=RegExp([Se+"?"+L+"+"+qi+"(?="+[ae,Se,"$"].join("|")+")",Vi+"+"+Ji+"(?="+[ae,Se+Zt,"$"].join("|")+")",Se+"?"+Zt+"+"+qi,Se+"+"+Ji,Ye,st].join("|"),"g"),en=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gn={À:"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",ſ:"ss"},ts=typeof mn=="object"&&mn&&mn.Object===Object&&mn,Sn=typeof self=="object"&&self&&self.Object===Object&&self,An=ts||Sn||Function("return this")();function ns(W,Ce,Ct,Hi){for(var On=-1,_i=W?W.length:0;++On<_i;)Ct=Ce(Ct,W[On],On,W);return Ct}function Vn(W){return W.match(r)||[]}function qn(W){return function(Ce){return W?.[Ce]}}var zi=qn(Gn);function Xe(W){return en.test(W)}function In(W){return W.match(es)||[]}var is=Object.prototype,wt=is.toString,vi=An.Symbol,Qi=vi?vi.prototype:void 0,tn=Qi?Qi.toString:void 0;function Ke(W){if(typeof W=="string")return W;if(rs(W))return tn?tn.call(W):"";var Ce=W+"";return Ce=="0"&&1/W==-1/0?"-0":Ce}function bn(W){return function(Ce){return ns(rn(ss(Ce).replace(Kr,"")),W,"")}}function Jn(W){return!!W&&typeof W=="object"}function rs(W){return typeof W=="symbol"||Jn(W)&&wt.call(W)==n}function nn(W){return W==null?"":Ke(W)}function ss(W){return W=nn(W),W&&W.replace(i,zi).replace(Zr,"")}var Nn=bn(function(W,Ce,Ct){return W+(Ct?"-":"")+Ce.toLowerCase()});function rn(W,Ce,Ct){return W=nn(W),Ce=Ce,Ce===void 0?Xe(W)?In(W):Vn(W):W.match(Ce)||[]}return Aa=Nn,Aa}var _x=vx();const fi=Uy(_x),xx=({name:n,universalIdentifier:r=pi.v4()})=>{const i=fi(n);return`import { defineFrontComponent } from 'twenty-sdk';
|
|
310
|
+
`;await de.appendFile(ge.join(r,"index.ts"),i)}}class ux{constructor(){this.clientService=new ox}async execute(r=Yt){try{await this.clientService.generate(r)}catch(i){throw console.error(R.default.red("Generate Twenty client failed:"),i instanceof Error?i.message:i),i}}}class cx{constructor(){this.apiService=new Zt}async execute({appPath:r=Yt,askForConfirmation:i}){try{console.log(R.default.blue("🚀 Uninstall Twenty Application")),console.log(R.default.gray(`📁 App Path: ${r}`)),console.log(""),i&&!await this.confirmationPrompt()&&(console.error(R.default.red("⛔️ Aborting uninstall")),process.exit(1));const{manifest:o}=await Yr(r);if(!o)return{success:!1,error:"Build failed"};const u=await this.apiService.uninstallApplication(o.application.universalIdentifier);return u.success===!1?console.error(R.default.red("❌ Uninstall failed:"),u.error):console.log(R.default.green("✅ Application uninstalled successfully")),u}catch(o){throw console.error(R.default.red("Uninstall failed:"),o instanceof Error?o.message:o),o}}async confirmationPrompt(){const{confirmation:r}=await Qt.default.prompt([{type:"confirm",name:"confirmation",message:"Are you sure you want to uninstall this application?",default:!1}]);return r}}class lx{constructor(){this.configService=new je}async execute(){try{const r=await this.configService.getAvailableWorkspaces(),i=await this.configService.getDefaultWorkspace();if(r.length===0){console.log(R.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}console.log(R.default.blue(`Available workspaces:
|
|
311
|
+
`));for(const o of r){const u=await this.configService.getConfigForWorkspace(o),f=!!u.apiKey,v=o===i?R.default.green(" (default)"):"",w=f?R.default.green("●"):R.default.gray("○");console.log(` ${w} ${o}${v}`),console.log(R.default.gray(` API URL: ${u.apiUrl}`))}console.log(""),console.log(R.default.gray("● = authenticated, ○ = no credentials")),console.log(R.default.gray("Use `twenty auth:switch <workspace>` to change default"))}catch(r){console.error(R.default.red("List failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class fx{constructor(){this.configService=new je,this.apiService=new Zt}async execute(r){try{let{apiKey:i,apiUrl:o}=r;const u=await this.configService.getConfig();if(o||(o=(await Qt.default.prompt([{type:"input",name:"apiUrl",message:"Twenty API URL:",default:u.apiUrl,validate:v=>{try{return new URL(v),!0}catch{return"Please enter a valid URL"}}}])).apiUrl),i||(i=(await Qt.default.prompt([{type:"password",name:"apiKey",message:"API Key:",mask:"*",validate:v=>v.length>0||"API key is required"}])).apiKey),await this.configService.setConfig({apiUrl:o,apiKey:i}),(await this.apiService.validateAuth()).authValid){const g=je.getActiveWorkspace();console.log(R.default.green(`✓ Successfully authenticated with Twenty (workspace: ${g})`))}else console.log(R.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(i){console.error(R.default.red("Login failed:"),i instanceof Error?i.message:i),process.exit(1)}}}class px{constructor(){this.configService=new je}async execute(){try{await this.configService.clearConfig();const r=je.getActiveWorkspace();console.log(R.default.green(`✓ Successfully logged out (workspace: ${r})`))}catch(r){console.error(R.default.red("Logout failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class dx{constructor(){this.configService=new je,this.apiService=new Zt}async execute(){try{const r=je.getActiveWorkspace(),i=await this.configService.getConfig();if(console.log(R.default.blue("Authentication Status:")),console.log(`Workspace: ${r}`),console.log(`API URL: ${i.apiUrl}`),console.log(`API Key: ${i.apiKey?"***"+i.apiKey.slice(-4):"Not set"}`),i.apiKey){const o=await this.apiService.validateAuth();console.log(`Status: ${o.authValid?R.default.green("✓ Valid"):R.default.red("✗ Invalid")}`)}else console.log(`Status: ${R.default.yellow("⚠ Not authenticated")}`)}catch(r){console.error(R.default.red("Status check failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class hx{constructor(){this.apiService=new Zt}async execute({appPath:r=Yt,functionUniversalIdentifier:i,functionName:o,payload:u="{}"}){try{let f;try{f=JSON.parse(u)}catch{console.error(R.default.red("Invalid JSON payload. Please provide valid JSON.")),process.exit(1)}const{manifest:g}=await Yr(r);g||(console.error(R.default.red("Failed to build manifest.")),process.exit(1));const v=await this.apiService.findLogicFunctions();v.success||(console.error(R.default.red("Failed to fetch functions:"),v.error instanceof Error?v.error.message:v.error),process.exit(1));const w=v.data.filter(M=>M.universalIdentifier&&this.belongsToApplication(M,g)),b=w.find(M=>i?M.universalIdentifier===i:o?M.name===o:!1);if(!b){const M=i||o;console.error(R.default.red(`Function "${M}" not found in application.`)),console.log(""),w.length>0?(console.log(R.default.cyan("Available functions:")),w.forEach($=>{console.log(` - ${R.default.white($.name)} (${$.universalIdentifier})`)})):console.log(R.default.yellow("No functions found for this application. Have you synced your app with `yarn app:sync`?")),process.exit(1)}console.log(R.default.blue(`🚀 Executing function "${b.name}"...`)),console.log(R.default.gray(` Payload: ${JSON.stringify(f)}`)),console.log("");const O=await this.apiService.executeLogicFunction({functionId:b.id,payload:f});O.success||(console.error(R.default.red("Execution failed:"),O.error instanceof Error?O.error.message:O.error),process.exit(1));const D=O.data;console.log(R.default.cyan("─".repeat(60))),console.log(R.default.cyan("Execution Result")),console.log(R.default.cyan("─".repeat(60)));const P=D.status==="SUCCESS"?R.default.green:R.default.red;console.log(`${R.default.bold("Status:")} ${P(D.status)}`),console.log(`${R.default.bold("Duration:")} ${D.duration}ms`),kt.Tr(D.data)&&(console.log(""),console.log(R.default.bold("Data:")),console.log(R.default.white(JSON.stringify(D.data,null,2)))),D.error&&(console.log(""),console.log(R.default.bold.red("Error:")),console.log(R.default.red(` Type: ${D.error.errorType}`)),console.log(R.default.red(` Message: ${D.error.errorMessage}`)),D.error.stackTrace&&(console.log(""),console.log(R.default.gray("Stack trace:")),console.log(R.default.gray(D.error.stackTrace)))),D.logs&&(console.log(""),console.log(R.default.bold("Logs:")),console.log(R.default.gray(D.logs))),console.log(R.default.cyan("─".repeat(60))),D.status!=="SUCCESS"&&process.exit(1)}catch(f){console.error(R.default.red("Execution failed:"),f instanceof Error?f.message:f),process.exit(1)}}belongsToApplication(r,i){return i.logicFunctions.some(o=>o.universalIdentifier===r.universalIdentifier)}}class gx{constructor(){this.apiService=new Zt}async execute({appPath:r=Yt,functionUniversalIdentifier:i,functionName:o}){try{const{manifest:u}=await Yr(r);u||process.exit(1),this.logWatchInfo({appName:u.application.displayName,functionUniversalIdentifier:i,functionName:o}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:u.application.universalIdentifier,functionUniversalIdentifier:i,functionName:o})}catch(u){console.error(R.default.red("Watch logs failed:"),u instanceof Error?u.message:u),process.exit(1)}}logWatchInfo({appName:r,functionUniversalIdentifier:i,functionName:o}){const u=r??"Twenty Application",f=i||o?`function "${i||o}"`:"functions";console.log(R.default.blue(`🚀 Watching ${u} ${f} logs:`)),console.log("")}}class mx{constructor(){this.configService=new je,this.apiService=new Zt}async execute(r){try{let{workspace:i}=r;const o=await this.configService.getAvailableWorkspaces(),u=await this.configService.getDefaultWorkspace();if(o.length===0){console.log(R.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}if(!i){const v=o.map(b=>({name:b===u?`${b} (current default)`:b,value:b}));i=(await Qt.default.prompt([{type:"list",name:"workspace",message:"Select a workspace to set as default:",choices:v,default:u}])).workspace}if(o.includes(i)||(console.log(R.default.red(`✗ Workspace "${i}" not found. Available workspaces: ${o.join(", ")}`)),process.exit(1)),i===u){console.log(R.default.blue(`ℹ "${i}" is already the default workspace.`));return}await this.configService.setDefaultWorkspace(i),je.setActiveWorkspace(i);const g=!!(await this.configService.getConfig()).apiKey;console.log(R.default.green(`✓ Switched default workspace to "${i}"`)),g?(await this.apiService.validateAuth()).authValid?console.log(R.default.green("✓ Authentication is valid")):console.log(R.default.yellow("⚠ Authentication credentials exist but are invalid. Run `twenty auth:login` to re-authenticate.")):console.log(R.default.yellow("⚠ No credentials configured for this workspace. Run `twenty auth:login` to authenticate."))}catch(i){console.error(R.default.red("Switch failed:"),i instanceof Error?i.message:i),process.exit(1)}}}var Aa,Cc;function yx(){if(Cc)return Aa;Cc=1;var n="[object Symbol]",r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o="\\ud800-\\udfff",u="\\u0300-\\u036f\\ufe20-\\ufe23",f="\\u20d0-\\u20f0",g="\\u2700-\\u27bf",v="a-z\\xdf-\\xf6\\xf8-\\xff",w="\\xac\\xb1\\xd7\\xf7",b="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",O="\\u2000-\\u206f",D=" \\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",P="A-Z\\xc0-\\xd6\\xd8-\\xde",M="\\ufe0e\\ufe0f",$=w+b+O+D,he="['’]",ae="["+$+"]",me="["+u+f+"]",Ye="\\d+",xe="["+g+"]",L="["+v+"]",ee="[^"+o+$+Ye+g+v+P+"]",H="\\ud83c[\\udffb-\\udfff]",ce="(?:"+me+"|"+H+")",qe="[^"+o+"]",x="(?:\\ud83c[\\udde6-\\uddff]){2}",q="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="["+P+"]",xt="\\u200d",en="(?:"+L+"|"+ee+")",Vi="(?:"+Se+"|"+ee+")",qi="(?:"+he+"(?:d|ll|m|re|s|t|ve))?",Ji="(?:"+he+"(?:D|LL|M|RE|S|T|VE))?",Rt=ce+"?",Tt="["+M+"]?",Xr="(?:"+xt+"(?:"+[qe,x,q].join("|")+")"+Tt+Rt+")*",Wn=Tt+Rt+Xr,st="(?:"+[xe,x,q].join("|")+")"+Wn,Kr=RegExp(he,"g"),Zr=RegExp(me,"g"),es=RegExp([Se+"?"+L+"+"+qi+"(?="+[ae,Se,"$"].join("|")+")",Vi+"+"+Ji+"(?="+[ae,Se+en,"$"].join("|")+")",Se+"?"+en+"+"+qi,Se+"+"+Ji,Ye,st].join("|"),"g"),tn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gn={À:"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",ſ:"ss"},ts=typeof B.commonjsGlobal=="object"&&B.commonjsGlobal&&B.commonjsGlobal.Object===Object&&B.commonjsGlobal,Sn=typeof self=="object"&&self&&self.Object===Object&&self,An=ts||Sn||Function("return this")();function ns(W,Ce,Ct,Hi){for(var On=-1,_i=W?W.length:0;++On<_i;)Ct=Ce(Ct,W[On],On,W);return Ct}function Vn(W){return W.match(r)||[]}function qn(W){return function(Ce){return W?.[Ce]}}var zi=qn(Gn);function Xe(W){return tn.test(W)}function In(W){return W.match(es)||[]}var is=Object.prototype,wt=is.toString,vi=An.Symbol,Qi=vi?vi.prototype:void 0,nn=Qi?Qi.toString:void 0;function Ke(W){if(typeof W=="string")return W;if(rs(W))return nn?nn.call(W):"";var Ce=W+"";return Ce=="0"&&1/W==-1/0?"-0":Ce}function bn(W){return function(Ce){return ns(sn(ss(Ce).replace(Kr,"")),W,"")}}function Jn(W){return!!W&&typeof W=="object"}function rs(W){return typeof W=="symbol"||Jn(W)&&wt.call(W)==n}function rn(W){return W==null?"":Ke(W)}function ss(W){return W=rn(W),W&&W.replace(i,zi).replace(Zr,"")}var Nn=bn(function(W,Ce,Ct){return W+(Ct?"-":"")+Ce.toLowerCase()});function sn(W,Ce,Ct){return W=rn(W),Ce=Ce,Ce===void 0?Xe(W)?In(W):Vn(W):W.match(Ce)||[]}return Aa=Nn,Aa}var vx=yx();const fi=B.getDefaultExportFromCjs(vx),_x=({name:n,universalIdentifier:r=pi.v4()})=>{const i=fi(n);return`import { defineFrontComponent } from 'twenty-sdk';
|
|
312
312
|
|
|
313
313
|
// React component - implement your UI here
|
|
314
314
|
const Component = () => {
|
|
@@ -326,7 +326,7 @@ export default defineFrontComponent({
|
|
|
326
326
|
description: 'Add a description for your front component',
|
|
327
327
|
component: Component,
|
|
328
328
|
});
|
|
329
|
-
`},
|
|
329
|
+
`},xx=({name:n,universalIdentifier:r=pi.v4()})=>{const i=fi(n),o=pi.v4();return`import { defineLogicFunction } from 'twenty-sdk';
|
|
330
330
|
|
|
331
331
|
// Logic function handler - rename and implement your logic
|
|
332
332
|
const handler = async (params: {
|
|
@@ -378,9 +378,9 @@ export default defineLogicFunction({
|
|
|
378
378
|
* Released under MIT license <https://lodash.com/license>
|
|
379
379
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
380
380
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
381
|
-
*/var wx=$i.exports,Lc;function Ex(){return Lc||(Lc=1,function(n,r){(function(){var i,o="4.17.21",u=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",g="Expected a function",v="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",b=500,O="__lodash_placeholder__",D=1,P=2,M=4,$=1,he=2,ae=1,me=2,Ye=4,xe=8,L=16,ee=32,H=64,ce=128,qe=256,x=512,q=30,Se="...",xt=800,Zt=16,Vi=1,qi=2,Ji=3,Rt=1/0,Tt=9007199254740991,Xr=17976931348623157e292,Wn=NaN,st=4294967295,Kr=st-1,Zr=st>>>1,es=[["ary",ce],["bind",ae],["bindKey",me],["curry",xe],["curryRight",L],["flip",x],["partial",ee],["partialRight",H],["rearg",qe]],en="[object Arguments]",Gn="[object Array]",ts="[object AsyncFunction]",Sn="[object Boolean]",An="[object Date]",ns="[object DOMException]",Vn="[object Error]",qn="[object Function]",zi="[object GeneratorFunction]",Xe="[object Map]",In="[object Number]",is="[object Null]",wt="[object Object]",vi="[object Promise]",Qi="[object Proxy]",tn="[object RegExp]",Ke="[object Set]",bn="[object String]",Jn="[object Symbol]",rs="[object Undefined]",nn="[object WeakMap]",ss="[object WeakSet]",Nn="[object ArrayBuffer]",rn="[object DataView]",W="[object Float32Array]",Ce="[object Float64Array]",Ct="[object Int8Array]",Hi="[object Int16Array]",On="[object Int32Array]",_i="[object Uint8Array]",as="[object Uint8ClampedArray]",os="[object Uint16Array]",us="[object Uint32Array]",Cl=/\b__p \+= '';/g,Ll=/\b(__p \+=) '' \+/g,Fl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ma=/&(?:amp|lt|gt|quot|#39);/g,$a=/[&<>"']/g,Dl=RegExp(Ma.source),Pl=RegExp($a.source),kl=/<%-([\s\S]+?)%>/g,Ul=/<%([\s\S]+?)%>/g,Ba=/<%=([\s\S]+?)%>/g,Ml=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$l=/^\w*$/,Bl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cs=/[\\^$.*+?()[\]{}|]/g,jl=RegExp(cs.source),ls=/^\s+/,Wl=/\s/,Gl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vl=/\{\n\/\* \[wrapped with (.+)\] \*/,ql=/,? & /,Jl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zl=/[()=,{}\[\]\/\s]/,Ql=/\\(\\)?/g,Hl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ja=/\w*$/,Yl=/^[-+]0x[0-9a-f]+$/i,Xl=/^0b[01]+$/i,Kl=/^\[object .+?Constructor\]$/,Zl=/^0o[0-7]+$/i,ef=/^(?:0|[1-9]\d*)$/,tf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yi=/($^)/,nf=/['\n\r\u2028\u2029\\]/g,Xi="\\ud800-\\udfff",rf="\\u0300-\\u036f",sf="\\ufe20-\\ufe2f",af="\\u20d0-\\u20ff",Wa=rf+sf+af,Ga="\\u2700-\\u27bf",Va="a-z\\xdf-\\xf6\\xf8-\\xff",of="\\xac\\xb1\\xd7\\xf7",uf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",cf="\\u2000-\\u206f",lf=" \\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",qa="A-Z\\xc0-\\xd6\\xd8-\\xde",Ja="\\ufe0e\\ufe0f",za=of+uf+cf+lf,fs="['’]",ff="["+Xi+"]",Qa="["+za+"]",Ki="["+Wa+"]",Ha="\\d+",pf="["+Ga+"]",Ya="["+Va+"]",Xa="[^"+Xi+za+Ha+Ga+Va+qa+"]",ps="\\ud83c[\\udffb-\\udfff]",df="(?:"+Ki+"|"+ps+")",Ka="[^"+Xi+"]",ds="(?:\\ud83c[\\udde6-\\uddff]){2}",hs="[\\ud800-\\udbff][\\udc00-\\udfff]",zn="["+qa+"]",Za="\\u200d",eo="(?:"+Ya+"|"+Xa+")",hf="(?:"+zn+"|"+Xa+")",to="(?:"+fs+"(?:d|ll|m|re|s|t|ve))?",no="(?:"+fs+"(?:D|LL|M|RE|S|T|VE))?",io=df+"?",ro="["+Ja+"]?",gf="(?:"+Za+"(?:"+[Ka,ds,hs].join("|")+")"+ro+io+")*",mf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",so=ro+io+gf,vf="(?:"+[pf,ds,hs].join("|")+")"+so,_f="(?:"+[Ka+Ki+"?",Ki,ds,hs,ff].join("|")+")",xf=RegExp(fs,"g"),Tf=RegExp(Ki,"g"),gs=RegExp(ps+"(?="+ps+")|"+_f+so,"g"),wf=RegExp([zn+"?"+Ya+"+"+to+"(?="+[Qa,zn,"$"].join("|")+")",hf+"+"+no+"(?="+[Qa,zn+eo,"$"].join("|")+")",zn+"?"+eo+"+"+to,zn+"+"+no,yf,mf,Ha,vf].join("|"),"g"),Ef=RegExp("["+Za+Xi+Wa+Ja+"]"),Sf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Af=["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"],If=-1,Te={};Te[W]=Te[Ce]=Te[Ct]=Te[Hi]=Te[On]=Te[_i]=Te[as]=Te[os]=Te[us]=!0,Te[en]=Te[Gn]=Te[Nn]=Te[Sn]=Te[rn]=Te[An]=Te[Vn]=Te[qn]=Te[Xe]=Te[In]=Te[wt]=Te[tn]=Te[Ke]=Te[bn]=Te[nn]=!1;var _e={};_e[en]=_e[Gn]=_e[Nn]=_e[rn]=_e[Sn]=_e[An]=_e[W]=_e[Ce]=_e[Ct]=_e[Hi]=_e[On]=_e[Xe]=_e[In]=_e[wt]=_e[tn]=_e[Ke]=_e[bn]=_e[Jn]=_e[_i]=_e[as]=_e[os]=_e[us]=!0,_e[Vn]=_e[qn]=_e[nn]=!1;var bf={À:"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"},Nf={"&":"&","<":"<",">":">",'"':""","'":"'"},Of={"&":"&","<":"<",">":">",""":'"',"'":"'"},Rf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cf=parseFloat,Lf=parseInt,ao=typeof mn=="object"&&mn&&mn.Object===Object&&mn,Ff=typeof self=="object"&&self&&self.Object===Object&&self,Ue=ao||Ff||Function("return this")(),ms=r&&!r.nodeType&&r,Rn=ms&&!0&&n&&!n.nodeType&&n,oo=Rn&&Rn.exports===ms,ys=oo&&ao.process,at=function(){try{var m=Rn&&Rn.require&&Rn.require("util").types;return m||ys&&ys.binding&&ys.binding("util")}catch{}}(),uo=at&&at.isArrayBuffer,co=at&&at.isDate,lo=at&&at.isMap,fo=at&&at.isRegExp,po=at&&at.isSet,ho=at&&at.isTypedArray;function Ze(m,T,_){switch(_.length){case 0:return m.call(T);case 1:return m.call(T,_[0]);case 2:return m.call(T,_[0],_[1]);case 3:return m.call(T,_[0],_[1],_[2])}return m.apply(T,_)}function Df(m,T,_,F){for(var z=-1,oe=m==null?0:m.length;++z<oe;){var Le=m[z];T(F,Le,_(Le),m)}return F}function ot(m,T){for(var _=-1,F=m==null?0:m.length;++_<F&&T(m[_],_,m)!==!1;);return m}function Pf(m,T){for(var _=m==null?0:m.length;_--&&T(m[_],_,m)!==!1;);return m}function go(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(!T(m[_],_,m))return!1;return!0}function sn(m,T){for(var _=-1,F=m==null?0:m.length,z=0,oe=[];++_<F;){var Le=m[_];T(Le,_,m)&&(oe[z++]=Le)}return oe}function Zi(m,T){var _=m==null?0:m.length;return!!_&&Qn(m,T,0)>-1}function vs(m,T,_){for(var F=-1,z=m==null?0:m.length;++F<z;)if(_(T,m[F]))return!0;return!1}function Ee(m,T){for(var _=-1,F=m==null?0:m.length,z=Array(F);++_<F;)z[_]=T(m[_],_,m);return z}function an(m,T){for(var _=-1,F=T.length,z=m.length;++_<F;)m[z+_]=T[_];return m}function _s(m,T,_,F){var z=-1,oe=m==null?0:m.length;for(F&&oe&&(_=m[++z]);++z<oe;)_=T(_,m[z],z,m);return _}function kf(m,T,_,F){var z=m==null?0:m.length;for(F&&z&&(_=m[--z]);z--;)_=T(_,m[z],z,m);return _}function xs(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(T(m[_],_,m))return!0;return!1}var Uf=Ts("length");function Mf(m){return m.split("")}function $f(m){return m.match(Jl)||[]}function mo(m,T,_){var F;return _(m,function(z,oe,Le){if(T(z,oe,Le))return F=oe,!1}),F}function er(m,T,_,F){for(var z=m.length,oe=_+(F?1:-1);F?oe--:++oe<z;)if(T(m[oe],oe,m))return oe;return-1}function Qn(m,T,_){return T===T?Xf(m,T,_):er(m,yo,_)}function Bf(m,T,_,F){for(var z=_-1,oe=m.length;++z<oe;)if(F(m[z],T))return z;return-1}function yo(m){return m!==m}function vo(m,T){var _=m==null?0:m.length;return _?Es(m,T)/_:Wn}function Ts(m){return function(T){return T==null?i:T[m]}}function ws(m){return function(T){return m==null?i:m[T]}}function _o(m,T,_,F,z){return z(m,function(oe,Le,ye){_=F?(F=!1,oe):T(_,oe,Le,ye)}),_}function jf(m,T){var _=m.length;for(m.sort(T);_--;)m[_]=m[_].value;return m}function Es(m,T){for(var _,F=-1,z=m.length;++F<z;){var oe=T(m[F]);oe!==i&&(_=_===i?oe:_+oe)}return _}function Ss(m,T){for(var _=-1,F=Array(m);++_<m;)F[_]=T(_);return F}function Wf(m,T){return Ee(T,function(_){return[_,m[_]]})}function xo(m){return m&&m.slice(0,So(m)+1).replace(ls,"")}function et(m){return function(T){return m(T)}}function As(m,T){return Ee(T,function(_){return m[_]})}function xi(m,T){return m.has(T)}function To(m,T){for(var _=-1,F=m.length;++_<F&&Qn(T,m[_],0)>-1;);return _}function wo(m,T){for(var _=m.length;_--&&Qn(T,m[_],0)>-1;);return _}function Gf(m,T){for(var _=m.length,F=0;_--;)m[_]===T&&++F;return F}var Vf=ws(bf),qf=ws(Nf);function Jf(m){return"\\"+Rf[m]}function zf(m,T){return m==null?i:m[T]}function Hn(m){return Ef.test(m)}function Qf(m){return Sf.test(m)}function Hf(m){for(var T,_=[];!(T=m.next()).done;)_.push(T.value);return _}function Is(m){var T=-1,_=Array(m.size);return m.forEach(function(F,z){_[++T]=[z,F]}),_}function Eo(m,T){return function(_){return m(T(_))}}function on(m,T){for(var _=-1,F=m.length,z=0,oe=[];++_<F;){var Le=m[_];(Le===T||Le===O)&&(m[_]=O,oe[z++]=_)}return oe}function tr(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=F}),_}function Yf(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=[F,F]}),_}function Xf(m,T,_){for(var F=_-1,z=m.length;++F<z;)if(m[F]===T)return F;return-1}function Kf(m,T,_){for(var F=_+1;F--;)if(m[F]===T)return F;return F}function Yn(m){return Hn(m)?ep(m):Uf(m)}function Et(m){return Hn(m)?tp(m):Mf(m)}function So(m){for(var T=m.length;T--&&Wl.test(m.charAt(T)););return T}var Zf=ws(Of);function ep(m){for(var T=gs.lastIndex=0;gs.test(m);)++T;return T}function tp(m){return m.match(gs)||[]}function np(m){return m.match(wf)||[]}var ip=function m(T){T=T==null?Ue:Xn.defaults(Ue.Object(),T,Xn.pick(Ue,Af));var _=T.Array,F=T.Date,z=T.Error,oe=T.Function,Le=T.Math,ye=T.Object,bs=T.RegExp,rp=T.String,ut=T.TypeError,nr=_.prototype,sp=oe.prototype,Kn=ye.prototype,ir=T["__core-js_shared__"],rr=sp.toString,pe=Kn.hasOwnProperty,ap=0,Ao=function(){var e=/[^.]+$/.exec(ir&&ir.keys&&ir.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),sr=Kn.toString,op=rr.call(ye),up=Ue._,cp=bs("^"+rr.call(pe).replace(cs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ar=oo?T.Buffer:i,un=T.Symbol,or=T.Uint8Array,Io=ar?ar.allocUnsafe:i,ur=Eo(ye.getPrototypeOf,ye),bo=ye.create,No=Kn.propertyIsEnumerable,cr=nr.splice,Oo=un?un.isConcatSpreadable:i,Ti=un?un.iterator:i,Cn=un?un.toStringTag:i,lr=function(){try{var e=kn(ye,"defineProperty");return e({},"",{}),e}catch{}}(),lp=T.clearTimeout!==Ue.clearTimeout&&T.clearTimeout,fp=F&&F.now!==Ue.Date.now&&F.now,pp=T.setTimeout!==Ue.setTimeout&&T.setTimeout,fr=Le.ceil,pr=Le.floor,Ns=ye.getOwnPropertySymbols,dp=ar?ar.isBuffer:i,Ro=T.isFinite,hp=nr.join,gp=Eo(ye.keys,ye),Fe=Le.max,$e=Le.min,mp=F.now,yp=T.parseInt,Co=Le.random,vp=nr.reverse,Os=kn(T,"DataView"),wi=kn(T,"Map"),Rs=kn(T,"Promise"),Zn=kn(T,"Set"),Ei=kn(T,"WeakMap"),Si=kn(ye,"create"),dr=Ei&&new Ei,ei={},_p=Un(Os),xp=Un(wi),Tp=Un(Rs),wp=Un(Zn),Ep=Un(Ei),hr=un?un.prototype:i,Ai=hr?hr.valueOf:i,Lo=hr?hr.toString:i;function l(e){if(Ie(e)&&!Q(e)&&!(e instanceof te)){if(e instanceof ct)return e;if(pe.call(e,"__wrapped__"))return Fu(e)}return new ct(e)}var ti=function(){function e(){}return function(t){if(!Ae(t))return{};if(bo)return bo(t);e.prototype=t;var s=new e;return e.prototype=i,s}}();function gr(){}function ct(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}l.templateSettings={escape:kl,evaluate:Ul,interpolate:Ba,variable:"",imports:{_:l}},l.prototype=gr.prototype,l.prototype.constructor=l,ct.prototype=ti(gr.prototype),ct.prototype.constructor=ct;function te(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=st,this.__views__=[]}function Sp(){var e=new te(this.__wrapped__);return e.__actions__=Je(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Je(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Je(this.__views__),e}function Ap(){if(this.__filtered__){var e=new te(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Ip(){var e=this.__wrapped__.value(),t=this.__dir__,s=Q(e),a=t<0,c=s?e.length:0,p=Md(0,c,this.__views__),d=p.start,h=p.end,y=h-d,E=a?h:d-1,S=this.__iteratees__,I=S.length,C=0,U=$e(y,this.__takeCount__);if(!s||!a&&c==y&&U==y)return nu(e,this.__actions__);var G=[];e:for(;y--&&C<U;){E+=t;for(var X=-1,V=e[E];++X<I;){var Z=S[X],ie=Z.iteratee,it=Z.type,Ve=ie(V);if(it==qi)V=Ve;else if(!Ve){if(it==Vi)continue e;break e}}G[C++]=V}return G}te.prototype=ti(gr.prototype),te.prototype.constructor=te;function Ln(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function bp(){this.__data__=Si?Si(null):{},this.size=0}function Np(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Op(e){var t=this.__data__;if(Si){var s=t[e];return s===w?i:s}return pe.call(t,e)?t[e]:i}function Rp(e){var t=this.__data__;return Si?t[e]!==i:pe.call(t,e)}function Cp(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=Si&&t===i?w:t,this}Ln.prototype.clear=bp,Ln.prototype.delete=Np,Ln.prototype.get=Op,Ln.prototype.has=Rp,Ln.prototype.set=Cp;function Ut(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function Lp(){this.__data__=[],this.size=0}function Fp(e){var t=this.__data__,s=mr(t,e);if(s<0)return!1;var a=t.length-1;return s==a?t.pop():cr.call(t,s,1),--this.size,!0}function Dp(e){var t=this.__data__,s=mr(t,e);return s<0?i:t[s][1]}function Pp(e){return mr(this.__data__,e)>-1}function kp(e,t){var s=this.__data__,a=mr(s,e);return a<0?(++this.size,s.push([e,t])):s[a][1]=t,this}Ut.prototype.clear=Lp,Ut.prototype.delete=Fp,Ut.prototype.get=Dp,Ut.prototype.has=Pp,Ut.prototype.set=kp;function Mt(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function Up(){this.size=0,this.__data__={hash:new Ln,map:new(wi||Ut),string:new Ln}}function Mp(e){var t=Nr(this,e).delete(e);return this.size-=t?1:0,t}function $p(e){return Nr(this,e).get(e)}function Bp(e){return Nr(this,e).has(e)}function jp(e,t){var s=Nr(this,e),a=s.size;return s.set(e,t),this.size+=s.size==a?0:1,this}Mt.prototype.clear=Up,Mt.prototype.delete=Mp,Mt.prototype.get=$p,Mt.prototype.has=Bp,Mt.prototype.set=jp;function Fn(e){var t=-1,s=e==null?0:e.length;for(this.__data__=new Mt;++t<s;)this.add(e[t])}function Wp(e){return this.__data__.set(e,w),this}function Gp(e){return this.__data__.has(e)}Fn.prototype.add=Fn.prototype.push=Wp,Fn.prototype.has=Gp;function St(e){var t=this.__data__=new Ut(e);this.size=t.size}function Vp(){this.__data__=new Ut,this.size=0}function qp(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}function Jp(e){return this.__data__.get(e)}function zp(e){return this.__data__.has(e)}function Qp(e,t){var s=this.__data__;if(s instanceof Ut){var a=s.__data__;if(!wi||a.length<u-1)return a.push([e,t]),this.size=++s.size,this;s=this.__data__=new Mt(a)}return s.set(e,t),this.size=s.size,this}St.prototype.clear=Vp,St.prototype.delete=qp,St.prototype.get=Jp,St.prototype.has=zp,St.prototype.set=Qp;function Fo(e,t){var s=Q(e),a=!s&&Mn(e),c=!s&&!a&&dn(e),p=!s&&!a&&!c&&si(e),d=s||a||c||p,h=d?Ss(e.length,rp):[],y=h.length;for(var E in e)(t||pe.call(e,E))&&!(d&&(E=="length"||c&&(E=="offset"||E=="parent")||p&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||Wt(E,y)))&&h.push(E);return h}function Do(e){var t=e.length;return t?e[js(0,t-1)]:i}function Hp(e,t){return Or(Je(e),Dn(t,0,e.length))}function Yp(e){return Or(Je(e))}function Cs(e,t,s){(s!==i&&!At(e[t],s)||s===i&&!(t in e))&&$t(e,t,s)}function Ii(e,t,s){var a=e[t];(!(pe.call(e,t)&&At(a,s))||s===i&&!(t in e))&&$t(e,t,s)}function mr(e,t){for(var s=e.length;s--;)if(At(e[s][0],t))return s;return-1}function Xp(e,t,s,a){return cn(e,function(c,p,d){t(a,c,s(c),d)}),a}function Po(e,t){return e&&Ft(t,Pe(t),e)}function Kp(e,t){return e&&Ft(t,Qe(t),e)}function $t(e,t,s){t=="__proto__"&&lr?lr(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}function Ls(e,t){for(var s=-1,a=t.length,c=_(a),p=e==null;++s<a;)c[s]=p?i:pa(e,t[s]);return c}function Dn(e,t,s){return e===e&&(s!==i&&(e=e<=s?e:s),t!==i&&(e=e>=t?e:t)),e}function lt(e,t,s,a,c,p){var d,h=t&D,y=t&P,E=t&M;if(s&&(d=c?s(e,a,c,p):s(e)),d!==i)return d;if(!Ae(e))return e;var S=Q(e);if(S){if(d=Bd(e),!h)return Je(e,d)}else{var I=Be(e),C=I==qn||I==zi;if(dn(e))return su(e,h);if(I==wt||I==en||C&&!c){if(d=y||C?{}:Su(e),!h)return y?Od(e,Kp(d,e)):Nd(e,Po(d,e))}else{if(!_e[I])return c?e:{};d=jd(e,I,h)}}p||(p=new St);var U=p.get(e);if(U)return U;p.set(e,d),Zu(e)?e.forEach(function(V){d.add(lt(V,t,s,V,e,p))}):Xu(e)&&e.forEach(function(V,Z){d.set(Z,lt(V,t,s,Z,e,p))});var G=E?y?Ks:Xs:y?Qe:Pe,X=S?i:G(e);return ot(X||e,function(V,Z){X&&(Z=V,V=e[Z]),Ii(d,Z,lt(V,t,s,Z,e,p))}),d}function Zp(e){var t=Pe(e);return function(s){return ko(s,e,t)}}function ko(e,t,s){var a=s.length;if(e==null)return!a;for(e=ye(e);a--;){var c=s[a],p=t[c],d=e[c];if(d===i&&!(c in e)||!p(d))return!1}return!0}function Uo(e,t,s){if(typeof e!="function")throw new ut(g);return Fi(function(){e.apply(i,s)},t)}function bi(e,t,s,a){var c=-1,p=Zi,d=!0,h=e.length,y=[],E=t.length;if(!h)return y;s&&(t=Ee(t,et(s))),a?(p=vs,d=!1):t.length>=u&&(p=xi,d=!1,t=new Fn(t));e:for(;++c<h;){var S=e[c],I=s==null?S:s(S);if(S=a||S!==0?S:0,d&&I===I){for(var C=E;C--;)if(t[C]===I)continue e;y.push(S)}else p(t,I,a)||y.push(S)}return y}var cn=lu(Lt),Mo=lu(Ds,!0);function ed(e,t){var s=!0;return cn(e,function(a,c,p){return s=!!t(a,c,p),s}),s}function yr(e,t,s){for(var a=-1,c=e.length;++a<c;){var p=e[a],d=t(p);if(d!=null&&(h===i?d===d&&!nt(d):s(d,h)))var h=d,y=p}return y}function td(e,t,s,a){var c=e.length;for(s=Y(s),s<0&&(s=-s>c?0:c+s),a=a===i||a>c?c:Y(a),a<0&&(a+=c),a=s>a?0:tc(a);s<a;)e[s++]=t;return e}function $o(e,t){var s=[];return cn(e,function(a,c,p){t(a,c,p)&&s.push(a)}),s}function Me(e,t,s,a,c){var p=-1,d=e.length;for(s||(s=Gd),c||(c=[]);++p<d;){var h=e[p];t>0&&s(h)?t>1?Me(h,t-1,s,a,c):an(c,h):a||(c[c.length]=h)}return c}var Fs=fu(),Bo=fu(!0);function Lt(e,t){return e&&Fs(e,t,Pe)}function Ds(e,t){return e&&Bo(e,t,Pe)}function vr(e,t){return sn(t,function(s){return Gt(e[s])})}function Pn(e,t){t=fn(t,e);for(var s=0,a=t.length;e!=null&&s<a;)e=e[Dt(t[s++])];return s&&s==a?e:i}function jo(e,t,s){var a=t(e);return Q(e)?a:an(a,s(e))}function We(e){return e==null?e===i?rs:is:Cn&&Cn in ye(e)?Ud(e):Yd(e)}function Ps(e,t){return e>t}function nd(e,t){return e!=null&&pe.call(e,t)}function id(e,t){return e!=null&&t in ye(e)}function rd(e,t,s){return e>=$e(t,s)&&e<Fe(t,s)}function ks(e,t,s){for(var a=s?vs:Zi,c=e[0].length,p=e.length,d=p,h=_(p),y=1/0,E=[];d--;){var S=e[d];d&&t&&(S=Ee(S,et(t))),y=$e(S.length,y),h[d]=!s&&(t||c>=120&&S.length>=120)?new Fn(d&&S):i}S=e[0];var I=-1,C=h[0];e:for(;++I<c&&E.length<y;){var U=S[I],G=t?t(U):U;if(U=s||U!==0?U:0,!(C?xi(C,G):a(E,G,s))){for(d=p;--d;){var X=h[d];if(!(X?xi(X,G):a(e[d],G,s)))continue e}C&&C.push(G),E.push(U)}}return E}function sd(e,t,s,a){return Lt(e,function(c,p,d){t(a,s(c),p,d)}),a}function Ni(e,t,s){t=fn(t,e),e=Nu(e,t);var a=e==null?e:e[Dt(pt(t))];return a==null?i:Ze(a,e,s)}function Wo(e){return Ie(e)&&We(e)==en}function ad(e){return Ie(e)&&We(e)==Nn}function od(e){return Ie(e)&&We(e)==An}function Oi(e,t,s,a,c){return e===t?!0:e==null||t==null||!Ie(e)&&!Ie(t)?e!==e&&t!==t:ud(e,t,s,a,Oi,c)}function ud(e,t,s,a,c,p){var d=Q(e),h=Q(t),y=d?Gn:Be(e),E=h?Gn:Be(t);y=y==en?wt:y,E=E==en?wt:E;var S=y==wt,I=E==wt,C=y==E;if(C&&dn(e)){if(!dn(t))return!1;d=!0,S=!1}if(C&&!S)return p||(p=new St),d||si(e)?Tu(e,t,s,a,c,p):Pd(e,t,y,s,a,c,p);if(!(s&$)){var U=S&&pe.call(e,"__wrapped__"),G=I&&pe.call(t,"__wrapped__");if(U||G){var X=U?e.value():e,V=G?t.value():t;return p||(p=new St),c(X,V,s,a,p)}}return C?(p||(p=new St),kd(e,t,s,a,c,p)):!1}function cd(e){return Ie(e)&&Be(e)==Xe}function Us(e,t,s,a){var c=s.length,p=c,d=!a;if(e==null)return!p;for(e=ye(e);c--;){var h=s[c];if(d&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++c<p;){h=s[c];var y=h[0],E=e[y],S=h[1];if(d&&h[2]){if(E===i&&!(y in e))return!1}else{var I=new St;if(a)var C=a(E,S,y,e,t,I);if(!(C===i?Oi(S,E,$|he,a,I):C))return!1}}return!0}function Go(e){if(!Ae(e)||qd(e))return!1;var t=Gt(e)?cp:Kl;return t.test(Un(e))}function ld(e){return Ie(e)&&We(e)==tn}function fd(e){return Ie(e)&&Be(e)==Ke}function pd(e){return Ie(e)&&Pr(e.length)&&!!Te[We(e)]}function Vo(e){return typeof e=="function"?e:e==null?He:typeof e=="object"?Q(e)?zo(e[0],e[1]):Jo(e):pc(e)}function Ms(e){if(!Li(e))return gp(e);var t=[];for(var s in ye(e))pe.call(e,s)&&s!="constructor"&&t.push(s);return t}function dd(e){if(!Ae(e))return Hd(e);var t=Li(e),s=[];for(var a in e)a=="constructor"&&(t||!pe.call(e,a))||s.push(a);return s}function $s(e,t){return e<t}function qo(e,t){var s=-1,a=ze(e)?_(e.length):[];return cn(e,function(c,p,d){a[++s]=t(c,p,d)}),a}function Jo(e){var t=ea(e);return t.length==1&&t[0][2]?Iu(t[0][0],t[0][1]):function(s){return s===e||Us(s,e,t)}}function zo(e,t){return na(e)&&Au(t)?Iu(Dt(e),t):function(s){var a=pa(s,e);return a===i&&a===t?da(s,e):Oi(t,a,$|he)}}function _r(e,t,s,a,c){e!==t&&Fs(t,function(p,d){if(c||(c=new St),Ae(p))hd(e,t,d,s,_r,a,c);else{var h=a?a(ra(e,d),p,d+"",e,t,c):i;h===i&&(h=p),Cs(e,d,h)}},Qe)}function hd(e,t,s,a,c,p,d){var h=ra(e,s),y=ra(t,s),E=d.get(y);if(E){Cs(e,s,E);return}var S=p?p(h,y,s+"",e,t,d):i,I=S===i;if(I){var C=Q(y),U=!C&&dn(y),G=!C&&!U&&si(y);S=y,C||U||G?Q(h)?S=h:be(h)?S=Je(h):U?(I=!1,S=su(y,!0)):G?(I=!1,S=au(y,!0)):S=[]:Di(y)||Mn(y)?(S=h,Mn(h)?S=nc(h):(!Ae(h)||Gt(h))&&(S=Su(y))):I=!1}I&&(d.set(y,S),c(S,y,a,p,d),d.delete(y)),Cs(e,s,S)}function Qo(e,t){var s=e.length;if(s)return t+=t<0?s:0,Wt(t,s)?e[t]:i}function Ho(e,t,s){t.length?t=Ee(t,function(p){return Q(p)?function(d){return Pn(d,p.length===1?p[0]:p)}:p}):t=[He];var a=-1;t=Ee(t,et(j()));var c=qo(e,function(p,d,h){var y=Ee(t,function(E){return E(p)});return{criteria:y,index:++a,value:p}});return jf(c,function(p,d){return bd(p,d,s)})}function gd(e,t){return Yo(e,t,function(s,a){return da(e,a)})}function Yo(e,t,s){for(var a=-1,c=t.length,p={};++a<c;){var d=t[a],h=Pn(e,d);s(h,d)&&Ri(p,fn(d,e),h)}return p}function md(e){return function(t){return Pn(t,e)}}function Bs(e,t,s,a){var c=a?Bf:Qn,p=-1,d=t.length,h=e;for(e===t&&(t=Je(t)),s&&(h=Ee(e,et(s)));++p<d;)for(var y=0,E=t[p],S=s?s(E):E;(y=c(h,S,y,a))>-1;)h!==e&&cr.call(h,y,1),cr.call(e,y,1);return e}function Xo(e,t){for(var s=e?t.length:0,a=s-1;s--;){var c=t[s];if(s==a||c!==p){var p=c;Wt(c)?cr.call(e,c,1):Vs(e,c)}}return e}function js(e,t){return e+pr(Co()*(t-e+1))}function yd(e,t,s,a){for(var c=-1,p=Fe(fr((t-e)/(s||1)),0),d=_(p);p--;)d[a?p:++c]=e,e+=s;return d}function Ws(e,t){var s="";if(!e||t<1||t>Tt)return s;do t%2&&(s+=e),t=pr(t/2),t&&(e+=e);while(t);return s}function K(e,t){return sa(bu(e,t,He),e+"")}function vd(e){return Do(ai(e))}function _d(e,t){var s=ai(e);return Or(s,Dn(t,0,s.length))}function Ri(e,t,s,a){if(!Ae(e))return e;t=fn(t,e);for(var c=-1,p=t.length,d=p-1,h=e;h!=null&&++c<p;){var y=Dt(t[c]),E=s;if(y==="__proto__"||y==="constructor"||y==="prototype")return e;if(c!=d){var S=h[y];E=a?a(S,y,h):i,E===i&&(E=Ae(S)?S:Wt(t[c+1])?[]:{})}Ii(h,y,E),h=h[y]}return e}var Ko=dr?function(e,t){return dr.set(e,t),e}:He,xd=lr?function(e,t){return lr(e,"toString",{configurable:!0,enumerable:!1,value:ga(t),writable:!0})}:He;function Td(e){return Or(ai(e))}function ft(e,t,s){var a=-1,c=e.length;t<0&&(t=-t>c?0:c+t),s=s>c?c:s,s<0&&(s+=c),c=t>s?0:s-t>>>0,t>>>=0;for(var p=_(c);++a<c;)p[a]=e[a+t];return p}function wd(e,t){var s;return cn(e,function(a,c,p){return s=t(a,c,p),!s}),!!s}function xr(e,t,s){var a=0,c=e==null?a:e.length;if(typeof t=="number"&&t===t&&c<=Zr){for(;a<c;){var p=a+c>>>1,d=e[p];d!==null&&!nt(d)&&(s?d<=t:d<t)?a=p+1:c=p}return c}return Gs(e,t,He,s)}function Gs(e,t,s,a){var c=0,p=e==null?0:e.length;if(p===0)return 0;t=s(t);for(var d=t!==t,h=t===null,y=nt(t),E=t===i;c<p;){var S=pr((c+p)/2),I=s(e[S]),C=I!==i,U=I===null,G=I===I,X=nt(I);if(d)var V=a||G;else E?V=G&&(a||C):h?V=G&&C&&(a||!U):y?V=G&&C&&!U&&(a||!X):U||X?V=!1:V=a?I<=t:I<t;V?c=S+1:p=S}return $e(p,Kr)}function Zo(e,t){for(var s=-1,a=e.length,c=0,p=[];++s<a;){var d=e[s],h=t?t(d):d;if(!s||!At(h,y)){var y=h;p[c++]=d===0?0:d}}return p}function eu(e){return typeof e=="number"?e:nt(e)?Wn:+e}function tt(e){if(typeof e=="string")return e;if(Q(e))return Ee(e,tt)+"";if(nt(e))return Lo?Lo.call(e):"";var t=e+"";return t=="0"&&1/e==-Rt?"-0":t}function ln(e,t,s){var a=-1,c=Zi,p=e.length,d=!0,h=[],y=h;if(s)d=!1,c=vs;else if(p>=u){var E=t?null:Fd(e);if(E)return tr(E);d=!1,c=xi,y=new Fn}else y=t?[]:h;e:for(;++a<p;){var S=e[a],I=t?t(S):S;if(S=s||S!==0?S:0,d&&I===I){for(var C=y.length;C--;)if(y[C]===I)continue e;t&&y.push(I),h.push(S)}else c(y,I,s)||(y!==h&&y.push(I),h.push(S))}return h}function Vs(e,t){return t=fn(t,e),e=Nu(e,t),e==null||delete e[Dt(pt(t))]}function tu(e,t,s,a){return Ri(e,t,s(Pn(e,t)),a)}function Tr(e,t,s,a){for(var c=e.length,p=a?c:-1;(a?p--:++p<c)&&t(e[p],p,e););return s?ft(e,a?0:p,a?p+1:c):ft(e,a?p+1:0,a?c:p)}function nu(e,t){var s=e;return s instanceof te&&(s=s.value()),_s(t,function(a,c){return c.func.apply(c.thisArg,an([a],c.args))},s)}function qs(e,t,s){var a=e.length;if(a<2)return a?ln(e[0]):[];for(var c=-1,p=_(a);++c<a;)for(var d=e[c],h=-1;++h<a;)h!=c&&(p[c]=bi(p[c]||d,e[h],t,s));return ln(Me(p,1),t,s)}function iu(e,t,s){for(var a=-1,c=e.length,p=t.length,d={};++a<c;){var h=a<p?t[a]:i;s(d,e[a],h)}return d}function Js(e){return be(e)?e:[]}function zs(e){return typeof e=="function"?e:He}function fn(e,t){return Q(e)?e:na(e,t)?[e]:Lu(le(e))}var Ed=K;function pn(e,t,s){var a=e.length;return s=s===i?a:s,!t&&s>=a?e:ft(e,t,s)}var ru=lp||function(e){return Ue.clearTimeout(e)};function su(e,t){if(t)return e.slice();var s=e.length,a=Io?Io(s):new e.constructor(s);return e.copy(a),a}function Qs(e){var t=new e.constructor(e.byteLength);return new or(t).set(new or(e)),t}function Sd(e,t){var s=t?Qs(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Ad(e){var t=new e.constructor(e.source,ja.exec(e));return t.lastIndex=e.lastIndex,t}function Id(e){return Ai?ye(Ai.call(e)):{}}function au(e,t){var s=t?Qs(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function ou(e,t){if(e!==t){var s=e!==i,a=e===null,c=e===e,p=nt(e),d=t!==i,h=t===null,y=t===t,E=nt(t);if(!h&&!E&&!p&&e>t||p&&d&&y&&!h&&!E||a&&d&&y||!s&&y||!c)return 1;if(!a&&!p&&!E&&e<t||E&&s&&c&&!a&&!p||h&&s&&c||!d&&c||!y)return-1}return 0}function bd(e,t,s){for(var a=-1,c=e.criteria,p=t.criteria,d=c.length,h=s.length;++a<d;){var y=ou(c[a],p[a]);if(y){if(a>=h)return y;var E=s[a];return y*(E=="desc"?-1:1)}}return e.index-t.index}function uu(e,t,s,a){for(var c=-1,p=e.length,d=s.length,h=-1,y=t.length,E=Fe(p-d,0),S=_(y+E),I=!a;++h<y;)S[h]=t[h];for(;++c<d;)(I||c<p)&&(S[s[c]]=e[c]);for(;E--;)S[h++]=e[c++];return S}function cu(e,t,s,a){for(var c=-1,p=e.length,d=-1,h=s.length,y=-1,E=t.length,S=Fe(p-h,0),I=_(S+E),C=!a;++c<S;)I[c]=e[c];for(var U=c;++y<E;)I[U+y]=t[y];for(;++d<h;)(C||c<p)&&(I[U+s[d]]=e[c++]);return I}function Je(e,t){var s=-1,a=e.length;for(t||(t=_(a));++s<a;)t[s]=e[s];return t}function Ft(e,t,s,a){var c=!s;s||(s={});for(var p=-1,d=t.length;++p<d;){var h=t[p],y=a?a(s[h],e[h],h,s,e):i;y===i&&(y=e[h]),c?$t(s,h,y):Ii(s,h,y)}return s}function Nd(e,t){return Ft(e,ta(e),t)}function Od(e,t){return Ft(e,wu(e),t)}function wr(e,t){return function(s,a){var c=Q(s)?Df:Xp,p=t?t():{};return c(s,e,j(a,2),p)}}function ni(e){return K(function(t,s){var a=-1,c=s.length,p=c>1?s[c-1]:i,d=c>2?s[2]:i;for(p=e.length>3&&typeof p=="function"?(c--,p):i,d&&Ge(s[0],s[1],d)&&(p=c<3?i:p,c=1),t=ye(t);++a<c;){var h=s[a];h&&e(t,h,a,p)}return t})}function lu(e,t){return function(s,a){if(s==null)return s;if(!ze(s))return e(s,a);for(var c=s.length,p=t?c:-1,d=ye(s);(t?p--:++p<c)&&a(d[p],p,d)!==!1;);return s}}function fu(e){return function(t,s,a){for(var c=-1,p=ye(t),d=a(t),h=d.length;h--;){var y=d[e?h:++c];if(s(p[y],y,p)===!1)break}return t}}function Rd(e,t,s){var a=t&ae,c=Ci(e);function p(){var d=this&&this!==Ue&&this instanceof p?c:e;return d.apply(a?s:this,arguments)}return p}function pu(e){return function(t){t=le(t);var s=Hn(t)?Et(t):i,a=s?s[0]:t.charAt(0),c=s?pn(s,1).join(""):t.slice(1);return a[e]()+c}}function ii(e){return function(t){return _s(lc(cc(t).replace(xf,"")),e,"")}}function Ci(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 s=ti(e.prototype),a=e.apply(s,t);return Ae(a)?a:s}}function Cd(e,t,s){var a=Ci(e);function c(){for(var p=arguments.length,d=_(p),h=p,y=ri(c);h--;)d[h]=arguments[h];var E=p<3&&d[0]!==y&&d[p-1]!==y?[]:on(d,y);if(p-=E.length,p<s)return yu(e,t,Er,c.placeholder,i,d,E,i,i,s-p);var S=this&&this!==Ue&&this instanceof c?a:e;return Ze(S,this,d)}return c}function du(e){return function(t,s,a){var c=ye(t);if(!ze(t)){var p=j(s,3);t=Pe(t),s=function(h){return p(c[h],h,c)}}var d=e(t,s,a);return d>-1?c[p?t[d]:d]:i}}function hu(e){return jt(function(t){var s=t.length,a=s,c=ct.prototype.thru;for(e&&t.reverse();a--;){var p=t[a];if(typeof p!="function")throw new ut(g);if(c&&!d&&br(p)=="wrapper")var d=new ct([],!0)}for(a=d?a:s;++a<s;){p=t[a];var h=br(p),y=h=="wrapper"?Zs(p):i;y&&ia(y[0])&&y[1]==(ce|xe|ee|qe)&&!y[4].length&&y[9]==1?d=d[br(y[0])].apply(d,y[3]):d=p.length==1&&ia(p)?d[h]():d.thru(p)}return function(){var E=arguments,S=E[0];if(d&&E.length==1&&Q(S))return d.plant(S).value();for(var I=0,C=s?t[I].apply(this,E):S;++I<s;)C=t[I].call(this,C);return C}})}function Er(e,t,s,a,c,p,d,h,y,E){var S=t&ce,I=t&ae,C=t&me,U=t&(xe|L),G=t&x,X=C?i:Ci(e);function V(){for(var Z=arguments.length,ie=_(Z),it=Z;it--;)ie[it]=arguments[it];if(U)var Ve=ri(V),rt=Gf(ie,Ve);if(a&&(ie=uu(ie,a,c,U)),p&&(ie=cu(ie,p,d,U)),Z-=rt,U&&Z<E){var Ne=on(ie,Ve);return yu(e,t,Er,V.placeholder,s,ie,Ne,h,y,E-Z)}var It=I?s:this,qt=C?It[e]:e;return Z=ie.length,h?ie=Xd(ie,h):G&&Z>1&&ie.reverse(),S&&y<Z&&(ie.length=y),this&&this!==Ue&&this instanceof V&&(qt=X||Ci(qt)),qt.apply(It,ie)}return V}function gu(e,t){return function(s,a){return sd(s,e,t(a),{})}}function Sr(e,t){return function(s,a){var c;if(s===i&&a===i)return t;if(s!==i&&(c=s),a!==i){if(c===i)return a;typeof s=="string"||typeof a=="string"?(s=tt(s),a=tt(a)):(s=eu(s),a=eu(a)),c=e(s,a)}return c}}function Hs(e){return jt(function(t){return t=Ee(t,et(j())),K(function(s){var a=this;return e(t,function(c){return Ze(c,a,s)})})})}function Ar(e,t){t=t===i?" ":tt(t);var s=t.length;if(s<2)return s?Ws(t,e):t;var a=Ws(t,fr(e/Yn(t)));return Hn(t)?pn(Et(a),0,e).join(""):a.slice(0,e)}function Ld(e,t,s,a){var c=t&ae,p=Ci(e);function d(){for(var h=-1,y=arguments.length,E=-1,S=a.length,I=_(S+y),C=this&&this!==Ue&&this instanceof d?p:e;++E<S;)I[E]=a[E];for(;y--;)I[E++]=arguments[++h];return Ze(C,c?s:this,I)}return d}function mu(e){return function(t,s,a){return a&&typeof a!="number"&&Ge(t,s,a)&&(s=a=i),t=Vt(t),s===i?(s=t,t=0):s=Vt(s),a=a===i?t<s?1:-1:Vt(a),yd(t,s,a,e)}}function Ir(e){return function(t,s){return typeof t=="string"&&typeof s=="string"||(t=dt(t),s=dt(s)),e(t,s)}}function yu(e,t,s,a,c,p,d,h,y,E){var S=t&xe,I=S?d:i,C=S?i:d,U=S?p:i,G=S?i:p;t|=S?ee:H,t&=~(S?H:ee),t&Ye||(t&=-4);var X=[e,t,c,U,I,G,C,h,y,E],V=s.apply(i,X);return ia(e)&&Ou(V,X),V.placeholder=a,Ru(V,e,t)}function Ys(e){var t=Le[e];return function(s,a){if(s=dt(s),a=a==null?0:$e(Y(a),292),a&&Ro(s)){var c=(le(s)+"e").split("e"),p=t(c[0]+"e"+(+c[1]+a));return c=(le(p)+"e").split("e"),+(c[0]+"e"+(+c[1]-a))}return t(s)}}var Fd=Zn&&1/tr(new Zn([,-0]))[1]==Rt?function(e){return new Zn(e)}:va;function vu(e){return function(t){var s=Be(t);return s==Xe?Is(t):s==Ke?Yf(t):Wf(t,e(t))}}function Bt(e,t,s,a,c,p,d,h){var y=t&me;if(!y&&typeof e!="function")throw new ut(g);var E=a?a.length:0;if(E||(t&=-97,a=c=i),d=d===i?d:Fe(Y(d),0),h=h===i?h:Y(h),E-=c?c.length:0,t&H){var S=a,I=c;a=c=i}var C=y?i:Zs(e),U=[e,t,s,a,c,S,I,p,d,h];if(C&&Qd(U,C),e=U[0],t=U[1],s=U[2],a=U[3],c=U[4],h=U[9]=U[9]===i?y?0:e.length:Fe(U[9]-E,0),!h&&t&(xe|L)&&(t&=-25),!t||t==ae)var G=Rd(e,t,s);else t==xe||t==L?G=Cd(e,t,h):(t==ee||t==(ae|ee))&&!c.length?G=Ld(e,t,s,a):G=Er.apply(i,U);var X=C?Ko:Ou;return Ru(X(G,U),e,t)}function _u(e,t,s,a){return e===i||At(e,Kn[s])&&!pe.call(a,s)?t:e}function xu(e,t,s,a,c,p){return Ae(e)&&Ae(t)&&(p.set(t,e),_r(e,t,i,xu,p),p.delete(t)),e}function Dd(e){return Di(e)?i:e}function Tu(e,t,s,a,c,p){var d=s&$,h=e.length,y=t.length;if(h!=y&&!(d&&y>h))return!1;var E=p.get(e),S=p.get(t);if(E&&S)return E==t&&S==e;var I=-1,C=!0,U=s&he?new Fn:i;for(p.set(e,t),p.set(t,e);++I<h;){var G=e[I],X=t[I];if(a)var V=d?a(X,G,I,t,e,p):a(G,X,I,e,t,p);if(V!==i){if(V)continue;C=!1;break}if(U){if(!xs(t,function(Z,ie){if(!xi(U,ie)&&(G===Z||c(G,Z,s,a,p)))return U.push(ie)})){C=!1;break}}else if(!(G===X||c(G,X,s,a,p))){C=!1;break}}return p.delete(e),p.delete(t),C}function Pd(e,t,s,a,c,p,d){switch(s){case rn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Nn:return!(e.byteLength!=t.byteLength||!p(new or(e),new or(t)));case Sn:case An:case In:return At(+e,+t);case Vn:return e.name==t.name&&e.message==t.message;case tn:case bn:return e==t+"";case Xe:var h=Is;case Ke:var y=a&$;if(h||(h=tr),e.size!=t.size&&!y)return!1;var E=d.get(e);if(E)return E==t;a|=he,d.set(e,t);var S=Tu(h(e),h(t),a,c,p,d);return d.delete(e),S;case Jn:if(Ai)return Ai.call(e)==Ai.call(t)}return!1}function kd(e,t,s,a,c,p){var d=s&$,h=Xs(e),y=h.length,E=Xs(t),S=E.length;if(y!=S&&!d)return!1;for(var I=y;I--;){var C=h[I];if(!(d?C in t:pe.call(t,C)))return!1}var U=p.get(e),G=p.get(t);if(U&&G)return U==t&&G==e;var X=!0;p.set(e,t),p.set(t,e);for(var V=d;++I<y;){C=h[I];var Z=e[C],ie=t[C];if(a)var it=d?a(ie,Z,C,t,e,p):a(Z,ie,C,e,t,p);if(!(it===i?Z===ie||c(Z,ie,s,a,p):it)){X=!1;break}V||(V=C=="constructor")}if(X&&!V){var Ve=e.constructor,rt=t.constructor;Ve!=rt&&"constructor"in e&&"constructor"in t&&!(typeof Ve=="function"&&Ve instanceof Ve&&typeof rt=="function"&&rt instanceof rt)&&(X=!1)}return p.delete(e),p.delete(t),X}function jt(e){return sa(bu(e,i,ku),e+"")}function Xs(e){return jo(e,Pe,ta)}function Ks(e){return jo(e,Qe,wu)}var Zs=dr?function(e){return dr.get(e)}:va;function br(e){for(var t=e.name+"",s=ei[t],a=pe.call(ei,t)?s.length:0;a--;){var c=s[a],p=c.func;if(p==null||p==e)return c.name}return t}function ri(e){var t=pe.call(l,"placeholder")?l:e;return t.placeholder}function j(){var e=l.iteratee||ma;return e=e===ma?Vo:e,arguments.length?e(arguments[0],arguments[1]):e}function Nr(e,t){var s=e.__data__;return Vd(t)?s[typeof t=="string"?"string":"hash"]:s.map}function ea(e){for(var t=Pe(e),s=t.length;s--;){var a=t[s],c=e[a];t[s]=[a,c,Au(c)]}return t}function kn(e,t){var s=zf(e,t);return Go(s)?s:i}function Ud(e){var t=pe.call(e,Cn),s=e[Cn];try{e[Cn]=i;var a=!0}catch{}var c=sr.call(e);return a&&(t?e[Cn]=s:delete e[Cn]),c}var ta=Ns?function(e){return e==null?[]:(e=ye(e),sn(Ns(e),function(t){return No.call(e,t)}))}:_a,wu=Ns?function(e){for(var t=[];e;)an(t,ta(e)),e=ur(e);return t}:_a,Be=We;(Os&&Be(new Os(new ArrayBuffer(1)))!=rn||wi&&Be(new wi)!=Xe||Rs&&Be(Rs.resolve())!=vi||Zn&&Be(new Zn)!=Ke||Ei&&Be(new Ei)!=nn)&&(Be=function(e){var t=We(e),s=t==wt?e.constructor:i,a=s?Un(s):"";if(a)switch(a){case _p:return rn;case xp:return Xe;case Tp:return vi;case wp:return Ke;case Ep:return nn}return t});function Md(e,t,s){for(var a=-1,c=s.length;++a<c;){var p=s[a],d=p.size;switch(p.type){case"drop":e+=d;break;case"dropRight":t-=d;break;case"take":t=$e(t,e+d);break;case"takeRight":e=Fe(e,t-d);break}}return{start:e,end:t}}function $d(e){var t=e.match(Vl);return t?t[1].split(ql):[]}function Eu(e,t,s){t=fn(t,e);for(var a=-1,c=t.length,p=!1;++a<c;){var d=Dt(t[a]);if(!(p=e!=null&&s(e,d)))break;e=e[d]}return p||++a!=c?p:(c=e==null?0:e.length,!!c&&Pr(c)&&Wt(d,c)&&(Q(e)||Mn(e)))}function Bd(e){var t=e.length,s=new e.constructor(t);return t&&typeof e[0]=="string"&&pe.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function Su(e){return typeof e.constructor=="function"&&!Li(e)?ti(ur(e)):{}}function jd(e,t,s){var a=e.constructor;switch(t){case Nn:return Qs(e);case Sn:case An:return new a(+e);case rn:return Sd(e,s);case W:case Ce:case Ct:case Hi:case On:case _i:case as:case os:case us:return au(e,s);case Xe:return new a;case In:case bn:return new a(e);case tn:return Ad(e);case Ke:return new a;case Jn:return Id(e)}}function Wd(e,t){var s=t.length;if(!s)return e;var a=s-1;return t[a]=(s>1?"& ":"")+t[a],t=t.join(s>2?", ":" "),e.replace(Gl,`{
|
|
381
|
+
*/var Tx=$i.exports,Lc;function wx(){return Lc||(Lc=1,function(n,r){(function(){var i,o="4.17.21",u=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",g="Expected a function",v="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",b=500,O="__lodash_placeholder__",D=1,P=2,M=4,$=1,he=2,ae=1,me=2,Ye=4,xe=8,L=16,ee=32,H=64,ce=128,qe=256,x=512,q=30,Se="...",xt=800,en=16,Vi=1,qi=2,Ji=3,Rt=1/0,Tt=9007199254740991,Xr=17976931348623157e292,Wn=NaN,st=4294967295,Kr=st-1,Zr=st>>>1,es=[["ary",ce],["bind",ae],["bindKey",me],["curry",xe],["curryRight",L],["flip",x],["partial",ee],["partialRight",H],["rearg",qe]],tn="[object Arguments]",Gn="[object Array]",ts="[object AsyncFunction]",Sn="[object Boolean]",An="[object Date]",ns="[object DOMException]",Vn="[object Error]",qn="[object Function]",zi="[object GeneratorFunction]",Xe="[object Map]",In="[object Number]",is="[object Null]",wt="[object Object]",vi="[object Promise]",Qi="[object Proxy]",nn="[object RegExp]",Ke="[object Set]",bn="[object String]",Jn="[object Symbol]",rs="[object Undefined]",rn="[object WeakMap]",ss="[object WeakSet]",Nn="[object ArrayBuffer]",sn="[object DataView]",W="[object Float32Array]",Ce="[object Float64Array]",Ct="[object Int8Array]",Hi="[object Int16Array]",On="[object Int32Array]",_i="[object Uint8Array]",as="[object Uint8ClampedArray]",os="[object Uint16Array]",us="[object Uint32Array]",Cl=/\b__p \+= '';/g,Ll=/\b(__p \+=) '' \+/g,Fl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ma=/&(?:amp|lt|gt|quot|#39);/g,$a=/[&<>"']/g,Dl=RegExp(Ma.source),Pl=RegExp($a.source),kl=/<%-([\s\S]+?)%>/g,Ul=/<%([\s\S]+?)%>/g,Ba=/<%=([\s\S]+?)%>/g,Ml=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$l=/^\w*$/,Bl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cs=/[\\^$.*+?()[\]{}|]/g,jl=RegExp(cs.source),ls=/^\s+/,Wl=/\s/,Gl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vl=/\{\n\/\* \[wrapped with (.+)\] \*/,ql=/,? & /,Jl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zl=/[()=,{}\[\]\/\s]/,Ql=/\\(\\)?/g,Hl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ja=/\w*$/,Yl=/^[-+]0x[0-9a-f]+$/i,Xl=/^0b[01]+$/i,Kl=/^\[object .+?Constructor\]$/,Zl=/^0o[0-7]+$/i,ef=/^(?:0|[1-9]\d*)$/,tf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yi=/($^)/,nf=/['\n\r\u2028\u2029\\]/g,Xi="\\ud800-\\udfff",rf="\\u0300-\\u036f",sf="\\ufe20-\\ufe2f",af="\\u20d0-\\u20ff",Wa=rf+sf+af,Ga="\\u2700-\\u27bf",Va="a-z\\xdf-\\xf6\\xf8-\\xff",of="\\xac\\xb1\\xd7\\xf7",uf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",cf="\\u2000-\\u206f",lf=" \\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",qa="A-Z\\xc0-\\xd6\\xd8-\\xde",Ja="\\ufe0e\\ufe0f",za=of+uf+cf+lf,fs="['’]",ff="["+Xi+"]",Qa="["+za+"]",Ki="["+Wa+"]",Ha="\\d+",pf="["+Ga+"]",Ya="["+Va+"]",Xa="[^"+Xi+za+Ha+Ga+Va+qa+"]",ps="\\ud83c[\\udffb-\\udfff]",df="(?:"+Ki+"|"+ps+")",Ka="[^"+Xi+"]",ds="(?:\\ud83c[\\udde6-\\uddff]){2}",hs="[\\ud800-\\udbff][\\udc00-\\udfff]",zn="["+qa+"]",Za="\\u200d",eo="(?:"+Ya+"|"+Xa+")",hf="(?:"+zn+"|"+Xa+")",to="(?:"+fs+"(?:d|ll|m|re|s|t|ve))?",no="(?:"+fs+"(?:D|LL|M|RE|S|T|VE))?",io=df+"?",ro="["+Ja+"]?",gf="(?:"+Za+"(?:"+[Ka,ds,hs].join("|")+")"+ro+io+")*",mf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",so=ro+io+gf,vf="(?:"+[pf,ds,hs].join("|")+")"+so,_f="(?:"+[Ka+Ki+"?",Ki,ds,hs,ff].join("|")+")",xf=RegExp(fs,"g"),Tf=RegExp(Ki,"g"),gs=RegExp(ps+"(?="+ps+")|"+_f+so,"g"),wf=RegExp([zn+"?"+Ya+"+"+to+"(?="+[Qa,zn,"$"].join("|")+")",hf+"+"+no+"(?="+[Qa,zn+eo,"$"].join("|")+")",zn+"?"+eo+"+"+to,zn+"+"+no,yf,mf,Ha,vf].join("|"),"g"),Ef=RegExp("["+Za+Xi+Wa+Ja+"]"),Sf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Af=["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"],If=-1,Te={};Te[W]=Te[Ce]=Te[Ct]=Te[Hi]=Te[On]=Te[_i]=Te[as]=Te[os]=Te[us]=!0,Te[tn]=Te[Gn]=Te[Nn]=Te[Sn]=Te[sn]=Te[An]=Te[Vn]=Te[qn]=Te[Xe]=Te[In]=Te[wt]=Te[nn]=Te[Ke]=Te[bn]=Te[rn]=!1;var _e={};_e[tn]=_e[Gn]=_e[Nn]=_e[sn]=_e[Sn]=_e[An]=_e[W]=_e[Ce]=_e[Ct]=_e[Hi]=_e[On]=_e[Xe]=_e[In]=_e[wt]=_e[nn]=_e[Ke]=_e[bn]=_e[Jn]=_e[_i]=_e[as]=_e[os]=_e[us]=!0,_e[Vn]=_e[qn]=_e[rn]=!1;var bf={À:"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"},Nf={"&":"&","<":"<",">":">",'"':""","'":"'"},Of={"&":"&","<":"<",">":">",""":'"',"'":"'"},Rf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cf=parseFloat,Lf=parseInt,ao=typeof B.commonjsGlobal=="object"&&B.commonjsGlobal&&B.commonjsGlobal.Object===Object&&B.commonjsGlobal,Ff=typeof self=="object"&&self&&self.Object===Object&&self,Ue=ao||Ff||Function("return this")(),ms=r&&!r.nodeType&&r,Rn=ms&&!0&&n&&!n.nodeType&&n,oo=Rn&&Rn.exports===ms,ys=oo&&ao.process,at=function(){try{var m=Rn&&Rn.require&&Rn.require("util").types;return m||ys&&ys.binding&&ys.binding("util")}catch{}}(),uo=at&&at.isArrayBuffer,co=at&&at.isDate,lo=at&&at.isMap,fo=at&&at.isRegExp,po=at&&at.isSet,ho=at&&at.isTypedArray;function Ze(m,T,_){switch(_.length){case 0:return m.call(T);case 1:return m.call(T,_[0]);case 2:return m.call(T,_[0],_[1]);case 3:return m.call(T,_[0],_[1],_[2])}return m.apply(T,_)}function Df(m,T,_,F){for(var z=-1,oe=m==null?0:m.length;++z<oe;){var Le=m[z];T(F,Le,_(Le),m)}return F}function ot(m,T){for(var _=-1,F=m==null?0:m.length;++_<F&&T(m[_],_,m)!==!1;);return m}function Pf(m,T){for(var _=m==null?0:m.length;_--&&T(m[_],_,m)!==!1;);return m}function go(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(!T(m[_],_,m))return!1;return!0}function an(m,T){for(var _=-1,F=m==null?0:m.length,z=0,oe=[];++_<F;){var Le=m[_];T(Le,_,m)&&(oe[z++]=Le)}return oe}function Zi(m,T){var _=m==null?0:m.length;return!!_&&Qn(m,T,0)>-1}function vs(m,T,_){for(var F=-1,z=m==null?0:m.length;++F<z;)if(_(T,m[F]))return!0;return!1}function Ee(m,T){for(var _=-1,F=m==null?0:m.length,z=Array(F);++_<F;)z[_]=T(m[_],_,m);return z}function on(m,T){for(var _=-1,F=T.length,z=m.length;++_<F;)m[z+_]=T[_];return m}function _s(m,T,_,F){var z=-1,oe=m==null?0:m.length;for(F&&oe&&(_=m[++z]);++z<oe;)_=T(_,m[z],z,m);return _}function kf(m,T,_,F){var z=m==null?0:m.length;for(F&&z&&(_=m[--z]);z--;)_=T(_,m[z],z,m);return _}function xs(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(T(m[_],_,m))return!0;return!1}var Uf=Ts("length");function Mf(m){return m.split("")}function $f(m){return m.match(Jl)||[]}function mo(m,T,_){var F;return _(m,function(z,oe,Le){if(T(z,oe,Le))return F=oe,!1}),F}function er(m,T,_,F){for(var z=m.length,oe=_+(F?1:-1);F?oe--:++oe<z;)if(T(m[oe],oe,m))return oe;return-1}function Qn(m,T,_){return T===T?Xf(m,T,_):er(m,yo,_)}function Bf(m,T,_,F){for(var z=_-1,oe=m.length;++z<oe;)if(F(m[z],T))return z;return-1}function yo(m){return m!==m}function vo(m,T){var _=m==null?0:m.length;return _?Es(m,T)/_:Wn}function Ts(m){return function(T){return T==null?i:T[m]}}function ws(m){return function(T){return m==null?i:m[T]}}function _o(m,T,_,F,z){return z(m,function(oe,Le,ye){_=F?(F=!1,oe):T(_,oe,Le,ye)}),_}function jf(m,T){var _=m.length;for(m.sort(T);_--;)m[_]=m[_].value;return m}function Es(m,T){for(var _,F=-1,z=m.length;++F<z;){var oe=T(m[F]);oe!==i&&(_=_===i?oe:_+oe)}return _}function Ss(m,T){for(var _=-1,F=Array(m);++_<m;)F[_]=T(_);return F}function Wf(m,T){return Ee(T,function(_){return[_,m[_]]})}function xo(m){return m&&m.slice(0,So(m)+1).replace(ls,"")}function et(m){return function(T){return m(T)}}function As(m,T){return Ee(T,function(_){return m[_]})}function xi(m,T){return m.has(T)}function To(m,T){for(var _=-1,F=m.length;++_<F&&Qn(T,m[_],0)>-1;);return _}function wo(m,T){for(var _=m.length;_--&&Qn(T,m[_],0)>-1;);return _}function Gf(m,T){for(var _=m.length,F=0;_--;)m[_]===T&&++F;return F}var Vf=ws(bf),qf=ws(Nf);function Jf(m){return"\\"+Rf[m]}function zf(m,T){return m==null?i:m[T]}function Hn(m){return Ef.test(m)}function Qf(m){return Sf.test(m)}function Hf(m){for(var T,_=[];!(T=m.next()).done;)_.push(T.value);return _}function Is(m){var T=-1,_=Array(m.size);return m.forEach(function(F,z){_[++T]=[z,F]}),_}function Eo(m,T){return function(_){return m(T(_))}}function un(m,T){for(var _=-1,F=m.length,z=0,oe=[];++_<F;){var Le=m[_];(Le===T||Le===O)&&(m[_]=O,oe[z++]=_)}return oe}function tr(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=F}),_}function Yf(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=[F,F]}),_}function Xf(m,T,_){for(var F=_-1,z=m.length;++F<z;)if(m[F]===T)return F;return-1}function Kf(m,T,_){for(var F=_+1;F--;)if(m[F]===T)return F;return F}function Yn(m){return Hn(m)?ep(m):Uf(m)}function Et(m){return Hn(m)?tp(m):Mf(m)}function So(m){for(var T=m.length;T--&&Wl.test(m.charAt(T)););return T}var Zf=ws(Of);function ep(m){for(var T=gs.lastIndex=0;gs.test(m);)++T;return T}function tp(m){return m.match(gs)||[]}function np(m){return m.match(wf)||[]}var ip=function m(T){T=T==null?Ue:Xn.defaults(Ue.Object(),T,Xn.pick(Ue,Af));var _=T.Array,F=T.Date,z=T.Error,oe=T.Function,Le=T.Math,ye=T.Object,bs=T.RegExp,rp=T.String,ut=T.TypeError,nr=_.prototype,sp=oe.prototype,Kn=ye.prototype,ir=T["__core-js_shared__"],rr=sp.toString,pe=Kn.hasOwnProperty,ap=0,Ao=function(){var e=/[^.]+$/.exec(ir&&ir.keys&&ir.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),sr=Kn.toString,op=rr.call(ye),up=Ue._,cp=bs("^"+rr.call(pe).replace(cs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ar=oo?T.Buffer:i,cn=T.Symbol,or=T.Uint8Array,Io=ar?ar.allocUnsafe:i,ur=Eo(ye.getPrototypeOf,ye),bo=ye.create,No=Kn.propertyIsEnumerable,cr=nr.splice,Oo=cn?cn.isConcatSpreadable:i,Ti=cn?cn.iterator:i,Cn=cn?cn.toStringTag:i,lr=function(){try{var e=kn(ye,"defineProperty");return e({},"",{}),e}catch{}}(),lp=T.clearTimeout!==Ue.clearTimeout&&T.clearTimeout,fp=F&&F.now!==Ue.Date.now&&F.now,pp=T.setTimeout!==Ue.setTimeout&&T.setTimeout,fr=Le.ceil,pr=Le.floor,Ns=ye.getOwnPropertySymbols,dp=ar?ar.isBuffer:i,Ro=T.isFinite,hp=nr.join,gp=Eo(ye.keys,ye),Fe=Le.max,$e=Le.min,mp=F.now,yp=T.parseInt,Co=Le.random,vp=nr.reverse,Os=kn(T,"DataView"),wi=kn(T,"Map"),Rs=kn(T,"Promise"),Zn=kn(T,"Set"),Ei=kn(T,"WeakMap"),Si=kn(ye,"create"),dr=Ei&&new Ei,ei={},_p=Un(Os),xp=Un(wi),Tp=Un(Rs),wp=Un(Zn),Ep=Un(Ei),hr=cn?cn.prototype:i,Ai=hr?hr.valueOf:i,Lo=hr?hr.toString:i;function l(e){if(Ie(e)&&!Q(e)&&!(e instanceof te)){if(e instanceof ct)return e;if(pe.call(e,"__wrapped__"))return Fu(e)}return new ct(e)}var ti=function(){function e(){}return function(t){if(!Ae(t))return{};if(bo)return bo(t);e.prototype=t;var s=new e;return e.prototype=i,s}}();function gr(){}function ct(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}l.templateSettings={escape:kl,evaluate:Ul,interpolate:Ba,variable:"",imports:{_:l}},l.prototype=gr.prototype,l.prototype.constructor=l,ct.prototype=ti(gr.prototype),ct.prototype.constructor=ct;function te(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=st,this.__views__=[]}function Sp(){var e=new te(this.__wrapped__);return e.__actions__=Je(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Je(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Je(this.__views__),e}function Ap(){if(this.__filtered__){var e=new te(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Ip(){var e=this.__wrapped__.value(),t=this.__dir__,s=Q(e),a=t<0,c=s?e.length:0,p=Md(0,c,this.__views__),d=p.start,h=p.end,y=h-d,E=a?h:d-1,S=this.__iteratees__,I=S.length,C=0,U=$e(y,this.__takeCount__);if(!s||!a&&c==y&&U==y)return nu(e,this.__actions__);var G=[];e:for(;y--&&C<U;){E+=t;for(var X=-1,V=e[E];++X<I;){var Z=S[X],ie=Z.iteratee,it=Z.type,Ve=ie(V);if(it==qi)V=Ve;else if(!Ve){if(it==Vi)continue e;break e}}G[C++]=V}return G}te.prototype=ti(gr.prototype),te.prototype.constructor=te;function Ln(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function bp(){this.__data__=Si?Si(null):{},this.size=0}function Np(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Op(e){var t=this.__data__;if(Si){var s=t[e];return s===w?i:s}return pe.call(t,e)?t[e]:i}function Rp(e){var t=this.__data__;return Si?t[e]!==i:pe.call(t,e)}function Cp(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=Si&&t===i?w:t,this}Ln.prototype.clear=bp,Ln.prototype.delete=Np,Ln.prototype.get=Op,Ln.prototype.has=Rp,Ln.prototype.set=Cp;function Mt(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function Lp(){this.__data__=[],this.size=0}function Fp(e){var t=this.__data__,s=mr(t,e);if(s<0)return!1;var a=t.length-1;return s==a?t.pop():cr.call(t,s,1),--this.size,!0}function Dp(e){var t=this.__data__,s=mr(t,e);return s<0?i:t[s][1]}function Pp(e){return mr(this.__data__,e)>-1}function kp(e,t){var s=this.__data__,a=mr(s,e);return a<0?(++this.size,s.push([e,t])):s[a][1]=t,this}Mt.prototype.clear=Lp,Mt.prototype.delete=Fp,Mt.prototype.get=Dp,Mt.prototype.has=Pp,Mt.prototype.set=kp;function $t(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function Up(){this.size=0,this.__data__={hash:new Ln,map:new(wi||Mt),string:new Ln}}function Mp(e){var t=Nr(this,e).delete(e);return this.size-=t?1:0,t}function $p(e){return Nr(this,e).get(e)}function Bp(e){return Nr(this,e).has(e)}function jp(e,t){var s=Nr(this,e),a=s.size;return s.set(e,t),this.size+=s.size==a?0:1,this}$t.prototype.clear=Up,$t.prototype.delete=Mp,$t.prototype.get=$p,$t.prototype.has=Bp,$t.prototype.set=jp;function Fn(e){var t=-1,s=e==null?0:e.length;for(this.__data__=new $t;++t<s;)this.add(e[t])}function Wp(e){return this.__data__.set(e,w),this}function Gp(e){return this.__data__.has(e)}Fn.prototype.add=Fn.prototype.push=Wp,Fn.prototype.has=Gp;function St(e){var t=this.__data__=new Mt(e);this.size=t.size}function Vp(){this.__data__=new Mt,this.size=0}function qp(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}function Jp(e){return this.__data__.get(e)}function zp(e){return this.__data__.has(e)}function Qp(e,t){var s=this.__data__;if(s instanceof Mt){var a=s.__data__;if(!wi||a.length<u-1)return a.push([e,t]),this.size=++s.size,this;s=this.__data__=new $t(a)}return s.set(e,t),this.size=s.size,this}St.prototype.clear=Vp,St.prototype.delete=qp,St.prototype.get=Jp,St.prototype.has=zp,St.prototype.set=Qp;function Fo(e,t){var s=Q(e),a=!s&&Mn(e),c=!s&&!a&&hn(e),p=!s&&!a&&!c&&si(e),d=s||a||c||p,h=d?Ss(e.length,rp):[],y=h.length;for(var E in e)(t||pe.call(e,E))&&!(d&&(E=="length"||c&&(E=="offset"||E=="parent")||p&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||Gt(E,y)))&&h.push(E);return h}function Do(e){var t=e.length;return t?e[js(0,t-1)]:i}function Hp(e,t){return Or(Je(e),Dn(t,0,e.length))}function Yp(e){return Or(Je(e))}function Cs(e,t,s){(s!==i&&!At(e[t],s)||s===i&&!(t in e))&&Bt(e,t,s)}function Ii(e,t,s){var a=e[t];(!(pe.call(e,t)&&At(a,s))||s===i&&!(t in e))&&Bt(e,t,s)}function mr(e,t){for(var s=e.length;s--;)if(At(e[s][0],t))return s;return-1}function Xp(e,t,s,a){return ln(e,function(c,p,d){t(a,c,s(c),d)}),a}function Po(e,t){return e&&Ft(t,Pe(t),e)}function Kp(e,t){return e&&Ft(t,Qe(t),e)}function Bt(e,t,s){t=="__proto__"&&lr?lr(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}function Ls(e,t){for(var s=-1,a=t.length,c=_(a),p=e==null;++s<a;)c[s]=p?i:pa(e,t[s]);return c}function Dn(e,t,s){return e===e&&(s!==i&&(e=e<=s?e:s),t!==i&&(e=e>=t?e:t)),e}function lt(e,t,s,a,c,p){var d,h=t&D,y=t&P,E=t&M;if(s&&(d=c?s(e,a,c,p):s(e)),d!==i)return d;if(!Ae(e))return e;var S=Q(e);if(S){if(d=Bd(e),!h)return Je(e,d)}else{var I=Be(e),C=I==qn||I==zi;if(hn(e))return su(e,h);if(I==wt||I==tn||C&&!c){if(d=y||C?{}:Su(e),!h)return y?Od(e,Kp(d,e)):Nd(e,Po(d,e))}else{if(!_e[I])return c?e:{};d=jd(e,I,h)}}p||(p=new St);var U=p.get(e);if(U)return U;p.set(e,d),Zu(e)?e.forEach(function(V){d.add(lt(V,t,s,V,e,p))}):Xu(e)&&e.forEach(function(V,Z){d.set(Z,lt(V,t,s,Z,e,p))});var G=E?y?Ks:Xs:y?Qe:Pe,X=S?i:G(e);return ot(X||e,function(V,Z){X&&(Z=V,V=e[Z]),Ii(d,Z,lt(V,t,s,Z,e,p))}),d}function Zp(e){var t=Pe(e);return function(s){return ko(s,e,t)}}function ko(e,t,s){var a=s.length;if(e==null)return!a;for(e=ye(e);a--;){var c=s[a],p=t[c],d=e[c];if(d===i&&!(c in e)||!p(d))return!1}return!0}function Uo(e,t,s){if(typeof e!="function")throw new ut(g);return Fi(function(){e.apply(i,s)},t)}function bi(e,t,s,a){var c=-1,p=Zi,d=!0,h=e.length,y=[],E=t.length;if(!h)return y;s&&(t=Ee(t,et(s))),a?(p=vs,d=!1):t.length>=u&&(p=xi,d=!1,t=new Fn(t));e:for(;++c<h;){var S=e[c],I=s==null?S:s(S);if(S=a||S!==0?S:0,d&&I===I){for(var C=E;C--;)if(t[C]===I)continue e;y.push(S)}else p(t,I,a)||y.push(S)}return y}var ln=lu(Lt),Mo=lu(Ds,!0);function ed(e,t){var s=!0;return ln(e,function(a,c,p){return s=!!t(a,c,p),s}),s}function yr(e,t,s){for(var a=-1,c=e.length;++a<c;){var p=e[a],d=t(p);if(d!=null&&(h===i?d===d&&!nt(d):s(d,h)))var h=d,y=p}return y}function td(e,t,s,a){var c=e.length;for(s=Y(s),s<0&&(s=-s>c?0:c+s),a=a===i||a>c?c:Y(a),a<0&&(a+=c),a=s>a?0:tc(a);s<a;)e[s++]=t;return e}function $o(e,t){var s=[];return ln(e,function(a,c,p){t(a,c,p)&&s.push(a)}),s}function Me(e,t,s,a,c){var p=-1,d=e.length;for(s||(s=Gd),c||(c=[]);++p<d;){var h=e[p];t>0&&s(h)?t>1?Me(h,t-1,s,a,c):on(c,h):a||(c[c.length]=h)}return c}var Fs=fu(),Bo=fu(!0);function Lt(e,t){return e&&Fs(e,t,Pe)}function Ds(e,t){return e&&Bo(e,t,Pe)}function vr(e,t){return an(t,function(s){return Vt(e[s])})}function Pn(e,t){t=pn(t,e);for(var s=0,a=t.length;e!=null&&s<a;)e=e[Dt(t[s++])];return s&&s==a?e:i}function jo(e,t,s){var a=t(e);return Q(e)?a:on(a,s(e))}function We(e){return e==null?e===i?rs:is:Cn&&Cn in ye(e)?Ud(e):Yd(e)}function Ps(e,t){return e>t}function nd(e,t){return e!=null&&pe.call(e,t)}function id(e,t){return e!=null&&t in ye(e)}function rd(e,t,s){return e>=$e(t,s)&&e<Fe(t,s)}function ks(e,t,s){for(var a=s?vs:Zi,c=e[0].length,p=e.length,d=p,h=_(p),y=1/0,E=[];d--;){var S=e[d];d&&t&&(S=Ee(S,et(t))),y=$e(S.length,y),h[d]=!s&&(t||c>=120&&S.length>=120)?new Fn(d&&S):i}S=e[0];var I=-1,C=h[0];e:for(;++I<c&&E.length<y;){var U=S[I],G=t?t(U):U;if(U=s||U!==0?U:0,!(C?xi(C,G):a(E,G,s))){for(d=p;--d;){var X=h[d];if(!(X?xi(X,G):a(e[d],G,s)))continue e}C&&C.push(G),E.push(U)}}return E}function sd(e,t,s,a){return Lt(e,function(c,p,d){t(a,s(c),p,d)}),a}function Ni(e,t,s){t=pn(t,e),e=Nu(e,t);var a=e==null?e:e[Dt(pt(t))];return a==null?i:Ze(a,e,s)}function Wo(e){return Ie(e)&&We(e)==tn}function ad(e){return Ie(e)&&We(e)==Nn}function od(e){return Ie(e)&&We(e)==An}function Oi(e,t,s,a,c){return e===t?!0:e==null||t==null||!Ie(e)&&!Ie(t)?e!==e&&t!==t:ud(e,t,s,a,Oi,c)}function ud(e,t,s,a,c,p){var d=Q(e),h=Q(t),y=d?Gn:Be(e),E=h?Gn:Be(t);y=y==tn?wt:y,E=E==tn?wt:E;var S=y==wt,I=E==wt,C=y==E;if(C&&hn(e)){if(!hn(t))return!1;d=!0,S=!1}if(C&&!S)return p||(p=new St),d||si(e)?Tu(e,t,s,a,c,p):Pd(e,t,y,s,a,c,p);if(!(s&$)){var U=S&&pe.call(e,"__wrapped__"),G=I&&pe.call(t,"__wrapped__");if(U||G){var X=U?e.value():e,V=G?t.value():t;return p||(p=new St),c(X,V,s,a,p)}}return C?(p||(p=new St),kd(e,t,s,a,c,p)):!1}function cd(e){return Ie(e)&&Be(e)==Xe}function Us(e,t,s,a){var c=s.length,p=c,d=!a;if(e==null)return!p;for(e=ye(e);c--;){var h=s[c];if(d&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++c<p;){h=s[c];var y=h[0],E=e[y],S=h[1];if(d&&h[2]){if(E===i&&!(y in e))return!1}else{var I=new St;if(a)var C=a(E,S,y,e,t,I);if(!(C===i?Oi(S,E,$|he,a,I):C))return!1}}return!0}function Go(e){if(!Ae(e)||qd(e))return!1;var t=Vt(e)?cp:Kl;return t.test(Un(e))}function ld(e){return Ie(e)&&We(e)==nn}function fd(e){return Ie(e)&&Be(e)==Ke}function pd(e){return Ie(e)&&Pr(e.length)&&!!Te[We(e)]}function Vo(e){return typeof e=="function"?e:e==null?He:typeof e=="object"?Q(e)?zo(e[0],e[1]):Jo(e):pc(e)}function Ms(e){if(!Li(e))return gp(e);var t=[];for(var s in ye(e))pe.call(e,s)&&s!="constructor"&&t.push(s);return t}function dd(e){if(!Ae(e))return Hd(e);var t=Li(e),s=[];for(var a in e)a=="constructor"&&(t||!pe.call(e,a))||s.push(a);return s}function $s(e,t){return e<t}function qo(e,t){var s=-1,a=ze(e)?_(e.length):[];return ln(e,function(c,p,d){a[++s]=t(c,p,d)}),a}function Jo(e){var t=ea(e);return t.length==1&&t[0][2]?Iu(t[0][0],t[0][1]):function(s){return s===e||Us(s,e,t)}}function zo(e,t){return na(e)&&Au(t)?Iu(Dt(e),t):function(s){var a=pa(s,e);return a===i&&a===t?da(s,e):Oi(t,a,$|he)}}function _r(e,t,s,a,c){e!==t&&Fs(t,function(p,d){if(c||(c=new St),Ae(p))hd(e,t,d,s,_r,a,c);else{var h=a?a(ra(e,d),p,d+"",e,t,c):i;h===i&&(h=p),Cs(e,d,h)}},Qe)}function hd(e,t,s,a,c,p,d){var h=ra(e,s),y=ra(t,s),E=d.get(y);if(E){Cs(e,s,E);return}var S=p?p(h,y,s+"",e,t,d):i,I=S===i;if(I){var C=Q(y),U=!C&&hn(y),G=!C&&!U&&si(y);S=y,C||U||G?Q(h)?S=h:be(h)?S=Je(h):U?(I=!1,S=su(y,!0)):G?(I=!1,S=au(y,!0)):S=[]:Di(y)||Mn(y)?(S=h,Mn(h)?S=nc(h):(!Ae(h)||Vt(h))&&(S=Su(y))):I=!1}I&&(d.set(y,S),c(S,y,a,p,d),d.delete(y)),Cs(e,s,S)}function Qo(e,t){var s=e.length;if(s)return t+=t<0?s:0,Gt(t,s)?e[t]:i}function Ho(e,t,s){t.length?t=Ee(t,function(p){return Q(p)?function(d){return Pn(d,p.length===1?p[0]:p)}:p}):t=[He];var a=-1;t=Ee(t,et(j()));var c=qo(e,function(p,d,h){var y=Ee(t,function(E){return E(p)});return{criteria:y,index:++a,value:p}});return jf(c,function(p,d){return bd(p,d,s)})}function gd(e,t){return Yo(e,t,function(s,a){return da(e,a)})}function Yo(e,t,s){for(var a=-1,c=t.length,p={};++a<c;){var d=t[a],h=Pn(e,d);s(h,d)&&Ri(p,pn(d,e),h)}return p}function md(e){return function(t){return Pn(t,e)}}function Bs(e,t,s,a){var c=a?Bf:Qn,p=-1,d=t.length,h=e;for(e===t&&(t=Je(t)),s&&(h=Ee(e,et(s)));++p<d;)for(var y=0,E=t[p],S=s?s(E):E;(y=c(h,S,y,a))>-1;)h!==e&&cr.call(h,y,1),cr.call(e,y,1);return e}function Xo(e,t){for(var s=e?t.length:0,a=s-1;s--;){var c=t[s];if(s==a||c!==p){var p=c;Gt(c)?cr.call(e,c,1):Vs(e,c)}}return e}function js(e,t){return e+pr(Co()*(t-e+1))}function yd(e,t,s,a){for(var c=-1,p=Fe(fr((t-e)/(s||1)),0),d=_(p);p--;)d[a?p:++c]=e,e+=s;return d}function Ws(e,t){var s="";if(!e||t<1||t>Tt)return s;do t%2&&(s+=e),t=pr(t/2),t&&(e+=e);while(t);return s}function K(e,t){return sa(bu(e,t,He),e+"")}function vd(e){return Do(ai(e))}function _d(e,t){var s=ai(e);return Or(s,Dn(t,0,s.length))}function Ri(e,t,s,a){if(!Ae(e))return e;t=pn(t,e);for(var c=-1,p=t.length,d=p-1,h=e;h!=null&&++c<p;){var y=Dt(t[c]),E=s;if(y==="__proto__"||y==="constructor"||y==="prototype")return e;if(c!=d){var S=h[y];E=a?a(S,y,h):i,E===i&&(E=Ae(S)?S:Gt(t[c+1])?[]:{})}Ii(h,y,E),h=h[y]}return e}var Ko=dr?function(e,t){return dr.set(e,t),e}:He,xd=lr?function(e,t){return lr(e,"toString",{configurable:!0,enumerable:!1,value:ga(t),writable:!0})}:He;function Td(e){return Or(ai(e))}function ft(e,t,s){var a=-1,c=e.length;t<0&&(t=-t>c?0:c+t),s=s>c?c:s,s<0&&(s+=c),c=t>s?0:s-t>>>0,t>>>=0;for(var p=_(c);++a<c;)p[a]=e[a+t];return p}function wd(e,t){var s;return ln(e,function(a,c,p){return s=t(a,c,p),!s}),!!s}function xr(e,t,s){var a=0,c=e==null?a:e.length;if(typeof t=="number"&&t===t&&c<=Zr){for(;a<c;){var p=a+c>>>1,d=e[p];d!==null&&!nt(d)&&(s?d<=t:d<t)?a=p+1:c=p}return c}return Gs(e,t,He,s)}function Gs(e,t,s,a){var c=0,p=e==null?0:e.length;if(p===0)return 0;t=s(t);for(var d=t!==t,h=t===null,y=nt(t),E=t===i;c<p;){var S=pr((c+p)/2),I=s(e[S]),C=I!==i,U=I===null,G=I===I,X=nt(I);if(d)var V=a||G;else E?V=G&&(a||C):h?V=G&&C&&(a||!U):y?V=G&&C&&!U&&(a||!X):U||X?V=!1:V=a?I<=t:I<t;V?c=S+1:p=S}return $e(p,Kr)}function Zo(e,t){for(var s=-1,a=e.length,c=0,p=[];++s<a;){var d=e[s],h=t?t(d):d;if(!s||!At(h,y)){var y=h;p[c++]=d===0?0:d}}return p}function eu(e){return typeof e=="number"?e:nt(e)?Wn:+e}function tt(e){if(typeof e=="string")return e;if(Q(e))return Ee(e,tt)+"";if(nt(e))return Lo?Lo.call(e):"";var t=e+"";return t=="0"&&1/e==-Rt?"-0":t}function fn(e,t,s){var a=-1,c=Zi,p=e.length,d=!0,h=[],y=h;if(s)d=!1,c=vs;else if(p>=u){var E=t?null:Fd(e);if(E)return tr(E);d=!1,c=xi,y=new Fn}else y=t?[]:h;e:for(;++a<p;){var S=e[a],I=t?t(S):S;if(S=s||S!==0?S:0,d&&I===I){for(var C=y.length;C--;)if(y[C]===I)continue e;t&&y.push(I),h.push(S)}else c(y,I,s)||(y!==h&&y.push(I),h.push(S))}return h}function Vs(e,t){return t=pn(t,e),e=Nu(e,t),e==null||delete e[Dt(pt(t))]}function tu(e,t,s,a){return Ri(e,t,s(Pn(e,t)),a)}function Tr(e,t,s,a){for(var c=e.length,p=a?c:-1;(a?p--:++p<c)&&t(e[p],p,e););return s?ft(e,a?0:p,a?p+1:c):ft(e,a?p+1:0,a?c:p)}function nu(e,t){var s=e;return s instanceof te&&(s=s.value()),_s(t,function(a,c){return c.func.apply(c.thisArg,on([a],c.args))},s)}function qs(e,t,s){var a=e.length;if(a<2)return a?fn(e[0]):[];for(var c=-1,p=_(a);++c<a;)for(var d=e[c],h=-1;++h<a;)h!=c&&(p[c]=bi(p[c]||d,e[h],t,s));return fn(Me(p,1),t,s)}function iu(e,t,s){for(var a=-1,c=e.length,p=t.length,d={};++a<c;){var h=a<p?t[a]:i;s(d,e[a],h)}return d}function Js(e){return be(e)?e:[]}function zs(e){return typeof e=="function"?e:He}function pn(e,t){return Q(e)?e:na(e,t)?[e]:Lu(le(e))}var Ed=K;function dn(e,t,s){var a=e.length;return s=s===i?a:s,!t&&s>=a?e:ft(e,t,s)}var ru=lp||function(e){return Ue.clearTimeout(e)};function su(e,t){if(t)return e.slice();var s=e.length,a=Io?Io(s):new e.constructor(s);return e.copy(a),a}function Qs(e){var t=new e.constructor(e.byteLength);return new or(t).set(new or(e)),t}function Sd(e,t){var s=t?Qs(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Ad(e){var t=new e.constructor(e.source,ja.exec(e));return t.lastIndex=e.lastIndex,t}function Id(e){return Ai?ye(Ai.call(e)):{}}function au(e,t){var s=t?Qs(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function ou(e,t){if(e!==t){var s=e!==i,a=e===null,c=e===e,p=nt(e),d=t!==i,h=t===null,y=t===t,E=nt(t);if(!h&&!E&&!p&&e>t||p&&d&&y&&!h&&!E||a&&d&&y||!s&&y||!c)return 1;if(!a&&!p&&!E&&e<t||E&&s&&c&&!a&&!p||h&&s&&c||!d&&c||!y)return-1}return 0}function bd(e,t,s){for(var a=-1,c=e.criteria,p=t.criteria,d=c.length,h=s.length;++a<d;){var y=ou(c[a],p[a]);if(y){if(a>=h)return y;var E=s[a];return y*(E=="desc"?-1:1)}}return e.index-t.index}function uu(e,t,s,a){for(var c=-1,p=e.length,d=s.length,h=-1,y=t.length,E=Fe(p-d,0),S=_(y+E),I=!a;++h<y;)S[h]=t[h];for(;++c<d;)(I||c<p)&&(S[s[c]]=e[c]);for(;E--;)S[h++]=e[c++];return S}function cu(e,t,s,a){for(var c=-1,p=e.length,d=-1,h=s.length,y=-1,E=t.length,S=Fe(p-h,0),I=_(S+E),C=!a;++c<S;)I[c]=e[c];for(var U=c;++y<E;)I[U+y]=t[y];for(;++d<h;)(C||c<p)&&(I[U+s[d]]=e[c++]);return I}function Je(e,t){var s=-1,a=e.length;for(t||(t=_(a));++s<a;)t[s]=e[s];return t}function Ft(e,t,s,a){var c=!s;s||(s={});for(var p=-1,d=t.length;++p<d;){var h=t[p],y=a?a(s[h],e[h],h,s,e):i;y===i&&(y=e[h]),c?Bt(s,h,y):Ii(s,h,y)}return s}function Nd(e,t){return Ft(e,ta(e),t)}function Od(e,t){return Ft(e,wu(e),t)}function wr(e,t){return function(s,a){var c=Q(s)?Df:Xp,p=t?t():{};return c(s,e,j(a,2),p)}}function ni(e){return K(function(t,s){var a=-1,c=s.length,p=c>1?s[c-1]:i,d=c>2?s[2]:i;for(p=e.length>3&&typeof p=="function"?(c--,p):i,d&&Ge(s[0],s[1],d)&&(p=c<3?i:p,c=1),t=ye(t);++a<c;){var h=s[a];h&&e(t,h,a,p)}return t})}function lu(e,t){return function(s,a){if(s==null)return s;if(!ze(s))return e(s,a);for(var c=s.length,p=t?c:-1,d=ye(s);(t?p--:++p<c)&&a(d[p],p,d)!==!1;);return s}}function fu(e){return function(t,s,a){for(var c=-1,p=ye(t),d=a(t),h=d.length;h--;){var y=d[e?h:++c];if(s(p[y],y,p)===!1)break}return t}}function Rd(e,t,s){var a=t&ae,c=Ci(e);function p(){var d=this&&this!==Ue&&this instanceof p?c:e;return d.apply(a?s:this,arguments)}return p}function pu(e){return function(t){t=le(t);var s=Hn(t)?Et(t):i,a=s?s[0]:t.charAt(0),c=s?dn(s,1).join(""):t.slice(1);return a[e]()+c}}function ii(e){return function(t){return _s(lc(cc(t).replace(xf,"")),e,"")}}function Ci(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 s=ti(e.prototype),a=e.apply(s,t);return Ae(a)?a:s}}function Cd(e,t,s){var a=Ci(e);function c(){for(var p=arguments.length,d=_(p),h=p,y=ri(c);h--;)d[h]=arguments[h];var E=p<3&&d[0]!==y&&d[p-1]!==y?[]:un(d,y);if(p-=E.length,p<s)return yu(e,t,Er,c.placeholder,i,d,E,i,i,s-p);var S=this&&this!==Ue&&this instanceof c?a:e;return Ze(S,this,d)}return c}function du(e){return function(t,s,a){var c=ye(t);if(!ze(t)){var p=j(s,3);t=Pe(t),s=function(h){return p(c[h],h,c)}}var d=e(t,s,a);return d>-1?c[p?t[d]:d]:i}}function hu(e){return Wt(function(t){var s=t.length,a=s,c=ct.prototype.thru;for(e&&t.reverse();a--;){var p=t[a];if(typeof p!="function")throw new ut(g);if(c&&!d&&br(p)=="wrapper")var d=new ct([],!0)}for(a=d?a:s;++a<s;){p=t[a];var h=br(p),y=h=="wrapper"?Zs(p):i;y&&ia(y[0])&&y[1]==(ce|xe|ee|qe)&&!y[4].length&&y[9]==1?d=d[br(y[0])].apply(d,y[3]):d=p.length==1&&ia(p)?d[h]():d.thru(p)}return function(){var E=arguments,S=E[0];if(d&&E.length==1&&Q(S))return d.plant(S).value();for(var I=0,C=s?t[I].apply(this,E):S;++I<s;)C=t[I].call(this,C);return C}})}function Er(e,t,s,a,c,p,d,h,y,E){var S=t&ce,I=t&ae,C=t&me,U=t&(xe|L),G=t&x,X=C?i:Ci(e);function V(){for(var Z=arguments.length,ie=_(Z),it=Z;it--;)ie[it]=arguments[it];if(U)var Ve=ri(V),rt=Gf(ie,Ve);if(a&&(ie=uu(ie,a,c,U)),p&&(ie=cu(ie,p,d,U)),Z-=rt,U&&Z<E){var Ne=un(ie,Ve);return yu(e,t,Er,V.placeholder,s,ie,Ne,h,y,E-Z)}var It=I?s:this,Jt=C?It[e]:e;return Z=ie.length,h?ie=Xd(ie,h):G&&Z>1&&ie.reverse(),S&&y<Z&&(ie.length=y),this&&this!==Ue&&this instanceof V&&(Jt=X||Ci(Jt)),Jt.apply(It,ie)}return V}function gu(e,t){return function(s,a){return sd(s,e,t(a),{})}}function Sr(e,t){return function(s,a){var c;if(s===i&&a===i)return t;if(s!==i&&(c=s),a!==i){if(c===i)return a;typeof s=="string"||typeof a=="string"?(s=tt(s),a=tt(a)):(s=eu(s),a=eu(a)),c=e(s,a)}return c}}function Hs(e){return Wt(function(t){return t=Ee(t,et(j())),K(function(s){var a=this;return e(t,function(c){return Ze(c,a,s)})})})}function Ar(e,t){t=t===i?" ":tt(t);var s=t.length;if(s<2)return s?Ws(t,e):t;var a=Ws(t,fr(e/Yn(t)));return Hn(t)?dn(Et(a),0,e).join(""):a.slice(0,e)}function Ld(e,t,s,a){var c=t&ae,p=Ci(e);function d(){for(var h=-1,y=arguments.length,E=-1,S=a.length,I=_(S+y),C=this&&this!==Ue&&this instanceof d?p:e;++E<S;)I[E]=a[E];for(;y--;)I[E++]=arguments[++h];return Ze(C,c?s:this,I)}return d}function mu(e){return function(t,s,a){return a&&typeof a!="number"&&Ge(t,s,a)&&(s=a=i),t=qt(t),s===i?(s=t,t=0):s=qt(s),a=a===i?t<s?1:-1:qt(a),yd(t,s,a,e)}}function Ir(e){return function(t,s){return typeof t=="string"&&typeof s=="string"||(t=dt(t),s=dt(s)),e(t,s)}}function yu(e,t,s,a,c,p,d,h,y,E){var S=t&xe,I=S?d:i,C=S?i:d,U=S?p:i,G=S?i:p;t|=S?ee:H,t&=~(S?H:ee),t&Ye||(t&=-4);var X=[e,t,c,U,I,G,C,h,y,E],V=s.apply(i,X);return ia(e)&&Ou(V,X),V.placeholder=a,Ru(V,e,t)}function Ys(e){var t=Le[e];return function(s,a){if(s=dt(s),a=a==null?0:$e(Y(a),292),a&&Ro(s)){var c=(le(s)+"e").split("e"),p=t(c[0]+"e"+(+c[1]+a));return c=(le(p)+"e").split("e"),+(c[0]+"e"+(+c[1]-a))}return t(s)}}var Fd=Zn&&1/tr(new Zn([,-0]))[1]==Rt?function(e){return new Zn(e)}:va;function vu(e){return function(t){var s=Be(t);return s==Xe?Is(t):s==Ke?Yf(t):Wf(t,e(t))}}function jt(e,t,s,a,c,p,d,h){var y=t&me;if(!y&&typeof e!="function")throw new ut(g);var E=a?a.length:0;if(E||(t&=-97,a=c=i),d=d===i?d:Fe(Y(d),0),h=h===i?h:Y(h),E-=c?c.length:0,t&H){var S=a,I=c;a=c=i}var C=y?i:Zs(e),U=[e,t,s,a,c,S,I,p,d,h];if(C&&Qd(U,C),e=U[0],t=U[1],s=U[2],a=U[3],c=U[4],h=U[9]=U[9]===i?y?0:e.length:Fe(U[9]-E,0),!h&&t&(xe|L)&&(t&=-25),!t||t==ae)var G=Rd(e,t,s);else t==xe||t==L?G=Cd(e,t,h):(t==ee||t==(ae|ee))&&!c.length?G=Ld(e,t,s,a):G=Er.apply(i,U);var X=C?Ko:Ou;return Ru(X(G,U),e,t)}function _u(e,t,s,a){return e===i||At(e,Kn[s])&&!pe.call(a,s)?t:e}function xu(e,t,s,a,c,p){return Ae(e)&&Ae(t)&&(p.set(t,e),_r(e,t,i,xu,p),p.delete(t)),e}function Dd(e){return Di(e)?i:e}function Tu(e,t,s,a,c,p){var d=s&$,h=e.length,y=t.length;if(h!=y&&!(d&&y>h))return!1;var E=p.get(e),S=p.get(t);if(E&&S)return E==t&&S==e;var I=-1,C=!0,U=s&he?new Fn:i;for(p.set(e,t),p.set(t,e);++I<h;){var G=e[I],X=t[I];if(a)var V=d?a(X,G,I,t,e,p):a(G,X,I,e,t,p);if(V!==i){if(V)continue;C=!1;break}if(U){if(!xs(t,function(Z,ie){if(!xi(U,ie)&&(G===Z||c(G,Z,s,a,p)))return U.push(ie)})){C=!1;break}}else if(!(G===X||c(G,X,s,a,p))){C=!1;break}}return p.delete(e),p.delete(t),C}function Pd(e,t,s,a,c,p,d){switch(s){case sn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Nn:return!(e.byteLength!=t.byteLength||!p(new or(e),new or(t)));case Sn:case An:case In:return At(+e,+t);case Vn:return e.name==t.name&&e.message==t.message;case nn:case bn:return e==t+"";case Xe:var h=Is;case Ke:var y=a&$;if(h||(h=tr),e.size!=t.size&&!y)return!1;var E=d.get(e);if(E)return E==t;a|=he,d.set(e,t);var S=Tu(h(e),h(t),a,c,p,d);return d.delete(e),S;case Jn:if(Ai)return Ai.call(e)==Ai.call(t)}return!1}function kd(e,t,s,a,c,p){var d=s&$,h=Xs(e),y=h.length,E=Xs(t),S=E.length;if(y!=S&&!d)return!1;for(var I=y;I--;){var C=h[I];if(!(d?C in t:pe.call(t,C)))return!1}var U=p.get(e),G=p.get(t);if(U&&G)return U==t&&G==e;var X=!0;p.set(e,t),p.set(t,e);for(var V=d;++I<y;){C=h[I];var Z=e[C],ie=t[C];if(a)var it=d?a(ie,Z,C,t,e,p):a(Z,ie,C,e,t,p);if(!(it===i?Z===ie||c(Z,ie,s,a,p):it)){X=!1;break}V||(V=C=="constructor")}if(X&&!V){var Ve=e.constructor,rt=t.constructor;Ve!=rt&&"constructor"in e&&"constructor"in t&&!(typeof Ve=="function"&&Ve instanceof Ve&&typeof rt=="function"&&rt instanceof rt)&&(X=!1)}return p.delete(e),p.delete(t),X}function Wt(e){return sa(bu(e,i,ku),e+"")}function Xs(e){return jo(e,Pe,ta)}function Ks(e){return jo(e,Qe,wu)}var Zs=dr?function(e){return dr.get(e)}:va;function br(e){for(var t=e.name+"",s=ei[t],a=pe.call(ei,t)?s.length:0;a--;){var c=s[a],p=c.func;if(p==null||p==e)return c.name}return t}function ri(e){var t=pe.call(l,"placeholder")?l:e;return t.placeholder}function j(){var e=l.iteratee||ma;return e=e===ma?Vo:e,arguments.length?e(arguments[0],arguments[1]):e}function Nr(e,t){var s=e.__data__;return Vd(t)?s[typeof t=="string"?"string":"hash"]:s.map}function ea(e){for(var t=Pe(e),s=t.length;s--;){var a=t[s],c=e[a];t[s]=[a,c,Au(c)]}return t}function kn(e,t){var s=zf(e,t);return Go(s)?s:i}function Ud(e){var t=pe.call(e,Cn),s=e[Cn];try{e[Cn]=i;var a=!0}catch{}var c=sr.call(e);return a&&(t?e[Cn]=s:delete e[Cn]),c}var ta=Ns?function(e){return e==null?[]:(e=ye(e),an(Ns(e),function(t){return No.call(e,t)}))}:_a,wu=Ns?function(e){for(var t=[];e;)on(t,ta(e)),e=ur(e);return t}:_a,Be=We;(Os&&Be(new Os(new ArrayBuffer(1)))!=sn||wi&&Be(new wi)!=Xe||Rs&&Be(Rs.resolve())!=vi||Zn&&Be(new Zn)!=Ke||Ei&&Be(new Ei)!=rn)&&(Be=function(e){var t=We(e),s=t==wt?e.constructor:i,a=s?Un(s):"";if(a)switch(a){case _p:return sn;case xp:return Xe;case Tp:return vi;case wp:return Ke;case Ep:return rn}return t});function Md(e,t,s){for(var a=-1,c=s.length;++a<c;){var p=s[a],d=p.size;switch(p.type){case"drop":e+=d;break;case"dropRight":t-=d;break;case"take":t=$e(t,e+d);break;case"takeRight":e=Fe(e,t-d);break}}return{start:e,end:t}}function $d(e){var t=e.match(Vl);return t?t[1].split(ql):[]}function Eu(e,t,s){t=pn(t,e);for(var a=-1,c=t.length,p=!1;++a<c;){var d=Dt(t[a]);if(!(p=e!=null&&s(e,d)))break;e=e[d]}return p||++a!=c?p:(c=e==null?0:e.length,!!c&&Pr(c)&&Gt(d,c)&&(Q(e)||Mn(e)))}function Bd(e){var t=e.length,s=new e.constructor(t);return t&&typeof e[0]=="string"&&pe.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function Su(e){return typeof e.constructor=="function"&&!Li(e)?ti(ur(e)):{}}function jd(e,t,s){var a=e.constructor;switch(t){case Nn:return Qs(e);case Sn:case An:return new a(+e);case sn:return Sd(e,s);case W:case Ce:case Ct:case Hi:case On:case _i:case as:case os:case us:return au(e,s);case Xe:return new a;case In:case bn:return new a(e);case nn:return Ad(e);case Ke:return new a;case Jn:return Id(e)}}function Wd(e,t){var s=t.length;if(!s)return e;var a=s-1;return t[a]=(s>1?"& ":"")+t[a],t=t.join(s>2?", ":" "),e.replace(Gl,`{
|
|
382
382
|
/* [wrapped with `+t+`] */
|
|
383
|
-
`)}function Gd(e){return Q(e)||Mn(e)||!!(Oo&&e&&e[Oo])}function Wt(e,t){var s=typeof e;return t=t??Tt,!!t&&(s=="number"||s!="symbol"&&ef.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e,t,s){if(!Ae(s))return!1;var a=typeof t;return(a=="number"?ze(s)&&Wt(t,s.length):a=="string"&&t in s)?At(s[t],e):!1}function na(e,t){if(Q(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||nt(e)?!0:$l.test(e)||!Ml.test(e)||t!=null&&e in ye(t)}function Vd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ia(e){var t=br(e),s=l[t];if(typeof s!="function"||!(t in te.prototype))return!1;if(e===s)return!0;var a=Zs(s);return!!a&&e===a[0]}function qd(e){return!!Ao&&Ao in e}var Jd=ir?Gt:xa;function Li(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||Kn;return e===s}function Au(e){return e===e&&!Ae(e)}function Iu(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==i||e in ye(s))}}function zd(e){var t=Fr(e,function(a){return s.size===b&&s.clear(),a}),s=t.cache;return t}function Qd(e,t){var s=e[1],a=t[1],c=s|a,p=c<(ae|me|ce),d=a==ce&&s==xe||a==ce&&s==qe&&e[7].length<=t[8]||a==(ce|qe)&&t[7].length<=t[8]&&s==xe;if(!(p||d))return e;a&ae&&(e[2]=t[2],c|=s&ae?0:Ye);var h=t[3];if(h){var y=e[3];e[3]=y?uu(y,h,t[4]):h,e[4]=y?on(e[3],O):t[4]}return h=t[5],h&&(y=e[5],e[5]=y?cu(y,h,t[6]):h,e[6]=y?on(e[5],O):t[6]),h=t[7],h&&(e[7]=h),a&ce&&(e[8]=e[8]==null?t[8]:$e(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}function Hd(e){var t=[];if(e!=null)for(var s in ye(e))t.push(s);return t}function Yd(e){return sr.call(e)}function bu(e,t,s){return t=Fe(t===i?e.length-1:t,0),function(){for(var a=arguments,c=-1,p=Fe(a.length-t,0),d=_(p);++c<p;)d[c]=a[t+c];c=-1;for(var h=_(t+1);++c<t;)h[c]=a[c];return h[t]=s(d),Ze(e,this,h)}}function Nu(e,t){return t.length<2?e:Pn(e,ft(t,0,-1))}function Xd(e,t){for(var s=e.length,a=$e(t.length,s),c=Je(e);a--;){var p=t[a];e[a]=Wt(p,s)?c[p]:i}return e}function ra(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Ou=Cu(Ko),Fi=pp||function(e,t){return Ue.setTimeout(e,t)},sa=Cu(xd);function Ru(e,t,s){var a=t+"";return sa(e,Wd(a,Kd($d(a),s)))}function Cu(e){var t=0,s=0;return function(){var a=mp(),c=Zt-(a-s);if(s=a,c>0){if(++t>=xt)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Or(e,t){var s=-1,a=e.length,c=a-1;for(t=t===i?a:t;++s<t;){var p=js(s,c),d=e[p];e[p]=e[s],e[s]=d}return e.length=t,e}var Lu=zd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Bl,function(s,a,c,p){t.push(c?p.replace(Ql,"$1"):a||s)}),t});function Dt(e){if(typeof e=="string"||nt(e))return e;var t=e+"";return t=="0"&&1/e==-Rt?"-0":t}function Un(e){if(e!=null){try{return rr.call(e)}catch{}try{return e+""}catch{}}return""}function Kd(e,t){return ot(es,function(s){var a="_."+s[0];t&s[1]&&!Zi(e,a)&&e.push(a)}),e.sort()}function Fu(e){if(e instanceof te)return e.clone();var t=new ct(e.__wrapped__,e.__chain__);return t.__actions__=Je(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Zd(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Fe(Y(t),0);var a=e==null?0:e.length;if(!a||t<1)return[];for(var c=0,p=0,d=_(fr(a/t));c<a;)d[p++]=ft(e,c,c+=t);return d}function eh(e){for(var t=-1,s=e==null?0:e.length,a=0,c=[];++t<s;){var p=e[t];p&&(c[a++]=p)}return c}function th(){var e=arguments.length;if(!e)return[];for(var t=_(e-1),s=arguments[0],a=e;a--;)t[a-1]=arguments[a];return an(Q(s)?Je(s):[s],Me(t,1))}var nh=K(function(e,t){return be(e)?bi(e,Me(t,1,be,!0)):[]}),ih=K(function(e,t){var s=pt(t);return be(s)&&(s=i),be(e)?bi(e,Me(t,1,be,!0),j(s,2)):[]}),rh=K(function(e,t){var s=pt(t);return be(s)&&(s=i),be(e)?bi(e,Me(t,1,be,!0),i,s):[]});function sh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),ft(e,t<0?0:t,a)):[]}function ah(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,0,t<0?0:t)):[]}function oh(e,t){return e&&e.length?Tr(e,j(t,3),!0,!0):[]}function uh(e,t){return e&&e.length?Tr(e,j(t,3),!0):[]}function ch(e,t,s,a){var c=e==null?0:e.length;return c?(s&&typeof s!="number"&&Ge(e,t,s)&&(s=0,a=c),td(e,t,s,a)):[]}function Du(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=s==null?0:Y(s);return c<0&&(c=Fe(a+c,0)),er(e,j(t,3),c)}function Pu(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=a-1;return s!==i&&(c=Y(s),c=s<0?Fe(a+c,0):$e(c,a-1)),er(e,j(t,3),c,!0)}function ku(e){var t=e==null?0:e.length;return t?Me(e,1):[]}function lh(e){var t=e==null?0:e.length;return t?Me(e,Rt):[]}function fh(e,t){var s=e==null?0:e.length;return s?(t=t===i?1:Y(t),Me(e,t)):[]}function ph(e){for(var t=-1,s=e==null?0:e.length,a={};++t<s;){var c=e[t];a[c[0]]=c[1]}return a}function Uu(e){return e&&e.length?e[0]:i}function dh(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=s==null?0:Y(s);return c<0&&(c=Fe(a+c,0)),Qn(e,t,c)}function hh(e){var t=e==null?0:e.length;return t?ft(e,0,-1):[]}var gh=K(function(e){var t=Ee(e,Js);return t.length&&t[0]===e[0]?ks(t):[]}),mh=K(function(e){var t=pt(e),s=Ee(e,Js);return t===pt(s)?t=i:s.pop(),s.length&&s[0]===e[0]?ks(s,j(t,2)):[]}),yh=K(function(e){var t=pt(e),s=Ee(e,Js);return t=typeof t=="function"?t:i,t&&s.pop(),s.length&&s[0]===e[0]?ks(s,i,t):[]});function vh(e,t){return e==null?"":hp.call(e,t)}function pt(e){var t=e==null?0:e.length;return t?e[t-1]:i}function _h(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=a;return s!==i&&(c=Y(s),c=c<0?Fe(a+c,0):$e(c,a-1)),t===t?Kf(e,t,c):er(e,yo,c,!0)}function xh(e,t){return e&&e.length?Qo(e,Y(t)):i}var Th=K(Mu);function Mu(e,t){return e&&e.length&&t&&t.length?Bs(e,t):e}function wh(e,t,s){return e&&e.length&&t&&t.length?Bs(e,t,j(s,2)):e}function Eh(e,t,s){return e&&e.length&&t&&t.length?Bs(e,t,i,s):e}var Sh=jt(function(e,t){var s=e==null?0:e.length,a=Ls(e,t);return Xo(e,Ee(t,function(c){return Wt(c,s)?+c:c}).sort(ou)),a});function Ah(e,t){var s=[];if(!(e&&e.length))return s;var a=-1,c=[],p=e.length;for(t=j(t,3);++a<p;){var d=e[a];t(d,a,e)&&(s.push(d),c.push(a))}return Xo(e,c),s}function aa(e){return e==null?e:vp.call(e)}function Ih(e,t,s){var a=e==null?0:e.length;return a?(s&&typeof s!="number"&&Ge(e,t,s)?(t=0,s=a):(t=t==null?0:Y(t),s=s===i?a:Y(s)),ft(e,t,s)):[]}function bh(e,t){return xr(e,t)}function Nh(e,t,s){return Gs(e,t,j(s,2))}function Oh(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t);if(a<s&&At(e[a],t))return a}return-1}function Rh(e,t){return xr(e,t,!0)}function Ch(e,t,s){return Gs(e,t,j(s,2),!0)}function Lh(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t,!0)-1;if(At(e[a],t))return a}return-1}function Fh(e){return e&&e.length?Zo(e):[]}function Dh(e,t){return e&&e.length?Zo(e,j(t,2)):[]}function Ph(e){var t=e==null?0:e.length;return t?ft(e,1,t):[]}function kh(e,t,s){return e&&e.length?(t=s||t===i?1:Y(t),ft(e,0,t<0?0:t)):[]}function Uh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,t<0?0:t,a)):[]}function Mh(e,t){return e&&e.length?Tr(e,j(t,3),!1,!0):[]}function $h(e,t){return e&&e.length?Tr(e,j(t,3)):[]}var Bh=K(function(e){return ln(Me(e,1,be,!0))}),jh=K(function(e){var t=pt(e);return be(t)&&(t=i),ln(Me(e,1,be,!0),j(t,2))}),Wh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,ln(Me(e,1,be,!0),i,t)});function Gh(e){return e&&e.length?ln(e):[]}function Vh(e,t){return e&&e.length?ln(e,j(t,2)):[]}function qh(e,t){return t=typeof t=="function"?t:i,e&&e.length?ln(e,i,t):[]}function oa(e){if(!(e&&e.length))return[];var t=0;return e=sn(e,function(s){if(be(s))return t=Fe(s.length,t),!0}),Ss(t,function(s){return Ee(e,Ts(s))})}function $u(e,t){if(!(e&&e.length))return[];var s=oa(e);return t==null?s:Ee(s,function(a){return Ze(t,i,a)})}var Jh=K(function(e,t){return be(e)?bi(e,t):[]}),zh=K(function(e){return qs(sn(e,be))}),Qh=K(function(e){var t=pt(e);return be(t)&&(t=i),qs(sn(e,be),j(t,2))}),Hh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,qs(sn(e,be),i,t)}),Yh=K(oa);function Xh(e,t){return iu(e||[],t||[],Ii)}function Kh(e,t){return iu(e||[],t||[],Ri)}var Zh=K(function(e){var t=e.length,s=t>1?e[t-1]:i;return s=typeof s=="function"?(e.pop(),s):i,$u(e,s)});function Bu(e){var t=l(e);return t.__chain__=!0,t}function eg(e,t){return t(e),e}function Rr(e,t){return t(e)}var tg=jt(function(e){var t=e.length,s=t?e[0]:0,a=this.__wrapped__,c=function(p){return Ls(p,e)};return t>1||this.__actions__.length||!(a instanceof te)||!Wt(s)?this.thru(c):(a=a.slice(s,+s+(t?1:0)),a.__actions__.push({func:Rr,args:[c],thisArg:i}),new ct(a,this.__chain__).thru(function(p){return t&&!p.length&&p.push(i),p}))});function ng(){return Bu(this)}function ig(){return new ct(this.value(),this.__chain__)}function rg(){this.__values__===i&&(this.__values__=ec(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function sg(){return this}function ag(e){for(var t,s=this;s instanceof gr;){var a=Fu(s);a.__index__=0,a.__values__=i,t?c.__wrapped__=a:t=a;var c=a;s=s.__wrapped__}return c.__wrapped__=e,t}function og(){var e=this.__wrapped__;if(e instanceof te){var t=e;return this.__actions__.length&&(t=new te(this)),t=t.reverse(),t.__actions__.push({func:Rr,args:[aa],thisArg:i}),new ct(t,this.__chain__)}return this.thru(aa)}function ug(){return nu(this.__wrapped__,this.__actions__)}var cg=wr(function(e,t,s){pe.call(e,s)?++e[s]:$t(e,s,1)});function lg(e,t,s){var a=Q(e)?go:ed;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}function fg(e,t){var s=Q(e)?sn:$o;return s(e,j(t,3))}var pg=du(Du),dg=du(Pu);function hg(e,t){return Me(Cr(e,t),1)}function gg(e,t){return Me(Cr(e,t),Rt)}function mg(e,t,s){return s=s===i?1:Y(s),Me(Cr(e,t),s)}function ju(e,t){var s=Q(e)?ot:cn;return s(e,j(t,3))}function Wu(e,t){var s=Q(e)?Pf:Mo;return s(e,j(t,3))}var yg=wr(function(e,t,s){pe.call(e,s)?e[s].push(t):$t(e,s,[t])});function vg(e,t,s,a){e=ze(e)?e:ai(e),s=s&&!a?Y(s):0;var c=e.length;return s<0&&(s=Fe(c+s,0)),kr(e)?s<=c&&e.indexOf(t,s)>-1:!!c&&Qn(e,t,s)>-1}var _g=K(function(e,t,s){var a=-1,c=typeof t=="function",p=ze(e)?_(e.length):[];return cn(e,function(d){p[++a]=c?Ze(t,d,s):Ni(d,t,s)}),p}),xg=wr(function(e,t,s){$t(e,s,t)});function Cr(e,t){var s=Q(e)?Ee:qo;return s(e,j(t,3))}function Tg(e,t,s,a){return e==null?[]:(Q(t)||(t=t==null?[]:[t]),s=a?i:s,Q(s)||(s=s==null?[]:[s]),Ho(e,t,s))}var wg=wr(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function Eg(e,t,s){var a=Q(e)?_s:_o,c=arguments.length<3;return a(e,j(t,4),s,c,cn)}function Sg(e,t,s){var a=Q(e)?kf:_o,c=arguments.length<3;return a(e,j(t,4),s,c,Mo)}function Ag(e,t){var s=Q(e)?sn:$o;return s(e,Dr(j(t,3)))}function Ig(e){var t=Q(e)?Do:vd;return t(e)}function bg(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Y(t);var a=Q(e)?Hp:_d;return a(e,t)}function Ng(e){var t=Q(e)?Yp:Td;return t(e)}function Og(e){if(e==null)return 0;if(ze(e))return kr(e)?Yn(e):e.length;var t=Be(e);return t==Xe||t==Ke?e.size:Ms(e).length}function Rg(e,t,s){var a=Q(e)?xs:wd;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}var Cg=K(function(e,t){if(e==null)return[];var s=t.length;return s>1&&Ge(e,t[0],t[1])?t=[]:s>2&&Ge(t[0],t[1],t[2])&&(t=[t[0]]),Ho(e,Me(t,1),[])}),Lr=fp||function(){return Ue.Date.now()};function Lg(e,t){if(typeof t!="function")throw new ut(g);return e=Y(e),function(){if(--e<1)return t.apply(this,arguments)}}function Gu(e,t,s){return t=s?i:t,t=e&&t==null?e.length:t,Bt(e,ce,i,i,i,i,t)}function Vu(e,t){var s;if(typeof t!="function")throw new ut(g);return e=Y(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=i),s}}var ua=K(function(e,t,s){var a=ae;if(s.length){var c=on(s,ri(ua));a|=ee}return Bt(e,a,t,s,c)}),qu=K(function(e,t,s){var a=ae|me;if(s.length){var c=on(s,ri(qu));a|=ee}return Bt(t,a,e,s,c)});function Ju(e,t,s){t=s?i:t;var a=Bt(e,xe,i,i,i,i,i,t);return a.placeholder=Ju.placeholder,a}function zu(e,t,s){t=s?i:t;var a=Bt(e,L,i,i,i,i,i,t);return a.placeholder=zu.placeholder,a}function Qu(e,t,s){var a,c,p,d,h,y,E=0,S=!1,I=!1,C=!0;if(typeof e!="function")throw new ut(g);t=dt(t)||0,Ae(s)&&(S=!!s.leading,I="maxWait"in s,p=I?Fe(dt(s.maxWait)||0,t):p,C="trailing"in s?!!s.trailing:C);function U(Ne){var It=a,qt=c;return a=c=i,E=Ne,d=e.apply(qt,It),d}function G(Ne){return E=Ne,h=Fi(Z,t),S?U(Ne):d}function X(Ne){var It=Ne-y,qt=Ne-E,dc=t-It;return I?$e(dc,p-qt):dc}function V(Ne){var It=Ne-y,qt=Ne-E;return y===i||It>=t||It<0||I&&qt>=p}function Z(){var Ne=Lr();if(V(Ne))return ie(Ne);h=Fi(Z,X(Ne))}function ie(Ne){return h=i,C&&a?U(Ne):(a=c=i,d)}function it(){h!==i&&ru(h),E=0,a=y=c=h=i}function Ve(){return h===i?d:ie(Lr())}function rt(){var Ne=Lr(),It=V(Ne);if(a=arguments,c=this,y=Ne,It){if(h===i)return G(y);if(I)return ru(h),h=Fi(Z,t),U(y)}return h===i&&(h=Fi(Z,t)),d}return rt.cancel=it,rt.flush=Ve,rt}var Fg=K(function(e,t){return Uo(e,1,t)}),Dg=K(function(e,t,s){return Uo(e,dt(t)||0,s)});function Pg(e){return Bt(e,x)}function Fr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new ut(g);var s=function(){var a=arguments,c=t?t.apply(this,a):a[0],p=s.cache;if(p.has(c))return p.get(c);var d=e.apply(this,a);return s.cache=p.set(c,d)||p,d};return s.cache=new(Fr.Cache||Mt),s}Fr.Cache=Mt;function Dr(e){if(typeof e!="function")throw new ut(g);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 kg(e){return Vu(2,e)}var Ug=Ed(function(e,t){t=t.length==1&&Q(t[0])?Ee(t[0],et(j())):Ee(Me(t,1),et(j()));var s=t.length;return K(function(a){for(var c=-1,p=$e(a.length,s);++c<p;)a[c]=t[c].call(this,a[c]);return Ze(e,this,a)})}),ca=K(function(e,t){var s=on(t,ri(ca));return Bt(e,ee,i,t,s)}),Hu=K(function(e,t){var s=on(t,ri(Hu));return Bt(e,H,i,t,s)}),Mg=jt(function(e,t){return Bt(e,qe,i,i,i,t)});function $g(e,t){if(typeof e!="function")throw new ut(g);return t=t===i?t:Y(t),K(e,t)}function Bg(e,t){if(typeof e!="function")throw new ut(g);return t=t==null?0:Fe(Y(t),0),K(function(s){var a=s[t],c=pn(s,0,t);return a&&an(c,a),Ze(e,this,c)})}function jg(e,t,s){var a=!0,c=!0;if(typeof e!="function")throw new ut(g);return Ae(s)&&(a="leading"in s?!!s.leading:a,c="trailing"in s?!!s.trailing:c),Qu(e,t,{leading:a,maxWait:t,trailing:c})}function Wg(e){return Gu(e,1)}function Gg(e,t){return ca(zs(t),e)}function Vg(){if(!arguments.length)return[];var e=arguments[0];return Q(e)?e:[e]}function qg(e){return lt(e,M)}function Jg(e,t){return t=typeof t=="function"?t:i,lt(e,M,t)}function zg(e){return lt(e,D|M)}function Qg(e,t){return t=typeof t=="function"?t:i,lt(e,D|M,t)}function Hg(e,t){return t==null||ko(e,t,Pe(t))}function At(e,t){return e===t||e!==e&&t!==t}var Yg=Ir(Ps),Xg=Ir(function(e,t){return e>=t}),Mn=Wo(function(){return arguments}())?Wo:function(e){return Ie(e)&&pe.call(e,"callee")&&!No.call(e,"callee")},Q=_.isArray,Kg=uo?et(uo):ad;function ze(e){return e!=null&&Pr(e.length)&&!Gt(e)}function be(e){return Ie(e)&&ze(e)}function Zg(e){return e===!0||e===!1||Ie(e)&&We(e)==Sn}var dn=dp||xa,em=co?et(co):od;function tm(e){return Ie(e)&&e.nodeType===1&&!Di(e)}function nm(e){if(e==null)return!0;if(ze(e)&&(Q(e)||typeof e=="string"||typeof e.splice=="function"||dn(e)||si(e)||Mn(e)))return!e.length;var t=Be(e);if(t==Xe||t==Ke)return!e.size;if(Li(e))return!Ms(e).length;for(var s in e)if(pe.call(e,s))return!1;return!0}function im(e,t){return Oi(e,t)}function rm(e,t,s){s=typeof s=="function"?s:i;var a=s?s(e,t):i;return a===i?Oi(e,t,i,s):!!a}function la(e){if(!Ie(e))return!1;var t=We(e);return t==Vn||t==ns||typeof e.message=="string"&&typeof e.name=="string"&&!Di(e)}function sm(e){return typeof e=="number"&&Ro(e)}function Gt(e){if(!Ae(e))return!1;var t=We(e);return t==qn||t==zi||t==ts||t==Qi}function Yu(e){return typeof e=="number"&&e==Y(e)}function Pr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Tt}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ie(e){return e!=null&&typeof e=="object"}var Xu=lo?et(lo):cd;function am(e,t){return e===t||Us(e,t,ea(t))}function om(e,t,s){return s=typeof s=="function"?s:i,Us(e,t,ea(t),s)}function um(e){return Ku(e)&&e!=+e}function cm(e){if(Jd(e))throw new z(f);return Go(e)}function lm(e){return e===null}function fm(e){return e==null}function Ku(e){return typeof e=="number"||Ie(e)&&We(e)==In}function Di(e){if(!Ie(e)||We(e)!=wt)return!1;var t=ur(e);if(t===null)return!0;var s=pe.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&rr.call(s)==op}var fa=fo?et(fo):ld;function pm(e){return Yu(e)&&e>=-Tt&&e<=Tt}var Zu=po?et(po):fd;function kr(e){return typeof e=="string"||!Q(e)&&Ie(e)&&We(e)==bn}function nt(e){return typeof e=="symbol"||Ie(e)&&We(e)==Jn}var si=ho?et(ho):pd;function dm(e){return e===i}function hm(e){return Ie(e)&&Be(e)==nn}function gm(e){return Ie(e)&&We(e)==ss}var mm=Ir($s),ym=Ir(function(e,t){return e<=t});function ec(e){if(!e)return[];if(ze(e))return kr(e)?Et(e):Je(e);if(Ti&&e[Ti])return Hf(e[Ti]());var t=Be(e),s=t==Xe?Is:t==Ke?tr:ai;return s(e)}function Vt(e){if(!e)return e===0?e:0;if(e=dt(e),e===Rt||e===-Rt){var t=e<0?-1:1;return t*Xr}return e===e?e:0}function Y(e){var t=Vt(e),s=t%1;return t===t?s?t-s:t:0}function tc(e){return e?Dn(Y(e),0,st):0}function dt(e){if(typeof e=="number")return e;if(nt(e))return Wn;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=xo(e);var s=Xl.test(e);return s||Zl.test(e)?Lf(e.slice(2),s?2:8):Yl.test(e)?Wn:+e}function nc(e){return Ft(e,Qe(e))}function vm(e){return e?Dn(Y(e),-Tt,Tt):e===0?e:0}function le(e){return e==null?"":tt(e)}var _m=ni(function(e,t){if(Li(t)||ze(t)){Ft(t,Pe(t),e);return}for(var s in t)pe.call(t,s)&&Ii(e,s,t[s])}),ic=ni(function(e,t){Ft(t,Qe(t),e)}),Ur=ni(function(e,t,s,a){Ft(t,Qe(t),e,a)}),xm=ni(function(e,t,s,a){Ft(t,Pe(t),e,a)}),Tm=jt(Ls);function wm(e,t){var s=ti(e);return t==null?s:Po(s,t)}var Em=K(function(e,t){e=ye(e);var s=-1,a=t.length,c=a>2?t[2]:i;for(c&&Ge(t[0],t[1],c)&&(a=1);++s<a;)for(var p=t[s],d=Qe(p),h=-1,y=d.length;++h<y;){var E=d[h],S=e[E];(S===i||At(S,Kn[E])&&!pe.call(e,E))&&(e[E]=p[E])}return e}),Sm=K(function(e){return e.push(i,xu),Ze(rc,i,e)});function Am(e,t){return mo(e,j(t,3),Lt)}function Im(e,t){return mo(e,j(t,3),Ds)}function bm(e,t){return e==null?e:Fs(e,j(t,3),Qe)}function Nm(e,t){return e==null?e:Bo(e,j(t,3),Qe)}function Om(e,t){return e&&Lt(e,j(t,3))}function Rm(e,t){return e&&Ds(e,j(t,3))}function Cm(e){return e==null?[]:vr(e,Pe(e))}function Lm(e){return e==null?[]:vr(e,Qe(e))}function pa(e,t,s){var a=e==null?i:Pn(e,t);return a===i?s:a}function Fm(e,t){return e!=null&&Eu(e,t,nd)}function da(e,t){return e!=null&&Eu(e,t,id)}var Dm=gu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=sr.call(t)),e[t]=s},ga(He)),Pm=gu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=sr.call(t)),pe.call(e,t)?e[t].push(s):e[t]=[s]},j),km=K(Ni);function Pe(e){return ze(e)?Fo(e):Ms(e)}function Qe(e){return ze(e)?Fo(e,!0):dd(e)}function Um(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){$t(s,t(a,c,p),a)}),s}function Mm(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){$t(s,c,t(a,c,p))}),s}var $m=ni(function(e,t,s){_r(e,t,s)}),rc=ni(function(e,t,s,a){_r(e,t,s,a)}),Bm=jt(function(e,t){var s={};if(e==null)return s;var a=!1;t=Ee(t,function(p){return p=fn(p,e),a||(a=p.length>1),p}),Ft(e,Ks(e),s),a&&(s=lt(s,D|P|M,Dd));for(var c=t.length;c--;)Vs(s,t[c]);return s});function jm(e,t){return sc(e,Dr(j(t)))}var Wm=jt(function(e,t){return e==null?{}:gd(e,t)});function sc(e,t){if(e==null)return{};var s=Ee(Ks(e),function(a){return[a]});return t=j(t),Yo(e,s,function(a,c){return t(a,c[0])})}function Gm(e,t,s){t=fn(t,e);var a=-1,c=t.length;for(c||(c=1,e=i);++a<c;){var p=e==null?i:e[Dt(t[a])];p===i&&(a=c,p=s),e=Gt(p)?p.call(e):p}return e}function Vm(e,t,s){return e==null?e:Ri(e,t,s)}function qm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:Ri(e,t,s,a)}var ac=vu(Pe),oc=vu(Qe);function Jm(e,t,s){var a=Q(e),c=a||dn(e)||si(e);if(t=j(t,4),s==null){var p=e&&e.constructor;c?s=a?new p:[]:Ae(e)?s=Gt(p)?ti(ur(e)):{}:s={}}return(c?ot:Lt)(e,function(d,h,y){return t(s,d,h,y)}),s}function zm(e,t){return e==null?!0:Vs(e,t)}function Qm(e,t,s){return e==null?e:tu(e,t,zs(s))}function Hm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:tu(e,t,zs(s),a)}function ai(e){return e==null?[]:As(e,Pe(e))}function Ym(e){return e==null?[]:As(e,Qe(e))}function Xm(e,t,s){return s===i&&(s=t,t=i),s!==i&&(s=dt(s),s=s===s?s:0),t!==i&&(t=dt(t),t=t===t?t:0),Dn(dt(e),t,s)}function Km(e,t,s){return t=Vt(t),s===i?(s=t,t=0):s=Vt(s),e=dt(e),rd(e,t,s)}function Zm(e,t,s){if(s&&typeof s!="boolean"&&Ge(e,t,s)&&(t=s=i),s===i&&(typeof t=="boolean"?(s=t,t=i):typeof e=="boolean"&&(s=e,e=i)),e===i&&t===i?(e=0,t=1):(e=Vt(e),t===i?(t=e,e=0):t=Vt(t)),e>t){var a=e;e=t,t=a}if(s||e%1||t%1){var c=Co();return $e(e+c*(t-e+Cf("1e-"+((c+"").length-1))),t)}return js(e,t)}var e0=ii(function(e,t,s){return t=t.toLowerCase(),e+(s?uc(t):t)});function uc(e){return ha(le(e).toLowerCase())}function cc(e){return e=le(e),e&&e.replace(tf,Vf).replace(Tf,"")}function t0(e,t,s){e=le(e),t=tt(t);var a=e.length;s=s===i?a:Dn(Y(s),0,a);var c=s;return s-=t.length,s>=0&&e.slice(s,c)==t}function n0(e){return e=le(e),e&&Pl.test(e)?e.replace($a,qf):e}function i0(e){return e=le(e),e&&jl.test(e)?e.replace(cs,"\\$&"):e}var r0=ii(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),s0=ii(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),a0=pu("toLowerCase");function o0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;if(!t||a>=t)return e;var c=(t-a)/2;return Ar(pr(c),s)+e+Ar(fr(c),s)}function u0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;return t&&a<t?e+Ar(t-a,s):e}function c0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;return t&&a<t?Ar(t-a,s)+e:e}function l0(e,t,s){return s||t==null?t=0:t&&(t=+t),yp(le(e).replace(ls,""),t||0)}function f0(e,t,s){return(s?Ge(e,t,s):t===i)?t=1:t=Y(t),Ws(le(e),t)}function p0(){var e=arguments,t=le(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var d0=ii(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});function h0(e,t,s){return s&&typeof s!="number"&&Ge(e,t,s)&&(t=s=i),s=s===i?st:s>>>0,s?(e=le(e),e&&(typeof t=="string"||t!=null&&!fa(t))&&(t=tt(t),!t&&Hn(e))?pn(Et(e),0,s):e.split(t,s)):[]}var g0=ii(function(e,t,s){return e+(s?" ":"")+ha(t)});function m0(e,t,s){return e=le(e),s=s==null?0:Dn(Y(s),0,e.length),t=tt(t),e.slice(s,s+t.length)==t}function y0(e,t,s){var a=l.templateSettings;s&&Ge(e,t,s)&&(t=i),e=le(e),t=Ur({},t,a,_u);var c=Ur({},t.imports,a.imports,_u),p=Pe(c),d=As(c,p),h,y,E=0,S=t.interpolate||Yi,I="__p += '",C=bs((t.escape||Yi).source+"|"+S.source+"|"+(S===Ba?Hl:Yi).source+"|"+(t.evaluate||Yi).source+"|$","g"),U="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++If+"]")+`
|
|
383
|
+
`)}function Gd(e){return Q(e)||Mn(e)||!!(Oo&&e&&e[Oo])}function Gt(e,t){var s=typeof e;return t=t??Tt,!!t&&(s=="number"||s!="symbol"&&ef.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e,t,s){if(!Ae(s))return!1;var a=typeof t;return(a=="number"?ze(s)&&Gt(t,s.length):a=="string"&&t in s)?At(s[t],e):!1}function na(e,t){if(Q(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||nt(e)?!0:$l.test(e)||!Ml.test(e)||t!=null&&e in ye(t)}function Vd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ia(e){var t=br(e),s=l[t];if(typeof s!="function"||!(t in te.prototype))return!1;if(e===s)return!0;var a=Zs(s);return!!a&&e===a[0]}function qd(e){return!!Ao&&Ao in e}var Jd=ir?Vt:xa;function Li(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||Kn;return e===s}function Au(e){return e===e&&!Ae(e)}function Iu(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==i||e in ye(s))}}function zd(e){var t=Fr(e,function(a){return s.size===b&&s.clear(),a}),s=t.cache;return t}function Qd(e,t){var s=e[1],a=t[1],c=s|a,p=c<(ae|me|ce),d=a==ce&&s==xe||a==ce&&s==qe&&e[7].length<=t[8]||a==(ce|qe)&&t[7].length<=t[8]&&s==xe;if(!(p||d))return e;a&ae&&(e[2]=t[2],c|=s&ae?0:Ye);var h=t[3];if(h){var y=e[3];e[3]=y?uu(y,h,t[4]):h,e[4]=y?un(e[3],O):t[4]}return h=t[5],h&&(y=e[5],e[5]=y?cu(y,h,t[6]):h,e[6]=y?un(e[5],O):t[6]),h=t[7],h&&(e[7]=h),a&ce&&(e[8]=e[8]==null?t[8]:$e(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}function Hd(e){var t=[];if(e!=null)for(var s in ye(e))t.push(s);return t}function Yd(e){return sr.call(e)}function bu(e,t,s){return t=Fe(t===i?e.length-1:t,0),function(){for(var a=arguments,c=-1,p=Fe(a.length-t,0),d=_(p);++c<p;)d[c]=a[t+c];c=-1;for(var h=_(t+1);++c<t;)h[c]=a[c];return h[t]=s(d),Ze(e,this,h)}}function Nu(e,t){return t.length<2?e:Pn(e,ft(t,0,-1))}function Xd(e,t){for(var s=e.length,a=$e(t.length,s),c=Je(e);a--;){var p=t[a];e[a]=Gt(p,s)?c[p]:i}return e}function ra(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Ou=Cu(Ko),Fi=pp||function(e,t){return Ue.setTimeout(e,t)},sa=Cu(xd);function Ru(e,t,s){var a=t+"";return sa(e,Wd(a,Kd($d(a),s)))}function Cu(e){var t=0,s=0;return function(){var a=mp(),c=en-(a-s);if(s=a,c>0){if(++t>=xt)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Or(e,t){var s=-1,a=e.length,c=a-1;for(t=t===i?a:t;++s<t;){var p=js(s,c),d=e[p];e[p]=e[s],e[s]=d}return e.length=t,e}var Lu=zd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Bl,function(s,a,c,p){t.push(c?p.replace(Ql,"$1"):a||s)}),t});function Dt(e){if(typeof e=="string"||nt(e))return e;var t=e+"";return t=="0"&&1/e==-Rt?"-0":t}function Un(e){if(e!=null){try{return rr.call(e)}catch{}try{return e+""}catch{}}return""}function Kd(e,t){return ot(es,function(s){var a="_."+s[0];t&s[1]&&!Zi(e,a)&&e.push(a)}),e.sort()}function Fu(e){if(e instanceof te)return e.clone();var t=new ct(e.__wrapped__,e.__chain__);return t.__actions__=Je(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Zd(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Fe(Y(t),0);var a=e==null?0:e.length;if(!a||t<1)return[];for(var c=0,p=0,d=_(fr(a/t));c<a;)d[p++]=ft(e,c,c+=t);return d}function eh(e){for(var t=-1,s=e==null?0:e.length,a=0,c=[];++t<s;){var p=e[t];p&&(c[a++]=p)}return c}function th(){var e=arguments.length;if(!e)return[];for(var t=_(e-1),s=arguments[0],a=e;a--;)t[a-1]=arguments[a];return on(Q(s)?Je(s):[s],Me(t,1))}var nh=K(function(e,t){return be(e)?bi(e,Me(t,1,be,!0)):[]}),ih=K(function(e,t){var s=pt(t);return be(s)&&(s=i),be(e)?bi(e,Me(t,1,be,!0),j(s,2)):[]}),rh=K(function(e,t){var s=pt(t);return be(s)&&(s=i),be(e)?bi(e,Me(t,1,be,!0),i,s):[]});function sh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),ft(e,t<0?0:t,a)):[]}function ah(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,0,t<0?0:t)):[]}function oh(e,t){return e&&e.length?Tr(e,j(t,3),!0,!0):[]}function uh(e,t){return e&&e.length?Tr(e,j(t,3),!0):[]}function ch(e,t,s,a){var c=e==null?0:e.length;return c?(s&&typeof s!="number"&&Ge(e,t,s)&&(s=0,a=c),td(e,t,s,a)):[]}function Du(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=s==null?0:Y(s);return c<0&&(c=Fe(a+c,0)),er(e,j(t,3),c)}function Pu(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=a-1;return s!==i&&(c=Y(s),c=s<0?Fe(a+c,0):$e(c,a-1)),er(e,j(t,3),c,!0)}function ku(e){var t=e==null?0:e.length;return t?Me(e,1):[]}function lh(e){var t=e==null?0:e.length;return t?Me(e,Rt):[]}function fh(e,t){var s=e==null?0:e.length;return s?(t=t===i?1:Y(t),Me(e,t)):[]}function ph(e){for(var t=-1,s=e==null?0:e.length,a={};++t<s;){var c=e[t];a[c[0]]=c[1]}return a}function Uu(e){return e&&e.length?e[0]:i}function dh(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=s==null?0:Y(s);return c<0&&(c=Fe(a+c,0)),Qn(e,t,c)}function hh(e){var t=e==null?0:e.length;return t?ft(e,0,-1):[]}var gh=K(function(e){var t=Ee(e,Js);return t.length&&t[0]===e[0]?ks(t):[]}),mh=K(function(e){var t=pt(e),s=Ee(e,Js);return t===pt(s)?t=i:s.pop(),s.length&&s[0]===e[0]?ks(s,j(t,2)):[]}),yh=K(function(e){var t=pt(e),s=Ee(e,Js);return t=typeof t=="function"?t:i,t&&s.pop(),s.length&&s[0]===e[0]?ks(s,i,t):[]});function vh(e,t){return e==null?"":hp.call(e,t)}function pt(e){var t=e==null?0:e.length;return t?e[t-1]:i}function _h(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=a;return s!==i&&(c=Y(s),c=c<0?Fe(a+c,0):$e(c,a-1)),t===t?Kf(e,t,c):er(e,yo,c,!0)}function xh(e,t){return e&&e.length?Qo(e,Y(t)):i}var Th=K(Mu);function Mu(e,t){return e&&e.length&&t&&t.length?Bs(e,t):e}function wh(e,t,s){return e&&e.length&&t&&t.length?Bs(e,t,j(s,2)):e}function Eh(e,t,s){return e&&e.length&&t&&t.length?Bs(e,t,i,s):e}var Sh=Wt(function(e,t){var s=e==null?0:e.length,a=Ls(e,t);return Xo(e,Ee(t,function(c){return Gt(c,s)?+c:c}).sort(ou)),a});function Ah(e,t){var s=[];if(!(e&&e.length))return s;var a=-1,c=[],p=e.length;for(t=j(t,3);++a<p;){var d=e[a];t(d,a,e)&&(s.push(d),c.push(a))}return Xo(e,c),s}function aa(e){return e==null?e:vp.call(e)}function Ih(e,t,s){var a=e==null?0:e.length;return a?(s&&typeof s!="number"&&Ge(e,t,s)?(t=0,s=a):(t=t==null?0:Y(t),s=s===i?a:Y(s)),ft(e,t,s)):[]}function bh(e,t){return xr(e,t)}function Nh(e,t,s){return Gs(e,t,j(s,2))}function Oh(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t);if(a<s&&At(e[a],t))return a}return-1}function Rh(e,t){return xr(e,t,!0)}function Ch(e,t,s){return Gs(e,t,j(s,2),!0)}function Lh(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t,!0)-1;if(At(e[a],t))return a}return-1}function Fh(e){return e&&e.length?Zo(e):[]}function Dh(e,t){return e&&e.length?Zo(e,j(t,2)):[]}function Ph(e){var t=e==null?0:e.length;return t?ft(e,1,t):[]}function kh(e,t,s){return e&&e.length?(t=s||t===i?1:Y(t),ft(e,0,t<0?0:t)):[]}function Uh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,t<0?0:t,a)):[]}function Mh(e,t){return e&&e.length?Tr(e,j(t,3),!1,!0):[]}function $h(e,t){return e&&e.length?Tr(e,j(t,3)):[]}var Bh=K(function(e){return fn(Me(e,1,be,!0))}),jh=K(function(e){var t=pt(e);return be(t)&&(t=i),fn(Me(e,1,be,!0),j(t,2))}),Wh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,fn(Me(e,1,be,!0),i,t)});function Gh(e){return e&&e.length?fn(e):[]}function Vh(e,t){return e&&e.length?fn(e,j(t,2)):[]}function qh(e,t){return t=typeof t=="function"?t:i,e&&e.length?fn(e,i,t):[]}function oa(e){if(!(e&&e.length))return[];var t=0;return e=an(e,function(s){if(be(s))return t=Fe(s.length,t),!0}),Ss(t,function(s){return Ee(e,Ts(s))})}function $u(e,t){if(!(e&&e.length))return[];var s=oa(e);return t==null?s:Ee(s,function(a){return Ze(t,i,a)})}var Jh=K(function(e,t){return be(e)?bi(e,t):[]}),zh=K(function(e){return qs(an(e,be))}),Qh=K(function(e){var t=pt(e);return be(t)&&(t=i),qs(an(e,be),j(t,2))}),Hh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,qs(an(e,be),i,t)}),Yh=K(oa);function Xh(e,t){return iu(e||[],t||[],Ii)}function Kh(e,t){return iu(e||[],t||[],Ri)}var Zh=K(function(e){var t=e.length,s=t>1?e[t-1]:i;return s=typeof s=="function"?(e.pop(),s):i,$u(e,s)});function Bu(e){var t=l(e);return t.__chain__=!0,t}function eg(e,t){return t(e),e}function Rr(e,t){return t(e)}var tg=Wt(function(e){var t=e.length,s=t?e[0]:0,a=this.__wrapped__,c=function(p){return Ls(p,e)};return t>1||this.__actions__.length||!(a instanceof te)||!Gt(s)?this.thru(c):(a=a.slice(s,+s+(t?1:0)),a.__actions__.push({func:Rr,args:[c],thisArg:i}),new ct(a,this.__chain__).thru(function(p){return t&&!p.length&&p.push(i),p}))});function ng(){return Bu(this)}function ig(){return new ct(this.value(),this.__chain__)}function rg(){this.__values__===i&&(this.__values__=ec(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function sg(){return this}function ag(e){for(var t,s=this;s instanceof gr;){var a=Fu(s);a.__index__=0,a.__values__=i,t?c.__wrapped__=a:t=a;var c=a;s=s.__wrapped__}return c.__wrapped__=e,t}function og(){var e=this.__wrapped__;if(e instanceof te){var t=e;return this.__actions__.length&&(t=new te(this)),t=t.reverse(),t.__actions__.push({func:Rr,args:[aa],thisArg:i}),new ct(t,this.__chain__)}return this.thru(aa)}function ug(){return nu(this.__wrapped__,this.__actions__)}var cg=wr(function(e,t,s){pe.call(e,s)?++e[s]:Bt(e,s,1)});function lg(e,t,s){var a=Q(e)?go:ed;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}function fg(e,t){var s=Q(e)?an:$o;return s(e,j(t,3))}var pg=du(Du),dg=du(Pu);function hg(e,t){return Me(Cr(e,t),1)}function gg(e,t){return Me(Cr(e,t),Rt)}function mg(e,t,s){return s=s===i?1:Y(s),Me(Cr(e,t),s)}function ju(e,t){var s=Q(e)?ot:ln;return s(e,j(t,3))}function Wu(e,t){var s=Q(e)?Pf:Mo;return s(e,j(t,3))}var yg=wr(function(e,t,s){pe.call(e,s)?e[s].push(t):Bt(e,s,[t])});function vg(e,t,s,a){e=ze(e)?e:ai(e),s=s&&!a?Y(s):0;var c=e.length;return s<0&&(s=Fe(c+s,0)),kr(e)?s<=c&&e.indexOf(t,s)>-1:!!c&&Qn(e,t,s)>-1}var _g=K(function(e,t,s){var a=-1,c=typeof t=="function",p=ze(e)?_(e.length):[];return ln(e,function(d){p[++a]=c?Ze(t,d,s):Ni(d,t,s)}),p}),xg=wr(function(e,t,s){Bt(e,s,t)});function Cr(e,t){var s=Q(e)?Ee:qo;return s(e,j(t,3))}function Tg(e,t,s,a){return e==null?[]:(Q(t)||(t=t==null?[]:[t]),s=a?i:s,Q(s)||(s=s==null?[]:[s]),Ho(e,t,s))}var wg=wr(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function Eg(e,t,s){var a=Q(e)?_s:_o,c=arguments.length<3;return a(e,j(t,4),s,c,ln)}function Sg(e,t,s){var a=Q(e)?kf:_o,c=arguments.length<3;return a(e,j(t,4),s,c,Mo)}function Ag(e,t){var s=Q(e)?an:$o;return s(e,Dr(j(t,3)))}function Ig(e){var t=Q(e)?Do:vd;return t(e)}function bg(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Y(t);var a=Q(e)?Hp:_d;return a(e,t)}function Ng(e){var t=Q(e)?Yp:Td;return t(e)}function Og(e){if(e==null)return 0;if(ze(e))return kr(e)?Yn(e):e.length;var t=Be(e);return t==Xe||t==Ke?e.size:Ms(e).length}function Rg(e,t,s){var a=Q(e)?xs:wd;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}var Cg=K(function(e,t){if(e==null)return[];var s=t.length;return s>1&&Ge(e,t[0],t[1])?t=[]:s>2&&Ge(t[0],t[1],t[2])&&(t=[t[0]]),Ho(e,Me(t,1),[])}),Lr=fp||function(){return Ue.Date.now()};function Lg(e,t){if(typeof t!="function")throw new ut(g);return e=Y(e),function(){if(--e<1)return t.apply(this,arguments)}}function Gu(e,t,s){return t=s?i:t,t=e&&t==null?e.length:t,jt(e,ce,i,i,i,i,t)}function Vu(e,t){var s;if(typeof t!="function")throw new ut(g);return e=Y(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=i),s}}var ua=K(function(e,t,s){var a=ae;if(s.length){var c=un(s,ri(ua));a|=ee}return jt(e,a,t,s,c)}),qu=K(function(e,t,s){var a=ae|me;if(s.length){var c=un(s,ri(qu));a|=ee}return jt(t,a,e,s,c)});function Ju(e,t,s){t=s?i:t;var a=jt(e,xe,i,i,i,i,i,t);return a.placeholder=Ju.placeholder,a}function zu(e,t,s){t=s?i:t;var a=jt(e,L,i,i,i,i,i,t);return a.placeholder=zu.placeholder,a}function Qu(e,t,s){var a,c,p,d,h,y,E=0,S=!1,I=!1,C=!0;if(typeof e!="function")throw new ut(g);t=dt(t)||0,Ae(s)&&(S=!!s.leading,I="maxWait"in s,p=I?Fe(dt(s.maxWait)||0,t):p,C="trailing"in s?!!s.trailing:C);function U(Ne){var It=a,Jt=c;return a=c=i,E=Ne,d=e.apply(Jt,It),d}function G(Ne){return E=Ne,h=Fi(Z,t),S?U(Ne):d}function X(Ne){var It=Ne-y,Jt=Ne-E,dc=t-It;return I?$e(dc,p-Jt):dc}function V(Ne){var It=Ne-y,Jt=Ne-E;return y===i||It>=t||It<0||I&&Jt>=p}function Z(){var Ne=Lr();if(V(Ne))return ie(Ne);h=Fi(Z,X(Ne))}function ie(Ne){return h=i,C&&a?U(Ne):(a=c=i,d)}function it(){h!==i&&ru(h),E=0,a=y=c=h=i}function Ve(){return h===i?d:ie(Lr())}function rt(){var Ne=Lr(),It=V(Ne);if(a=arguments,c=this,y=Ne,It){if(h===i)return G(y);if(I)return ru(h),h=Fi(Z,t),U(y)}return h===i&&(h=Fi(Z,t)),d}return rt.cancel=it,rt.flush=Ve,rt}var Fg=K(function(e,t){return Uo(e,1,t)}),Dg=K(function(e,t,s){return Uo(e,dt(t)||0,s)});function Pg(e){return jt(e,x)}function Fr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new ut(g);var s=function(){var a=arguments,c=t?t.apply(this,a):a[0],p=s.cache;if(p.has(c))return p.get(c);var d=e.apply(this,a);return s.cache=p.set(c,d)||p,d};return s.cache=new(Fr.Cache||$t),s}Fr.Cache=$t;function Dr(e){if(typeof e!="function")throw new ut(g);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 kg(e){return Vu(2,e)}var Ug=Ed(function(e,t){t=t.length==1&&Q(t[0])?Ee(t[0],et(j())):Ee(Me(t,1),et(j()));var s=t.length;return K(function(a){for(var c=-1,p=$e(a.length,s);++c<p;)a[c]=t[c].call(this,a[c]);return Ze(e,this,a)})}),ca=K(function(e,t){var s=un(t,ri(ca));return jt(e,ee,i,t,s)}),Hu=K(function(e,t){var s=un(t,ri(Hu));return jt(e,H,i,t,s)}),Mg=Wt(function(e,t){return jt(e,qe,i,i,i,t)});function $g(e,t){if(typeof e!="function")throw new ut(g);return t=t===i?t:Y(t),K(e,t)}function Bg(e,t){if(typeof e!="function")throw new ut(g);return t=t==null?0:Fe(Y(t),0),K(function(s){var a=s[t],c=dn(s,0,t);return a&&on(c,a),Ze(e,this,c)})}function jg(e,t,s){var a=!0,c=!0;if(typeof e!="function")throw new ut(g);return Ae(s)&&(a="leading"in s?!!s.leading:a,c="trailing"in s?!!s.trailing:c),Qu(e,t,{leading:a,maxWait:t,trailing:c})}function Wg(e){return Gu(e,1)}function Gg(e,t){return ca(zs(t),e)}function Vg(){if(!arguments.length)return[];var e=arguments[0];return Q(e)?e:[e]}function qg(e){return lt(e,M)}function Jg(e,t){return t=typeof t=="function"?t:i,lt(e,M,t)}function zg(e){return lt(e,D|M)}function Qg(e,t){return t=typeof t=="function"?t:i,lt(e,D|M,t)}function Hg(e,t){return t==null||ko(e,t,Pe(t))}function At(e,t){return e===t||e!==e&&t!==t}var Yg=Ir(Ps),Xg=Ir(function(e,t){return e>=t}),Mn=Wo(function(){return arguments}())?Wo:function(e){return Ie(e)&&pe.call(e,"callee")&&!No.call(e,"callee")},Q=_.isArray,Kg=uo?et(uo):ad;function ze(e){return e!=null&&Pr(e.length)&&!Vt(e)}function be(e){return Ie(e)&&ze(e)}function Zg(e){return e===!0||e===!1||Ie(e)&&We(e)==Sn}var hn=dp||xa,em=co?et(co):od;function tm(e){return Ie(e)&&e.nodeType===1&&!Di(e)}function nm(e){if(e==null)return!0;if(ze(e)&&(Q(e)||typeof e=="string"||typeof e.splice=="function"||hn(e)||si(e)||Mn(e)))return!e.length;var t=Be(e);if(t==Xe||t==Ke)return!e.size;if(Li(e))return!Ms(e).length;for(var s in e)if(pe.call(e,s))return!1;return!0}function im(e,t){return Oi(e,t)}function rm(e,t,s){s=typeof s=="function"?s:i;var a=s?s(e,t):i;return a===i?Oi(e,t,i,s):!!a}function la(e){if(!Ie(e))return!1;var t=We(e);return t==Vn||t==ns||typeof e.message=="string"&&typeof e.name=="string"&&!Di(e)}function sm(e){return typeof e=="number"&&Ro(e)}function Vt(e){if(!Ae(e))return!1;var t=We(e);return t==qn||t==zi||t==ts||t==Qi}function Yu(e){return typeof e=="number"&&e==Y(e)}function Pr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Tt}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ie(e){return e!=null&&typeof e=="object"}var Xu=lo?et(lo):cd;function am(e,t){return e===t||Us(e,t,ea(t))}function om(e,t,s){return s=typeof s=="function"?s:i,Us(e,t,ea(t),s)}function um(e){return Ku(e)&&e!=+e}function cm(e){if(Jd(e))throw new z(f);return Go(e)}function lm(e){return e===null}function fm(e){return e==null}function Ku(e){return typeof e=="number"||Ie(e)&&We(e)==In}function Di(e){if(!Ie(e)||We(e)!=wt)return!1;var t=ur(e);if(t===null)return!0;var s=pe.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&rr.call(s)==op}var fa=fo?et(fo):ld;function pm(e){return Yu(e)&&e>=-Tt&&e<=Tt}var Zu=po?et(po):fd;function kr(e){return typeof e=="string"||!Q(e)&&Ie(e)&&We(e)==bn}function nt(e){return typeof e=="symbol"||Ie(e)&&We(e)==Jn}var si=ho?et(ho):pd;function dm(e){return e===i}function hm(e){return Ie(e)&&Be(e)==rn}function gm(e){return Ie(e)&&We(e)==ss}var mm=Ir($s),ym=Ir(function(e,t){return e<=t});function ec(e){if(!e)return[];if(ze(e))return kr(e)?Et(e):Je(e);if(Ti&&e[Ti])return Hf(e[Ti]());var t=Be(e),s=t==Xe?Is:t==Ke?tr:ai;return s(e)}function qt(e){if(!e)return e===0?e:0;if(e=dt(e),e===Rt||e===-Rt){var t=e<0?-1:1;return t*Xr}return e===e?e:0}function Y(e){var t=qt(e),s=t%1;return t===t?s?t-s:t:0}function tc(e){return e?Dn(Y(e),0,st):0}function dt(e){if(typeof e=="number")return e;if(nt(e))return Wn;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=xo(e);var s=Xl.test(e);return s||Zl.test(e)?Lf(e.slice(2),s?2:8):Yl.test(e)?Wn:+e}function nc(e){return Ft(e,Qe(e))}function vm(e){return e?Dn(Y(e),-Tt,Tt):e===0?e:0}function le(e){return e==null?"":tt(e)}var _m=ni(function(e,t){if(Li(t)||ze(t)){Ft(t,Pe(t),e);return}for(var s in t)pe.call(t,s)&&Ii(e,s,t[s])}),ic=ni(function(e,t){Ft(t,Qe(t),e)}),Ur=ni(function(e,t,s,a){Ft(t,Qe(t),e,a)}),xm=ni(function(e,t,s,a){Ft(t,Pe(t),e,a)}),Tm=Wt(Ls);function wm(e,t){var s=ti(e);return t==null?s:Po(s,t)}var Em=K(function(e,t){e=ye(e);var s=-1,a=t.length,c=a>2?t[2]:i;for(c&&Ge(t[0],t[1],c)&&(a=1);++s<a;)for(var p=t[s],d=Qe(p),h=-1,y=d.length;++h<y;){var E=d[h],S=e[E];(S===i||At(S,Kn[E])&&!pe.call(e,E))&&(e[E]=p[E])}return e}),Sm=K(function(e){return e.push(i,xu),Ze(rc,i,e)});function Am(e,t){return mo(e,j(t,3),Lt)}function Im(e,t){return mo(e,j(t,3),Ds)}function bm(e,t){return e==null?e:Fs(e,j(t,3),Qe)}function Nm(e,t){return e==null?e:Bo(e,j(t,3),Qe)}function Om(e,t){return e&&Lt(e,j(t,3))}function Rm(e,t){return e&&Ds(e,j(t,3))}function Cm(e){return e==null?[]:vr(e,Pe(e))}function Lm(e){return e==null?[]:vr(e,Qe(e))}function pa(e,t,s){var a=e==null?i:Pn(e,t);return a===i?s:a}function Fm(e,t){return e!=null&&Eu(e,t,nd)}function da(e,t){return e!=null&&Eu(e,t,id)}var Dm=gu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=sr.call(t)),e[t]=s},ga(He)),Pm=gu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=sr.call(t)),pe.call(e,t)?e[t].push(s):e[t]=[s]},j),km=K(Ni);function Pe(e){return ze(e)?Fo(e):Ms(e)}function Qe(e){return ze(e)?Fo(e,!0):dd(e)}function Um(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){Bt(s,t(a,c,p),a)}),s}function Mm(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){Bt(s,c,t(a,c,p))}),s}var $m=ni(function(e,t,s){_r(e,t,s)}),rc=ni(function(e,t,s,a){_r(e,t,s,a)}),Bm=Wt(function(e,t){var s={};if(e==null)return s;var a=!1;t=Ee(t,function(p){return p=pn(p,e),a||(a=p.length>1),p}),Ft(e,Ks(e),s),a&&(s=lt(s,D|P|M,Dd));for(var c=t.length;c--;)Vs(s,t[c]);return s});function jm(e,t){return sc(e,Dr(j(t)))}var Wm=Wt(function(e,t){return e==null?{}:gd(e,t)});function sc(e,t){if(e==null)return{};var s=Ee(Ks(e),function(a){return[a]});return t=j(t),Yo(e,s,function(a,c){return t(a,c[0])})}function Gm(e,t,s){t=pn(t,e);var a=-1,c=t.length;for(c||(c=1,e=i);++a<c;){var p=e==null?i:e[Dt(t[a])];p===i&&(a=c,p=s),e=Vt(p)?p.call(e):p}return e}function Vm(e,t,s){return e==null?e:Ri(e,t,s)}function qm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:Ri(e,t,s,a)}var ac=vu(Pe),oc=vu(Qe);function Jm(e,t,s){var a=Q(e),c=a||hn(e)||si(e);if(t=j(t,4),s==null){var p=e&&e.constructor;c?s=a?new p:[]:Ae(e)?s=Vt(p)?ti(ur(e)):{}:s={}}return(c?ot:Lt)(e,function(d,h,y){return t(s,d,h,y)}),s}function zm(e,t){return e==null?!0:Vs(e,t)}function Qm(e,t,s){return e==null?e:tu(e,t,zs(s))}function Hm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:tu(e,t,zs(s),a)}function ai(e){return e==null?[]:As(e,Pe(e))}function Ym(e){return e==null?[]:As(e,Qe(e))}function Xm(e,t,s){return s===i&&(s=t,t=i),s!==i&&(s=dt(s),s=s===s?s:0),t!==i&&(t=dt(t),t=t===t?t:0),Dn(dt(e),t,s)}function Km(e,t,s){return t=qt(t),s===i?(s=t,t=0):s=qt(s),e=dt(e),rd(e,t,s)}function Zm(e,t,s){if(s&&typeof s!="boolean"&&Ge(e,t,s)&&(t=s=i),s===i&&(typeof t=="boolean"?(s=t,t=i):typeof e=="boolean"&&(s=e,e=i)),e===i&&t===i?(e=0,t=1):(e=qt(e),t===i?(t=e,e=0):t=qt(t)),e>t){var a=e;e=t,t=a}if(s||e%1||t%1){var c=Co();return $e(e+c*(t-e+Cf("1e-"+((c+"").length-1))),t)}return js(e,t)}var e0=ii(function(e,t,s){return t=t.toLowerCase(),e+(s?uc(t):t)});function uc(e){return ha(le(e).toLowerCase())}function cc(e){return e=le(e),e&&e.replace(tf,Vf).replace(Tf,"")}function t0(e,t,s){e=le(e),t=tt(t);var a=e.length;s=s===i?a:Dn(Y(s),0,a);var c=s;return s-=t.length,s>=0&&e.slice(s,c)==t}function n0(e){return e=le(e),e&&Pl.test(e)?e.replace($a,qf):e}function i0(e){return e=le(e),e&&jl.test(e)?e.replace(cs,"\\$&"):e}var r0=ii(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),s0=ii(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),a0=pu("toLowerCase");function o0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;if(!t||a>=t)return e;var c=(t-a)/2;return Ar(pr(c),s)+e+Ar(fr(c),s)}function u0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;return t&&a<t?e+Ar(t-a,s):e}function c0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;return t&&a<t?Ar(t-a,s)+e:e}function l0(e,t,s){return s||t==null?t=0:t&&(t=+t),yp(le(e).replace(ls,""),t||0)}function f0(e,t,s){return(s?Ge(e,t,s):t===i)?t=1:t=Y(t),Ws(le(e),t)}function p0(){var e=arguments,t=le(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var d0=ii(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});function h0(e,t,s){return s&&typeof s!="number"&&Ge(e,t,s)&&(t=s=i),s=s===i?st:s>>>0,s?(e=le(e),e&&(typeof t=="string"||t!=null&&!fa(t))&&(t=tt(t),!t&&Hn(e))?dn(Et(e),0,s):e.split(t,s)):[]}var g0=ii(function(e,t,s){return e+(s?" ":"")+ha(t)});function m0(e,t,s){return e=le(e),s=s==null?0:Dn(Y(s),0,e.length),t=tt(t),e.slice(s,s+t.length)==t}function y0(e,t,s){var a=l.templateSettings;s&&Ge(e,t,s)&&(t=i),e=le(e),t=Ur({},t,a,_u);var c=Ur({},t.imports,a.imports,_u),p=Pe(c),d=As(c,p),h,y,E=0,S=t.interpolate||Yi,I="__p += '",C=bs((t.escape||Yi).source+"|"+S.source+"|"+(S===Ba?Hl:Yi).source+"|"+(t.evaluate||Yi).source+"|$","g"),U="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++If+"]")+`
|
|
384
384
|
`;e.replace(C,function(V,Z,ie,it,Ve,rt){return ie||(ie=it),I+=e.slice(E,rt).replace(nf,Jf),Z&&(h=!0,I+=`' +
|
|
385
385
|
__e(`+Z+`) +
|
|
386
386
|
'`),Ve&&(y=!0,I+=`';
|
|
@@ -397,7 +397,7 @@ __p += '`),ie&&(I+=`' +
|
|
|
397
397
|
function print() { __p += __j.call(arguments, '') }
|
|
398
398
|
`:`;
|
|
399
399
|
`)+I+`return __p
|
|
400
|
-
}`;var X=fc(function(){return oe(p,U+"return "+I).apply(i,d)});if(X.source=I,la(X))throw X;return X}function v0(e){return le(e).toLowerCase()}function _0(e){return le(e).toUpperCase()}function x0(e,t,s){if(e=le(e),e&&(s||t===i))return xo(e);if(!e||!(t=tt(t)))return e;var a=Et(e),c=Et(t),p=To(a,c),d=wo(a,c)+1;return pn(a,p,d).join("")}function T0(e,t,s){if(e=le(e),e&&(s||t===i))return e.slice(0,So(e)+1);if(!e||!(t=tt(t)))return e;var a=Et(e),c=wo(a,Et(t))+1;return pn(a,0,c).join("")}function w0(e,t,s){if(e=le(e),e&&(s||t===i))return e.replace(ls,"");if(!e||!(t=tt(t)))return e;var a=Et(e),c=To(a,Et(t));return pn(a,c).join("")}function E0(e,t){var s=q,a=Se;if(Ae(t)){var c="separator"in t?t.separator:c;s="length"in t?Y(t.length):s,a="omission"in t?tt(t.omission):a}e=le(e);var p=e.length;if(Hn(e)){var d=Et(e);p=d.length}if(s>=p)return e;var h=s-Yn(a);if(h<1)return a;var y=d?pn(d,0,h).join(""):e.slice(0,h);if(c===i)return y+a;if(d&&(h+=y.length-h),fa(c)){if(e.slice(h).search(c)){var E,S=y;for(c.global||(c=bs(c.source,le(ja.exec(c))+"g")),c.lastIndex=0;E=c.exec(S);)var I=E.index;y=y.slice(0,I===i?h:I)}}else if(e.indexOf(tt(c),h)!=h){var C=y.lastIndexOf(c);C>-1&&(y=y.slice(0,C))}return y+a}function S0(e){return e=le(e),e&&Dl.test(e)?e.replace(Ma,Zf):e}var A0=ii(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),ha=pu("toUpperCase");function lc(e,t,s){return e=le(e),t=s?i:t,t===i?Qf(e)?np(e):$f(e):e.match(t)||[]}var fc=K(function(e,t){try{return Ze(e,i,t)}catch(s){return la(s)?s:new z(s)}}),I0=jt(function(e,t){return ot(t,function(s){s=Dt(s),$t(e,s,ua(e[s],e))}),e});function b0(e){var t=e==null?0:e.length,s=j();return e=t?Ee(e,function(a){if(typeof a[1]!="function")throw new ut(g);return[s(a[0]),a[1]]}):[],K(function(a){for(var c=-1;++c<t;){var p=e[c];if(Ze(p[0],this,a))return Ze(p[1],this,a)}})}function N0(e){return Zp(lt(e,D))}function ga(e){return function(){return e}}function O0(e,t){return e==null||e!==e?t:e}var R0=hu(),C0=hu(!0);function He(e){return e}function ma(e){return Vo(typeof e=="function"?e:lt(e,D))}function L0(e){return Jo(lt(e,D))}function F0(e,t){return zo(e,lt(t,D))}var D0=K(function(e,t){return function(s){return Ni(s,e,t)}}),P0=K(function(e,t){return function(s){return Ni(e,s,t)}});function ya(e,t,s){var a=Pe(t),c=vr(t,a);s==null&&!(Ae(t)&&(c.length||!a.length))&&(s=t,t=e,e=this,c=vr(t,Pe(t)));var p=!(Ae(s)&&"chain"in s)||!!s.chain,d=Gt(e);return ot(c,function(h){var y=t[h];e[h]=y,d&&(e.prototype[h]=function(){var E=this.__chain__;if(p||E){var S=e(this.__wrapped__),I=S.__actions__=Je(this.__actions__);return I.push({func:y,args:arguments,thisArg:e}),S.__chain__=E,S}return y.apply(e,an([this.value()],arguments))})}),e}function k0(){return Ue._===this&&(Ue._=up),this}function va(){}function U0(e){return e=Y(e),K(function(t){return Qo(t,e)})}var M0=Hs(Ee),$0=Hs(go),B0=Hs(xs);function pc(e){return na(e)?Ts(Dt(e)):md(e)}function j0(e){return function(t){return e==null?i:Pn(e,t)}}var W0=mu(),G0=mu(!0);function _a(){return[]}function xa(){return!1}function V0(){return{}}function q0(){return""}function J0(){return!0}function z0(e,t){if(e=Y(e),e<1||e>Tt)return[];var s=st,a=$e(e,st);t=j(t),e-=st;for(var c=Ss(a,t);++s<e;)t(s);return c}function Q0(e){return Q(e)?Ee(e,Dt):nt(e)?[e]:Je(Lu(le(e)))}function H0(e){var t=++ap;return le(e)+t}var Y0=Sr(function(e,t){return e+t},0),X0=Ys("ceil"),K0=Sr(function(e,t){return e/t},1),Z0=Ys("floor");function ey(e){return e&&e.length?yr(e,He,Ps):i}function ty(e,t){return e&&e.length?yr(e,j(t,2),Ps):i}function ny(e){return vo(e,He)}function iy(e,t){return vo(e,j(t,2))}function ry(e){return e&&e.length?yr(e,He,$s):i}function sy(e,t){return e&&e.length?yr(e,j(t,2),$s):i}var ay=Sr(function(e,t){return e*t},1),oy=Ys("round"),uy=Sr(function(e,t){return e-t},0);function cy(e){return e&&e.length?Es(e,He):0}function ly(e,t){return e&&e.length?Es(e,j(t,2)):0}return l.after=Lg,l.ary=Gu,l.assign=_m,l.assignIn=ic,l.assignInWith=Ur,l.assignWith=xm,l.at=Tm,l.before=Vu,l.bind=ua,l.bindAll=I0,l.bindKey=qu,l.castArray=Vg,l.chain=Bu,l.chunk=Zd,l.compact=eh,l.concat=th,l.cond=b0,l.conforms=N0,l.constant=ga,l.countBy=cg,l.create=wm,l.curry=Ju,l.curryRight=zu,l.debounce=Qu,l.defaults=Em,l.defaultsDeep=Sm,l.defer=Fg,l.delay=Dg,l.difference=nh,l.differenceBy=ih,l.differenceWith=rh,l.drop=sh,l.dropRight=ah,l.dropRightWhile=oh,l.dropWhile=uh,l.fill=ch,l.filter=fg,l.flatMap=hg,l.flatMapDeep=gg,l.flatMapDepth=mg,l.flatten=ku,l.flattenDeep=lh,l.flattenDepth=fh,l.flip=Pg,l.flow=R0,l.flowRight=C0,l.fromPairs=ph,l.functions=Cm,l.functionsIn=Lm,l.groupBy=yg,l.initial=hh,l.intersection=gh,l.intersectionBy=mh,l.intersectionWith=yh,l.invert=Dm,l.invertBy=Pm,l.invokeMap=_g,l.iteratee=ma,l.keyBy=xg,l.keys=Pe,l.keysIn=Qe,l.map=Cr,l.mapKeys=Um,l.mapValues=Mm,l.matches=L0,l.matchesProperty=F0,l.memoize=Fr,l.merge=$m,l.mergeWith=rc,l.method=D0,l.methodOf=P0,l.mixin=ya,l.negate=Dr,l.nthArg=U0,l.omit=Bm,l.omitBy=jm,l.once=kg,l.orderBy=Tg,l.over=M0,l.overArgs=Ug,l.overEvery=$0,l.overSome=B0,l.partial=ca,l.partialRight=Hu,l.partition=wg,l.pick=Wm,l.pickBy=sc,l.property=pc,l.propertyOf=j0,l.pull=Th,l.pullAll=Mu,l.pullAllBy=wh,l.pullAllWith=Eh,l.pullAt=Sh,l.range=W0,l.rangeRight=G0,l.rearg=Mg,l.reject=Ag,l.remove=Ah,l.rest=$g,l.reverse=aa,l.sampleSize=bg,l.set=Vm,l.setWith=qm,l.shuffle=Ng,l.slice=Ih,l.sortBy=Cg,l.sortedUniq=Fh,l.sortedUniqBy=Dh,l.split=h0,l.spread=Bg,l.tail=Ph,l.take=kh,l.takeRight=Uh,l.takeRightWhile=Mh,l.takeWhile=$h,l.tap=eg,l.throttle=jg,l.thru=Rr,l.toArray=ec,l.toPairs=ac,l.toPairsIn=oc,l.toPath=Q0,l.toPlainObject=nc,l.transform=Jm,l.unary=Wg,l.union=Bh,l.unionBy=jh,l.unionWith=Wh,l.uniq=Gh,l.uniqBy=Vh,l.uniqWith=qh,l.unset=zm,l.unzip=oa,l.unzipWith=$u,l.update=Qm,l.updateWith=Hm,l.values=ai,l.valuesIn=Ym,l.without=Jh,l.words=lc,l.wrap=Gg,l.xor=zh,l.xorBy=Qh,l.xorWith=Hh,l.zip=Yh,l.zipObject=Xh,l.zipObjectDeep=Kh,l.zipWith=Zh,l.entries=ac,l.entriesIn=oc,l.extend=ic,l.extendWith=Ur,ya(l,l),l.add=Y0,l.attempt=fc,l.camelCase=e0,l.capitalize=uc,l.ceil=X0,l.clamp=Xm,l.clone=qg,l.cloneDeep=zg,l.cloneDeepWith=Qg,l.cloneWith=Jg,l.conformsTo=Hg,l.deburr=cc,l.defaultTo=O0,l.divide=K0,l.endsWith=t0,l.eq=At,l.escape=n0,l.escapeRegExp=i0,l.every=lg,l.find=pg,l.findIndex=Du,l.findKey=Am,l.findLast=dg,l.findLastIndex=Pu,l.findLastKey=Im,l.floor=Z0,l.forEach=ju,l.forEachRight=Wu,l.forIn=bm,l.forInRight=Nm,l.forOwn=Om,l.forOwnRight=Rm,l.get=pa,l.gt=Yg,l.gte=Xg,l.has=Fm,l.hasIn=da,l.head=Uu,l.identity=He,l.includes=vg,l.indexOf=dh,l.inRange=Km,l.invoke=km,l.isArguments=Mn,l.isArray=Q,l.isArrayBuffer=Kg,l.isArrayLike=ze,l.isArrayLikeObject=be,l.isBoolean=Zg,l.isBuffer=dn,l.isDate=em,l.isElement=tm,l.isEmpty=nm,l.isEqual=im,l.isEqualWith=rm,l.isError=la,l.isFinite=sm,l.isFunction=Gt,l.isInteger=Yu,l.isLength=Pr,l.isMap=Xu,l.isMatch=am,l.isMatchWith=om,l.isNaN=um,l.isNative=cm,l.isNil=fm,l.isNull=lm,l.isNumber=Ku,l.isObject=Ae,l.isObjectLike=Ie,l.isPlainObject=Di,l.isRegExp=fa,l.isSafeInteger=pm,l.isSet=Zu,l.isString=kr,l.isSymbol=nt,l.isTypedArray=si,l.isUndefined=dm,l.isWeakMap=hm,l.isWeakSet=gm,l.join=vh,l.kebabCase=r0,l.last=pt,l.lastIndexOf=_h,l.lowerCase=s0,l.lowerFirst=a0,l.lt=mm,l.lte=ym,l.max=ey,l.maxBy=ty,l.mean=ny,l.meanBy=iy,l.min=ry,l.minBy=sy,l.stubArray=_a,l.stubFalse=xa,l.stubObject=V0,l.stubString=q0,l.stubTrue=J0,l.multiply=ay,l.nth=xh,l.noConflict=k0,l.noop=va,l.now=Lr,l.pad=o0,l.padEnd=u0,l.padStart=c0,l.parseInt=l0,l.random=Zm,l.reduce=Eg,l.reduceRight=Sg,l.repeat=f0,l.replace=p0,l.result=Gm,l.round=oy,l.runInContext=m,l.sample=Ig,l.size=Og,l.snakeCase=d0,l.some=Rg,l.sortedIndex=bh,l.sortedIndexBy=Nh,l.sortedIndexOf=Oh,l.sortedLastIndex=Rh,l.sortedLastIndexBy=Ch,l.sortedLastIndexOf=Lh,l.startCase=g0,l.startsWith=m0,l.subtract=uy,l.sum=cy,l.sumBy=ly,l.template=y0,l.times=z0,l.toFinite=Vt,l.toInteger=Y,l.toLength=tc,l.toLower=v0,l.toNumber=dt,l.toSafeInteger=vm,l.toString=le,l.toUpper=_0,l.trim=x0,l.trimEnd=T0,l.trimStart=w0,l.truncate=E0,l.unescape=S0,l.uniqueId=H0,l.upperCase=A0,l.upperFirst=ha,l.each=ju,l.eachRight=Wu,l.first=Uu,ya(l,function(){var e={};return Lt(l,function(t,s){pe.call(l.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),l.VERSION=o,ot(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),ot(["drop","take"],function(e,t){te.prototype[e]=function(s){s=s===i?1:Fe(Y(s),0);var a=this.__filtered__&&!t?new te(this):this.clone();return a.__filtered__?a.__takeCount__=$e(s,a.__takeCount__):a.__views__.push({size:$e(s,st),type:e+(a.__dir__<0?"Right":"")}),a},te.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),ot(["filter","map","takeWhile"],function(e,t){var s=t+1,a=s==Vi||s==Ji;te.prototype[e]=function(c){var p=this.clone();return p.__iteratees__.push({iteratee:j(c,3),type:s}),p.__filtered__=p.__filtered__||a,p}}),ot(["head","last"],function(e,t){var s="take"+(t?"Right":"");te.prototype[e]=function(){return this[s](1).value()[0]}}),ot(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");te.prototype[e]=function(){return this.__filtered__?new te(this):this[s](1)}}),te.prototype.compact=function(){return this.filter(He)},te.prototype.find=function(e){return this.filter(e).head()},te.prototype.findLast=function(e){return this.reverse().find(e)},te.prototype.invokeMap=K(function(e,t){return typeof e=="function"?new te(this):this.map(function(s){return Ni(s,e,t)})}),te.prototype.reject=function(e){return this.filter(Dr(j(e)))},te.prototype.slice=function(e,t){e=Y(e);var s=this;return s.__filtered__&&(e>0||t<0)?new te(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==i&&(t=Y(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},te.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},te.prototype.toArray=function(){return this.take(st)},Lt(te.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),c=l[a?"take"+(t=="last"?"Right":""):t],p=a||/^find/.test(t);c&&(l.prototype[t]=function(){var d=this.__wrapped__,h=a?[1]:arguments,y=d instanceof te,E=h[0],S=y||Q(d),I=function(Z){var ie=c.apply(l,an([Z],h));return a&&C?ie[0]:ie};S&&s&&typeof E=="function"&&E.length!=1&&(y=S=!1);var C=this.__chain__,U=!!this.__actions__.length,G=p&&!C,X=y&&!U;if(!p&&S){d=X?d:new te(this);var V=e.apply(d,h);return V.__actions__.push({func:Rr,args:[I],thisArg:i}),new ct(V,C)}return G&&X?e.apply(this,h):(V=this.thru(I),G?a?V.value()[0]:V.value():V)})}),ot(["pop","push","shift","sort","splice","unshift"],function(e){var t=nr[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var c=arguments;if(a&&!this.__chain__){var p=this.value();return t.apply(Q(p)?p:[],c)}return this[s](function(d){return t.apply(Q(d)?d:[],c)})}}),Lt(te.prototype,function(e,t){var s=l[t];if(s){var a=s.name+"";pe.call(ei,a)||(ei[a]=[]),ei[a].push({name:t,func:s})}}),ei[Er(i,me).name]=[{name:"wrapper",func:i}],te.prototype.clone=Sp,te.prototype.reverse=Ap,te.prototype.value=Ip,l.prototype.at=tg,l.prototype.chain=ng,l.prototype.commit=ig,l.prototype.next=rg,l.prototype.plant=ag,l.prototype.reverse=og,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=ug,l.prototype.first=l.prototype.head,Ti&&(l.prototype[Ti]=sg),l},Xn=ip();Rn?((Rn.exports=Xn)._=Xn,ms._=Xn):Ue._=Xn}).call(wx)}($i,$i.exports)),$i.exports}var Sx=Ex();const Ia=n=>{const r=Sx.startCase(n).toLowerCase();return r.charAt(0).toUpperCase()+r.slice(1)},Ax=({data:n})=>`import { defineObject } from 'twenty-sdk';
|
|
400
|
+
}`;var X=fc(function(){return oe(p,U+"return "+I).apply(i,d)});if(X.source=I,la(X))throw X;return X}function v0(e){return le(e).toLowerCase()}function _0(e){return le(e).toUpperCase()}function x0(e,t,s){if(e=le(e),e&&(s||t===i))return xo(e);if(!e||!(t=tt(t)))return e;var a=Et(e),c=Et(t),p=To(a,c),d=wo(a,c)+1;return dn(a,p,d).join("")}function T0(e,t,s){if(e=le(e),e&&(s||t===i))return e.slice(0,So(e)+1);if(!e||!(t=tt(t)))return e;var a=Et(e),c=wo(a,Et(t))+1;return dn(a,0,c).join("")}function w0(e,t,s){if(e=le(e),e&&(s||t===i))return e.replace(ls,"");if(!e||!(t=tt(t)))return e;var a=Et(e),c=To(a,Et(t));return dn(a,c).join("")}function E0(e,t){var s=q,a=Se;if(Ae(t)){var c="separator"in t?t.separator:c;s="length"in t?Y(t.length):s,a="omission"in t?tt(t.omission):a}e=le(e);var p=e.length;if(Hn(e)){var d=Et(e);p=d.length}if(s>=p)return e;var h=s-Yn(a);if(h<1)return a;var y=d?dn(d,0,h).join(""):e.slice(0,h);if(c===i)return y+a;if(d&&(h+=y.length-h),fa(c)){if(e.slice(h).search(c)){var E,S=y;for(c.global||(c=bs(c.source,le(ja.exec(c))+"g")),c.lastIndex=0;E=c.exec(S);)var I=E.index;y=y.slice(0,I===i?h:I)}}else if(e.indexOf(tt(c),h)!=h){var C=y.lastIndexOf(c);C>-1&&(y=y.slice(0,C))}return y+a}function S0(e){return e=le(e),e&&Dl.test(e)?e.replace(Ma,Zf):e}var A0=ii(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),ha=pu("toUpperCase");function lc(e,t,s){return e=le(e),t=s?i:t,t===i?Qf(e)?np(e):$f(e):e.match(t)||[]}var fc=K(function(e,t){try{return Ze(e,i,t)}catch(s){return la(s)?s:new z(s)}}),I0=Wt(function(e,t){return ot(t,function(s){s=Dt(s),Bt(e,s,ua(e[s],e))}),e});function b0(e){var t=e==null?0:e.length,s=j();return e=t?Ee(e,function(a){if(typeof a[1]!="function")throw new ut(g);return[s(a[0]),a[1]]}):[],K(function(a){for(var c=-1;++c<t;){var p=e[c];if(Ze(p[0],this,a))return Ze(p[1],this,a)}})}function N0(e){return Zp(lt(e,D))}function ga(e){return function(){return e}}function O0(e,t){return e==null||e!==e?t:e}var R0=hu(),C0=hu(!0);function He(e){return e}function ma(e){return Vo(typeof e=="function"?e:lt(e,D))}function L0(e){return Jo(lt(e,D))}function F0(e,t){return zo(e,lt(t,D))}var D0=K(function(e,t){return function(s){return Ni(s,e,t)}}),P0=K(function(e,t){return function(s){return Ni(e,s,t)}});function ya(e,t,s){var a=Pe(t),c=vr(t,a);s==null&&!(Ae(t)&&(c.length||!a.length))&&(s=t,t=e,e=this,c=vr(t,Pe(t)));var p=!(Ae(s)&&"chain"in s)||!!s.chain,d=Vt(e);return ot(c,function(h){var y=t[h];e[h]=y,d&&(e.prototype[h]=function(){var E=this.__chain__;if(p||E){var S=e(this.__wrapped__),I=S.__actions__=Je(this.__actions__);return I.push({func:y,args:arguments,thisArg:e}),S.__chain__=E,S}return y.apply(e,on([this.value()],arguments))})}),e}function k0(){return Ue._===this&&(Ue._=up),this}function va(){}function U0(e){return e=Y(e),K(function(t){return Qo(t,e)})}var M0=Hs(Ee),$0=Hs(go),B0=Hs(xs);function pc(e){return na(e)?Ts(Dt(e)):md(e)}function j0(e){return function(t){return e==null?i:Pn(e,t)}}var W0=mu(),G0=mu(!0);function _a(){return[]}function xa(){return!1}function V0(){return{}}function q0(){return""}function J0(){return!0}function z0(e,t){if(e=Y(e),e<1||e>Tt)return[];var s=st,a=$e(e,st);t=j(t),e-=st;for(var c=Ss(a,t);++s<e;)t(s);return c}function Q0(e){return Q(e)?Ee(e,Dt):nt(e)?[e]:Je(Lu(le(e)))}function H0(e){var t=++ap;return le(e)+t}var Y0=Sr(function(e,t){return e+t},0),X0=Ys("ceil"),K0=Sr(function(e,t){return e/t},1),Z0=Ys("floor");function ey(e){return e&&e.length?yr(e,He,Ps):i}function ty(e,t){return e&&e.length?yr(e,j(t,2),Ps):i}function ny(e){return vo(e,He)}function iy(e,t){return vo(e,j(t,2))}function ry(e){return e&&e.length?yr(e,He,$s):i}function sy(e,t){return e&&e.length?yr(e,j(t,2),$s):i}var ay=Sr(function(e,t){return e*t},1),oy=Ys("round"),uy=Sr(function(e,t){return e-t},0);function cy(e){return e&&e.length?Es(e,He):0}function ly(e,t){return e&&e.length?Es(e,j(t,2)):0}return l.after=Lg,l.ary=Gu,l.assign=_m,l.assignIn=ic,l.assignInWith=Ur,l.assignWith=xm,l.at=Tm,l.before=Vu,l.bind=ua,l.bindAll=I0,l.bindKey=qu,l.castArray=Vg,l.chain=Bu,l.chunk=Zd,l.compact=eh,l.concat=th,l.cond=b0,l.conforms=N0,l.constant=ga,l.countBy=cg,l.create=wm,l.curry=Ju,l.curryRight=zu,l.debounce=Qu,l.defaults=Em,l.defaultsDeep=Sm,l.defer=Fg,l.delay=Dg,l.difference=nh,l.differenceBy=ih,l.differenceWith=rh,l.drop=sh,l.dropRight=ah,l.dropRightWhile=oh,l.dropWhile=uh,l.fill=ch,l.filter=fg,l.flatMap=hg,l.flatMapDeep=gg,l.flatMapDepth=mg,l.flatten=ku,l.flattenDeep=lh,l.flattenDepth=fh,l.flip=Pg,l.flow=R0,l.flowRight=C0,l.fromPairs=ph,l.functions=Cm,l.functionsIn=Lm,l.groupBy=yg,l.initial=hh,l.intersection=gh,l.intersectionBy=mh,l.intersectionWith=yh,l.invert=Dm,l.invertBy=Pm,l.invokeMap=_g,l.iteratee=ma,l.keyBy=xg,l.keys=Pe,l.keysIn=Qe,l.map=Cr,l.mapKeys=Um,l.mapValues=Mm,l.matches=L0,l.matchesProperty=F0,l.memoize=Fr,l.merge=$m,l.mergeWith=rc,l.method=D0,l.methodOf=P0,l.mixin=ya,l.negate=Dr,l.nthArg=U0,l.omit=Bm,l.omitBy=jm,l.once=kg,l.orderBy=Tg,l.over=M0,l.overArgs=Ug,l.overEvery=$0,l.overSome=B0,l.partial=ca,l.partialRight=Hu,l.partition=wg,l.pick=Wm,l.pickBy=sc,l.property=pc,l.propertyOf=j0,l.pull=Th,l.pullAll=Mu,l.pullAllBy=wh,l.pullAllWith=Eh,l.pullAt=Sh,l.range=W0,l.rangeRight=G0,l.rearg=Mg,l.reject=Ag,l.remove=Ah,l.rest=$g,l.reverse=aa,l.sampleSize=bg,l.set=Vm,l.setWith=qm,l.shuffle=Ng,l.slice=Ih,l.sortBy=Cg,l.sortedUniq=Fh,l.sortedUniqBy=Dh,l.split=h0,l.spread=Bg,l.tail=Ph,l.take=kh,l.takeRight=Uh,l.takeRightWhile=Mh,l.takeWhile=$h,l.tap=eg,l.throttle=jg,l.thru=Rr,l.toArray=ec,l.toPairs=ac,l.toPairsIn=oc,l.toPath=Q0,l.toPlainObject=nc,l.transform=Jm,l.unary=Wg,l.union=Bh,l.unionBy=jh,l.unionWith=Wh,l.uniq=Gh,l.uniqBy=Vh,l.uniqWith=qh,l.unset=zm,l.unzip=oa,l.unzipWith=$u,l.update=Qm,l.updateWith=Hm,l.values=ai,l.valuesIn=Ym,l.without=Jh,l.words=lc,l.wrap=Gg,l.xor=zh,l.xorBy=Qh,l.xorWith=Hh,l.zip=Yh,l.zipObject=Xh,l.zipObjectDeep=Kh,l.zipWith=Zh,l.entries=ac,l.entriesIn=oc,l.extend=ic,l.extendWith=Ur,ya(l,l),l.add=Y0,l.attempt=fc,l.camelCase=e0,l.capitalize=uc,l.ceil=X0,l.clamp=Xm,l.clone=qg,l.cloneDeep=zg,l.cloneDeepWith=Qg,l.cloneWith=Jg,l.conformsTo=Hg,l.deburr=cc,l.defaultTo=O0,l.divide=K0,l.endsWith=t0,l.eq=At,l.escape=n0,l.escapeRegExp=i0,l.every=lg,l.find=pg,l.findIndex=Du,l.findKey=Am,l.findLast=dg,l.findLastIndex=Pu,l.findLastKey=Im,l.floor=Z0,l.forEach=ju,l.forEachRight=Wu,l.forIn=bm,l.forInRight=Nm,l.forOwn=Om,l.forOwnRight=Rm,l.get=pa,l.gt=Yg,l.gte=Xg,l.has=Fm,l.hasIn=da,l.head=Uu,l.identity=He,l.includes=vg,l.indexOf=dh,l.inRange=Km,l.invoke=km,l.isArguments=Mn,l.isArray=Q,l.isArrayBuffer=Kg,l.isArrayLike=ze,l.isArrayLikeObject=be,l.isBoolean=Zg,l.isBuffer=hn,l.isDate=em,l.isElement=tm,l.isEmpty=nm,l.isEqual=im,l.isEqualWith=rm,l.isError=la,l.isFinite=sm,l.isFunction=Vt,l.isInteger=Yu,l.isLength=Pr,l.isMap=Xu,l.isMatch=am,l.isMatchWith=om,l.isNaN=um,l.isNative=cm,l.isNil=fm,l.isNull=lm,l.isNumber=Ku,l.isObject=Ae,l.isObjectLike=Ie,l.isPlainObject=Di,l.isRegExp=fa,l.isSafeInteger=pm,l.isSet=Zu,l.isString=kr,l.isSymbol=nt,l.isTypedArray=si,l.isUndefined=dm,l.isWeakMap=hm,l.isWeakSet=gm,l.join=vh,l.kebabCase=r0,l.last=pt,l.lastIndexOf=_h,l.lowerCase=s0,l.lowerFirst=a0,l.lt=mm,l.lte=ym,l.max=ey,l.maxBy=ty,l.mean=ny,l.meanBy=iy,l.min=ry,l.minBy=sy,l.stubArray=_a,l.stubFalse=xa,l.stubObject=V0,l.stubString=q0,l.stubTrue=J0,l.multiply=ay,l.nth=xh,l.noConflict=k0,l.noop=va,l.now=Lr,l.pad=o0,l.padEnd=u0,l.padStart=c0,l.parseInt=l0,l.random=Zm,l.reduce=Eg,l.reduceRight=Sg,l.repeat=f0,l.replace=p0,l.result=Gm,l.round=oy,l.runInContext=m,l.sample=Ig,l.size=Og,l.snakeCase=d0,l.some=Rg,l.sortedIndex=bh,l.sortedIndexBy=Nh,l.sortedIndexOf=Oh,l.sortedLastIndex=Rh,l.sortedLastIndexBy=Ch,l.sortedLastIndexOf=Lh,l.startCase=g0,l.startsWith=m0,l.subtract=uy,l.sum=cy,l.sumBy=ly,l.template=y0,l.times=z0,l.toFinite=qt,l.toInteger=Y,l.toLength=tc,l.toLower=v0,l.toNumber=dt,l.toSafeInteger=vm,l.toString=le,l.toUpper=_0,l.trim=x0,l.trimEnd=T0,l.trimStart=w0,l.truncate=E0,l.unescape=S0,l.uniqueId=H0,l.upperCase=A0,l.upperFirst=ha,l.each=ju,l.eachRight=Wu,l.first=Uu,ya(l,function(){var e={};return Lt(l,function(t,s){pe.call(l.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),l.VERSION=o,ot(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),ot(["drop","take"],function(e,t){te.prototype[e]=function(s){s=s===i?1:Fe(Y(s),0);var a=this.__filtered__&&!t?new te(this):this.clone();return a.__filtered__?a.__takeCount__=$e(s,a.__takeCount__):a.__views__.push({size:$e(s,st),type:e+(a.__dir__<0?"Right":"")}),a},te.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),ot(["filter","map","takeWhile"],function(e,t){var s=t+1,a=s==Vi||s==Ji;te.prototype[e]=function(c){var p=this.clone();return p.__iteratees__.push({iteratee:j(c,3),type:s}),p.__filtered__=p.__filtered__||a,p}}),ot(["head","last"],function(e,t){var s="take"+(t?"Right":"");te.prototype[e]=function(){return this[s](1).value()[0]}}),ot(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");te.prototype[e]=function(){return this.__filtered__?new te(this):this[s](1)}}),te.prototype.compact=function(){return this.filter(He)},te.prototype.find=function(e){return this.filter(e).head()},te.prototype.findLast=function(e){return this.reverse().find(e)},te.prototype.invokeMap=K(function(e,t){return typeof e=="function"?new te(this):this.map(function(s){return Ni(s,e,t)})}),te.prototype.reject=function(e){return this.filter(Dr(j(e)))},te.prototype.slice=function(e,t){e=Y(e);var s=this;return s.__filtered__&&(e>0||t<0)?new te(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==i&&(t=Y(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},te.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},te.prototype.toArray=function(){return this.take(st)},Lt(te.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),c=l[a?"take"+(t=="last"?"Right":""):t],p=a||/^find/.test(t);c&&(l.prototype[t]=function(){var d=this.__wrapped__,h=a?[1]:arguments,y=d instanceof te,E=h[0],S=y||Q(d),I=function(Z){var ie=c.apply(l,on([Z],h));return a&&C?ie[0]:ie};S&&s&&typeof E=="function"&&E.length!=1&&(y=S=!1);var C=this.__chain__,U=!!this.__actions__.length,G=p&&!C,X=y&&!U;if(!p&&S){d=X?d:new te(this);var V=e.apply(d,h);return V.__actions__.push({func:Rr,args:[I],thisArg:i}),new ct(V,C)}return G&&X?e.apply(this,h):(V=this.thru(I),G?a?V.value()[0]:V.value():V)})}),ot(["pop","push","shift","sort","splice","unshift"],function(e){var t=nr[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var c=arguments;if(a&&!this.__chain__){var p=this.value();return t.apply(Q(p)?p:[],c)}return this[s](function(d){return t.apply(Q(d)?d:[],c)})}}),Lt(te.prototype,function(e,t){var s=l[t];if(s){var a=s.name+"";pe.call(ei,a)||(ei[a]=[]),ei[a].push({name:t,func:s})}}),ei[Er(i,me).name]=[{name:"wrapper",func:i}],te.prototype.clone=Sp,te.prototype.reverse=Ap,te.prototype.value=Ip,l.prototype.at=tg,l.prototype.chain=ng,l.prototype.commit=ig,l.prototype.next=rg,l.prototype.plant=ag,l.prototype.reverse=og,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=ug,l.prototype.first=l.prototype.head,Ti&&(l.prototype[Ti]=sg),l},Xn=ip();Rn?((Rn.exports=Xn)._=Xn,ms._=Xn):Ue._=Xn}).call(Tx)}($i,$i.exports)),$i.exports}var Ex=wx();const Ia=n=>{const r=Ex.startCase(n).toLowerCase();return r.charAt(0).toUpperCase()+r.slice(1)},Sx=({data:n})=>`import { defineObject } from 'twenty-sdk';
|
|
401
401
|
|
|
402
402
|
export default defineObject({
|
|
403
403
|
universalIdentifier: '${pi.v4()}',
|
|
@@ -417,7 +417,7 @@ export default defineObject({
|
|
|
417
417
|
// },
|
|
418
418
|
],
|
|
419
419
|
});
|
|
420
|
-
`,
|
|
420
|
+
`,Ax=({name:n,universalIdentifier:r=pi.v4()})=>{const i=fi(n);return`import { defineRole } from 'twenty-sdk';
|
|
421
421
|
|
|
422
422
|
export const ${i.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER =
|
|
423
423
|
'${r}';
|
|
@@ -431,7 +431,7 @@ export default defineRole({
|
|
|
431
431
|
canSoftDeleteAllObjectRecords: true,
|
|
432
432
|
canDestroyAllObjectRecords: false,
|
|
433
433
|
});
|
|
434
|
-
`},
|
|
434
|
+
`},Ix=({data:n})=>{const r=pi.v4(),i=n.description?`
|
|
435
435
|
description: '${n.description}',`:"";return`import { defineField, FieldType } from 'twenty-sdk';
|
|
436
436
|
|
|
437
437
|
export default defineField({
|
|
@@ -441,4 +441,4 @@ export default defineField({
|
|
|
441
441
|
type: FieldMetadataType.${n.type},
|
|
442
442
|
objectUniversalIdentifier: '${n.objectUniversalIdentifier}',${i}
|
|
443
443
|
});
|
|
444
|
-
`},
|
|
444
|
+
`},bx="src";class Nx{async execute(r,i){try{const o=r??await this.getEntity(),u=this.getFolderName(o),f=i?ge.join(Yt,i):ge.join(Yt,bx,u);await de.ensureDir(f);const{name:g,file:v}=await this.getEntityData(o),w=ge.join(f,this.getFileName(g,o));if(await de.pathExists(w)){const{overwrite:b}=await this.handleFileExist();if(!b)return}await de.writeFile(w,v),console.log(R.default.green(`✓ Created ${u}:`),R.default.cyan(ge.relative(Yt,w)))}catch(o){console.error(R.default.red("Add new entity failed:"),o instanceof Error?o.message:o),process.exit(1)}}async getEntityData(r){switch(r){case De.Object:{const i=await this.getObjectData(),o=i.nameSingular,u=Sx({data:i});return{name:o,file:u}}case De.Field:{const i=await this.getFieldData(),o=i.name,u=Ix({data:i});return{name:o,file:u}}case De.LogicFunction:{const i=await this.getEntityName(r),o=xx({name:i});return{name:i,file:o}}case De.FrontComponent:{const i=await this.getEntityName(r),o=_x({name:i});return{name:i,file:o}}case De.Role:{const i=await this.getEntityName(r),o=Ax({name:i});return{name:i,file:o}}default:kt.ln()}}async getEntity(){const{entity:r}=await Qt.default.prompt([{type:"select",name:"entity",message:"What entity do you want to create?",default:"",choices:Object.values(De)}]);return r}async handleFileExist(){return await Qt.default.prompt([{type:"confirm",name:"overwrite",message:"File already exists. Do you want to overwrite it?",default:!1}])}async getEntityName(r){const{name:i}=await Qt.default.prompt([{type:"input",name:"name",message:`Enter a name for your new ${r}:`,default:"",validate:o=>o.length===0?`${r} name is required`:!0}]);return i}async getFieldData(){return Qt.default.prompt([{type:"input",name:"name",message:"Enter a name for your field:",default:"",validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"label",message:"Enter a label for your field:",default:r=>Ia(r.name),validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"select",name:"type",message:"Select the field type:",choices:Object.values(mc.s),default:mc.s.TEXT},{type:"input",name:"objectUniversalIdentifier",message:"Enter the universalIdentifier of the object this field belongs to:",default:"fill-later",validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"description",message:"Enter a description for your field (optional):",default:""}])}async getObjectData(){return Qt.default.prompt([{type:"input",name:"nameSingular",message:"Enter a name singular for your object (eg: company):",default:"",validate:r=>!r||r.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:(r,i)=>r.trim()===i?.nameSingular.trim()?"Name plural must be different from name singular":!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelSingular",message:"Enter a label singular for your object:",default:r=>Ia(r.nameSingular),validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelPlural",message:"Enter a label plural for your object:",default:r=>Ia(r.namePlural),validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0}])}getFolderName(r){return`${fi(r)}s`}getFileName(r,i){switch(i){case De.FrontComponent:return`${fi(r)}.tsx`;default:return`${fi(r)}.ts`}}}const Ox=n=>{const r=new lx,i=new fx,o=new px,u=new dx,f=new mx;n.command("auth:login").description("Authenticate with Twenty").option("--api-key <key>","API key for authentication").option("--api-url <url>","Twenty API URL").action(async P=>{await i.execute(P)}),n.command("auth:logout").description("Remove authentication credentials").action(async()=>{await o.execute()}),n.command("auth:status").description("Check authentication status").action(async()=>{await u.execute()}),n.command("auth:switch [workspace]").description("Switch the default workspace for authentication").action(async P=>{await f.execute({workspace:P})}),n.command("auth:list").description("List all configured workspaces").action(async()=>{await r.execute()});const g=new sx,v=new cx,w=new Nx,b=new ux,O=new gx,D=new hx;n.command("app:dev [appPath]").description("Watch and sync local application changes").action(async P=>{await g.execute({appPath:Pi(P)})}),n.command("app:uninstall [appPath]").description("Uninstall application from Twenty").action(async P=>{try{const M=await v.execute({appPath:Pi(P),askForConfirmation:!0});process.exit(M.success?0:1)}catch{process.exit(1)}}),n.command("entity:add [entityType]").option("--path <path>","Path in which the entity should be created.").description(`Add a new entity to your application (${Object.values(De).join("|")})`).action(async(P,M)=>{await w.execute(P,M?.path)}),n.command("app:generate [appPath]").description("Generate Twenty client").action(async P=>{await b.execute(Pi(P))}),n.command("function:logs [appPath]").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").description("Watch application function logs").action(async(P,M)=>{await O.execute({...M,appPath:Pi(P)})}),n.command("function:execute [appPath]").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").description("Execute a logic function with a JSON payload").action(async(P,M)=>{!M?.functionUniversalIdentifier&&!M?.functionName&&(console.error(R.default.red("Error: Either --functionName (-n) or --functionUniversalIdentifier (-u) is required.")),process.exit(1)),await D.execute({...M,payload:M?.payload??"{}",appPath:Pi(P)})})},Rx="0.4.2",Cx={version:Rx};Fy.inspect.defaultOptions.depth=10;const yi=new kc.Command;yi.name("twenty").description("CLI for Twenty application development").version(Cx.version);yi.option("--workspace <name>","Use a specific workspace configuration (overrides the default set by auth:switch)");yi.hook("preAction",async n=>{let i=(n.optsWithGlobals?n.optsWithGlobals():n.opts()).workspace;i||(i=await new je().getDefaultWorkspace()),je.setActiveWorkspace(i),console.log(R.default.gray(`👩💻 Workspace - ${je.getActiveWorkspace()}`))});Ox(yi);yi.exitOverride();try{yi.parse()}catch(n){n instanceof kc.CommanderError&&process.exit(n.exitCode),n instanceof Error&&(console.error(R.default.red("Error:"),n.message),process.exit(1))}
|