twenty-sdk 0.5.2 → 0.6.0-alpha
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/README.md +2 -0
- package/dist/{AllIcons-CGPKtPQS-sO2O4z-k.js → AllIcons-CGPKtPQS-BLFCKgx3.js} +3793 -3798
- package/dist/{AllIcons-CGPKtPQS-C-ZFgy8B.mjs → AllIcons-CGPKtPQS-Djzg3SXS.mjs} +5806 -5814
- package/dist/{isValidCountryCode-ujmwsK7z-DwSvvT1u.js → HtmlTagToRemoteComponent-CSfU1Ai0.js} +12 -12
- package/dist/{isValidCountryCode-ujmwsK7z-B8kSH7O8.mjs → HtmlTagToRemoteComponent-_7-Er-Nj.mjs} +1612 -1465
- package/dist/cli/commands/app/app-uninstall.d.ts +2 -2
- package/dist/cli/commands/app-command.d.ts +1 -1
- package/dist/cli/commands/logic-function/logic-function-execute.d.ts +1 -1
- package/dist/cli/commands/logic-function/logic-function-logs.d.ts +1 -1
- package/dist/cli/utilities/api/api-service.d.ts +6 -6
- package/dist/cli/utilities/build/common/esbuild-result-processor.d.ts +2 -2
- package/dist/cli/utilities/build/common/esbuild-watcher.d.ts +2 -2
- package/dist/cli/utilities/build/common/file-upload-watcher.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/react-globals-plugin.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/twenty-sdk-globals-plugin.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/twenty-sdk-ui-globals-plugin.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/twenty-shared-globals-plugin.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/utils/extract-names-from-import-specifier.d.ts +1 -1
- package/dist/cli/utilities/build/common/restartable-watcher-interface.d.ts +2 -2
- package/dist/cli/utilities/build/manifest/manifest-build.d.ts +2 -2
- package/dist/cli/utilities/build/manifest/manifest-extract-config-from-file.d.ts +1 -1
- package/dist/cli/utilities/build/manifest/manifest-update-checksums.d.ts +2 -2
- package/dist/cli/utilities/build/manifest/manifest-validate.d.ts +1 -1
- package/dist/cli/utilities/build/manifest/manifest-writer.d.ts +1 -1
- package/dist/cli/utilities/dev/dev-mode-orchestrator.d.ts +6 -6
- package/dist/cli/utilities/dev/dev-ui-state-manager.d.ts +6 -6
- package/dist/cli/utilities/dev/dev-ui-state.d.ts +1 -1
- package/dist/cli/utilities/dev/dev-ui.d.ts +1 -1
- package/dist/cli/utilities/entity/entity-field-template.d.ts +2 -2
- package/dist/cli/utilities/entity/entity-front-component-template.d.ts +1 -1
- package/dist/cli/utilities/entity/entity-logic-function-template.d.ts +1 -1
- package/dist/cli/utilities/entity/entity-role-template.d.ts +1 -1
- package/dist/cli/utilities/file/file-jsonc.d.ts +1 -1
- package/dist/cli/utilities/file/file-path.d.ts +1 -1
- package/dist/cli/utilities/file/file-uploader.d.ts +3 -3
- package/dist/cli/utilities/typescript/typescript-diagnostics.d.ts +1 -1
- package/dist/cli/utilities/typescript/typescript-program.d.ts +1 -1
- package/dist/cli.cjs +29 -29
- package/dist/cli.mjs +463 -460
- package/dist/front-component-renderer/__stories__/FrontComponentRenderer.stories.d.ts +16 -0
- package/dist/front-component-renderer/__stories__/example-sources/chakra-example.front-component.d.ts +8 -0
- package/dist/front-component-renderer/__stories__/example-sources/emotion-example.front-component.d.ts +7 -0
- package/dist/{front-component/__stories__/mocks → front-component-renderer/__stories__/example-sources}/interactive.front-component.d.ts +1 -1
- package/dist/{front-component/__stories__/mocks → front-component-renderer/__stories__/example-sources}/lifecycle.front-component.d.ts +1 -1
- package/dist/front-component-renderer/__stories__/example-sources/mui-example.front-component.d.ts +7 -0
- package/dist/front-component-renderer/__stories__/example-sources/shadcn-example.front-component.d.ts +7 -0
- package/dist/{front-component/__stories__/mocks → front-component-renderer/__stories__/example-sources}/static.front-component.d.ts +1 -1
- package/dist/front-component-renderer/__stories__/example-sources/styled-components-example.front-component.d.ts +7 -0
- package/dist/front-component-renderer/__stories__/example-sources/tailwind-example.front-component.d.ts +7 -0
- package/dist/front-component-renderer/__stories__/example-sources/twenty-ui-example.front-component.d.ts +7 -0
- package/dist/front-component-renderer/__stories__/utils/getBuiltStoryComponentPathForRender.d.ts +1 -0
- package/dist/front-component-renderer/host/components/FrontComponentRenderer.d.ts +14 -0
- package/dist/front-component-renderer/index.cjs +25 -0
- package/dist/{front-component → front-component-renderer}/index.d.ts +4 -4
- package/dist/front-component-renderer/index.mjs +12026 -0
- package/dist/front-component-renderer/remote/components/FrontComponentHostCommunicationApiEffect.d.ts +8 -0
- package/dist/front-component-renderer/remote/components/FrontComponentUpdateContextEffect.d.ts +10 -0
- package/dist/{front-component → front-component-renderer}/remote/components/FrontComponentWorkerEffect.d.ts +5 -4
- package/dist/front-component-renderer/remote/generated/remote-components.d.ts +43 -0
- package/dist/front-component-renderer/remote/generated/remote-elements.d.ts +187 -0
- package/dist/{front-component → front-component-renderer}/remote/mock/mock-front-component.d.ts +1 -1
- package/dist/front-component-renderer/remote/worker/remote-worker.d.ts +3 -0
- package/dist/front-component-renderer/remote/worker/utils/setWorkerEnv.d.ts +1 -0
- package/dist/{front-component → front-component-renderer}/types/FrontComponentHostCommunicationApi.d.ts +1 -1
- package/dist/{front-component → front-component-renderer}/types/HostToWorkerRenderContext.d.ts +2 -1
- package/dist/front-component-renderer/types/PropertySchema.d.ts +4 -0
- package/dist/{front-component → front-component-renderer}/types/WorkerExports.d.ts +3 -3
- package/dist/index-DX23sVyw.js +2415 -0
- package/dist/index-JB9QoBK0.mjs +33884 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +15 -12
- package/dist/sdk/application/application-config.d.ts +1 -1
- package/dist/sdk/application/define-application.d.ts +2 -2
- package/dist/sdk/common/types/define-entity.type.d.ts +4 -4
- package/dist/sdk/common/utils/create-validation-result.d.ts +1 -1
- package/dist/sdk/define-front-component.d.ts +2 -2
- package/dist/sdk/fields/define-field.d.ts +2 -2
- package/dist/sdk/fields/validate-fields.d.ts +1 -1
- package/dist/sdk/front-component-api/constants/HtmlCommonProperties.d.ts +2 -0
- package/dist/sdk/front-component-api/context/frontComponentContext.d.ts +1 -1
- package/dist/sdk/front-component-api/functions/navigate.d.ts +1 -1
- package/dist/sdk/front-component-api/hooks/useFrontComponentExecutionContext.d.ts +1 -1
- package/dist/sdk/front-component-api/index.d.ts +7 -0
- package/dist/sdk/front-component-config.d.ts +1 -1
- package/dist/sdk/index.d.ts +6 -6
- package/dist/sdk/logic-functions/define-logic-function.d.ts +2 -2
- package/dist/sdk/logic-functions/logic-function-config.d.ts +1 -1
- package/dist/sdk/objects/define-object.d.ts +2 -2
- package/dist/sdk/roles/define-role.d.ts +2 -2
- package/dist/ui/index.cjs +1 -47
- package/dist/ui/index.mjs +682 -2401
- package/package.json +34 -12
- package/dist/HtmlTagToRemoteComponent-B6lQe_K8.js +0 -1
- package/dist/HtmlTagToRemoteComponent-DRdIf3GJ.mjs +0 -151
- package/dist/IconWorld-DynX4UYH.mjs +0 -3003
- package/dist/IconWorld-JYjJym3l.js +0 -1876
- package/dist/_commonjsHelpers-DKOUU3wS.js +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.mjs +0 -8
- package/dist/cli/utilities/build/common/front-component-build/utils/create-front-component-build-options.d.ts +0 -13
- package/dist/front-component/__stories__/FrontComponentRenderer.stories.d.ts +0 -9
- package/dist/front-component/__stories__/utils/buildMockComponents.d.ts +0 -1
- package/dist/front-component/__stories__/utils/loadBuiltComponent.d.ts +0 -1
- package/dist/front-component/host/components/FrontComponentRenderer.d.ts +0 -13
- package/dist/front-component/index.cjs +0 -1
- package/dist/front-component/index.mjs +0 -5736
- package/dist/front-component/remote/components/FrontComponentHostCommunicationApiEffect.d.ts +0 -8
- package/dist/front-component/remote/components/FrontComponentUpdateContextEffect.d.ts +0 -10
- package/dist/front-component/remote/generated/remote-components.d.ts +0 -299
- package/dist/front-component/remote/generated/remote-elements.d.ts +0 -3335
- package/dist/front-component/remote/worker/remote-worker.d.ts +0 -0
- package/dist/front-component/types/PropertySchema.d.ts +0 -4
- package/dist/index.d.ts +0 -1
- package/dist/navigation-_M4-TT0O.js +0 -503
- package/dist/navigation-udgao_jA.mjs +0 -30041
- package/dist/sdk/front-component-common/HtmlCommonProperties.d.ts +0 -2
- package/dist/sdk/front-component-common/index.d.ts +0 -7
- /package/dist/{front-component → front-component-renderer}/host/generated/host-component-registry.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/host/generated/host-index.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/remote/components/FrontComponentErrorEffect.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/remote/generated/remote-index.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/remote/utils/exposeGlobals.d.ts +0 -0
- /package/dist/{front-component/remote/worker → front-component-renderer/remote/worker/utils}/createRemoteWorker.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/types/FrontComponentExecutionContext.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/AllowedHtmlElements.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/CommonHtmlEvents.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/EventToReact.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/HtmlTagToRemoteComponent.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/SerializedEventData.d.ts +0 -0
package/dist/cli.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
${_}`:_,loader:"tsx"}}catch(i){return{errors:[{text:`Failed to transform front component: ${i instanceof Error?i.message:String(i)}`,location:{file:a}}]}}})}},Gm=/^(\w+)\s+as\s+(\w+)$/,Hm=c=>{const a=c.trim(),i=a.match(Gm);if(
|
|
2
|
+
"use strict";var sm=Object.create;var au=Object.defineProperty;var am=Object.getOwnPropertyDescriptor;var om=Object.getOwnPropertyNames;var um=Object.getPrototypeOf,cm=Object.prototype.hasOwnProperty;var lm=(c,a,i,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let g of om(a))!cm.call(c,g)&&g!==i&&au(c,g,{get:()=>a[g],enumerable:!(f=am(a,g))||f.enumerable});return c};var ou=(c,a,i)=>(i=c!=null?sm(um(c)):{},lm(a||!c||!c.__esModule?au(i,"default",{value:c,enumerable:!0}):i,c));const ie=require("path"),fm=require("chalk"),du=require("fs-extra"),hm=require("crypto"),pm=require("node:fs/promises"),le=require("./HtmlTagToRemoteComponent-CSfU1Ai0.js"),dm=require("@sniptt/guards"),gm=require("lodash.camelcase");require("react");const mm=require("fs/promises"),vm=require("esbuild"),_m=require("chokidar"),wm=require("os"),ym=require("axios"),xm=require("fs"),Sm=require("graphql-sse"),Ss=require("graphql/index"),Am=require("typescript"),bm=require("module"),gu=require("fast-glob"),W=require("react/jsx-runtime"),Em=require("@genql/cli"),Cm=require("inquirer"),Xn=require("uuid"),mu=require("commander"),Tm=require("util"),In=c=>c&&c.__esModule?c:{default:c};function jt(c){if(c&&c.__esModule)return c;const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const i in c)if(i!=="default"){const f=Object.getOwnPropertyDescriptor(c,i);Object.defineProperty(a,i,f.get?f:{enumerable:!0,get:()=>c[i]})}}return a.default=c,Object.freeze(a)}const ee=jt(ie),b=In(fm),V=jt(du),vu=In(hm),Fm=jt(pm),Im=In(gm),Ts=jt(mm),_u=jt(vm),wu=In(_m),Fs=jt(wm),Kr=In(ym),uu=jt(xm),Tn=jt(Am),St=In(Cm);var kt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rm(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}const Pm=c=>dm.isNonEmptyString(c)?c[0].toUpperCase()+c.slice(1):"",Om=c=>Pm(Im.default(c)),Lm=c=>typeof c=="object"&&c!==null&&!Array.isArray(c),At=process.env.INIT_CWD||process.cwd(),Jn=c=>c&&!c?.startsWith("/")?ie.join(At,c):c,Mm=async(c,a,i)=>{const f=new Set(i),g=a.filter(_=>!f.has(_));for(const _ of g){const S=_.replace(/\.tsx?$/,".mjs"),A=ee.default.join(c,S),I=`${A}.map`;await V.remove(A),await V.remove(I)}},Nm=async({result:c,appPath:a,fileFolder:i,lastChecksums:f,onFileBuilt:g})=>{const _=Object.keys(c.metafile?.outputs??{}).filter(S=>S.endsWith(".mjs"));for(const S of _){const A=ee.default.resolve(S),I=ee.default.relative(a,A),P=c.metafile?.outputs?.[S]?.entryPoint||"",J=ee.default.relative(a,P),G=await V.readFile(A),K=vu.default.createHash("md5").update(G).digest("hex");f.get(I)!==K&&(f.set(I,K),g&&await g({fileFolder:i,builtPath:I,sourcePath:J,checksum:K}))}},Um=["react-dom"],Wm="RemoteComponents",Dm=()=>{const c=Object.keys(le.HTML_TAG_TO_REMOTE_COMPONENT).join("|");return new RegExp(`(<\\/?)\\b(${c})\\b(?=[\\s>\\/>])`,"g")},$m=Dm(),Bm=c=>c.replace($m,(a,i,f)=>{const g=le.HTML_TAG_TO_REMOTE_COMPONENT[f];return le.Tr(g)?`${i}${Wm}.${g}`:a}),km=/import\s*\{\s*defineFrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g,cu=/export\s+default\s+defineFrontComponent\s*\(\s*\{[^}]*component\s*:\s*(\w+)[^}]*\}\s*\)\s*;?/s,qm=c=>{let a=c.replace(km,"");const i=a.match(cu);if(i){const f=i[1],g=new RegExp(`export\\s+(const|function)\\s+${f}\\b`);a=a.replace(g,`$1 ${f}`),a=a.replace(cu,`export default globalThis.jsx(${f}, {});`)}return a},jm={name:"jsx-transform-to-remote-dom-worker-format-plugin",setup:c=>{c.onLoad({filter:/\.tsx$/},async({path:a})=>{try{const i=await Fm.readFile(a,"utf8"),f=Bm(i),g=f!==i,_=qm(f);return{contents:g?`var RemoteComponents = globalThis.RemoteComponents;
|
|
3
|
+
${_}`:_,loader:"tsx"}}catch(i){return{errors:[{text:`Failed to transform front component: ${i instanceof Error?i.message:String(i)}`,location:{file:a}}]}}})}},Gm=/^([\w$]+)\s+as\s+([\w$]+)$/,Hm=c=>{const a=c.trim(),i=a.match(Gm);if(le.Tr(i)){const[,f,g]=i;return{originalName:f,aliasName:g}}return{originalName:a,aliasName:a}},Km=c=>c.split(",").map(a=>a.trim()).filter(a=>a.length>0).filter(a=>!a.startsWith("type ")).map(a=>Hm(a).originalName),Yr=({sourceContent:c,pattern:a})=>{const i=new Map;let f;for(;le.Tr(f=a.exec(c));){const g=f.groups?.namedImports,_=f.groups?.subPath??"";i.has(_)||i.set(_,new Set),g&&Km(g).forEach(S=>i.get(_)?.add(S))}return a.lastIndex=0,i},Zr=c=>{const a=c.namespace??c.pluginName;return{name:c.pluginName,setup:i=>{const f=new Map;i.onStart(()=>{f.clear()}),i.onResolve({filter:c.moduleFilter},async({importer:g,path:_})=>{if(g&&!f.has(g))try{const S=await Ts.readFile(g,"utf-8");f.set(g,c.collectImports(S))}catch{f.set(g,new Map)}return{path:g?`${_}?importer=${encodeURIComponent(g)}`:_,namespace:a,pluginData:{importerFilePath:g,originalPath:_}}}),i.onLoad({filter:/.*/,namespace:a},({pluginData:g})=>{const{originalPath:_,importerFilePath:S}=g;if(c.staticContents?.[_])return{contents:c.staticContents[_],loader:"js"};const A=_===c.moduleName?"":_.replace(`${c.moduleName}/`,""),P=f.get(S)?.get(A)??new Set;return{contents:c.generateExports({namedImports:P,moduleSubPath:A}),loader:"js"}})}}},As=/import\s+(?:(?<defaultImport>\w+)\s*,?\s*)?(?:\{(?<namedImports>[^}]*)\})?\s*from\s*['"]react['"];?/g,zm=/^react(\/jsx-runtime)?$/,Jm=`
|
|
4
4
|
export var jsx = /* @__PURE__ */ (() => globalThis.jsx)();
|
|
5
5
|
export var jsxs = /* @__PURE__ */ (() => globalThis.jsxs)();
|
|
6
6
|
export var Fragment = /* @__PURE__ */ (() => globalThis.React.Fragment)();
|
|
7
|
-
`.trim(),Ym=c=>{const a=
|
|
8
|
-
`)},Xm=
|
|
9
|
-
`)}),r0=/import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-sdk\/ui['"];?/g,i0=/^twenty-sdk\/ui$/,s0=
|
|
10
|
-
`)}),a0=/import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-shared(?:\/(?<subPath>[^'"]*?))?['"];?/g,o0=/^twenty-shared(\/.*)?$/,u0=c=>c===""?"globalThis.TwentyShared":`globalThis.TwentyShared['${c}']`,c0=
|
|
11
|
-
`)}}),l0=()=>[Xm,n0,s0,c0,
|
|
12
|
-
const require = __createRequire(import.meta.url);`},qt=".twenty/output";var
|
|
7
|
+
`.trim(),Ym=c=>{const a=Yr({sourceContent:c,pattern:As});let i;for(;le.Tr(i=As.exec(c));)i.groups?.defaultImport&&(a.has("")||a.set("",new Set),a.get("").add("default"));return As.lastIndex=0,a},Zm=({namedImports:c})=>{const a=[];for(const i of c)i==="default"?a.push("export default /* @__PURE__ */ (() => globalThis.React)();"):a.push(`export var ${i} = /* @__PURE__ */ (() => globalThis.React.${i})();`);return a.join(`
|
|
8
|
+
`)},Xm=Zr({pluginName:"react-globals",namespace:"react-globals",moduleName:"react",moduleFilter:zm,collectImports:Ym,generateExports:Zm,staticContents:{"react/jsx-runtime":Jm}}),Qm=/^\/\/.*$\n/gm,Vm={name:"strip-comments",setup:c=>{c.onEnd(async a=>{if(a.errors.length>0)return;const i=Object.keys(a.metafile?.outputs??{}).filter(f=>f.endsWith(".mjs"));for(const f of i){const g=ee.default.resolve(f),_=await Ts.readFile(g,"utf-8"),S=_.replace(Qm,"");S!==_&&await Ts.writeFile(g,S,"utf-8")}})}},e0=/import\s+(?:\{(?<namedImports>[^}]*)\})?\s*from\s*['"]twenty-sdk['"];?/g,t0=/^twenty-sdk$/,n0=Zr({pluginName:"twenty-sdk-globals",namespace:"twenty-sdk-globals",moduleName:"twenty-sdk",moduleFilter:t0,collectImports:c=>Yr({sourceContent:c,pattern:e0}),generateExports:({namedImports:c})=>[...c].map(a=>`export var ${a} = /* @__PURE__ */ (() => globalThis.TwentySdk.${a})();`).join(`
|
|
9
|
+
`)}),r0=/import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-sdk\/ui['"];?/g,i0=/^twenty-sdk\/ui$/,s0=Zr({pluginName:"twenty-sdk-ui-globals",namespace:"twenty-sdk-ui-globals",moduleName:"twenty-sdk/ui",moduleFilter:i0,collectImports:c=>Yr({sourceContent:c,pattern:r0}),generateExports:({namedImports:c})=>[...c].map(a=>`export var ${a} = /* @__PURE__ */ (() => globalThis.RemoteComponents.TwentyUi${a})();`).join(`
|
|
10
|
+
`)}),a0=/import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-shared(?:\/(?<subPath>[^'"]*?))?['"];?/g,o0=/^twenty-shared(\/.*)?$/,u0=c=>c===""?"globalThis.TwentyShared":`globalThis.TwentyShared['${c}']`,c0=Zr({pluginName:"twenty-shared-globals",namespace:"twenty-shared-globals",moduleName:"twenty-shared",moduleFilter:o0,collectImports:c=>Yr({sourceContent:c,pattern:a0}),generateExports:({namedImports:c,moduleSubPath:a})=>{const i=u0(a);return[...c].map(f=>`export var ${f} = /* @__PURE__ */ (() => ${i}.${f})();`).join(`
|
|
11
|
+
`)}}),l0=()=>[Xm,n0,s0,c0,jm,Vm],Is="public",f0="TWENTY_API_KEY",h0="TWENTY_API_URL",p0={js:`import { createRequire as __createRequire } from 'module';
|
|
12
|
+
const require = __createRequire(import.meta.url);`},qt=".twenty/output";var _e=(c=>(c.Object="object",c.Field="field",c.LogicFunction="logicFunction",c.FrontComponent="frontComponent",c.Role="role",c))(_e||{});const d0=["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/*"];class yu{constructor(a){this.esBuildContext=null,this.isRestarting=!1,this.lastChecksums=new Map,this.buildCompletePromise=Promise.resolve(),this.resolveBuildComplete=null,this.appPath=a.appPath,this.sourcePaths=a.sourcePaths,this.watchMode=a.watch??!0,this.onFileBuilt=a.handleFileBuilt,this.onBuildError=a.handleBuildError,this.config=a.config}shouldRestart(a){const i=this.sourcePaths.sort().join(","),f=[...a].sort().join(",");return i!==f}async start(){this.sourcePaths.length>0&&await this.createContext()}async close(){await this.esBuildContext?.dispose(),this.esBuildContext=null}async restart(a){if(!this.isRestarting){this.isRestarting=!0;try{await this.close();const i=ee.default.join(this.appPath,qt);await Mm(i,this.sourcePaths,a),this.sourcePaths=a,this.lastChecksums.clear(),this.sourcePaths.length>0&&await this.createContext()}finally{this.isRestarting=!1}}}async createContext(){const a=ee.default.join(this.appPath,qt),i={};for(const _ of this.sourcePaths){const S=_.replace(/\.tsx?$/,"");i[S]=ee.default.join(this.appPath,_)}const f=this,g=[...this.config.extraPlugins??[],{name:"build-notifications",setup:_=>{_.onEnd(async S=>{try{if(S.errors.length>0){S.errors[0].text.includes("Could not resolve")||await this.onBuildError?.(S.errors.map(A=>({error:A.text,location:A.location})));return}await Nm({result:S,appPath:this.appPath,fileFolder:this.config.fileFolder,lastChecksums:f.lastChecksums,onFileBuilt:f.onFileBuilt})}finally{f.resolveBuildComplete?.()}})}}];this.esBuildContext=await _u.context({entryPoints:i,bundle:!0,splitting:!1,format:"esm",platform:this.config.platform,outdir:a,outExtension:{".js":".mjs"},external:this.config.externalModules,tsconfig:ee.default.join(this.appPath,"tsconfig.json"),jsx:this.config.jsx,sourcemap:!0,metafile:!0,logLevel:"silent",minify:this.config.minify,banner:this.config.banner,plugins:g}),this.buildCompletePromise=new Promise(_=>{this.resolveBuildComplete=_}),await this.esBuildContext.rebuild(),await this.buildCompletePromise,this.watchMode&&await this.esBuildContext.watch()}}const g0={name:"external-patterns",setup:c=>{c.onResolve({filter:/(?:^|\/)generated(?:\/|$)/},a=>({path:a.path,external:!0}))}},m0=c=>new yu({...c,config:{externalModules:d0,fileFolder:le.N.BuiltLogicFunction,platform:"node",extraPlugins:[g0],banner:p0}}),v0=c=>new yu({...c,config:{externalModules:Um,fileFolder:le.N.BuiltFrontComponent,jsx:"automatic",extraPlugins:l0()}});class _0{constructor(a){this.watcher=null,this.appPath=a.appPath,this.handleChangeDetected=a.handleChangeDetected}async start(){this.watcher=wu.default.watch(this.appPath,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",async(a,i)=>{if(a==="addDir")return;const f=ie.relative(this.appPath,i),g=f.startsWith("node_modules")||f.startsWith("generated")||f.startsWith("dist"),_=f.startsWith(Is),S=["package.json","yarn.lock"].includes(f),A=f.endsWith(".ts")||f.endsWith(".tsx"),I=f.startsWith(".");(g||!A||I)&&!_&&!S||this.handleChangeDetected(f,a)})}async close(){await this.watcher?.close()}}const w0=({manifest:c,builtFileInfos:a})=>{let i=structuredClone(c);for(const[f,{fileFolder:g,checksum:_}]of a.entries()){const S=ie.relative(qt,f);if(g===le.N.BuiltLogicFunction){const A=i.logicFunctions,I=A.findIndex(P=>P.builtHandlerPath===S);if(I===-1)continue;i={...i,logicFunctions:A.map((P,J)=>J===I?{...P,builtHandlerChecksum:_}:P)}}if(g===le.N.PublicAsset){const A=i.publicAssets,I=A.findIndex(P=>P.filePath===S);if(I===-1)continue;i={...i,publicAssets:A.map((P,J)=>J===I?{...P,checksum:_}:P)};continue}if(g===le.N.BuiltFrontComponent){const A=i.frontComponents,I=A.findIndex(P=>P.builtComponentPath===S)??-1;if(I===-1)continue;i={...i,frontComponents:A.map((P,J)=>J===I?{...P,builtComponentChecksum:_}:P)}}g===le.N.Dependencies&&(S==="package.json"&&(i.application.packageJsonChecksum=_),S==="yarn.lock"&&(i.application.yarnLockChecksum=_))}return i},y0=async(c,a)=>{const i=ee.default.join(c,qt);await V.ensureDir(i);const f=ee.default.join(i,"manifest.json");return await V.writeJSON(f,a,{spaces:2}),f},x0=ee.join(Fs.tmpdir(),".twenty-sdk-test"),S0=()=>process.env.NODE_ENV==="test"?ee.join(x0,"config.json"):ee.join(Fs.homedir(),".twenty","config.json"),xt="default",Jr=class Jr{constructor(){this.configPath=S0()}static setActiveWorkspace(a){this.activeWorkspace=a??xt}static getActiveWorkspace(){return this.activeWorkspace}getActiveWorkspaceName(){return Jr.getActiveWorkspace()}async readRawConfig(){await V.ensureFile(this.configPath);const a=await V.readFile(this.configPath,"utf8");return JSON.parse(a||"{}")}async getConfig(){return this.getConfigForWorkspace(this.getActiveWorkspaceName())}async getConfigForWorkspace(a){const i=this.getDefaultConfig();try{const f=await this.readRawConfig(),g=a===xt&&!f.profiles?.[xt]?f:f.profiles?.[a],_=g?.apiUrl??i.apiUrl,S=g?.apiKey;return{apiUrl:_,apiKey:S}}catch{return i}}async setConfig(a){const i=await this.readRawConfig(),f=this.getActiveWorkspaceName();i.profiles||(i.profiles={});const g=i.profiles[f]||{apiUrl:""};i.profiles[f]={...g,...a},await V.ensureDir(ee.dirname(this.configPath)),await V.writeFile(this.configPath,JSON.stringify(i,null,2))}async clearConfig(){const a=await this.readRawConfig(),i=this.getActiveWorkspaceName();if(a.profiles||(a.profiles={}),a.profiles[i]&&delete a.profiles[i],i===xt){const f=this.getDefaultConfig();delete a.apiKey,a.apiUrl=f.apiUrl}await V.ensureDir(ee.dirname(this.configPath)),await V.writeFile(this.configPath,JSON.stringify(a,null,2))}getDefaultConfig(){return{apiUrl:"http://localhost:3000"}}async getAvailableWorkspaces(){try{const a=await this.readRawConfig(),i=new Set;return i.add(xt),a.profiles&&Object.keys(a.profiles).forEach(f=>i.add(f)),Array.from(i).sort()}catch{return[xt]}}async getDefaultWorkspace(){try{return(await this.readRawConfig()).defaultWorkspace??xt}catch{return xt}}async setDefaultWorkspace(a){const i=await this.readRawConfig();i.defaultWorkspace=a,await V.ensureDir(ee.dirname(this.configPath)),await V.writeFile(this.configPath,JSON.stringify(i,null,2))}};Jr.activeWorkspace=xt;let be=Jr;class bt{constructor(a){const{disableInterceptors:i=!1}=a||{};this.configService=new be,this.client=Kr.default.create(),this.client.interceptors.request.use(async f=>{const g=await this.configService.getConfig();return f.baseURL=g.apiUrl,g.apiKey&&(f.headers.Authorization=`Bearer ${g.apiKey}`),f}),!i&&this.client.interceptors.response.use(f=>f,f=>{throw f.response?.status===401?console.error(b.default.red("Authentication failed. Please run `twenty auth:login` first.")):f.response?.status===403?console.error(b.default.red("Access denied. Check your API key and workspace permissions.")):f.code==="ECONNREFUSED"&&console.error(b.default.red("Cannot connect to Twenty server. Is it running?")),f})}async validateAuth(){try{const i=await this.client.post("/metadata",{query:`
|
|
13
13
|
query CurrentWorkspace {
|
|
14
14
|
currentWorkspace {
|
|
15
15
|
id
|
|
@@ -34,7 +34,7 @@ const require = __createRequire(import.meta.url);`},qt=".twenty/output";var ve=(
|
|
|
34
34
|
mutation UninstallApplication($universalIdentifier: String!) {
|
|
35
35
|
uninstallApplication(universalIdentifier: $universalIdentifier)
|
|
36
36
|
}
|
|
37
|
-
`,f={universalIdentifier:a},g=await this.client.post("/metadata",{query:i,variables:f},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return g.data.errors?{success:!1,error:g.data.errors[0]?.message||"Failed to delete application"}:{success:!0,data:g.data.data.uninstallApplication,message:"Successfully uninstalled application"}}catch(i){if(
|
|
37
|
+
`,f={universalIdentifier:a},g=await this.client.post("/metadata",{query:i,variables:f},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return g.data.errors?{success:!1,error:g.data.errors[0]?.message||"Failed to delete application"}:{success:!0,data:g.data.data.uninstallApplication,message:"Successfully uninstalled application"}}catch(i){if(Kr.default.isAxiosError(i)&&i.response)return{success:!1,error:i.response.data?.errors?.[0]?.message||i.message};throw i}}async getSchema(){try{const a=Ss.getIntrospectionQuery(),i=await this.client.post("/graphql",{query:a},{headers:{"Content-Type":"application/json",Accept:"*/*"}});if(i.data.errors)return{success:!1,error:`GraphQL introspection errors: ${JSON.stringify(i.data.errors)}`};const f=Ss.buildClientSchema(i.data.data);return{success:!0,data:Ss.printSchema(f),message:"Successfully load schema"}}catch(a){if(Kr.default.isAxiosError(a)&&a.response)return{success:!1,error:a.response.data.errors[0]?.message||"Failed to load graphql Schema"};throw a}}async findLogicFunctions(){try{const i=await this.client.post("/metadata",{query:`
|
|
38
38
|
query FindManyLogicFunctions {
|
|
39
39
|
findManyLogicFunctions {
|
|
40
40
|
id
|
|
@@ -53,18 +53,18 @@ const require = __createRequire(import.meta.url);`},qt=".twenty/output";var ve=(
|
|
|
53
53
|
error
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
`,g={input:{id:a,payload:i}},_=await this.client.post("/metadata",{query:f,variables:g},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return _.data.errors?{success:!1,error:_.data.errors[0]?.message||"Failed to execute logic function"}:{success:!0,data:_.data.data.executeOneLogicFunction}}catch(f){return{success:!1,error:f}}}async subscribeToLogs({applicationUniversalIdentifier:a,functionUniversalIdentifier:i,functionName:f}){const g=await this.configService.getConfig(),_=
|
|
56
|
+
`,g={input:{id:a,payload:i}},_=await this.client.post("/metadata",{query:f,variables:g},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return _.data.errors?{success:!1,error:_.data.errors[0]?.message||"Failed to execute logic function"}:{success:!0,data:_.data.data.executeOneLogicFunction}}catch(f){return{success:!1,error:f}}}async subscribeToLogs({applicationUniversalIdentifier:a,functionUniversalIdentifier:i,functionName:f}){const g=await this.configService.getConfig(),_=Sm.createClient({url:g.apiUrl+"/graphql",headers:{Authorization:`Bearer ${g.apiKey}`,"Content-Type":"application/json",Accept:"text/event-stream"}}),S=`
|
|
57
57
|
subscription SubscribeToLogs($input: LogicFunctionLogsInput!) {
|
|
58
58
|
logicFunctionLogs(input: $input) {
|
|
59
59
|
logs
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
`,A={input:{applicationUniversalIdentifier:a,universalIdentifier:i,name:f}};_.subscribe({query:S,variables:A},{next:({data:I})=>console.log(I?.logicFunctionLogs.logs),error:I=>console.error(I),complete:()=>console.log("Completed")})}async uploadFile({filePath:a,builtHandlerPath:i,fileFolder:f,applicationUniversalIdentifier:g}){try{const _=ee.resolve(a);if(!
|
|
62
|
+
`,A={input:{applicationUniversalIdentifier:a,universalIdentifier:i,name:f}};_.subscribe({query:S,variables:A},{next:({data:I})=>console.log(I?.logicFunctionLogs.logs),error:I=>console.error(I),complete:()=>console.log("Completed")})}async uploadFile({filePath:a,builtHandlerPath:i,fileFolder:f,applicationUniversalIdentifier:g}){try{const _=ee.resolve(a);if(!uu.existsSync(_))return{success:!1,error:`File not found: ${_}`};const S=ee.basename(_),A=uu.readFileSync(_),I=this.getMimeType(S),P=`
|
|
63
63
|
mutation UploadApplicationFile($file: Upload!, $applicationUniversalIdentifier: String!, $fileFolder: FileFolder!, $filePath: String!) {
|
|
64
64
|
uploadApplicationFile(file: $file, applicationUniversalIdentifier: $applicationUniversalIdentifier, fileFolder: $fileFolder, filePath: $filePath)
|
|
65
65
|
{ path }
|
|
66
66
|
}
|
|
67
|
-
`,J=Om(f),G=JSON.stringify({query:P,variables:{file:null,applicationUniversalIdentifier:g,filePath:i,fileFolder:J}}),K=JSON.stringify({0:["variables.file"]}),k=new FormData;k.append("operations",G),k.append("map",K),k.append("0",new Blob([new Uint8Array(A)],{type:I}),S);const ue=await this.client.post("/metadata",k);return ue.data.errors?{success:!1,error:ue.data.errors[0]?.message||"Failed to upload file"}:{success:!0,data:ue.data.data.uploadApplicationFile,message:`Successfully uploaded ${S}`}}catch(_){return zr.default.isAxiosError(_)&&_.response?{success:!1,error:_.response.data?.errors?.[0]?.message||_.message}:{success:!1,error:_}}}getMimeType(a){const i=ee.extname(a).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 A0{constructor(a){this.apiService=new Ct,this.applicationUniversalIdentifier=a.applicationUniversalIdentifier,this.appPath=a.appPath}async uploadFile({builtPath:a,fileFolder:i}){const f=ie.relative(qt,a);return await this.apiService.uploadFile({filePath:ee.default.join(this.appPath,a),builtHandlerPath:f,fileFolder:i,applicationUniversalIdentifier:this.applicationUniversalIdentifier})}}var Su=(c=>(c.DefineApplication="defineApplication",c.DefineField="defineField",c.DefineLogicFunction="defineLogicFunction",c.DefineObject="defineObject",c.DefineRole="defineRole",c.DefineFrontComponent="defineFrontComponent",c))(Su||{}),jt=(c=>(c.Application="application",c.Fields="fields",c.LogicFunctions="logicFunctions",c.Objects="objects",c.Roles="roles",c.FrontComponents="frontComponents",c.PublicAssets="publicAssets",c))(jt||{});const b0={defineApplication:"application",defineField:"fields",defineLogicFunction:"logicFunctions",defineObject:"objects",defineRole:"roles",defineFrontComponent:"frontComponents"},E0=c=>{if(!Fn.isCallExpression(c))return;const a=c.expression;if(Fn.isIdentifier(a)&&Object.values(Su).includes(a.text))return a.text},C0=c=>{const a=Fn.createSourceFile("temp.ts",c,Fn.ScriptTarget.Latest,!0),i=[];Fn.forEachChild(a,f=>{i.push(f)});for(const f of i)if(Fn.isExportAssignment(f)){if(f.isExportEquals||!f.expression)return;const g=E0(f.expression);if(g)return g}},T0=["twenty-sdk/ui"],F0={name:"manifest-mock",setup:c=>{const a=new RegExp(`^(${T0.map(i=>i.replace("/","\\/")).join("|")})$`);c.onResolve({filter:a},({path:i})=>({path:i,namespace:"manifest-mock"})),c.onLoad({filter:/.*/,namespace:"manifest-mock"},()=>({contents:"module.exports = new Proxy({}, { get: () => () => {} });",loader:"js"}))}},Tn=async({filePath:c,appPath:a})=>{const i=await I0({filePath:c,appPath:a});return R0(i,c)},I0=async({filePath:c,appPath:a})=>{const i=ee.default.join(a,"tsconfig.json"),f=await V.pathExists(i),g=Em.createRequire(ee.default.join(a,"package.json"));let _,S;try{_=ee.default.dirname(g.resolve("react/package.json")),S=ee.default.dirname(g.resolve("react-dom/package.json"))}catch{}const I=(await wu.build({entryPoints:[c],bundle:!0,write:!1,format:"cjs",platform:"node",target:"node18",jsx:"automatic",tsconfig:f?i:void 0,alias:{..._&&{react:_},...S&&{"react-dom":S}},plugins:[F0],logLevel:"silent"})).outputFiles[0].text,P=await V.mkdtemp(ee.default.join(Is.default.tmpdir(),"twenty-manifest-")),J=ee.default.join(P,"module.cjs");try{return await V.writeFile(J,I),require(J)}finally{await V.remove(P)}},R0=(c,a)=>{if(je.Tr(c.default)&&Lm(c.default))return c.default;throw new Error(`Config file ${a} must export a config object default export`)},P0=async c=>await mu.glob(["**/*.ts","**/*.tsx"],{cwd:c,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**","**/.twenty/**"],onlyFiles:!0}),O0=async c=>await mu.glob([`${Rs}/**/*`],{cwd:c,onlyFiles:!0}),Qr=async c=>{const a=await P0(c),i=[];let f;const g=[],_=[],S=[],A=[],I=[],P=[],J=[],G=[],K=[],k=[],ue=[],Oe=[],pe=[];for(const F of a){const Z=await gu.readFile(F,"utf-8"),z=ie.relative(c,F),se=C0(Z);if(!se)continue;switch(b0[se]){case jt.Application:{const ne=await Tn({appPath:c,filePath:F});f={...ne.config,yarnLockChecksum:null,packageJsonChecksum:null},i.push(...ne.errors),J.push(z);break}case jt.Objects:{const ne=await Tn({appPath:c,filePath:F});g.push(ne.config),i.push(...ne.errors),G.push(z);break}case jt.Fields:{const ne=await Tn({appPath:c,filePath:F});_.push(ne.config),i.push(...ne.errors),K.push(z);break}case jt.Roles:{const ne=await Tn({appPath:c,filePath:F});S.push(ne.config),i.push(...ne.errors),k.push(z);break}case jt.LogicFunctions:{const ne=await Tn({appPath:c,filePath:F});i.push(...ne.errors);const{handler:Ht,...Ge}=ne.config,ht=ie.relative(c,F),Ft={...Ge,handlerName:"default.config.handler",sourceHandlerPath:ht,builtHandlerPath:ht.replace(/\.tsx?$/,".mjs"),builtHandlerChecksum:"[default-checksum]"};A.push(Ft),ue.push(z);break}case jt.FrontComponents:{const ne=await Tn({appPath:c,filePath:F});i.push(...ne.errors);const{component:Ht,...Ge}=ne.config,ht=ie.relative(c,F),Ft={...Ge,componentName:Ht.name,sourceComponentPath:ht,builtComponentPath:ht.replace(/\.tsx?$/,".mjs"),builtComponentChecksum:""};I.push(Ft),Oe.push(z);break}case jt.PublicAssets:break;default:je.ln()}}const Le=await O0(c);for(const F of Le)P.push({filePath:F,fileName:ie.basename(F),fileType:ie.extname(F).replace(/^\./,""),checksum:null}),pe.push(ie.relative(c,F));return f||i.push("Cannot build application, please export default defineApplication() to define an application"),{manifest:f?{application:f,objects:g,fields:_,roles:S,logicFunctions:A,frontComponents:I,publicAssets:P}:null,filePaths:{application:J,objects:G,fields:K,roles:k,logicFunctions:ue,frontComponents:Oe,publicAssets:pe},errors:i}},L0=c=>{const a=new Set,i=new Set;for(const f of c)a.has(f)?i.add(f):a.add(f);return Array.from(i)},Au=c=>{const a=[];if(!c)return[];for(const[i,f]of Object.entries(c))i==="universalIdentifier"&&typeof f=="string"&&a.push(f),typeof f=="object"&&a.push(...Au(f));return a},M0=c=>{const a=[],i=[],f=L0(Au(c));return f.length>0&&a.push(`Duplicate universal identifiers: ${f.join(", ")}`),je.Zo(c.objects)||i.push("No object defined"),je.Zo(c.logicFunctions)||i.push("No logic function defined"),je.Zo(c.frontComponents)||i.push("No front component defined"),{errors:a,warnings:i,isValid:a.length===0}};class N0{constructor(a){this.builtFileInfos=new Map,this.fileUploader=null,this.apiService=new Ct({disableInterceptors:!0}),this.activeUploads=new Set,this.syncTimer=null,this.isSyncing=!1,this.serverReady=!1,this.serverErrorLogged=!1,this.appPath=a.appPath,this.debounceMs=a.debounceMs??200,this.handleManifestBuilt=a.handleManifestBuilt,this.uiStateManager=a.uiStateManager}async checkServer(){const a=await this.apiService.validateAuth();if(!a.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(!a.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(a,i){this.serverReady||await this.checkServer(),this.serverReady&&(this.uiStateManager.addEvent({message:`Change detected: ${a}`,status:"info"}),i==="unlink"?this.uiStateManager.removeEntity(a):this.uiStateManager.updateFileStatus(a,"building"),this.scheduleSync())}handleFileBuildError(a){this.uiStateManager.addEvent({message:"Build failed:",status:"error"});for(const i of a)this.uiStateManager.addEvent({message:i.error,status:"error"})}handleFileBuilt({fileFolder:a,builtPath:i,sourcePath:f,checksum:g}){this.uiStateManager.addEvent({message:`Successfully built ${i}`,status:"success"}),this.builtFileInfos.set(i,{checksum:g,builtPath:i,sourcePath:f,fileFolder:a}),this.fileUploader&&this.uploadFile(i,f,a),this.scheduleSync()}uploadFile(a,i,f){this.uiStateManager.addEvent({message:`Uploading ${a}`,status:"info"}),this.uiStateManager.updateFileStatus(i,"uploading");const g=this.fileUploader.uploadFile({builtPath:a,fileFolder:f}).then(_=>{_.success?(this.uiStateManager.addEvent({message:`Successfully uploaded ${a}`,status:"success"}),this.uiStateManager.updateFileStatus(i,"success")):this.uiStateManager.addEvent({message:`Failed to upload ${a}: ${_.error}`,status:"error"})}).catch(_=>{this.uiStateManager.addEvent({message:`Upload failed for ${a}: ${_}`,status:"error"})}).finally(()=>{this.activeUploads.delete(g)});this.activeUploads.add(g)}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 a=await Qr(this.appPath);if(a.errors.length>0||!a.manifest){for(const _ of a.errors)this.uiStateManager.addEvent({message:_,status:"error"});this.uiStateManager.updateManifestState({manifestStatus:"error",error:a.errors[a.errors.length-1]});return}const i=M0(a.manifest);if(!i.isValid){for(const _ of i.errors)this.uiStateManager.addEvent({message:_,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:_});return}if(this.uiStateManager.updateManifestState({appName:a.manifest.application.displayName}),this.uiStateManager.updateAllFilesTypes({manifestFilePaths:a.filePaths}),i.warnings.length>0)for(const _ of i.warnings)this.uiStateManager.addEvent({message:`⚠ ${_}`,status:"warning"});if(this.uiStateManager.addEvent({message:"Successfully built manifest",status:"success"}),await this.handleManifestBuilt(a),!this.fileUploader){const _=await this.apiService.checkApplicationExist(a.manifest.application.universalIdentifier);if(!_.success){this.uiStateManager.addEvent({message:`Failed to check if application ${a.manifest.application.universalIdentifier} already exists`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Failed to check if application already exists"});return}if(!_.data){this.uiStateManager.addEvent({message:"Creating application",status:"info"});const A=await this.apiService.createApplication(a.manifest);if(A.success)this.uiStateManager.addEvent({message:"Application created",status:"success"});else{this.uiStateManager.addEvent({message:`Application creation failed with error ${JSON.stringify(A.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:`Application creation failed with error ${JSON.stringify(A.error,null,2)}`});return}}this.fileUploader=new A0({appPath:this.appPath,applicationUniversalIdentifier:a.manifest.application.universalIdentifier});for(const[A,{fileFolder:I,sourcePath:P}]of this.builtFileInfos.entries())this.uploadFile(A,P,I)}for(;this.activeUploads.size>0;)await Promise.all(this.activeUploads);const f=w0({manifest:a.manifest,builtFileInfos:this.builtFileInfos});this.uiStateManager.addEvent({message:"Manifest checksums set",status:"info"}),await y0(this.appPath,f),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 g=await this.apiService.syncApplication(f);this.uiStateManager.updateAllFilesStatus("success"),g.success?(this.uiStateManager.addEvent({message:"✓ Synced",status:"success"}),this.uiStateManager.updateManifestState({manifestStatus:"synced"})):(this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(g.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"}))}catch(a){this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(a,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"})}finally{this.isSyncing=!1}}}}const U0={pending:["building","uploading","success"],building:["pending","uploading","success"],uploading:["pending","success"],success:["pending","building","uploading"]};class W0{constructor({appPath:a,frontendUrl:i}){this.eventIdCounter=0,this.listeners=new Set,this.state={appPath:a,frontendUrl:i,appName:null,appDescription:null,appUniversalIdentifier:null,manifestStatus:"idle",entities:new Map,events:[]}}getSnapshot(){return this.state}subscribe(a){return this.listeners.add(a),a(this.getSnapshot()),()=>this.listeners.delete(a)}notify(){for(const a of this.listeners)a(this.state)}addEvent({message:a,status:i="info"}){const f={id:++this.eventIdCounter,timestamp:new Date,message:a.slice(0,5e3),status:i};this.state={...this.state,events:[...this.state.events.slice(-201),f]},this.notify()}updateManifestState({manifestStatus:a,appName:i,error:f}){this.state={...this.state,...a?{manifestStatus:a}:{},...i?{appName:i}:{},...f?{error:f.slice(0,5e3)}:{error:void 0}},this.notify()}convertEntityTypeToSyncableEntity(a){switch(a){case"objects":return ve.Object;case"fields":return ve.Field;case"logicFunctions":return ve.LogicFunction;case"frontComponents":return ve.FrontComponent;case"roles":return ve.Role;default:return}}updateAllFilesTypes({manifestFilePaths:a}){const i=new Map;Object.entries(a).forEach(([g,_])=>{_.forEach(S=>{const A=this.convertEntityTypeToSyncableEntity(g);A&&i.set(S,A)})});const f=new Map(this.state.entities);for(const[g,_]of f)f.set(g,{..._,type:i.get(g)});this.state={...this.state,entities:f},this.notify()}updateAllFilesStatus(a){const i=new Map(this.state.entities);for(const[f,g]of i)i.set(f,{...g,status:a});this.state={...this.state,entities:i},this.notify()}removeEntity(a){const i=new Map(this.state.entities);i.delete(a),this.state={...this.state,entities:i}}updateFileStatus(a,i){const f=new Map(this.state.entities),g=f.get(a);g?.status&&!U0[g.status].find(_=>_===i)||(f.set(a,g?{...g,status:i}:{name:a,path:a,status:i}),this.state={...this.state,entities:f},this.notify())}}const Es=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],fu=["↑","⇡","↟","⤒"],Jr={pending:"○",success:"✓"},Zn={pending:"gray",building:"yellow",uploading:"cyan",success:"green"},bu={[ve.Object]:"Objects",[ve.Field]:"Fields",[ve.LogicFunction]:"Logic functions",[ve.FrontComponent]:"Front components",[ve.Role]:"Roles"},Eu=Object.keys(bu),D0={info:"gray",success:"green",error:"red",warning:"yellow"},$0=c=>{const a=new Map;for(const i of Eu)a.set(i,[]);for(const i of c.values()){if(!i.type)continue;const f=a.get(i.type)??[];f.push(i),a.set(i.type,f)}return a},B0=c=>c.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),k0=(c,a=40)=>{if(c.length<=a)return c;const i=c.split("/");return i.length<=2?c:`.../${i.slice(-2).join("/")}`},j0=c=>!c.frontendUrl||!c.appUniversalIdentifier?null:`${c.frontendUrl}/settings/applications`,q0=async c=>{const[a,i]=await Promise.all([import("react"),import("ink")]),{useState:f,useEffect:g}=a,{render:_,Box:S,Text:A,Static:I}=i,P=(F,Z=80)=>{const[z,se]=f(0);return g(()=>{const qe=setInterval(()=>{se(ne=>(ne+1)%F.length)},Z);return()=>clearInterval(qe)},[F.length,Z]),F[z]},J=({event:F})=>{const Z=D0[F.status],z=B0(F.timestamp);return W.jsxs(S,{children:[W.jsxs(A,{dimColor:!0,children:[z," "]}),W.jsx(A,{color:Z,children:F.message})]})},G=({status:F})=>{const Z=P(Es,200),z=P(fu,200),se={building:Z,uploading:z,pending:Jr.pending,success:Jr.success};return W.jsxs(A,{color:Zn[F],children:[se[F]," "]})},K=({entity:F})=>W.jsxs(S,{children:[W.jsx(G,{status:F.status}),W.jsx(A,{children:F.name}),F.path!==F.name&&W.jsxs(A,{dimColor:!0,children:[" (",k0(F.path),")"]})]}),k=({type:F,entities:Z})=>Z.length===0?null:W.jsxs(S,{flexDirection:"column",marginTop:1,children:[W.jsx(A,{bold:!0,dimColor:!0,children:bu[F]}),Z.map(z=>W.jsx(K,{entity:z},z.path))]}),ue={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"}},Oe=({snapshot:F})=>{const Z=P(Es,80),z=ue[F.manifestStatus],se=z.icon==="spinner"?Z:z.icon;return W.jsxs(A,{color:z.color,children:[se?`${se} `:"",z.text,F.error&&`: ${F.error}`]})},pe=({snapshot:F})=>{const Z=$0(F.entities),z=j0(F);return W.jsxs(S,{flexDirection:"column",borderStyle:"classic",borderColor:"gray",paddingX:1,children:[W.jsx(A,{bold:!0,color:"cyan",children:"Application"}),W.jsxs(S,{marginLeft:2,flexDirection:"column",children:[W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Name: "}),W.jsx(A,{bold:!0,children:F.appName??"Loading..."})]}),F.appDescription&&W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Description: "}),W.jsx(A,{children:F.appDescription})]}),W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Status: "}),W.jsx(Oe,{snapshot:F})]}),z&&W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Open:"}),W.jsxs(A,{bold:!0,color:"cyan",children:[" ",z]})]})]}),W.jsx(S,{marginLeft:2,flexDirection:"column",children:Eu.map(se=>{const qe=Z.get(se)??[];return W.jsx(k,{type:se,entities:qe},se)})})]})},Le=()=>W.jsx(S,{marginTop:1,children:W.jsxs(A,{dimColor:!0,children:[W.jsx(A,{color:Zn.pending,children:Jr.pending})," ","pending ",W.jsx(A,{color:Zn.building,children:Es[0]})," ","building ",W.jsx(A,{color:Zn.uploading,children:fu[0]})," ","uploading"," ",W.jsx(A,{color:Zn.success,children:Jr.success})," ","success"]})}),Tt=()=>{const[F,Z]=f(c.getSnapshot());return g(()=>c.subscribe(Z),[]),W.jsxs(W.Fragment,{children:[W.jsx(I,{items:F.events,children:z=>W.jsx(J,{event:z},z.id)}),W.jsxs(S,{marginTop:1,flexDirection:"column",children:[W.jsx(pe,{snapshot:F}),W.jsx(Le,{})]})]})},{unmount:Te}=_(W.jsx(Tt,{}));return{unmount:Te}};class hu{constructor(a){this.watcher=null,this.appPath=a.appPath,this.fileFolder=a.fileFolder,this.watchPaths=a.watchPaths,this.handleFileBuilt=a.handleFileBuilt}async start(){const a=this.watchPaths.map(i=>ie.join(this.appPath,i));for(const i of a)if(!await V.pathExists(i))return;this.watcher=yu.default.watch(a,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",(i,f)=>{i!=="addDir"&&((i==="add"||i==="change")&&this.copyAndNotify(f),i==="unlink"&&this.handleUnlink(f))})}async close(){await this.watcher?.close()}async copyAndNotify(a){const i=ie.relative(this.appPath,a),f=ie.join(qt,i),g=ie.join(this.appPath,f);await V.ensureDir(ie.dirname(g)),await V.copy(a,g);const _=await V.readFile(g),S=_u.default.createHash("md5").update(_).digest("hex");this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:f,sourcePath:i,checksum:S})}async handleUnlink(a){const i=ie.relative(this.appPath,a),f=ie.join(qt,i),g=ie.join(this.appPath,f);await V.remove(g)}}class G0{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 close(){this.unmountUI?.(),await Promise.all([this.manifestWatcher?.close(),this.logicFunctionsWatcher?.close(),this.frontComponentsWatcher?.close(),this.assetWatcher?.close(),this.dependencyWatcher?.close()])}async execute(a){this.appPath=a.appPath??Et,await this.cleanOutputDir(),this.uiStateManager=new W0({appPath:this.appPath,frontendUrl:process.env.FRONTEND_URL});const{unmount:i}=await q0(this.uiStateManager);this.unmountUI=i,this.orchestrator=new N0({appPath:this.appPath,handleManifestBuilt:this.handleWatcherRestarts.bind(this),uiStateManager:this.uiStateManager}),await this.startManifestWatcher(),this.setupGracefulShutdown()}async cleanOutputDir(){const a=ee.default.join(this.appPath,qt);await V.ensureDir(a),await V.emptyDir(a)}async startManifestWatcher(){this.manifestWatcher=new _0({appPath:this.appPath,handleChangeDetected:this.orchestrator.handleChangeDetected.bind(this.orchestrator)}),await this.manifestWatcher.start()}async handleWatcherRestarts(a){const{logicFunctions:i,frontComponents:f}=a.filePaths;if(!this.watchersStarted){this.watchersStarted=!0,await this.startFileWatchers(i,f);return}this.logicFunctionsWatcher?.shouldRestart(i)&&await this.logicFunctionsWatcher.restart(i),this.frontComponentsWatcher?.shouldRestart(f)&&await this.frontComponentsWatcher.restart(f)}async startFileWatchers(a,i){await Promise.all([this.startLogicFunctionsWatcher(a),this.startFrontComponentsWatcher(i),this.startAssetWatcher(),this.startDependencyWatcher()])}async startLogicFunctionsWatcher(a){this.logicFunctionsWatcher=m0({appPath:this.appPath,sourcePaths:a,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.logicFunctionsWatcher.start()}async startFrontComponentsWatcher(a){this.frontComponentsWatcher=v0({appPath:this.appPath,sourcePaths:a,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.frontComponentsWatcher.start()}async startAssetWatcher(){this.assetWatcher=new hu({appPath:this.appPath,fileFolder:ft.N.PublicAsset,watchPaths:[Rs],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new hu({appPath:this.appPath,fileFolder:ft.N.Dependencies,watchPaths:["package.json","yarn.lock"],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),this.dependencyWatcher.start()}setupGracefulShutdown(){const a=()=>void this.close().then(()=>process.exit(0));process.on("SIGINT",a),process.on("SIGTERM",a)}}const H0="generated";class K0{constructor(){this.configService=new Ae,this.apiService=new Ct}async generate(a){const i=ie.join(a,H0);console.log(b.default.blue("📦 Generating Twenty client...")),console.log(b.default.gray(`📁 Output Path: ${i}`)),console.log("");const f=await this.configService.getConfig(),g=f.apiUrl,_=f.apiKey;if(!g||!_){console.log(b.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(b.default.gray(`API URL: ${g}`)),console.log(b.default.gray(`Output: ${i}`));const S=await this.apiService.getSchema();if(!S.success)return;const{data:A}=S,I=ie.resolve(i);await Cm.generate({schema:A,output:I,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(I),console.log(b.default.green("✓ Client generated successfully!")),console.log(b.default.gray(`Generated files at: ${i}`))}async injectTwentyClient(a){const i=`
|
|
67
|
+
`,J=Om(f),G=JSON.stringify({query:P,variables:{file:null,applicationUniversalIdentifier:g,filePath:i,fileFolder:J}}),K=JSON.stringify({0:["variables.file"]}),k=new FormData;k.append("operations",G),k.append("map",K),k.append("0",new Blob([new Uint8Array(A)],{type:I}),S);const ue=await this.client.post("/metadata",k);return ue.data.errors?{success:!1,error:ue.data.errors[0]?.message||"Failed to upload file"}:{success:!0,data:ue.data.data.uploadApplicationFile,message:`Successfully uploaded ${S}`}}catch(_){return Kr.default.isAxiosError(_)&&_.response?{success:!1,error:_.response.data?.errors?.[0]?.message||_.message}:{success:!1,error:_}}}getMimeType(a){const i=ee.extname(a).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 A0{constructor(a){this.apiService=new bt,this.applicationUniversalIdentifier=a.applicationUniversalIdentifier,this.appPath=a.appPath}async uploadFile({builtPath:a,fileFolder:i}){const f=ie.relative(qt,a);return await this.apiService.uploadFile({filePath:ee.default.join(this.appPath,a),builtHandlerPath:f,fileFolder:i,applicationUniversalIdentifier:this.applicationUniversalIdentifier})}}var xu=(c=>(c.DefineApplication="defineApplication",c.DefineField="defineField",c.DefineLogicFunction="defineLogicFunction",c.DefineObject="defineObject",c.DefineRole="defineRole",c.DefineFrontComponent="defineFrontComponent",c))(xu||{}),Bt=(c=>(c.Application="application",c.Fields="fields",c.LogicFunctions="logicFunctions",c.Objects="objects",c.Roles="roles",c.FrontComponents="frontComponents",c.PublicAssets="publicAssets",c))(Bt||{});const b0={defineApplication:"application",defineField:"fields",defineLogicFunction:"logicFunctions",defineObject:"objects",defineRole:"roles",defineFrontComponent:"frontComponents"},E0=c=>{if(!Tn.isCallExpression(c))return;const a=c.expression;if(Tn.isIdentifier(a)&&Object.values(xu).includes(a.text))return a.text},C0=c=>{const a=Tn.createSourceFile("temp.ts",c,Tn.ScriptTarget.Latest,!0),i=[];Tn.forEachChild(a,f=>{i.push(f)});for(const f of i)if(Tn.isExportAssignment(f)){if(f.isExportEquals||!f.expression)return;const g=E0(f.expression);if(g)return g}},T0=["twenty-sdk/ui"],F0={name:"manifest-mock",setup:c=>{const a=new RegExp(`^(${T0.map(i=>i.replace("/","\\/")).join("|")})$`);c.onResolve({filter:a},({path:i})=>({path:i,namespace:"manifest-mock"})),c.onLoad({filter:/.*/,namespace:"manifest-mock"},()=>({contents:"module.exports = new Proxy({}, { get: () => () => {} });",loader:"js"}))}},Cn=async({filePath:c,appPath:a})=>{const i=await I0({filePath:c,appPath:a});return R0(i,c)},I0=async({filePath:c,appPath:a})=>{const i=ee.default.join(a,"tsconfig.json"),f=await V.pathExists(i),g=bm.createRequire(ee.default.join(a,"package.json"));let _,S;try{_=ee.default.dirname(g.resolve("react/package.json")),S=ee.default.dirname(g.resolve("react-dom/package.json"))}catch{}const I=(await _u.build({entryPoints:[c],bundle:!0,write:!1,format:"cjs",platform:"node",target:"node18",jsx:"automatic",tsconfig:f?i:void 0,alias:{..._&&{react:_},...S&&{"react-dom":S}},plugins:[F0],logLevel:"silent"})).outputFiles[0].text,P=await V.mkdtemp(ee.default.join(Fs.default.tmpdir(),"twenty-manifest-")),J=ee.default.join(P,"module.cjs");try{return await V.writeFile(J,I),require(J)}finally{await V.remove(P)}},R0=(c,a)=>{if(le.Tr(c.default)&&Lm(c.default))return c.default;throw new Error(`Config file ${a} must export a config object default export`)},P0=async c=>await gu.glob(["**/*.ts","**/*.tsx"],{cwd:c,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**","**/.twenty/**"],onlyFiles:!0}),O0=async c=>await gu.glob([`${Is}/**/*`],{cwd:c,onlyFiles:!0}),Xr=async c=>{const a=await P0(c),i=[];let f;const g=[],_=[],S=[],A=[],I=[],P=[],J=[],G=[],K=[],k=[],ue=[],Le=[],de=[];for(const F of a){const Z=await du.readFile(F,"utf-8"),z=ie.relative(c,F),se=C0(Z);if(!se)continue;switch(b0[se]){case Bt.Application:{const ne=await Cn({appPath:c,filePath:F});f={...ne.config,yarnLockChecksum:null,packageJsonChecksum:null},i.push(...ne.errors),J.push(z);break}case Bt.Objects:{const ne=await Cn({appPath:c,filePath:F});g.push(ne.config),i.push(...ne.errors),G.push(z);break}case Bt.Fields:{const ne=await Cn({appPath:c,filePath:F});_.push(ne.config),i.push(...ne.errors),K.push(z);break}case Bt.Roles:{const ne=await Cn({appPath:c,filePath:F});S.push(ne.config),i.push(...ne.errors),k.push(z);break}case Bt.LogicFunctions:{const ne=await Cn({appPath:c,filePath:F});i.push(...ne.errors);const{handler:Gt,...Ge}=ne.config,ft=ie.relative(c,F),Ct={...Ge,handlerName:"default.config.handler",sourceHandlerPath:ft,builtHandlerPath:ft.replace(/\.tsx?$/,".mjs"),builtHandlerChecksum:"[default-checksum]"};A.push(Ct),ue.push(z);break}case Bt.FrontComponents:{const ne=await Cn({appPath:c,filePath:F});i.push(...ne.errors);const{component:Gt,...Ge}=ne.config,ft=ie.relative(c,F),Ct={...Ge,componentName:Gt.name,sourceComponentPath:ft,builtComponentPath:ft.replace(/\.tsx?$/,".mjs"),builtComponentChecksum:""};I.push(Ct),Le.push(z);break}case Bt.PublicAssets:break;default:le.ln()}}const Me=await O0(c);for(const F of Me)P.push({filePath:F,fileName:ie.basename(F),fileType:ie.extname(F).replace(/^\./,""),checksum:null}),de.push(ie.relative(c,F));return f||i.push("Cannot build application, please export default defineApplication() to define an application"),{manifest:f?{application:f,objects:g,fields:_,roles:S,logicFunctions:A,frontComponents:I,publicAssets:P}:null,filePaths:{application:J,objects:G,fields:K,roles:k,logicFunctions:ue,frontComponents:Le,publicAssets:de},errors:i}},L0=c=>{const a=new Set,i=new Set;for(const f of c)a.has(f)?i.add(f):a.add(f);return Array.from(i)},Su=c=>{const a=[];if(!c)return[];for(const[i,f]of Object.entries(c))i==="universalIdentifier"&&typeof f=="string"&&a.push(f),typeof f=="object"&&a.push(...Su(f));return a},M0=c=>{const a=[],i=[],f=L0(Su(c));return f.length>0&&a.push(`Duplicate universal identifiers: ${f.join(", ")}`),le.Zo(c.objects)||i.push("No object defined"),le.Zo(c.logicFunctions)||i.push("No logic function defined"),le.Zo(c.frontComponents)||i.push("No front component defined"),{errors:a,warnings:i,isValid:a.length===0}};class N0{constructor(a){this.builtFileInfos=new Map,this.fileUploader=null,this.apiService=new bt({disableInterceptors:!0}),this.activeUploads=new Set,this.syncTimer=null,this.isSyncing=!1,this.serverReady=!1,this.serverErrorLogged=!1,this.appPath=a.appPath,this.debounceMs=a.debounceMs??200,this.handleManifestBuilt=a.handleManifestBuilt,this.uiStateManager=a.uiStateManager}async checkServer(){const a=await this.apiService.validateAuth();if(!a.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(!a.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(a,i){this.serverReady||await this.checkServer(),this.serverReady&&(this.uiStateManager.addEvent({message:`Change detected: ${a}`,status:"info"}),i==="unlink"?this.uiStateManager.removeEntity(a):this.uiStateManager.updateFileStatus(a,"building"),this.scheduleSync())}handleFileBuildError(a){this.uiStateManager.addEvent({message:"Build failed:",status:"error"});for(const i of a)this.uiStateManager.addEvent({message:i.error,status:"error"})}handleFileBuilt({fileFolder:a,builtPath:i,sourcePath:f,checksum:g}){this.uiStateManager.addEvent({message:`Successfully built ${i}`,status:"success"}),this.builtFileInfos.set(i,{checksum:g,builtPath:i,sourcePath:f,fileFolder:a}),this.fileUploader&&this.uploadFile(i,f,a),this.scheduleSync()}uploadFile(a,i,f){this.uiStateManager.addEvent({message:`Uploading ${a}`,status:"info"}),this.uiStateManager.updateFileStatus(i,"uploading");const g=this.fileUploader.uploadFile({builtPath:a,fileFolder:f}).then(_=>{_.success?(this.uiStateManager.addEvent({message:`Successfully uploaded ${a}`,status:"success"}),this.uiStateManager.updateFileStatus(i,"success")):this.uiStateManager.addEvent({message:`Failed to upload ${a}: ${_.error}`,status:"error"})}).catch(_=>{this.uiStateManager.addEvent({message:`Upload failed for ${a}: ${_}`,status:"error"})}).finally(()=>{this.activeUploads.delete(g)});this.activeUploads.add(g)}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 a=await Xr(this.appPath);if(a.errors.length>0||!a.manifest){for(const _ of a.errors)this.uiStateManager.addEvent({message:_,status:"error"});this.uiStateManager.updateManifestState({manifestStatus:"error",error:a.errors[a.errors.length-1]});return}const i=M0(a.manifest);if(!i.isValid){for(const _ of i.errors)this.uiStateManager.addEvent({message:_,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:_});return}if(this.uiStateManager.updateManifestState({appName:a.manifest.application.displayName}),this.uiStateManager.updateAllFilesTypes({manifestFilePaths:a.filePaths}),i.warnings.length>0)for(const _ of i.warnings)this.uiStateManager.addEvent({message:`⚠ ${_}`,status:"warning"});if(this.uiStateManager.addEvent({message:"Successfully built manifest",status:"success"}),await this.handleManifestBuilt(a),!this.fileUploader){const _=await this.apiService.checkApplicationExist(a.manifest.application.universalIdentifier);if(!_.success){this.uiStateManager.addEvent({message:`Failed to check if application ${a.manifest.application.universalIdentifier} already exists`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Failed to check if application already exists"});return}if(!_.data){this.uiStateManager.addEvent({message:"Creating application",status:"info"});const A=await this.apiService.createApplication(a.manifest);if(A.success)this.uiStateManager.addEvent({message:"Application created",status:"success"});else{this.uiStateManager.addEvent({message:`Application creation failed with error ${JSON.stringify(A.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:`Application creation failed with error ${JSON.stringify(A.error,null,2)}`});return}}this.fileUploader=new A0({appPath:this.appPath,applicationUniversalIdentifier:a.manifest.application.universalIdentifier});for(const[A,{fileFolder:I,sourcePath:P}]of this.builtFileInfos.entries())this.uploadFile(A,P,I)}for(;this.activeUploads.size>0;)await Promise.all(this.activeUploads);const f=w0({manifest:a.manifest,builtFileInfos:this.builtFileInfos});this.uiStateManager.addEvent({message:"Manifest checksums set",status:"info"}),await y0(this.appPath,f),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 g=await this.apiService.syncApplication(f);this.uiStateManager.updateAllFilesStatus("success"),g.success?(this.uiStateManager.addEvent({message:"✓ Synced",status:"success"}),this.uiStateManager.updateManifestState({manifestStatus:"synced"})):(this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(g.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"}))}catch(a){this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(a,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"})}finally{this.isSyncing=!1}}}}const U0={pending:["building","uploading","success"],building:["pending","uploading","success"],uploading:["pending","success"],success:["pending","building","uploading"]};class W0{constructor({appPath:a,frontendUrl:i}){this.eventIdCounter=0,this.listeners=new Set,this.state={appPath:a,frontendUrl:i,appName:null,appDescription:null,appUniversalIdentifier:null,manifestStatus:"idle",entities:new Map,events:[]}}getSnapshot(){return this.state}subscribe(a){return this.listeners.add(a),a(this.getSnapshot()),()=>this.listeners.delete(a)}notify(){for(const a of this.listeners)a(this.state)}addEvent({message:a,status:i="info"}){const f={id:++this.eventIdCounter,timestamp:new Date,message:a.slice(0,5e3),status:i};this.state={...this.state,events:[...this.state.events.slice(-201),f]},this.notify()}updateManifestState({manifestStatus:a,appName:i,error:f}){this.state={...this.state,...a?{manifestStatus:a}:{},...i?{appName:i}:{},...f?{error:f.slice(0,5e3)}:{error:void 0}},this.notify()}convertEntityTypeToSyncableEntity(a){switch(a){case"objects":return _e.Object;case"fields":return _e.Field;case"logicFunctions":return _e.LogicFunction;case"frontComponents":return _e.FrontComponent;case"roles":return _e.Role;default:return}}updateAllFilesTypes({manifestFilePaths:a}){const i=new Map;Object.entries(a).forEach(([g,_])=>{_.forEach(S=>{const A=this.convertEntityTypeToSyncableEntity(g);A&&i.set(S,A)})});const f=new Map(this.state.entities);for(const[g,_]of f)f.set(g,{..._,type:i.get(g)});this.state={...this.state,entities:f},this.notify()}updateAllFilesStatus(a){const i=new Map(this.state.entities);for(const[f,g]of i)i.set(f,{...g,status:a});this.state={...this.state,entities:i},this.notify()}removeEntity(a){const i=new Map(this.state.entities);i.delete(a),this.state={...this.state,entities:i}}updateFileStatus(a,i){const f=new Map(this.state.entities),g=f.get(a);g?.status&&!U0[g.status].find(_=>_===i)||(f.set(a,g?{...g,status:i}:{name:a,path:a,status:i}),this.state={...this.state,entities:f},this.notify())}}const bs=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],lu=["↑","⇡","↟","⤒"],zr={pending:"○",success:"✓"},Yn={pending:"gray",building:"yellow",uploading:"cyan",success:"green"},Au={[_e.Object]:"Objects",[_e.Field]:"Fields",[_e.LogicFunction]:"Logic functions",[_e.FrontComponent]:"Front components",[_e.Role]:"Roles"},bu=Object.keys(Au),D0={info:"gray",success:"green",error:"red",warning:"yellow"},$0=c=>{const a=new Map;for(const i of bu)a.set(i,[]);for(const i of c.values()){if(!i.type)continue;const f=a.get(i.type)??[];f.push(i),a.set(i.type,f)}return a},B0=c=>c.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),k0=(c,a=40)=>{if(c.length<=a)return c;const i=c.split("/");return i.length<=2?c:`.../${i.slice(-2).join("/")}`},q0=c=>!c.frontendUrl||!c.appUniversalIdentifier?null:`${c.frontendUrl}/settings/applications`,j0=async c=>{const[a,i]=await Promise.all([import("react"),import("ink")]),{useState:f,useEffect:g}=a,{render:_,Box:S,Text:A,Static:I}=i,P=(F,Z=80)=>{const[z,se]=f(0);return g(()=>{const je=setInterval(()=>{se(ne=>(ne+1)%F.length)},Z);return()=>clearInterval(je)},[F.length,Z]),F[z]},J=({event:F})=>{const Z=D0[F.status],z=B0(F.timestamp);return W.jsxs(S,{children:[W.jsxs(A,{dimColor:!0,children:[z," "]}),W.jsx(A,{color:Z,children:F.message})]})},G=({status:F})=>{const Z=P(bs,200),z=P(lu,200),se={building:Z,uploading:z,pending:zr.pending,success:zr.success};return W.jsxs(A,{color:Yn[F],children:[se[F]," "]})},K=({entity:F})=>W.jsxs(S,{children:[W.jsx(G,{status:F.status}),W.jsx(A,{children:F.name}),F.path!==F.name&&W.jsxs(A,{dimColor:!0,children:[" (",k0(F.path),")"]})]}),k=({type:F,entities:Z})=>Z.length===0?null:W.jsxs(S,{flexDirection:"column",marginTop:1,children:[W.jsx(A,{bold:!0,dimColor:!0,children:Au[F]}),Z.map(z=>W.jsx(K,{entity:z},z.path))]}),ue={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"}},Le=({snapshot:F})=>{const Z=P(bs,80),z=ue[F.manifestStatus],se=z.icon==="spinner"?Z:z.icon;return W.jsxs(A,{color:z.color,children:[se?`${se} `:"",z.text,F.error&&`: ${F.error}`]})},de=({snapshot:F})=>{const Z=$0(F.entities),z=q0(F);return W.jsxs(S,{flexDirection:"column",borderStyle:"classic",borderColor:"gray",paddingX:1,children:[W.jsx(A,{bold:!0,color:"cyan",children:"Application"}),W.jsxs(S,{marginLeft:2,flexDirection:"column",children:[W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Name: "}),W.jsx(A,{bold:!0,children:F.appName??"Loading..."})]}),F.appDescription&&W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Description: "}),W.jsx(A,{children:F.appDescription})]}),W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Status: "}),W.jsx(Le,{snapshot:F})]}),z&&W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Open:"}),W.jsxs(A,{bold:!0,color:"cyan",children:[" ",z]})]})]}),W.jsx(S,{marginLeft:2,flexDirection:"column",children:bu.map(se=>{const je=Z.get(se)??[];return W.jsx(k,{type:se,entities:je},se)})})]})},Me=()=>W.jsx(S,{marginTop:1,children:W.jsxs(A,{dimColor:!0,children:[W.jsx(A,{color:Yn.pending,children:zr.pending})," ","pending ",W.jsx(A,{color:Yn.building,children:bs[0]})," ","building ",W.jsx(A,{color:Yn.uploading,children:lu[0]})," ","uploading"," ",W.jsx(A,{color:Yn.success,children:zr.success})," ","success"]})}),Et=()=>{const[F,Z]=f(c.getSnapshot());return g(()=>c.subscribe(Z),[]),W.jsxs(W.Fragment,{children:[W.jsx(I,{items:F.events,children:z=>W.jsx(J,{event:z},z.id)}),W.jsxs(S,{marginTop:1,flexDirection:"column",children:[W.jsx(de,{snapshot:F}),W.jsx(Me,{})]})]})},{unmount:Fe}=_(W.jsx(Et,{}));return{unmount:Fe}};class fu{constructor(a){this.watcher=null,this.appPath=a.appPath,this.fileFolder=a.fileFolder,this.watchPaths=a.watchPaths,this.handleFileBuilt=a.handleFileBuilt}async start(){const a=this.watchPaths.map(i=>ie.join(this.appPath,i));for(const i of a)if(!await V.pathExists(i))return;this.watcher=wu.default.watch(a,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",(i,f)=>{i!=="addDir"&&((i==="add"||i==="change")&&this.copyAndNotify(f),i==="unlink"&&this.handleUnlink(f))})}async close(){await this.watcher?.close()}async copyAndNotify(a){const i=ie.relative(this.appPath,a),f=ie.join(qt,i),g=ie.join(this.appPath,f);await V.ensureDir(ie.dirname(g)),await V.copy(a,g);const _=await V.readFile(g),S=vu.default.createHash("md5").update(_).digest("hex");this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:f,sourcePath:i,checksum:S})}async handleUnlink(a){const i=ie.relative(this.appPath,a),f=ie.join(qt,i),g=ie.join(this.appPath,f);await V.remove(g)}}class G0{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 close(){this.unmountUI?.(),await Promise.all([this.manifestWatcher?.close(),this.logicFunctionsWatcher?.close(),this.frontComponentsWatcher?.close(),this.assetWatcher?.close(),this.dependencyWatcher?.close()])}async execute(a){this.appPath=a.appPath??At,await this.cleanOutputDir(),this.uiStateManager=new W0({appPath:this.appPath,frontendUrl:process.env.FRONTEND_URL});const{unmount:i}=await j0(this.uiStateManager);this.unmountUI=i,this.orchestrator=new N0({appPath:this.appPath,handleManifestBuilt:this.handleWatcherRestarts.bind(this),uiStateManager:this.uiStateManager}),await this.startManifestWatcher(),this.setupGracefulShutdown()}async cleanOutputDir(){const a=ee.default.join(this.appPath,qt);await V.ensureDir(a),await V.emptyDir(a)}async startManifestWatcher(){this.manifestWatcher=new _0({appPath:this.appPath,handleChangeDetected:this.orchestrator.handleChangeDetected.bind(this.orchestrator)}),await this.manifestWatcher.start()}async handleWatcherRestarts(a){const{logicFunctions:i,frontComponents:f}=a.filePaths;if(!this.watchersStarted){this.watchersStarted=!0,await this.startFileWatchers(i,f);return}this.logicFunctionsWatcher?.shouldRestart(i)&&await this.logicFunctionsWatcher.restart(i),this.frontComponentsWatcher?.shouldRestart(f)&&await this.frontComponentsWatcher.restart(f)}async startFileWatchers(a,i){await Promise.all([this.startLogicFunctionsWatcher(a),this.startFrontComponentsWatcher(i),this.startAssetWatcher(),this.startDependencyWatcher()])}async startLogicFunctionsWatcher(a){this.logicFunctionsWatcher=m0({appPath:this.appPath,sourcePaths:a,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.logicFunctionsWatcher.start()}async startFrontComponentsWatcher(a){this.frontComponentsWatcher=v0({appPath:this.appPath,sourcePaths:a,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.frontComponentsWatcher.start()}async startAssetWatcher(){this.assetWatcher=new fu({appPath:this.appPath,fileFolder:le.N.PublicAsset,watchPaths:[Is],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new fu({appPath:this.appPath,fileFolder:le.N.Dependencies,watchPaths:["package.json","yarn.lock"],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),this.dependencyWatcher.start()}setupGracefulShutdown(){const a=()=>void this.close().then(()=>process.exit(0));process.on("SIGINT",a),process.on("SIGTERM",a)}}const H0="generated";class K0{constructor(){this.configService=new be,this.apiService=new bt}async generate(a){const i=ie.join(a,H0);console.log(b.default.blue("📦 Generating Twenty client...")),console.log(b.default.gray(`📁 Output Path: ${i}`)),console.log("");const f=await this.configService.getConfig(),g=f.apiUrl,_=f.apiKey;if(!g||!_){console.log(b.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(b.default.gray(`API URL: ${g}`)),console.log(b.default.gray(`Output: ${i}`));const S=await this.apiService.getSchema();if(!S.success)return;const{data:A}=S,I=ie.resolve(i);await Em.generate({schema:A,output:I,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(I),console.log(b.default.green("✓ Client generated successfully!")),console.log(b.default.gray(`Generated files at: ${i}`))}async injectTwentyClient(a){const i=`
|
|
68
68
|
|
|
69
69
|
// ----------------------------------------------------
|
|
70
70
|
// ✨ Custom Twenty client (auto-injected)
|
|
@@ -142,8 +142,8 @@ export default class Twenty {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
`;await V.appendFile(ie.join(a,"index.ts"),i)}}class z0{constructor(){this.clientService=new K0}async execute(a=
|
|
146
|
-
`));for(const f of a){const g=await this.configService.getConfigForWorkspace(f),_=!!g.apiKey,A=f===i?b.default.green(" (default)"):"",I=_?b.default.green("●"):b.default.gray("○");console.log(` ${I} ${f}${A}`),console.log(b.default.gray(` API URL: ${g.apiUrl}`))}console.log(""),console.log(b.default.gray("● = authenticated, ○ = no credentials")),console.log(b.default.gray("Use `twenty auth:switch <workspace>` to change default"))}catch(a){console.error(b.default.red("List failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class Z0{constructor(){this.configService=new Ae,this.apiService=new Ct}async execute(a){try{let{apiKey:i,apiUrl:f}=a;const g=await this.configService.getConfig();if(f||(f=(await At.default.prompt([{type:"input",name:"apiUrl",message:"Twenty API URL:",default:g.apiUrl,validate:A=>{try{return new URL(A),!0}catch{return"Please enter a valid URL"}}}])).apiUrl),i||(i=(await At.default.prompt([{type:"password",name:"apiKey",message:"API Key:",mask:"*",validate:A=>A.length>0||"API key is required"}])).apiKey),await this.configService.setConfig({apiUrl:f,apiKey:i}),(await this.apiService.validateAuth()).authValid){const S=Ae.getActiveWorkspace();console.log(b.default.green(`✓ Successfully authenticated with Twenty (workspace: ${S})`))}else console.log(b.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(i){console.error(b.default.red("Login failed:"),i instanceof Error?i.message:i),process.exit(1)}}}class X0{constructor(){this.configService=new Ae}async execute(){try{await this.configService.clearConfig();const a=Ae.getActiveWorkspace();console.log(b.default.green(`✓ Successfully logged out (workspace: ${a})`))}catch(a){console.error(b.default.red("Logout failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class Q0{constructor(){this.configService=new Ae,this.apiService=new Ct}async execute(){try{const a=Ae.getActiveWorkspace(),i=await this.configService.getConfig();if(console.log(b.default.blue("Authentication Status:")),console.log(`Workspace: ${a}`),console.log(`API URL: ${i.apiUrl}`),console.log(`API Key: ${i.apiKey?"***"+i.apiKey.slice(-4):"Not set"}`),i.apiKey){const f=await this.apiService.validateAuth();console.log(`Status: ${f.authValid?b.default.green("✓ Valid"):b.default.red("✗ Invalid")}`)}else console.log(`Status: ${b.default.yellow("⚠ Not authenticated")}`)}catch(a){console.error(b.default.red("Status check failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class V0{constructor(){this.apiService=new Ct}async execute({appPath:a=Et,functionUniversalIdentifier:i,functionName:f,payload:g="{}"}){try{let _;try{_=JSON.parse(g)}catch{console.error(b.default.red("Invalid JSON payload. Please provide valid JSON.")),process.exit(1)}const{manifest:S}=await Qr(a);S||(console.error(b.default.red("Failed to build manifest.")),process.exit(1));const A=await this.apiService.findLogicFunctions();A.success||(console.error(b.default.red("Failed to fetch functions:"),A.error instanceof Error?A.error.message:A.error),process.exit(1));const I=A.data.filter(k=>k.universalIdentifier&&this.belongsToApplication(k,S)),P=I.find(k=>i?k.universalIdentifier===i:f?k.name===f:!1);if(!P){const k=i||f;console.error(b.default.red(`Function "${k}" not found in application.`)),console.log(""),I.length>0?(console.log(b.default.cyan("Available functions:")),I.forEach(ue=>{console.log(` - ${b.default.white(ue.name)} (${ue.universalIdentifier})`)})):console.log(b.default.yellow("No functions found for this application. Have you synced your app with `yarn app:dev`?")),process.exit(1)}console.log(b.default.blue(`🚀 Executing function "${P.name}"...`)),console.log(b.default.gray(` Payload: ${JSON.stringify(_)}`)),console.log("");const J=await this.apiService.executeLogicFunction({functionId:P.id,payload:_});J.success||(console.error(b.default.red("Execution failed:"),J.error instanceof Error?J.error.message:J.error),process.exit(1));const G=J.data;console.log(b.default.cyan("─".repeat(60))),console.log(b.default.cyan("Execution Result")),console.log(b.default.cyan("─".repeat(60)));const K=G.status==="SUCCESS"?b.default.green:b.default.red;console.log(`${b.default.bold("Status:")} ${K(G.status)}`),console.log(`${b.default.bold("Duration:")} ${G.duration}ms`),je.Tr(G.data)&&(console.log(""),console.log(b.default.bold("Data:")),console.log(b.default.white(JSON.stringify(G.data,null,2)))),G.error&&(console.log(""),console.log(b.default.bold.red("Error:")),console.log(b.default.red(` Type: ${G.error.errorType}`)),console.log(b.default.red(` Message: ${G.error.errorMessage}`)),G.error.stackTrace&&(console.log(""),console.log(b.default.gray("Stack trace:")),console.log(b.default.gray(G.error.stackTrace)))),G.logs&&(console.log(""),console.log(b.default.bold("Logs:")),console.log(b.default.gray(G.logs))),console.log(b.default.cyan("─".repeat(60))),G.status!=="SUCCESS"&&process.exit(1)}catch(_){console.error(b.default.red("Execution failed:"),_ instanceof Error?_.message:_),process.exit(1)}}belongsToApplication(a,i){return i.logicFunctions.some(f=>f.universalIdentifier===a.universalIdentifier)}}class ev{constructor(){this.apiService=new Ct}async execute({appPath:a=Et,functionUniversalIdentifier:i,functionName:f}){try{const{manifest:g}=await Qr(a);g||process.exit(1),this.logWatchInfo({appName:g.application.displayName,functionUniversalIdentifier:i,functionName:f}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:g.application.universalIdentifier,functionUniversalIdentifier:i,functionName:f})}catch(g){console.error(b.default.red("Watch logs failed:"),g instanceof Error?g.message:g),process.exit(1)}}logWatchInfo({appName:a,functionUniversalIdentifier:i,functionName:f}){const g=a??"Twenty Application",_=i||f?`function "${i||f}"`:"functions";console.log(b.default.blue(`🚀 Watching ${g} ${_} logs:`)),console.log("")}}class tv{constructor(){this.configService=new Ae,this.apiService=new Ct}async execute(a){try{let{workspace:i}=a;const f=await this.configService.getAvailableWorkspaces(),g=await this.configService.getDefaultWorkspace();if(f.length===0){console.log(b.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}if(!i){const A=f.map(P=>({name:P===g?`${P} (current default)`:P,value:P}));i=(await At.default.prompt([{type:"list",name:"workspace",message:"Select a workspace to set as default:",choices:A,default:g}])).workspace}if(f.includes(i)||(console.log(b.default.red(`✗ Workspace "${i}" not found. Available workspaces: ${f.join(", ")}`)),process.exit(1)),i===g){console.log(b.default.blue(`ℹ "${i}" is already the default workspace.`));return}await this.configService.setDefaultWorkspace(i),Ae.setActiveWorkspace(i);const S=!!(await this.configService.getConfig()).apiKey;console.log(b.default.green(`✓ Switched default workspace to "${i}"`)),S?(await this.apiService.validateAuth()).authValid?console.log(b.default.green("✓ Authentication is valid")):console.log(b.default.yellow("⚠ Authentication credentials exist but are invalid. Run `twenty auth:login` to re-authenticate.")):console.log(b.default.yellow("⚠ No credentials configured for this workspace. Run `twenty auth:login` to authenticate."))}catch(i){console.error(b.default.red("Switch failed:"),i instanceof Error?i.message:i),process.exit(1)}}}var Cs,pu;function nv(){if(pu)return Cs;pu=1;var c="[object Symbol]",a=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,f="\\ud800-\\udfff",g="\\u0300-\\u036f\\ufe20-\\ufe23",_="\\u20d0-\\u20f0",S="\\u2700-\\u27bf",A="a-z\\xdf-\\xf6\\xf8-\\xff",I="\\xac\\xb1\\xd7\\xf7",P="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",J="\\u2000-\\u206f",G=" \\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",K="A-Z\\xc0-\\xd6\\xd8-\\xde",k="\\ufe0e\\ufe0f",ue=I+P+J+G,Oe="['’]",pe="["+ue+"]",Le="["+g+_+"]",Tt="\\d+",Te="["+S+"]",F="["+A+"]",Z="[^"+f+ue+Tt+S+A+K+"]",z="\\ud83c[\\udffb-\\udfff]",se="(?:"+Le+"|"+z+")",qe="[^"+f+"]",ne="(?:\\ud83c[\\udde6-\\uddff]){2}",Ht="[\\ud800-\\udbff][\\udc00-\\udfff]",Ge="["+K+"]",ht="\\u200d",Ft="(?:"+F+"|"+Z+")",Vn="(?:"+Ge+"|"+Z+")",er="(?:"+Oe+"(?:d|ll|m|re|s|t|ve))?",tr="(?:"+Oe+"(?:D|LL|M|RE|S|T|VE))?",at=se+"?",et="["+k+"]?",Vr="(?:"+ht+"(?:"+[qe,ne,Ht].join("|")+")"+et+at+")*",un=et+at+Vr,He="(?:"+[Te,ne,Ht].join("|")+")"+un,ei=RegExp(Oe,"g"),ti=RegExp(Le,"g"),ni=RegExp([Ge+"?"+F+"+"+er+"(?="+[pe,Ge,"$"].join("|")+")",Vn+"+"+tr+"(?="+[pe,Ge+Ft,"$"].join("|")+")",Ge+"?"+Ft+"+"+er,Ge+"+"+tr,Tt,He].join("|"),"g"),It=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cn={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},ri=typeof bt.commonjsGlobal=="object"&&bt.commonjsGlobal&&bt.commonjsGlobal.Object===Object&&bt.commonjsGlobal,Kt=typeof self=="object"&&self&&self.Object===Object&&self,zt=ri||Kt||Function("return this")();function ii(O,de,ot,ir){for(var Xt=-1,Ln=O?O.length:0;++Xt<Ln;)ot=de(ot,O[Xt],Xt,O);return ot}function ln(O){return O.match(a)||[]}function fn(O){return function(de){return O?.[de]}}var nr=fn(cn);function Me(O){return It.test(O)}function Jt(O){return O.match(ni)||[]}var si=Object.prototype,tt=si.toString,On=zt.Symbol,rr=On?On.prototype:void 0,Rt=rr?rr.toString:void 0;function Ne(O){if(typeof O=="string")return O;if(ai(O))return Rt?Rt.call(O):"";var de=O+"";return de=="0"&&1/O==-1/0?"-0":de}function Yt(O){return function(de){return ii(Ot(oi(de).replace(ei,"")),O,"")}}function hn(O){return!!O&&typeof O=="object"}function ai(O){return typeof O=="symbol"||hn(O)&&tt.call(O)==c}function Pt(O){return O==null?"":Ne(O)}function oi(O){return O=Pt(O),O&&O.replace(i,nr).replace(ti,"")}var Zt=Yt(function(O,de,ot){return O+(ot?"-":"")+de.toLowerCase()});function Ot(O,de,ot){return O=Pt(O),de=de,de===void 0?Me(O)?Jt(O):ln(O):O.match(de)||[]}return Cs=Zt,Cs}var rv=nv();const In=bt.getDefaultExportFromCjs(rv),iv=({name:c,universalIdentifier:a=Qn.v4()})=>{const i=In(c);return`import { defineFrontComponent } from 'twenty-sdk';
|
|
145
|
+
`;await V.appendFile(ie.join(a,"index.ts"),i)}}class z0{constructor(){this.clientService=new K0}async execute(a=At){try{await this.clientService.generate(a)}catch(i){throw console.error(b.default.red("Generate Twenty client failed:"),i instanceof Error?i.message:i),i}}}class J0{constructor(){this.apiService=new bt}async execute({appPath:a=At,askForConfirmation:i}){try{console.log(b.default.blue("🚀 Uninstall Twenty Application")),console.log(b.default.gray(`📁 App Path: ${a}`)),console.log(""),i&&!await this.confirmationPrompt()&&(console.error(b.default.red("⛔️ Aborting uninstall")),process.exit(1));const{manifest:f}=await Xr(a);if(!f)return{success:!1,error:"Build failed"};const g=await this.apiService.uninstallApplication(f.application.universalIdentifier);return g.success===!1?console.error(b.default.red("❌ Uninstall failed:"),g.error):console.log(b.default.green("✅ Application uninstalled successfully")),g}catch(f){throw console.error(b.default.red("Uninstall failed:"),f instanceof Error?f.message:f),f}}async confirmationPrompt(){const{confirmation:a}=await St.default.prompt([{type:"confirm",name:"confirmation",message:"Are you sure you want to uninstall this application?",default:!1}]);return a}}class Y0{constructor(){this.configService=new be}async execute(){try{const a=await this.configService.getAvailableWorkspaces(),i=await this.configService.getDefaultWorkspace();if(a.length===0){console.log(b.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}console.log(b.default.blue(`Available workspaces:
|
|
146
|
+
`));for(const f of a){const g=await this.configService.getConfigForWorkspace(f),_=!!g.apiKey,A=f===i?b.default.green(" (default)"):"",I=_?b.default.green("●"):b.default.gray("○");console.log(` ${I} ${f}${A}`),console.log(b.default.gray(` API URL: ${g.apiUrl}`))}console.log(""),console.log(b.default.gray("● = authenticated, ○ = no credentials")),console.log(b.default.gray("Use `twenty auth:switch <workspace>` to change default"))}catch(a){console.error(b.default.red("List failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class Z0{constructor(){this.configService=new be,this.apiService=new bt}async execute(a){try{let{apiKey:i,apiUrl:f}=a;const g=await this.configService.getConfig();if(f||(f=(await St.default.prompt([{type:"input",name:"apiUrl",message:"Twenty API URL:",default:g.apiUrl,validate:A=>{try{return new URL(A),!0}catch{return"Please enter a valid URL"}}}])).apiUrl),i||(i=(await St.default.prompt([{type:"password",name:"apiKey",message:"API Key:",mask:"*",validate:A=>A.length>0||"API key is required"}])).apiKey),await this.configService.setConfig({apiUrl:f,apiKey:i}),(await this.apiService.validateAuth()).authValid){const S=be.getActiveWorkspace();console.log(b.default.green(`✓ Successfully authenticated with Twenty (workspace: ${S})`))}else console.log(b.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(i){console.error(b.default.red("Login failed:"),i instanceof Error?i.message:i),process.exit(1)}}}class X0{constructor(){this.configService=new be}async execute(){try{await this.configService.clearConfig();const a=be.getActiveWorkspace();console.log(b.default.green(`✓ Successfully logged out (workspace: ${a})`))}catch(a){console.error(b.default.red("Logout failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class Q0{constructor(){this.configService=new be,this.apiService=new bt}async execute(){try{const a=be.getActiveWorkspace(),i=await this.configService.getConfig();if(console.log(b.default.blue("Authentication Status:")),console.log(`Workspace: ${a}`),console.log(`API URL: ${i.apiUrl}`),console.log(`API Key: ${i.apiKey?"***"+i.apiKey.slice(-4):"Not set"}`),i.apiKey){const f=await this.apiService.validateAuth();console.log(`Status: ${f.authValid?b.default.green("✓ Valid"):b.default.red("✗ Invalid")}`)}else console.log(`Status: ${b.default.yellow("⚠ Not authenticated")}`)}catch(a){console.error(b.default.red("Status check failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class V0{constructor(){this.apiService=new bt}async execute({appPath:a=At,functionUniversalIdentifier:i,functionName:f,payload:g="{}"}){try{let _;try{_=JSON.parse(g)}catch{console.error(b.default.red("Invalid JSON payload. Please provide valid JSON.")),process.exit(1)}const{manifest:S}=await Xr(a);S||(console.error(b.default.red("Failed to build manifest.")),process.exit(1));const A=await this.apiService.findLogicFunctions();A.success||(console.error(b.default.red("Failed to fetch functions:"),A.error instanceof Error?A.error.message:A.error),process.exit(1));const I=A.data.filter(k=>k.universalIdentifier&&this.belongsToApplication(k,S)),P=I.find(k=>i?k.universalIdentifier===i:f?k.name===f:!1);if(!P){const k=i||f;console.error(b.default.red(`Function "${k}" not found in application.`)),console.log(""),I.length>0?(console.log(b.default.cyan("Available functions:")),I.forEach(ue=>{console.log(` - ${b.default.white(ue.name)} (${ue.universalIdentifier})`)})):console.log(b.default.yellow("No functions found for this application. Have you synced your app with `yarn app:dev`?")),process.exit(1)}console.log(b.default.blue(`🚀 Executing function "${P.name}"...`)),console.log(b.default.gray(` Payload: ${JSON.stringify(_)}`)),console.log("");const J=await this.apiService.executeLogicFunction({functionId:P.id,payload:_});J.success||(console.error(b.default.red("Execution failed:"),J.error instanceof Error?J.error.message:J.error),process.exit(1));const G=J.data;console.log(b.default.cyan("─".repeat(60))),console.log(b.default.cyan("Execution Result")),console.log(b.default.cyan("─".repeat(60)));const K=G.status==="SUCCESS"?b.default.green:b.default.red;console.log(`${b.default.bold("Status:")} ${K(G.status)}`),console.log(`${b.default.bold("Duration:")} ${G.duration}ms`),le.Tr(G.data)&&(console.log(""),console.log(b.default.bold("Data:")),console.log(b.default.white(JSON.stringify(G.data,null,2)))),G.error&&(console.log(""),console.log(b.default.bold.red("Error:")),console.log(b.default.red(` Type: ${G.error.errorType}`)),console.log(b.default.red(` Message: ${G.error.errorMessage}`)),G.error.stackTrace&&(console.log(""),console.log(b.default.gray("Stack trace:")),console.log(b.default.gray(G.error.stackTrace)))),G.logs&&(console.log(""),console.log(b.default.bold("Logs:")),console.log(b.default.gray(G.logs))),console.log(b.default.cyan("─".repeat(60))),G.status!=="SUCCESS"&&process.exit(1)}catch(_){console.error(b.default.red("Execution failed:"),_ instanceof Error?_.message:_),process.exit(1)}}belongsToApplication(a,i){return i.logicFunctions.some(f=>f.universalIdentifier===a.universalIdentifier)}}class ev{constructor(){this.apiService=new bt}async execute({appPath:a=At,functionUniversalIdentifier:i,functionName:f}){try{const{manifest:g}=await Xr(a);g||process.exit(1),this.logWatchInfo({appName:g.application.displayName,functionUniversalIdentifier:i,functionName:f}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:g.application.universalIdentifier,functionUniversalIdentifier:i,functionName:f})}catch(g){console.error(b.default.red("Watch logs failed:"),g instanceof Error?g.message:g),process.exit(1)}}logWatchInfo({appName:a,functionUniversalIdentifier:i,functionName:f}){const g=a??"Twenty Application",_=i||f?`function "${i||f}"`:"functions";console.log(b.default.blue(`🚀 Watching ${g} ${_} logs:`)),console.log("")}}class tv{constructor(){this.configService=new be,this.apiService=new bt}async execute(a){try{let{workspace:i}=a;const f=await this.configService.getAvailableWorkspaces(),g=await this.configService.getDefaultWorkspace();if(f.length===0){console.log(b.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}if(!i){const A=f.map(P=>({name:P===g?`${P} (current default)`:P,value:P}));i=(await St.default.prompt([{type:"list",name:"workspace",message:"Select a workspace to set as default:",choices:A,default:g}])).workspace}if(f.includes(i)||(console.log(b.default.red(`✗ Workspace "${i}" not found. Available workspaces: ${f.join(", ")}`)),process.exit(1)),i===g){console.log(b.default.blue(`ℹ "${i}" is already the default workspace.`));return}await this.configService.setDefaultWorkspace(i),be.setActiveWorkspace(i);const S=!!(await this.configService.getConfig()).apiKey;console.log(b.default.green(`✓ Switched default workspace to "${i}"`)),S?(await this.apiService.validateAuth()).authValid?console.log(b.default.green("✓ Authentication is valid")):console.log(b.default.yellow("⚠ Authentication credentials exist but are invalid. Run `twenty auth:login` to re-authenticate.")):console.log(b.default.yellow("⚠ No credentials configured for this workspace. Run `twenty auth:login` to authenticate."))}catch(i){console.error(b.default.red("Switch failed:"),i instanceof Error?i.message:i),process.exit(1)}}}var Es,hu;function nv(){if(hu)return Es;hu=1;var c="[object Symbol]",a=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,f="\\ud800-\\udfff",g="\\u0300-\\u036f\\ufe20-\\ufe23",_="\\u20d0-\\u20f0",S="\\u2700-\\u27bf",A="a-z\\xdf-\\xf6\\xf8-\\xff",I="\\xac\\xb1\\xd7\\xf7",P="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",J="\\u2000-\\u206f",G=" \\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",K="A-Z\\xc0-\\xd6\\xd8-\\xde",k="\\ufe0e\\ufe0f",ue=I+P+J+G,Le="['’]",de="["+ue+"]",Me="["+g+_+"]",Et="\\d+",Fe="["+S+"]",F="["+A+"]",Z="[^"+f+ue+Et+S+A+K+"]",z="\\ud83c[\\udffb-\\udfff]",se="(?:"+Me+"|"+z+")",je="[^"+f+"]",ne="(?:\\ud83c[\\udde6-\\uddff]){2}",Gt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ge="["+K+"]",ft="\\u200d",Ct="(?:"+F+"|"+Z+")",Qn="(?:"+Ge+"|"+Z+")",Vn="(?:"+Le+"(?:d|ll|m|re|s|t|ve))?",er="(?:"+Le+"(?:D|LL|M|RE|S|T|VE))?",at=se+"?",et="["+k+"]?",Qr="(?:"+ft+"(?:"+[je,ne,Gt].join("|")+")"+et+at+")*",on=et+at+Qr,He="(?:"+[Fe,ne,Gt].join("|")+")"+on,Vr=RegExp(Le,"g"),ei=RegExp(Me,"g"),ti=RegExp([Ge+"?"+F+"+"+Vn+"(?="+[de,Ge,"$"].join("|")+")",Qn+"+"+er+"(?="+[de,Ge+Ct,"$"].join("|")+")",Ge+"?"+Ct+"+"+Vn,Ge+"+"+er,Et,He].join("|"),"g"),Tt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,un={À:"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"},ni=typeof kt=="object"&&kt&&kt.Object===Object&&kt,Ht=typeof self=="object"&&self&&self.Object===Object&&self,Kt=ni||Ht||Function("return this")();function ri(O,ge,ot,rr){for(var Zt=-1,On=O?O.length:0;++Zt<On;)ot=ge(ot,O[Zt],Zt,O);return ot}function cn(O){return O.match(a)||[]}function ln(O){return function(ge){return O?.[ge]}}var tr=ln(un);function Ne(O){return Tt.test(O)}function zt(O){return O.match(ti)||[]}var ii=Object.prototype,tt=ii.toString,Pn=Kt.Symbol,nr=Pn?Pn.prototype:void 0,Ft=nr?nr.toString:void 0;function Ue(O){if(typeof O=="string")return O;if(si(O))return Ft?Ft.call(O):"";var ge=O+"";return ge=="0"&&1/O==-1/0?"-0":ge}function Jt(O){return function(ge){return ri(Rt(ai(ge).replace(Vr,"")),O,"")}}function fn(O){return!!O&&typeof O=="object"}function si(O){return typeof O=="symbol"||fn(O)&&tt.call(O)==c}function It(O){return O==null?"":Ue(O)}function ai(O){return O=It(O),O&&O.replace(i,tr).replace(ei,"")}var Yt=Jt(function(O,ge,ot){return O+(ot?"-":"")+ge.toLowerCase()});function Rt(O,ge,ot){return O=It(O),ge=ge,ge===void 0?Ne(O)?zt(O):cn(O):O.match(ge)||[]}return Es=Yt,Es}var rv=nv();const Fn=Rm(rv),iv=({name:c,universalIdentifier:a=Xn.v4()})=>{const i=Fn(c);return`import { defineFrontComponent } from 'twenty-sdk';
|
|
147
147
|
|
|
148
148
|
// React component - implement your UI here
|
|
149
149
|
const Component = () => {
|
|
@@ -161,7 +161,7 @@ export default defineFrontComponent({
|
|
|
161
161
|
description: 'Add a description for your front component',
|
|
162
162
|
component: Component,
|
|
163
163
|
});
|
|
164
|
-
`},sv=({name:c,universalIdentifier:a=
|
|
164
|
+
`},sv=({name:c,universalIdentifier:a=Xn.v4()})=>{const i=Fn(c);return`import { defineLogicFunction } from 'twenty-sdk';
|
|
165
165
|
|
|
166
166
|
// Logic function handler - rename and implement your logic
|
|
167
167
|
const handler = async (params: {
|
|
@@ -199,36 +199,36 @@ export default defineLogicFunction({
|
|
|
199
199
|
// },
|
|
200
200
|
],
|
|
201
201
|
});
|
|
202
|
-
`};var
|
|
202
|
+
`};var Zn={exports:{}};/**
|
|
203
203
|
* @license
|
|
204
204
|
* Lodash <https://lodash.com/>
|
|
205
205
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
206
206
|
* Released under MIT license <https://lodash.com/license>
|
|
207
207
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
208
208
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
209
|
-
*/var av=Xn.exports,du;function ov(){return du||(du=1,function(c,a){(function(){var i,f="4.17.21",g=200,_="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",S="Expected a function",A="Invalid `variable` option passed into `_.template`",I="__lodash_hash_undefined__",P=500,J="__lodash_placeholder__",G=1,K=2,k=4,ue=1,Oe=2,pe=1,Le=2,Tt=4,Te=8,F=16,Z=32,z=64,se=128,qe=256,ne=512,Ht=30,Ge="...",ht=800,Ft=16,Vn=1,er=2,tr=3,at=1/0,et=9007199254740991,Vr=17976931348623157e292,un=NaN,He=4294967295,ei=He-1,ti=He>>>1,ni=[["ary",se],["bind",pe],["bindKey",Le],["curry",Te],["curryRight",F],["flip",ne],["partial",Z],["partialRight",z],["rearg",qe]],It="[object Arguments]",cn="[object Array]",ri="[object AsyncFunction]",Kt="[object Boolean]",zt="[object Date]",ii="[object DOMException]",ln="[object Error]",fn="[object Function]",nr="[object GeneratorFunction]",Me="[object Map]",Jt="[object Number]",si="[object Null]",tt="[object Object]",On="[object Promise]",rr="[object Proxy]",Rt="[object RegExp]",Ne="[object Set]",Yt="[object String]",hn="[object Symbol]",ai="[object Undefined]",Pt="[object WeakMap]",oi="[object WeakSet]",Zt="[object ArrayBuffer]",Ot="[object DataView]",O="[object Float32Array]",de="[object Float64Array]",ot="[object Int8Array]",ir="[object Int16Array]",Xt="[object Int32Array]",Ln="[object Uint8Array]",ui="[object Uint8ClampedArray]",ci="[object Uint16Array]",li="[object Uint32Array]",Cu=/\b__p \+= '';/g,Tu=/\b(__p \+=) '' \+/g,Fu=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ps=/&(?:amp|lt|gt|quot|#39);/g,Os=/[&<>"']/g,Iu=RegExp(Ps.source),Ru=RegExp(Os.source),Pu=/<%-([\s\S]+?)%>/g,Ou=/<%([\s\S]+?)%>/g,Ls=/<%=([\s\S]+?)%>/g,Lu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mu=/^\w*$/,Nu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fi=/[\\^$.*+?()[\]{}|]/g,Uu=RegExp(fi.source),hi=/^\s+/,Wu=/\s/,Du=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$u=/\{\n\/\* \[wrapped with (.+)\] \*/,Bu=/,? & /,ku=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ju=/[()=,{}\[\]\/\s]/,qu=/\\(\\)?/g,Gu=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ms=/\w*$/,Hu=/^[-+]0x[0-9a-f]+$/i,Ku=/^0b[01]+$/i,zu=/^\[object .+?Constructor\]$/,Ju=/^0o[0-7]+$/i,Yu=/^(?:0|[1-9]\d*)$/,Zu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sr=/($^)/,Xu=/['\n\r\u2028\u2029\\]/g,ar="\\ud800-\\udfff",Qu="\\u0300-\\u036f",Vu="\\ufe20-\\ufe2f",ec="\\u20d0-\\u20ff",Ns=Qu+Vu+ec,Us="\\u2700-\\u27bf",Ws="a-z\\xdf-\\xf6\\xf8-\\xff",tc="\\xac\\xb1\\xd7\\xf7",nc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rc="\\u2000-\\u206f",ic=" \\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",Ds="A-Z\\xc0-\\xd6\\xd8-\\xde",$s="\\ufe0e\\ufe0f",Bs=tc+nc+rc+ic,pi="['’]",sc="["+ar+"]",ks="["+Bs+"]",or="["+Ns+"]",js="\\d+",ac="["+Us+"]",qs="["+Ws+"]",Gs="[^"+ar+Bs+js+Us+Ws+Ds+"]",di="\\ud83c[\\udffb-\\udfff]",oc="(?:"+or+"|"+di+")",Hs="[^"+ar+"]",gi="(?:\\ud83c[\\udde6-\\uddff]){2}",mi="[\\ud800-\\udbff][\\udc00-\\udfff]",pn="["+Ds+"]",Ks="\\u200d",zs="(?:"+qs+"|"+Gs+")",uc="(?:"+pn+"|"+Gs+")",Js="(?:"+pi+"(?:d|ll|m|re|s|t|ve))?",Ys="(?:"+pi+"(?:D|LL|M|RE|S|T|VE))?",Zs=oc+"?",Xs="["+$s+"]?",cc="(?:"+Ks+"(?:"+[Hs,gi,mi].join("|")+")"+Xs+Zs+")*",lc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Qs=Xs+Zs+cc,hc="(?:"+[ac,gi,mi].join("|")+")"+Qs,pc="(?:"+[Hs+or+"?",or,gi,mi,sc].join("|")+")",dc=RegExp(pi,"g"),gc=RegExp(or,"g"),vi=RegExp(di+"(?="+di+")|"+pc+Qs,"g"),mc=RegExp([pn+"?"+qs+"+"+Js+"(?="+[ks,pn,"$"].join("|")+")",uc+"+"+Ys+"(?="+[ks,pn+zs,"$"].join("|")+")",pn+"?"+zs+"+"+Js,pn+"+"+Ys,fc,lc,js,hc].join("|"),"g"),vc=RegExp("["+Ks+ar+Ns+$s+"]"),_c=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,wc=["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"],yc=-1,ae={};ae[O]=ae[de]=ae[ot]=ae[ir]=ae[Xt]=ae[Ln]=ae[ui]=ae[ci]=ae[li]=!0,ae[It]=ae[cn]=ae[Zt]=ae[Kt]=ae[Ot]=ae[zt]=ae[ln]=ae[fn]=ae[Me]=ae[Jt]=ae[tt]=ae[Rt]=ae[Ne]=ae[Yt]=ae[Pt]=!1;var re={};re[It]=re[cn]=re[Zt]=re[Ot]=re[Kt]=re[zt]=re[O]=re[de]=re[ot]=re[ir]=re[Xt]=re[Me]=re[Jt]=re[tt]=re[Rt]=re[Ne]=re[Yt]=re[hn]=re[Ln]=re[ui]=re[ci]=re[li]=!0,re[ln]=re[fn]=re[Pt]=!1;var xc={À:"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"},Sc={"&":"&","<":"<",">":">",'"':""","'":"'"},Ac={"&":"&","<":"<",">":">",""":'"',"'":"'"},bc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ec=parseFloat,Cc=parseInt,Vs=typeof bt.commonjsGlobal=="object"&&bt.commonjsGlobal&&bt.commonjsGlobal.Object===Object&&bt.commonjsGlobal,Tc=typeof self=="object"&&self&&self.Object===Object&&self,we=Vs||Tc||Function("return this")(),_i=a&&!a.nodeType&&a,Qt=_i&&!0&&c&&!c.nodeType&&c,ea=Qt&&Qt.exports===_i,wi=ea&&Vs.process,Ke=function(){try{var p=Qt&&Qt.require&&Qt.require("util").types;return p||wi&&wi.binding&&wi.binding("util")}catch{}}(),ta=Ke&&Ke.isArrayBuffer,na=Ke&&Ke.isDate,ra=Ke&&Ke.isMap,ia=Ke&&Ke.isRegExp,sa=Ke&&Ke.isSet,aa=Ke&&Ke.isTypedArray;function Ue(p,v,m){switch(m.length){case 0:return p.call(v);case 1:return p.call(v,m[0]);case 2:return p.call(v,m[0],m[1]);case 3:return p.call(v,m[0],m[1],m[2])}return p.apply(v,m)}function Fc(p,v,m,C){for(var N=-1,Y=p==null?0:p.length;++N<Y;){var ge=p[N];v(C,ge,m(ge),p)}return C}function ze(p,v){for(var m=-1,C=p==null?0:p.length;++m<C&&v(p[m],m,p)!==!1;);return p}function Ic(p,v){for(var m=p==null?0:p.length;m--&&v(p[m],m,p)!==!1;);return p}function oa(p,v){for(var m=-1,C=p==null?0:p.length;++m<C;)if(!v(p[m],m,p))return!1;return!0}function Lt(p,v){for(var m=-1,C=p==null?0:p.length,N=0,Y=[];++m<C;){var ge=p[m];v(ge,m,p)&&(Y[N++]=ge)}return Y}function ur(p,v){var m=p==null?0:p.length;return!!m&&dn(p,v,0)>-1}function yi(p,v,m){for(var C=-1,N=p==null?0:p.length;++C<N;)if(m(v,p[C]))return!0;return!1}function oe(p,v){for(var m=-1,C=p==null?0:p.length,N=Array(C);++m<C;)N[m]=v(p[m],m,p);return N}function Mt(p,v){for(var m=-1,C=v.length,N=p.length;++m<C;)p[N+m]=v[m];return p}function xi(p,v,m,C){var N=-1,Y=p==null?0:p.length;for(C&&Y&&(m=p[++N]);++N<Y;)m=v(m,p[N],N,p);return m}function Rc(p,v,m,C){var N=p==null?0:p.length;for(C&&N&&(m=p[--N]);N--;)m=v(m,p[N],N,p);return m}function Si(p,v){for(var m=-1,C=p==null?0:p.length;++m<C;)if(v(p[m],m,p))return!0;return!1}var Pc=Ai("length");function Oc(p){return p.split("")}function Lc(p){return p.match(ku)||[]}function ua(p,v,m){var C;return m(p,function(N,Y,ge){if(v(N,Y,ge))return C=Y,!1}),C}function cr(p,v,m,C){for(var N=p.length,Y=m+(C?1:-1);C?Y--:++Y<N;)if(v(p[Y],Y,p))return Y;return-1}function dn(p,v,m){return v===v?Hc(p,v,m):cr(p,ca,m)}function Mc(p,v,m,C){for(var N=m-1,Y=p.length;++N<Y;)if(C(p[N],v))return N;return-1}function ca(p){return p!==p}function la(p,v){var m=p==null?0:p.length;return m?Ei(p,v)/m:un}function Ai(p){return function(v){return v==null?i:v[p]}}function bi(p){return function(v){return p==null?i:p[v]}}function fa(p,v,m,C,N){return N(p,function(Y,ge,te){m=C?(C=!1,Y):v(m,Y,ge,te)}),m}function Nc(p,v){var m=p.length;for(p.sort(v);m--;)p[m]=p[m].value;return p}function Ei(p,v){for(var m,C=-1,N=p.length;++C<N;){var Y=v(p[C]);Y!==i&&(m=m===i?Y:m+Y)}return m}function Ci(p,v){for(var m=-1,C=Array(p);++m<p;)C[m]=v(m);return C}function Uc(p,v){return oe(v,function(m){return[m,p[m]]})}function ha(p){return p&&p.slice(0,ma(p)+1).replace(hi,"")}function We(p){return function(v){return p(v)}}function Ti(p,v){return oe(v,function(m){return p[m]})}function Mn(p,v){return p.has(v)}function pa(p,v){for(var m=-1,C=p.length;++m<C&&dn(v,p[m],0)>-1;);return m}function da(p,v){for(var m=p.length;m--&&dn(v,p[m],0)>-1;);return m}function Wc(p,v){for(var m=p.length,C=0;m--;)p[m]===v&&++C;return C}var Dc=bi(xc),$c=bi(Sc);function Bc(p){return"\\"+bc[p]}function kc(p,v){return p==null?i:p[v]}function gn(p){return vc.test(p)}function jc(p){return _c.test(p)}function qc(p){for(var v,m=[];!(v=p.next()).done;)m.push(v.value);return m}function Fi(p){var v=-1,m=Array(p.size);return p.forEach(function(C,N){m[++v]=[N,C]}),m}function ga(p,v){return function(m){return p(v(m))}}function Nt(p,v){for(var m=-1,C=p.length,N=0,Y=[];++m<C;){var ge=p[m];(ge===v||ge===J)&&(p[m]=J,Y[N++]=m)}return Y}function lr(p){var v=-1,m=Array(p.size);return p.forEach(function(C){m[++v]=C}),m}function Gc(p){var v=-1,m=Array(p.size);return p.forEach(function(C){m[++v]=[C,C]}),m}function Hc(p,v,m){for(var C=m-1,N=p.length;++C<N;)if(p[C]===v)return C;return-1}function Kc(p,v,m){for(var C=m+1;C--;)if(p[C]===v)return C;return C}function mn(p){return gn(p)?Jc(p):Pc(p)}function nt(p){return gn(p)?Yc(p):Oc(p)}function ma(p){for(var v=p.length;v--&&Wu.test(p.charAt(v)););return v}var zc=bi(Ac);function Jc(p){for(var v=vi.lastIndex=0;vi.test(p);)++v;return v}function Yc(p){return p.match(vi)||[]}function Zc(p){return p.match(mc)||[]}var Xc=function p(v){v=v==null?we:vn.defaults(we.Object(),v,vn.pick(we,wc));var m=v.Array,C=v.Date,N=v.Error,Y=v.Function,ge=v.Math,te=v.Object,Ii=v.RegExp,Qc=v.String,Je=v.TypeError,fr=m.prototype,Vc=Y.prototype,_n=te.prototype,hr=v["__core-js_shared__"],pr=Vc.toString,Q=_n.hasOwnProperty,el=0,va=function(){var e=/[^.]+$/.exec(hr&&hr.keys&&hr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),dr=_n.toString,tl=pr.call(te),nl=we._,rl=Ii("^"+pr.call(Q).replace(fi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gr=ea?v.Buffer:i,Ut=v.Symbol,mr=v.Uint8Array,_a=gr?gr.allocUnsafe:i,vr=ga(te.getPrototypeOf,te),wa=te.create,ya=_n.propertyIsEnumerable,_r=fr.splice,xa=Ut?Ut.isConcatSpreadable:i,Nn=Ut?Ut.iterator:i,Vt=Ut?Ut.toStringTag:i,wr=function(){try{var e=sn(te,"defineProperty");return e({},"",{}),e}catch{}}(),il=v.clearTimeout!==we.clearTimeout&&v.clearTimeout,sl=C&&C.now!==we.Date.now&&C.now,al=v.setTimeout!==we.setTimeout&&v.setTimeout,yr=ge.ceil,xr=ge.floor,Ri=te.getOwnPropertySymbols,ol=gr?gr.isBuffer:i,Sa=v.isFinite,ul=fr.join,cl=ga(te.keys,te),me=ge.max,xe=ge.min,ll=C.now,fl=v.parseInt,Aa=ge.random,hl=fr.reverse,Pi=sn(v,"DataView"),Un=sn(v,"Map"),Oi=sn(v,"Promise"),wn=sn(v,"Set"),Wn=sn(v,"WeakMap"),Dn=sn(te,"create"),Sr=Wn&&new Wn,yn={},pl=an(Pi),dl=an(Un),gl=an(Oi),ml=an(wn),vl=an(Wn),Ar=Ut?Ut.prototype:i,$n=Ar?Ar.valueOf:i,ba=Ar?Ar.toString:i;function o(e){if(le(e)&&!U(e)&&!(e instanceof q)){if(e instanceof Ye)return e;if(Q.call(e,"__wrapped__"))return Co(e)}return new Ye(e)}var xn=function(){function e(){}return function(t){if(!ce(t))return{};if(wa)return wa(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function br(){}function Ye(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}o.templateSettings={escape:Pu,evaluate:Ou,interpolate:Ls,variable:"",imports:{_:o}},o.prototype=br.prototype,o.prototype.constructor=o,Ye.prototype=xn(br.prototype),Ye.prototype.constructor=Ye;function q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=He,this.__views__=[]}function _l(){var e=new q(this.__wrapped__);return e.__actions__=Fe(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Fe(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Fe(this.__views__),e}function wl(){if(this.__filtered__){var e=new q(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function yl(){var e=this.__wrapped__.value(),t=this.__dir__,n=U(e),r=t<0,s=n?e.length:0,u=Lf(0,s,this.__views__),l=u.start,h=u.end,d=h-l,w=r?h:l-1,y=this.__iteratees__,x=y.length,E=0,T=xe(d,this.__takeCount__);if(!n||!r&&s==d&&T==d)return Ja(e,this.__actions__);var L=[];e:for(;d--&&E<T;){w+=t;for(var $=-1,M=e[w];++$<x;){var j=y[$],H=j.iteratee,Be=j.type,Ce=H(M);if(Be==er)M=Ce;else if(!Ce){if(Be==Vn)continue e;break e}}L[E++]=M}return L}q.prototype=xn(br.prototype),q.prototype.constructor=q;function en(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function xl(){this.__data__=Dn?Dn(null):{},this.size=0}function Sl(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Al(e){var t=this.__data__;if(Dn){var n=t[e];return n===I?i:n}return Q.call(t,e)?t[e]:i}function bl(e){var t=this.__data__;return Dn?t[e]!==i:Q.call(t,e)}function El(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Dn&&t===i?I:t,this}en.prototype.clear=xl,en.prototype.delete=Sl,en.prototype.get=Al,en.prototype.has=bl,en.prototype.set=El;function pt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Cl(){this.__data__=[],this.size=0}function Tl(e){var t=this.__data__,n=Er(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():_r.call(t,n,1),--this.size,!0}function Fl(e){var t=this.__data__,n=Er(t,e);return n<0?i:t[n][1]}function Il(e){return Er(this.__data__,e)>-1}function Rl(e,t){var n=this.__data__,r=Er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}pt.prototype.clear=Cl,pt.prototype.delete=Tl,pt.prototype.get=Fl,pt.prototype.has=Il,pt.prototype.set=Rl;function dt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pl(){this.size=0,this.__data__={hash:new en,map:new(Un||pt),string:new en}}function Ol(e){var t=Wr(this,e).delete(e);return this.size-=t?1:0,t}function Ll(e){return Wr(this,e).get(e)}function Ml(e){return Wr(this,e).has(e)}function Nl(e,t){var n=Wr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}dt.prototype.clear=Pl,dt.prototype.delete=Ol,dt.prototype.get=Ll,dt.prototype.has=Ml,dt.prototype.set=Nl;function tn(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new dt;++t<n;)this.add(e[t])}function Ul(e){return this.__data__.set(e,I),this}function Wl(e){return this.__data__.has(e)}tn.prototype.add=tn.prototype.push=Ul,tn.prototype.has=Wl;function rt(e){var t=this.__data__=new pt(e);this.size=t.size}function Dl(){this.__data__=new pt,this.size=0}function $l(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Bl(e){return this.__data__.get(e)}function kl(e){return this.__data__.has(e)}function jl(e,t){var n=this.__data__;if(n instanceof pt){var r=n.__data__;if(!Un||r.length<g-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new dt(r)}return n.set(e,t),this.size=n.size,this}rt.prototype.clear=Dl,rt.prototype.delete=$l,rt.prototype.get=Bl,rt.prototype.has=kl,rt.prototype.set=jl;function Ea(e,t){var n=U(e),r=!n&&on(e),s=!n&&!r&&kt(e),u=!n&&!r&&!s&&En(e),l=n||r||s||u,h=l?Ci(e.length,Qc):[],d=h.length;for(var w in e)(t||Q.call(e,w))&&!(l&&(w=="length"||s&&(w=="offset"||w=="parent")||u&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||_t(w,d)))&&h.push(w);return h}function Ca(e){var t=e.length;return t?e[qi(0,t-1)]:i}function ql(e,t){return Dr(Fe(e),nn(t,0,e.length))}function Gl(e){return Dr(Fe(e))}function Li(e,t,n){(n!==i&&!it(e[t],n)||n===i&&!(t in e))&>(e,t,n)}function Bn(e,t,n){var r=e[t];(!(Q.call(e,t)&&it(r,n))||n===i&&!(t in e))&>(e,t,n)}function Er(e,t){for(var n=e.length;n--;)if(it(e[n][0],t))return n;return-1}function Hl(e,t,n,r){return Wt(e,function(s,u,l){t(r,s,n(s),l)}),r}function Ta(e,t){return e&&ct(t,_e(t),e)}function Kl(e,t){return e&&ct(t,Re(t),e)}function gt(e,t,n){t=="__proto__"&&wr?wr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Mi(e,t){for(var n=-1,r=t.length,s=m(r),u=e==null;++n<r;)s[n]=u?i:ds(e,t[n]);return s}function nn(e,t,n){return e===e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function Ze(e,t,n,r,s,u){var l,h=t&G,d=t&K,w=t&k;if(n&&(l=s?n(e,r,s,u):n(e)),l!==i)return l;if(!ce(e))return e;var y=U(e);if(y){if(l=Nf(e),!h)return Fe(e,l)}else{var x=Se(e),E=x==fn||x==nr;if(kt(e))return Xa(e,h);if(x==tt||x==It||E&&!s){if(l=d||E?{}:vo(e),!h)return d?bf(e,Kl(l,e)):Af(e,Ta(l,e))}else{if(!re[x])return s?e:{};l=Uf(e,x,h)}}u||(u=new rt);var T=u.get(e);if(T)return T;u.set(e,l),Ko(e)?e.forEach(function(M){l.add(Ze(M,t,n,M,e,u))}):Go(e)&&e.forEach(function(M,j){l.set(j,Ze(M,t,n,j,e,u))});var L=w?d?es:Vi:d?Re:_e,$=y?i:L(e);return ze($||e,function(M,j){$&&(j=M,M=e[j]),Bn(l,j,Ze(M,t,n,j,e,u))}),l}function zl(e){var t=_e(e);return function(n){return Fa(n,e,t)}}function Fa(e,t,n){var r=n.length;if(e==null)return!r;for(e=te(e);r--;){var s=n[r],u=t[s],l=e[s];if(l===i&&!(s in e)||!u(l))return!1}return!0}function Ia(e,t,n){if(typeof e!="function")throw new Je(S);return zn(function(){e.apply(i,n)},t)}function kn(e,t,n,r){var s=-1,u=ur,l=!0,h=e.length,d=[],w=t.length;if(!h)return d;n&&(t=oe(t,We(n))),r?(u=yi,l=!1):t.length>=g&&(u=Mn,l=!1,t=new tn(t));e:for(;++s<h;){var y=e[s],x=n==null?y:n(y);if(y=r||y!==0?y:0,l&&x===x){for(var E=w;E--;)if(t[E]===x)continue e;d.push(y)}else u(t,x,r)||d.push(y)}return d}var Wt=no(ut),Ra=no(Ui,!0);function Jl(e,t){var n=!0;return Wt(e,function(r,s,u){return n=!!t(r,s,u),n}),n}function Cr(e,t,n){for(var r=-1,s=e.length;++r<s;){var u=e[r],l=t(u);if(l!=null&&(h===i?l===l&&!$e(l):n(l,h)))var h=l,d=u}return d}function Yl(e,t,n,r){var s=e.length;for(n=D(n),n<0&&(n=-n>s?0:s+n),r=r===i||r>s?s:D(r),r<0&&(r+=s),r=n>r?0:Jo(r);n<r;)e[n++]=t;return e}function Pa(e,t){var n=[];return Wt(e,function(r,s,u){t(r,s,u)&&n.push(r)}),n}function ye(e,t,n,r,s){var u=-1,l=e.length;for(n||(n=Df),s||(s=[]);++u<l;){var h=e[u];t>0&&n(h)?t>1?ye(h,t-1,n,r,s):Mt(s,h):r||(s[s.length]=h)}return s}var Ni=ro(),Oa=ro(!0);function ut(e,t){return e&&Ni(e,t,_e)}function Ui(e,t){return e&&Oa(e,t,_e)}function Tr(e,t){return Lt(t,function(n){return wt(e[n])})}function rn(e,t){t=$t(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[lt(t[n++])];return n&&n==r?e:i}function La(e,t,n){var r=t(e);return U(e)?r:Mt(r,n(e))}function be(e){return e==null?e===i?ai:si:Vt&&Vt in te(e)?Of(e):Hf(e)}function Wi(e,t){return e>t}function Zl(e,t){return e!=null&&Q.call(e,t)}function Xl(e,t){return e!=null&&t in te(e)}function Ql(e,t,n){return e>=xe(t,n)&&e<me(t,n)}function Di(e,t,n){for(var r=n?yi:ur,s=e[0].length,u=e.length,l=u,h=m(u),d=1/0,w=[];l--;){var y=e[l];l&&t&&(y=oe(y,We(t))),d=xe(y.length,d),h[l]=!n&&(t||s>=120&&y.length>=120)?new tn(l&&y):i}y=e[0];var x=-1,E=h[0];e:for(;++x<s&&w.length<d;){var T=y[x],L=t?t(T):T;if(T=n||T!==0?T:0,!(E?Mn(E,L):r(w,L,n))){for(l=u;--l;){var $=h[l];if(!($?Mn($,L):r(e[l],L,n)))continue e}E&&E.push(L),w.push(T)}}return w}function Vl(e,t,n,r){return ut(e,function(s,u,l){t(r,n(s),u,l)}),r}function jn(e,t,n){t=$t(t,e),e=xo(e,t);var r=e==null?e:e[lt(Qe(t))];return r==null?i:Ue(r,e,n)}function Ma(e){return le(e)&&be(e)==It}function ef(e){return le(e)&&be(e)==Zt}function tf(e){return le(e)&&be(e)==zt}function qn(e,t,n,r,s){return e===t?!0:e==null||t==null||!le(e)&&!le(t)?e!==e&&t!==t:nf(e,t,n,r,qn,s)}function nf(e,t,n,r,s,u){var l=U(e),h=U(t),d=l?cn:Se(e),w=h?cn:Se(t);d=d==It?tt:d,w=w==It?tt:w;var y=d==tt,x=w==tt,E=d==w;if(E&&kt(e)){if(!kt(t))return!1;l=!0,y=!1}if(E&&!y)return u||(u=new rt),l||En(e)?po(e,t,n,r,s,u):Rf(e,t,d,n,r,s,u);if(!(n&ue)){var T=y&&Q.call(e,"__wrapped__"),L=x&&Q.call(t,"__wrapped__");if(T||L){var $=T?e.value():e,M=L?t.value():t;return u||(u=new rt),s($,M,n,r,u)}}return E?(u||(u=new rt),Pf(e,t,n,r,s,u)):!1}function rf(e){return le(e)&&Se(e)==Me}function $i(e,t,n,r){var s=n.length,u=s,l=!r;if(e==null)return!u;for(e=te(e);s--;){var h=n[s];if(l&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++s<u;){h=n[s];var d=h[0],w=e[d],y=h[1];if(l&&h[2]){if(w===i&&!(d in e))return!1}else{var x=new rt;if(r)var E=r(w,y,d,e,t,x);if(!(E===i?qn(y,w,ue|Oe,r,x):E))return!1}}return!0}function Na(e){if(!ce(e)||Bf(e))return!1;var t=wt(e)?rl:zu;return t.test(an(e))}function sf(e){return le(e)&&be(e)==Rt}function af(e){return le(e)&&Se(e)==Ne}function of(e){return le(e)&&Gr(e.length)&&!!ae[be(e)]}function Ua(e){return typeof e=="function"?e:e==null?Pe:typeof e=="object"?U(e)?$a(e[0],e[1]):Da(e):su(e)}function Bi(e){if(!Kn(e))return cl(e);var t=[];for(var n in te(e))Q.call(e,n)&&n!="constructor"&&t.push(n);return t}function uf(e){if(!ce(e))return Gf(e);var t=Kn(e),n=[];for(var r in e)r=="constructor"&&(t||!Q.call(e,r))||n.push(r);return n}function ki(e,t){return e<t}function Wa(e,t){var n=-1,r=Ie(e)?m(e.length):[];return Wt(e,function(s,u,l){r[++n]=t(s,u,l)}),r}function Da(e){var t=ns(e);return t.length==1&&t[0][2]?wo(t[0][0],t[0][1]):function(n){return n===e||$i(n,e,t)}}function $a(e,t){return is(e)&&_o(t)?wo(lt(e),t):function(n){var r=ds(n,e);return r===i&&r===t?gs(n,e):qn(t,r,ue|Oe)}}function Fr(e,t,n,r,s){e!==t&&Ni(t,function(u,l){if(s||(s=new rt),ce(u))cf(e,t,l,n,Fr,r,s);else{var h=r?r(as(e,l),u,l+"",e,t,s):i;h===i&&(h=u),Li(e,l,h)}},Re)}function cf(e,t,n,r,s,u,l){var h=as(e,n),d=as(t,n),w=l.get(d);if(w){Li(e,n,w);return}var y=u?u(h,d,n+"",e,t,l):i,x=y===i;if(x){var E=U(d),T=!E&&kt(d),L=!E&&!T&&En(d);y=d,E||T||L?U(h)?y=h:fe(h)?y=Fe(h):T?(x=!1,y=Xa(d,!0)):L?(x=!1,y=Qa(d,!0)):y=[]:Jn(d)||on(d)?(y=h,on(h)?y=Yo(h):(!ce(h)||wt(h))&&(y=vo(d))):x=!1}x&&(l.set(d,y),s(y,d,r,u,l),l.delete(d)),Li(e,n,y)}function Ba(e,t){var n=e.length;if(n)return t+=t<0?n:0,_t(t,n)?e[t]:i}function ka(e,t,n){t.length?t=oe(t,function(u){return U(u)?function(l){return rn(l,u.length===1?u[0]:u)}:u}):t=[Pe];var r=-1;t=oe(t,We(R()));var s=Wa(e,function(u,l,h){var d=oe(t,function(w){return w(u)});return{criteria:d,index:++r,value:u}});return Nc(s,function(u,l){return Sf(u,l,n)})}function lf(e,t){return ja(e,t,function(n,r){return gs(e,r)})}function ja(e,t,n){for(var r=-1,s=t.length,u={};++r<s;){var l=t[r],h=rn(e,l);n(h,l)&&Gn(u,$t(l,e),h)}return u}function ff(e){return function(t){return rn(t,e)}}function ji(e,t,n,r){var s=r?Mc:dn,u=-1,l=t.length,h=e;for(e===t&&(t=Fe(t)),n&&(h=oe(e,We(n)));++u<l;)for(var d=0,w=t[u],y=n?n(w):w;(d=s(h,y,d,r))>-1;)h!==e&&_r.call(h,d,1),_r.call(e,d,1);return e}function qa(e,t){for(var n=e?t.length:0,r=n-1;n--;){var s=t[n];if(n==r||s!==u){var u=s;_t(s)?_r.call(e,s,1):Ki(e,s)}}return e}function qi(e,t){return e+xr(Aa()*(t-e+1))}function hf(e,t,n,r){for(var s=-1,u=me(yr((t-e)/(n||1)),0),l=m(u);u--;)l[r?u:++s]=e,e+=n;return l}function Gi(e,t){var n="";if(!e||t<1||t>et)return n;do t%2&&(n+=e),t=xr(t/2),t&&(e+=e);while(t);return n}function B(e,t){return os(yo(e,t,Pe),e+"")}function pf(e){return Ca(Cn(e))}function df(e,t){var n=Cn(e);return Dr(n,nn(t,0,n.length))}function Gn(e,t,n,r){if(!ce(e))return e;t=$t(t,e);for(var s=-1,u=t.length,l=u-1,h=e;h!=null&&++s<u;){var d=lt(t[s]),w=n;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(s!=l){var y=h[d];w=r?r(y,d,h):i,w===i&&(w=ce(y)?y:_t(t[s+1])?[]:{})}Bn(h,d,w),h=h[d]}return e}var Ga=Sr?function(e,t){return Sr.set(e,t),e}:Pe,gf=wr?function(e,t){return wr(e,"toString",{configurable:!0,enumerable:!1,value:vs(t),writable:!0})}:Pe;function mf(e){return Dr(Cn(e))}function Xe(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),n=n>s?s:n,n<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var u=m(s);++r<s;)u[r]=e[r+t];return u}function vf(e,t){var n;return Wt(e,function(r,s,u){return n=t(r,s,u),!n}),!!n}function Ir(e,t,n){var r=0,s=e==null?r:e.length;if(typeof t=="number"&&t===t&&s<=ti){for(;r<s;){var u=r+s>>>1,l=e[u];l!==null&&!$e(l)&&(n?l<=t:l<t)?r=u+1:s=u}return s}return Hi(e,t,Pe,n)}function Hi(e,t,n,r){var s=0,u=e==null?0:e.length;if(u===0)return 0;t=n(t);for(var l=t!==t,h=t===null,d=$e(t),w=t===i;s<u;){var y=xr((s+u)/2),x=n(e[y]),E=x!==i,T=x===null,L=x===x,$=$e(x);if(l)var M=r||L;else w?M=L&&(r||E):h?M=L&&E&&(r||!T):d?M=L&&E&&!T&&(r||!$):T||$?M=!1:M=r?x<=t:x<t;M?s=y+1:u=y}return xe(u,ei)}function Ha(e,t){for(var n=-1,r=e.length,s=0,u=[];++n<r;){var l=e[n],h=t?t(l):l;if(!n||!it(h,d)){var d=h;u[s++]=l===0?0:l}}return u}function Ka(e){return typeof e=="number"?e:$e(e)?un:+e}function De(e){if(typeof e=="string")return e;if(U(e))return oe(e,De)+"";if($e(e))return ba?ba.call(e):"";var t=e+"";return t=="0"&&1/e==-at?"-0":t}function Dt(e,t,n){var r=-1,s=ur,u=e.length,l=!0,h=[],d=h;if(n)l=!1,s=yi;else if(u>=g){var w=t?null:Ff(e);if(w)return lr(w);l=!1,s=Mn,d=new tn}else d=t?[]:h;e:for(;++r<u;){var y=e[r],x=t?t(y):y;if(y=n||y!==0?y:0,l&&x===x){for(var E=d.length;E--;)if(d[E]===x)continue e;t&&d.push(x),h.push(y)}else s(d,x,n)||(d!==h&&d.push(x),h.push(y))}return h}function Ki(e,t){return t=$t(t,e),e=xo(e,t),e==null||delete e[lt(Qe(t))]}function za(e,t,n,r){return Gn(e,t,n(rn(e,t)),r)}function Rr(e,t,n,r){for(var s=e.length,u=r?s:-1;(r?u--:++u<s)&&t(e[u],u,e););return n?Xe(e,r?0:u,r?u+1:s):Xe(e,r?u+1:0,r?s:u)}function Ja(e,t){var n=e;return n instanceof q&&(n=n.value()),xi(t,function(r,s){return s.func.apply(s.thisArg,Mt([r],s.args))},n)}function zi(e,t,n){var r=e.length;if(r<2)return r?Dt(e[0]):[];for(var s=-1,u=m(r);++s<r;)for(var l=e[s],h=-1;++h<r;)h!=s&&(u[s]=kn(u[s]||l,e[h],t,n));return Dt(ye(u,1),t,n)}function Ya(e,t,n){for(var r=-1,s=e.length,u=t.length,l={};++r<s;){var h=r<u?t[r]:i;n(l,e[r],h)}return l}function Ji(e){return fe(e)?e:[]}function Yi(e){return typeof e=="function"?e:Pe}function $t(e,t){return U(e)?e:is(e,t)?[e]:Eo(X(e))}var _f=B;function Bt(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:Xe(e,t,n)}var Za=il||function(e){return we.clearTimeout(e)};function Xa(e,t){if(t)return e.slice();var n=e.length,r=_a?_a(n):new e.constructor(n);return e.copy(r),r}function Zi(e){var t=new e.constructor(e.byteLength);return new mr(t).set(new mr(e)),t}function wf(e,t){var n=t?Zi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function yf(e){var t=new e.constructor(e.source,Ms.exec(e));return t.lastIndex=e.lastIndex,t}function xf(e){return $n?te($n.call(e)):{}}function Qa(e,t){var n=t?Zi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Va(e,t){if(e!==t){var n=e!==i,r=e===null,s=e===e,u=$e(e),l=t!==i,h=t===null,d=t===t,w=$e(t);if(!h&&!w&&!u&&e>t||u&&l&&d&&!h&&!w||r&&l&&d||!n&&d||!s)return 1;if(!r&&!u&&!w&&e<t||w&&n&&s&&!r&&!u||h&&n&&s||!l&&s||!d)return-1}return 0}function Sf(e,t,n){for(var r=-1,s=e.criteria,u=t.criteria,l=s.length,h=n.length;++r<l;){var d=Va(s[r],u[r]);if(d){if(r>=h)return d;var w=n[r];return d*(w=="desc"?-1:1)}}return e.index-t.index}function eo(e,t,n,r){for(var s=-1,u=e.length,l=n.length,h=-1,d=t.length,w=me(u-l,0),y=m(d+w),x=!r;++h<d;)y[h]=t[h];for(;++s<l;)(x||s<u)&&(y[n[s]]=e[s]);for(;w--;)y[h++]=e[s++];return y}function to(e,t,n,r){for(var s=-1,u=e.length,l=-1,h=n.length,d=-1,w=t.length,y=me(u-h,0),x=m(y+w),E=!r;++s<y;)x[s]=e[s];for(var T=s;++d<w;)x[T+d]=t[d];for(;++l<h;)(E||s<u)&&(x[T+n[l]]=e[s++]);return x}function Fe(e,t){var n=-1,r=e.length;for(t||(t=m(r));++n<r;)t[n]=e[n];return t}function ct(e,t,n,r){var s=!n;n||(n={});for(var u=-1,l=t.length;++u<l;){var h=t[u],d=r?r(n[h],e[h],h,n,e):i;d===i&&(d=e[h]),s?gt(n,h,d):Bn(n,h,d)}return n}function Af(e,t){return ct(e,rs(e),t)}function bf(e,t){return ct(e,go(e),t)}function Pr(e,t){return function(n,r){var s=U(n)?Fc:Hl,u=t?t():{};return s(n,e,R(r,2),u)}}function Sn(e){return B(function(t,n){var r=-1,s=n.length,u=s>1?n[s-1]:i,l=s>2?n[2]:i;for(u=e.length>3&&typeof u=="function"?(s--,u):i,l&&Ee(n[0],n[1],l)&&(u=s<3?i:u,s=1),t=te(t);++r<s;){var h=n[r];h&&e(t,h,r,u)}return t})}function no(e,t){return function(n,r){if(n==null)return n;if(!Ie(n))return e(n,r);for(var s=n.length,u=t?s:-1,l=te(n);(t?u--:++u<s)&&r(l[u],u,l)!==!1;);return n}}function ro(e){return function(t,n,r){for(var s=-1,u=te(t),l=r(t),h=l.length;h--;){var d=l[e?h:++s];if(n(u[d],d,u)===!1)break}return t}}function Ef(e,t,n){var r=t&pe,s=Hn(e);function u(){var l=this&&this!==we&&this instanceof u?s:e;return l.apply(r?n:this,arguments)}return u}function io(e){return function(t){t=X(t);var n=gn(t)?nt(t):i,r=n?n[0]:t.charAt(0),s=n?Bt(n,1).join(""):t.slice(1);return r[e]()+s}}function An(e){return function(t){return xi(ru(nu(t).replace(dc,"")),e,"")}}function Hn(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=xn(e.prototype),r=e.apply(n,t);return ce(r)?r:n}}function Cf(e,t,n){var r=Hn(e);function s(){for(var u=arguments.length,l=m(u),h=u,d=bn(s);h--;)l[h]=arguments[h];var w=u<3&&l[0]!==d&&l[u-1]!==d?[]:Nt(l,d);if(u-=w.length,u<n)return co(e,t,Or,s.placeholder,i,l,w,i,i,n-u);var y=this&&this!==we&&this instanceof s?r:e;return Ue(y,this,l)}return s}function so(e){return function(t,n,r){var s=te(t);if(!Ie(t)){var u=R(n,3);t=_e(t),n=function(h){return u(s[h],h,s)}}var l=e(t,n,r);return l>-1?s[u?t[l]:l]:i}}function ao(e){return vt(function(t){var n=t.length,r=n,s=Ye.prototype.thru;for(e&&t.reverse();r--;){var u=t[r];if(typeof u!="function")throw new Je(S);if(s&&!l&&Ur(u)=="wrapper")var l=new Ye([],!0)}for(r=l?r:n;++r<n;){u=t[r];var h=Ur(u),d=h=="wrapper"?ts(u):i;d&&ss(d[0])&&d[1]==(se|Te|Z|qe)&&!d[4].length&&d[9]==1?l=l[Ur(d[0])].apply(l,d[3]):l=u.length==1&&ss(u)?l[h]():l.thru(u)}return function(){var w=arguments,y=w[0];if(l&&w.length==1&&U(y))return l.plant(y).value();for(var x=0,E=n?t[x].apply(this,w):y;++x<n;)E=t[x].call(this,E);return E}})}function Or(e,t,n,r,s,u,l,h,d,w){var y=t&se,x=t&pe,E=t&Le,T=t&(Te|F),L=t&ne,$=E?i:Hn(e);function M(){for(var j=arguments.length,H=m(j),Be=j;Be--;)H[Be]=arguments[Be];if(T)var Ce=bn(M),ke=Wc(H,Ce);if(r&&(H=eo(H,r,s,T)),u&&(H=to(H,u,l,T)),j-=ke,T&&j<w){var he=Nt(H,Ce);return co(e,t,Or,M.placeholder,n,H,he,h,d,w-j)}var st=x?n:this,xt=E?st[e]:e;return j=H.length,h?H=Kf(H,h):L&&j>1&&H.reverse(),y&&d<j&&(H.length=d),this&&this!==we&&this instanceof M&&(xt=$||Hn(xt)),xt.apply(st,H)}return M}function oo(e,t){return function(n,r){return Vl(n,e,t(r),{})}}function Lr(e,t){return function(n,r){var s;if(n===i&&r===i)return t;if(n!==i&&(s=n),r!==i){if(s===i)return r;typeof n=="string"||typeof r=="string"?(n=De(n),r=De(r)):(n=Ka(n),r=Ka(r)),s=e(n,r)}return s}}function Xi(e){return vt(function(t){return t=oe(t,We(R())),B(function(n){var r=this;return e(t,function(s){return Ue(s,r,n)})})})}function Mr(e,t){t=t===i?" ":De(t);var n=t.length;if(n<2)return n?Gi(t,e):t;var r=Gi(t,yr(e/mn(t)));return gn(t)?Bt(nt(r),0,e).join(""):r.slice(0,e)}function Tf(e,t,n,r){var s=t&pe,u=Hn(e);function l(){for(var h=-1,d=arguments.length,w=-1,y=r.length,x=m(y+d),E=this&&this!==we&&this instanceof l?u:e;++w<y;)x[w]=r[w];for(;d--;)x[w++]=arguments[++h];return Ue(E,s?n:this,x)}return l}function uo(e){return function(t,n,r){return r&&typeof r!="number"&&Ee(t,n,r)&&(n=r=i),t=yt(t),n===i?(n=t,t=0):n=yt(n),r=r===i?t<n?1:-1:yt(r),hf(t,n,r,e)}}function Nr(e){return function(t,n){return typeof t=="string"&&typeof n=="string"||(t=Ve(t),n=Ve(n)),e(t,n)}}function co(e,t,n,r,s,u,l,h,d,w){var y=t&Te,x=y?l:i,E=y?i:l,T=y?u:i,L=y?i:u;t|=y?Z:z,t&=~(y?z:Z),t&Tt||(t&=-4);var $=[e,t,s,T,x,L,E,h,d,w],M=n.apply(i,$);return ss(e)&&So(M,$),M.placeholder=r,Ao(M,e,t)}function Qi(e){var t=ge[e];return function(n,r){if(n=Ve(n),r=r==null?0:xe(D(r),292),r&&Sa(n)){var s=(X(n)+"e").split("e"),u=t(s[0]+"e"+(+s[1]+r));return s=(X(u)+"e").split("e"),+(s[0]+"e"+(+s[1]-r))}return t(n)}}var Ff=wn&&1/lr(new wn([,-0]))[1]==at?function(e){return new wn(e)}:ys;function lo(e){return function(t){var n=Se(t);return n==Me?Fi(t):n==Ne?Gc(t):Uc(t,e(t))}}function mt(e,t,n,r,s,u,l,h){var d=t&Le;if(!d&&typeof e!="function")throw new Je(S);var w=r?r.length:0;if(w||(t&=-97,r=s=i),l=l===i?l:me(D(l),0),h=h===i?h:D(h),w-=s?s.length:0,t&z){var y=r,x=s;r=s=i}var E=d?i:ts(e),T=[e,t,n,r,s,y,x,u,l,h];if(E&&qf(T,E),e=T[0],t=T[1],n=T[2],r=T[3],s=T[4],h=T[9]=T[9]===i?d?0:e.length:me(T[9]-w,0),!h&&t&(Te|F)&&(t&=-25),!t||t==pe)var L=Ef(e,t,n);else t==Te||t==F?L=Cf(e,t,h):(t==Z||t==(pe|Z))&&!s.length?L=Tf(e,t,n,r):L=Or.apply(i,T);var $=E?Ga:So;return Ao($(L,T),e,t)}function fo(e,t,n,r){return e===i||it(e,_n[n])&&!Q.call(r,n)?t:e}function ho(e,t,n,r,s,u){return ce(e)&&ce(t)&&(u.set(t,e),Fr(e,t,i,ho,u),u.delete(t)),e}function If(e){return Jn(e)?i:e}function po(e,t,n,r,s,u){var l=n&ue,h=e.length,d=t.length;if(h!=d&&!(l&&d>h))return!1;var w=u.get(e),y=u.get(t);if(w&&y)return w==t&&y==e;var x=-1,E=!0,T=n&Oe?new tn:i;for(u.set(e,t),u.set(t,e);++x<h;){var L=e[x],$=t[x];if(r)var M=l?r($,L,x,t,e,u):r(L,$,x,e,t,u);if(M!==i){if(M)continue;E=!1;break}if(T){if(!Si(t,function(j,H){if(!Mn(T,H)&&(L===j||s(L,j,n,r,u)))return T.push(H)})){E=!1;break}}else if(!(L===$||s(L,$,n,r,u))){E=!1;break}}return u.delete(e),u.delete(t),E}function Rf(e,t,n,r,s,u,l){switch(n){case Ot:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Zt:return!(e.byteLength!=t.byteLength||!u(new mr(e),new mr(t)));case Kt:case zt:case Jt:return it(+e,+t);case ln:return e.name==t.name&&e.message==t.message;case Rt:case Yt:return e==t+"";case Me:var h=Fi;case Ne:var d=r&ue;if(h||(h=lr),e.size!=t.size&&!d)return!1;var w=l.get(e);if(w)return w==t;r|=Oe,l.set(e,t);var y=po(h(e),h(t),r,s,u,l);return l.delete(e),y;case hn:if($n)return $n.call(e)==$n.call(t)}return!1}function Pf(e,t,n,r,s,u){var l=n&ue,h=Vi(e),d=h.length,w=Vi(t),y=w.length;if(d!=y&&!l)return!1;for(var x=d;x--;){var E=h[x];if(!(l?E in t:Q.call(t,E)))return!1}var T=u.get(e),L=u.get(t);if(T&&L)return T==t&&L==e;var $=!0;u.set(e,t),u.set(t,e);for(var M=l;++x<d;){E=h[x];var j=e[E],H=t[E];if(r)var Be=l?r(H,j,E,t,e,u):r(j,H,E,e,t,u);if(!(Be===i?j===H||s(j,H,n,r,u):Be)){$=!1;break}M||(M=E=="constructor")}if($&&!M){var Ce=e.constructor,ke=t.constructor;Ce!=ke&&"constructor"in e&&"constructor"in t&&!(typeof Ce=="function"&&Ce instanceof Ce&&typeof ke=="function"&&ke instanceof ke)&&($=!1)}return u.delete(e),u.delete(t),$}function vt(e){return os(yo(e,i,Io),e+"")}function Vi(e){return La(e,_e,rs)}function es(e){return La(e,Re,go)}var ts=Sr?function(e){return Sr.get(e)}:ys;function Ur(e){for(var t=e.name+"",n=yn[t],r=Q.call(yn,t)?n.length:0;r--;){var s=n[r],u=s.func;if(u==null||u==e)return s.name}return t}function bn(e){var t=Q.call(o,"placeholder")?o:e;return t.placeholder}function R(){var e=o.iteratee||_s;return e=e===_s?Ua:e,arguments.length?e(arguments[0],arguments[1]):e}function Wr(e,t){var n=e.__data__;return $f(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ns(e){for(var t=_e(e),n=t.length;n--;){var r=t[n],s=e[r];t[n]=[r,s,_o(s)]}return t}function sn(e,t){var n=kc(e,t);return Na(n)?n:i}function Of(e){var t=Q.call(e,Vt),n=e[Vt];try{e[Vt]=i;var r=!0}catch{}var s=dr.call(e);return r&&(t?e[Vt]=n:delete e[Vt]),s}var rs=Ri?function(e){return e==null?[]:(e=te(e),Lt(Ri(e),function(t){return ya.call(e,t)}))}:xs,go=Ri?function(e){for(var t=[];e;)Mt(t,rs(e)),e=vr(e);return t}:xs,Se=be;(Pi&&Se(new Pi(new ArrayBuffer(1)))!=Ot||Un&&Se(new Un)!=Me||Oi&&Se(Oi.resolve())!=On||wn&&Se(new wn)!=Ne||Wn&&Se(new Wn)!=Pt)&&(Se=function(e){var t=be(e),n=t==tt?e.constructor:i,r=n?an(n):"";if(r)switch(r){case pl:return Ot;case dl:return Me;case gl:return On;case ml:return Ne;case vl:return Pt}return t});function Lf(e,t,n){for(var r=-1,s=n.length;++r<s;){var u=n[r],l=u.size;switch(u.type){case"drop":e+=l;break;case"dropRight":t-=l;break;case"take":t=xe(t,e+l);break;case"takeRight":e=me(e,t-l);break}}return{start:e,end:t}}function Mf(e){var t=e.match($u);return t?t[1].split(Bu):[]}function mo(e,t,n){t=$t(t,e);for(var r=-1,s=t.length,u=!1;++r<s;){var l=lt(t[r]);if(!(u=e!=null&&n(e,l)))break;e=e[l]}return u||++r!=s?u:(s=e==null?0:e.length,!!s&&Gr(s)&&_t(l,s)&&(U(e)||on(e)))}function Nf(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Q.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function vo(e){return typeof e.constructor=="function"&&!Kn(e)?xn(vr(e)):{}}function Uf(e,t,n){var r=e.constructor;switch(t){case Zt:return Zi(e);case Kt:case zt:return new r(+e);case Ot:return wf(e,n);case O:case de:case ot:case ir:case Xt:case Ln:case ui:case ci:case li:return Qa(e,n);case Me:return new r;case Jt:case Yt:return new r(e);case Rt:return yf(e);case Ne:return new r;case hn:return xf(e)}}function Wf(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Du,`{
|
|
209
|
+
*/var av=Zn.exports,pu;function ov(){return pu||(pu=1,function(c,a){(function(){var i,f="4.17.21",g=200,_="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",S="Expected a function",A="Invalid `variable` option passed into `_.template`",I="__lodash_hash_undefined__",P=500,J="__lodash_placeholder__",G=1,K=2,k=4,ue=1,Le=2,de=1,Me=2,Et=4,Fe=8,F=16,Z=32,z=64,se=128,je=256,ne=512,Gt=30,Ge="...",ft=800,Ct=16,Qn=1,Vn=2,er=3,at=1/0,et=9007199254740991,Qr=17976931348623157e292,on=NaN,He=4294967295,Vr=He-1,ei=He>>>1,ti=[["ary",se],["bind",de],["bindKey",Me],["curry",Fe],["curryRight",F],["flip",ne],["partial",Z],["partialRight",z],["rearg",je]],Tt="[object Arguments]",un="[object Array]",ni="[object AsyncFunction]",Ht="[object Boolean]",Kt="[object Date]",ri="[object DOMException]",cn="[object Error]",ln="[object Function]",tr="[object GeneratorFunction]",Ne="[object Map]",zt="[object Number]",ii="[object Null]",tt="[object Object]",Pn="[object Promise]",nr="[object Proxy]",Ft="[object RegExp]",Ue="[object Set]",Jt="[object String]",fn="[object Symbol]",si="[object Undefined]",It="[object WeakMap]",ai="[object WeakSet]",Yt="[object ArrayBuffer]",Rt="[object DataView]",O="[object Float32Array]",ge="[object Float64Array]",ot="[object Int8Array]",rr="[object Int16Array]",Zt="[object Int32Array]",On="[object Uint8Array]",oi="[object Uint8ClampedArray]",ui="[object Uint16Array]",ci="[object Uint32Array]",Eu=/\b__p \+= '';/g,Cu=/\b(__p \+=) '' \+/g,Tu=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Rs=/&(?:amp|lt|gt|quot|#39);/g,Ps=/[&<>"']/g,Fu=RegExp(Rs.source),Iu=RegExp(Ps.source),Ru=/<%-([\s\S]+?)%>/g,Pu=/<%([\s\S]+?)%>/g,Os=/<%=([\s\S]+?)%>/g,Ou=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lu=/^\w*$/,Mu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,li=/[\\^$.*+?()[\]{}|]/g,Nu=RegExp(li.source),fi=/^\s+/,Uu=/\s/,Wu=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Du=/\{\n\/\* \[wrapped with (.+)\] \*/,$u=/,? & /,Bu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ku=/[()=,{}\[\]\/\s]/,qu=/\\(\\)?/g,ju=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ls=/\w*$/,Gu=/^[-+]0x[0-9a-f]+$/i,Hu=/^0b[01]+$/i,Ku=/^\[object .+?Constructor\]$/,zu=/^0o[0-7]+$/i,Ju=/^(?:0|[1-9]\d*)$/,Yu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ir=/($^)/,Zu=/['\n\r\u2028\u2029\\]/g,sr="\\ud800-\\udfff",Xu="\\u0300-\\u036f",Qu="\\ufe20-\\ufe2f",Vu="\\u20d0-\\u20ff",Ms=Xu+Qu+Vu,Ns="\\u2700-\\u27bf",Us="a-z\\xdf-\\xf6\\xf8-\\xff",ec="\\xac\\xb1\\xd7\\xf7",tc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nc="\\u2000-\\u206f",rc=" \\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",Ws="A-Z\\xc0-\\xd6\\xd8-\\xde",Ds="\\ufe0e\\ufe0f",$s=ec+tc+nc+rc,hi="['’]",ic="["+sr+"]",Bs="["+$s+"]",ar="["+Ms+"]",ks="\\d+",sc="["+Ns+"]",qs="["+Us+"]",js="[^"+sr+$s+ks+Ns+Us+Ws+"]",pi="\\ud83c[\\udffb-\\udfff]",ac="(?:"+ar+"|"+pi+")",Gs="[^"+sr+"]",di="(?:\\ud83c[\\udde6-\\uddff]){2}",gi="[\\ud800-\\udbff][\\udc00-\\udfff]",hn="["+Ws+"]",Hs="\\u200d",Ks="(?:"+qs+"|"+js+")",oc="(?:"+hn+"|"+js+")",zs="(?:"+hi+"(?:d|ll|m|re|s|t|ve))?",Js="(?:"+hi+"(?:D|LL|M|RE|S|T|VE))?",Ys=ac+"?",Zs="["+Ds+"]?",uc="(?:"+Hs+"(?:"+[Gs,di,gi].join("|")+")"+Zs+Ys+")*",cc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xs=Zs+Ys+uc,fc="(?:"+[sc,di,gi].join("|")+")"+Xs,hc="(?:"+[Gs+ar+"?",ar,di,gi,ic].join("|")+")",pc=RegExp(hi,"g"),dc=RegExp(ar,"g"),mi=RegExp(pi+"(?="+pi+")|"+hc+Xs,"g"),gc=RegExp([hn+"?"+qs+"+"+zs+"(?="+[Bs,hn,"$"].join("|")+")",oc+"+"+Js+"(?="+[Bs,hn+Ks,"$"].join("|")+")",hn+"?"+Ks+"+"+zs,hn+"+"+Js,lc,cc,ks,fc].join("|"),"g"),mc=RegExp("["+Hs+sr+Ms+Ds+"]"),vc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_c=["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"],wc=-1,ae={};ae[O]=ae[ge]=ae[ot]=ae[rr]=ae[Zt]=ae[On]=ae[oi]=ae[ui]=ae[ci]=!0,ae[Tt]=ae[un]=ae[Yt]=ae[Ht]=ae[Rt]=ae[Kt]=ae[cn]=ae[ln]=ae[Ne]=ae[zt]=ae[tt]=ae[Ft]=ae[Ue]=ae[Jt]=ae[It]=!1;var re={};re[Tt]=re[un]=re[Yt]=re[Rt]=re[Ht]=re[Kt]=re[O]=re[ge]=re[ot]=re[rr]=re[Zt]=re[Ne]=re[zt]=re[tt]=re[Ft]=re[Ue]=re[Jt]=re[fn]=re[On]=re[oi]=re[ui]=re[ci]=!0,re[cn]=re[ln]=re[It]=!1;var yc={À:"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"},xc={"&":"&","<":"<",">":">",'"':""","'":"'"},Sc={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ac={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},bc=parseFloat,Ec=parseInt,Qs=typeof kt=="object"&&kt&&kt.Object===Object&&kt,Cc=typeof self=="object"&&self&&self.Object===Object&&self,ye=Qs||Cc||Function("return this")(),vi=a&&!a.nodeType&&a,Xt=vi&&!0&&c&&!c.nodeType&&c,Vs=Xt&&Xt.exports===vi,_i=Vs&&Qs.process,Ke=function(){try{var p=Xt&&Xt.require&&Xt.require("util").types;return p||_i&&_i.binding&&_i.binding("util")}catch{}}(),ea=Ke&&Ke.isArrayBuffer,ta=Ke&&Ke.isDate,na=Ke&&Ke.isMap,ra=Ke&&Ke.isRegExp,ia=Ke&&Ke.isSet,sa=Ke&&Ke.isTypedArray;function We(p,v,m){switch(m.length){case 0:return p.call(v);case 1:return p.call(v,m[0]);case 2:return p.call(v,m[0],m[1]);case 3:return p.call(v,m[0],m[1],m[2])}return p.apply(v,m)}function Tc(p,v,m,C){for(var N=-1,Y=p==null?0:p.length;++N<Y;){var me=p[N];v(C,me,m(me),p)}return C}function ze(p,v){for(var m=-1,C=p==null?0:p.length;++m<C&&v(p[m],m,p)!==!1;);return p}function Fc(p,v){for(var m=p==null?0:p.length;m--&&v(p[m],m,p)!==!1;);return p}function aa(p,v){for(var m=-1,C=p==null?0:p.length;++m<C;)if(!v(p[m],m,p))return!1;return!0}function Pt(p,v){for(var m=-1,C=p==null?0:p.length,N=0,Y=[];++m<C;){var me=p[m];v(me,m,p)&&(Y[N++]=me)}return Y}function or(p,v){var m=p==null?0:p.length;return!!m&&pn(p,v,0)>-1}function wi(p,v,m){for(var C=-1,N=p==null?0:p.length;++C<N;)if(m(v,p[C]))return!0;return!1}function oe(p,v){for(var m=-1,C=p==null?0:p.length,N=Array(C);++m<C;)N[m]=v(p[m],m,p);return N}function Ot(p,v){for(var m=-1,C=v.length,N=p.length;++m<C;)p[N+m]=v[m];return p}function yi(p,v,m,C){var N=-1,Y=p==null?0:p.length;for(C&&Y&&(m=p[++N]);++N<Y;)m=v(m,p[N],N,p);return m}function Ic(p,v,m,C){var N=p==null?0:p.length;for(C&&N&&(m=p[--N]);N--;)m=v(m,p[N],N,p);return m}function xi(p,v){for(var m=-1,C=p==null?0:p.length;++m<C;)if(v(p[m],m,p))return!0;return!1}var Rc=Si("length");function Pc(p){return p.split("")}function Oc(p){return p.match(Bu)||[]}function oa(p,v,m){var C;return m(p,function(N,Y,me){if(v(N,Y,me))return C=Y,!1}),C}function ur(p,v,m,C){for(var N=p.length,Y=m+(C?1:-1);C?Y--:++Y<N;)if(v(p[Y],Y,p))return Y;return-1}function pn(p,v,m){return v===v?Gc(p,v,m):ur(p,ua,m)}function Lc(p,v,m,C){for(var N=m-1,Y=p.length;++N<Y;)if(C(p[N],v))return N;return-1}function ua(p){return p!==p}function ca(p,v){var m=p==null?0:p.length;return m?bi(p,v)/m:on}function Si(p){return function(v){return v==null?i:v[p]}}function Ai(p){return function(v){return p==null?i:p[v]}}function la(p,v,m,C,N){return N(p,function(Y,me,te){m=C?(C=!1,Y):v(m,Y,me,te)}),m}function Mc(p,v){var m=p.length;for(p.sort(v);m--;)p[m]=p[m].value;return p}function bi(p,v){for(var m,C=-1,N=p.length;++C<N;){var Y=v(p[C]);Y!==i&&(m=m===i?Y:m+Y)}return m}function Ei(p,v){for(var m=-1,C=Array(p);++m<p;)C[m]=v(m);return C}function Nc(p,v){return oe(v,function(m){return[m,p[m]]})}function fa(p){return p&&p.slice(0,ga(p)+1).replace(fi,"")}function De(p){return function(v){return p(v)}}function Ci(p,v){return oe(v,function(m){return p[m]})}function Ln(p,v){return p.has(v)}function ha(p,v){for(var m=-1,C=p.length;++m<C&&pn(v,p[m],0)>-1;);return m}function pa(p,v){for(var m=p.length;m--&&pn(v,p[m],0)>-1;);return m}function Uc(p,v){for(var m=p.length,C=0;m--;)p[m]===v&&++C;return C}var Wc=Ai(yc),Dc=Ai(xc);function $c(p){return"\\"+Ac[p]}function Bc(p,v){return p==null?i:p[v]}function dn(p){return mc.test(p)}function kc(p){return vc.test(p)}function qc(p){for(var v,m=[];!(v=p.next()).done;)m.push(v.value);return m}function Ti(p){var v=-1,m=Array(p.size);return p.forEach(function(C,N){m[++v]=[N,C]}),m}function da(p,v){return function(m){return p(v(m))}}function Lt(p,v){for(var m=-1,C=p.length,N=0,Y=[];++m<C;){var me=p[m];(me===v||me===J)&&(p[m]=J,Y[N++]=m)}return Y}function cr(p){var v=-1,m=Array(p.size);return p.forEach(function(C){m[++v]=C}),m}function jc(p){var v=-1,m=Array(p.size);return p.forEach(function(C){m[++v]=[C,C]}),m}function Gc(p,v,m){for(var C=m-1,N=p.length;++C<N;)if(p[C]===v)return C;return-1}function Hc(p,v,m){for(var C=m+1;C--;)if(p[C]===v)return C;return C}function gn(p){return dn(p)?zc(p):Rc(p)}function nt(p){return dn(p)?Jc(p):Pc(p)}function ga(p){for(var v=p.length;v--&&Uu.test(p.charAt(v)););return v}var Kc=Ai(Sc);function zc(p){for(var v=mi.lastIndex=0;mi.test(p);)++v;return v}function Jc(p){return p.match(mi)||[]}function Yc(p){return p.match(gc)||[]}var Zc=function p(v){v=v==null?ye:mn.defaults(ye.Object(),v,mn.pick(ye,_c));var m=v.Array,C=v.Date,N=v.Error,Y=v.Function,me=v.Math,te=v.Object,Fi=v.RegExp,Xc=v.String,Je=v.TypeError,lr=m.prototype,Qc=Y.prototype,vn=te.prototype,fr=v["__core-js_shared__"],hr=Qc.toString,Q=vn.hasOwnProperty,Vc=0,ma=function(){var e=/[^.]+$/.exec(fr&&fr.keys&&fr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),pr=vn.toString,el=hr.call(te),tl=ye._,nl=Fi("^"+hr.call(Q).replace(li,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dr=Vs?v.Buffer:i,Mt=v.Symbol,gr=v.Uint8Array,va=dr?dr.allocUnsafe:i,mr=da(te.getPrototypeOf,te),_a=te.create,wa=vn.propertyIsEnumerable,vr=lr.splice,ya=Mt?Mt.isConcatSpreadable:i,Mn=Mt?Mt.iterator:i,Qt=Mt?Mt.toStringTag:i,_r=function(){try{var e=rn(te,"defineProperty");return e({},"",{}),e}catch{}}(),rl=v.clearTimeout!==ye.clearTimeout&&v.clearTimeout,il=C&&C.now!==ye.Date.now&&C.now,sl=v.setTimeout!==ye.setTimeout&&v.setTimeout,wr=me.ceil,yr=me.floor,Ii=te.getOwnPropertySymbols,al=dr?dr.isBuffer:i,xa=v.isFinite,ol=lr.join,ul=da(te.keys,te),ve=me.max,Se=me.min,cl=C.now,ll=v.parseInt,Sa=me.random,fl=lr.reverse,Ri=rn(v,"DataView"),Nn=rn(v,"Map"),Pi=rn(v,"Promise"),_n=rn(v,"Set"),Un=rn(v,"WeakMap"),Wn=rn(te,"create"),xr=Un&&new Un,wn={},hl=sn(Ri),pl=sn(Nn),dl=sn(Pi),gl=sn(_n),ml=sn(Un),Sr=Mt?Mt.prototype:i,Dn=Sr?Sr.valueOf:i,Aa=Sr?Sr.toString:i;function o(e){if(fe(e)&&!U(e)&&!(e instanceof j)){if(e instanceof Ye)return e;if(Q.call(e,"__wrapped__"))return Eo(e)}return new Ye(e)}var yn=function(){function e(){}return function(t){if(!ce(t))return{};if(_a)return _a(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Ar(){}function Ye(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}o.templateSettings={escape:Ru,evaluate:Pu,interpolate:Os,variable:"",imports:{_:o}},o.prototype=Ar.prototype,o.prototype.constructor=o,Ye.prototype=yn(Ar.prototype),Ye.prototype.constructor=Ye;function j(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=He,this.__views__=[]}function vl(){var e=new j(this.__wrapped__);return e.__actions__=Ie(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ie(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ie(this.__views__),e}function _l(){if(this.__filtered__){var e=new j(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function wl(){var e=this.__wrapped__.value(),t=this.__dir__,n=U(e),r=t<0,s=n?e.length:0,u=Of(0,s,this.__views__),l=u.start,h=u.end,d=h-l,w=r?h:l-1,y=this.__iteratees__,x=y.length,E=0,T=Se(d,this.__takeCount__);if(!n||!r&&s==d&&T==d)return za(e,this.__actions__);var L=[];e:for(;d--&&E<T;){w+=t;for(var $=-1,M=e[w];++$<x;){var q=y[$],H=q.iteratee,ke=q.type,Te=H(M);if(ke==Vn)M=Te;else if(!Te){if(ke==Qn)continue e;break e}}L[E++]=M}return L}j.prototype=yn(Ar.prototype),j.prototype.constructor=j;function Vt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function yl(){this.__data__=Wn?Wn(null):{},this.size=0}function xl(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Sl(e){var t=this.__data__;if(Wn){var n=t[e];return n===I?i:n}return Q.call(t,e)?t[e]:i}function Al(e){var t=this.__data__;return Wn?t[e]!==i:Q.call(t,e)}function bl(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wn&&t===i?I:t,this}Vt.prototype.clear=yl,Vt.prototype.delete=xl,Vt.prototype.get=Sl,Vt.prototype.has=Al,Vt.prototype.set=bl;function ht(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function El(){this.__data__=[],this.size=0}function Cl(e){var t=this.__data__,n=br(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():vr.call(t,n,1),--this.size,!0}function Tl(e){var t=this.__data__,n=br(t,e);return n<0?i:t[n][1]}function Fl(e){return br(this.__data__,e)>-1}function Il(e,t){var n=this.__data__,r=br(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}ht.prototype.clear=El,ht.prototype.delete=Cl,ht.prototype.get=Tl,ht.prototype.has=Fl,ht.prototype.set=Il;function pt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Rl(){this.size=0,this.__data__={hash:new Vt,map:new(Nn||ht),string:new Vt}}function Pl(e){var t=Ur(this,e).delete(e);return this.size-=t?1:0,t}function Ol(e){return Ur(this,e).get(e)}function Ll(e){return Ur(this,e).has(e)}function Ml(e,t){var n=Ur(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}pt.prototype.clear=Rl,pt.prototype.delete=Pl,pt.prototype.get=Ol,pt.prototype.has=Ll,pt.prototype.set=Ml;function en(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new pt;++t<n;)this.add(e[t])}function Nl(e){return this.__data__.set(e,I),this}function Ul(e){return this.__data__.has(e)}en.prototype.add=en.prototype.push=Nl,en.prototype.has=Ul;function rt(e){var t=this.__data__=new ht(e);this.size=t.size}function Wl(){this.__data__=new ht,this.size=0}function Dl(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function $l(e){return this.__data__.get(e)}function Bl(e){return this.__data__.has(e)}function kl(e,t){var n=this.__data__;if(n instanceof ht){var r=n.__data__;if(!Nn||r.length<g-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new pt(r)}return n.set(e,t),this.size=n.size,this}rt.prototype.clear=Wl,rt.prototype.delete=Dl,rt.prototype.get=$l,rt.prototype.has=Bl,rt.prototype.set=kl;function ba(e,t){var n=U(e),r=!n&&an(e),s=!n&&!r&&$t(e),u=!n&&!r&&!s&&bn(e),l=n||r||s||u,h=l?Ei(e.length,Xc):[],d=h.length;for(var w in e)(t||Q.call(e,w))&&!(l&&(w=="length"||s&&(w=="offset"||w=="parent")||u&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||vt(w,d)))&&h.push(w);return h}function Ea(e){var t=e.length;return t?e[qi(0,t-1)]:i}function ql(e,t){return Wr(Ie(e),tn(t,0,e.length))}function jl(e){return Wr(Ie(e))}function Oi(e,t,n){(n!==i&&!it(e[t],n)||n===i&&!(t in e))&&dt(e,t,n)}function $n(e,t,n){var r=e[t];(!(Q.call(e,t)&&it(r,n))||n===i&&!(t in e))&&dt(e,t,n)}function br(e,t){for(var n=e.length;n--;)if(it(e[n][0],t))return n;return-1}function Gl(e,t,n,r){return Nt(e,function(s,u,l){t(r,s,n(s),l)}),r}function Ca(e,t){return e&&ct(t,we(t),e)}function Hl(e,t){return e&&ct(t,Pe(t),e)}function dt(e,t,n){t=="__proto__"&&_r?_r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Li(e,t){for(var n=-1,r=t.length,s=m(r),u=e==null;++n<r;)s[n]=u?i:ps(e,t[n]);return s}function tn(e,t,n){return e===e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function Ze(e,t,n,r,s,u){var l,h=t&G,d=t&K,w=t&k;if(n&&(l=s?n(e,r,s,u):n(e)),l!==i)return l;if(!ce(e))return e;var y=U(e);if(y){if(l=Mf(e),!h)return Ie(e,l)}else{var x=Ae(e),E=x==ln||x==tr;if($t(e))return Za(e,h);if(x==tt||x==Tt||E&&!s){if(l=d||E?{}:mo(e),!h)return d?Af(e,Hl(l,e)):Sf(e,Ca(l,e))}else{if(!re[x])return s?e:{};l=Nf(e,x,h)}}u||(u=new rt);var T=u.get(e);if(T)return T;u.set(e,l),Ho(e)?e.forEach(function(M){l.add(Ze(M,t,n,M,e,u))}):jo(e)&&e.forEach(function(M,q){l.set(q,Ze(M,t,n,q,e,u))});var L=w?d?Vi:Qi:d?Pe:we,$=y?i:L(e);return ze($||e,function(M,q){$&&(q=M,M=e[q]),$n(l,q,Ze(M,t,n,q,e,u))}),l}function Kl(e){var t=we(e);return function(n){return Ta(n,e,t)}}function Ta(e,t,n){var r=n.length;if(e==null)return!r;for(e=te(e);r--;){var s=n[r],u=t[s],l=e[s];if(l===i&&!(s in e)||!u(l))return!1}return!0}function Fa(e,t,n){if(typeof e!="function")throw new Je(S);return Kn(function(){e.apply(i,n)},t)}function Bn(e,t,n,r){var s=-1,u=or,l=!0,h=e.length,d=[],w=t.length;if(!h)return d;n&&(t=oe(t,De(n))),r?(u=wi,l=!1):t.length>=g&&(u=Ln,l=!1,t=new en(t));e:for(;++s<h;){var y=e[s],x=n==null?y:n(y);if(y=r||y!==0?y:0,l&&x===x){for(var E=w;E--;)if(t[E]===x)continue e;d.push(y)}else u(t,x,r)||d.push(y)}return d}var Nt=to(ut),Ia=to(Ni,!0);function zl(e,t){var n=!0;return Nt(e,function(r,s,u){return n=!!t(r,s,u),n}),n}function Er(e,t,n){for(var r=-1,s=e.length;++r<s;){var u=e[r],l=t(u);if(l!=null&&(h===i?l===l&&!Be(l):n(l,h)))var h=l,d=u}return d}function Jl(e,t,n,r){var s=e.length;for(n=D(n),n<0&&(n=-n>s?0:s+n),r=r===i||r>s?s:D(r),r<0&&(r+=s),r=n>r?0:zo(r);n<r;)e[n++]=t;return e}function Ra(e,t){var n=[];return Nt(e,function(r,s,u){t(r,s,u)&&n.push(r)}),n}function xe(e,t,n,r,s){var u=-1,l=e.length;for(n||(n=Wf),s||(s=[]);++u<l;){var h=e[u];t>0&&n(h)?t>1?xe(h,t-1,n,r,s):Ot(s,h):r||(s[s.length]=h)}return s}var Mi=no(),Pa=no(!0);function ut(e,t){return e&&Mi(e,t,we)}function Ni(e,t){return e&&Pa(e,t,we)}function Cr(e,t){return Pt(t,function(n){return _t(e[n])})}function nn(e,t){t=Wt(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[lt(t[n++])];return n&&n==r?e:i}function Oa(e,t,n){var r=t(e);return U(e)?r:Ot(r,n(e))}function Ee(e){return e==null?e===i?si:ii:Qt&&Qt in te(e)?Pf(e):Gf(e)}function Ui(e,t){return e>t}function Yl(e,t){return e!=null&&Q.call(e,t)}function Zl(e,t){return e!=null&&t in te(e)}function Xl(e,t,n){return e>=Se(t,n)&&e<ve(t,n)}function Wi(e,t,n){for(var r=n?wi:or,s=e[0].length,u=e.length,l=u,h=m(u),d=1/0,w=[];l--;){var y=e[l];l&&t&&(y=oe(y,De(t))),d=Se(y.length,d),h[l]=!n&&(t||s>=120&&y.length>=120)?new en(l&&y):i}y=e[0];var x=-1,E=h[0];e:for(;++x<s&&w.length<d;){var T=y[x],L=t?t(T):T;if(T=n||T!==0?T:0,!(E?Ln(E,L):r(w,L,n))){for(l=u;--l;){var $=h[l];if(!($?Ln($,L):r(e[l],L,n)))continue e}E&&E.push(L),w.push(T)}}return w}function Ql(e,t,n,r){return ut(e,function(s,u,l){t(r,n(s),u,l)}),r}function kn(e,t,n){t=Wt(t,e),e=yo(e,t);var r=e==null?e:e[lt(Qe(t))];return r==null?i:We(r,e,n)}function La(e){return fe(e)&&Ee(e)==Tt}function Vl(e){return fe(e)&&Ee(e)==Yt}function ef(e){return fe(e)&&Ee(e)==Kt}function qn(e,t,n,r,s){return e===t?!0:e==null||t==null||!fe(e)&&!fe(t)?e!==e&&t!==t:tf(e,t,n,r,qn,s)}function tf(e,t,n,r,s,u){var l=U(e),h=U(t),d=l?un:Ae(e),w=h?un:Ae(t);d=d==Tt?tt:d,w=w==Tt?tt:w;var y=d==tt,x=w==tt,E=d==w;if(E&&$t(e)){if(!$t(t))return!1;l=!0,y=!1}if(E&&!y)return u||(u=new rt),l||bn(e)?ho(e,t,n,r,s,u):If(e,t,d,n,r,s,u);if(!(n&ue)){var T=y&&Q.call(e,"__wrapped__"),L=x&&Q.call(t,"__wrapped__");if(T||L){var $=T?e.value():e,M=L?t.value():t;return u||(u=new rt),s($,M,n,r,u)}}return E?(u||(u=new rt),Rf(e,t,n,r,s,u)):!1}function nf(e){return fe(e)&&Ae(e)==Ne}function Di(e,t,n,r){var s=n.length,u=s,l=!r;if(e==null)return!u;for(e=te(e);s--;){var h=n[s];if(l&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++s<u;){h=n[s];var d=h[0],w=e[d],y=h[1];if(l&&h[2]){if(w===i&&!(d in e))return!1}else{var x=new rt;if(r)var E=r(w,y,d,e,t,x);if(!(E===i?qn(y,w,ue|Le,r,x):E))return!1}}return!0}function Ma(e){if(!ce(e)||$f(e))return!1;var t=_t(e)?nl:Ku;return t.test(sn(e))}function rf(e){return fe(e)&&Ee(e)==Ft}function sf(e){return fe(e)&&Ae(e)==Ue}function af(e){return fe(e)&&jr(e.length)&&!!ae[Ee(e)]}function Na(e){return typeof e=="function"?e:e==null?Oe:typeof e=="object"?U(e)?Da(e[0],e[1]):Wa(e):iu(e)}function $i(e){if(!Hn(e))return ul(e);var t=[];for(var n in te(e))Q.call(e,n)&&n!="constructor"&&t.push(n);return t}function of(e){if(!ce(e))return jf(e);var t=Hn(e),n=[];for(var r in e)r=="constructor"&&(t||!Q.call(e,r))||n.push(r);return n}function Bi(e,t){return e<t}function Ua(e,t){var n=-1,r=Re(e)?m(e.length):[];return Nt(e,function(s,u,l){r[++n]=t(s,u,l)}),r}function Wa(e){var t=ts(e);return t.length==1&&t[0][2]?_o(t[0][0],t[0][1]):function(n){return n===e||Di(n,e,t)}}function Da(e,t){return rs(e)&&vo(t)?_o(lt(e),t):function(n){var r=ps(n,e);return r===i&&r===t?ds(n,e):qn(t,r,ue|Le)}}function Tr(e,t,n,r,s){e!==t&&Mi(t,function(u,l){if(s||(s=new rt),ce(u))uf(e,t,l,n,Tr,r,s);else{var h=r?r(ss(e,l),u,l+"",e,t,s):i;h===i&&(h=u),Oi(e,l,h)}},Pe)}function uf(e,t,n,r,s,u,l){var h=ss(e,n),d=ss(t,n),w=l.get(d);if(w){Oi(e,n,w);return}var y=u?u(h,d,n+"",e,t,l):i,x=y===i;if(x){var E=U(d),T=!E&&$t(d),L=!E&&!T&&bn(d);y=d,E||T||L?U(h)?y=h:he(h)?y=Ie(h):T?(x=!1,y=Za(d,!0)):L?(x=!1,y=Xa(d,!0)):y=[]:zn(d)||an(d)?(y=h,an(h)?y=Jo(h):(!ce(h)||_t(h))&&(y=mo(d))):x=!1}x&&(l.set(d,y),s(y,d,r,u,l),l.delete(d)),Oi(e,n,y)}function $a(e,t){var n=e.length;if(n)return t+=t<0?n:0,vt(t,n)?e[t]:i}function Ba(e,t,n){t.length?t=oe(t,function(u){return U(u)?function(l){return nn(l,u.length===1?u[0]:u)}:u}):t=[Oe];var r=-1;t=oe(t,De(R()));var s=Ua(e,function(u,l,h){var d=oe(t,function(w){return w(u)});return{criteria:d,index:++r,value:u}});return Mc(s,function(u,l){return xf(u,l,n)})}function cf(e,t){return ka(e,t,function(n,r){return ds(e,r)})}function ka(e,t,n){for(var r=-1,s=t.length,u={};++r<s;){var l=t[r],h=nn(e,l);n(h,l)&&jn(u,Wt(l,e),h)}return u}function lf(e){return function(t){return nn(t,e)}}function ki(e,t,n,r){var s=r?Lc:pn,u=-1,l=t.length,h=e;for(e===t&&(t=Ie(t)),n&&(h=oe(e,De(n)));++u<l;)for(var d=0,w=t[u],y=n?n(w):w;(d=s(h,y,d,r))>-1;)h!==e&&vr.call(h,d,1),vr.call(e,d,1);return e}function qa(e,t){for(var n=e?t.length:0,r=n-1;n--;){var s=t[n];if(n==r||s!==u){var u=s;vt(s)?vr.call(e,s,1):Hi(e,s)}}return e}function qi(e,t){return e+yr(Sa()*(t-e+1))}function ff(e,t,n,r){for(var s=-1,u=ve(wr((t-e)/(n||1)),0),l=m(u);u--;)l[r?u:++s]=e,e+=n;return l}function ji(e,t){var n="";if(!e||t<1||t>et)return n;do t%2&&(n+=e),t=yr(t/2),t&&(e+=e);while(t);return n}function B(e,t){return as(wo(e,t,Oe),e+"")}function hf(e){return Ea(En(e))}function pf(e,t){var n=En(e);return Wr(n,tn(t,0,n.length))}function jn(e,t,n,r){if(!ce(e))return e;t=Wt(t,e);for(var s=-1,u=t.length,l=u-1,h=e;h!=null&&++s<u;){var d=lt(t[s]),w=n;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(s!=l){var y=h[d];w=r?r(y,d,h):i,w===i&&(w=ce(y)?y:vt(t[s+1])?[]:{})}$n(h,d,w),h=h[d]}return e}var ja=xr?function(e,t){return xr.set(e,t),e}:Oe,df=_r?function(e,t){return _r(e,"toString",{configurable:!0,enumerable:!1,value:ms(t),writable:!0})}:Oe;function gf(e){return Wr(En(e))}function Xe(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),n=n>s?s:n,n<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var u=m(s);++r<s;)u[r]=e[r+t];return u}function mf(e,t){var n;return Nt(e,function(r,s,u){return n=t(r,s,u),!n}),!!n}function Fr(e,t,n){var r=0,s=e==null?r:e.length;if(typeof t=="number"&&t===t&&s<=ei){for(;r<s;){var u=r+s>>>1,l=e[u];l!==null&&!Be(l)&&(n?l<=t:l<t)?r=u+1:s=u}return s}return Gi(e,t,Oe,n)}function Gi(e,t,n,r){var s=0,u=e==null?0:e.length;if(u===0)return 0;t=n(t);for(var l=t!==t,h=t===null,d=Be(t),w=t===i;s<u;){var y=yr((s+u)/2),x=n(e[y]),E=x!==i,T=x===null,L=x===x,$=Be(x);if(l)var M=r||L;else w?M=L&&(r||E):h?M=L&&E&&(r||!T):d?M=L&&E&&!T&&(r||!$):T||$?M=!1:M=r?x<=t:x<t;M?s=y+1:u=y}return Se(u,Vr)}function Ga(e,t){for(var n=-1,r=e.length,s=0,u=[];++n<r;){var l=e[n],h=t?t(l):l;if(!n||!it(h,d)){var d=h;u[s++]=l===0?0:l}}return u}function Ha(e){return typeof e=="number"?e:Be(e)?on:+e}function $e(e){if(typeof e=="string")return e;if(U(e))return oe(e,$e)+"";if(Be(e))return Aa?Aa.call(e):"";var t=e+"";return t=="0"&&1/e==-at?"-0":t}function Ut(e,t,n){var r=-1,s=or,u=e.length,l=!0,h=[],d=h;if(n)l=!1,s=wi;else if(u>=g){var w=t?null:Tf(e);if(w)return cr(w);l=!1,s=Ln,d=new en}else d=t?[]:h;e:for(;++r<u;){var y=e[r],x=t?t(y):y;if(y=n||y!==0?y:0,l&&x===x){for(var E=d.length;E--;)if(d[E]===x)continue e;t&&d.push(x),h.push(y)}else s(d,x,n)||(d!==h&&d.push(x),h.push(y))}return h}function Hi(e,t){return t=Wt(t,e),e=yo(e,t),e==null||delete e[lt(Qe(t))]}function Ka(e,t,n,r){return jn(e,t,n(nn(e,t)),r)}function Ir(e,t,n,r){for(var s=e.length,u=r?s:-1;(r?u--:++u<s)&&t(e[u],u,e););return n?Xe(e,r?0:u,r?u+1:s):Xe(e,r?u+1:0,r?s:u)}function za(e,t){var n=e;return n instanceof j&&(n=n.value()),yi(t,function(r,s){return s.func.apply(s.thisArg,Ot([r],s.args))},n)}function Ki(e,t,n){var r=e.length;if(r<2)return r?Ut(e[0]):[];for(var s=-1,u=m(r);++s<r;)for(var l=e[s],h=-1;++h<r;)h!=s&&(u[s]=Bn(u[s]||l,e[h],t,n));return Ut(xe(u,1),t,n)}function Ja(e,t,n){for(var r=-1,s=e.length,u=t.length,l={};++r<s;){var h=r<u?t[r]:i;n(l,e[r],h)}return l}function zi(e){return he(e)?e:[]}function Ji(e){return typeof e=="function"?e:Oe}function Wt(e,t){return U(e)?e:rs(e,t)?[e]:bo(X(e))}var vf=B;function Dt(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:Xe(e,t,n)}var Ya=rl||function(e){return ye.clearTimeout(e)};function Za(e,t){if(t)return e.slice();var n=e.length,r=va?va(n):new e.constructor(n);return e.copy(r),r}function Yi(e){var t=new e.constructor(e.byteLength);return new gr(t).set(new gr(e)),t}function _f(e,t){var n=t?Yi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function wf(e){var t=new e.constructor(e.source,Ls.exec(e));return t.lastIndex=e.lastIndex,t}function yf(e){return Dn?te(Dn.call(e)):{}}function Xa(e,t){var n=t?Yi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Qa(e,t){if(e!==t){var n=e!==i,r=e===null,s=e===e,u=Be(e),l=t!==i,h=t===null,d=t===t,w=Be(t);if(!h&&!w&&!u&&e>t||u&&l&&d&&!h&&!w||r&&l&&d||!n&&d||!s)return 1;if(!r&&!u&&!w&&e<t||w&&n&&s&&!r&&!u||h&&n&&s||!l&&s||!d)return-1}return 0}function xf(e,t,n){for(var r=-1,s=e.criteria,u=t.criteria,l=s.length,h=n.length;++r<l;){var d=Qa(s[r],u[r]);if(d){if(r>=h)return d;var w=n[r];return d*(w=="desc"?-1:1)}}return e.index-t.index}function Va(e,t,n,r){for(var s=-1,u=e.length,l=n.length,h=-1,d=t.length,w=ve(u-l,0),y=m(d+w),x=!r;++h<d;)y[h]=t[h];for(;++s<l;)(x||s<u)&&(y[n[s]]=e[s]);for(;w--;)y[h++]=e[s++];return y}function eo(e,t,n,r){for(var s=-1,u=e.length,l=-1,h=n.length,d=-1,w=t.length,y=ve(u-h,0),x=m(y+w),E=!r;++s<y;)x[s]=e[s];for(var T=s;++d<w;)x[T+d]=t[d];for(;++l<h;)(E||s<u)&&(x[T+n[l]]=e[s++]);return x}function Ie(e,t){var n=-1,r=e.length;for(t||(t=m(r));++n<r;)t[n]=e[n];return t}function ct(e,t,n,r){var s=!n;n||(n={});for(var u=-1,l=t.length;++u<l;){var h=t[u],d=r?r(n[h],e[h],h,n,e):i;d===i&&(d=e[h]),s?dt(n,h,d):$n(n,h,d)}return n}function Sf(e,t){return ct(e,ns(e),t)}function Af(e,t){return ct(e,po(e),t)}function Rr(e,t){return function(n,r){var s=U(n)?Tc:Gl,u=t?t():{};return s(n,e,R(r,2),u)}}function xn(e){return B(function(t,n){var r=-1,s=n.length,u=s>1?n[s-1]:i,l=s>2?n[2]:i;for(u=e.length>3&&typeof u=="function"?(s--,u):i,l&&Ce(n[0],n[1],l)&&(u=s<3?i:u,s=1),t=te(t);++r<s;){var h=n[r];h&&e(t,h,r,u)}return t})}function to(e,t){return function(n,r){if(n==null)return n;if(!Re(n))return e(n,r);for(var s=n.length,u=t?s:-1,l=te(n);(t?u--:++u<s)&&r(l[u],u,l)!==!1;);return n}}function no(e){return function(t,n,r){for(var s=-1,u=te(t),l=r(t),h=l.length;h--;){var d=l[e?h:++s];if(n(u[d],d,u)===!1)break}return t}}function bf(e,t,n){var r=t&de,s=Gn(e);function u(){var l=this&&this!==ye&&this instanceof u?s:e;return l.apply(r?n:this,arguments)}return u}function ro(e){return function(t){t=X(t);var n=dn(t)?nt(t):i,r=n?n[0]:t.charAt(0),s=n?Dt(n,1).join(""):t.slice(1);return r[e]()+s}}function Sn(e){return function(t){return yi(nu(tu(t).replace(pc,"")),e,"")}}function Gn(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=yn(e.prototype),r=e.apply(n,t);return ce(r)?r:n}}function Ef(e,t,n){var r=Gn(e);function s(){for(var u=arguments.length,l=m(u),h=u,d=An(s);h--;)l[h]=arguments[h];var w=u<3&&l[0]!==d&&l[u-1]!==d?[]:Lt(l,d);if(u-=w.length,u<n)return uo(e,t,Pr,s.placeholder,i,l,w,i,i,n-u);var y=this&&this!==ye&&this instanceof s?r:e;return We(y,this,l)}return s}function io(e){return function(t,n,r){var s=te(t);if(!Re(t)){var u=R(n,3);t=we(t),n=function(h){return u(s[h],h,s)}}var l=e(t,n,r);return l>-1?s[u?t[l]:l]:i}}function so(e){return mt(function(t){var n=t.length,r=n,s=Ye.prototype.thru;for(e&&t.reverse();r--;){var u=t[r];if(typeof u!="function")throw new Je(S);if(s&&!l&&Nr(u)=="wrapper")var l=new Ye([],!0)}for(r=l?r:n;++r<n;){u=t[r];var h=Nr(u),d=h=="wrapper"?es(u):i;d&&is(d[0])&&d[1]==(se|Fe|Z|je)&&!d[4].length&&d[9]==1?l=l[Nr(d[0])].apply(l,d[3]):l=u.length==1&&is(u)?l[h]():l.thru(u)}return function(){var w=arguments,y=w[0];if(l&&w.length==1&&U(y))return l.plant(y).value();for(var x=0,E=n?t[x].apply(this,w):y;++x<n;)E=t[x].call(this,E);return E}})}function Pr(e,t,n,r,s,u,l,h,d,w){var y=t&se,x=t&de,E=t&Me,T=t&(Fe|F),L=t&ne,$=E?i:Gn(e);function M(){for(var q=arguments.length,H=m(q),ke=q;ke--;)H[ke]=arguments[ke];if(T)var Te=An(M),qe=Uc(H,Te);if(r&&(H=Va(H,r,s,T)),u&&(H=eo(H,u,l,T)),q-=qe,T&&q<w){var pe=Lt(H,Te);return uo(e,t,Pr,M.placeholder,n,H,pe,h,d,w-q)}var st=x?n:this,yt=E?st[e]:e;return q=H.length,h?H=Hf(H,h):L&&q>1&&H.reverse(),y&&d<q&&(H.length=d),this&&this!==ye&&this instanceof M&&(yt=$||Gn(yt)),yt.apply(st,H)}return M}function ao(e,t){return function(n,r){return Ql(n,e,t(r),{})}}function Or(e,t){return function(n,r){var s;if(n===i&&r===i)return t;if(n!==i&&(s=n),r!==i){if(s===i)return r;typeof n=="string"||typeof r=="string"?(n=$e(n),r=$e(r)):(n=Ha(n),r=Ha(r)),s=e(n,r)}return s}}function Zi(e){return mt(function(t){return t=oe(t,De(R())),B(function(n){var r=this;return e(t,function(s){return We(s,r,n)})})})}function Lr(e,t){t=t===i?" ":$e(t);var n=t.length;if(n<2)return n?ji(t,e):t;var r=ji(t,wr(e/gn(t)));return dn(t)?Dt(nt(r),0,e).join(""):r.slice(0,e)}function Cf(e,t,n,r){var s=t&de,u=Gn(e);function l(){for(var h=-1,d=arguments.length,w=-1,y=r.length,x=m(y+d),E=this&&this!==ye&&this instanceof l?u:e;++w<y;)x[w]=r[w];for(;d--;)x[w++]=arguments[++h];return We(E,s?n:this,x)}return l}function oo(e){return function(t,n,r){return r&&typeof r!="number"&&Ce(t,n,r)&&(n=r=i),t=wt(t),n===i?(n=t,t=0):n=wt(n),r=r===i?t<n?1:-1:wt(r),ff(t,n,r,e)}}function Mr(e){return function(t,n){return typeof t=="string"&&typeof n=="string"||(t=Ve(t),n=Ve(n)),e(t,n)}}function uo(e,t,n,r,s,u,l,h,d,w){var y=t&Fe,x=y?l:i,E=y?i:l,T=y?u:i,L=y?i:u;t|=y?Z:z,t&=~(y?z:Z),t&Et||(t&=-4);var $=[e,t,s,T,x,L,E,h,d,w],M=n.apply(i,$);return is(e)&&xo(M,$),M.placeholder=r,So(M,e,t)}function Xi(e){var t=me[e];return function(n,r){if(n=Ve(n),r=r==null?0:Se(D(r),292),r&&xa(n)){var s=(X(n)+"e").split("e"),u=t(s[0]+"e"+(+s[1]+r));return s=(X(u)+"e").split("e"),+(s[0]+"e"+(+s[1]-r))}return t(n)}}var Tf=_n&&1/cr(new _n([,-0]))[1]==at?function(e){return new _n(e)}:ws;function co(e){return function(t){var n=Ae(t);return n==Ne?Ti(t):n==Ue?jc(t):Nc(t,e(t))}}function gt(e,t,n,r,s,u,l,h){var d=t&Me;if(!d&&typeof e!="function")throw new Je(S);var w=r?r.length:0;if(w||(t&=-97,r=s=i),l=l===i?l:ve(D(l),0),h=h===i?h:D(h),w-=s?s.length:0,t&z){var y=r,x=s;r=s=i}var E=d?i:es(e),T=[e,t,n,r,s,y,x,u,l,h];if(E&&qf(T,E),e=T[0],t=T[1],n=T[2],r=T[3],s=T[4],h=T[9]=T[9]===i?d?0:e.length:ve(T[9]-w,0),!h&&t&(Fe|F)&&(t&=-25),!t||t==de)var L=bf(e,t,n);else t==Fe||t==F?L=Ef(e,t,h):(t==Z||t==(de|Z))&&!s.length?L=Cf(e,t,n,r):L=Pr.apply(i,T);var $=E?ja:xo;return So($(L,T),e,t)}function lo(e,t,n,r){return e===i||it(e,vn[n])&&!Q.call(r,n)?t:e}function fo(e,t,n,r,s,u){return ce(e)&&ce(t)&&(u.set(t,e),Tr(e,t,i,fo,u),u.delete(t)),e}function Ff(e){return zn(e)?i:e}function ho(e,t,n,r,s,u){var l=n&ue,h=e.length,d=t.length;if(h!=d&&!(l&&d>h))return!1;var w=u.get(e),y=u.get(t);if(w&&y)return w==t&&y==e;var x=-1,E=!0,T=n&Le?new en:i;for(u.set(e,t),u.set(t,e);++x<h;){var L=e[x],$=t[x];if(r)var M=l?r($,L,x,t,e,u):r(L,$,x,e,t,u);if(M!==i){if(M)continue;E=!1;break}if(T){if(!xi(t,function(q,H){if(!Ln(T,H)&&(L===q||s(L,q,n,r,u)))return T.push(H)})){E=!1;break}}else if(!(L===$||s(L,$,n,r,u))){E=!1;break}}return u.delete(e),u.delete(t),E}function If(e,t,n,r,s,u,l){switch(n){case Rt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Yt:return!(e.byteLength!=t.byteLength||!u(new gr(e),new gr(t)));case Ht:case Kt:case zt:return it(+e,+t);case cn:return e.name==t.name&&e.message==t.message;case Ft:case Jt:return e==t+"";case Ne:var h=Ti;case Ue:var d=r&ue;if(h||(h=cr),e.size!=t.size&&!d)return!1;var w=l.get(e);if(w)return w==t;r|=Le,l.set(e,t);var y=ho(h(e),h(t),r,s,u,l);return l.delete(e),y;case fn:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}function Rf(e,t,n,r,s,u){var l=n&ue,h=Qi(e),d=h.length,w=Qi(t),y=w.length;if(d!=y&&!l)return!1;for(var x=d;x--;){var E=h[x];if(!(l?E in t:Q.call(t,E)))return!1}var T=u.get(e),L=u.get(t);if(T&&L)return T==t&&L==e;var $=!0;u.set(e,t),u.set(t,e);for(var M=l;++x<d;){E=h[x];var q=e[E],H=t[E];if(r)var ke=l?r(H,q,E,t,e,u):r(q,H,E,e,t,u);if(!(ke===i?q===H||s(q,H,n,r,u):ke)){$=!1;break}M||(M=E=="constructor")}if($&&!M){var Te=e.constructor,qe=t.constructor;Te!=qe&&"constructor"in e&&"constructor"in t&&!(typeof Te=="function"&&Te instanceof Te&&typeof qe=="function"&&qe instanceof qe)&&($=!1)}return u.delete(e),u.delete(t),$}function mt(e){return as(wo(e,i,Fo),e+"")}function Qi(e){return Oa(e,we,ns)}function Vi(e){return Oa(e,Pe,po)}var es=xr?function(e){return xr.get(e)}:ws;function Nr(e){for(var t=e.name+"",n=wn[t],r=Q.call(wn,t)?n.length:0;r--;){var s=n[r],u=s.func;if(u==null||u==e)return s.name}return t}function An(e){var t=Q.call(o,"placeholder")?o:e;return t.placeholder}function R(){var e=o.iteratee||vs;return e=e===vs?Na:e,arguments.length?e(arguments[0],arguments[1]):e}function Ur(e,t){var n=e.__data__;return Df(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ts(e){for(var t=we(e),n=t.length;n--;){var r=t[n],s=e[r];t[n]=[r,s,vo(s)]}return t}function rn(e,t){var n=Bc(e,t);return Ma(n)?n:i}function Pf(e){var t=Q.call(e,Qt),n=e[Qt];try{e[Qt]=i;var r=!0}catch{}var s=pr.call(e);return r&&(t?e[Qt]=n:delete e[Qt]),s}var ns=Ii?function(e){return e==null?[]:(e=te(e),Pt(Ii(e),function(t){return wa.call(e,t)}))}:ys,po=Ii?function(e){for(var t=[];e;)Ot(t,ns(e)),e=mr(e);return t}:ys,Ae=Ee;(Ri&&Ae(new Ri(new ArrayBuffer(1)))!=Rt||Nn&&Ae(new Nn)!=Ne||Pi&&Ae(Pi.resolve())!=Pn||_n&&Ae(new _n)!=Ue||Un&&Ae(new Un)!=It)&&(Ae=function(e){var t=Ee(e),n=t==tt?e.constructor:i,r=n?sn(n):"";if(r)switch(r){case hl:return Rt;case pl:return Ne;case dl:return Pn;case gl:return Ue;case ml:return It}return t});function Of(e,t,n){for(var r=-1,s=n.length;++r<s;){var u=n[r],l=u.size;switch(u.type){case"drop":e+=l;break;case"dropRight":t-=l;break;case"take":t=Se(t,e+l);break;case"takeRight":e=ve(e,t-l);break}}return{start:e,end:t}}function Lf(e){var t=e.match(Du);return t?t[1].split($u):[]}function go(e,t,n){t=Wt(t,e);for(var r=-1,s=t.length,u=!1;++r<s;){var l=lt(t[r]);if(!(u=e!=null&&n(e,l)))break;e=e[l]}return u||++r!=s?u:(s=e==null?0:e.length,!!s&&jr(s)&&vt(l,s)&&(U(e)||an(e)))}function Mf(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Q.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function mo(e){return typeof e.constructor=="function"&&!Hn(e)?yn(mr(e)):{}}function Nf(e,t,n){var r=e.constructor;switch(t){case Yt:return Yi(e);case Ht:case Kt:return new r(+e);case Rt:return _f(e,n);case O:case ge:case ot:case rr:case Zt:case On:case oi:case ui:case ci:return Xa(e,n);case Ne:return new r;case zt:case Jt:return new r(e);case Ft:return wf(e);case Ue:return new r;case fn:return yf(e)}}function Uf(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Wu,`{
|
|
210
210
|
/* [wrapped with `+t+`] */
|
|
211
|
-
`)}function Df(e){return U(e)||on(e)||!!(xa&&e&&e[xa])}function _t(e,t){var n=typeof e;return t=t??et,!!t&&(n=="number"||n!="symbol"&&Yu.test(e))&&e>-1&&e%1==0&&e<t}function Ee(e,t,n){if(!ce(n))return!1;var r=typeof t;return(r=="number"?Ie(n)&&_t(t,n.length):r=="string"&&t in n)?it(n[t],e):!1}function is(e,t){if(U(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||$e(e)?!0:Mu.test(e)||!Lu.test(e)||t!=null&&e in te(t)}function $f(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ss(e){var t=Ur(e),n=o[t];if(typeof n!="function"||!(t in q.prototype))return!1;if(e===n)return!0;var r=ts(n);return!!r&&e===r[0]}function Bf(e){return!!va&&va in e}var kf=hr?wt:Ss;function Kn(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||_n;return e===n}function _o(e){return e===e&&!ce(e)}function wo(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==i||e in te(n))}}function jf(e){var t=jr(e,function(r){return n.size===P&&n.clear(),r}),n=t.cache;return t}function qf(e,t){var n=e[1],r=t[1],s=n|r,u=s<(pe|Le|se),l=r==se&&n==Te||r==se&&n==qe&&e[7].length<=t[8]||r==(se|qe)&&t[7].length<=t[8]&&n==Te;if(!(u||l))return e;r&pe&&(e[2]=t[2],s|=n&pe?0:Tt);var h=t[3];if(h){var d=e[3];e[3]=d?eo(d,h,t[4]):h,e[4]=d?Nt(e[3],J):t[4]}return h=t[5],h&&(d=e[5],e[5]=d?to(d,h,t[6]):h,e[6]=d?Nt(e[5],J):t[6]),h=t[7],h&&(e[7]=h),r&se&&(e[8]=e[8]==null?t[8]:xe(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=s,e}function Gf(e){var t=[];if(e!=null)for(var n in te(e))t.push(n);return t}function Hf(e){return dr.call(e)}function yo(e,t,n){return t=me(t===i?e.length-1:t,0),function(){for(var r=arguments,s=-1,u=me(r.length-t,0),l=m(u);++s<u;)l[s]=r[t+s];s=-1;for(var h=m(t+1);++s<t;)h[s]=r[s];return h[t]=n(l),Ue(e,this,h)}}function xo(e,t){return t.length<2?e:rn(e,Xe(t,0,-1))}function Kf(e,t){for(var n=e.length,r=xe(t.length,n),s=Fe(e);r--;){var u=t[r];e[r]=_t(u,n)?s[u]:i}return e}function as(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var So=bo(Ga),zn=al||function(e,t){return we.setTimeout(e,t)},os=bo(gf);function Ao(e,t,n){var r=t+"";return os(e,Wf(r,zf(Mf(r),n)))}function bo(e){var t=0,n=0;return function(){var r=ll(),s=Ft-(r-n);if(n=r,s>0){if(++t>=ht)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Dr(e,t){var n=-1,r=e.length,s=r-1;for(t=t===i?r:t;++n<t;){var u=qi(n,s),l=e[u];e[u]=e[n],e[n]=l}return e.length=t,e}var Eo=jf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Nu,function(n,r,s,u){t.push(s?u.replace(qu,"$1"):r||n)}),t});function lt(e){if(typeof e=="string"||$e(e))return e;var t=e+"";return t=="0"&&1/e==-at?"-0":t}function an(e){if(e!=null){try{return pr.call(e)}catch{}try{return e+""}catch{}}return""}function zf(e,t){return ze(ni,function(n){var r="_."+n[0];t&n[1]&&!ur(e,r)&&e.push(r)}),e.sort()}function Co(e){if(e instanceof q)return e.clone();var t=new Ye(e.__wrapped__,e.__chain__);return t.__actions__=Fe(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Jf(e,t,n){(n?Ee(e,t,n):t===i)?t=1:t=me(D(t),0);var r=e==null?0:e.length;if(!r||t<1)return[];for(var s=0,u=0,l=m(yr(r/t));s<r;)l[u++]=Xe(e,s,s+=t);return l}function Yf(e){for(var t=-1,n=e==null?0:e.length,r=0,s=[];++t<n;){var u=e[t];u&&(s[r++]=u)}return s}function Zf(){var e=arguments.length;if(!e)return[];for(var t=m(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Mt(U(n)?Fe(n):[n],ye(t,1))}var Xf=B(function(e,t){return fe(e)?kn(e,ye(t,1,fe,!0)):[]}),Qf=B(function(e,t){var n=Qe(t);return fe(n)&&(n=i),fe(e)?kn(e,ye(t,1,fe,!0),R(n,2)):[]}),Vf=B(function(e,t){var n=Qe(t);return fe(n)&&(n=i),fe(e)?kn(e,ye(t,1,fe,!0),i,n):[]});function eh(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===i?1:D(t),Xe(e,t<0?0:t,r)):[]}function th(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===i?1:D(t),t=r-t,Xe(e,0,t<0?0:t)):[]}function nh(e,t){return e&&e.length?Rr(e,R(t,3),!0,!0):[]}function rh(e,t){return e&&e.length?Rr(e,R(t,3),!0):[]}function ih(e,t,n,r){var s=e==null?0:e.length;return s?(n&&typeof n!="number"&&Ee(e,t,n)&&(n=0,r=s),Yl(e,t,n,r)):[]}function To(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=n==null?0:D(n);return s<0&&(s=me(r+s,0)),cr(e,R(t,3),s)}function Fo(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=r-1;return n!==i&&(s=D(n),s=n<0?me(r+s,0):xe(s,r-1)),cr(e,R(t,3),s,!0)}function Io(e){var t=e==null?0:e.length;return t?ye(e,1):[]}function sh(e){var t=e==null?0:e.length;return t?ye(e,at):[]}function ah(e,t){var n=e==null?0:e.length;return n?(t=t===i?1:D(t),ye(e,t)):[]}function oh(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var s=e[t];r[s[0]]=s[1]}return r}function Ro(e){return e&&e.length?e[0]:i}function uh(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=n==null?0:D(n);return s<0&&(s=me(r+s,0)),dn(e,t,s)}function ch(e){var t=e==null?0:e.length;return t?Xe(e,0,-1):[]}var lh=B(function(e){var t=oe(e,Ji);return t.length&&t[0]===e[0]?Di(t):[]}),fh=B(function(e){var t=Qe(e),n=oe(e,Ji);return t===Qe(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Di(n,R(t,2)):[]}),hh=B(function(e){var t=Qe(e),n=oe(e,Ji);return t=typeof t=="function"?t:i,t&&n.pop(),n.length&&n[0]===e[0]?Di(n,i,t):[]});function ph(e,t){return e==null?"":ul.call(e,t)}function Qe(e){var t=e==null?0:e.length;return t?e[t-1]:i}function dh(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=r;return n!==i&&(s=D(n),s=s<0?me(r+s,0):xe(s,r-1)),t===t?Kc(e,t,s):cr(e,ca,s,!0)}function gh(e,t){return e&&e.length?Ba(e,D(t)):i}var mh=B(Po);function Po(e,t){return e&&e.length&&t&&t.length?ji(e,t):e}function vh(e,t,n){return e&&e.length&&t&&t.length?ji(e,t,R(n,2)):e}function _h(e,t,n){return e&&e.length&&t&&t.length?ji(e,t,i,n):e}var wh=vt(function(e,t){var n=e==null?0:e.length,r=Mi(e,t);return qa(e,oe(t,function(s){return _t(s,n)?+s:s}).sort(Va)),r});function yh(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,s=[],u=e.length;for(t=R(t,3);++r<u;){var l=e[r];t(l,r,e)&&(n.push(l),s.push(r))}return qa(e,s),n}function us(e){return e==null?e:hl.call(e)}function xh(e,t,n){var r=e==null?0:e.length;return r?(n&&typeof n!="number"&&Ee(e,t,n)?(t=0,n=r):(t=t==null?0:D(t),n=n===i?r:D(n)),Xe(e,t,n)):[]}function Sh(e,t){return Ir(e,t)}function Ah(e,t,n){return Hi(e,t,R(n,2))}function bh(e,t){var n=e==null?0:e.length;if(n){var r=Ir(e,t);if(r<n&&it(e[r],t))return r}return-1}function Eh(e,t){return Ir(e,t,!0)}function Ch(e,t,n){return Hi(e,t,R(n,2),!0)}function Th(e,t){var n=e==null?0:e.length;if(n){var r=Ir(e,t,!0)-1;if(it(e[r],t))return r}return-1}function Fh(e){return e&&e.length?Ha(e):[]}function Ih(e,t){return e&&e.length?Ha(e,R(t,2)):[]}function Rh(e){var t=e==null?0:e.length;return t?Xe(e,1,t):[]}function Ph(e,t,n){return e&&e.length?(t=n||t===i?1:D(t),Xe(e,0,t<0?0:t)):[]}function Oh(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===i?1:D(t),t=r-t,Xe(e,t<0?0:t,r)):[]}function Lh(e,t){return e&&e.length?Rr(e,R(t,3),!1,!0):[]}function Mh(e,t){return e&&e.length?Rr(e,R(t,3)):[]}var Nh=B(function(e){return Dt(ye(e,1,fe,!0))}),Uh=B(function(e){var t=Qe(e);return fe(t)&&(t=i),Dt(ye(e,1,fe,!0),R(t,2))}),Wh=B(function(e){var t=Qe(e);return t=typeof t=="function"?t:i,Dt(ye(e,1,fe,!0),i,t)});function Dh(e){return e&&e.length?Dt(e):[]}function $h(e,t){return e&&e.length?Dt(e,R(t,2)):[]}function Bh(e,t){return t=typeof t=="function"?t:i,e&&e.length?Dt(e,i,t):[]}function cs(e){if(!(e&&e.length))return[];var t=0;return e=Lt(e,function(n){if(fe(n))return t=me(n.length,t),!0}),Ci(t,function(n){return oe(e,Ai(n))})}function Oo(e,t){if(!(e&&e.length))return[];var n=cs(e);return t==null?n:oe(n,function(r){return Ue(t,i,r)})}var kh=B(function(e,t){return fe(e)?kn(e,t):[]}),jh=B(function(e){return zi(Lt(e,fe))}),qh=B(function(e){var t=Qe(e);return fe(t)&&(t=i),zi(Lt(e,fe),R(t,2))}),Gh=B(function(e){var t=Qe(e);return t=typeof t=="function"?t:i,zi(Lt(e,fe),i,t)}),Hh=B(cs);function Kh(e,t){return Ya(e||[],t||[],Bn)}function zh(e,t){return Ya(e||[],t||[],Gn)}var Jh=B(function(e){var t=e.length,n=t>1?e[t-1]:i;return n=typeof n=="function"?(e.pop(),n):i,Oo(e,n)});function Lo(e){var t=o(e);return t.__chain__=!0,t}function Yh(e,t){return t(e),e}function $r(e,t){return t(e)}var Zh=vt(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,s=function(u){return Mi(u,e)};return t>1||this.__actions__.length||!(r instanceof q)||!_t(n)?this.thru(s):(r=r.slice(n,+n+(t?1:0)),r.__actions__.push({func:$r,args:[s],thisArg:i}),new Ye(r,this.__chain__).thru(function(u){return t&&!u.length&&u.push(i),u}))});function Xh(){return Lo(this)}function Qh(){return new Ye(this.value(),this.__chain__)}function Vh(){this.__values__===i&&(this.__values__=zo(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function ep(){return this}function tp(e){for(var t,n=this;n instanceof br;){var r=Co(n);r.__index__=0,r.__values__=i,t?s.__wrapped__=r:t=r;var s=r;n=n.__wrapped__}return s.__wrapped__=e,t}function np(){var e=this.__wrapped__;if(e instanceof q){var t=e;return this.__actions__.length&&(t=new q(this)),t=t.reverse(),t.__actions__.push({func:$r,args:[us],thisArg:i}),new Ye(t,this.__chain__)}return this.thru(us)}function rp(){return Ja(this.__wrapped__,this.__actions__)}var ip=Pr(function(e,t,n){Q.call(e,n)?++e[n]:gt(e,n,1)});function sp(e,t,n){var r=U(e)?oa:Jl;return n&&Ee(e,t,n)&&(t=i),r(e,R(t,3))}function ap(e,t){var n=U(e)?Lt:Pa;return n(e,R(t,3))}var op=so(To),up=so(Fo);function cp(e,t){return ye(Br(e,t),1)}function lp(e,t){return ye(Br(e,t),at)}function fp(e,t,n){return n=n===i?1:D(n),ye(Br(e,t),n)}function Mo(e,t){var n=U(e)?ze:Wt;return n(e,R(t,3))}function No(e,t){var n=U(e)?Ic:Ra;return n(e,R(t,3))}var hp=Pr(function(e,t,n){Q.call(e,n)?e[n].push(t):gt(e,n,[t])});function pp(e,t,n,r){e=Ie(e)?e:Cn(e),n=n&&!r?D(n):0;var s=e.length;return n<0&&(n=me(s+n,0)),Hr(e)?n<=s&&e.indexOf(t,n)>-1:!!s&&dn(e,t,n)>-1}var dp=B(function(e,t,n){var r=-1,s=typeof t=="function",u=Ie(e)?m(e.length):[];return Wt(e,function(l){u[++r]=s?Ue(t,l,n):jn(l,t,n)}),u}),gp=Pr(function(e,t,n){gt(e,n,t)});function Br(e,t){var n=U(e)?oe:Wa;return n(e,R(t,3))}function mp(e,t,n,r){return e==null?[]:(U(t)||(t=t==null?[]:[t]),n=r?i:n,U(n)||(n=n==null?[]:[n]),ka(e,t,n))}var vp=Pr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function _p(e,t,n){var r=U(e)?xi:fa,s=arguments.length<3;return r(e,R(t,4),n,s,Wt)}function wp(e,t,n){var r=U(e)?Rc:fa,s=arguments.length<3;return r(e,R(t,4),n,s,Ra)}function yp(e,t){var n=U(e)?Lt:Pa;return n(e,qr(R(t,3)))}function xp(e){var t=U(e)?Ca:pf;return t(e)}function Sp(e,t,n){(n?Ee(e,t,n):t===i)?t=1:t=D(t);var r=U(e)?ql:df;return r(e,t)}function Ap(e){var t=U(e)?Gl:mf;return t(e)}function bp(e){if(e==null)return 0;if(Ie(e))return Hr(e)?mn(e):e.length;var t=Se(e);return t==Me||t==Ne?e.size:Bi(e).length}function Ep(e,t,n){var r=U(e)?Si:vf;return n&&Ee(e,t,n)&&(t=i),r(e,R(t,3))}var Cp=B(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Ee(e,t[0],t[1])?t=[]:n>2&&Ee(t[0],t[1],t[2])&&(t=[t[0]]),ka(e,ye(t,1),[])}),kr=sl||function(){return we.Date.now()};function Tp(e,t){if(typeof t!="function")throw new Je(S);return e=D(e),function(){if(--e<1)return t.apply(this,arguments)}}function Uo(e,t,n){return t=n?i:t,t=e&&t==null?e.length:t,mt(e,se,i,i,i,i,t)}function Wo(e,t){var n;if(typeof t!="function")throw new Je(S);return e=D(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var ls=B(function(e,t,n){var r=pe;if(n.length){var s=Nt(n,bn(ls));r|=Z}return mt(e,r,t,n,s)}),Do=B(function(e,t,n){var r=pe|Le;if(n.length){var s=Nt(n,bn(Do));r|=Z}return mt(t,r,e,n,s)});function $o(e,t,n){t=n?i:t;var r=mt(e,Te,i,i,i,i,i,t);return r.placeholder=$o.placeholder,r}function Bo(e,t,n){t=n?i:t;var r=mt(e,F,i,i,i,i,i,t);return r.placeholder=Bo.placeholder,r}function ko(e,t,n){var r,s,u,l,h,d,w=0,y=!1,x=!1,E=!0;if(typeof e!="function")throw new Je(S);t=Ve(t)||0,ce(n)&&(y=!!n.leading,x="maxWait"in n,u=x?me(Ve(n.maxWait)||0,t):u,E="trailing"in n?!!n.trailing:E);function T(he){var st=r,xt=s;return r=s=i,w=he,l=e.apply(xt,st),l}function L(he){return w=he,h=zn(j,t),y?T(he):l}function $(he){var st=he-d,xt=he-w,au=t-st;return x?xe(au,u-xt):au}function M(he){var st=he-d,xt=he-w;return d===i||st>=t||st<0||x&&xt>=u}function j(){var he=kr();if(M(he))return H(he);h=zn(j,$(he))}function H(he){return h=i,E&&r?T(he):(r=s=i,l)}function Be(){h!==i&&Za(h),w=0,r=d=s=h=i}function Ce(){return h===i?l:H(kr())}function ke(){var he=kr(),st=M(he);if(r=arguments,s=this,d=he,st){if(h===i)return L(d);if(x)return Za(h),h=zn(j,t),T(d)}return h===i&&(h=zn(j,t)),l}return ke.cancel=Be,ke.flush=Ce,ke}var Fp=B(function(e,t){return Ia(e,1,t)}),Ip=B(function(e,t,n){return Ia(e,Ve(t)||0,n)});function Rp(e){return mt(e,ne)}function jr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new Je(S);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],u=n.cache;if(u.has(s))return u.get(s);var l=e.apply(this,r);return n.cache=u.set(s,l)||u,l};return n.cache=new(jr.Cache||dt),n}jr.Cache=dt;function qr(e){if(typeof e!="function")throw new Je(S);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 Pp(e){return Wo(2,e)}var Op=_f(function(e,t){t=t.length==1&&U(t[0])?oe(t[0],We(R())):oe(ye(t,1),We(R()));var n=t.length;return B(function(r){for(var s=-1,u=xe(r.length,n);++s<u;)r[s]=t[s].call(this,r[s]);return Ue(e,this,r)})}),fs=B(function(e,t){var n=Nt(t,bn(fs));return mt(e,Z,i,t,n)}),jo=B(function(e,t){var n=Nt(t,bn(jo));return mt(e,z,i,t,n)}),Lp=vt(function(e,t){return mt(e,qe,i,i,i,t)});function Mp(e,t){if(typeof e!="function")throw new Je(S);return t=t===i?t:D(t),B(e,t)}function Np(e,t){if(typeof e!="function")throw new Je(S);return t=t==null?0:me(D(t),0),B(function(n){var r=n[t],s=Bt(n,0,t);return r&&Mt(s,r),Ue(e,this,s)})}function Up(e,t,n){var r=!0,s=!0;if(typeof e!="function")throw new Je(S);return ce(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),ko(e,t,{leading:r,maxWait:t,trailing:s})}function Wp(e){return Uo(e,1)}function Dp(e,t){return fs(Yi(t),e)}function $p(){if(!arguments.length)return[];var e=arguments[0];return U(e)?e:[e]}function Bp(e){return Ze(e,k)}function kp(e,t){return t=typeof t=="function"?t:i,Ze(e,k,t)}function jp(e){return Ze(e,G|k)}function qp(e,t){return t=typeof t=="function"?t:i,Ze(e,G|k,t)}function Gp(e,t){return t==null||Fa(e,t,_e(t))}function it(e,t){return e===t||e!==e&&t!==t}var Hp=Nr(Wi),Kp=Nr(function(e,t){return e>=t}),on=Ma(function(){return arguments}())?Ma:function(e){return le(e)&&Q.call(e,"callee")&&!ya.call(e,"callee")},U=m.isArray,zp=ta?We(ta):ef;function Ie(e){return e!=null&&Gr(e.length)&&!wt(e)}function fe(e){return le(e)&&Ie(e)}function Jp(e){return e===!0||e===!1||le(e)&&be(e)==Kt}var kt=ol||Ss,Yp=na?We(na):tf;function Zp(e){return le(e)&&e.nodeType===1&&!Jn(e)}function Xp(e){if(e==null)return!0;if(Ie(e)&&(U(e)||typeof e=="string"||typeof e.splice=="function"||kt(e)||En(e)||on(e)))return!e.length;var t=Se(e);if(t==Me||t==Ne)return!e.size;if(Kn(e))return!Bi(e).length;for(var n in e)if(Q.call(e,n))return!1;return!0}function Qp(e,t){return qn(e,t)}function Vp(e,t,n){n=typeof n=="function"?n:i;var r=n?n(e,t):i;return r===i?qn(e,t,i,n):!!r}function hs(e){if(!le(e))return!1;var t=be(e);return t==ln||t==ii||typeof e.message=="string"&&typeof e.name=="string"&&!Jn(e)}function ed(e){return typeof e=="number"&&Sa(e)}function wt(e){if(!ce(e))return!1;var t=be(e);return t==fn||t==nr||t==ri||t==rr}function qo(e){return typeof e=="number"&&e==D(e)}function Gr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=et}function ce(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function le(e){return e!=null&&typeof e=="object"}var Go=ra?We(ra):rf;function td(e,t){return e===t||$i(e,t,ns(t))}function nd(e,t,n){return n=typeof n=="function"?n:i,$i(e,t,ns(t),n)}function rd(e){return Ho(e)&&e!=+e}function id(e){if(kf(e))throw new N(_);return Na(e)}function sd(e){return e===null}function ad(e){return e==null}function Ho(e){return typeof e=="number"||le(e)&&be(e)==Jt}function Jn(e){if(!le(e)||be(e)!=tt)return!1;var t=vr(e);if(t===null)return!0;var n=Q.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&pr.call(n)==tl}var ps=ia?We(ia):sf;function od(e){return qo(e)&&e>=-et&&e<=et}var Ko=sa?We(sa):af;function Hr(e){return typeof e=="string"||!U(e)&&le(e)&&be(e)==Yt}function $e(e){return typeof e=="symbol"||le(e)&&be(e)==hn}var En=aa?We(aa):of;function ud(e){return e===i}function cd(e){return le(e)&&Se(e)==Pt}function ld(e){return le(e)&&be(e)==oi}var fd=Nr(ki),hd=Nr(function(e,t){return e<=t});function zo(e){if(!e)return[];if(Ie(e))return Hr(e)?nt(e):Fe(e);if(Nn&&e[Nn])return qc(e[Nn]());var t=Se(e),n=t==Me?Fi:t==Ne?lr:Cn;return n(e)}function yt(e){if(!e)return e===0?e:0;if(e=Ve(e),e===at||e===-at){var t=e<0?-1:1;return t*Vr}return e===e?e:0}function D(e){var t=yt(e),n=t%1;return t===t?n?t-n:t:0}function Jo(e){return e?nn(D(e),0,He):0}function Ve(e){if(typeof e=="number")return e;if($e(e))return un;if(ce(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ce(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=ha(e);var n=Ku.test(e);return n||Ju.test(e)?Cc(e.slice(2),n?2:8):Hu.test(e)?un:+e}function Yo(e){return ct(e,Re(e))}function pd(e){return e?nn(D(e),-et,et):e===0?e:0}function X(e){return e==null?"":De(e)}var dd=Sn(function(e,t){if(Kn(t)||Ie(t)){ct(t,_e(t),e);return}for(var n in t)Q.call(t,n)&&Bn(e,n,t[n])}),Zo=Sn(function(e,t){ct(t,Re(t),e)}),Kr=Sn(function(e,t,n,r){ct(t,Re(t),e,r)}),gd=Sn(function(e,t,n,r){ct(t,_e(t),e,r)}),md=vt(Mi);function vd(e,t){var n=xn(e);return t==null?n:Ta(n,t)}var _d=B(function(e,t){e=te(e);var n=-1,r=t.length,s=r>2?t[2]:i;for(s&&Ee(t[0],t[1],s)&&(r=1);++n<r;)for(var u=t[n],l=Re(u),h=-1,d=l.length;++h<d;){var w=l[h],y=e[w];(y===i||it(y,_n[w])&&!Q.call(e,w))&&(e[w]=u[w])}return e}),wd=B(function(e){return e.push(i,ho),Ue(Xo,i,e)});function yd(e,t){return ua(e,R(t,3),ut)}function xd(e,t){return ua(e,R(t,3),Ui)}function Sd(e,t){return e==null?e:Ni(e,R(t,3),Re)}function Ad(e,t){return e==null?e:Oa(e,R(t,3),Re)}function bd(e,t){return e&&ut(e,R(t,3))}function Ed(e,t){return e&&Ui(e,R(t,3))}function Cd(e){return e==null?[]:Tr(e,_e(e))}function Td(e){return e==null?[]:Tr(e,Re(e))}function ds(e,t,n){var r=e==null?i:rn(e,t);return r===i?n:r}function Fd(e,t){return e!=null&&mo(e,t,Zl)}function gs(e,t){return e!=null&&mo(e,t,Xl)}var Id=oo(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=dr.call(t)),e[t]=n},vs(Pe)),Rd=oo(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=dr.call(t)),Q.call(e,t)?e[t].push(n):e[t]=[n]},R),Pd=B(jn);function _e(e){return Ie(e)?Ea(e):Bi(e)}function Re(e){return Ie(e)?Ea(e,!0):uf(e)}function Od(e,t){var n={};return t=R(t,3),ut(e,function(r,s,u){gt(n,t(r,s,u),r)}),n}function Ld(e,t){var n={};return t=R(t,3),ut(e,function(r,s,u){gt(n,s,t(r,s,u))}),n}var Md=Sn(function(e,t,n){Fr(e,t,n)}),Xo=Sn(function(e,t,n,r){Fr(e,t,n,r)}),Nd=vt(function(e,t){var n={};if(e==null)return n;var r=!1;t=oe(t,function(u){return u=$t(u,e),r||(r=u.length>1),u}),ct(e,es(e),n),r&&(n=Ze(n,G|K|k,If));for(var s=t.length;s--;)Ki(n,t[s]);return n});function Ud(e,t){return Qo(e,qr(R(t)))}var Wd=vt(function(e,t){return e==null?{}:lf(e,t)});function Qo(e,t){if(e==null)return{};var n=oe(es(e),function(r){return[r]});return t=R(t),ja(e,n,function(r,s){return t(r,s[0])})}function Dd(e,t,n){t=$t(t,e);var r=-1,s=t.length;for(s||(s=1,e=i);++r<s;){var u=e==null?i:e[lt(t[r])];u===i&&(r=s,u=n),e=wt(u)?u.call(e):u}return e}function $d(e,t,n){return e==null?e:Gn(e,t,n)}function Bd(e,t,n,r){return r=typeof r=="function"?r:i,e==null?e:Gn(e,t,n,r)}var Vo=lo(_e),eu=lo(Re);function kd(e,t,n){var r=U(e),s=r||kt(e)||En(e);if(t=R(t,4),n==null){var u=e&&e.constructor;s?n=r?new u:[]:ce(e)?n=wt(u)?xn(vr(e)):{}:n={}}return(s?ze:ut)(e,function(l,h,d){return t(n,l,h,d)}),n}function jd(e,t){return e==null?!0:Ki(e,t)}function qd(e,t,n){return e==null?e:za(e,t,Yi(n))}function Gd(e,t,n,r){return r=typeof r=="function"?r:i,e==null?e:za(e,t,Yi(n),r)}function Cn(e){return e==null?[]:Ti(e,_e(e))}function Hd(e){return e==null?[]:Ti(e,Re(e))}function Kd(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=Ve(n),n=n===n?n:0),t!==i&&(t=Ve(t),t=t===t?t:0),nn(Ve(e),t,n)}function zd(e,t,n){return t=yt(t),n===i?(n=t,t=0):n=yt(n),e=Ve(e),Ql(e,t,n)}function Jd(e,t,n){if(n&&typeof n!="boolean"&&Ee(e,t,n)&&(t=n=i),n===i&&(typeof t=="boolean"?(n=t,t=i):typeof e=="boolean"&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=yt(e),t===i?(t=e,e=0):t=yt(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var s=Aa();return xe(e+s*(t-e+Ec("1e-"+((s+"").length-1))),t)}return qi(e,t)}var Yd=An(function(e,t,n){return t=t.toLowerCase(),e+(n?tu(t):t)});function tu(e){return ms(X(e).toLowerCase())}function nu(e){return e=X(e),e&&e.replace(Zu,Dc).replace(gc,"")}function Zd(e,t,n){e=X(e),t=De(t);var r=e.length;n=n===i?r:nn(D(n),0,r);var s=n;return n-=t.length,n>=0&&e.slice(n,s)==t}function Xd(e){return e=X(e),e&&Ru.test(e)?e.replace(Os,$c):e}function Qd(e){return e=X(e),e&&Uu.test(e)?e.replace(fi,"\\$&"):e}var Vd=An(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),eg=An(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),tg=io("toLowerCase");function ng(e,t,n){e=X(e),t=D(t);var r=t?mn(e):0;if(!t||r>=t)return e;var s=(t-r)/2;return Mr(xr(s),n)+e+Mr(yr(s),n)}function rg(e,t,n){e=X(e),t=D(t);var r=t?mn(e):0;return t&&r<t?e+Mr(t-r,n):e}function ig(e,t,n){e=X(e),t=D(t);var r=t?mn(e):0;return t&&r<t?Mr(t-r,n)+e:e}function sg(e,t,n){return n||t==null?t=0:t&&(t=+t),fl(X(e).replace(hi,""),t||0)}function ag(e,t,n){return(n?Ee(e,t,n):t===i)?t=1:t=D(t),Gi(X(e),t)}function og(){var e=arguments,t=X(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var ug=An(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});function cg(e,t,n){return n&&typeof n!="number"&&Ee(e,t,n)&&(t=n=i),n=n===i?He:n>>>0,n?(e=X(e),e&&(typeof t=="string"||t!=null&&!ps(t))&&(t=De(t),!t&&gn(e))?Bt(nt(e),0,n):e.split(t,n)):[]}var lg=An(function(e,t,n){return e+(n?" ":"")+ms(t)});function fg(e,t,n){return e=X(e),n=n==null?0:nn(D(n),0,e.length),t=De(t),e.slice(n,n+t.length)==t}function hg(e,t,n){var r=o.templateSettings;n&&Ee(e,t,n)&&(t=i),e=X(e),t=Kr({},t,r,fo);var s=Kr({},t.imports,r.imports,fo),u=_e(s),l=Ti(s,u),h,d,w=0,y=t.interpolate||sr,x="__p += '",E=Ii((t.escape||sr).source+"|"+y.source+"|"+(y===Ls?Gu:sr).source+"|"+(t.evaluate||sr).source+"|$","g"),T="//# sourceURL="+(Q.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yc+"]")+`
|
|
212
|
-
`;e.replace(E,function(M,
|
|
213
|
-
__e(`+
|
|
214
|
-
'`),
|
|
215
|
-
`+
|
|
211
|
+
`)}function Wf(e){return U(e)||an(e)||!!(ya&&e&&e[ya])}function vt(e,t){var n=typeof e;return t=t??et,!!t&&(n=="number"||n!="symbol"&&Ju.test(e))&&e>-1&&e%1==0&&e<t}function Ce(e,t,n){if(!ce(n))return!1;var r=typeof t;return(r=="number"?Re(n)&&vt(t,n.length):r=="string"&&t in n)?it(n[t],e):!1}function rs(e,t){if(U(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Be(e)?!0:Lu.test(e)||!Ou.test(e)||t!=null&&e in te(t)}function Df(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function is(e){var t=Nr(e),n=o[t];if(typeof n!="function"||!(t in j.prototype))return!1;if(e===n)return!0;var r=es(n);return!!r&&e===r[0]}function $f(e){return!!ma&&ma in e}var Bf=fr?_t:xs;function Hn(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||vn;return e===n}function vo(e){return e===e&&!ce(e)}function _o(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==i||e in te(n))}}function kf(e){var t=kr(e,function(r){return n.size===P&&n.clear(),r}),n=t.cache;return t}function qf(e,t){var n=e[1],r=t[1],s=n|r,u=s<(de|Me|se),l=r==se&&n==Fe||r==se&&n==je&&e[7].length<=t[8]||r==(se|je)&&t[7].length<=t[8]&&n==Fe;if(!(u||l))return e;r&de&&(e[2]=t[2],s|=n&de?0:Et);var h=t[3];if(h){var d=e[3];e[3]=d?Va(d,h,t[4]):h,e[4]=d?Lt(e[3],J):t[4]}return h=t[5],h&&(d=e[5],e[5]=d?eo(d,h,t[6]):h,e[6]=d?Lt(e[5],J):t[6]),h=t[7],h&&(e[7]=h),r&se&&(e[8]=e[8]==null?t[8]:Se(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=s,e}function jf(e){var t=[];if(e!=null)for(var n in te(e))t.push(n);return t}function Gf(e){return pr.call(e)}function wo(e,t,n){return t=ve(t===i?e.length-1:t,0),function(){for(var r=arguments,s=-1,u=ve(r.length-t,0),l=m(u);++s<u;)l[s]=r[t+s];s=-1;for(var h=m(t+1);++s<t;)h[s]=r[s];return h[t]=n(l),We(e,this,h)}}function yo(e,t){return t.length<2?e:nn(e,Xe(t,0,-1))}function Hf(e,t){for(var n=e.length,r=Se(t.length,n),s=Ie(e);r--;){var u=t[r];e[r]=vt(u,n)?s[u]:i}return e}function ss(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var xo=Ao(ja),Kn=sl||function(e,t){return ye.setTimeout(e,t)},as=Ao(df);function So(e,t,n){var r=t+"";return as(e,Uf(r,Kf(Lf(r),n)))}function Ao(e){var t=0,n=0;return function(){var r=cl(),s=Ct-(r-n);if(n=r,s>0){if(++t>=ft)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Wr(e,t){var n=-1,r=e.length,s=r-1;for(t=t===i?r:t;++n<t;){var u=qi(n,s),l=e[u];e[u]=e[n],e[n]=l}return e.length=t,e}var bo=kf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Mu,function(n,r,s,u){t.push(s?u.replace(qu,"$1"):r||n)}),t});function lt(e){if(typeof e=="string"||Be(e))return e;var t=e+"";return t=="0"&&1/e==-at?"-0":t}function sn(e){if(e!=null){try{return hr.call(e)}catch{}try{return e+""}catch{}}return""}function Kf(e,t){return ze(ti,function(n){var r="_."+n[0];t&n[1]&&!or(e,r)&&e.push(r)}),e.sort()}function Eo(e){if(e instanceof j)return e.clone();var t=new Ye(e.__wrapped__,e.__chain__);return t.__actions__=Ie(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function zf(e,t,n){(n?Ce(e,t,n):t===i)?t=1:t=ve(D(t),0);var r=e==null?0:e.length;if(!r||t<1)return[];for(var s=0,u=0,l=m(wr(r/t));s<r;)l[u++]=Xe(e,s,s+=t);return l}function Jf(e){for(var t=-1,n=e==null?0:e.length,r=0,s=[];++t<n;){var u=e[t];u&&(s[r++]=u)}return s}function Yf(){var e=arguments.length;if(!e)return[];for(var t=m(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Ot(U(n)?Ie(n):[n],xe(t,1))}var Zf=B(function(e,t){return he(e)?Bn(e,xe(t,1,he,!0)):[]}),Xf=B(function(e,t){var n=Qe(t);return he(n)&&(n=i),he(e)?Bn(e,xe(t,1,he,!0),R(n,2)):[]}),Qf=B(function(e,t){var n=Qe(t);return he(n)&&(n=i),he(e)?Bn(e,xe(t,1,he,!0),i,n):[]});function Vf(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===i?1:D(t),Xe(e,t<0?0:t,r)):[]}function eh(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===i?1:D(t),t=r-t,Xe(e,0,t<0?0:t)):[]}function th(e,t){return e&&e.length?Ir(e,R(t,3),!0,!0):[]}function nh(e,t){return e&&e.length?Ir(e,R(t,3),!0):[]}function rh(e,t,n,r){var s=e==null?0:e.length;return s?(n&&typeof n!="number"&&Ce(e,t,n)&&(n=0,r=s),Jl(e,t,n,r)):[]}function Co(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=n==null?0:D(n);return s<0&&(s=ve(r+s,0)),ur(e,R(t,3),s)}function To(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=r-1;return n!==i&&(s=D(n),s=n<0?ve(r+s,0):Se(s,r-1)),ur(e,R(t,3),s,!0)}function Fo(e){var t=e==null?0:e.length;return t?xe(e,1):[]}function ih(e){var t=e==null?0:e.length;return t?xe(e,at):[]}function sh(e,t){var n=e==null?0:e.length;return n?(t=t===i?1:D(t),xe(e,t)):[]}function ah(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var s=e[t];r[s[0]]=s[1]}return r}function Io(e){return e&&e.length?e[0]:i}function oh(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=n==null?0:D(n);return s<0&&(s=ve(r+s,0)),pn(e,t,s)}function uh(e){var t=e==null?0:e.length;return t?Xe(e,0,-1):[]}var ch=B(function(e){var t=oe(e,zi);return t.length&&t[0]===e[0]?Wi(t):[]}),lh=B(function(e){var t=Qe(e),n=oe(e,zi);return t===Qe(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Wi(n,R(t,2)):[]}),fh=B(function(e){var t=Qe(e),n=oe(e,zi);return t=typeof t=="function"?t:i,t&&n.pop(),n.length&&n[0]===e[0]?Wi(n,i,t):[]});function hh(e,t){return e==null?"":ol.call(e,t)}function Qe(e){var t=e==null?0:e.length;return t?e[t-1]:i}function ph(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=r;return n!==i&&(s=D(n),s=s<0?ve(r+s,0):Se(s,r-1)),t===t?Hc(e,t,s):ur(e,ua,s,!0)}function dh(e,t){return e&&e.length?$a(e,D(t)):i}var gh=B(Ro);function Ro(e,t){return e&&e.length&&t&&t.length?ki(e,t):e}function mh(e,t,n){return e&&e.length&&t&&t.length?ki(e,t,R(n,2)):e}function vh(e,t,n){return e&&e.length&&t&&t.length?ki(e,t,i,n):e}var _h=mt(function(e,t){var n=e==null?0:e.length,r=Li(e,t);return qa(e,oe(t,function(s){return vt(s,n)?+s:s}).sort(Qa)),r});function wh(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,s=[],u=e.length;for(t=R(t,3);++r<u;){var l=e[r];t(l,r,e)&&(n.push(l),s.push(r))}return qa(e,s),n}function os(e){return e==null?e:fl.call(e)}function yh(e,t,n){var r=e==null?0:e.length;return r?(n&&typeof n!="number"&&Ce(e,t,n)?(t=0,n=r):(t=t==null?0:D(t),n=n===i?r:D(n)),Xe(e,t,n)):[]}function xh(e,t){return Fr(e,t)}function Sh(e,t,n){return Gi(e,t,R(n,2))}function Ah(e,t){var n=e==null?0:e.length;if(n){var r=Fr(e,t);if(r<n&&it(e[r],t))return r}return-1}function bh(e,t){return Fr(e,t,!0)}function Eh(e,t,n){return Gi(e,t,R(n,2),!0)}function Ch(e,t){var n=e==null?0:e.length;if(n){var r=Fr(e,t,!0)-1;if(it(e[r],t))return r}return-1}function Th(e){return e&&e.length?Ga(e):[]}function Fh(e,t){return e&&e.length?Ga(e,R(t,2)):[]}function Ih(e){var t=e==null?0:e.length;return t?Xe(e,1,t):[]}function Rh(e,t,n){return e&&e.length?(t=n||t===i?1:D(t),Xe(e,0,t<0?0:t)):[]}function Ph(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===i?1:D(t),t=r-t,Xe(e,t<0?0:t,r)):[]}function Oh(e,t){return e&&e.length?Ir(e,R(t,3),!1,!0):[]}function Lh(e,t){return e&&e.length?Ir(e,R(t,3)):[]}var Mh=B(function(e){return Ut(xe(e,1,he,!0))}),Nh=B(function(e){var t=Qe(e);return he(t)&&(t=i),Ut(xe(e,1,he,!0),R(t,2))}),Uh=B(function(e){var t=Qe(e);return t=typeof t=="function"?t:i,Ut(xe(e,1,he,!0),i,t)});function Wh(e){return e&&e.length?Ut(e):[]}function Dh(e,t){return e&&e.length?Ut(e,R(t,2)):[]}function $h(e,t){return t=typeof t=="function"?t:i,e&&e.length?Ut(e,i,t):[]}function us(e){if(!(e&&e.length))return[];var t=0;return e=Pt(e,function(n){if(he(n))return t=ve(n.length,t),!0}),Ei(t,function(n){return oe(e,Si(n))})}function Po(e,t){if(!(e&&e.length))return[];var n=us(e);return t==null?n:oe(n,function(r){return We(t,i,r)})}var Bh=B(function(e,t){return he(e)?Bn(e,t):[]}),kh=B(function(e){return Ki(Pt(e,he))}),qh=B(function(e){var t=Qe(e);return he(t)&&(t=i),Ki(Pt(e,he),R(t,2))}),jh=B(function(e){var t=Qe(e);return t=typeof t=="function"?t:i,Ki(Pt(e,he),i,t)}),Gh=B(us);function Hh(e,t){return Ja(e||[],t||[],$n)}function Kh(e,t){return Ja(e||[],t||[],jn)}var zh=B(function(e){var t=e.length,n=t>1?e[t-1]:i;return n=typeof n=="function"?(e.pop(),n):i,Po(e,n)});function Oo(e){var t=o(e);return t.__chain__=!0,t}function Jh(e,t){return t(e),e}function Dr(e,t){return t(e)}var Yh=mt(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,s=function(u){return Li(u,e)};return t>1||this.__actions__.length||!(r instanceof j)||!vt(n)?this.thru(s):(r=r.slice(n,+n+(t?1:0)),r.__actions__.push({func:Dr,args:[s],thisArg:i}),new Ye(r,this.__chain__).thru(function(u){return t&&!u.length&&u.push(i),u}))});function Zh(){return Oo(this)}function Xh(){return new Ye(this.value(),this.__chain__)}function Qh(){this.__values__===i&&(this.__values__=Ko(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function Vh(){return this}function ep(e){for(var t,n=this;n instanceof Ar;){var r=Eo(n);r.__index__=0,r.__values__=i,t?s.__wrapped__=r:t=r;var s=r;n=n.__wrapped__}return s.__wrapped__=e,t}function tp(){var e=this.__wrapped__;if(e instanceof j){var t=e;return this.__actions__.length&&(t=new j(this)),t=t.reverse(),t.__actions__.push({func:Dr,args:[os],thisArg:i}),new Ye(t,this.__chain__)}return this.thru(os)}function np(){return za(this.__wrapped__,this.__actions__)}var rp=Rr(function(e,t,n){Q.call(e,n)?++e[n]:dt(e,n,1)});function ip(e,t,n){var r=U(e)?aa:zl;return n&&Ce(e,t,n)&&(t=i),r(e,R(t,3))}function sp(e,t){var n=U(e)?Pt:Ra;return n(e,R(t,3))}var ap=io(Co),op=io(To);function up(e,t){return xe($r(e,t),1)}function cp(e,t){return xe($r(e,t),at)}function lp(e,t,n){return n=n===i?1:D(n),xe($r(e,t),n)}function Lo(e,t){var n=U(e)?ze:Nt;return n(e,R(t,3))}function Mo(e,t){var n=U(e)?Fc:Ia;return n(e,R(t,3))}var fp=Rr(function(e,t,n){Q.call(e,n)?e[n].push(t):dt(e,n,[t])});function hp(e,t,n,r){e=Re(e)?e:En(e),n=n&&!r?D(n):0;var s=e.length;return n<0&&(n=ve(s+n,0)),Gr(e)?n<=s&&e.indexOf(t,n)>-1:!!s&&pn(e,t,n)>-1}var pp=B(function(e,t,n){var r=-1,s=typeof t=="function",u=Re(e)?m(e.length):[];return Nt(e,function(l){u[++r]=s?We(t,l,n):kn(l,t,n)}),u}),dp=Rr(function(e,t,n){dt(e,n,t)});function $r(e,t){var n=U(e)?oe:Ua;return n(e,R(t,3))}function gp(e,t,n,r){return e==null?[]:(U(t)||(t=t==null?[]:[t]),n=r?i:n,U(n)||(n=n==null?[]:[n]),Ba(e,t,n))}var mp=Rr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function vp(e,t,n){var r=U(e)?yi:la,s=arguments.length<3;return r(e,R(t,4),n,s,Nt)}function _p(e,t,n){var r=U(e)?Ic:la,s=arguments.length<3;return r(e,R(t,4),n,s,Ia)}function wp(e,t){var n=U(e)?Pt:Ra;return n(e,qr(R(t,3)))}function yp(e){var t=U(e)?Ea:hf;return t(e)}function xp(e,t,n){(n?Ce(e,t,n):t===i)?t=1:t=D(t);var r=U(e)?ql:pf;return r(e,t)}function Sp(e){var t=U(e)?jl:gf;return t(e)}function Ap(e){if(e==null)return 0;if(Re(e))return Gr(e)?gn(e):e.length;var t=Ae(e);return t==Ne||t==Ue?e.size:$i(e).length}function bp(e,t,n){var r=U(e)?xi:mf;return n&&Ce(e,t,n)&&(t=i),r(e,R(t,3))}var Ep=B(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Ce(e,t[0],t[1])?t=[]:n>2&&Ce(t[0],t[1],t[2])&&(t=[t[0]]),Ba(e,xe(t,1),[])}),Br=il||function(){return ye.Date.now()};function Cp(e,t){if(typeof t!="function")throw new Je(S);return e=D(e),function(){if(--e<1)return t.apply(this,arguments)}}function No(e,t,n){return t=n?i:t,t=e&&t==null?e.length:t,gt(e,se,i,i,i,i,t)}function Uo(e,t){var n;if(typeof t!="function")throw new Je(S);return e=D(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var cs=B(function(e,t,n){var r=de;if(n.length){var s=Lt(n,An(cs));r|=Z}return gt(e,r,t,n,s)}),Wo=B(function(e,t,n){var r=de|Me;if(n.length){var s=Lt(n,An(Wo));r|=Z}return gt(t,r,e,n,s)});function Do(e,t,n){t=n?i:t;var r=gt(e,Fe,i,i,i,i,i,t);return r.placeholder=Do.placeholder,r}function $o(e,t,n){t=n?i:t;var r=gt(e,F,i,i,i,i,i,t);return r.placeholder=$o.placeholder,r}function Bo(e,t,n){var r,s,u,l,h,d,w=0,y=!1,x=!1,E=!0;if(typeof e!="function")throw new Je(S);t=Ve(t)||0,ce(n)&&(y=!!n.leading,x="maxWait"in n,u=x?ve(Ve(n.maxWait)||0,t):u,E="trailing"in n?!!n.trailing:E);function T(pe){var st=r,yt=s;return r=s=i,w=pe,l=e.apply(yt,st),l}function L(pe){return w=pe,h=Kn(q,t),y?T(pe):l}function $(pe){var st=pe-d,yt=pe-w,su=t-st;return x?Se(su,u-yt):su}function M(pe){var st=pe-d,yt=pe-w;return d===i||st>=t||st<0||x&&yt>=u}function q(){var pe=Br();if(M(pe))return H(pe);h=Kn(q,$(pe))}function H(pe){return h=i,E&&r?T(pe):(r=s=i,l)}function ke(){h!==i&&Ya(h),w=0,r=d=s=h=i}function Te(){return h===i?l:H(Br())}function qe(){var pe=Br(),st=M(pe);if(r=arguments,s=this,d=pe,st){if(h===i)return L(d);if(x)return Ya(h),h=Kn(q,t),T(d)}return h===i&&(h=Kn(q,t)),l}return qe.cancel=ke,qe.flush=Te,qe}var Tp=B(function(e,t){return Fa(e,1,t)}),Fp=B(function(e,t,n){return Fa(e,Ve(t)||0,n)});function Ip(e){return gt(e,ne)}function kr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new Je(S);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],u=n.cache;if(u.has(s))return u.get(s);var l=e.apply(this,r);return n.cache=u.set(s,l)||u,l};return n.cache=new(kr.Cache||pt),n}kr.Cache=pt;function qr(e){if(typeof e!="function")throw new Je(S);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 Rp(e){return Uo(2,e)}var Pp=vf(function(e,t){t=t.length==1&&U(t[0])?oe(t[0],De(R())):oe(xe(t,1),De(R()));var n=t.length;return B(function(r){for(var s=-1,u=Se(r.length,n);++s<u;)r[s]=t[s].call(this,r[s]);return We(e,this,r)})}),ls=B(function(e,t){var n=Lt(t,An(ls));return gt(e,Z,i,t,n)}),ko=B(function(e,t){var n=Lt(t,An(ko));return gt(e,z,i,t,n)}),Op=mt(function(e,t){return gt(e,je,i,i,i,t)});function Lp(e,t){if(typeof e!="function")throw new Je(S);return t=t===i?t:D(t),B(e,t)}function Mp(e,t){if(typeof e!="function")throw new Je(S);return t=t==null?0:ve(D(t),0),B(function(n){var r=n[t],s=Dt(n,0,t);return r&&Ot(s,r),We(e,this,s)})}function Np(e,t,n){var r=!0,s=!0;if(typeof e!="function")throw new Je(S);return ce(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),Bo(e,t,{leading:r,maxWait:t,trailing:s})}function Up(e){return No(e,1)}function Wp(e,t){return ls(Ji(t),e)}function Dp(){if(!arguments.length)return[];var e=arguments[0];return U(e)?e:[e]}function $p(e){return Ze(e,k)}function Bp(e,t){return t=typeof t=="function"?t:i,Ze(e,k,t)}function kp(e){return Ze(e,G|k)}function qp(e,t){return t=typeof t=="function"?t:i,Ze(e,G|k,t)}function jp(e,t){return t==null||Ta(e,t,we(t))}function it(e,t){return e===t||e!==e&&t!==t}var Gp=Mr(Ui),Hp=Mr(function(e,t){return e>=t}),an=La(function(){return arguments}())?La:function(e){return fe(e)&&Q.call(e,"callee")&&!wa.call(e,"callee")},U=m.isArray,Kp=ea?De(ea):Vl;function Re(e){return e!=null&&jr(e.length)&&!_t(e)}function he(e){return fe(e)&&Re(e)}function zp(e){return e===!0||e===!1||fe(e)&&Ee(e)==Ht}var $t=al||xs,Jp=ta?De(ta):ef;function Yp(e){return fe(e)&&e.nodeType===1&&!zn(e)}function Zp(e){if(e==null)return!0;if(Re(e)&&(U(e)||typeof e=="string"||typeof e.splice=="function"||$t(e)||bn(e)||an(e)))return!e.length;var t=Ae(e);if(t==Ne||t==Ue)return!e.size;if(Hn(e))return!$i(e).length;for(var n in e)if(Q.call(e,n))return!1;return!0}function Xp(e,t){return qn(e,t)}function Qp(e,t,n){n=typeof n=="function"?n:i;var r=n?n(e,t):i;return r===i?qn(e,t,i,n):!!r}function fs(e){if(!fe(e))return!1;var t=Ee(e);return t==cn||t==ri||typeof e.message=="string"&&typeof e.name=="string"&&!zn(e)}function Vp(e){return typeof e=="number"&&xa(e)}function _t(e){if(!ce(e))return!1;var t=Ee(e);return t==ln||t==tr||t==ni||t==nr}function qo(e){return typeof e=="number"&&e==D(e)}function jr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=et}function ce(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function fe(e){return e!=null&&typeof e=="object"}var jo=na?De(na):nf;function ed(e,t){return e===t||Di(e,t,ts(t))}function td(e,t,n){return n=typeof n=="function"?n:i,Di(e,t,ts(t),n)}function nd(e){return Go(e)&&e!=+e}function rd(e){if(Bf(e))throw new N(_);return Ma(e)}function id(e){return e===null}function sd(e){return e==null}function Go(e){return typeof e=="number"||fe(e)&&Ee(e)==zt}function zn(e){if(!fe(e)||Ee(e)!=tt)return!1;var t=mr(e);if(t===null)return!0;var n=Q.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&hr.call(n)==el}var hs=ra?De(ra):rf;function ad(e){return qo(e)&&e>=-et&&e<=et}var Ho=ia?De(ia):sf;function Gr(e){return typeof e=="string"||!U(e)&&fe(e)&&Ee(e)==Jt}function Be(e){return typeof e=="symbol"||fe(e)&&Ee(e)==fn}var bn=sa?De(sa):af;function od(e){return e===i}function ud(e){return fe(e)&&Ae(e)==It}function cd(e){return fe(e)&&Ee(e)==ai}var ld=Mr(Bi),fd=Mr(function(e,t){return e<=t});function Ko(e){if(!e)return[];if(Re(e))return Gr(e)?nt(e):Ie(e);if(Mn&&e[Mn])return qc(e[Mn]());var t=Ae(e),n=t==Ne?Ti:t==Ue?cr:En;return n(e)}function wt(e){if(!e)return e===0?e:0;if(e=Ve(e),e===at||e===-at){var t=e<0?-1:1;return t*Qr}return e===e?e:0}function D(e){var t=wt(e),n=t%1;return t===t?n?t-n:t:0}function zo(e){return e?tn(D(e),0,He):0}function Ve(e){if(typeof e=="number")return e;if(Be(e))return on;if(ce(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ce(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=fa(e);var n=Hu.test(e);return n||zu.test(e)?Ec(e.slice(2),n?2:8):Gu.test(e)?on:+e}function Jo(e){return ct(e,Pe(e))}function hd(e){return e?tn(D(e),-et,et):e===0?e:0}function X(e){return e==null?"":$e(e)}var pd=xn(function(e,t){if(Hn(t)||Re(t)){ct(t,we(t),e);return}for(var n in t)Q.call(t,n)&&$n(e,n,t[n])}),Yo=xn(function(e,t){ct(t,Pe(t),e)}),Hr=xn(function(e,t,n,r){ct(t,Pe(t),e,r)}),dd=xn(function(e,t,n,r){ct(t,we(t),e,r)}),gd=mt(Li);function md(e,t){var n=yn(e);return t==null?n:Ca(n,t)}var vd=B(function(e,t){e=te(e);var n=-1,r=t.length,s=r>2?t[2]:i;for(s&&Ce(t[0],t[1],s)&&(r=1);++n<r;)for(var u=t[n],l=Pe(u),h=-1,d=l.length;++h<d;){var w=l[h],y=e[w];(y===i||it(y,vn[w])&&!Q.call(e,w))&&(e[w]=u[w])}return e}),_d=B(function(e){return e.push(i,fo),We(Zo,i,e)});function wd(e,t){return oa(e,R(t,3),ut)}function yd(e,t){return oa(e,R(t,3),Ni)}function xd(e,t){return e==null?e:Mi(e,R(t,3),Pe)}function Sd(e,t){return e==null?e:Pa(e,R(t,3),Pe)}function Ad(e,t){return e&&ut(e,R(t,3))}function bd(e,t){return e&&Ni(e,R(t,3))}function Ed(e){return e==null?[]:Cr(e,we(e))}function Cd(e){return e==null?[]:Cr(e,Pe(e))}function ps(e,t,n){var r=e==null?i:nn(e,t);return r===i?n:r}function Td(e,t){return e!=null&&go(e,t,Yl)}function ds(e,t){return e!=null&&go(e,t,Zl)}var Fd=ao(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=pr.call(t)),e[t]=n},ms(Oe)),Id=ao(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=pr.call(t)),Q.call(e,t)?e[t].push(n):e[t]=[n]},R),Rd=B(kn);function we(e){return Re(e)?ba(e):$i(e)}function Pe(e){return Re(e)?ba(e,!0):of(e)}function Pd(e,t){var n={};return t=R(t,3),ut(e,function(r,s,u){dt(n,t(r,s,u),r)}),n}function Od(e,t){var n={};return t=R(t,3),ut(e,function(r,s,u){dt(n,s,t(r,s,u))}),n}var Ld=xn(function(e,t,n){Tr(e,t,n)}),Zo=xn(function(e,t,n,r){Tr(e,t,n,r)}),Md=mt(function(e,t){var n={};if(e==null)return n;var r=!1;t=oe(t,function(u){return u=Wt(u,e),r||(r=u.length>1),u}),ct(e,Vi(e),n),r&&(n=Ze(n,G|K|k,Ff));for(var s=t.length;s--;)Hi(n,t[s]);return n});function Nd(e,t){return Xo(e,qr(R(t)))}var Ud=mt(function(e,t){return e==null?{}:cf(e,t)});function Xo(e,t){if(e==null)return{};var n=oe(Vi(e),function(r){return[r]});return t=R(t),ka(e,n,function(r,s){return t(r,s[0])})}function Wd(e,t,n){t=Wt(t,e);var r=-1,s=t.length;for(s||(s=1,e=i);++r<s;){var u=e==null?i:e[lt(t[r])];u===i&&(r=s,u=n),e=_t(u)?u.call(e):u}return e}function Dd(e,t,n){return e==null?e:jn(e,t,n)}function $d(e,t,n,r){return r=typeof r=="function"?r:i,e==null?e:jn(e,t,n,r)}var Qo=co(we),Vo=co(Pe);function Bd(e,t,n){var r=U(e),s=r||$t(e)||bn(e);if(t=R(t,4),n==null){var u=e&&e.constructor;s?n=r?new u:[]:ce(e)?n=_t(u)?yn(mr(e)):{}:n={}}return(s?ze:ut)(e,function(l,h,d){return t(n,l,h,d)}),n}function kd(e,t){return e==null?!0:Hi(e,t)}function qd(e,t,n){return e==null?e:Ka(e,t,Ji(n))}function jd(e,t,n,r){return r=typeof r=="function"?r:i,e==null?e:Ka(e,t,Ji(n),r)}function En(e){return e==null?[]:Ci(e,we(e))}function Gd(e){return e==null?[]:Ci(e,Pe(e))}function Hd(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=Ve(n),n=n===n?n:0),t!==i&&(t=Ve(t),t=t===t?t:0),tn(Ve(e),t,n)}function Kd(e,t,n){return t=wt(t),n===i?(n=t,t=0):n=wt(n),e=Ve(e),Xl(e,t,n)}function zd(e,t,n){if(n&&typeof n!="boolean"&&Ce(e,t,n)&&(t=n=i),n===i&&(typeof t=="boolean"?(n=t,t=i):typeof e=="boolean"&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=wt(e),t===i?(t=e,e=0):t=wt(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var s=Sa();return Se(e+s*(t-e+bc("1e-"+((s+"").length-1))),t)}return qi(e,t)}var Jd=Sn(function(e,t,n){return t=t.toLowerCase(),e+(n?eu(t):t)});function eu(e){return gs(X(e).toLowerCase())}function tu(e){return e=X(e),e&&e.replace(Yu,Wc).replace(dc,"")}function Yd(e,t,n){e=X(e),t=$e(t);var r=e.length;n=n===i?r:tn(D(n),0,r);var s=n;return n-=t.length,n>=0&&e.slice(n,s)==t}function Zd(e){return e=X(e),e&&Iu.test(e)?e.replace(Ps,Dc):e}function Xd(e){return e=X(e),e&&Nu.test(e)?e.replace(li,"\\$&"):e}var Qd=Sn(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Vd=Sn(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),eg=ro("toLowerCase");function tg(e,t,n){e=X(e),t=D(t);var r=t?gn(e):0;if(!t||r>=t)return e;var s=(t-r)/2;return Lr(yr(s),n)+e+Lr(wr(s),n)}function ng(e,t,n){e=X(e),t=D(t);var r=t?gn(e):0;return t&&r<t?e+Lr(t-r,n):e}function rg(e,t,n){e=X(e),t=D(t);var r=t?gn(e):0;return t&&r<t?Lr(t-r,n)+e:e}function ig(e,t,n){return n||t==null?t=0:t&&(t=+t),ll(X(e).replace(fi,""),t||0)}function sg(e,t,n){return(n?Ce(e,t,n):t===i)?t=1:t=D(t),ji(X(e),t)}function ag(){var e=arguments,t=X(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var og=Sn(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});function ug(e,t,n){return n&&typeof n!="number"&&Ce(e,t,n)&&(t=n=i),n=n===i?He:n>>>0,n?(e=X(e),e&&(typeof t=="string"||t!=null&&!hs(t))&&(t=$e(t),!t&&dn(e))?Dt(nt(e),0,n):e.split(t,n)):[]}var cg=Sn(function(e,t,n){return e+(n?" ":"")+gs(t)});function lg(e,t,n){return e=X(e),n=n==null?0:tn(D(n),0,e.length),t=$e(t),e.slice(n,n+t.length)==t}function fg(e,t,n){var r=o.templateSettings;n&&Ce(e,t,n)&&(t=i),e=X(e),t=Hr({},t,r,lo);var s=Hr({},t.imports,r.imports,lo),u=we(s),l=Ci(s,u),h,d,w=0,y=t.interpolate||ir,x="__p += '",E=Fi((t.escape||ir).source+"|"+y.source+"|"+(y===Os?ju:ir).source+"|"+(t.evaluate||ir).source+"|$","g"),T="//# sourceURL="+(Q.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++wc+"]")+`
|
|
212
|
+
`;e.replace(E,function(M,q,H,ke,Te,qe){return H||(H=ke),x+=e.slice(w,qe).replace(Zu,$c),q&&(h=!0,x+=`' +
|
|
213
|
+
__e(`+q+`) +
|
|
214
|
+
'`),Te&&(d=!0,x+=`';
|
|
215
|
+
`+Te+`;
|
|
216
216
|
__p += '`),H&&(x+=`' +
|
|
217
217
|
((__t = (`+H+`)) == null ? '' : __t) +
|
|
218
|
-
'`),w=
|
|
218
|
+
'`),w=qe+M.length,M}),x+=`';
|
|
219
219
|
`;var L=Q.call(t,"variable")&&t.variable;if(!L)x=`with (obj) {
|
|
220
220
|
`+x+`
|
|
221
221
|
}
|
|
222
|
-
`;else if(
|
|
222
|
+
`;else if(ku.test(L))throw new N(A);x=(d?x.replace(Eu,""):x).replace(Cu,"$1").replace(Tu,"$1;"),x="function("+(L||"obj")+`) {
|
|
223
223
|
`+(L?"":`obj || (obj = {});
|
|
224
224
|
`)+"var __t, __p = ''"+(h?", __e = _.escape":"")+(d?`, __j = Array.prototype.join;
|
|
225
225
|
function print() { __p += __j.call(arguments, '') }
|
|
226
226
|
`:`;
|
|
227
227
|
`)+x+`return __p
|
|
228
|
-
}`;var $=iu(function(){return Y(u,T+"return "+x).apply(i,l)});if($.source=x,hs($))throw $;return $}function pg(e){return X(e).toLowerCase()}function dg(e){return X(e).toUpperCase()}function gg(e,t,n){if(e=X(e),e&&(n||t===i))return ha(e);if(!e||!(t=De(t)))return e;var r=nt(e),s=nt(t),u=pa(r,s),l=da(r,s)+1;return Bt(r,u,l).join("")}function mg(e,t,n){if(e=X(e),e&&(n||t===i))return e.slice(0,ma(e)+1);if(!e||!(t=De(t)))return e;var r=nt(e),s=da(r,nt(t))+1;return Bt(r,0,s).join("")}function vg(e,t,n){if(e=X(e),e&&(n||t===i))return e.replace(hi,"");if(!e||!(t=De(t)))return e;var r=nt(e),s=pa(r,nt(t));return Bt(r,s).join("")}function _g(e,t){var n=Ht,r=Ge;if(ce(t)){var s="separator"in t?t.separator:s;n="length"in t?D(t.length):n,r="omission"in t?De(t.omission):r}e=X(e);var u=e.length;if(gn(e)){var l=nt(e);u=l.length}if(n>=u)return e;var h=n-mn(r);if(h<1)return r;var d=l?Bt(l,0,h).join(""):e.slice(0,h);if(s===i)return d+r;if(l&&(h+=d.length-h),ps(s)){if(e.slice(h).search(s)){var w,y=d;for(s.global||(s=Ii(s.source,X(Ms.exec(s))+"g")),s.lastIndex=0;w=s.exec(y);)var x=w.index;d=d.slice(0,x===i?h:x)}}else if(e.indexOf(De(s),h)!=h){var E=d.lastIndexOf(s);E>-1&&(d=d.slice(0,E))}return d+r}function wg(e){return e=X(e),e&&Iu.test(e)?e.replace(Ps,zc):e}var yg=An(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),ms=io("toUpperCase");function ru(e,t,n){return e=X(e),t=n?i:t,t===i?jc(e)?Zc(e):Lc(e):e.match(t)||[]}var iu=B(function(e,t){try{return Ue(e,i,t)}catch(n){return hs(n)?n:new N(n)}}),xg=vt(function(e,t){return ze(t,function(n){n=lt(n),gt(e,n,ls(e[n],e))}),e});function Sg(e){var t=e==null?0:e.length,n=R();return e=t?oe(e,function(r){if(typeof r[1]!="function")throw new Je(S);return[n(r[0]),r[1]]}):[],B(function(r){for(var s=-1;++s<t;){var u=e[s];if(Ue(u[0],this,r))return Ue(u[1],this,r)}})}function Ag(e){return zl(Ze(e,G))}function vs(e){return function(){return e}}function bg(e,t){return e==null||e!==e?t:e}var Eg=ao(),Cg=ao(!0);function Pe(e){return e}function _s(e){return Ua(typeof e=="function"?e:Ze(e,G))}function Tg(e){return Da(Ze(e,G))}function Fg(e,t){return $a(e,Ze(t,G))}var Ig=B(function(e,t){return function(n){return jn(n,e,t)}}),Rg=B(function(e,t){return function(n){return jn(e,n,t)}});function ws(e,t,n){var r=_e(t),s=Tr(t,r);n==null&&!(ce(t)&&(s.length||!r.length))&&(n=t,t=e,e=this,s=Tr(t,_e(t)));var u=!(ce(n)&&"chain"in n)||!!n.chain,l=wt(e);return ze(s,function(h){var d=t[h];e[h]=d,l&&(e.prototype[h]=function(){var w=this.__chain__;if(u||w){var y=e(this.__wrapped__),x=y.__actions__=Fe(this.__actions__);return x.push({func:d,args:arguments,thisArg:e}),y.__chain__=w,y}return d.apply(e,Mt([this.value()],arguments))})}),e}function Pg(){return we._===this&&(we._=nl),this}function ys(){}function Og(e){return e=D(e),B(function(t){return Ba(t,e)})}var Lg=Xi(oe),Mg=Xi(oa),Ng=Xi(Si);function su(e){return is(e)?Ai(lt(e)):ff(e)}function Ug(e){return function(t){return e==null?i:rn(e,t)}}var Wg=uo(),Dg=uo(!0);function xs(){return[]}function Ss(){return!1}function $g(){return{}}function Bg(){return""}function kg(){return!0}function jg(e,t){if(e=D(e),e<1||e>et)return[];var n=He,r=xe(e,He);t=R(t),e-=He;for(var s=Ci(r,t);++n<e;)t(n);return s}function qg(e){return U(e)?oe(e,lt):$e(e)?[e]:Fe(Eo(X(e)))}function Gg(e){var t=++el;return X(e)+t}var Hg=Lr(function(e,t){return e+t},0),Kg=Qi("ceil"),zg=Lr(function(e,t){return e/t},1),Jg=Qi("floor");function Yg(e){return e&&e.length?Cr(e,Pe,Wi):i}function Zg(e,t){return e&&e.length?Cr(e,R(t,2),Wi):i}function Xg(e){return la(e,Pe)}function Qg(e,t){return la(e,R(t,2))}function Vg(e){return e&&e.length?Cr(e,Pe,ki):i}function em(e,t){return e&&e.length?Cr(e,R(t,2),ki):i}var tm=Lr(function(e,t){return e*t},1),nm=Qi("round"),rm=Lr(function(e,t){return e-t},0);function im(e){return e&&e.length?Ei(e,Pe):0}function sm(e,t){return e&&e.length?Ei(e,R(t,2)):0}return o.after=Tp,o.ary=Uo,o.assign=dd,o.assignIn=Zo,o.assignInWith=Kr,o.assignWith=gd,o.at=md,o.before=Wo,o.bind=ls,o.bindAll=xg,o.bindKey=Do,o.castArray=$p,o.chain=Lo,o.chunk=Jf,o.compact=Yf,o.concat=Zf,o.cond=Sg,o.conforms=Ag,o.constant=vs,o.countBy=ip,o.create=vd,o.curry=$o,o.curryRight=Bo,o.debounce=ko,o.defaults=_d,o.defaultsDeep=wd,o.defer=Fp,o.delay=Ip,o.difference=Xf,o.differenceBy=Qf,o.differenceWith=Vf,o.drop=eh,o.dropRight=th,o.dropRightWhile=nh,o.dropWhile=rh,o.fill=ih,o.filter=ap,o.flatMap=cp,o.flatMapDeep=lp,o.flatMapDepth=fp,o.flatten=Io,o.flattenDeep=sh,o.flattenDepth=ah,o.flip=Rp,o.flow=Eg,o.flowRight=Cg,o.fromPairs=oh,o.functions=Cd,o.functionsIn=Td,o.groupBy=hp,o.initial=ch,o.intersection=lh,o.intersectionBy=fh,o.intersectionWith=hh,o.invert=Id,o.invertBy=Rd,o.invokeMap=dp,o.iteratee=_s,o.keyBy=gp,o.keys=_e,o.keysIn=Re,o.map=Br,o.mapKeys=Od,o.mapValues=Ld,o.matches=Tg,o.matchesProperty=Fg,o.memoize=jr,o.merge=Md,o.mergeWith=Xo,o.method=Ig,o.methodOf=Rg,o.mixin=ws,o.negate=qr,o.nthArg=Og,o.omit=Nd,o.omitBy=Ud,o.once=Pp,o.orderBy=mp,o.over=Lg,o.overArgs=Op,o.overEvery=Mg,o.overSome=Ng,o.partial=fs,o.partialRight=jo,o.partition=vp,o.pick=Wd,o.pickBy=Qo,o.property=su,o.propertyOf=Ug,o.pull=mh,o.pullAll=Po,o.pullAllBy=vh,o.pullAllWith=_h,o.pullAt=wh,o.range=Wg,o.rangeRight=Dg,o.rearg=Lp,o.reject=yp,o.remove=yh,o.rest=Mp,o.reverse=us,o.sampleSize=Sp,o.set=$d,o.setWith=Bd,o.shuffle=Ap,o.slice=xh,o.sortBy=Cp,o.sortedUniq=Fh,o.sortedUniqBy=Ih,o.split=cg,o.spread=Np,o.tail=Rh,o.take=Ph,o.takeRight=Oh,o.takeRightWhile=Lh,o.takeWhile=Mh,o.tap=Yh,o.throttle=Up,o.thru=$r,o.toArray=zo,o.toPairs=Vo,o.toPairsIn=eu,o.toPath=qg,o.toPlainObject=Yo,o.transform=kd,o.unary=Wp,o.union=Nh,o.unionBy=Uh,o.unionWith=Wh,o.uniq=Dh,o.uniqBy=$h,o.uniqWith=Bh,o.unset=jd,o.unzip=cs,o.unzipWith=Oo,o.update=qd,o.updateWith=Gd,o.values=Cn,o.valuesIn=Hd,o.without=kh,o.words=ru,o.wrap=Dp,o.xor=jh,o.xorBy=qh,o.xorWith=Gh,o.zip=Hh,o.zipObject=Kh,o.zipObjectDeep=zh,o.zipWith=Jh,o.entries=Vo,o.entriesIn=eu,o.extend=Zo,o.extendWith=Kr,ws(o,o),o.add=Hg,o.attempt=iu,o.camelCase=Yd,o.capitalize=tu,o.ceil=Kg,o.clamp=Kd,o.clone=Bp,o.cloneDeep=jp,o.cloneDeepWith=qp,o.cloneWith=kp,o.conformsTo=Gp,o.deburr=nu,o.defaultTo=bg,o.divide=zg,o.endsWith=Zd,o.eq=it,o.escape=Xd,o.escapeRegExp=Qd,o.every=sp,o.find=op,o.findIndex=To,o.findKey=yd,o.findLast=up,o.findLastIndex=Fo,o.findLastKey=xd,o.floor=Jg,o.forEach=Mo,o.forEachRight=No,o.forIn=Sd,o.forInRight=Ad,o.forOwn=bd,o.forOwnRight=Ed,o.get=ds,o.gt=Hp,o.gte=Kp,o.has=Fd,o.hasIn=gs,o.head=Ro,o.identity=Pe,o.includes=pp,o.indexOf=uh,o.inRange=zd,o.invoke=Pd,o.isArguments=on,o.isArray=U,o.isArrayBuffer=zp,o.isArrayLike=Ie,o.isArrayLikeObject=fe,o.isBoolean=Jp,o.isBuffer=kt,o.isDate=Yp,o.isElement=Zp,o.isEmpty=Xp,o.isEqual=Qp,o.isEqualWith=Vp,o.isError=hs,o.isFinite=ed,o.isFunction=wt,o.isInteger=qo,o.isLength=Gr,o.isMap=Go,o.isMatch=td,o.isMatchWith=nd,o.isNaN=rd,o.isNative=id,o.isNil=ad,o.isNull=sd,o.isNumber=Ho,o.isObject=ce,o.isObjectLike=le,o.isPlainObject=Jn,o.isRegExp=ps,o.isSafeInteger=od,o.isSet=Ko,o.isString=Hr,o.isSymbol=$e,o.isTypedArray=En,o.isUndefined=ud,o.isWeakMap=cd,o.isWeakSet=ld,o.join=ph,o.kebabCase=Vd,o.last=Qe,o.lastIndexOf=dh,o.lowerCase=eg,o.lowerFirst=tg,o.lt=fd,o.lte=hd,o.max=Yg,o.maxBy=Zg,o.mean=Xg,o.meanBy=Qg,o.min=Vg,o.minBy=em,o.stubArray=xs,o.stubFalse=Ss,o.stubObject=$g,o.stubString=Bg,o.stubTrue=kg,o.multiply=tm,o.nth=gh,o.noConflict=Pg,o.noop=ys,o.now=kr,o.pad=ng,o.padEnd=rg,o.padStart=ig,o.parseInt=sg,o.random=Jd,o.reduce=_p,o.reduceRight=wp,o.repeat=ag,o.replace=og,o.result=Dd,o.round=nm,o.runInContext=p,o.sample=xp,o.size=bp,o.snakeCase=ug,o.some=Ep,o.sortedIndex=Sh,o.sortedIndexBy=Ah,o.sortedIndexOf=bh,o.sortedLastIndex=Eh,o.sortedLastIndexBy=Ch,o.sortedLastIndexOf=Th,o.startCase=lg,o.startsWith=fg,o.subtract=rm,o.sum=im,o.sumBy=sm,o.template=hg,o.times=jg,o.toFinite=yt,o.toInteger=D,o.toLength=Jo,o.toLower=pg,o.toNumber=Ve,o.toSafeInteger=pd,o.toString=X,o.toUpper=dg,o.trim=gg,o.trimEnd=mg,o.trimStart=vg,o.truncate=_g,o.unescape=wg,o.uniqueId=Gg,o.upperCase=yg,o.upperFirst=ms,o.each=Mo,o.eachRight=No,o.first=Ro,ws(o,function(){var e={};return ut(o,function(t,n){Q.call(o.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),o.VERSION=f,ze(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){o[e].placeholder=o}),ze(["drop","take"],function(e,t){q.prototype[e]=function(n){n=n===i?1:me(D(n),0);var r=this.__filtered__&&!t?new q(this):this.clone();return r.__filtered__?r.__takeCount__=xe(n,r.__takeCount__):r.__views__.push({size:xe(n,He),type:e+(r.__dir__<0?"Right":"")}),r},q.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),ze(["filter","map","takeWhile"],function(e,t){var n=t+1,r=n==Vn||n==tr;q.prototype[e]=function(s){var u=this.clone();return u.__iteratees__.push({iteratee:R(s,3),type:n}),u.__filtered__=u.__filtered__||r,u}}),ze(["head","last"],function(e,t){var n="take"+(t?"Right":"");q.prototype[e]=function(){return this[n](1).value()[0]}}),ze(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");q.prototype[e]=function(){return this.__filtered__?new q(this):this[n](1)}}),q.prototype.compact=function(){return this.filter(Pe)},q.prototype.find=function(e){return this.filter(e).head()},q.prototype.findLast=function(e){return this.reverse().find(e)},q.prototype.invokeMap=B(function(e,t){return typeof e=="function"?new q(this):this.map(function(n){return jn(n,e,t)})}),q.prototype.reject=function(e){return this.filter(qr(R(e)))},q.prototype.slice=function(e,t){e=D(e);var n=this;return n.__filtered__&&(e>0||t<0)?new q(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=D(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},q.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},q.prototype.toArray=function(){return this.take(He)},ut(q.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),s=o[r?"take"+(t=="last"?"Right":""):t],u=r||/^find/.test(t);s&&(o.prototype[t]=function(){var l=this.__wrapped__,h=r?[1]:arguments,d=l instanceof q,w=h[0],y=d||U(l),x=function(j){var H=s.apply(o,Mt([j],h));return r&&E?H[0]:H};y&&n&&typeof w=="function"&&w.length!=1&&(d=y=!1);var E=this.__chain__,T=!!this.__actions__.length,L=u&&!E,$=d&&!T;if(!u&&y){l=$?l:new q(this);var M=e.apply(l,h);return M.__actions__.push({func:$r,args:[x],thisArg:i}),new Ye(M,E)}return L&&$?e.apply(this,h):(M=this.thru(x),L?r?M.value()[0]:M.value():M)})}),ze(["pop","push","shift","sort","splice","unshift"],function(e){var t=fr[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);o.prototype[e]=function(){var s=arguments;if(r&&!this.__chain__){var u=this.value();return t.apply(U(u)?u:[],s)}return this[n](function(l){return t.apply(U(l)?l:[],s)})}}),ut(q.prototype,function(e,t){var n=o[t];if(n){var r=n.name+"";Q.call(yn,r)||(yn[r]=[]),yn[r].push({name:t,func:n})}}),yn[Or(i,Le).name]=[{name:"wrapper",func:i}],q.prototype.clone=_l,q.prototype.reverse=wl,q.prototype.value=yl,o.prototype.at=Zh,o.prototype.chain=Xh,o.prototype.commit=Qh,o.prototype.next=Vh,o.prototype.plant=tp,o.prototype.reverse=np,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=rp,o.prototype.first=o.prototype.head,Nn&&(o.prototype[Nn]=ep),o},vn=Xc();Qt?((Qt.exports=vn)._=vn,_i._=vn):we._=vn}).call(av)}(Xn,Xn.exports)),Xn.exports}var uv=ov();const Ts=c=>{const a=uv.startCase(c).toLowerCase();return a.charAt(0).toUpperCase()+a.slice(1)},cv=({data:c})=>`import { defineObject } from 'twenty-sdk';
|
|
228
|
+
}`;var $=ru(function(){return Y(u,T+"return "+x).apply(i,l)});if($.source=x,fs($))throw $;return $}function hg(e){return X(e).toLowerCase()}function pg(e){return X(e).toUpperCase()}function dg(e,t,n){if(e=X(e),e&&(n||t===i))return fa(e);if(!e||!(t=$e(t)))return e;var r=nt(e),s=nt(t),u=ha(r,s),l=pa(r,s)+1;return Dt(r,u,l).join("")}function gg(e,t,n){if(e=X(e),e&&(n||t===i))return e.slice(0,ga(e)+1);if(!e||!(t=$e(t)))return e;var r=nt(e),s=pa(r,nt(t))+1;return Dt(r,0,s).join("")}function mg(e,t,n){if(e=X(e),e&&(n||t===i))return e.replace(fi,"");if(!e||!(t=$e(t)))return e;var r=nt(e),s=ha(r,nt(t));return Dt(r,s).join("")}function vg(e,t){var n=Gt,r=Ge;if(ce(t)){var s="separator"in t?t.separator:s;n="length"in t?D(t.length):n,r="omission"in t?$e(t.omission):r}e=X(e);var u=e.length;if(dn(e)){var l=nt(e);u=l.length}if(n>=u)return e;var h=n-gn(r);if(h<1)return r;var d=l?Dt(l,0,h).join(""):e.slice(0,h);if(s===i)return d+r;if(l&&(h+=d.length-h),hs(s)){if(e.slice(h).search(s)){var w,y=d;for(s.global||(s=Fi(s.source,X(Ls.exec(s))+"g")),s.lastIndex=0;w=s.exec(y);)var x=w.index;d=d.slice(0,x===i?h:x)}}else if(e.indexOf($e(s),h)!=h){var E=d.lastIndexOf(s);E>-1&&(d=d.slice(0,E))}return d+r}function _g(e){return e=X(e),e&&Fu.test(e)?e.replace(Rs,Kc):e}var wg=Sn(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),gs=ro("toUpperCase");function nu(e,t,n){return e=X(e),t=n?i:t,t===i?kc(e)?Yc(e):Oc(e):e.match(t)||[]}var ru=B(function(e,t){try{return We(e,i,t)}catch(n){return fs(n)?n:new N(n)}}),yg=mt(function(e,t){return ze(t,function(n){n=lt(n),dt(e,n,cs(e[n],e))}),e});function xg(e){var t=e==null?0:e.length,n=R();return e=t?oe(e,function(r){if(typeof r[1]!="function")throw new Je(S);return[n(r[0]),r[1]]}):[],B(function(r){for(var s=-1;++s<t;){var u=e[s];if(We(u[0],this,r))return We(u[1],this,r)}})}function Sg(e){return Kl(Ze(e,G))}function ms(e){return function(){return e}}function Ag(e,t){return e==null||e!==e?t:e}var bg=so(),Eg=so(!0);function Oe(e){return e}function vs(e){return Na(typeof e=="function"?e:Ze(e,G))}function Cg(e){return Wa(Ze(e,G))}function Tg(e,t){return Da(e,Ze(t,G))}var Fg=B(function(e,t){return function(n){return kn(n,e,t)}}),Ig=B(function(e,t){return function(n){return kn(e,n,t)}});function _s(e,t,n){var r=we(t),s=Cr(t,r);n==null&&!(ce(t)&&(s.length||!r.length))&&(n=t,t=e,e=this,s=Cr(t,we(t)));var u=!(ce(n)&&"chain"in n)||!!n.chain,l=_t(e);return ze(s,function(h){var d=t[h];e[h]=d,l&&(e.prototype[h]=function(){var w=this.__chain__;if(u||w){var y=e(this.__wrapped__),x=y.__actions__=Ie(this.__actions__);return x.push({func:d,args:arguments,thisArg:e}),y.__chain__=w,y}return d.apply(e,Ot([this.value()],arguments))})}),e}function Rg(){return ye._===this&&(ye._=tl),this}function ws(){}function Pg(e){return e=D(e),B(function(t){return $a(t,e)})}var Og=Zi(oe),Lg=Zi(aa),Mg=Zi(xi);function iu(e){return rs(e)?Si(lt(e)):lf(e)}function Ng(e){return function(t){return e==null?i:nn(e,t)}}var Ug=oo(),Wg=oo(!0);function ys(){return[]}function xs(){return!1}function Dg(){return{}}function $g(){return""}function Bg(){return!0}function kg(e,t){if(e=D(e),e<1||e>et)return[];var n=He,r=Se(e,He);t=R(t),e-=He;for(var s=Ei(r,t);++n<e;)t(n);return s}function qg(e){return U(e)?oe(e,lt):Be(e)?[e]:Ie(bo(X(e)))}function jg(e){var t=++Vc;return X(e)+t}var Gg=Or(function(e,t){return e+t},0),Hg=Xi("ceil"),Kg=Or(function(e,t){return e/t},1),zg=Xi("floor");function Jg(e){return e&&e.length?Er(e,Oe,Ui):i}function Yg(e,t){return e&&e.length?Er(e,R(t,2),Ui):i}function Zg(e){return ca(e,Oe)}function Xg(e,t){return ca(e,R(t,2))}function Qg(e){return e&&e.length?Er(e,Oe,Bi):i}function Vg(e,t){return e&&e.length?Er(e,R(t,2),Bi):i}var em=Or(function(e,t){return e*t},1),tm=Xi("round"),nm=Or(function(e,t){return e-t},0);function rm(e){return e&&e.length?bi(e,Oe):0}function im(e,t){return e&&e.length?bi(e,R(t,2)):0}return o.after=Cp,o.ary=No,o.assign=pd,o.assignIn=Yo,o.assignInWith=Hr,o.assignWith=dd,o.at=gd,o.before=Uo,o.bind=cs,o.bindAll=yg,o.bindKey=Wo,o.castArray=Dp,o.chain=Oo,o.chunk=zf,o.compact=Jf,o.concat=Yf,o.cond=xg,o.conforms=Sg,o.constant=ms,o.countBy=rp,o.create=md,o.curry=Do,o.curryRight=$o,o.debounce=Bo,o.defaults=vd,o.defaultsDeep=_d,o.defer=Tp,o.delay=Fp,o.difference=Zf,o.differenceBy=Xf,o.differenceWith=Qf,o.drop=Vf,o.dropRight=eh,o.dropRightWhile=th,o.dropWhile=nh,o.fill=rh,o.filter=sp,o.flatMap=up,o.flatMapDeep=cp,o.flatMapDepth=lp,o.flatten=Fo,o.flattenDeep=ih,o.flattenDepth=sh,o.flip=Ip,o.flow=bg,o.flowRight=Eg,o.fromPairs=ah,o.functions=Ed,o.functionsIn=Cd,o.groupBy=fp,o.initial=uh,o.intersection=ch,o.intersectionBy=lh,o.intersectionWith=fh,o.invert=Fd,o.invertBy=Id,o.invokeMap=pp,o.iteratee=vs,o.keyBy=dp,o.keys=we,o.keysIn=Pe,o.map=$r,o.mapKeys=Pd,o.mapValues=Od,o.matches=Cg,o.matchesProperty=Tg,o.memoize=kr,o.merge=Ld,o.mergeWith=Zo,o.method=Fg,o.methodOf=Ig,o.mixin=_s,o.negate=qr,o.nthArg=Pg,o.omit=Md,o.omitBy=Nd,o.once=Rp,o.orderBy=gp,o.over=Og,o.overArgs=Pp,o.overEvery=Lg,o.overSome=Mg,o.partial=ls,o.partialRight=ko,o.partition=mp,o.pick=Ud,o.pickBy=Xo,o.property=iu,o.propertyOf=Ng,o.pull=gh,o.pullAll=Ro,o.pullAllBy=mh,o.pullAllWith=vh,o.pullAt=_h,o.range=Ug,o.rangeRight=Wg,o.rearg=Op,o.reject=wp,o.remove=wh,o.rest=Lp,o.reverse=os,o.sampleSize=xp,o.set=Dd,o.setWith=$d,o.shuffle=Sp,o.slice=yh,o.sortBy=Ep,o.sortedUniq=Th,o.sortedUniqBy=Fh,o.split=ug,o.spread=Mp,o.tail=Ih,o.take=Rh,o.takeRight=Ph,o.takeRightWhile=Oh,o.takeWhile=Lh,o.tap=Jh,o.throttle=Np,o.thru=Dr,o.toArray=Ko,o.toPairs=Qo,o.toPairsIn=Vo,o.toPath=qg,o.toPlainObject=Jo,o.transform=Bd,o.unary=Up,o.union=Mh,o.unionBy=Nh,o.unionWith=Uh,o.uniq=Wh,o.uniqBy=Dh,o.uniqWith=$h,o.unset=kd,o.unzip=us,o.unzipWith=Po,o.update=qd,o.updateWith=jd,o.values=En,o.valuesIn=Gd,o.without=Bh,o.words=nu,o.wrap=Wp,o.xor=kh,o.xorBy=qh,o.xorWith=jh,o.zip=Gh,o.zipObject=Hh,o.zipObjectDeep=Kh,o.zipWith=zh,o.entries=Qo,o.entriesIn=Vo,o.extend=Yo,o.extendWith=Hr,_s(o,o),o.add=Gg,o.attempt=ru,o.camelCase=Jd,o.capitalize=eu,o.ceil=Hg,o.clamp=Hd,o.clone=$p,o.cloneDeep=kp,o.cloneDeepWith=qp,o.cloneWith=Bp,o.conformsTo=jp,o.deburr=tu,o.defaultTo=Ag,o.divide=Kg,o.endsWith=Yd,o.eq=it,o.escape=Zd,o.escapeRegExp=Xd,o.every=ip,o.find=ap,o.findIndex=Co,o.findKey=wd,o.findLast=op,o.findLastIndex=To,o.findLastKey=yd,o.floor=zg,o.forEach=Lo,o.forEachRight=Mo,o.forIn=xd,o.forInRight=Sd,o.forOwn=Ad,o.forOwnRight=bd,o.get=ps,o.gt=Gp,o.gte=Hp,o.has=Td,o.hasIn=ds,o.head=Io,o.identity=Oe,o.includes=hp,o.indexOf=oh,o.inRange=Kd,o.invoke=Rd,o.isArguments=an,o.isArray=U,o.isArrayBuffer=Kp,o.isArrayLike=Re,o.isArrayLikeObject=he,o.isBoolean=zp,o.isBuffer=$t,o.isDate=Jp,o.isElement=Yp,o.isEmpty=Zp,o.isEqual=Xp,o.isEqualWith=Qp,o.isError=fs,o.isFinite=Vp,o.isFunction=_t,o.isInteger=qo,o.isLength=jr,o.isMap=jo,o.isMatch=ed,o.isMatchWith=td,o.isNaN=nd,o.isNative=rd,o.isNil=sd,o.isNull=id,o.isNumber=Go,o.isObject=ce,o.isObjectLike=fe,o.isPlainObject=zn,o.isRegExp=hs,o.isSafeInteger=ad,o.isSet=Ho,o.isString=Gr,o.isSymbol=Be,o.isTypedArray=bn,o.isUndefined=od,o.isWeakMap=ud,o.isWeakSet=cd,o.join=hh,o.kebabCase=Qd,o.last=Qe,o.lastIndexOf=ph,o.lowerCase=Vd,o.lowerFirst=eg,o.lt=ld,o.lte=fd,o.max=Jg,o.maxBy=Yg,o.mean=Zg,o.meanBy=Xg,o.min=Qg,o.minBy=Vg,o.stubArray=ys,o.stubFalse=xs,o.stubObject=Dg,o.stubString=$g,o.stubTrue=Bg,o.multiply=em,o.nth=dh,o.noConflict=Rg,o.noop=ws,o.now=Br,o.pad=tg,o.padEnd=ng,o.padStart=rg,o.parseInt=ig,o.random=zd,o.reduce=vp,o.reduceRight=_p,o.repeat=sg,o.replace=ag,o.result=Wd,o.round=tm,o.runInContext=p,o.sample=yp,o.size=Ap,o.snakeCase=og,o.some=bp,o.sortedIndex=xh,o.sortedIndexBy=Sh,o.sortedIndexOf=Ah,o.sortedLastIndex=bh,o.sortedLastIndexBy=Eh,o.sortedLastIndexOf=Ch,o.startCase=cg,o.startsWith=lg,o.subtract=nm,o.sum=rm,o.sumBy=im,o.template=fg,o.times=kg,o.toFinite=wt,o.toInteger=D,o.toLength=zo,o.toLower=hg,o.toNumber=Ve,o.toSafeInteger=hd,o.toString=X,o.toUpper=pg,o.trim=dg,o.trimEnd=gg,o.trimStart=mg,o.truncate=vg,o.unescape=_g,o.uniqueId=jg,o.upperCase=wg,o.upperFirst=gs,o.each=Lo,o.eachRight=Mo,o.first=Io,_s(o,function(){var e={};return ut(o,function(t,n){Q.call(o.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),o.VERSION=f,ze(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){o[e].placeholder=o}),ze(["drop","take"],function(e,t){j.prototype[e]=function(n){n=n===i?1:ve(D(n),0);var r=this.__filtered__&&!t?new j(this):this.clone();return r.__filtered__?r.__takeCount__=Se(n,r.__takeCount__):r.__views__.push({size:Se(n,He),type:e+(r.__dir__<0?"Right":"")}),r},j.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),ze(["filter","map","takeWhile"],function(e,t){var n=t+1,r=n==Qn||n==er;j.prototype[e]=function(s){var u=this.clone();return u.__iteratees__.push({iteratee:R(s,3),type:n}),u.__filtered__=u.__filtered__||r,u}}),ze(["head","last"],function(e,t){var n="take"+(t?"Right":"");j.prototype[e]=function(){return this[n](1).value()[0]}}),ze(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");j.prototype[e]=function(){return this.__filtered__?new j(this):this[n](1)}}),j.prototype.compact=function(){return this.filter(Oe)},j.prototype.find=function(e){return this.filter(e).head()},j.prototype.findLast=function(e){return this.reverse().find(e)},j.prototype.invokeMap=B(function(e,t){return typeof e=="function"?new j(this):this.map(function(n){return kn(n,e,t)})}),j.prototype.reject=function(e){return this.filter(qr(R(e)))},j.prototype.slice=function(e,t){e=D(e);var n=this;return n.__filtered__&&(e>0||t<0)?new j(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=D(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},j.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},j.prototype.toArray=function(){return this.take(He)},ut(j.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),s=o[r?"take"+(t=="last"?"Right":""):t],u=r||/^find/.test(t);s&&(o.prototype[t]=function(){var l=this.__wrapped__,h=r?[1]:arguments,d=l instanceof j,w=h[0],y=d||U(l),x=function(q){var H=s.apply(o,Ot([q],h));return r&&E?H[0]:H};y&&n&&typeof w=="function"&&w.length!=1&&(d=y=!1);var E=this.__chain__,T=!!this.__actions__.length,L=u&&!E,$=d&&!T;if(!u&&y){l=$?l:new j(this);var M=e.apply(l,h);return M.__actions__.push({func:Dr,args:[x],thisArg:i}),new Ye(M,E)}return L&&$?e.apply(this,h):(M=this.thru(x),L?r?M.value()[0]:M.value():M)})}),ze(["pop","push","shift","sort","splice","unshift"],function(e){var t=lr[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);o.prototype[e]=function(){var s=arguments;if(r&&!this.__chain__){var u=this.value();return t.apply(U(u)?u:[],s)}return this[n](function(l){return t.apply(U(l)?l:[],s)})}}),ut(j.prototype,function(e,t){var n=o[t];if(n){var r=n.name+"";Q.call(wn,r)||(wn[r]=[]),wn[r].push({name:t,func:n})}}),wn[Pr(i,Me).name]=[{name:"wrapper",func:i}],j.prototype.clone=vl,j.prototype.reverse=_l,j.prototype.value=wl,o.prototype.at=Yh,o.prototype.chain=Zh,o.prototype.commit=Xh,o.prototype.next=Qh,o.prototype.plant=ep,o.prototype.reverse=tp,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=np,o.prototype.first=o.prototype.head,Mn&&(o.prototype[Mn]=Vh),o},mn=Zc();Xt?((Xt.exports=mn)._=mn,vi._=mn):ye._=mn}).call(av)}(Zn,Zn.exports)),Zn.exports}var uv=ov();const Cs=c=>{const a=uv.startCase(c).toLowerCase();return a.charAt(0).toUpperCase()+a.slice(1)},cv=({data:c})=>`import { defineObject } from 'twenty-sdk';
|
|
229
229
|
|
|
230
230
|
export default defineObject({
|
|
231
|
-
universalIdentifier: '${
|
|
231
|
+
universalIdentifier: '${Xn.v4()}',
|
|
232
232
|
nameSingular: '${c.nameSingular}',
|
|
233
233
|
namePlural: '${c.namePlural}',
|
|
234
234
|
labelSingular: '${c.labelSingular}',
|
|
@@ -245,7 +245,7 @@ export default defineObject({
|
|
|
245
245
|
// },
|
|
246
246
|
],
|
|
247
247
|
});
|
|
248
|
-
`,lv=({name:c,universalIdentifier:a=
|
|
248
|
+
`,lv=({name:c,universalIdentifier:a=Xn.v4()})=>{const i=Fn(c);return`import { defineRole } from 'twenty-sdk';
|
|
249
249
|
|
|
250
250
|
export const ${i.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER =
|
|
251
251
|
'${a}';
|
|
@@ -259,7 +259,7 @@ export default defineRole({
|
|
|
259
259
|
canSoftDeleteAllObjectRecords: true,
|
|
260
260
|
canDestroyAllObjectRecords: false,
|
|
261
261
|
});
|
|
262
|
-
`},fv=({data:c})=>{const a=
|
|
262
|
+
`},fv=({data:c})=>{const a=Xn.v4(),i=c.description?`
|
|
263
263
|
description: '${c.description}',`:"";return`import { defineField, FieldType } from 'twenty-sdk';
|
|
264
264
|
|
|
265
265
|
export default defineField({
|
|
@@ -269,4 +269,4 @@ export default defineField({
|
|
|
269
269
|
type: FieldMetadataType.${c.type},
|
|
270
270
|
objectUniversalIdentifier: '${c.objectUniversalIdentifier}',${i}
|
|
271
271
|
});
|
|
272
|
-
`},hv="src";class pv{async execute(a,i){try{const f=a??await this.getEntity(),g=this.getFolderName(f),_=i?ie.join(
|
|
272
|
+
`},hv="src";class pv{async execute(a,i){try{const f=a??await this.getEntity(),g=this.getFolderName(f),_=i?ie.join(At,i):ie.join(At,hv,g);await V.ensureDir(_);const{name:S,file:A}=await this.getEntityData(f),I=ie.join(_,this.getFileName(S,f));if(await V.pathExists(I)){const{overwrite:P}=await this.handleFileExist();if(!P)return}await V.writeFile(I,A),console.log(b.default.green(`✓ Created ${g}:`),b.default.cyan(ie.relative(At,I)))}catch(f){console.error(b.default.red("Add new entity failed:"),f instanceof Error?f.message:f),process.exit(1)}}async getEntityData(a){switch(a){case _e.Object:{const i=await this.getObjectData(),f=i.nameSingular,g=cv({data:i});return{name:f,file:g}}case _e.Field:{const i=await this.getFieldData(),f=i.name,g=fv({data:i});return{name:f,file:g}}case _e.LogicFunction:{const i=await this.getEntityName(a),f=sv({name:i});return{name:i,file:f}}case _e.FrontComponent:{const i=await this.getEntityName(a),f=iv({name:i});return{name:i,file:f}}case _e.Role:{const i=await this.getEntityName(a),f=lv({name:i});return{name:i,file:f}}default:le.ln()}}async getEntity(){const{entity:a}=await St.default.prompt([{type:"select",name:"entity",message:"What entity do you want to create?",default:"",choices:Object.values(_e)}]);return a}async handleFileExist(){return await St.default.prompt([{type:"confirm",name:"overwrite",message:"File already exists. Do you want to overwrite it?",default:!1}])}async getEntityName(a){const{name:i}=await St.default.prompt([{type:"input",name:"name",message:`Enter a name for your new ${a}:`,default:"",validate:f=>f.length===0?`${a} name is required`:!0}]);return i}async getFieldData(){return St.default.prompt([{type:"input",name:"name",message:"Enter a name for your field:",default:"",validate:a=>!a||a.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"label",message:"Enter a label for your field:",default:a=>Cs(a.name),validate:a=>!a||a.trim().length===0?"Please enter a non empty string":!0},{type:"select",name:"type",message:"Select the field type:",choices:Object.values(le.s),default:le.s.TEXT},{type:"input",name:"objectUniversalIdentifier",message:"Enter the universalIdentifier of the object this field belongs to:",default:"fill-later",validate:a=>!a||a.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 St.default.prompt([{type:"input",name:"nameSingular",message:"Enter a name singular for your object (eg: company):",default:"",validate:a=>!a||a.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:(a,i)=>a.trim()===i?.nameSingular.trim()?"Name plural must be different from name singular":!a||a.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelSingular",message:"Enter a label singular for your object:",default:a=>Cs(a.nameSingular),validate:a=>!a||a.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelPlural",message:"Enter a label plural for your object:",default:a=>Cs(a.namePlural),validate:a=>!a||a.trim().length===0?"Please enter a non empty string":!0}])}getFolderName(a){return`${Fn(a)}s`}getFileName(a,i){switch(i){case _e.FrontComponent:return`${Fn(a)}.tsx`;default:return`${Fn(a)}.ts`}}}const dv=c=>{const a=new Y0,i=new Z0,f=new X0,g=new Q0,_=new tv;c.command("auth:login").description("Authenticate with Twenty").option("--api-key <key>","API key for authentication").option("--api-url <url>","Twenty API URL").action(async K=>{await i.execute(K)}),c.command("auth:logout").description("Remove authentication credentials").action(async()=>{await f.execute()}),c.command("auth:status").description("Check authentication status").action(async()=>{await g.execute()}),c.command("auth:switch [workspace]").description("Switch the default workspace for authentication").action(async K=>{await _.execute({workspace:K})}),c.command("auth:list").description("List all configured workspaces").action(async()=>{await a.execute()});const S=new G0,A=new J0,I=new pv,P=new z0,J=new ev,G=new V0;c.command("app:dev [appPath]").description("Watch and sync local application changes").action(async K=>{await S.execute({appPath:Jn(K)})}),c.command("app:uninstall [appPath]").description("Uninstall application from Twenty").option("-y, --yes","Skip confirmation prompt").action(async(K,k)=>{try{const ue=await A.execute({appPath:Jn(K),askForConfirmation:!k?.yes});process.exit(ue.success?0:1)}catch{process.exit(1)}}),c.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(_e).join("|")})`).action(async(K,k)=>{await I.execute(K,k?.path)}),c.command("app:generate [appPath]").description("Generate Twenty client").action(async K=>{await P.execute(Jn(K))}),c.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(K,k)=>{await J.execute({...k,appPath:Jn(K)})}),c.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(K,k)=>{!k?.functionUniversalIdentifier&&!k?.functionName&&(console.error(b.default.red("Error: Either --functionName (-n) or --functionUniversalIdentifier (-u) is required.")),process.exit(1)),await G.execute({...k,payload:k?.payload??"{}",appPath:Jn(K)})})},gv="0.6.0-alpha",mv={version:gv};Tm.inspect.defaultOptions.depth=10;const Rn=new mu.Command;Rn.name("twenty").description("CLI for Twenty application development").version(mv.version);Rn.option("--workspace <name>","Use a specific workspace configuration (overrides the default set by auth:switch)");Rn.hook("preAction",async c=>{let i=(c.optsWithGlobals?c.optsWithGlobals():c.opts()).workspace;i||(i=await new be().getDefaultWorkspace()),be.setActiveWorkspace(i),console.log(b.default.gray(`👩💻 Workspace - ${be.getActiveWorkspace()}`))});dv(Rn);Rn.exitOverride();try{Rn.parse()}catch(c){c instanceof mu.CommanderError&&process.exit(c.exitCode),c instanceof Error&&(console.error(b.default.red("Error:"),c.message),process.exit(1))}
|