twenty-sdk 0.4.8 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/HtmlTagToRemoteComponent-Bd5sgek2.js +1 -0
- package/dist/{HtmlTagToRemoteComponent-_kOtAcK_.mjs → HtmlTagToRemoteComponent-DlsAI7JU.mjs} +4 -9
- package/dist/cli/commands/app/app-dev.d.ts +1 -0
- package/dist/cli/utilities/build/common/esbuild-watcher.d.ts +1 -0
- package/dist/cli/utilities/build/common/front-component-build/react-globals-plugin.d.ts +1 -2
- package/dist/cli/utilities/build/common/front-component-build/strip-comments-plugin.d.ts +2 -0
- package/dist/cli/utilities/build/common/front-component-build/twenty-sdk-globals-plugin.d.ts +1 -0
- package/dist/cli/utilities/build/common/front-component-build/twenty-sdk-ui-globals-plugin.d.ts +1 -0
- package/dist/cli/utilities/build/common/front-component-build/twenty-shared-globals-plugin.d.ts +1 -0
- package/dist/cli/utilities/build/common/front-component-build/utils/collect-named-imports.d.ts +4 -0
- package/dist/cli/utilities/build/common/front-component-build/utils/create-front-component-build-options.d.ts +1 -2
- package/dist/cli/utilities/build/common/front-component-build/utils/create-globals-plugin.d.ts +15 -0
- package/dist/cli/utilities/config/get-config-path.d.ts +1 -0
- package/dist/cli.cjs +64 -237
- package/dist/cli.mjs +3677 -8386
- package/dist/front-component/host/components/FrontComponentRenderer.d.ts +4 -1
- package/dist/front-component/index.cjs +1 -1
- package/dist/front-component/index.d.ts +3 -2
- package/dist/front-component/index.mjs +5699 -2008
- package/dist/front-component/remote/components/FrontComponentHostCommunicationApiEffect.d.ts +8 -0
- package/dist/front-component/remote/components/FrontComponentUpdateContextEffect.d.ts +2 -1
- package/dist/front-component/remote/components/FrontComponentWorkerEffect.d.ts +5 -2
- package/dist/front-component/remote/generated/remote-components.d.ts +256 -1
- package/dist/front-component/remote/generated/remote-elements.d.ts +3162 -22
- package/dist/front-component/remote/utils/exposeGlobals.d.ts +1 -0
- package/dist/front-component/types/FrontComponentHostCommunicationApi.d.ts +4 -0
- package/dist/front-component/types/HostToWorkerRenderContext.d.ts +1 -0
- package/dist/front-component/types/PropertySchema.d.ts +1 -1
- package/dist/front-component/types/WorkerExports.d.ts +1 -0
- package/dist/index.cjs +1 -5
- package/dist/index.mjs +94 -2308
- package/dist/sdk/front-component-api/context/frontComponentContext.d.ts +7 -0
- package/dist/sdk/front-component-api/functions/navigate.d.ts +5 -0
- package/dist/sdk/front-component-api/hooks/useFrontComponentExecutionContext.d.ts +1 -1
- package/dist/sdk/front-component-api/hooks/useUserId.d.ts +1 -0
- package/dist/sdk/front-component-api/index.d.ts +3 -1
- package/dist/sdk/front-component-api/types/FrontComponentExecutionContext.d.ts +1 -1
- package/dist/sdk/front-component-common/SerializedEventData.d.ts +26 -0
- package/dist/sdk/front-component-common/index.d.ts +1 -2
- package/dist/sdk/index.d.ts +2 -3
- package/dist/sdk/logic-functions/logic-function-config.d.ts +1 -2
- package/dist/ui/index.cjs +1 -2015
- package/dist/ui/index.mjs +10 -9941
- package/package.json +2 -2
- package/dist/AllIcons-CGPKtPQS-DL2Ipn0N.mjs +0 -30768
- package/dist/AllIcons-CGPKtPQS-cyMLi0D3.js +0 -18986
- package/dist/HtmlTagToRemoteComponent-cjNxtZqX.js +0 -1
- package/dist/RatingValues-CT-y6O0b-CsGZSJKO.mjs +0 -402
- package/dist/RatingValues-CT-y6O0b-D7JSZAMu.js +0 -1
- package/dist/front-component/remote/context/FrontComponentExecutionContextStore.d.ts +0 -11
- package/dist/input-pdm2U5rP.js +0 -402
- package/dist/input-r2MHVbqO.mjs +0 -28019
- package/dist/isValidCountryCode-B7MxBtRC-BNPnBggZ.js +0 -25
- package/dist/isValidCountryCode-B7MxBtRC-BsdyqBLg.mjs +0 -9841
- package/dist/jsx-runtime-BdMIAavf.mjs +0 -639
- package/dist/jsx-runtime-Bglt9wWZ.js +0 -30
- package/dist/sdk/front-component-api/types/FrontComponentExecutionContextStore.d.ts +0 -5
- package/dist/sdk/front-component-common/AllowedUiComponents.d.ts +0 -9
package/dist/cli.cjs
CHANGED
|
@@ -1,205 +1,39 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
${
|
|
4
|
-
export var jsx = globalThis.jsx;
|
|
5
|
-
export var jsxs = globalThis.jsxs;
|
|
6
|
-
export var Fragment = globalThis.React.Fragment;
|
|
7
|
-
`.trim(),
|
|
8
|
-
`)},
|
|
9
|
-
|
|
10
|
-
`)}
|
|
11
|
-
|
|
12
|
-
`+dv(i.loc));else if(this.source&&this.locations)for(const i of this.locations)r+=`
|
|
13
|
-
|
|
14
|
-
`+jc(this.source,i);return r}toJSON(){const r={message:this.message};return this.locations!=null&&(r.locations=this.locations),this.path!=null&&(r.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(r.extensions=this.extensions),r}}function Tc(n){return n===void 0||n.length===0?void 0:n}function ke(n,r,i){return new fe(`Syntax Error: ${i}`,{source:n,positions:[r]})}class gv{constructor(r,i,o){this.start=r.start,this.end=i.end,this.startToken=r,this.endToken=i,this.source=o}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Wc{constructor(r,i,o,u,f,g){this.kind=r,this.start=i,this.end=o,this.line=u,this.column=f,this.value=g,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Gc={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},mv=new Set(Object.keys(Gc));function wc(n){const r=n?.kind;return typeof r=="string"&&mv.has(r)}var Yt;(function(n){n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription"})(Yt||(Yt={}));var se;(function(n){n.QUERY="QUERY",n.MUTATION="MUTATION",n.SUBSCRIPTION="SUBSCRIPTION",n.FIELD="FIELD",n.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",n.FRAGMENT_SPREAD="FRAGMENT_SPREAD",n.INLINE_FRAGMENT="INLINE_FRAGMENT",n.VARIABLE_DEFINITION="VARIABLE_DEFINITION",n.SCHEMA="SCHEMA",n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.FIELD_DEFINITION="FIELD_DEFINITION",n.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.ENUM_VALUE="ENUM_VALUE",n.INPUT_OBJECT="INPUT_OBJECT",n.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(se||(se={}));var N;(function(n){n.NAME="Name",n.DOCUMENT="Document",n.OPERATION_DEFINITION="OperationDefinition",n.VARIABLE_DEFINITION="VariableDefinition",n.SELECTION_SET="SelectionSet",n.FIELD="Field",n.ARGUMENT="Argument",n.FRAGMENT_SPREAD="FragmentSpread",n.INLINE_FRAGMENT="InlineFragment",n.FRAGMENT_DEFINITION="FragmentDefinition",n.VARIABLE="Variable",n.INT="IntValue",n.FLOAT="FloatValue",n.STRING="StringValue",n.BOOLEAN="BooleanValue",n.NULL="NullValue",n.ENUM="EnumValue",n.LIST="ListValue",n.OBJECT="ObjectValue",n.OBJECT_FIELD="ObjectField",n.DIRECTIVE="Directive",n.NAMED_TYPE="NamedType",n.LIST_TYPE="ListType",n.NON_NULL_TYPE="NonNullType",n.SCHEMA_DEFINITION="SchemaDefinition",n.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",n.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",n.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",n.FIELD_DEFINITION="FieldDefinition",n.INPUT_VALUE_DEFINITION="InputValueDefinition",n.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",n.UNION_TYPE_DEFINITION="UnionTypeDefinition",n.ENUM_TYPE_DEFINITION="EnumTypeDefinition",n.ENUM_VALUE_DEFINITION="EnumValueDefinition",n.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",n.DIRECTIVE_DEFINITION="DirectiveDefinition",n.SCHEMA_EXTENSION="SchemaExtension",n.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",n.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",n.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",n.UNION_TYPE_EXTENSION="UnionTypeExtension",n.ENUM_TYPE_EXTENSION="EnumTypeExtension",n.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(N||(N={}));function Na(n){return n===9||n===32}function Bi(n){return n>=48&&n<=57}function Vc(n){return n>=97&&n<=122||n>=65&&n<=90}function Fa(n){return Vc(n)||n===95}function qc(n){return Vc(n)||Bi(n)||n===95}function yv(n){var r;let i=Number.MAX_SAFE_INTEGER,o=null,u=-1;for(let g=0;g<n.length;++g){var f;const v=n[g],w=vv(v);w!==v.length&&(o=(f=o)!==null&&f!==void 0?f:g,u=g,g!==0&&w<i&&(i=w))}return n.map((g,v)=>v===0?g:g.slice(i)).slice((r=o)!==null&&r!==void 0?r:0,u+1)}function vv(n){let r=0;for(;r<n.length&&Na(n.charCodeAt(r));)++r;return r}function _v(n){if(n==="")return!0;let r=!0,i=!1,o=!0,u=!1;for(let f=0;f<n.length;++f)switch(n.codePointAt(f)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(r&&!u)return!1;u=!0,r=!0,i=!1;break;case 9:case 32:i||(i=r);break;default:o&&(o=i),r=!1}return!(r||o&&u)}function xv(n,r){const i=n.replace(/"""/g,'\\"""'),o=i.split(/\r\n|[\n\r]/g),u=o.length===1,f=o.length>1&&o.slice(1).every(M=>M.length===0||Na(M.charCodeAt(0))),g=i.endsWith('\\"""'),v=n.endsWith('"')&&!g,w=n.endsWith("\\"),b=v||w,O=!u||n.length>70||b||f||g;let D="";const P=u&&Na(n.charCodeAt(0));return(O&&!P||f)&&(D+=`
|
|
15
|
-
`),D+=i,(O||b)&&(D+=`
|
|
16
|
-
`),'"""'+D+'"""'}var A;(function(n){n.SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment"})(A||(A={}));class Tv{constructor(r){const i=new Wc(A.SOF,0,0,0,0);this.source=r,this.lastToken=i,this.token=i,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let r=this.token;if(r.kind!==A.EOF)do if(r.next)r=r.next;else{const i=Ev(this,r.end);r.next=i,i.prev=r,r=i}while(r.kind===A.COMMENT);return r}}function wv(n){return n===A.BANG||n===A.DOLLAR||n===A.AMP||n===A.PAREN_L||n===A.PAREN_R||n===A.SPREAD||n===A.COLON||n===A.EQUALS||n===A.AT||n===A.BRACKET_L||n===A.BRACKET_R||n===A.BRACE_L||n===A.PIPE||n===A.BRACE_R}function hi(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function qr(n,r){return Jc(n.charCodeAt(r))&&zc(n.charCodeAt(r+1))}function Jc(n){return n>=55296&&n<=56319}function zc(n){return n>=56320&&n<=57343}function Bn(n,r){const i=n.source.body.codePointAt(r);if(i===void 0)return A.EOF;if(i>=32&&i<=126){const o=String.fromCodePoint(i);return o==='"'?`'"'`:`"${o}"`}return"U+"+i.toString(16).toUpperCase().padStart(4,"0")}function Re(n,r,i,o,u){const f=n.line,g=1+i-n.lineStart;return new Wc(r,i,o,f,g,u)}function Ev(n,r){const i=n.source.body,o=i.length;let u=r;for(;u<o;){const f=i.charCodeAt(u);switch(f){case 65279:case 9:case 32:case 44:++u;continue;case 10:++u,++n.line,n.lineStart=u;continue;case 13:i.charCodeAt(u+1)===10?u+=2:++u,++n.line,n.lineStart=u;continue;case 35:return Sv(n,u);case 33:return Re(n,A.BANG,u,u+1);case 36:return Re(n,A.DOLLAR,u,u+1);case 38:return Re(n,A.AMP,u,u+1);case 40:return Re(n,A.PAREN_L,u,u+1);case 41:return Re(n,A.PAREN_R,u,u+1);case 46:if(i.charCodeAt(u+1)===46&&i.charCodeAt(u+2)===46)return Re(n,A.SPREAD,u,u+3);break;case 58:return Re(n,A.COLON,u,u+1);case 61:return Re(n,A.EQUALS,u,u+1);case 64:return Re(n,A.AT,u,u+1);case 91:return Re(n,A.BRACKET_L,u,u+1);case 93:return Re(n,A.BRACKET_R,u,u+1);case 123:return Re(n,A.BRACE_L,u,u+1);case 124:return Re(n,A.PIPE,u,u+1);case 125:return Re(n,A.BRACE_R,u,u+1);case 34:return i.charCodeAt(u+1)===34&&i.charCodeAt(u+2)===34?Rv(n,u):Iv(n,u)}if(Bi(f)||f===45)return Av(n,u,f);if(Fa(f))return Cv(n,u);throw ke(n.source,u,f===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:hi(f)||qr(i,u)?`Unexpected character: ${Bn(n,u)}.`:`Invalid character: ${Bn(n,u)}.`)}return Re(n,A.EOF,o,o)}function Sv(n,r){const i=n.source.body,o=i.length;let u=r+1;for(;u<o;){const f=i.charCodeAt(u);if(f===10||f===13)break;if(hi(f))++u;else if(qr(i,u))u+=2;else break}return Re(n,A.COMMENT,r,u,i.slice(r+1,u))}function Av(n,r,i){const o=n.source.body;let u=r,f=i,g=!1;if(f===45&&(f=o.charCodeAt(++u)),f===48){if(f=o.charCodeAt(++u),Bi(f))throw ke(n.source,u,`Invalid number, unexpected digit after 0: ${Bn(n,u)}.`)}else u=Ta(n,u,f),f=o.charCodeAt(u);if(f===46&&(g=!0,f=o.charCodeAt(++u),u=Ta(n,u,f),f=o.charCodeAt(u)),(f===69||f===101)&&(g=!0,f=o.charCodeAt(++u),(f===43||f===45)&&(f=o.charCodeAt(++u)),u=Ta(n,u,f),f=o.charCodeAt(u)),f===46||Fa(f))throw ke(n.source,u,`Invalid number, expected digit but got: ${Bn(n,u)}.`);return Re(n,g?A.FLOAT:A.INT,r,u,o.slice(r,u))}function Ta(n,r,i){if(!Bi(i))throw ke(n.source,r,`Invalid number, expected digit but got: ${Bn(n,r)}.`);const o=n.source.body;let u=r+1;for(;Bi(o.charCodeAt(u));)++u;return u}function Iv(n,r){const i=n.source.body,o=i.length;let u=r+1,f=u,g="";for(;u<o;){const v=i.charCodeAt(u);if(v===34)return g+=i.slice(f,u),Re(n,A.STRING,r,u+1,g);if(v===92){g+=i.slice(f,u);const w=i.charCodeAt(u+1)===117?i.charCodeAt(u+2)===123?bv(n,u):Nv(n,u):Ov(n,u);g+=w.value,u+=w.size,f=u;continue}if(v===10||v===13)break;if(hi(v))++u;else if(qr(i,u))u+=2;else throw ke(n.source,u,`Invalid character within String: ${Bn(n,u)}.`)}throw ke(n.source,u,"Unterminated string.")}function bv(n,r){const i=n.source.body;let o=0,u=3;for(;u<12;){const f=i.charCodeAt(r+u++);if(f===125){if(u<5||!hi(o))break;return{value:String.fromCodePoint(o),size:u}}if(o=o<<4|Ui(f),o<0)break}throw ke(n.source,r,`Invalid Unicode escape sequence: "${i.slice(r,r+u)}".`)}function Nv(n,r){const i=n.source.body,o=Ec(i,r+2);if(hi(o))return{value:String.fromCodePoint(o),size:6};if(Jc(o)&&i.charCodeAt(r+6)===92&&i.charCodeAt(r+7)===117){const u=Ec(i,r+8);if(zc(u))return{value:String.fromCodePoint(o,u),size:12}}throw ke(n.source,r,`Invalid Unicode escape sequence: "${i.slice(r,r+6)}".`)}function Ec(n,r){return Ui(n.charCodeAt(r))<<12|Ui(n.charCodeAt(r+1))<<8|Ui(n.charCodeAt(r+2))<<4|Ui(n.charCodeAt(r+3))}function Ui(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function Ov(n,r){const i=n.source.body;switch(i.charCodeAt(r+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
17
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw ke(n.source,r,`Invalid character escape sequence: "${i.slice(r,r+2)}".`)}function Rv(n,r){const i=n.source.body,o=i.length;let u=n.lineStart,f=r+3,g=f,v="";const w=[];for(;f<o;){const b=i.charCodeAt(f);if(b===34&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34){v+=i.slice(g,f),w.push(v);const O=Re(n,A.BLOCK_STRING,r,f+3,yv(w).join(`
|
|
18
|
-
`));return n.line+=w.length-1,n.lineStart=u,O}if(b===92&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34&&i.charCodeAt(f+3)===34){v+=i.slice(g,f),g=f+1,f+=4;continue}if(b===10||b===13){v+=i.slice(g,f),w.push(v),b===13&&i.charCodeAt(f+1)===10?f+=2:++f,v="",g=f,u=f;continue}if(hi(b))++f;else if(qr(i,f))f+=2;else throw ke(n.source,f,`Invalid character within String: ${Bn(n,f)}.`)}throw ke(n.source,f,"Unterminated string.")}function Cv(n,r){const i=n.source.body,o=i.length;let u=r+1;for(;u<o;){const f=i.charCodeAt(u);if(qc(f))++u;else break}return Re(n,A.NAME,r,u,i.slice(r,u))}const Lv=10,Qc=2;function J(n){return Jr(n,[])}function Jr(n,r){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return Fv(n,r);default:return String(n)}}function Fv(n,r){if(n===null)return"null";if(r.includes(n))return"[Circular]";const i=[...r,n];if(Dv(n)){const o=n.toJSON();if(o!==n)return typeof o=="string"?o:Jr(o,i)}else if(Array.isArray(n))return kv(n,i);return Pv(n,i)}function Dv(n){return typeof n.toJSON=="function"}function Pv(n,r){const i=Object.entries(n);return i.length===0?"{}":r.length>Qc?"["+Uv(n)+"]":"{ "+i.map(([u,f])=>u+": "+Jr(f,r)).join(", ")+" }"}function kv(n,r){if(n.length===0)return"[]";if(r.length>Qc)return"[Array]";const i=Math.min(Lv,n.length),o=n.length-i,u=[];for(let f=0;f<i;++f)u.push(Jr(n[f],r));return o===1?u.push("... 1 more item"):o>1&&u.push(`... ${o} more items`),"["+u.join(", ")+"]"}function Uv(n){const r=Object.prototype.toString.call(n).replace(/^\[object /,"").replace(/]$/,"");if(r==="Object"&&typeof n.constructor=="function"){const i=n.constructor.name;if(typeof i=="string"&&i!=="")return i}return r}const Mt=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(r,i){return r instanceof i}:function(r,i){if(r instanceof i)return!0;if(typeof r=="object"&&r!==null){var o;const u=i.prototype[Symbol.toStringTag],f=Symbol.toStringTag in r?r[Symbol.toStringTag]:(o=r.constructor)===null||o===void 0?void 0:o.name;if(u===f){const g=J(r);throw new Error(`Cannot use ${u} "${g}" from another module or realm.
|
|
19
|
-
|
|
20
|
-
Ensure that there is only one instance of "graphql" in the node_modules
|
|
21
|
-
directory. If different versions of "graphql" are the dependencies of other
|
|
22
|
-
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
23
|
-
|
|
24
|
-
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
25
|
-
|
|
26
|
-
Duplicate "graphql" modules cannot be used at the same time since different
|
|
27
|
-
versions may have different capabilities and behavior. The data from one
|
|
28
|
-
version used in the function from another could produce confusing and
|
|
29
|
-
spurious results.`)}}return!1};class Hc{constructor(r,i="GraphQL request",o={line:1,column:1}){typeof r=="string"||ue(!1,`Body must be a string. Received: ${J(r)}.`),this.body=r,this.name=i,this.locationOffset=o,this.locationOffset.line>0||ue(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ue(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Mv(n){return Mt(n,Hc)}function $v(n,r){const i=new Bv(n,r);i.expectToken(A.SOF);const o=i.parseValueLiteral(!1);return i.expectToken(A.EOF),o}class Bv{constructor(r,i={}){const o=Mv(r)?r:new Hc(r);this._lexer=new Tv(o),this._options=i,this._tokenCounter=0}parseName(){const r=this.expectToken(A.NAME);return this.node(r,{kind:N.NAME,value:r.value})}parseDocument(){return this.node(this._lexer.token,{kind:N.DOCUMENT,definitions:this.many(A.SOF,this.parseDefinition,A.EOF)})}parseDefinition(){if(this.peek(A.BRACE_L))return this.parseOperationDefinition();const r=this.peekDescription(),i=r?this._lexer.lookahead():this._lexer.token;if(i.kind===A.NAME){switch(i.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(r)throw ke(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(i.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(i)}parseOperationDefinition(){const r=this._lexer.token;if(this.peek(A.BRACE_L))return this.node(r,{kind:N.OPERATION_DEFINITION,operation:Yt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const i=this.parseOperationType();let o;return this.peek(A.NAME)&&(o=this.parseName()),this.node(r,{kind:N.OPERATION_DEFINITION,operation:i,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const r=this.expectToken(A.NAME);switch(r.value){case"query":return Yt.QUERY;case"mutation":return Yt.MUTATION;case"subscription":return Yt.SUBSCRIPTION}throw this.unexpected(r)}parseVariableDefinitions(){return this.optionalMany(A.PAREN_L,this.parseVariableDefinition,A.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:N.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(A.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(A.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const r=this._lexer.token;return this.expectToken(A.DOLLAR),this.node(r,{kind:N.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:N.SELECTION_SET,selections:this.many(A.BRACE_L,this.parseSelection,A.BRACE_R)})}parseSelection(){return this.peek(A.SPREAD)?this.parseFragment():this.parseField()}parseField(){const r=this._lexer.token,i=this.parseName();let o,u;return this.expectOptionalToken(A.COLON)?(o=i,u=this.parseName()):u=i,this.node(r,{kind:N.FIELD,alias:o,name:u,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(A.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(r){const i=r?this.parseConstArgument:this.parseArgument;return this.optionalMany(A.PAREN_L,i,A.PAREN_R)}parseArgument(r=!1){const i=this._lexer.token,o=this.parseName();return this.expectToken(A.COLON),this.node(i,{kind:N.ARGUMENT,name:o,value:this.parseValueLiteral(r)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const r=this._lexer.token;this.expectToken(A.SPREAD);const i=this.expectOptionalKeyword("on");return!i&&this.peek(A.NAME)?this.node(r,{kind:N.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(r,{kind:N.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const r=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(r,{kind:N.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(r,{kind:N.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(r){const i=this._lexer.token;switch(i.kind){case A.BRACKET_L:return this.parseList(r);case A.BRACE_L:return this.parseObject(r);case A.INT:return this.advanceLexer(),this.node(i,{kind:N.INT,value:i.value});case A.FLOAT:return this.advanceLexer(),this.node(i,{kind:N.FLOAT,value:i.value});case A.STRING:case A.BLOCK_STRING:return this.parseStringLiteral();case A.NAME:switch(this.advanceLexer(),i.value){case"true":return this.node(i,{kind:N.BOOLEAN,value:!0});case"false":return this.node(i,{kind:N.BOOLEAN,value:!1});case"null":return this.node(i,{kind:N.NULL});default:return this.node(i,{kind:N.ENUM,value:i.value})}case A.DOLLAR:if(r)if(this.expectToken(A.DOLLAR),this._lexer.token.kind===A.NAME){const o=this._lexer.token.value;throw ke(this._lexer.source,i.start,`Unexpected variable "$${o}" in constant value.`)}else throw this.unexpected(i);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const r=this._lexer.token;return this.advanceLexer(),this.node(r,{kind:N.STRING,value:r.value,block:r.kind===A.BLOCK_STRING})}parseList(r){const i=()=>this.parseValueLiteral(r);return this.node(this._lexer.token,{kind:N.LIST,values:this.any(A.BRACKET_L,i,A.BRACKET_R)})}parseObject(r){const i=()=>this.parseObjectField(r);return this.node(this._lexer.token,{kind:N.OBJECT,fields:this.any(A.BRACE_L,i,A.BRACE_R)})}parseObjectField(r){const i=this._lexer.token,o=this.parseName();return this.expectToken(A.COLON),this.node(i,{kind:N.OBJECT_FIELD,name:o,value:this.parseValueLiteral(r)})}parseDirectives(r){const i=[];for(;this.peek(A.AT);)i.push(this.parseDirective(r));return i}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(r){const i=this._lexer.token;return this.expectToken(A.AT),this.node(i,{kind:N.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(r)})}parseTypeReference(){const r=this._lexer.token;let i;if(this.expectOptionalToken(A.BRACKET_L)){const o=this.parseTypeReference();this.expectToken(A.BRACKET_R),i=this.node(r,{kind:N.LIST_TYPE,type:o})}else i=this.parseNamedType();return this.expectOptionalToken(A.BANG)?this.node(r,{kind:N.NON_NULL_TYPE,type:i}):i}parseNamedType(){return this.node(this._lexer.token,{kind:N.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(A.STRING)||this.peek(A.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");const o=this.parseConstDirectives(),u=this.many(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);return this.node(r,{kind:N.SCHEMA_DEFINITION,description:i,directives:o,operationTypes:u})}parseOperationTypeDefinition(){const r=this._lexer.token,i=this.parseOperationType();this.expectToken(A.COLON);const o=this.parseNamedType();return this.node(r,{kind:N.OPERATION_TYPE_DEFINITION,operation:i,type:o})}parseScalarTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");const o=this.parseName(),u=this.parseConstDirectives();return this.node(r,{kind:N.SCALAR_TYPE_DEFINITION,description:i,name:o,directives:u})}parseObjectTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.OBJECT_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(A.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(A.BRACE_L,this.parseFieldDefinition,A.BRACE_R)}parseFieldDefinition(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseName(),u=this.parseArgumentDefs();this.expectToken(A.COLON);const f=this.parseTypeReference(),g=this.parseConstDirectives();return this.node(r,{kind:N.FIELD_DEFINITION,description:i,name:o,arguments:u,type:f,directives:g})}parseArgumentDefs(){return this.optionalMany(A.PAREN_L,this.parseInputValueDef,A.PAREN_R)}parseInputValueDef(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseName();this.expectToken(A.COLON);const u=this.parseTypeReference();let f;this.expectOptionalToken(A.EQUALS)&&(f=this.parseConstValueLiteral());const g=this.parseConstDirectives();return this.node(r,{kind:N.INPUT_VALUE_DEFINITION,description:i,name:o,type:u,defaultValue:f,directives:g})}parseInterfaceTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.INTERFACE_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}parseUnionTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseUnionMemberTypes();return this.node(r,{kind:N.UNION_TYPE_DEFINITION,description:i,name:o,directives:u,types:f})}parseUnionMemberTypes(){return this.expectOptionalToken(A.EQUALS)?this.delimitedMany(A.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseEnumValuesDefinition();return this.node(r,{kind:N.ENUM_TYPE_DEFINITION,description:i,name:o,directives:u,values:f})}parseEnumValuesDefinition(){return this.optionalMany(A.BRACE_L,this.parseEnumValueDefinition,A.BRACE_R)}parseEnumValueDefinition(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseEnumValueName(),u=this.parseConstDirectives();return this.node(r,{kind:N.ENUM_VALUE_DEFINITION,description:i,name:o,directives:u})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw ke(this._lexer.source,this._lexer.token.start,`${$r(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseInputFieldsDefinition();return this.node(r,{kind:N.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:o,directives:u,fields:f})}parseInputFieldsDefinition(){return this.optionalMany(A.BRACE_L,this.parseInputValueDef,A.BRACE_R)}parseTypeSystemExtension(){const r=this._lexer.lookahead();if(r.kind===A.NAME)switch(r.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(r)}parseSchemaExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const i=this.parseConstDirectives(),o=this.optionalMany(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);if(i.length===0&&o.length===0)throw this.unexpected();return this.node(r,{kind:N.SCHEMA_EXTENSION,directives:i,operationTypes:o})}parseScalarTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const i=this.parseName(),o=this.parseConstDirectives();if(o.length===0)throw this.unexpected();return this.node(r,{kind:N.SCALAR_TYPE_EXTENSION,name:i,directives:o})}parseObjectTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const i=this.parseName(),o=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),f=this.parseFieldsDefinition();if(o.length===0&&u.length===0&&f.length===0)throw this.unexpected();return this.node(r,{kind:N.OBJECT_TYPE_EXTENSION,name:i,interfaces:o,directives:u,fields:f})}parseInterfaceTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const i=this.parseName(),o=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),f=this.parseFieldsDefinition();if(o.length===0&&u.length===0&&f.length===0)throw this.unexpected();return this.node(r,{kind:N.INTERFACE_TYPE_EXTENSION,name:i,interfaces:o,directives:u,fields:f})}parseUnionTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseUnionMemberTypes();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.UNION_TYPE_EXTENSION,name:i,directives:o,types:u})}parseEnumTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseEnumValuesDefinition();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.ENUM_TYPE_EXTENSION,name:i,directives:o,values:u})}parseInputObjectTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseInputFieldsDefinition();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:o,fields:u})}parseDirectiveDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(A.AT);const o=this.parseName(),u=this.parseArgumentDefs(),f=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const g=this.parseDirectiveLocations();return this.node(r,{kind:N.DIRECTIVE_DEFINITION,description:i,name:o,arguments:u,repeatable:f,locations:g})}parseDirectiveLocations(){return this.delimitedMany(A.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const r=this._lexer.token,i=this.parseName();if(Object.prototype.hasOwnProperty.call(se,i.value))return i;throw this.unexpected(r)}node(r,i){return this._options.noLocation!==!0&&(i.loc=new gv(r,this._lexer.lastToken,this._lexer.source)),i}peek(r){return this._lexer.token.kind===r}expectToken(r){const i=this._lexer.token;if(i.kind===r)return this.advanceLexer(),i;throw ke(this._lexer.source,i.start,`Expected ${Yc(r)}, found ${$r(i)}.`)}expectOptionalToken(r){return this._lexer.token.kind===r?(this.advanceLexer(),!0):!1}expectKeyword(r){const i=this._lexer.token;if(i.kind===A.NAME&&i.value===r)this.advanceLexer();else throw ke(this._lexer.source,i.start,`Expected "${r}", found ${$r(i)}.`)}expectOptionalKeyword(r){const i=this._lexer.token;return i.kind===A.NAME&&i.value===r?(this.advanceLexer(),!0):!1}unexpected(r){const i=r??this._lexer.token;return ke(this._lexer.source,i.start,`Unexpected ${$r(i)}.`)}any(r,i,o){this.expectToken(r);const u=[];for(;!this.expectOptionalToken(o);)u.push(i.call(this));return u}optionalMany(r,i,o){if(this.expectOptionalToken(r)){const u=[];do u.push(i.call(this));while(!this.expectOptionalToken(o));return u}return[]}many(r,i,o){this.expectToken(r);const u=[];do u.push(i.call(this));while(!this.expectOptionalToken(o));return u}delimitedMany(r,i){this.expectOptionalToken(r);const o=[];do o.push(i.call(this));while(this.expectOptionalToken(r));return o}advanceLexer(){const{maxTokens:r}=this._options,i=this._lexer.advance();if(r!==void 0&&i.kind!==A.EOF&&(++this._tokenCounter,this._tokenCounter>r))throw ke(this._lexer.source,i.start,`Document contains more that ${r} tokens. Parsing aborted.`)}}function $r(n){const r=n.value;return Yc(n.kind)+(r!=null?` "${r}"`:"")}function Yc(n){return wv(n)?`"${n}"`:n}const jv=5;function Wv(n,r){const[i,o]=r?[n,r]:[void 0,n];let u=" Did you mean ";i&&(u+=i+" ");const f=o.map(w=>`"${w}"`);switch(f.length){case 0:return"";case 1:return u+f[0]+"?";case 2:return u+f[0]+" or "+f[1]+"?"}const g=f.slice(0,jv),v=g.pop();return u+g.join(", ")+", or "+v+"?"}function Sc(n){return n}function Xc(n,r){const i=Object.create(null);for(const o of n)i[r(o)]=o;return i}function $n(n,r,i){const o=Object.create(null);for(const u of n)o[r(u)]=i(u);return o}function zr(n,r){const i=Object.create(null);for(const o of Object.keys(n))i[o]=r(n[o],o);return i}function Gv(n,r){let i=0,o=0;for(;i<n.length&&o<r.length;){let u=n.charCodeAt(i),f=r.charCodeAt(o);if(Br(u)&&Br(f)){let g=0;do++i,g=g*10+u-Oa,u=n.charCodeAt(i);while(Br(u)&&g>0);let v=0;do++o,v=v*10+f-Oa,f=r.charCodeAt(o);while(Br(f)&&v>0);if(g<v)return-1;if(g>v)return 1}else{if(u<f)return-1;if(u>f)return 1;++i,++o}}return n.length-r.length}const Oa=48,Vv=57;function Br(n){return!isNaN(n)&&Oa<=n&&n<=Vv}function qv(n,r){const i=Object.create(null),o=new Jv(n),u=Math.floor(n.length*.4)+1;for(const f of r){const g=o.measure(f,u);g!==void 0&&(i[f]=g)}return Object.keys(i).sort((f,g)=>{const v=i[f]-i[g];return v!==0?v:Gv(f,g)})}class Jv{constructor(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=Ac(this._inputLowerCase),this._rows=[new Array(r.length+1).fill(0),new Array(r.length+1).fill(0),new Array(r.length+1).fill(0)]}measure(r,i){if(this._input===r)return 0;const o=r.toLowerCase();if(this._inputLowerCase===o)return 1;let u=Ac(o),f=this._inputArray;if(u.length<f.length){const O=u;u=f,f=O}const g=u.length,v=f.length;if(g-v>i)return;const w=this._rows;for(let O=0;O<=v;O++)w[0][O]=O;for(let O=1;O<=g;O++){const D=w[(O-1)%3],P=w[O%3];let M=P[0]=O;for(let $=1;$<=v;$++){const he=u[O-1]===f[$-1]?0:1;let ae=Math.min(D[$]+1,P[$-1]+1,D[$-1]+he);if(O>1&&$>1&&u[O-1]===f[$-2]&&u[O-2]===f[$-1]){const me=w[(O-2)%3][$-2];ae=Math.min(ae,me+1)}ae<M&&(M=ae),P[$]=ae}if(M>i)return}const b=w[g%3][v];return b<=i?b:void 0}}function Ac(n){const r=n.length,i=new Array(r);for(let o=0;o<r;++o)i[o]=n.charCodeAt(o);return i}function _t(n){if(n==null)return Object.create(null);if(Object.getPrototypeOf(n)===null)return n;const r=Object.create(null);for(const[i,o]of Object.entries(n))r[i]=o;return r}function zv(n){return`"${n.replace(Qv,Hv)}"`}const Qv=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Hv(n){return Yv[n.charCodeAt(0)]}const Yv=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Xv=Object.freeze({});function Kv(n,r,i=Gc){const o=new Map;for(const me of Object.values(N))o.set(me,Zv(r,me));let u,f=Array.isArray(n),g=[n],v=-1,w=[],b=n,O,D;const P=[],M=[];do{v++;const me=v===g.length,Ye=me&&w.length!==0;if(me){if(O=M.length===0?void 0:P[P.length-1],b=D,D=M.pop(),Ye)if(f){b=b.slice();let L=0;for(const[ee,H]of w){const ce=ee-L;H===null?(b.splice(ce,1),L++):b[ce]=H}}else{b=Object.defineProperties({},Object.getOwnPropertyDescriptors(b));for(const[L,ee]of w)b[L]=ee}v=u.index,g=u.keys,w=u.edits,f=u.inArray,u=u.prev}else if(D){if(O=f?v:g[v],b=D[O],b==null)continue;P.push(O)}let xe;if(!Array.isArray(b)){var $,he;wc(b)||ue(!1,`Invalid AST Node: ${J(b)}.`);const L=me?($=o.get(b.kind))===null||$===void 0?void 0:$.leave:(he=o.get(b.kind))===null||he===void 0?void 0:he.enter;if(xe=L?.call(r,b,O,D,P,M),xe===Xv)break;if(xe===!1){if(!me){P.pop();continue}}else if(xe!==void 0&&(w.push([O,xe]),!me))if(wc(xe))b=xe;else{P.pop();continue}}if(xe===void 0&&Ye&&w.push([O,b]),me)P.pop();else{var ae;u={inArray:f,index:v,keys:g,edits:w,prev:u},f=Array.isArray(b),g=f?b:(ae=i[b.kind])!==null&&ae!==void 0?ae:[],v=-1,w=[],D&&M.push(D),D=b}}while(u!==void 0);return w.length!==0?w[w.length-1][1]:n}function Zv(n,r){const i=n[r];return typeof i=="object"?i:typeof i=="function"?{enter:i,leave:void 0}:{enter:n.enter,leave:n.leave}}function yt(n){return Kv(n,t_)}const e_=80,t_={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>k(n.definitions,`
|
|
30
|
-
|
|
31
|
-
`)},OperationDefinition:{leave(n){const r=ne("(",k(n.variableDefinitions,", "),")"),i=k([n.operation,k([n.name,r]),k(n.directives," ")]," ");return(i==="query"?"":i+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:r,defaultValue:i,directives:o})=>n+": "+r+ne(" = ",i)+ne(" ",k(o," "))},SelectionSet:{leave:({selections:n})=>bt(n)},Field:{leave({alias:n,name:r,arguments:i,directives:o,selectionSet:u}){const f=ne("",n,": ")+r;let g=f+ne("(",k(i,", "),")");return g.length>e_&&(g=f+ne(`(
|
|
32
|
-
`,Gr(k(i,`
|
|
33
|
-
`)),`
|
|
34
|
-
)`)),k([g,k(o," "),u]," ")}},Argument:{leave:({name:n,value:r})=>n+": "+r},FragmentSpread:{leave:({name:n,directives:r})=>"..."+n+ne(" ",k(r," "))},InlineFragment:{leave:({typeCondition:n,directives:r,selectionSet:i})=>k(["...",ne("on ",n),k(r," "),i]," ")},FragmentDefinition:{leave:({name:n,typeCondition:r,variableDefinitions:i,directives:o,selectionSet:u})=>`fragment ${n}${ne("(",k(i,", "),")")} on ${r} ${ne("",k(o," ")," ")}`+u},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:r})=>r?xv(n):zv(n)},BooleanValue:{leave:({value:n})=>n?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:n})=>n},ListValue:{leave:({values:n})=>"["+k(n,", ")+"]"},ObjectValue:{leave:({fields:n})=>"{"+k(n,", ")+"}"},ObjectField:{leave:({name:n,value:r})=>n+": "+r},Directive:{leave:({name:n,arguments:r})=>"@"+n+ne("(",k(r,", "),")")},NamedType:{leave:({name:n})=>n},ListType:{leave:({type:n})=>"["+n+"]"},NonNullType:{leave:({type:n})=>n+"!"},SchemaDefinition:{leave:({description:n,directives:r,operationTypes:i})=>ne("",n,`
|
|
35
|
-
`)+k(["schema",k(r," "),bt(i)]," ")},OperationTypeDefinition:{leave:({operation:n,type:r})=>n+": "+r},ScalarTypeDefinition:{leave:({description:n,name:r,directives:i})=>ne("",n,`
|
|
36
|
-
`)+k(["scalar",r,k(i," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:r,interfaces:i,directives:o,fields:u})=>ne("",n,`
|
|
37
|
-
`)+k(["type",r,ne("implements ",k(i," & ")),k(o," "),bt(u)]," ")},FieldDefinition:{leave:({description:n,name:r,arguments:i,type:o,directives:u})=>ne("",n,`
|
|
38
|
-
`)+r+(Ic(i)?ne(`(
|
|
39
|
-
`,Gr(k(i,`
|
|
40
|
-
`)),`
|
|
41
|
-
)`):ne("(",k(i,", "),")"))+": "+o+ne(" ",k(u," "))},InputValueDefinition:{leave:({description:n,name:r,type:i,defaultValue:o,directives:u})=>ne("",n,`
|
|
42
|
-
`)+k([r+": "+i,ne("= ",o),k(u," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:r,interfaces:i,directives:o,fields:u})=>ne("",n,`
|
|
43
|
-
`)+k(["interface",r,ne("implements ",k(i," & ")),k(o," "),bt(u)]," ")},UnionTypeDefinition:{leave:({description:n,name:r,directives:i,types:o})=>ne("",n,`
|
|
44
|
-
`)+k(["union",r,k(i," "),ne("= ",k(o," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:r,directives:i,values:o})=>ne("",n,`
|
|
45
|
-
`)+k(["enum",r,k(i," "),bt(o)]," ")},EnumValueDefinition:{leave:({description:n,name:r,directives:i})=>ne("",n,`
|
|
46
|
-
`)+k([r,k(i," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:r,directives:i,fields:o})=>ne("",n,`
|
|
47
|
-
`)+k(["input",r,k(i," "),bt(o)]," ")},DirectiveDefinition:{leave:({description:n,name:r,arguments:i,repeatable:o,locations:u})=>ne("",n,`
|
|
48
|
-
`)+"directive @"+r+(Ic(i)?ne(`(
|
|
49
|
-
`,Gr(k(i,`
|
|
50
|
-
`)),`
|
|
51
|
-
)`):ne("(",k(i,", "),")"))+(o?" repeatable":"")+" on "+k(u," | ")},SchemaExtension:{leave:({directives:n,operationTypes:r})=>k(["extend schema",k(n," "),bt(r)]," ")},ScalarTypeExtension:{leave:({name:n,directives:r})=>k(["extend scalar",n,k(r," ")]," ")},ObjectTypeExtension:{leave:({name:n,interfaces:r,directives:i,fields:o})=>k(["extend type",n,ne("implements ",k(r," & ")),k(i," "),bt(o)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:r,directives:i,fields:o})=>k(["extend interface",n,ne("implements ",k(r," & ")),k(i," "),bt(o)]," ")},UnionTypeExtension:{leave:({name:n,directives:r,types:i})=>k(["extend union",n,k(r," "),ne("= ",k(i," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:r,values:i})=>k(["extend enum",n,k(r," "),bt(i)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:r,fields:i})=>k(["extend input",n,k(r," "),bt(i)]," ")}};function k(n,r=""){var i;return(i=n?.filter(o=>o).join(r))!==null&&i!==void 0?i:""}function bt(n){return ne(`{
|
|
52
|
-
`,Gr(k(n,`
|
|
53
|
-
`)),`
|
|
54
|
-
}`)}function ne(n,r,i=""){return r!=null&&r!==""?n+r+i:""}function Gr(n){return ne(" ",n.replace(/\n/g,`
|
|
55
|
-
`))}function Ic(n){var r;return(r=n?.some(i=>i.includes(`
|
|
56
|
-
`)))!==null&&r!==void 0?r:!1}function Ra(n,r){switch(n.kind){case N.NULL:return null;case N.INT:return parseInt(n.value,10);case N.FLOAT:return parseFloat(n.value);case N.STRING:case N.ENUM:case N.BOOLEAN:return n.value;case N.LIST:return n.values.map(i=>Ra(i,r));case N.OBJECT:return $n(n.fields,i=>i.name.value,i=>Ra(i.value,r));case N.VARIABLE:return r?.[n.name.value]}}function Ot(n){if(n!=null||ue(!1,"Must provide name."),typeof n=="string"||ue(!1,"Expected name to be a string."),n.length===0)throw new fe("Expected name to be a non-empty string.");for(let r=1;r<n.length;++r)if(!qc(n.charCodeAt(r)))throw new fe(`Names must only contain [_a-zA-Z0-9] but "${n}" does not.`);if(!Fa(n.charCodeAt(0)))throw new fe(`Names must start with [_a-zA-Z] but "${n}" does not.`);return n}function n_(n){if(n==="true"||n==="false"||n==="null")throw new fe(`Enum values cannot be named: ${n}`);return Ot(n)}function Kc(n){return gi(n)||Kt(n)||gt(n)||_n(n)||xn(n)||Tn(n)||Wi(n)||yn(n)}function gi(n){return Mt(n,jn)}function Kt(n){return Mt(n,En)}function i_(n){if(!Kt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Object type.`);return n}function gt(n){return Mt(n,ll)}function r_(n){if(!gt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Interface type.`);return n}function _n(n){return Mt(n,fl)}function xn(n){return Mt(n,Qr)}function Tn(n){return Mt(n,pl)}function Wi(n){return Mt(n,ht)}function yn(n){return Mt(n,re)}function Zc(n){return gi(n)||xn(n)||Tn(n)||Da(n)&&Zc(n.ofType)}function el(n){return gi(n)||Kt(n)||gt(n)||_n(n)||xn(n)||Da(n)&&el(n.ofType)}function tl(n){return gi(n)||xn(n)}function s_(n){return gt(n)||_n(n)}class ht{constructor(r){Kc(r)||ue(!1,`Expected ${J(r)} to be a GraphQL type.`),this.ofType=r}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class re{constructor(r){nl(r)||ue(!1,`Expected ${J(r)} to be a GraphQL nullable type.`),this.ofType=r}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function Da(n){return Wi(n)||yn(n)}function nl(n){return Kc(n)&&!yn(n)}function a_(n){if(!nl(n))throw new Error(`Expected ${J(n)} to be a GraphQL nullable type.`);return n}function o_(n){if(n){let r=n;for(;Da(r);)r=r.ofType;return r}}function il(n){return typeof n=="function"?n():n}function rl(n){return typeof n=="function"?n():n}class jn{constructor(r){var i,o,u,f;const g=(i=r.parseValue)!==null&&i!==void 0?i:Sc;this.name=Ot(r.name),this.description=r.description,this.specifiedByURL=r.specifiedByURL,this.serialize=(o=r.serialize)!==null&&o!==void 0?o:Sc,this.parseValue=g,this.parseLiteral=(u=r.parseLiteral)!==null&&u!==void 0?u:(v,w)=>g(Ra(v,w)),this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(f=r.extensionASTNodes)!==null&&f!==void 0?f:[],r.specifiedByURL==null||typeof r.specifiedByURL=="string"||ue(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${J(r.specifiedByURL)}.`),r.serialize==null||typeof r.serialize=="function"||ue(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),r.parseLiteral&&(typeof r.parseValue=="function"&&typeof r.parseLiteral=="function"||ue(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class En{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=()=>al(r),this._interfaces=()=>sl(r),r.isTypeOf==null||typeof r.isTypeOf=="function"||ue(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${J(r.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ul(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function sl(n){var r;const i=il((r=n.interfaces)!==null&&r!==void 0?r:[]);return Array.isArray(i)||ue(!1,`${n.name} interfaces must be an Array or a function which returns an Array.`),i}function al(n){const r=rl(n.fields);return li(r)||ue(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),zr(r,(i,o)=>{var u;li(i)||ue(!1,`${n.name}.${o} field config must be an object.`),i.resolve==null||typeof i.resolve=="function"||ue(!1,`${n.name}.${o} field resolver must be a function if provided, but got: ${J(i.resolve)}.`);const f=(u=i.args)!==null&&u!==void 0?u:{};return li(f)||ue(!1,`${n.name}.${o} args must be an object with argument names as keys.`),{name:Ot(o),description:i.description,type:i.type,args:ol(f),resolve:i.resolve,subscribe:i.subscribe,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}})}function ol(n){return Object.entries(n).map(([r,i])=>({name:Ot(r),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}function li(n){return Zt(n)&&!Array.isArray(n)}function ul(n){return zr(n,r=>({description:r.description,type:r.type,args:cl(r.args),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}function cl(n){return $n(n,r=>r.name,r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}class ll{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=al.bind(void 0,r),this._interfaces=sl.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${J(r.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ul(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class fl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._types=u_.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${J(r.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function u_(n){const r=il(n.types);return Array.isArray(r)||ue(!1,`Must provide Array of types or a function which returns such an array for Union ${n.name}.`),r}class Qr{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._values=c_(this.name,r.values),this._valueLookup=new Map(this._values.map(o=>[o.value,o])),this._nameLookup=Xc(this._values,o=>o.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(r){return this._nameLookup[r]}serialize(r){const i=this._valueLookup.get(r);if(i===void 0)throw new fe(`Enum "${this.name}" cannot represent value: ${J(r)}`);return i.name}parseValue(r){if(typeof r!="string"){const o=J(r);throw new fe(`Enum "${this.name}" cannot represent non-string value: ${o}.`+jr(this,o))}const i=this.getValue(r);if(i==null)throw new fe(`Value "${r}" does not exist in "${this.name}" enum.`+jr(this,r));return i.value}parseLiteral(r,i){if(r.kind!==N.ENUM){const u=yt(r);throw new fe(`Enum "${this.name}" cannot represent non-enum value: ${u}.`+jr(this,u),{nodes:r})}const o=this.getValue(r.value);if(o==null){const u=yt(r);throw new fe(`Value "${u}" does not exist in "${this.name}" enum.`+jr(this,u),{nodes:r})}return o.value}toConfig(){const r=$n(this.getValues(),i=>i.name,i=>({description:i.description,value:i.value,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}));return{name:this.name,description:this.description,values:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function jr(n,r){const i=n.getValues().map(u=>u.name),o=qv(r,i);return Wv("the enum value",o)}function c_(n,r){return li(r)||ue(!1,`${n} values must be an object with value names as keys.`),Object.entries(r).map(([i,o])=>(li(o)||ue(!1,`${n}.${i} must refer to an object with a "value" key representing an internal value but got: ${J(o)}.`),{name:n_(i),description:o.description,value:o.value!==void 0?o.value:i,deprecationReason:o.deprecationReason,extensions:_t(o.extensions),astNode:o.astNode}))}class pl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=l_.bind(void 0,r)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const r=zr(this.getFields(),i=>({description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}));return{name:this.name,description:this.description,fields:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function l_(n){const r=rl(n.fields);return li(r)||ue(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),zr(r,(i,o)=>(!("resolve"in i)||ue(!1,`${n.name}.${o} field has a resolve property, but Input Types cannot define resolvers.`),{name:Ot(o),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}const wa=2147483647,Ea=-2147483648,f_=new jn({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r?1:0;let i=r;if(typeof r=="string"&&r!==""&&(i=Number(r)),typeof i!="number"||!Number.isInteger(i))throw new fe(`Int cannot represent non-integer value: ${J(r)}`);if(i>wa||i<Ea)throw new fe("Int cannot represent non 32-bit signed integer value: "+J(r));return i},parseValue(n){if(typeof n!="number"||!Number.isInteger(n))throw new fe(`Int cannot represent non-integer value: ${J(n)}`);if(n>wa||n<Ea)throw new fe(`Int cannot represent non 32-bit signed integer value: ${n}`);return n},parseLiteral(n){if(n.kind!==N.INT)throw new fe(`Int cannot represent non-integer value: ${yt(n)}`,{nodes:n});const r=parseInt(n.value,10);if(r>wa||r<Ea)throw new fe(`Int cannot represent non 32-bit signed integer value: ${n.value}`,{nodes:n});return r}}),p_=new jn({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r?1:0;let i=r;if(typeof r=="string"&&r!==""&&(i=Number(r)),typeof i!="number"||!Number.isFinite(i))throw new fe(`Float cannot represent non numeric value: ${J(r)}`);return i},parseValue(n){if(typeof n!="number"||!Number.isFinite(n))throw new fe(`Float cannot represent non numeric value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.FLOAT&&n.kind!==N.INT)throw new fe(`Float cannot represent non numeric value: ${yt(n)}`,n);return parseFloat(n.value)}}),Oe=new jn({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(n){const r=Gi(n);if(typeof r=="string")return r;if(typeof r=="boolean")return r?"true":"false";if(typeof r=="number"&&Number.isFinite(r))return r.toString();throw new fe(`String cannot represent value: ${J(n)}`)},parseValue(n){if(typeof n!="string")throw new fe(`String cannot represent a non string value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.STRING)throw new fe(`String cannot represent a non string value: ${yt(n)}`,{nodes:n});return n.value}}),mt=new jn({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r;if(Number.isFinite(r))return r!==0;throw new fe(`Boolean cannot represent a non boolean value: ${J(r)}`)},parseValue(n){if(typeof n!="boolean")throw new fe(`Boolean cannot represent a non boolean value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.BOOLEAN)throw new fe(`Boolean cannot represent a non boolean value: ${yt(n)}`,{nodes:n});return n.value}}),dl=new jn({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(n){const r=Gi(n);if(typeof r=="string")return r;if(Number.isInteger(r))return String(r);throw new fe(`ID cannot represent value: ${J(n)}`)},parseValue(n){if(typeof n=="string")return n;if(typeof n=="number"&&Number.isInteger(n))return n.toString();throw new fe(`ID cannot represent value: ${J(n)}`)},parseLiteral(n){if(n.kind!==N.STRING&&n.kind!==N.INT)throw new fe("ID cannot represent a non-string and non-integer value: "+yt(n),{nodes:n});return n.value}}),hl=Object.freeze([Oe,f_,p_,mt,dl]);function d_(n){return hl.some(({name:r})=>n.name===r)}function Gi(n){if(Zt(n)){if(typeof n.valueOf=="function"){const r=n.valueOf();if(!Zt(r))return r}if(typeof n.toJSON=="function")return n.toJSON()}return n}function h_(n){return Mt(n,mi)}class mi{constructor(r){var i,o;this.name=Ot(r.name),this.description=r.description,this.locations=r.locations,this.isRepeatable=(i=r.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=_t(r.extensions),this.astNode=r.astNode,Array.isArray(r.locations)||ue(!1,`@${r.name} locations must be an Array.`);const u=(o=r.args)!==null&&o!==void 0?o:{};Zt(u)&&!Array.isArray(u)||ue(!1,`@${r.name} args must be an object with argument names as keys.`),this.args=ol(u)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:cl(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const g_=new mi({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[se.FIELD,se.FRAGMENT_SPREAD,se.INLINE_FRAGMENT],args:{if:{type:new re(mt),description:"Included when true."}}}),m_=new mi({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[se.FIELD,se.FRAGMENT_SPREAD,se.INLINE_FRAGMENT],args:{if:{type:new re(mt),description:"Skipped when true."}}}),gl="No longer supported",y_=new mi({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[se.FIELD_DEFINITION,se.ARGUMENT_DEFINITION,se.INPUT_FIELD_DEFINITION,se.ENUM_VALUE],args:{reason:{type:Oe,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:gl}}}),v_=new mi({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[se.SCALAR],args:{url:{type:new re(Oe),description:"The URL that specifies the behavior of this scalar."}}}),ml=Object.freeze([g_,m_,y_,v_]);function __(n){return ml.some(({name:r})=>r===n.name)}function x_(n){return typeof n=="object"&&typeof n?.[Symbol.iterator]=="function"}function ci(n,r){if(yn(r)){const i=ci(n,r.ofType);return i?.kind===N.NULL?null:i}if(n===null)return{kind:N.NULL};if(n===void 0)return null;if(Wi(r)){const i=r.ofType;if(x_(n)){const o=[];for(const u of n){const f=ci(u,i);f!=null&&o.push(f)}return{kind:N.LIST,values:o}}return ci(n,i)}if(Tn(r)){if(!Zt(n))return null;const i=[];for(const o of Object.values(r.getFields())){const u=ci(n[o.name],o.type);u&&i.push({kind:N.OBJECT_FIELD,name:{kind:N.NAME,value:o.name},value:u})}return{kind:N.OBJECT,fields:i}}if(tl(r)){const i=r.serialize(n);if(i==null)return null;if(typeof i=="boolean")return{kind:N.BOOLEAN,value:i};if(typeof i=="number"&&Number.isFinite(i)){const o=String(i);return bc.test(o)?{kind:N.INT,value:o}:{kind:N.FLOAT,value:o}}if(typeof i=="string")return xn(r)?{kind:N.ENUM,value:i}:r===dl&&bc.test(i)?{kind:N.INT,value:i}:{kind:N.STRING,value:i};throw new TypeError(`Cannot convert value to AST: ${J(i)}.`)}ji(!1,"Unexpected input type: "+J(r))}const bc=/^-?(?:0|[1-9][0-9]*)$/,Pa=new En({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Oe,resolve:n=>n.description},types:{description:"A list of all types supported by this server.",type:new re(new ht(new re(kt))),resolve(n){return Object.values(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new re(kt),resolve:n=>n.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:kt,resolve:n=>n.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:kt,resolve:n=>n.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new re(new ht(new re(yl))),resolve:n=>n.getDirectives()}})}),yl=new En({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
57
|
-
|
|
58
|
-
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},isRepeatable:{type:new re(mt),resolve:n=>n.isRepeatable},locations:{type:new re(new ht(new re(vl))),resolve:n=>n.locations},args:{type:new re(new ht(new re(Hr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}}})}),vl=new Qr({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:se.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:se.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:se.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:se.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:se.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:se.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:se.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:se.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:se.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:se.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:se.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:se.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:se.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:se.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:se.UNION,description:"Location adjacent to a union definition."},ENUM:{value:se.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:se.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:se.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:se.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),kt=new En({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new re(Tl),resolve(n){if(gi(n))return ve.SCALAR;if(Kt(n))return ve.OBJECT;if(gt(n))return ve.INTERFACE;if(_n(n))return ve.UNION;if(xn(n))return ve.ENUM;if(Tn(n))return ve.INPUT_OBJECT;if(Wi(n))return ve.LIST;if(yn(n))return ve.NON_NULL;ji(!1,`Unexpected type: "${J(n)}".`)}},name:{type:Oe,resolve:n=>"name"in n?n.name:void 0},description:{type:Oe,resolve:n=>"description"in n?n.description:void 0},specifiedByURL:{type:Oe,resolve:n=>"specifiedByURL"in n?n.specifiedByURL:void 0},fields:{type:new ht(new re(_l)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Kt(n)||gt(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},interfaces:{type:new ht(new re(kt)),resolve(n){if(Kt(n)||gt(n))return n.getInterfaces()}},possibleTypes:{type:new ht(new re(kt)),resolve(n,r,i,{schema:o}){if(s_(n))return o.getPossibleTypes(n)}},enumValues:{type:new ht(new re(xl)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(xn(n)){const i=n.getValues();return r?i:i.filter(o=>o.deprecationReason==null)}}},inputFields:{type:new ht(new re(Hr)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Tn(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},ofType:{type:kt,resolve:n=>"ofType"in n?n.ofType:void 0}})}),_l=new En({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},args:{type:new re(new ht(new re(Hr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}},type:{type:new re(kt),resolve:n=>n.type},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),Hr=new En({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},type:{type:new re(kt),resolve:n=>n.type},defaultValue:{type:Oe,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(n){const{type:r,defaultValue:i}=n,o=ci(i,r);return o?yt(o):null}},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),xl=new En({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})});var ve;(function(n){n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.INPUT_OBJECT="INPUT_OBJECT",n.LIST="LIST",n.NON_NULL="NON_NULL"})(ve||(ve={}));const Tl=new Qr({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ve.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:ve.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ve.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ve.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ve.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ve.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ve.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ve.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new re(Pa);new re(Oe);new re(Oe);const wl=Object.freeze([Pa,yl,vl,kt,_l,Hr,xl,Tl]);function T_(n){return wl.some(({name:r})=>n.name===r)}class w_{constructor(r){var i,o;this.__validationErrors=r.assumeValid===!0?[]:void 0,Zt(r)||ue(!1,"Must provide configuration object."),!r.types||Array.isArray(r.types)||ue(!1,`"types" must be Array if provided but got: ${J(r.types)}.`),!r.directives||Array.isArray(r.directives)||ue(!1,`"directives" must be Array if provided but got: ${J(r.directives)}.`),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._queryType=r.query,this._mutationType=r.mutation,this._subscriptionType=r.subscription,this._directives=(o=r.directives)!==null&&o!==void 0?o:ml;const u=new Set(r.types);if(r.types!=null)for(const f of r.types)u.delete(f),Nt(f,u);this._queryType!=null&&Nt(this._queryType,u),this._mutationType!=null&&Nt(this._mutationType,u),this._subscriptionType!=null&&Nt(this._subscriptionType,u);for(const f of this._directives)if(h_(f))for(const g of f.args)Nt(g.type,u);Nt(Pa,u),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const f of u){if(f==null)continue;const g=f.name;if(g||ue(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[g]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${g}".`);if(this._typeMap[g]=f,gt(f)){for(const v of f.getInterfaces())if(gt(v)){let w=this._implementationsMap[v.name];w===void 0&&(w=this._implementationsMap[v.name]={objects:[],interfaces:[]}),w.interfaces.push(f)}}else if(Kt(f)){for(const v of f.getInterfaces())if(gt(v)){let w=this._implementationsMap[v.name];w===void 0&&(w=this._implementationsMap[v.name]={objects:[],interfaces:[]}),w.objects.push(f)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(r){switch(r){case Yt.QUERY:return this.getQueryType();case Yt.MUTATION:return this.getMutationType();case Yt.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(r){return this.getTypeMap()[r]}getPossibleTypes(r){return _n(r)?r.getTypes():this.getImplementations(r).objects}getImplementations(r){const i=this._implementationsMap[r.name];return i??{objects:[],interfaces:[]}}isSubType(r,i){let o=this._subTypeMap[r.name];if(o===void 0){if(o=Object.create(null),_n(r))for(const u of r.getTypes())o[u.name]=!0;else{const u=this.getImplementations(r);for(const f of u.objects)o[f.name]=!0;for(const f of u.interfaces)o[f.name]=!0}this._subTypeMap[r.name]=o}return o[i.name]!==void 0}getDirectives(){return this._directives}getDirective(r){return this.getDirectives().find(i=>i.name===r)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function Nt(n,r){const i=o_(n);if(!r.has(i)){if(r.add(i),_n(i))for(const o of i.getTypes())Nt(o,r);else if(Kt(i)||gt(i)){for(const o of i.getInterfaces())Nt(o,r);for(const o of Object.values(i.getFields())){Nt(o.type,r);for(const u of o.args)Nt(u.type,r)}}else if(Tn(i))for(const o of Object.values(i.getFields()))Nt(o.type,r)}return r}function Mi(n,r,i){if(n){if(n.kind===N.VARIABLE){n.name.value;return}if(yn(r))return n.kind===N.NULL?void 0:Mi(n,r.ofType,i);if(n.kind===N.NULL)return null;if(Wi(r)){const o=r.ofType;if(n.kind===N.LIST){const f=[];for(const g of n.values)if(Nc(g,i)){if(yn(o))return;f.push(null)}else{const v=Mi(g,o,i);if(v===void 0)return;f.push(v)}return f}const u=Mi(n,o,i);return u===void 0?void 0:[u]}if(Tn(r)){if(n.kind!==N.OBJECT)return;const o=Object.create(null),u=Xc(n.fields,f=>f.name.value);for(const f of Object.values(r.getFields())){const g=u[f.name];if(!g||Nc(g.value,i)){if(f.defaultValue!==void 0)o[f.name]=f.defaultValue;else if(yn(f.type))return;continue}const v=Mi(g.value,f.type,i);if(v===void 0)return;o[f.name]=v}return o}if(tl(r)){let o;try{o=r.parseLiteral(n,i)}catch{return}return o===void 0?void 0:o}ji(!1,"Unexpected input type: "+J(r))}}function Nc(n,r){return n.kind===N.VARIABLE&&r==null}function E_(n){const r={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...n},i=r.descriptions?"description":"",o=r.specifiedByUrl?"specifiedByURL":"",u=r.directiveIsRepeatable?"isRepeatable":"",f=r.schemaDescription?i:"";function g(v){return r.inputValueDeprecation?v:""}return`
|
|
59
|
-
query IntrospectionQuery {
|
|
60
|
-
__schema {
|
|
61
|
-
${f}
|
|
62
|
-
queryType { name }
|
|
63
|
-
mutationType { name }
|
|
64
|
-
subscriptionType { name }
|
|
65
|
-
types {
|
|
66
|
-
...FullType
|
|
67
|
-
}
|
|
68
|
-
directives {
|
|
69
|
-
name
|
|
70
|
-
${i}
|
|
71
|
-
${u}
|
|
72
|
-
locations
|
|
73
|
-
args${g("(includeDeprecated: true)")} {
|
|
74
|
-
...InputValue
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
fragment FullType on __Type {
|
|
81
|
-
kind
|
|
82
|
-
name
|
|
83
|
-
${i}
|
|
84
|
-
${o}
|
|
85
|
-
fields(includeDeprecated: true) {
|
|
86
|
-
name
|
|
87
|
-
${i}
|
|
88
|
-
args${g("(includeDeprecated: true)")} {
|
|
89
|
-
...InputValue
|
|
90
|
-
}
|
|
91
|
-
type {
|
|
92
|
-
...TypeRef
|
|
93
|
-
}
|
|
94
|
-
isDeprecated
|
|
95
|
-
deprecationReason
|
|
96
|
-
}
|
|
97
|
-
inputFields${g("(includeDeprecated: true)")} {
|
|
98
|
-
...InputValue
|
|
99
|
-
}
|
|
100
|
-
interfaces {
|
|
101
|
-
...TypeRef
|
|
102
|
-
}
|
|
103
|
-
enumValues(includeDeprecated: true) {
|
|
104
|
-
name
|
|
105
|
-
${i}
|
|
106
|
-
isDeprecated
|
|
107
|
-
deprecationReason
|
|
108
|
-
}
|
|
109
|
-
possibleTypes {
|
|
110
|
-
...TypeRef
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
fragment InputValue on __InputValue {
|
|
115
|
-
name
|
|
116
|
-
${i}
|
|
117
|
-
type { ...TypeRef }
|
|
118
|
-
defaultValue
|
|
119
|
-
${g("isDeprecated")}
|
|
120
|
-
${g("deprecationReason")}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
fragment TypeRef on __Type {
|
|
124
|
-
kind
|
|
125
|
-
name
|
|
126
|
-
ofType {
|
|
127
|
-
kind
|
|
128
|
-
name
|
|
129
|
-
ofType {
|
|
130
|
-
kind
|
|
131
|
-
name
|
|
132
|
-
ofType {
|
|
133
|
-
kind
|
|
134
|
-
name
|
|
135
|
-
ofType {
|
|
136
|
-
kind
|
|
137
|
-
name
|
|
138
|
-
ofType {
|
|
139
|
-
kind
|
|
140
|
-
name
|
|
141
|
-
ofType {
|
|
142
|
-
kind
|
|
143
|
-
name
|
|
144
|
-
ofType {
|
|
145
|
-
kind
|
|
146
|
-
name
|
|
147
|
-
ofType {
|
|
148
|
-
kind
|
|
149
|
-
name
|
|
150
|
-
ofType {
|
|
151
|
-
kind
|
|
152
|
-
name
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
`}function S_(n,r){Zt(n)&&Zt(n.__schema)||ue(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${J(n)}.`);const i=n.__schema,o=$n(i.types,x=>x.name,x=>P(x));for(const x of[...hl,...wl])o[x.name]&&(o[x.name]=x);const u=i.queryType?O(i.queryType):null,f=i.mutationType?O(i.mutationType):null,g=i.subscriptionType?O(i.subscriptionType):null,v=i.directives?i.directives.map(qe):[];return new w_({description:i.description,query:u,mutation:f,subscription:g,types:Object.values(o),directives:v,assumeValid:void 0});function w(x){if(x.kind===ve.LIST){const q=x.ofType;if(!q)throw new Error("Decorated type deeper than introspection query.");return new ht(w(q))}if(x.kind===ve.NON_NULL){const q=x.ofType;if(!q)throw new Error("Decorated type deeper than introspection query.");const Se=w(q);return new re(a_(Se))}return b(x)}function b(x){const q=x.name;if(!q)throw new Error(`Unknown type reference: ${J(x)}.`);const Se=o[q];if(!Se)throw new Error(`Invalid or incomplete schema, unknown type: ${q}. Ensure that a full introspection query is used in order to build a client schema.`);return Se}function O(x){return i_(b(x))}function D(x){return r_(b(x))}function P(x){if(x!=null&&x.name!=null&&x.kind!=null)switch(x.kind){case ve.SCALAR:return M(x);case ve.OBJECT:return he(x);case ve.INTERFACE:return ae(x);case ve.UNION:return me(x);case ve.ENUM:return Ye(x);case ve.INPUT_OBJECT:return xe(x)}const q=J(x);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${q}.`)}function M(x){return new jn({name:x.name,description:x.description,specifiedByURL:x.specifiedByURL})}function $(x){if(x.interfaces===null&&x.kind===ve.INTERFACE)return[];if(!x.interfaces){const q=J(x);throw new Error(`Introspection result missing interfaces: ${q}.`)}return x.interfaces.map(D)}function he(x){return new En({name:x.name,description:x.description,interfaces:()=>$(x),fields:()=>L(x)})}function ae(x){return new ll({name:x.name,description:x.description,interfaces:()=>$(x),fields:()=>L(x)})}function me(x){if(!x.possibleTypes){const q=J(x);throw new Error(`Introspection result missing possibleTypes: ${q}.`)}return new fl({name:x.name,description:x.description,types:()=>x.possibleTypes.map(O)})}function Ye(x){if(!x.enumValues){const q=J(x);throw new Error(`Introspection result missing enumValues: ${q}.`)}return new Qr({name:x.name,description:x.description,values:$n(x.enumValues,q=>q.name,q=>({description:q.description,deprecationReason:q.deprecationReason}))})}function xe(x){if(!x.inputFields){const q=J(x);throw new Error(`Introspection result missing inputFields: ${q}.`)}return new pl({name:x.name,description:x.description,fields:()=>H(x.inputFields)})}function L(x){if(!x.fields)throw new Error(`Introspection result missing fields: ${J(x)}.`);return $n(x.fields,q=>q.name,ee)}function ee(x){const q=w(x.type);if(!el(q)){const Se=J(q);throw new Error(`Introspection must provide output type for fields, but received: ${Se}.`)}if(!x.args){const Se=J(x);throw new Error(`Introspection result missing field args: ${Se}.`)}return{description:x.description,deprecationReason:x.deprecationReason,type:q,args:H(x.args)}}function H(x){return $n(x,q=>q.name,ce)}function ce(x){const q=w(x.type);if(!Zc(q)){const xt=J(q);throw new Error(`Introspection must provide input type for arguments, but received: ${xt}.`)}const Se=x.defaultValue!=null?Mi($v(x.defaultValue),q):void 0;return{description:x.description,type:q,defaultValue:Se,deprecationReason:x.deprecationReason}}function qe(x){if(!x.args){const q=J(x);throw new Error(`Introspection result missing directive args: ${q}.`)}if(!x.locations){const q=J(x);throw new Error(`Introspection result missing directive locations: ${q}.`)}return new mi({name:x.name,description:x.description,isRepeatable:x.isRepeatable,locations:x.locations.slice(),args:H(x.args)})}}function A_(n){return b_(n,r=>!__(r),I_)}function I_(n){return!d_(n)&&!T_(n)}function b_(n,r,i){const o=n.getDirectives().filter(r),u=Object.values(n.getTypeMap()).filter(i);return[N_(n),...o.map(f=>U_(f)),...u.map(f=>R_(f))].filter(Boolean).join(`
|
|
164
|
-
|
|
165
|
-
`)}function N_(n){if(n.description==null&&O_(n))return;const r=[],i=n.getQueryType();i&&r.push(` query: ${i.name}`);const o=n.getMutationType();o&&r.push(` mutation: ${o.name}`);const u=n.getSubscriptionType();return u&&r.push(` subscription: ${u.name}`),vt(n)+`schema {
|
|
166
|
-
${r.join(`
|
|
167
|
-
`)}
|
|
168
|
-
}`}function O_(n){const r=n.getQueryType();if(r&&r.name!=="Query")return!1;const i=n.getMutationType();if(i&&i.name!=="Mutation")return!1;const o=n.getSubscriptionType();return!(o&&o.name!=="Subscription")}function R_(n){if(gi(n))return C_(n);if(Kt(n))return L_(n);if(gt(n))return F_(n);if(_n(n))return D_(n);if(xn(n))return P_(n);if(Tn(n))return k_(n);ji(!1,"Unexpected type: "+J(n))}function C_(n){return vt(n)+`scalar ${n.name}`+M_(n)}function El(n){const r=n.getInterfaces();return r.length?" implements "+r.map(i=>i.name).join(" & "):""}function L_(n){return vt(n)+`type ${n.name}`+El(n)+Sl(n)}function F_(n){return vt(n)+`interface ${n.name}`+El(n)+Sl(n)}function D_(n){const r=n.getTypes(),i=r.length?" = "+r.join(" | "):"";return vt(n)+"union "+n.name+i}function P_(n){const r=n.getValues().map((i,o)=>vt(i," ",!o)+" "+i.name+Ua(i.deprecationReason));return vt(n)+`enum ${n.name}`+ka(r)}function k_(n){const r=Object.values(n.getFields()).map((i,o)=>vt(i," ",!o)+" "+Ca(i));return vt(n)+`input ${n.name}`+ka(r)}function Sl(n){const r=Object.values(n.getFields()).map((i,o)=>vt(i," ",!o)+" "+i.name+Al(i.args," ")+": "+String(i.type)+Ua(i.deprecationReason));return ka(r)}function ka(n){return n.length!==0?` {
|
|
169
|
-
`+n.join(`
|
|
170
|
-
`)+`
|
|
171
|
-
}`:""}function Al(n,r=""){return n.length===0?"":n.every(i=>!i.description)?"("+n.map(Ca).join(", ")+")":`(
|
|
172
|
-
`+n.map((i,o)=>vt(i," "+r,!o)+" "+r+Ca(i)).join(`
|
|
173
|
-
`)+`
|
|
174
|
-
`+r+")"}function Ca(n){const r=ci(n.defaultValue,n.type);let i=n.name+": "+String(n.type);return r&&(i+=` = ${yt(r)}`),i+Ua(n.deprecationReason)}function U_(n){return vt(n)+"directive @"+n.name+Al(n.args)+(n.isRepeatable?" repeatable":"")+" on "+n.locations.join(" | ")}function Ua(n){return n==null?"":n!==gl?` @deprecated(reason: ${yt({kind:N.STRING,value:n})})`:" @deprecated"}function M_(n){return n.specifiedByURL==null?"":` @specifiedBy(url: ${yt({kind:N.STRING,value:n.specifiedByURL})})`}function vt(n,r="",i=!0){const{description:o}=n;if(o==null)return"";const u=yt({kind:N.STRING,value:o,block:_v(o)});return(r&&!i?`
|
|
175
|
-
`+r:r)+u.replace(/\n/g,`
|
|
176
|
-
`+r)+`
|
|
177
|
-
`}class en{constructor(r){const{disableInterceptors:i=!1}=r||{};this.configService=new je,this.client=Mr.default.create(),this.client.interceptors.request.use(async o=>{const u=await this.configService.getConfig();return o.baseURL=u.apiUrl,u.apiKey&&(o.headers.Authorization=`Bearer ${u.apiKey}`),o}),!i&&this.client.interceptors.response.use(o=>o,o=>{throw o.response?.status===401?console.error(R.default.red("Authentication failed. Please run `twenty auth:login` first.")):o.response?.status===403?console.error(R.default.red("Access denied. Check your API key and workspace permissions.")):o.code==="ECONNREFUSED"&&console.error(R.default.red("Cannot connect to Twenty server. Is it running?")),o})}async validateAuth(){try{const i=await this.client.post("/metadata",{query:`
|
|
2
|
+
"use strict";var sm=Object.create;var su=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&&su(c,g,{get:()=>a[g],enumerable:!(f=am(a,g))||f.enumerable});return c};var au=(c,a,i)=>(i=c!=null?sm(um(c)):{},lm(a||!c||!c.__esModule?su(i,"default",{value:c,enumerable:!0}):i,c));const se=require("path"),fm=require("chalk"),pu=require("fs-extra"),hm=require("crypto"),pm=require("node:fs/promises"),je=require("twenty-shared/utils"),du=require("./HtmlTagToRemoteComponent-Bd5sgek2.js"),dm=require("fs/promises"),gm=require("esbuild"),Y=require("twenty-shared/application"),ft=require("twenty-shared/types"),mm=require("chokidar"),vm=require("os"),_m=require("axios"),ym=require("fs"),wm=require("graphql-sse"),Ss=require("graphql/index"),xm=require("typescript"),Sm=require("module"),gu=require("fast-glob"),D=require("react/jsx-runtime"),Am=require("@genql/cli"),Em=require("inquirer"),Zn=require("uuid"),mu=require("commander"),bm=require("util"),Xn=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 te=jt(se),E=Xn(fm),ee=jt(pu),vu=Xn(hm),Cm=jt(pm),Ts=jt(dm),_u=jt(gm),yu=Xn(mm),Fs=jt(vm),Kr=Xn(_m),ou=jt(ym),Tn=jt(xm),At=Xn(Em),Et=process.env.INIT_CWD||process.cwd(),zn=c=>c&&!c?.startsWith("/")?se.join(Et,c):c,Tm=async(c,a,i)=>{const f=new Set(i),g=a.filter(_=>!f.has(_));for(const _ of g){const S=_.replace(/\.tsx?$/,".mjs"),A=te.default.join(c,S),I=`${A}.map`;await ee.remove(A),await ee.remove(I)}},Fm=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=te.default.resolve(S),I=te.default.relative(a,A),P=c.metafile?.outputs?.[S]?.entryPoint||"",J=te.default.relative(a,P),G=await ee.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}))}},Im=["react-dom"],Rm="RemoteComponents",Pm=()=>{const c=Object.keys(du.HTML_TAG_TO_REMOTE_COMPONENT).join("|");return new RegExp(`(<\\/?)\\b(${c})\\b(?=[\\s>\\/>])`,"g")},Om=Pm(),Lm=c=>c.replace(Om,(a,i,f)=>{const g=du.HTML_TAG_TO_REMOTE_COMPONENT[f];return je.isDefined(g)?`${i}${Rm}.${g}`:a}),Um=/import\s*\{\s*defineFrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g,uu=/export\s+default\s+defineFrontComponent\s*\(\s*\{[^}]*component\s*:\s*(\w+)[^}]*\}\s*\)\s*;?/s,Mm=c=>{let a=c.replace(Um,"");const i=a.match(uu);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(uu,`export default globalThis.jsx(${f}, {});`)}return a},Nm={name:"jsx-transform-to-remote-dom-worker-format-plugin",setup:c=>{c.onLoad({filter:/\.tsx$/},async({path:a})=>{try{const i=await Cm.readFile(a,"utf8"),f=Lm(i),g=f!==i,_=Mm(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}}]}}})}},Dm=/^(\w+)\s+as\s+(\w+)$/,Wm=c=>{const a=c.trim(),i=a.match(Dm);if(je.isDefined(i)){const[,f,g]=i;return{originalName:f,aliasName:g}}return{originalName:a,aliasName:a}},$m=c=>c.split(",").map(a=>a.trim()).filter(a=>a.length>0).filter(a=>!a.startsWith("type ")).map(a=>Wm(a).originalName),Yr=({sourceContent:c,pattern:a})=>{const i=new Map;let f;for(;je.isDefined(f=a.exec(c));){const g=f.groups?.namedImports,_=f.groups?.subPath??"";i.has(_)||i.set(_,new Set),g&&$m(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,Bm=/^react(\/jsx-runtime)?$/,km=`
|
|
4
|
+
export var jsx = /* @__PURE__ */ (() => globalThis.jsx)();
|
|
5
|
+
export var jsxs = /* @__PURE__ */ (() => globalThis.jsxs)();
|
|
6
|
+
export var Fragment = /* @__PURE__ */ (() => globalThis.React.Fragment)();
|
|
7
|
+
`.trim(),qm=c=>{const a=Yr({sourceContent:c,pattern:As});let i;for(;je.isDefined(i=As.exec(c));)i.groups?.defaultImport&&(a.has("")||a.set("",new Set),a.get("").add("default"));return As.lastIndex=0,a},jm=({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
|
+
`)},Gm=Zr({pluginName:"react-globals",namespace:"react-globals",moduleName:"react",moduleFilter:Bm,collectImports:qm,generateExports:jm,staticContents:{"react/jsx-runtime":km}}),Hm=/^\/\/.*$\n/gm,Km={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=te.default.resolve(f),_=await Ts.readFile(g,"utf-8"),S=_.replace(Hm,"");S!==_&&await Ts.writeFile(g,S,"utf-8")}})}},zm=/import\s+(?:\{(?<namedImports>[^}]*)\})?\s*from\s*['"]twenty-sdk['"];?/g,Jm=/^twenty-sdk$/,Ym=Zr({pluginName:"twenty-sdk-globals",namespace:"twenty-sdk-globals",moduleName:"twenty-sdk",moduleFilter:Jm,collectImports:c=>Yr({sourceContent:c,pattern:zm}),generateExports:({namedImports:c})=>[...c].map(a=>`export var ${a} = /* @__PURE__ */ (() => globalThis.TwentySdk.${a})();`).join(`
|
|
9
|
+
`)}),Zm=/import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-sdk\/ui['"];?/g,Xm=/^twenty-sdk\/ui$/,Qm=Zr({pluginName:"twenty-sdk-ui-globals",namespace:"twenty-sdk-ui-globals",moduleName:"twenty-sdk/ui",moduleFilter:Xm,collectImports:c=>Yr({sourceContent:c,pattern:Zm}),generateExports:({namedImports:c})=>[...c].map(a=>`export var ${a} = /* @__PURE__ */ (() => globalThis.RemoteComponents.TwentyUi${a})();`).join(`
|
|
10
|
+
`)}),Vm=/import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-shared(?:\/(?<subPath>[^'"]*?))?['"];?/g,e0=/^twenty-shared(\/.*)?$/,t0=c=>c===""?"globalThis.TwentyShared":`globalThis.TwentyShared['${c}']`,n0=Zr({pluginName:"twenty-shared-globals",namespace:"twenty-shared-globals",moduleName:"twenty-shared",moduleFilter:e0,collectImports:c=>Yr({sourceContent:c,pattern:Vm}),generateExports:({namedImports:c,moduleSubPath:a})=>{const i=t0(a);return[...c].map(f=>`export var ${f} = /* @__PURE__ */ (() => ${i}.${f})();`).join(`
|
|
11
|
+
`)}}),r0=()=>[Gm,Ym,Qm,n0,Nm,Km],i0=["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 wu{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=te.default.join(this.appPath,Y.OUTPUT_DIR);await Tm(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=te.default.join(this.appPath,Y.OUTPUT_DIR),i={};for(const _ of this.sourcePaths){const S=_.replace(/\.tsx?$/,"");i[S]=te.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 Fm({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:te.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 s0={name:"external-patterns",setup:c=>{c.onResolve({filter:/(?:^|\/)generated(?:\/|$)/},a=>({path:a.path,external:!0}))}},a0=c=>new wu({...c,config:{externalModules:i0,fileFolder:ft.FileFolder.BuiltLogicFunction,platform:"node",extraPlugins:[s0],banner:Y.NODE_ESM_CJS_BANNER}}),o0=c=>new wu({...c,config:{externalModules:Im,fileFolder:ft.FileFolder.BuiltFrontComponent,jsx:"automatic",extraPlugins:r0()}});class u0{constructor(a){this.watcher=null,this.appPath=a.appPath,this.handleChangeDetected=a.handleChangeDetected}async start(){this.watcher=yu.default.watch(this.appPath,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",async(a,i)=>{if(a==="addDir")return;const f=se.relative(this.appPath,i),g=f.startsWith("node_modules")||f.startsWith("generated")||f.startsWith("dist"),_=f.startsWith(Y.ASSETS_DIR),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 c0=({manifest:c,builtFileInfos:a})=>{let i=structuredClone(c);for(const[f,{fileFolder:g,checksum:_}]of a.entries()){const S=se.relative(Y.OUTPUT_DIR,f);if(g===ft.FileFolder.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===ft.FileFolder.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===ft.FileFolder.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===ft.FileFolder.Dependencies&&(S==="package.json"&&(i.application.packageJsonChecksum=_),S==="yarn.lock"&&(i.application.yarnLockChecksum=_))}return i},l0=async(c,a)=>{const i=te.default.join(c,Y.OUTPUT_DIR);await ee.ensureDir(i);const f=te.default.join(i,"manifest.json");return await ee.writeJSON(f,a,{spaces:2}),f},f0=te.join(Fs.tmpdir(),".twenty-sdk-test"),h0=()=>process.env.NODE_ENV==="test"?te.join(f0,"config.json"):te.join(Fs.homedir(),".twenty","config.json"),St="default",Jr=class Jr{constructor(){this.configPath=h0()}static setActiveWorkspace(a){this.activeWorkspace=a??St}static getActiveWorkspace(){return this.activeWorkspace}getActiveWorkspaceName(){return Jr.getActiveWorkspace()}async readRawConfig(){await ee.ensureFile(this.configPath);const a=await ee.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===St&&!f.profiles?.[St]?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 ee.ensureDir(te.dirname(this.configPath)),await ee.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===St){const f=this.getDefaultConfig();delete a.apiKey,a.apiUrl=f.apiUrl}await ee.ensureDir(te.dirname(this.configPath)),await ee.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(St),a.profiles&&Object.keys(a.profiles).forEach(f=>i.add(f)),Array.from(i).sort()}catch{return[St]}}async getDefaultWorkspace(){try{return(await this.readRawConfig()).defaultWorkspace??St}catch{return St}}async setDefaultWorkspace(a){const i=await this.readRawConfig();i.defaultWorkspace=a,await ee.ensureDir(te.dirname(this.configPath)),await ee.writeFile(this.configPath,JSON.stringify(i,null,2))}};Jr.activeWorkspace=St;let Ae=Jr;class bt{constructor(a){const{disableInterceptors:i=!1}=a||{};this.configService=new Ae,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(E.default.red("Authentication failed. Please run `twenty auth:login` first.")):f.response?.status===403?console.error(E.default.red("Access denied. Check your API key and workspace permissions.")):f.code==="ECONNREFUSED"&&console.error(E.default.red("Cannot connect to Twenty server. Is it running?")),f})}async validateAuth(){try{const i=await this.client.post("/metadata",{query:`
|
|
178
12
|
query CurrentWorkspace {
|
|
179
13
|
currentWorkspace {
|
|
180
14
|
id
|
|
181
15
|
}
|
|
182
16
|
}
|
|
183
|
-
`},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return{authValid:i.status===200&&!i.data.errors,serverUp:i.status===200}}catch{return{authValid:!1,serverUp:!1}}}async checkApplicationExist(
|
|
17
|
+
`},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return{authValid:i.status===200&&!i.data.errors,serverUp:i.status===200}}catch{return{authValid:!1,serverUp:!1}}}async checkApplicationExist(a){try{const f=await this.client.post("/metadata",{query:`
|
|
184
18
|
query CheckApplicationExist($universalIdentifier: UUID!) {
|
|
185
19
|
checkApplicationExist(universalIdentifier: $universalIdentifier)
|
|
186
20
|
}
|
|
187
|
-
`,variables:{universalIdentifier:
|
|
21
|
+
`,variables:{universalIdentifier:a}},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return f.data.errors?{success:!1,error:f.data.errors[0]}:{success:!0,data:f.data.data.checkApplicationExist,message:"Successfully find application"}}catch(i){return{success:!1,error:i}}}async createApplication(a){try{const i=`
|
|
188
22
|
mutation CreateOneApplication($input: CreateApplicationInput!) {
|
|
189
23
|
createOneApplication(input: $input) {
|
|
190
24
|
id
|
|
191
25
|
universalIdentifier
|
|
192
26
|
}
|
|
193
27
|
}
|
|
194
|
-
`,
|
|
28
|
+
`,f={input:{universalIdentifier:a.application.universalIdentifier,name:a.application.displayName,version:"0.0.1",sourcePath:"cli-sync"}},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]}:{success:!0,data:g.data.data.createOneApplication,message:`Successfully create application: ${a.application.displayName}`}}catch(i){return{success:!1,error:i}}}async syncApplication(a){try{const i=`
|
|
195
29
|
mutation SyncApplication($manifest: JSON!) {
|
|
196
30
|
syncApplication(manifest: $manifest)
|
|
197
31
|
}
|
|
198
|
-
`,
|
|
32
|
+
`,f={manifest: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]}:{success:!0,data:g.data.data.syncApplication,message:`Successfully synced application: ${a.application.displayName}`}}catch(i){return{success:!1,error:i}}}async uninstallApplication(a){try{const i=`
|
|
199
33
|
mutation UninstallApplication($universalIdentifier: String!) {
|
|
200
34
|
uninstallApplication(universalIdentifier: $universalIdentifier)
|
|
201
35
|
}
|
|
202
|
-
`,
|
|
36
|
+
`,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:`
|
|
203
37
|
query FindManyLogicFunctions {
|
|
204
38
|
findManyLogicFunctions {
|
|
205
39
|
id
|
|
@@ -208,8 +42,8 @@ ${r.join(`
|
|
|
208
42
|
applicationId
|
|
209
43
|
}
|
|
210
44
|
}
|
|
211
|
-
`},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return i.data.errors?{success:!1,error:i.data.errors[0]?.message||"Failed to fetch functions"}:{success:!0,data:i.data.data.findManyLogicFunctions}}catch(
|
|
212
|
-
mutation ExecuteOneLogicFunction($input:
|
|
45
|
+
`},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return i.data.errors?{success:!1,error:i.data.errors[0]?.message||"Failed to fetch functions"}:{success:!0,data:i.data.data.findManyLogicFunctions}}catch(a){return{success:!1,error:a}}}async executeLogicFunction({functionId:a,payload:i}){try{const f=`
|
|
46
|
+
mutation ExecuteOneLogicFunction($input: ExecuteOneLogicFunctionInput!) {
|
|
213
47
|
executeOneLogicFunction(input: $input) {
|
|
214
48
|
data
|
|
215
49
|
logs
|
|
@@ -218,28 +52,28 @@ ${r.join(`
|
|
|
218
52
|
error
|
|
219
53
|
}
|
|
220
54
|
}
|
|
221
|
-
`,
|
|
55
|
+
`,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(),_=wm.createClient({url:g.apiUrl+"/graphql",headers:{Authorization:`Bearer ${g.apiKey}`,"Content-Type":"application/json",Accept:"text/event-stream"}}),S=`
|
|
222
56
|
subscription SubscribeToLogs($input: LogicFunctionLogsInput!) {
|
|
223
57
|
logicFunctionLogs(input: $input) {
|
|
224
58
|
logs
|
|
225
59
|
}
|
|
226
60
|
}
|
|
227
|
-
`,
|
|
61
|
+
`,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 _=te.resolve(a);if(!ou.existsSync(_))return{success:!1,error:`File not found: ${_}`};const S=te.basename(_),A=ou.readFileSync(_),I=this.getMimeType(S),P=`
|
|
228
62
|
mutation UploadApplicationFile($file: Upload!, $applicationUniversalIdentifier: String!, $fileFolder: FileFolder!, $filePath: String!) {
|
|
229
63
|
uploadApplicationFile(file: $file, applicationUniversalIdentifier: $applicationUniversalIdentifier, fileFolder: $fileFolder, filePath: $filePath)
|
|
230
64
|
{ path }
|
|
231
65
|
}
|
|
232
|
-
`,O=By(o),D=JSON.stringify({query:b,variables:{file:null,applicationUniversalIdentifier:u,filePath:i,fileFolder:O}}),P=JSON.stringify({0:["variables.file"]}),M=new FormData;M.append("operations",D),M.append("map",P),M.append("0",new Blob([new Uint8Array(v)],{type:w}),g);const $=await this.client.post("/graphql",M);return $.data.errors?{success:!1,error:$.data.errors[0]?.message||"Failed to upload file"}:{success:!0,data:$.data.data.uploadApplicationFile,message:`Successfully uploaded ${g}`}}catch(f){return Mr.default.isAxiosError(f)&&f.response?{success:!1,error:f.response.data?.errors?.[0]?.message||f.message}:{success:!1,error:f}}}getMimeType(r){const i=we.extname(r).toLowerCase();return{".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".bmp":"image/bmp",".ico":"image/x-icon",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".txt":"text/plain",".csv":"text/csv",".json":"application/json",".xml":"application/xml",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".mp3":"audio/mpeg",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".js":"application/javascript",".ts":"application/typescript",".jsx":"application/javascript",".tsx":"application/typescript",".html":"text/html",".css":"text/css"}[i]||"application/octet-stream"}}class $_{constructor(r){this.apiService=new en,this.applicationUniversalIdentifier=r.applicationUniversalIdentifier,this.appPath=r.appPath}async uploadFile({builtPath:r,fileFolder:i}){const o=ge.relative(vn,r);return await this.apiService.uploadFile({filePath:we.default.join(this.appPath,r),builtHandlerPath:o,fileFolder:i,applicationUniversalIdentifier:this.applicationUniversalIdentifier})}}var Il=(n=>(n.DefineApplication="defineApplication",n.DefineField="defineField",n.DefineLogicFunction="defineLogicFunction",n.DefineObject="defineObject",n.DefineRole="defineRole",n.DefineFrontComponent="defineFrontComponent",n))(Il||{}),mn=(n=>(n.Application="application",n.Fields="fields",n.LogicFunctions="logicFunctions",n.Objects="objects",n.Roles="roles",n.FrontComponents="frontComponents",n.PublicAssets="publicAssets",n))(mn||{});const B_={defineApplication:"application",defineField:"fields",defineLogicFunction:"logicFunctions",defineObject:"objects",defineRole:"roles",defineFrontComponent:"frontComponents"},j_=n=>{if(!ui.isCallExpression(n))return;const r=n.expression;if(ui.isIdentifier(r)&&Object.values(Il).includes(r.text))return r.text},W_=n=>{const r=ui.createSourceFile("temp.ts",n,ui.ScriptTarget.Latest,!0),i=[];ui.forEachChild(r,o=>{i.push(o)});for(const o of i)if(ui.isExportAssignment(o)){if(o.isExportEquals||!o.expression)return;const u=j_(o.expression);if(u)return u}},oi=async({filePath:n,appPath:r})=>{const i=await G_({filePath:n,appPath:r});return V_(i,n)},G_=async({filePath:n,appPath:r})=>{const i=we.default.join(r,"tsconfig.json"),o=await de.pathExists(i),u=Oy.createRequire(we.default.join(r,"package.json"));let f,g;try{f=we.default.dirname(u.resolve("react/package.json")),g=we.default.dirname(u.resolve("react-dom/package.json"))}catch{}const w=(await Uc.build({entryPoints:[n],bundle:!0,write:!1,format:"cjs",platform:"node",target:"node18",jsx:"automatic",tsconfig:o?i:void 0,alias:{...f&&{react:f},...g&&{"react-dom":g}},logLevel:"silent"})).outputFiles[0].text,b=await de.mkdtemp(we.default.join($c.default.tmpdir(),"twenty-manifest-")),O=we.default.join(b,"module.cjs");try{return await de.writeFile(O,w),require(O)}finally{await de.remove(b)}},V_=(n,r)=>{if(Ut.Tr(n.default)&&jy(n.default))return n.default;throw new Error(`Config file ${r} must export a config object default export`)},q_=async n=>await Dc.glob(["**/*.ts","**/*.tsx"],{cwd:n,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**","**/.twenty/**"],onlyFiles:!0}),J_=async n=>await Dc.glob([`${La}/**/*`],{cwd:n,onlyFiles:!0}),z_=async(n,r)=>{const i={};for(const o of r){const f=ge.relative(n,o).split(ge.sep),g=await de.readFile(o,"utf8");let v=i;for(let w=0;w<f.length;w++){const b=f[w];w===f.length-1?v[b]=g:(v[b]=v[b]??{},v=v[b])}}return i},Yr=async n=>{const r=await q_(n),i=[];let o;const u=[],f=[],g=[],v=[],w=[],b=[],O=[],D=[],P=[],M=[],$=[],he=[],ae=[];for(const L of r){const ee=await Fc.readFile(L,"utf-8"),H=ge.relative(n,L),ce=W_(ee);if(!ce)continue;switch(B_[ce]){case mn.Application:{const x=await oi({appPath:n,filePath:L});o={...x.config,yarnLockChecksum:null,packageJsonChecksum:null},i.push(...x.errors),O.push(H);break}case mn.Objects:{const x=await oi({appPath:n,filePath:L});u.push(x.config),i.push(...x.errors),D.push(H);break}case mn.Fields:{const x=await oi({appPath:n,filePath:L});f.push(x.config),i.push(...x.errors),P.push(H);break}case mn.Roles:{const x=await oi({appPath:n,filePath:L});g.push(x.config),i.push(...x.errors),M.push(H);break}case mn.LogicFunctions:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{handler:q,...Se}=x.config,xt=ge.relative(n,L),tn={...Se,handlerName:"default.handler",sourceHandlerPath:xt,builtHandlerPath:xt.replace(/\.tsx?$/,".mjs"),builtHandlerChecksum:null};v.push(tn),$.push(H);break}case mn.FrontComponents:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{component:q,...Se}=x.config,xt=ge.relative(n,L),tn={...Se,componentName:q.name,sourceComponentPath:xt,builtComponentPath:xt.replace(/\.tsx?$/,".mjs"),builtComponentChecksum:null};w.push(tn),he.push(H);break}case mn.PublicAssets:break;default:Ut.ln()}}const me=await J_(n);for(const L of me)b.push({filePath:L,fileName:ge.basename(L),fileType:ge.extname(L).replace(/^\./,""),checksum:null}),ae.push(ge.relative(n,L));return o||i.push("Cannot build application, please export default defineApplication() to define an application"),{manifest:o?{application:o,objects:u,fields:f,roles:g,logicFunctions:v,frontComponents:w,publicAssets:b,sources:await z_(n,r)}:null,filePaths:{application:O,objects:D,fields:P,roles:M,logicFunctions:$,frontComponents:he,publicAssets:ae},errors:i}},Q_=n=>{const r=new Set,i=new Set;for(const o of n)r.has(o)?i.add(o):r.add(o);return Array.from(i)},bl=n=>{const r=[];if(!n)return[];for(const[i,o]of Object.entries(n))i==="universalIdentifier"&&typeof o=="string"&&r.push(o),typeof o=="object"&&r.push(...bl(o));return r},H_=n=>{const r=[],i=[],o=Q_(bl(n));return o.length>0&&r.push(`Duplicate universal identifiers: ${o.join(", ")}`),Ut.Zo(n.objects)||i.push("No object defined"),Ut.Zo(n.logicFunctions)||i.push("No logic function defined"),Ut.Zo(n.frontComponents)||i.push("No front component defined"),{errors:r,warnings:i,isValid:r.length===0}};class Y_{constructor(r){this.builtFileInfos=new Map,this.fileUploader=null,this.apiService=new en({disableInterceptors:!0}),this.activeUploads=new Set,this.syncTimer=null,this.isSyncing=!1,this.serverReady=!1,this.serverErrorLogged=!1,this.appPath=r.appPath,this.debounceMs=r.debounceMs??200,this.handleManifestBuilt=r.handleManifestBuilt,this.uiStateManager=r.uiStateManager}async checkServer(){const r=await this.apiService.validateAuth();if(!r.serverUp){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Cannot reach server",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Cannot connect to Twenty server. Is it running?"}),this.serverErrorLogged=!0);return}if(!r.authValid){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Authentication failed",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:'Cannot authenticate. Check your credentials are correct with "yarn auth:login"'}),this.serverErrorLogged=!0);return}this.serverErrorLogged=!1,this.serverReady=!0}async handleChangeDetected(r,i){this.serverReady||await this.checkServer(),this.serverReady&&(this.uiStateManager.addEvent({message:`Change detected: ${r}`,status:"info"}),i==="unlink"?this.uiStateManager.removeEntity(r):this.uiStateManager.updateFileStatus(r,"building"),this.scheduleSync())}handleFileBuildError(r){this.uiStateManager.addEvent({message:"Build failed:",status:"error"});for(const i of r)this.uiStateManager.addEvent({message:i.error,status:"error"})}handleFileBuilt({fileFolder:r,builtPath:i,sourcePath:o,checksum:u}){this.uiStateManager.addEvent({message:`Successfully built ${i}`,status:"success"}),this.builtFileInfos.set(i,{checksum:u,builtPath:i,sourcePath:o,fileFolder:r}),this.fileUploader&&this.uploadFile(i,o,r),this.scheduleSync()}uploadFile(r,i,o){this.uiStateManager.addEvent({message:`Uploading ${r}`,status:"info"}),this.uiStateManager.updateFileStatus(i,"uploading");const u=this.fileUploader.uploadFile({builtPath:r,fileFolder:o}).then(f=>{f.success?(this.uiStateManager.addEvent({message:`Successfully uploaded ${r}`,status:"success"}),this.uiStateManager.updateFileStatus(i,"success")):this.uiStateManager.addEvent({message:`Failed to upload ${r}: ${f.error}`,status:"error"})}).catch(f=>{this.uiStateManager.addEvent({message:`Upload failed for ${r}: ${f}`,status:"error"})}).finally(()=>{this.activeUploads.delete(u)});this.activeUploads.add(u)}cancelPendingSync(){this.syncTimer&&(clearTimeout(this.syncTimer),this.syncTimer=null)}scheduleSync(){this.cancelPendingSync(),this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.performSync()},this.debounceMs)}async performSync(){if(!this.isSyncing){this.isSyncing=!0;try{this.uiStateManager.addEvent({message:"Building manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"building"});const r=await Yr(this.appPath);if(r.errors.length>0||!r.manifest){for(const f of r.errors)this.uiStateManager.addEvent({message:f,status:"error"});this.uiStateManager.updateManifestState({manifestStatus:"error",error:r.errors[r.errors.length-1]});return}const i=H_(r.manifest);if(!i.isValid){for(const f of i.errors)this.uiStateManager.addEvent({message:f,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:f});return}if(this.uiStateManager.updateManifestState({appName:r.manifest.application.displayName}),this.uiStateManager.updateAllFilesTypes({manifestFilePaths:r.filePaths}),i.warnings.length>0)for(const f of i.warnings)this.uiStateManager.addEvent({message:`⚠ ${f}`,status:"warning"});if(this.uiStateManager.addEvent({message:"Successfully built manifest",status:"success"}),await this.handleManifestBuilt(r),!this.fileUploader){const f=await this.apiService.checkApplicationExist(r.manifest.application.universalIdentifier);if(!f.success){this.uiStateManager.addEvent({message:`Failed to check if application ${r.manifest.application.universalIdentifier} already exists`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Failed to check if application already exists"});return}if(!f.data){this.uiStateManager.addEvent({message:"Creating application",status:"info"});const v=await this.apiService.createApplication(r.manifest);if(v.success)this.uiStateManager.addEvent({message:"Application created",status:"success"});else{this.uiStateManager.addEvent({message:`Application creation failed with error ${JSON.stringify(v.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:`Application creation failed with error ${JSON.stringify(v.error,null,2)}`});return}}this.fileUploader=new $_({appPath:this.appPath,applicationUniversalIdentifier:r.manifest.application.universalIdentifier});for(const[v,{fileFolder:w,sourcePath:b}]of this.builtFileInfos.entries())this.uploadFile(v,b,w)}for(;this.activeUploads.size>0;)await Promise.all(this.activeUploads);const o=lv({manifest:r.manifest,builtFileInfos:this.builtFileInfos});this.uiStateManager.addEvent({message:"Manifest checksums set",status:"info"}),await fv(this.appPath,o),this.uiStateManager.addEvent({message:"Manifest saved to output directory",status:"info"}),this.uiStateManager.addEvent({message:"Syncing manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"syncing"});const u=await this.apiService.syncApplication(o);this.uiStateManager.updateAllFilesStatus("success"),u.success?(this.uiStateManager.addEvent({message:"✓ Synced",status:"success"}),this.uiStateManager.updateManifestState({manifestStatus:"synced"})):(this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(u.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"}))}catch(r){this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(r,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"})}finally{this.isSyncing=!1}}}}const X_={pending:["building","uploading","success"],building:["pending","uploading","success"],uploading:["pending","success"],success:["pending","building","uploading"]};class K_{constructor({appPath:r,frontendUrl:i}){this.eventIdCounter=0,this.listeners=new Set,this.state={appPath:r,frontendUrl:i,appName:null,appDescription:null,appUniversalIdentifier:null,manifestStatus:"idle",entities:new Map,events:[]}}getSnapshot(){return this.state}subscribe(r){return this.listeners.add(r),r(this.getSnapshot()),()=>this.listeners.delete(r)}notify(){for(const r of this.listeners)r(this.state)}addEvent({message:r,status:i="info"}){const o={id:++this.eventIdCounter,timestamp:new Date,message:r.slice(0,5e3),status:i};this.state={...this.state,events:[...this.state.events.slice(-201),o]},this.notify()}updateManifestState({manifestStatus:r,appName:i,error:o}){this.state={...this.state,...r?{manifestStatus:r}:{},...i?{appName:i}:{},...o?{error:o.slice(0,5e3)}:{error:void 0}},this.notify()}convertEntityTypeToSyncableEntity(r){switch(r){case"objects":return De.Object;case"fields":return De.Field;case"logicFunctions":return De.LogicFunction;case"frontComponents":return De.FrontComponent;case"roles":return De.Role;default:return}}updateAllFilesTypes({manifestFilePaths:r}){const i=new Map;Object.entries(r).forEach(([u,f])=>{f.forEach(g=>{const v=this.convertEntityTypeToSyncableEntity(u);v&&i.set(g,v)})});const o=new Map(this.state.entities);for(const[u,f]of o)o.set(u,{...f,type:i.get(u)});this.state={...this.state,entities:o},this.notify()}updateAllFilesStatus(r){const i=new Map(this.state.entities);for(const[o,u]of i)i.set(o,{...u,status:r});this.state={...this.state,entities:i},this.notify()}removeEntity(r){const i=new Map(this.state.entities);i.delete(r),this.state={...this.state,entities:i}}updateFileStatus(r,i){const o=new Map(this.state.entities),u=o.get(r);u?.status&&!X_[u.status].find(f=>f===i)||(o.set(r,u?{...u,status:i}:{name:r,path:r,status:i}),this.state={...this.state,entities:o},this.notify())}}const Sa=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],Oc=["↑","⇡","↟","⤒"],Wr={pending:"○",success:"✓"},ki={pending:"gray",building:"yellow",uploading:"cyan",success:"green"},Nl={[De.Object]:"Objects",[De.Field]:"Fields",[De.LogicFunction]:"Logic functions",[De.FrontComponent]:"Front components",[De.Role]:"Roles"},Ol=Object.keys(Nl),Z_={info:"gray",success:"green",error:"red",warning:"yellow"},ex=n=>{const r=new Map;for(const i of Ol)r.set(i,[]);for(const i of n.values()){if(!i.type)continue;const o=r.get(i.type)??[];o.push(i),r.set(i.type,o)}return r},tx=n=>n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),nx=(n,r=40)=>{if(n.length<=r)return n;const i=n.split("/");return i.length<=2?n:`.../${i.slice(-2).join("/")}`},ix=n=>!n.frontendUrl||!n.appUniversalIdentifier?null:`${n.frontendUrl}/settings/applications`,rx=async n=>{const[r,i]=await Promise.all([import("react"),import("ink")]),{useState:o,useEffect:u}=r,{render:f,Box:g,Text:v,Static:w}=i,b=(L,ee=80)=>{const[H,ce]=o(0);return u(()=>{const qe=setInterval(()=>{ce(x=>(x+1)%L.length)},ee);return()=>clearInterval(qe)},[L.length,ee]),L[H]},O=({event:L})=>{const ee=Z_[L.status],H=tx(L.timestamp);return B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[H," "]}),B.jsxRuntimeExports.jsx(v,{color:ee,children:L.message})]})},D=({status:L})=>{const ee=b(Sa,200),H=b(Oc,200),ce={building:ee,uploading:H,pending:Wr.pending,success:Wr.success};return B.jsxRuntimeExports.jsxs(v,{color:ki[L],children:[ce[L]," "]})},P=({entity:L})=>B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(D,{status:L.status}),B.jsxRuntimeExports.jsx(v,{children:L.name}),L.path!==L.name&&B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[" (",nx(L.path),")"]})]}),M=({type:L,entities:ee})=>ee.length===0?null:B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",marginTop:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,dimColor:!0,children:Nl[L]}),ee.map(H=>B.jsxRuntimeExports.jsx(P,{entity:H},H.path))]}),$={synced:{color:"green",icon:"✓",text:"Synced"},building:{color:"yellow",icon:"spinner",text:"Building..."},syncing:{color:"yellow",icon:"spinner",text:"Syncing..."},error:{color:"red",icon:null,text:"Error"},idle:{color:"gray",icon:null,text:"Idle"}},he=({snapshot:L})=>{const ee=b(Sa,80),H=$[L.manifestStatus],ce=H.icon==="spinner"?ee:H.icon;return B.jsxRuntimeExports.jsxs(v,{color:H.color,children:[ce?`${ce} `:"",H.text,L.error&&`: ${L.error}`]})},ae=({snapshot:L})=>{const ee=ex(L.entities),H=ix(L);return B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",borderStyle:"classic",borderColor:"gray",paddingX:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,color:"cyan",children:"Application"}),B.jsxRuntimeExports.jsxs(g,{marginLeft:2,flexDirection:"column",children:[B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Name: "}),B.jsxRuntimeExports.jsx(v,{bold:!0,children:L.appName??"Loading..."})]}),L.appDescription&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Description: "}),B.jsxRuntimeExports.jsx(v,{children:L.appDescription})]}),B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Status: "}),B.jsxRuntimeExports.jsx(he,{snapshot:L})]}),H&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Open:"}),B.jsxRuntimeExports.jsxs(v,{bold:!0,color:"cyan",children:[" ",H]})]})]}),B.jsxRuntimeExports.jsx(g,{marginLeft:2,flexDirection:"column",children:Ol.map(ce=>{const qe=ee.get(ce)??[];return B.jsxRuntimeExports.jsx(M,{type:ce,entities:qe},ce)})})]})},me=()=>B.jsxRuntimeExports.jsx(g,{marginTop:1,children:B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[B.jsxRuntimeExports.jsx(v,{color:ki.pending,children:Wr.pending})," ","pending ",B.jsxRuntimeExports.jsx(v,{color:ki.building,children:Sa[0]})," ","building ",B.jsxRuntimeExports.jsx(v,{color:ki.uploading,children:Oc[0]})," ","uploading"," ",B.jsxRuntimeExports.jsx(v,{color:ki.success,children:Wr.success})," ","success"]})}),Ye=()=>{const[L,ee]=o(n.getSnapshot());return u(()=>n.subscribe(ee),[]),B.jsxRuntimeExports.jsxs(B.jsxRuntimeExports.Fragment,{children:[B.jsxRuntimeExports.jsx(w,{items:L.events,children:H=>B.jsxRuntimeExports.jsx(O,{event:H},H.id)}),B.jsxRuntimeExports.jsxs(g,{marginTop:1,flexDirection:"column",children:[B.jsxRuntimeExports.jsx(ae,{snapshot:L}),B.jsxRuntimeExports.jsx(me,{})]})]})},{unmount:xe}=f(B.jsxRuntimeExports.jsx(Ye,{}));return{unmount:xe}};class Rc{constructor(r){this.watcher=null,this.appPath=r.appPath,this.fileFolder=r.fileFolder,this.watchPaths=r.watchPaths,this.handleFileBuilt=r.handleFileBuilt}async start(){const r=this.watchPaths.map(i=>ge.join(this.appPath,i));for(const i of r)if(!await de.pathExists(i))return;this.watcher=Mc.default.watch(r,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",(i,o)=>{i!=="addDir"&&((i==="add"||i==="change")&&this.copyAndNotify(o),i==="unlink"&&this.handleUnlink(o))})}async close(){await this.watcher?.close()}async copyAndNotify(r){const i=ge.relative(this.appPath,r),o=ge.join(vn,i),u=ge.join(this.appPath,o);await de.ensureDir(ge.dirname(u)),await de.copy(r,u);const f=await de.readFile(u),g=kc.default.createHash("md5").update(f).digest("hex");this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:o,sourcePath:i,checksum:g})}async handleUnlink(r){const i=ge.relative(this.appPath,r),o=ge.join(vn,i),u=ge.join(this.appPath,o);await de.remove(u)}}class sx{constructor(){this.appPath="",this.orchestrator=null,this.manifestWatcher=null,this.logicFunctionsWatcher=null,this.frontComponentsWatcher=null,this.assetWatcher=null,this.dependencyWatcher=null,this.watchersStarted=!1,this.uiStateManager=null,this.unmountUI=null}async execute(r){this.appPath=r.appPath??Xt,await this.cleanOutputDir(),this.uiStateManager=new K_({appPath:this.appPath,frontendUrl:process.env.FRONTEND_URL});const{unmount:i}=await rx(this.uiStateManager);this.unmountUI=i,this.orchestrator=new Y_({appPath:this.appPath,handleManifestBuilt:this.handleWatcherRestarts.bind(this),uiStateManager:this.uiStateManager}),await this.startManifestWatcher(),this.setupGracefulShutdown()}async cleanOutputDir(){const r=we.default.join(this.appPath,vn);await de.ensureDir(r),await de.emptyDir(r)}async startManifestWatcher(){this.manifestWatcher=new cv({appPath:this.appPath,handleChangeDetected:this.orchestrator.handleChangeDetected.bind(this.orchestrator)}),await this.manifestWatcher.start()}async handleWatcherRestarts(r){const{logicFunctions:i,frontComponents:o}=r.filePaths;if(!this.watchersStarted){this.watchersStarted=!0,await this.startFileWatchers(i,o);return}this.logicFunctionsWatcher?.shouldRestart(i)&&await this.logicFunctionsWatcher.restart(i),this.frontComponentsWatcher?.shouldRestart(o)&&await this.frontComponentsWatcher.restart(o)}async startFileWatchers(r,i){await Promise.all([this.startLogicFunctionsWatcher(r),this.startFrontComponentsWatcher(i),this.startAssetWatcher(),this.startDependencyWatcher()])}async startLogicFunctionsWatcher(r){this.logicFunctionsWatcher=ov({appPath:this.appPath,sourcePaths:r,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.logicFunctionsWatcher.start()}async startFrontComponentsWatcher(r){this.frontComponentsWatcher=uv({appPath:this.appPath,sourcePaths:r,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.frontComponentsWatcher.start()}async startAssetWatcher(){this.assetWatcher=new Rc({appPath:this.appPath,fileFolder:Pt.N.PublicAsset,watchPaths:[La],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new Rc({appPath:this.appPath,fileFolder:Pt.N.Source,watchPaths:["package.json","yarn.lock"],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),this.dependencyWatcher.start()}setupGracefulShutdown(){const r=async()=>{this.unmountUI?.(),await Promise.all([this.manifestWatcher?.close(),this.logicFunctionsWatcher?.close(),this.frontComponentsWatcher?.close(),this.assetWatcher?.close(),this.dependencyWatcher?.close()]),process.exit(0)};process.on("SIGINT",()=>void r()),process.on("SIGTERM",()=>void r())}}const ax="generated";class ox{constructor(){this.configService=new je,this.apiService=new en}async generate(r){const i=ge.join(r,ax);console.log(R.default.blue("📦 Generating Twenty client...")),console.log(R.default.gray(`📁 Output Path: ${i}`)),console.log("");const o=await this.configService.getConfig(),u=o.apiUrl,f=o.apiKey;if(!u||!f){console.log(R.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(R.default.gray(`API URL: ${u}`)),console.log(R.default.gray(`Output: ${i}`));const g=await this.apiService.getSchema();if(!g.success)return;const{data:v}=g,w=ge.resolve(i);await Ry.generate({schema:v,output:w,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(w),console.log(R.default.green("✓ Client generated successfully!")),console.log(R.default.gray(`Generated files at: ${i}`))}async injectTwentyClient(r){const i=`
|
|
66
|
+
`,J=je.pascalCase(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 ce=await this.client.post("/metadata",k);return ce.data.errors?{success:!1,error:ce.data.errors[0]?.message||"Failed to upload file"}:{success:!0,data:ce.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=te.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 p0{constructor(a){this.apiService=new bt,this.applicationUniversalIdentifier=a.applicationUniversalIdentifier,this.appPath=a.appPath}async uploadFile({builtPath:a,fileFolder:i}){const f=se.relative(Y.OUTPUT_DIR,a);return await this.apiService.uploadFile({filePath:te.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||{}),kt=(c=>(c.Application="application",c.Fields="fields",c.LogicFunctions="logicFunctions",c.Objects="objects",c.Roles="roles",c.FrontComponents="frontComponents",c.PublicAssets="publicAssets",c))(kt||{});const d0={defineApplication:"application",defineField:"fields",defineLogicFunction:"logicFunctions",defineObject:"objects",defineRole:"roles",defineFrontComponent:"frontComponents"},g0=c=>{if(!Tn.isCallExpression(c))return;const a=c.expression;if(Tn.isIdentifier(a)&&Object.values(xu).includes(a.text))return a.text},m0=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=g0(f.expression);if(g)return g}},v0=["twenty-sdk/ui"],_0={name:"manifest-mock",setup:c=>{const a=new RegExp(`^(${v0.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 y0({filePath:c,appPath:a});return w0(i,c)},y0=async({filePath:c,appPath:a})=>{const i=te.default.join(a,"tsconfig.json"),f=await ee.pathExists(i),g=Sm.createRequire(te.default.join(a,"package.json"));let _,S;try{_=te.default.dirname(g.resolve("react/package.json")),S=te.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:[_0],logLevel:"silent"})).outputFiles[0].text,P=await ee.mkdtemp(te.default.join(Fs.default.tmpdir(),"twenty-manifest-")),J=te.default.join(P,"module.cjs");try{return await ee.writeFile(J,I),require(J)}finally{await ee.remove(P)}},w0=(c,a)=>{if(je.isDefined(c.default)&&je.isPlainObject(c.default))return c.default;throw new Error(`Config file ${a} must export a config object default export`)},x0=async c=>await gu.glob(["**/*.ts","**/*.tsx"],{cwd:c,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**","**/.twenty/**"],onlyFiles:!0}),S0=async c=>await gu.glob([`${Y.ASSETS_DIR}/**/*`],{cwd:c,onlyFiles:!0}),Xr=async c=>{const a=await x0(c),i=[];let f;const g=[],_=[],S=[],A=[],I=[],P=[],J=[],G=[],K=[],k=[],ce=[],Le=[],de=[];for(const F of a){const X=await pu.readFile(F,"utf-8"),z=se.relative(c,F),ae=m0(X);if(!ae)continue;const Fe=d0[ae];switch(Fe){case kt.Application:{const re=await Cn({appPath:c,filePath:F});f={...re.config,yarnLockChecksum:null,packageJsonChecksum:null},i.push(...re.errors),J.push(z);break}case kt.Objects:{const re=await Cn({appPath:c,filePath:F});g.push(re.config),i.push(...re.errors),G.push(z);break}case kt.Fields:{const re=await Cn({appPath:c,filePath:F});_.push(re.config),i.push(...re.errors),K.push(z);break}case kt.Roles:{const re=await Cn({appPath:c,filePath:F});S.push(re.config),i.push(...re.errors),k.push(z);break}case kt.LogicFunctions:{const re=await Cn({appPath:c,filePath:F});i.push(...re.errors);const{handler:Gt,...Ge}=re.config,ht=se.relative(c,F),Tt={...Ge,handlerName:"default.config.handler",sourceHandlerPath:ht,builtHandlerPath:ht.replace(/\.tsx?$/,".mjs"),builtHandlerChecksum:"[default-checksum]"};A.push(Tt),ce.push(z);break}case kt.FrontComponents:{const re=await Cn({appPath:c,filePath:F});i.push(...re.errors);const{component:Gt,...Ge}=re.config,ht=se.relative(c,F),Tt={...Ge,componentName:Gt.name,sourceComponentPath:ht,builtComponentPath:ht.replace(/\.tsx?$/,".mjs"),builtComponentChecksum:""};I.push(Tt),Le.push(z);break}case kt.PublicAssets:break;default:je.assertUnreachable(Fe)}}const Ue=await S0(c);for(const F of Ue)P.push({filePath:F,fileName:se.basename(F),fileType:se.extname(F).replace(/^\./,""),checksum:null}),de.push(se.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:ce,frontComponents:Le,publicAssets:de},errors:i}},A0=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},E0=c=>{const a=[],i=[],f=A0(Su(c));return f.length>0&&a.push(`Duplicate universal identifiers: ${f.join(", ")}`),je.isNonEmptyArray(c.objects)||i.push("No object defined"),je.isNonEmptyArray(c.logicFunctions)||i.push("No logic function defined"),je.isNonEmptyArray(c.frontComponents)||i.push("No front component defined"),{errors:a,warnings:i,isValid:a.length===0}};class b0{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=E0(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 p0({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=c0({manifest:a.manifest,builtFileInfos:this.builtFileInfos});this.uiStateManager.addEvent({message:"Manifest checksums set",status:"info"}),await l0(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 C0={pending:["building","uploading","success"],building:["pending","uploading","success"],uploading:["pending","success"],success:["pending","building","uploading"]};class T0{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 Y.SyncableEntity.Object;case"fields":return Y.SyncableEntity.Field;case"logicFunctions":return Y.SyncableEntity.LogicFunction;case"frontComponents":return Y.SyncableEntity.FrontComponent;case"roles":return Y.SyncableEntity.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&&!C0[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=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],cu=["↑","⇡","↟","⤒"],zr={pending:"○",success:"✓"},Jn={pending:"gray",building:"yellow",uploading:"cyan",success:"green"},Au={[Y.SyncableEntity.Object]:"Objects",[Y.SyncableEntity.Field]:"Fields",[Y.SyncableEntity.LogicFunction]:"Logic functions",[Y.SyncableEntity.FrontComponent]:"Front components",[Y.SyncableEntity.Role]:"Roles"},Eu=Object.keys(Au),F0={info:"gray",success:"green",error:"red",warning:"yellow"},I0=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},R0=c=>c.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),P0=(c,a=40)=>{if(c.length<=a)return c;const i=c.split("/");return i.length<=2?c:`.../${i.slice(-2).join("/")}`},O0=c=>!c.frontendUrl||!c.appUniversalIdentifier?null:`${c.frontendUrl}/settings/applications`,L0=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,X=80)=>{const[z,ae]=f(0);return g(()=>{const Fe=setInterval(()=>{ae(re=>(re+1)%F.length)},X);return()=>clearInterval(Fe)},[F.length,X]),F[z]},J=({event:F})=>{const X=F0[F.status],z=R0(F.timestamp);return D.jsxs(S,{children:[D.jsxs(A,{dimColor:!0,children:[z," "]}),D.jsx(A,{color:X,children:F.message})]})},G=({status:F})=>{const X=P(Es,200),z=P(cu,200),ae={building:X,uploading:z,pending:zr.pending,success:zr.success};return D.jsxs(A,{color:Jn[F],children:[ae[F]," "]})},K=({entity:F})=>D.jsxs(S,{children:[D.jsx(G,{status:F.status}),D.jsx(A,{children:F.name}),F.path!==F.name&&D.jsxs(A,{dimColor:!0,children:[" (",P0(F.path),")"]})]}),k=({type:F,entities:X})=>X.length===0?null:D.jsxs(S,{flexDirection:"column",marginTop:1,children:[D.jsx(A,{bold:!0,dimColor:!0,children:Au[F]}),X.map(z=>D.jsx(K,{entity:z},z.path))]}),ce={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 X=P(Es,80),z=ce[F.manifestStatus],ae=z.icon==="spinner"?X:z.icon;return D.jsxs(A,{color:z.color,children:[ae?`${ae} `:"",z.text,F.error&&`: ${F.error}`]})},de=({snapshot:F})=>{const X=I0(F.entities),z=O0(F);return D.jsxs(S,{flexDirection:"column",borderStyle:"classic",borderColor:"gray",paddingX:1,children:[D.jsx(A,{bold:!0,color:"cyan",children:"Application"}),D.jsxs(S,{marginLeft:2,flexDirection:"column",children:[D.jsxs(S,{children:[D.jsx(A,{dimColor:!0,children:"Name: "}),D.jsx(A,{bold:!0,children:F.appName??"Loading..."})]}),F.appDescription&&D.jsxs(S,{children:[D.jsx(A,{dimColor:!0,children:"Description: "}),D.jsx(A,{children:F.appDescription})]}),D.jsxs(S,{children:[D.jsx(A,{dimColor:!0,children:"Status: "}),D.jsx(Le,{snapshot:F})]}),z&&D.jsxs(S,{children:[D.jsx(A,{dimColor:!0,children:"Open:"}),D.jsxs(A,{bold:!0,color:"cyan",children:[" ",z]})]})]}),D.jsx(S,{marginLeft:2,flexDirection:"column",children:Eu.map(ae=>{const Fe=X.get(ae)??[];return D.jsx(k,{type:ae,entities:Fe},ae)})})]})},Ue=()=>D.jsx(S,{marginTop:1,children:D.jsxs(A,{dimColor:!0,children:[D.jsx(A,{color:Jn.pending,children:zr.pending})," ","pending ",D.jsx(A,{color:Jn.building,children:Es[0]})," ","building ",D.jsx(A,{color:Jn.uploading,children:cu[0]})," ","uploading"," ",D.jsx(A,{color:Jn.success,children:zr.success})," ","success"]})}),Ct=()=>{const[F,X]=f(c.getSnapshot());return g(()=>c.subscribe(X),[]),D.jsxs(D.Fragment,{children:[D.jsx(I,{items:F.events,children:z=>D.jsx(J,{event:z},z.id)}),D.jsxs(S,{marginTop:1,flexDirection:"column",children:[D.jsx(de,{snapshot:F}),D.jsx(Ue,{})]})]})},{unmount:Te}=_(D.jsx(Ct,{}));return{unmount:Te}};class lu{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=>se.join(this.appPath,i));for(const i of a)if(!await ee.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=se.relative(this.appPath,a),f=se.join(Y.OUTPUT_DIR,i),g=se.join(this.appPath,f);await ee.ensureDir(se.dirname(g)),await ee.copy(a,g);const _=await ee.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=se.relative(this.appPath,a),f=se.join(Y.OUTPUT_DIR,i),g=se.join(this.appPath,f);await ee.remove(g)}}class U0{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 T0({appPath:this.appPath,frontendUrl:process.env.FRONTEND_URL});const{unmount:i}=await L0(this.uiStateManager);this.unmountUI=i,this.orchestrator=new b0({appPath:this.appPath,handleManifestBuilt:this.handleWatcherRestarts.bind(this),uiStateManager:this.uiStateManager}),await this.startManifestWatcher(),this.setupGracefulShutdown()}async cleanOutputDir(){const a=te.default.join(this.appPath,Y.OUTPUT_DIR);await ee.ensureDir(a),await ee.emptyDir(a)}async startManifestWatcher(){this.manifestWatcher=new u0({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=a0({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=o0({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 lu({appPath:this.appPath,fileFolder:ft.FileFolder.PublicAsset,watchPaths:[Y.ASSETS_DIR],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new lu({appPath:this.appPath,fileFolder:ft.FileFolder.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 M0="generated";class N0{constructor(){this.configService=new Ae,this.apiService=new bt}async generate(a){const i=se.join(a,M0);console.log(E.default.blue("📦 Generating Twenty client...")),console.log(E.default.gray(`📁 Output Path: ${i}`)),console.log("");const f=await this.configService.getConfig(),g=f.apiUrl,_=f.apiKey;if(!g||!_){console.log(E.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(E.default.gray(`API URL: ${g}`)),console.log(E.default.gray(`Output: ${i}`));const S=await this.apiService.getSchema();if(!S.success)return;const{data:A}=S,I=se.resolve(i);await Am.generate({schema:A,output:I,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(I),console.log(E.default.green("✓ Client generated successfully!")),console.log(E.default.gray(`Generated files at: ${i}`))}async injectTwentyClient(a){const i=`
|
|
233
67
|
|
|
234
68
|
// ----------------------------------------------------
|
|
235
69
|
// ✨ Custom Twenty client (auto-injected)
|
|
236
70
|
// ----------------------------------------------------
|
|
237
71
|
|
|
238
72
|
const defaultOptions: ClientOptions = {
|
|
239
|
-
url: \`\${process.env.${
|
|
73
|
+
url: \`\${process.env.${Y.DEFAULT_API_URL_NAME}}/graphql\`,
|
|
240
74
|
headers: {
|
|
241
75
|
'Content-Type': 'application/json',
|
|
242
|
-
Authorization: \`Bearer \${process.env.${
|
|
76
|
+
Authorization: \`Bearer \${process.env.${Y.DEFAULT_API_KEY_NAME}}\`,
|
|
243
77
|
},
|
|
244
78
|
}
|
|
245
79
|
|
|
@@ -307,8 +141,8 @@ export default class Twenty {
|
|
|
307
141
|
}
|
|
308
142
|
}
|
|
309
143
|
|
|
310
|
-
`;await
|
|
311
|
-
`));for(const o of r){const u=await this.configService.getConfigForWorkspace(o),f=!!u.apiKey,v=o===i?R.default.green(" (default)"):"",w=f?R.default.green("●"):R.default.gray("○");console.log(` ${w} ${o}${v}`),console.log(R.default.gray(` API URL: ${u.apiUrl}`))}console.log(""),console.log(R.default.gray("● = authenticated, ○ = no credentials")),console.log(R.default.gray("Use `twenty auth:switch <workspace>` to change default"))}catch(r){console.error(R.default.red("List failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class fx{constructor(){this.configService=new je,this.apiService=new en}async execute(r){try{let{apiKey:i,apiUrl:o}=r;const u=await this.configService.getConfig();if(o||(o=(await Ht.default.prompt([{type:"input",name:"apiUrl",message:"Twenty API URL:",default:u.apiUrl,validate:v=>{try{return new URL(v),!0}catch{return"Please enter a valid URL"}}}])).apiUrl),i||(i=(await Ht.default.prompt([{type:"password",name:"apiKey",message:"API Key:",mask:"*",validate:v=>v.length>0||"API key is required"}])).apiKey),await this.configService.setConfig({apiUrl:o,apiKey:i}),(await this.apiService.validateAuth()).authValid){const g=je.getActiveWorkspace();console.log(R.default.green(`✓ Successfully authenticated with Twenty (workspace: ${g})`))}else console.log(R.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(i){console.error(R.default.red("Login failed:"),i instanceof Error?i.message:i),process.exit(1)}}}class px{constructor(){this.configService=new je}async execute(){try{await this.configService.clearConfig();const r=je.getActiveWorkspace();console.log(R.default.green(`✓ Successfully logged out (workspace: ${r})`))}catch(r){console.error(R.default.red("Logout failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class dx{constructor(){this.configService=new je,this.apiService=new en}async execute(){try{const r=je.getActiveWorkspace(),i=await this.configService.getConfig();if(console.log(R.default.blue("Authentication Status:")),console.log(`Workspace: ${r}`),console.log(`API URL: ${i.apiUrl}`),console.log(`API Key: ${i.apiKey?"***"+i.apiKey.slice(-4):"Not set"}`),i.apiKey){const o=await this.apiService.validateAuth();console.log(`Status: ${o.authValid?R.default.green("✓ Valid"):R.default.red("✗ Invalid")}`)}else console.log(`Status: ${R.default.yellow("⚠ Not authenticated")}`)}catch(r){console.error(R.default.red("Status check failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class hx{constructor(){this.apiService=new en}async execute({appPath:r=Xt,functionUniversalIdentifier:i,functionName:o,payload:u="{}"}){try{let f;try{f=JSON.parse(u)}catch{console.error(R.default.red("Invalid JSON payload. Please provide valid JSON.")),process.exit(1)}const{manifest:g}=await Yr(r);g||(console.error(R.default.red("Failed to build manifest.")),process.exit(1));const v=await this.apiService.findLogicFunctions();v.success||(console.error(R.default.red("Failed to fetch functions:"),v.error instanceof Error?v.error.message:v.error),process.exit(1));const w=v.data.filter(M=>M.universalIdentifier&&this.belongsToApplication(M,g)),b=w.find(M=>i?M.universalIdentifier===i:o?M.name===o:!1);if(!b){const M=i||o;console.error(R.default.red(`Function "${M}" not found in application.`)),console.log(""),w.length>0?(console.log(R.default.cyan("Available functions:")),w.forEach($=>{console.log(` - ${R.default.white($.name)} (${$.universalIdentifier})`)})):console.log(R.default.yellow("No functions found for this application. Have you synced your app with `yarn app:sync`?")),process.exit(1)}console.log(R.default.blue(`🚀 Executing function "${b.name}"...`)),console.log(R.default.gray(` Payload: ${JSON.stringify(f)}`)),console.log("");const O=await this.apiService.executeLogicFunction({functionId:b.id,payload:f});O.success||(console.error(R.default.red("Execution failed:"),O.error instanceof Error?O.error.message:O.error),process.exit(1));const D=O.data;console.log(R.default.cyan("─".repeat(60))),console.log(R.default.cyan("Execution Result")),console.log(R.default.cyan("─".repeat(60)));const P=D.status==="SUCCESS"?R.default.green:R.default.red;console.log(`${R.default.bold("Status:")} ${P(D.status)}`),console.log(`${R.default.bold("Duration:")} ${D.duration}ms`),Ut.Tr(D.data)&&(console.log(""),console.log(R.default.bold("Data:")),console.log(R.default.white(JSON.stringify(D.data,null,2)))),D.error&&(console.log(""),console.log(R.default.bold.red("Error:")),console.log(R.default.red(` Type: ${D.error.errorType}`)),console.log(R.default.red(` Message: ${D.error.errorMessage}`)),D.error.stackTrace&&(console.log(""),console.log(R.default.gray("Stack trace:")),console.log(R.default.gray(D.error.stackTrace)))),D.logs&&(console.log(""),console.log(R.default.bold("Logs:")),console.log(R.default.gray(D.logs))),console.log(R.default.cyan("─".repeat(60))),D.status!=="SUCCESS"&&process.exit(1)}catch(f){console.error(R.default.red("Execution failed:"),f instanceof Error?f.message:f),process.exit(1)}}belongsToApplication(r,i){return i.logicFunctions.some(o=>o.universalIdentifier===r.universalIdentifier)}}class gx{constructor(){this.apiService=new en}async execute({appPath:r=Xt,functionUniversalIdentifier:i,functionName:o}){try{const{manifest:u}=await Yr(r);u||process.exit(1),this.logWatchInfo({appName:u.application.displayName,functionUniversalIdentifier:i,functionName:o}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:u.application.universalIdentifier,functionUniversalIdentifier:i,functionName:o})}catch(u){console.error(R.default.red("Watch logs failed:"),u instanceof Error?u.message:u),process.exit(1)}}logWatchInfo({appName:r,functionUniversalIdentifier:i,functionName:o}){const u=r??"Twenty Application",f=i||o?`function "${i||o}"`:"functions";console.log(R.default.blue(`🚀 Watching ${u} ${f} logs:`)),console.log("")}}class mx{constructor(){this.configService=new je,this.apiService=new en}async execute(r){try{let{workspace:i}=r;const o=await this.configService.getAvailableWorkspaces(),u=await this.configService.getDefaultWorkspace();if(o.length===0){console.log(R.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}if(!i){const v=o.map(b=>({name:b===u?`${b} (current default)`:b,value:b}));i=(await Ht.default.prompt([{type:"list",name:"workspace",message:"Select a workspace to set as default:",choices:v,default:u}])).workspace}if(o.includes(i)||(console.log(R.default.red(`✗ Workspace "${i}" not found. Available workspaces: ${o.join(", ")}`)),process.exit(1)),i===u){console.log(R.default.blue(`ℹ "${i}" is already the default workspace.`));return}await this.configService.setDefaultWorkspace(i),je.setActiveWorkspace(i);const g=!!(await this.configService.getConfig()).apiKey;console.log(R.default.green(`✓ Switched default workspace to "${i}"`)),g?(await this.apiService.validateAuth()).authValid?console.log(R.default.green("✓ Authentication is valid")):console.log(R.default.yellow("⚠ Authentication credentials exist but are invalid. Run `twenty auth:login` to re-authenticate.")):console.log(R.default.yellow("⚠ No credentials configured for this workspace. Run `twenty auth:login` to authenticate."))}catch(i){console.error(R.default.red("Switch failed:"),i instanceof Error?i.message:i),process.exit(1)}}}var Aa,Cc;function yx(){if(Cc)return Aa;Cc=1;var n="[object Symbol]",r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o="\\ud800-\\udfff",u="\\u0300-\\u036f\\ufe20-\\ufe23",f="\\u20d0-\\u20f0",g="\\u2700-\\u27bf",v="a-z\\xdf-\\xf6\\xf8-\\xff",w="\\xac\\xb1\\xd7\\xf7",b="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",O="\\u2000-\\u206f",D=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",P="A-Z\\xc0-\\xd6\\xd8-\\xde",M="\\ufe0e\\ufe0f",$=w+b+O+D,he="['’]",ae="["+$+"]",me="["+u+f+"]",Ye="\\d+",xe="["+g+"]",L="["+v+"]",ee="[^"+o+$+Ye+g+v+P+"]",H="\\ud83c[\\udffb-\\udfff]",ce="(?:"+me+"|"+H+")",qe="[^"+o+"]",x="(?:\\ud83c[\\udde6-\\uddff]){2}",q="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="["+P+"]",xt="\\u200d",tn="(?:"+L+"|"+ee+")",Vi="(?:"+Se+"|"+ee+")",qi="(?:"+he+"(?:d|ll|m|re|s|t|ve))?",Ji="(?:"+he+"(?:D|LL|M|RE|S|T|VE))?",Rt=ce+"?",Tt="["+M+"]?",Xr="(?:"+xt+"(?:"+[qe,x,q].join("|")+")"+Tt+Rt+")*",Wn=Tt+Rt+Xr,st="(?:"+[xe,x,q].join("|")+")"+Wn,Kr=RegExp(he,"g"),Zr=RegExp(me,"g"),es=RegExp([Se+"?"+L+"+"+qi+"(?="+[ae,Se,"$"].join("|")+")",Vi+"+"+Ji+"(?="+[ae,Se+tn,"$"].join("|")+")",Se+"?"+tn+"+"+qi,Se+"+"+Ji,Ye,st].join("|"),"g"),nn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gn={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},ts=typeof B.commonjsGlobal=="object"&&B.commonjsGlobal&&B.commonjsGlobal.Object===Object&&B.commonjsGlobal,Sn=typeof self=="object"&&self&&self.Object===Object&&self,An=ts||Sn||Function("return this")();function ns(W,Ce,Ct,Hi){for(var On=-1,_i=W?W.length:0;++On<_i;)Ct=Ce(Ct,W[On],On,W);return Ct}function Vn(W){return W.match(r)||[]}function qn(W){return function(Ce){return W?.[Ce]}}var zi=qn(Gn);function Xe(W){return nn.test(W)}function In(W){return W.match(es)||[]}var is=Object.prototype,wt=is.toString,vi=An.Symbol,Qi=vi?vi.prototype:void 0,rn=Qi?Qi.toString:void 0;function Ke(W){if(typeof W=="string")return W;if(rs(W))return rn?rn.call(W):"";var Ce=W+"";return Ce=="0"&&1/W==-1/0?"-0":Ce}function bn(W){return function(Ce){return ns(an(ss(Ce).replace(Kr,"")),W,"")}}function Jn(W){return!!W&&typeof W=="object"}function rs(W){return typeof W=="symbol"||Jn(W)&&wt.call(W)==n}function sn(W){return W==null?"":Ke(W)}function ss(W){return W=sn(W),W&&W.replace(i,zi).replace(Zr,"")}var Nn=bn(function(W,Ce,Ct){return W+(Ct?"-":"")+Ce.toLowerCase()});function an(W,Ce,Ct){return W=sn(W),Ce=Ce,Ce===void 0?Xe(W)?In(W):Vn(W):W.match(Ce)||[]}return Aa=Nn,Aa}var vx=yx();const fi=B.getDefaultExportFromCjs(vx),_x=({name:n,universalIdentifier:r=pi.v4()})=>{const i=fi(n);return`import { defineFrontComponent } from 'twenty-sdk';
|
|
144
|
+
`;await ee.appendFile(se.join(a,"index.ts"),i)}}class D0{constructor(){this.clientService=new N0}async execute(a=Et){try{await this.clientService.generate(a)}catch(i){throw console.error(E.default.red("Generate Twenty client failed:"),i instanceof Error?i.message:i),i}}}class W0{constructor(){this.apiService=new bt}async execute({appPath:a=Et,askForConfirmation:i}){try{console.log(E.default.blue("🚀 Uninstall Twenty Application")),console.log(E.default.gray(`📁 App Path: ${a}`)),console.log(""),i&&!await this.confirmationPrompt()&&(console.error(E.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(E.default.red("❌ Uninstall failed:"),g.error):console.log(E.default.green("✅ Application uninstalled successfully")),g}catch(f){throw console.error(E.default.red("Uninstall failed:"),f instanceof Error?f.message:f),f}}async confirmationPrompt(){const{confirmation:a}=await At.default.prompt([{type:"confirm",name:"confirmation",message:"Are you sure you want to uninstall this application?",default:!1}]);return a}}class $0{constructor(){this.configService=new Ae}async execute(){try{const a=await this.configService.getAvailableWorkspaces(),i=await this.configService.getDefaultWorkspace();if(a.length===0){console.log(E.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}console.log(E.default.blue(`Available workspaces:
|
|
145
|
+
`));for(const f of a){const g=await this.configService.getConfigForWorkspace(f),_=!!g.apiKey,A=f===i?E.default.green(" (default)"):"",I=_?E.default.green("●"):E.default.gray("○");console.log(` ${I} ${f}${A}`),console.log(E.default.gray(` API URL: ${g.apiUrl}`))}console.log(""),console.log(E.default.gray("● = authenticated, ○ = no credentials")),console.log(E.default.gray("Use `twenty auth:switch <workspace>` to change default"))}catch(a){console.error(E.default.red("List failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class B0{constructor(){this.configService=new Ae,this.apiService=new bt}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(E.default.green(`✓ Successfully authenticated with Twenty (workspace: ${S})`))}else console.log(E.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(i){console.error(E.default.red("Login failed:"),i instanceof Error?i.message:i),process.exit(1)}}}class k0{constructor(){this.configService=new Ae}async execute(){try{await this.configService.clearConfig();const a=Ae.getActiveWorkspace();console.log(E.default.green(`✓ Successfully logged out (workspace: ${a})`))}catch(a){console.error(E.default.red("Logout failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class q0{constructor(){this.configService=new Ae,this.apiService=new bt}async execute(){try{const a=Ae.getActiveWorkspace(),i=await this.configService.getConfig();if(console.log(E.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?E.default.green("✓ Valid"):E.default.red("✗ Invalid")}`)}else console.log(`Status: ${E.default.yellow("⚠ Not authenticated")}`)}catch(a){console.error(E.default.red("Status check failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class j0{constructor(){this.apiService=new bt}async execute({appPath:a=Et,functionUniversalIdentifier:i,functionName:f,payload:g="{}"}){try{let _;try{_=JSON.parse(g)}catch{console.error(E.default.red("Invalid JSON payload. Please provide valid JSON.")),process.exit(1)}const{manifest:S}=await Xr(a);S||(console.error(E.default.red("Failed to build manifest.")),process.exit(1));const A=await this.apiService.findLogicFunctions();A.success||(console.error(E.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(E.default.red(`Function "${k}" not found in application.`)),console.log(""),I.length>0?(console.log(E.default.cyan("Available functions:")),I.forEach(ce=>{console.log(` - ${E.default.white(ce.name)} (${ce.universalIdentifier})`)})):console.log(E.default.yellow("No functions found for this application. Have you synced your app with `yarn app:dev`?")),process.exit(1)}console.log(E.default.blue(`🚀 Executing function "${P.name}"...`)),console.log(E.default.gray(` Payload: ${JSON.stringify(_)}`)),console.log("");const J=await this.apiService.executeLogicFunction({functionId:P.id,payload:_});J.success||(console.error(E.default.red("Execution failed:"),J.error instanceof Error?J.error.message:J.error),process.exit(1));const G=J.data;console.log(E.default.cyan("─".repeat(60))),console.log(E.default.cyan("Execution Result")),console.log(E.default.cyan("─".repeat(60)));const K=G.status==="SUCCESS"?E.default.green:E.default.red;console.log(`${E.default.bold("Status:")} ${K(G.status)}`),console.log(`${E.default.bold("Duration:")} ${G.duration}ms`),je.isDefined(G.data)&&(console.log(""),console.log(E.default.bold("Data:")),console.log(E.default.white(JSON.stringify(G.data,null,2)))),G.error&&(console.log(""),console.log(E.default.bold.red("Error:")),console.log(E.default.red(` Type: ${G.error.errorType}`)),console.log(E.default.red(` Message: ${G.error.errorMessage}`)),G.error.stackTrace&&(console.log(""),console.log(E.default.gray("Stack trace:")),console.log(E.default.gray(G.error.stackTrace)))),G.logs&&(console.log(""),console.log(E.default.bold("Logs:")),console.log(E.default.gray(G.logs))),console.log(E.default.cyan("─".repeat(60))),G.status!=="SUCCESS"&&process.exit(1)}catch(_){console.error(E.default.red("Execution failed:"),_ instanceof Error?_.message:_),process.exit(1)}}belongsToApplication(a,i){return i.logicFunctions.some(f=>f.universalIdentifier===a.universalIdentifier)}}class G0{constructor(){this.apiService=new bt}async execute({appPath:a=Et,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(E.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(E.default.blue(`🚀 Watching ${g} ${_} logs:`)),console.log("")}}class H0{constructor(){this.configService=new Ae,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(E.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(E.default.red(`✗ Workspace "${i}" not found. Available workspaces: ${f.join(", ")}`)),process.exit(1)),i===g){console.log(E.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(E.default.green(`✓ Switched default workspace to "${i}"`)),S?(await this.apiService.validateAuth()).authValid?console.log(E.default.green("✓ Authentication is valid")):console.log(E.default.yellow("⚠ Authentication credentials exist but are invalid. Run `twenty auth:login` to re-authenticate.")):console.log(E.default.yellow("⚠ No credentials configured for this workspace. Run `twenty auth:login` to authenticate."))}catch(i){console.error(E.default.red("Switch failed:"),i instanceof Error?i.message:i),process.exit(1)}}}var qt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function K0(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}var bs,fu;function z0(){if(fu)return bs;fu=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",ce=I+P+J+G,Le="['’]",de="["+ce+"]",Ue="["+g+_+"]",Ct="\\d+",Te="["+S+"]",F="["+A+"]",X="[^"+f+ce+Ct+S+A+K+"]",z="\\ud83c[\\udffb-\\udfff]",ae="(?:"+Ue+"|"+z+")",Fe="[^"+f+"]",re="(?:\\ud83c[\\udde6-\\uddff]){2}",Gt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ge="["+K+"]",ht="\\u200d",Tt="(?:"+F+"|"+X+")",Qn="(?:"+Ge+"|"+X+")",Vn="(?:"+Le+"(?:d|ll|m|re|s|t|ve))?",er="(?:"+Le+"(?:D|LL|M|RE|S|T|VE))?",at=ae+"?",et="["+k+"]?",Qr="(?:"+ht+"(?:"+[Fe,re,Gt].join("|")+")"+et+at+")*",on=et+at+Qr,He="(?:"+[Te,re,Gt].join("|")+")"+on,Vr=RegExp(Le,"g"),ei=RegExp(Ue,"g"),ti=RegExp([Ge+"?"+F+"+"+Vn+"(?="+[de,Ge,"$"].join("|")+")",Qn+"+"+er+"(?="+[de,Ge+Tt,"$"].join("|")+")",Ge+"?"+Tt+"+"+Vn,Ge+"+"+er,Ct,He].join("|"),"g"),Ft=/[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 qt=="object"&&qt&&qt.Object===Object&&qt,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,Pn=O?O.length:0;++Zt<Pn;)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 Me(O){return Ft.test(O)}function zt(O){return O.match(ti)||[]}var ii=Object.prototype,tt=ii.toString,Rn=Kt.Symbol,nr=Rn?Rn.prototype:void 0,It=nr?nr.toString:void 0;function Ne(O){if(typeof O=="string")return O;if(si(O))return It?It.call(O):"";var ge=O+"";return ge=="0"&&1/O==-1/0?"-0":ge}function Jt(O){return function(ge){return ri(Pt(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 Rt(O){return O==null?"":Ne(O)}function ai(O){return O=Rt(O),O&&O.replace(i,tr).replace(ei,"")}var Yt=Jt(function(O,ge,ot){return O+(ot?"-":"")+ge.toLowerCase()});function Pt(O,ge,ot){return O=Rt(O),ge=ge,ge===void 0?Me(O)?zt(O):cn(O):O.match(ge)||[]}return bs=Yt,bs}var J0=z0();const Fn=K0(J0),Y0=({name:c,universalIdentifier:a=Zn.v4()})=>{const i=Fn(c);return`import { defineFrontComponent } from 'twenty-sdk';
|
|
312
146
|
|
|
313
147
|
// React component - implement your UI here
|
|
314
148
|
const Component = () => {
|
|
@@ -321,12 +155,12 @@ const Component = () => {
|
|
|
321
155
|
};
|
|
322
156
|
|
|
323
157
|
export default defineFrontComponent({
|
|
324
|
-
universalIdentifier: '${
|
|
158
|
+
universalIdentifier: '${a}',
|
|
325
159
|
name: '${i}',
|
|
326
160
|
description: 'Add a description for your front component',
|
|
327
161
|
component: Component,
|
|
328
162
|
});
|
|
329
|
-
`},
|
|
163
|
+
`},Z0=({name:c,universalIdentifier:a=Zn.v4()})=>{const i=Fn(c);return`import { defineLogicFunction } from 'twenty-sdk';
|
|
330
164
|
|
|
331
165
|
// Logic function handler - rename and implement your logic
|
|
332
166
|
const handler = async (params: {
|
|
@@ -342,69 +176,62 @@ const handler = async (params: {
|
|
|
342
176
|
};
|
|
343
177
|
|
|
344
178
|
export default defineLogicFunction({
|
|
345
|
-
universalIdentifier: '${
|
|
179
|
+
universalIdentifier: '${a}',
|
|
346
180
|
name: '${i}',
|
|
347
181
|
description: 'Add a description for your logic function',
|
|
348
182
|
timeoutSeconds: 5,
|
|
349
183
|
handler,
|
|
350
|
-
|
|
351
|
-
// Add your triggers here
|
|
184
|
+
// Add your trigger here
|
|
352
185
|
// Route trigger example:
|
|
353
|
-
// {
|
|
354
|
-
// universalIdentifier: '${o}',
|
|
355
|
-
// type: 'route',
|
|
186
|
+
// httpRouteTriggerSettings: {
|
|
356
187
|
// path: '/${i}',
|
|
357
188
|
// httpMethod: 'POST',
|
|
358
189
|
// isAuthRequired: true,
|
|
359
190
|
// },
|
|
360
191
|
// Cron trigger example:
|
|
361
|
-
// {
|
|
362
|
-
// universalIdentifier: '...',
|
|
363
|
-
// type: 'cron',
|
|
192
|
+
// cronTriggerSettings: {
|
|
364
193
|
// pattern: '0 0 * * *', // Daily at midnight
|
|
365
194
|
// },
|
|
366
195
|
// Database event trigger example:
|
|
367
|
-
// {
|
|
368
|
-
// universalIdentifier: '...',
|
|
369
|
-
// type: 'databaseEvent',
|
|
196
|
+
// databaseEventTriggerSettings: {
|
|
370
197
|
// eventName: 'objectName.created',
|
|
371
198
|
// },
|
|
372
199
|
],
|
|
373
200
|
});
|
|
374
|
-
`};var
|
|
201
|
+
`};var Yn={exports:{}};/**
|
|
375
202
|
* @license
|
|
376
203
|
* Lodash <https://lodash.com/>
|
|
377
204
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
378
205
|
* Released under MIT license <https://lodash.com/license>
|
|
379
206
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
380
207
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
381
|
-
*/var Tx=$i.exports,Lc;function wx(){return Lc||(Lc=1,function(n,r){(function(){var i,o="4.17.21",u=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",g="Expected a function",v="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",b=500,O="__lodash_placeholder__",D=1,P=2,M=4,$=1,he=2,ae=1,me=2,Ye=4,xe=8,L=16,ee=32,H=64,ce=128,qe=256,x=512,q=30,Se="...",xt=800,tn=16,Vi=1,qi=2,Ji=3,Rt=1/0,Tt=9007199254740991,Xr=17976931348623157e292,Wn=NaN,st=4294967295,Kr=st-1,Zr=st>>>1,es=[["ary",ce],["bind",ae],["bindKey",me],["curry",xe],["curryRight",L],["flip",x],["partial",ee],["partialRight",H],["rearg",qe]],nn="[object Arguments]",Gn="[object Array]",ts="[object AsyncFunction]",Sn="[object Boolean]",An="[object Date]",ns="[object DOMException]",Vn="[object Error]",qn="[object Function]",zi="[object GeneratorFunction]",Xe="[object Map]",In="[object Number]",is="[object Null]",wt="[object Object]",vi="[object Promise]",Qi="[object Proxy]",rn="[object RegExp]",Ke="[object Set]",bn="[object String]",Jn="[object Symbol]",rs="[object Undefined]",sn="[object WeakMap]",ss="[object WeakSet]",Nn="[object ArrayBuffer]",an="[object DataView]",W="[object Float32Array]",Ce="[object Float64Array]",Ct="[object Int8Array]",Hi="[object Int16Array]",On="[object Int32Array]",_i="[object Uint8Array]",as="[object Uint8ClampedArray]",os="[object Uint16Array]",us="[object Uint32Array]",Rl=/\b__p \+= '';/g,Cl=/\b(__p \+=) '' \+/g,Ll=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ma=/&(?:amp|lt|gt|quot|#39);/g,$a=/[&<>"']/g,Fl=RegExp(Ma.source),Dl=RegExp($a.source),Pl=/<%-([\s\S]+?)%>/g,kl=/<%([\s\S]+?)%>/g,Ba=/<%=([\s\S]+?)%>/g,Ul=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ml=/^\w*$/,$l=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cs=/[\\^$.*+?()[\]{}|]/g,Bl=RegExp(cs.source),ls=/^\s+/,jl=/\s/,Wl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Gl=/\{\n\/\* \[wrapped with (.+)\] \*/,Vl=/,? & /,ql=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Jl=/[()=,{}\[\]\/\s]/,zl=/\\(\\)?/g,Ql=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ja=/\w*$/,Hl=/^[-+]0x[0-9a-f]+$/i,Yl=/^0b[01]+$/i,Xl=/^\[object .+?Constructor\]$/,Kl=/^0o[0-7]+$/i,Zl=/^(?:0|[1-9]\d*)$/,ef=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yi=/($^)/,tf=/['\n\r\u2028\u2029\\]/g,Xi="\\ud800-\\udfff",nf="\\u0300-\\u036f",rf="\\ufe20-\\ufe2f",sf="\\u20d0-\\u20ff",Wa=nf+rf+sf,Ga="\\u2700-\\u27bf",Va="a-z\\xdf-\\xf6\\xf8-\\xff",af="\\xac\\xb1\\xd7\\xf7",of="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uf="\\u2000-\\u206f",cf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qa="A-Z\\xc0-\\xd6\\xd8-\\xde",Ja="\\ufe0e\\ufe0f",za=af+of+uf+cf,fs="['’]",lf="["+Xi+"]",Qa="["+za+"]",Ki="["+Wa+"]",Ha="\\d+",ff="["+Ga+"]",Ya="["+Va+"]",Xa="[^"+Xi+za+Ha+Ga+Va+qa+"]",ps="\\ud83c[\\udffb-\\udfff]",pf="(?:"+Ki+"|"+ps+")",Ka="[^"+Xi+"]",ds="(?:\\ud83c[\\udde6-\\uddff]){2}",hs="[\\ud800-\\udbff][\\udc00-\\udfff]",zn="["+qa+"]",Za="\\u200d",eo="(?:"+Ya+"|"+Xa+")",df="(?:"+zn+"|"+Xa+")",to="(?:"+fs+"(?:d|ll|m|re|s|t|ve))?",no="(?:"+fs+"(?:D|LL|M|RE|S|T|VE))?",io=pf+"?",ro="["+Ja+"]?",hf="(?:"+Za+"(?:"+[Ka,ds,hs].join("|")+")"+ro+io+")*",gf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",so=ro+io+hf,yf="(?:"+[ff,ds,hs].join("|")+")"+so,vf="(?:"+[Ka+Ki+"?",Ki,ds,hs,lf].join("|")+")",_f=RegExp(fs,"g"),xf=RegExp(Ki,"g"),gs=RegExp(ps+"(?="+ps+")|"+vf+so,"g"),Tf=RegExp([zn+"?"+Ya+"+"+to+"(?="+[Qa,zn,"$"].join("|")+")",df+"+"+no+"(?="+[Qa,zn+eo,"$"].join("|")+")",zn+"?"+eo+"+"+to,zn+"+"+no,mf,gf,Ha,yf].join("|"),"g"),wf=RegExp("["+Za+Xi+Wa+Ja+"]"),Ef=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Sf=["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"],Af=-1,Te={};Te[W]=Te[Ce]=Te[Ct]=Te[Hi]=Te[On]=Te[_i]=Te[as]=Te[os]=Te[us]=!0,Te[nn]=Te[Gn]=Te[Nn]=Te[Sn]=Te[an]=Te[An]=Te[Vn]=Te[qn]=Te[Xe]=Te[In]=Te[wt]=Te[rn]=Te[Ke]=Te[bn]=Te[sn]=!1;var _e={};_e[nn]=_e[Gn]=_e[Nn]=_e[an]=_e[Sn]=_e[An]=_e[W]=_e[Ce]=_e[Ct]=_e[Hi]=_e[On]=_e[Xe]=_e[In]=_e[wt]=_e[rn]=_e[Ke]=_e[bn]=_e[Jn]=_e[_i]=_e[as]=_e[os]=_e[us]=!0,_e[Vn]=_e[qn]=_e[sn]=!1;var If={À:"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"},bf={"&":"&","<":"<",">":">",'"':""","'":"'"},Nf={"&":"&","<":"<",">":">",""":'"',"'":"'"},Of={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Rf=parseFloat,Cf=parseInt,ao=typeof B.commonjsGlobal=="object"&&B.commonjsGlobal&&B.commonjsGlobal.Object===Object&&B.commonjsGlobal,Lf=typeof self=="object"&&self&&self.Object===Object&&self,Ue=ao||Lf||Function("return this")(),ms=r&&!r.nodeType&&r,Rn=ms&&!0&&n&&!n.nodeType&&n,oo=Rn&&Rn.exports===ms,ys=oo&&ao.process,at=function(){try{var m=Rn&&Rn.require&&Rn.require("util").types;return m||ys&&ys.binding&&ys.binding("util")}catch{}}(),uo=at&&at.isArrayBuffer,co=at&&at.isDate,lo=at&&at.isMap,fo=at&&at.isRegExp,po=at&&at.isSet,ho=at&&at.isTypedArray;function Ze(m,T,_){switch(_.length){case 0:return m.call(T);case 1:return m.call(T,_[0]);case 2:return m.call(T,_[0],_[1]);case 3:return m.call(T,_[0],_[1],_[2])}return m.apply(T,_)}function Ff(m,T,_,F){for(var z=-1,oe=m==null?0:m.length;++z<oe;){var Le=m[z];T(F,Le,_(Le),m)}return F}function ot(m,T){for(var _=-1,F=m==null?0:m.length;++_<F&&T(m[_],_,m)!==!1;);return m}function Df(m,T){for(var _=m==null?0:m.length;_--&&T(m[_],_,m)!==!1;);return m}function go(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(!T(m[_],_,m))return!1;return!0}function on(m,T){for(var _=-1,F=m==null?0:m.length,z=0,oe=[];++_<F;){var Le=m[_];T(Le,_,m)&&(oe[z++]=Le)}return oe}function Zi(m,T){var _=m==null?0:m.length;return!!_&&Qn(m,T,0)>-1}function vs(m,T,_){for(var F=-1,z=m==null?0:m.length;++F<z;)if(_(T,m[F]))return!0;return!1}function Ee(m,T){for(var _=-1,F=m==null?0:m.length,z=Array(F);++_<F;)z[_]=T(m[_],_,m);return z}function un(m,T){for(var _=-1,F=T.length,z=m.length;++_<F;)m[z+_]=T[_];return m}function _s(m,T,_,F){var z=-1,oe=m==null?0:m.length;for(F&&oe&&(_=m[++z]);++z<oe;)_=T(_,m[z],z,m);return _}function Pf(m,T,_,F){var z=m==null?0:m.length;for(F&&z&&(_=m[--z]);z--;)_=T(_,m[z],z,m);return _}function xs(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(T(m[_],_,m))return!0;return!1}var kf=Ts("length");function Uf(m){return m.split("")}function Mf(m){return m.match(ql)||[]}function mo(m,T,_){var F;return _(m,function(z,oe,Le){if(T(z,oe,Le))return F=oe,!1}),F}function er(m,T,_,F){for(var z=m.length,oe=_+(F?1:-1);F?oe--:++oe<z;)if(T(m[oe],oe,m))return oe;return-1}function Qn(m,T,_){return T===T?Yf(m,T,_):er(m,yo,_)}function $f(m,T,_,F){for(var z=_-1,oe=m.length;++z<oe;)if(F(m[z],T))return z;return-1}function yo(m){return m!==m}function vo(m,T){var _=m==null?0:m.length;return _?Es(m,T)/_:Wn}function Ts(m){return function(T){return T==null?i:T[m]}}function ws(m){return function(T){return m==null?i:m[T]}}function _o(m,T,_,F,z){return z(m,function(oe,Le,ye){_=F?(F=!1,oe):T(_,oe,Le,ye)}),_}function Bf(m,T){var _=m.length;for(m.sort(T);_--;)m[_]=m[_].value;return m}function Es(m,T){for(var _,F=-1,z=m.length;++F<z;){var oe=T(m[F]);oe!==i&&(_=_===i?oe:_+oe)}return _}function Ss(m,T){for(var _=-1,F=Array(m);++_<m;)F[_]=T(_);return F}function jf(m,T){return Ee(T,function(_){return[_,m[_]]})}function xo(m){return m&&m.slice(0,So(m)+1).replace(ls,"")}function et(m){return function(T){return m(T)}}function As(m,T){return Ee(T,function(_){return m[_]})}function xi(m,T){return m.has(T)}function To(m,T){for(var _=-1,F=m.length;++_<F&&Qn(T,m[_],0)>-1;);return _}function wo(m,T){for(var _=m.length;_--&&Qn(T,m[_],0)>-1;);return _}function Wf(m,T){for(var _=m.length,F=0;_--;)m[_]===T&&++F;return F}var Gf=ws(If),Vf=ws(bf);function qf(m){return"\\"+Of[m]}function Jf(m,T){return m==null?i:m[T]}function Hn(m){return wf.test(m)}function zf(m){return Ef.test(m)}function Qf(m){for(var T,_=[];!(T=m.next()).done;)_.push(T.value);return _}function Is(m){var T=-1,_=Array(m.size);return m.forEach(function(F,z){_[++T]=[z,F]}),_}function Eo(m,T){return function(_){return m(T(_))}}function cn(m,T){for(var _=-1,F=m.length,z=0,oe=[];++_<F;){var Le=m[_];(Le===T||Le===O)&&(m[_]=O,oe[z++]=_)}return oe}function tr(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=F}),_}function Hf(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=[F,F]}),_}function Yf(m,T,_){for(var F=_-1,z=m.length;++F<z;)if(m[F]===T)return F;return-1}function Xf(m,T,_){for(var F=_+1;F--;)if(m[F]===T)return F;return F}function Yn(m){return Hn(m)?Zf(m):kf(m)}function Et(m){return Hn(m)?ep(m):Uf(m)}function So(m){for(var T=m.length;T--&&jl.test(m.charAt(T)););return T}var Kf=ws(Nf);function Zf(m){for(var T=gs.lastIndex=0;gs.test(m);)++T;return T}function ep(m){return m.match(gs)||[]}function tp(m){return m.match(Tf)||[]}var np=function m(T){T=T==null?Ue:Xn.defaults(Ue.Object(),T,Xn.pick(Ue,Sf));var _=T.Array,F=T.Date,z=T.Error,oe=T.Function,Le=T.Math,ye=T.Object,bs=T.RegExp,ip=T.String,ut=T.TypeError,nr=_.prototype,rp=oe.prototype,Kn=ye.prototype,ir=T["__core-js_shared__"],rr=rp.toString,pe=Kn.hasOwnProperty,sp=0,Ao=function(){var e=/[^.]+$/.exec(ir&&ir.keys&&ir.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),sr=Kn.toString,ap=rr.call(ye),op=Ue._,up=bs("^"+rr.call(pe).replace(cs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ar=oo?T.Buffer:i,ln=T.Symbol,or=T.Uint8Array,Io=ar?ar.allocUnsafe:i,ur=Eo(ye.getPrototypeOf,ye),bo=ye.create,No=Kn.propertyIsEnumerable,cr=nr.splice,Oo=ln?ln.isConcatSpreadable:i,Ti=ln?ln.iterator:i,Cn=ln?ln.toStringTag:i,lr=function(){try{var e=kn(ye,"defineProperty");return e({},"",{}),e}catch{}}(),cp=T.clearTimeout!==Ue.clearTimeout&&T.clearTimeout,lp=F&&F.now!==Ue.Date.now&&F.now,fp=T.setTimeout!==Ue.setTimeout&&T.setTimeout,fr=Le.ceil,pr=Le.floor,Ns=ye.getOwnPropertySymbols,pp=ar?ar.isBuffer:i,Ro=T.isFinite,dp=nr.join,hp=Eo(ye.keys,ye),Fe=Le.max,$e=Le.min,gp=F.now,mp=T.parseInt,Co=Le.random,yp=nr.reverse,Os=kn(T,"DataView"),wi=kn(T,"Map"),Rs=kn(T,"Promise"),Zn=kn(T,"Set"),Ei=kn(T,"WeakMap"),Si=kn(ye,"create"),dr=Ei&&new Ei,ei={},vp=Un(Os),_p=Un(wi),xp=Un(Rs),Tp=Un(Zn),wp=Un(Ei),hr=ln?ln.prototype:i,Ai=hr?hr.valueOf:i,Lo=hr?hr.toString:i;function l(e){if(Ie(e)&&!Q(e)&&!(e instanceof te)){if(e instanceof ct)return e;if(pe.call(e,"__wrapped__"))return Fu(e)}return new ct(e)}var ti=function(){function e(){}return function(t){if(!Ae(t))return{};if(bo)return bo(t);e.prototype=t;var s=new e;return e.prototype=i,s}}();function gr(){}function ct(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}l.templateSettings={escape:Pl,evaluate:kl,interpolate:Ba,variable:"",imports:{_:l}},l.prototype=gr.prototype,l.prototype.constructor=l,ct.prototype=ti(gr.prototype),ct.prototype.constructor=ct;function te(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=st,this.__views__=[]}function Ep(){var e=new te(this.__wrapped__);return e.__actions__=Je(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Je(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Je(this.__views__),e}function Sp(){if(this.__filtered__){var e=new te(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Ap(){var e=this.__wrapped__.value(),t=this.__dir__,s=Q(e),a=t<0,c=s?e.length:0,p=Ud(0,c,this.__views__),d=p.start,h=p.end,y=h-d,E=a?h:d-1,S=this.__iteratees__,I=S.length,C=0,U=$e(y,this.__takeCount__);if(!s||!a&&c==y&&U==y)return nu(e,this.__actions__);var G=[];e:for(;y--&&C<U;){E+=t;for(var X=-1,V=e[E];++X<I;){var Z=S[X],ie=Z.iteratee,it=Z.type,Ve=ie(V);if(it==qi)V=Ve;else if(!Ve){if(it==Vi)continue e;break e}}G[C++]=V}return G}te.prototype=ti(gr.prototype),te.prototype.constructor=te;function Ln(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function Ip(){this.__data__=Si?Si(null):{},this.size=0}function bp(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Np(e){var t=this.__data__;if(Si){var s=t[e];return s===w?i:s}return pe.call(t,e)?t[e]:i}function Op(e){var t=this.__data__;return Si?t[e]!==i:pe.call(t,e)}function Rp(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=Si&&t===i?w:t,this}Ln.prototype.clear=Ip,Ln.prototype.delete=bp,Ln.prototype.get=Np,Ln.prototype.has=Op,Ln.prototype.set=Rp;function $t(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function Cp(){this.__data__=[],this.size=0}function Lp(e){var t=this.__data__,s=mr(t,e);if(s<0)return!1;var a=t.length-1;return s==a?t.pop():cr.call(t,s,1),--this.size,!0}function Fp(e){var t=this.__data__,s=mr(t,e);return s<0?i:t[s][1]}function Dp(e){return mr(this.__data__,e)>-1}function Pp(e,t){var s=this.__data__,a=mr(s,e);return a<0?(++this.size,s.push([e,t])):s[a][1]=t,this}$t.prototype.clear=Cp,$t.prototype.delete=Lp,$t.prototype.get=Fp,$t.prototype.has=Dp,$t.prototype.set=Pp;function Bt(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function kp(){this.size=0,this.__data__={hash:new Ln,map:new(wi||$t),string:new Ln}}function Up(e){var t=Nr(this,e).delete(e);return this.size-=t?1:0,t}function Mp(e){return Nr(this,e).get(e)}function $p(e){return Nr(this,e).has(e)}function Bp(e,t){var s=Nr(this,e),a=s.size;return s.set(e,t),this.size+=s.size==a?0:1,this}Bt.prototype.clear=kp,Bt.prototype.delete=Up,Bt.prototype.get=Mp,Bt.prototype.has=$p,Bt.prototype.set=Bp;function Fn(e){var t=-1,s=e==null?0:e.length;for(this.__data__=new Bt;++t<s;)this.add(e[t])}function jp(e){return this.__data__.set(e,w),this}function Wp(e){return this.__data__.has(e)}Fn.prototype.add=Fn.prototype.push=jp,Fn.prototype.has=Wp;function St(e){var t=this.__data__=new $t(e);this.size=t.size}function Gp(){this.__data__=new $t,this.size=0}function Vp(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}function qp(e){return this.__data__.get(e)}function Jp(e){return this.__data__.has(e)}function zp(e,t){var s=this.__data__;if(s instanceof $t){var a=s.__data__;if(!wi||a.length<u-1)return a.push([e,t]),this.size=++s.size,this;s=this.__data__=new Bt(a)}return s.set(e,t),this.size=s.size,this}St.prototype.clear=Gp,St.prototype.delete=Vp,St.prototype.get=qp,St.prototype.has=Jp,St.prototype.set=zp;function Fo(e,t){var s=Q(e),a=!s&&Mn(e),c=!s&&!a&&gn(e),p=!s&&!a&&!c&&si(e),d=s||a||c||p,h=d?Ss(e.length,ip):[],y=h.length;for(var E in e)(t||pe.call(e,E))&&!(d&&(E=="length"||c&&(E=="offset"||E=="parent")||p&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||Vt(E,y)))&&h.push(E);return h}function Do(e){var t=e.length;return t?e[js(0,t-1)]:i}function Qp(e,t){return Or(Je(e),Dn(t,0,e.length))}function Hp(e){return Or(Je(e))}function Cs(e,t,s){(s!==i&&!At(e[t],s)||s===i&&!(t in e))&&jt(e,t,s)}function Ii(e,t,s){var a=e[t];(!(pe.call(e,t)&&At(a,s))||s===i&&!(t in e))&&jt(e,t,s)}function mr(e,t){for(var s=e.length;s--;)if(At(e[s][0],t))return s;return-1}function Yp(e,t,s,a){return fn(e,function(c,p,d){t(a,c,s(c),d)}),a}function Po(e,t){return e&&Ft(t,Pe(t),e)}function Xp(e,t){return e&&Ft(t,Qe(t),e)}function jt(e,t,s){t=="__proto__"&&lr?lr(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}function Ls(e,t){for(var s=-1,a=t.length,c=_(a),p=e==null;++s<a;)c[s]=p?i:pa(e,t[s]);return c}function Dn(e,t,s){return e===e&&(s!==i&&(e=e<=s?e:s),t!==i&&(e=e>=t?e:t)),e}function lt(e,t,s,a,c,p){var d,h=t&D,y=t&P,E=t&M;if(s&&(d=c?s(e,a,c,p):s(e)),d!==i)return d;if(!Ae(e))return e;var S=Q(e);if(S){if(d=$d(e),!h)return Je(e,d)}else{var I=Be(e),C=I==qn||I==zi;if(gn(e))return su(e,h);if(I==wt||I==nn||C&&!c){if(d=y||C?{}:Su(e),!h)return y?Nd(e,Xp(d,e)):bd(e,Po(d,e))}else{if(!_e[I])return c?e:{};d=Bd(e,I,h)}}p||(p=new St);var U=p.get(e);if(U)return U;p.set(e,d),Zu(e)?e.forEach(function(V){d.add(lt(V,t,s,V,e,p))}):Xu(e)&&e.forEach(function(V,Z){d.set(Z,lt(V,t,s,Z,e,p))});var G=E?y?Ks:Xs:y?Qe:Pe,X=S?i:G(e);return ot(X||e,function(V,Z){X&&(Z=V,V=e[Z]),Ii(d,Z,lt(V,t,s,Z,e,p))}),d}function Kp(e){var t=Pe(e);return function(s){return ko(s,e,t)}}function ko(e,t,s){var a=s.length;if(e==null)return!a;for(e=ye(e);a--;){var c=s[a],p=t[c],d=e[c];if(d===i&&!(c in e)||!p(d))return!1}return!0}function Uo(e,t,s){if(typeof e!="function")throw new ut(g);return Fi(function(){e.apply(i,s)},t)}function bi(e,t,s,a){var c=-1,p=Zi,d=!0,h=e.length,y=[],E=t.length;if(!h)return y;s&&(t=Ee(t,et(s))),a?(p=vs,d=!1):t.length>=u&&(p=xi,d=!1,t=new Fn(t));e:for(;++c<h;){var S=e[c],I=s==null?S:s(S);if(S=a||S!==0?S:0,d&&I===I){for(var C=E;C--;)if(t[C]===I)continue e;y.push(S)}else p(t,I,a)||y.push(S)}return y}var fn=lu(Lt),Mo=lu(Ds,!0);function Zp(e,t){var s=!0;return fn(e,function(a,c,p){return s=!!t(a,c,p),s}),s}function yr(e,t,s){for(var a=-1,c=e.length;++a<c;){var p=e[a],d=t(p);if(d!=null&&(h===i?d===d&&!nt(d):s(d,h)))var h=d,y=p}return y}function ed(e,t,s,a){var c=e.length;for(s=Y(s),s<0&&(s=-s>c?0:c+s),a=a===i||a>c?c:Y(a),a<0&&(a+=c),a=s>a?0:tc(a);s<a;)e[s++]=t;return e}function $o(e,t){var s=[];return fn(e,function(a,c,p){t(a,c,p)&&s.push(a)}),s}function Me(e,t,s,a,c){var p=-1,d=e.length;for(s||(s=Wd),c||(c=[]);++p<d;){var h=e[p];t>0&&s(h)?t>1?Me(h,t-1,s,a,c):un(c,h):a||(c[c.length]=h)}return c}var Fs=fu(),Bo=fu(!0);function Lt(e,t){return e&&Fs(e,t,Pe)}function Ds(e,t){return e&&Bo(e,t,Pe)}function vr(e,t){return on(t,function(s){return qt(e[s])})}function Pn(e,t){t=dn(t,e);for(var s=0,a=t.length;e!=null&&s<a;)e=e[Dt(t[s++])];return s&&s==a?e:i}function jo(e,t,s){var a=t(e);return Q(e)?a:un(a,s(e))}function We(e){return e==null?e===i?rs:is:Cn&&Cn in ye(e)?kd(e):Hd(e)}function Ps(e,t){return e>t}function td(e,t){return e!=null&&pe.call(e,t)}function nd(e,t){return e!=null&&t in ye(e)}function id(e,t,s){return e>=$e(t,s)&&e<Fe(t,s)}function ks(e,t,s){for(var a=s?vs:Zi,c=e[0].length,p=e.length,d=p,h=_(p),y=1/0,E=[];d--;){var S=e[d];d&&t&&(S=Ee(S,et(t))),y=$e(S.length,y),h[d]=!s&&(t||c>=120&&S.length>=120)?new Fn(d&&S):i}S=e[0];var I=-1,C=h[0];e:for(;++I<c&&E.length<y;){var U=S[I],G=t?t(U):U;if(U=s||U!==0?U:0,!(C?xi(C,G):a(E,G,s))){for(d=p;--d;){var X=h[d];if(!(X?xi(X,G):a(e[d],G,s)))continue e}C&&C.push(G),E.push(U)}}return E}function rd(e,t,s,a){return Lt(e,function(c,p,d){t(a,s(c),p,d)}),a}function Ni(e,t,s){t=dn(t,e),e=Nu(e,t);var a=e==null?e:e[Dt(pt(t))];return a==null?i:Ze(a,e,s)}function Wo(e){return Ie(e)&&We(e)==nn}function sd(e){return Ie(e)&&We(e)==Nn}function ad(e){return Ie(e)&&We(e)==An}function Oi(e,t,s,a,c){return e===t?!0:e==null||t==null||!Ie(e)&&!Ie(t)?e!==e&&t!==t:od(e,t,s,a,Oi,c)}function od(e,t,s,a,c,p){var d=Q(e),h=Q(t),y=d?Gn:Be(e),E=h?Gn:Be(t);y=y==nn?wt:y,E=E==nn?wt:E;var S=y==wt,I=E==wt,C=y==E;if(C&&gn(e)){if(!gn(t))return!1;d=!0,S=!1}if(C&&!S)return p||(p=new St),d||si(e)?Tu(e,t,s,a,c,p):Dd(e,t,y,s,a,c,p);if(!(s&$)){var U=S&&pe.call(e,"__wrapped__"),G=I&&pe.call(t,"__wrapped__");if(U||G){var X=U?e.value():e,V=G?t.value():t;return p||(p=new St),c(X,V,s,a,p)}}return C?(p||(p=new St),Pd(e,t,s,a,c,p)):!1}function ud(e){return Ie(e)&&Be(e)==Xe}function Us(e,t,s,a){var c=s.length,p=c,d=!a;if(e==null)return!p;for(e=ye(e);c--;){var h=s[c];if(d&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++c<p;){h=s[c];var y=h[0],E=e[y],S=h[1];if(d&&h[2]){if(E===i&&!(y in e))return!1}else{var I=new St;if(a)var C=a(E,S,y,e,t,I);if(!(C===i?Oi(S,E,$|he,a,I):C))return!1}}return!0}function Go(e){if(!Ae(e)||Vd(e))return!1;var t=qt(e)?up:Xl;return t.test(Un(e))}function cd(e){return Ie(e)&&We(e)==rn}function ld(e){return Ie(e)&&Be(e)==Ke}function fd(e){return Ie(e)&&Pr(e.length)&&!!Te[We(e)]}function Vo(e){return typeof e=="function"?e:e==null?He:typeof e=="object"?Q(e)?zo(e[0],e[1]):Jo(e):pc(e)}function Ms(e){if(!Li(e))return hp(e);var t=[];for(var s in ye(e))pe.call(e,s)&&s!="constructor"&&t.push(s);return t}function pd(e){if(!Ae(e))return Qd(e);var t=Li(e),s=[];for(var a in e)a=="constructor"&&(t||!pe.call(e,a))||s.push(a);return s}function $s(e,t){return e<t}function qo(e,t){var s=-1,a=ze(e)?_(e.length):[];return fn(e,function(c,p,d){a[++s]=t(c,p,d)}),a}function Jo(e){var t=ea(e);return t.length==1&&t[0][2]?Iu(t[0][0],t[0][1]):function(s){return s===e||Us(s,e,t)}}function zo(e,t){return na(e)&&Au(t)?Iu(Dt(e),t):function(s){var a=pa(s,e);return a===i&&a===t?da(s,e):Oi(t,a,$|he)}}function _r(e,t,s,a,c){e!==t&&Fs(t,function(p,d){if(c||(c=new St),Ae(p))dd(e,t,d,s,_r,a,c);else{var h=a?a(ra(e,d),p,d+"",e,t,c):i;h===i&&(h=p),Cs(e,d,h)}},Qe)}function dd(e,t,s,a,c,p,d){var h=ra(e,s),y=ra(t,s),E=d.get(y);if(E){Cs(e,s,E);return}var S=p?p(h,y,s+"",e,t,d):i,I=S===i;if(I){var C=Q(y),U=!C&&gn(y),G=!C&&!U&&si(y);S=y,C||U||G?Q(h)?S=h:be(h)?S=Je(h):U?(I=!1,S=su(y,!0)):G?(I=!1,S=au(y,!0)):S=[]:Di(y)||Mn(y)?(S=h,Mn(h)?S=nc(h):(!Ae(h)||qt(h))&&(S=Su(y))):I=!1}I&&(d.set(y,S),c(S,y,a,p,d),d.delete(y)),Cs(e,s,S)}function Qo(e,t){var s=e.length;if(s)return t+=t<0?s:0,Vt(t,s)?e[t]:i}function Ho(e,t,s){t.length?t=Ee(t,function(p){return Q(p)?function(d){return Pn(d,p.length===1?p[0]:p)}:p}):t=[He];var a=-1;t=Ee(t,et(j()));var c=qo(e,function(p,d,h){var y=Ee(t,function(E){return E(p)});return{criteria:y,index:++a,value:p}});return Bf(c,function(p,d){return Id(p,d,s)})}function hd(e,t){return Yo(e,t,function(s,a){return da(e,a)})}function Yo(e,t,s){for(var a=-1,c=t.length,p={};++a<c;){var d=t[a],h=Pn(e,d);s(h,d)&&Ri(p,dn(d,e),h)}return p}function gd(e){return function(t){return Pn(t,e)}}function Bs(e,t,s,a){var c=a?$f:Qn,p=-1,d=t.length,h=e;for(e===t&&(t=Je(t)),s&&(h=Ee(e,et(s)));++p<d;)for(var y=0,E=t[p],S=s?s(E):E;(y=c(h,S,y,a))>-1;)h!==e&&cr.call(h,y,1),cr.call(e,y,1);return e}function Xo(e,t){for(var s=e?t.length:0,a=s-1;s--;){var c=t[s];if(s==a||c!==p){var p=c;Vt(c)?cr.call(e,c,1):Vs(e,c)}}return e}function js(e,t){return e+pr(Co()*(t-e+1))}function md(e,t,s,a){for(var c=-1,p=Fe(fr((t-e)/(s||1)),0),d=_(p);p--;)d[a?p:++c]=e,e+=s;return d}function Ws(e,t){var s="";if(!e||t<1||t>Tt)return s;do t%2&&(s+=e),t=pr(t/2),t&&(e+=e);while(t);return s}function K(e,t){return sa(bu(e,t,He),e+"")}function yd(e){return Do(ai(e))}function vd(e,t){var s=ai(e);return Or(s,Dn(t,0,s.length))}function Ri(e,t,s,a){if(!Ae(e))return e;t=dn(t,e);for(var c=-1,p=t.length,d=p-1,h=e;h!=null&&++c<p;){var y=Dt(t[c]),E=s;if(y==="__proto__"||y==="constructor"||y==="prototype")return e;if(c!=d){var S=h[y];E=a?a(S,y,h):i,E===i&&(E=Ae(S)?S:Vt(t[c+1])?[]:{})}Ii(h,y,E),h=h[y]}return e}var Ko=dr?function(e,t){return dr.set(e,t),e}:He,_d=lr?function(e,t){return lr(e,"toString",{configurable:!0,enumerable:!1,value:ga(t),writable:!0})}:He;function xd(e){return Or(ai(e))}function ft(e,t,s){var a=-1,c=e.length;t<0&&(t=-t>c?0:c+t),s=s>c?c:s,s<0&&(s+=c),c=t>s?0:s-t>>>0,t>>>=0;for(var p=_(c);++a<c;)p[a]=e[a+t];return p}function Td(e,t){var s;return fn(e,function(a,c,p){return s=t(a,c,p),!s}),!!s}function xr(e,t,s){var a=0,c=e==null?a:e.length;if(typeof t=="number"&&t===t&&c<=Zr){for(;a<c;){var p=a+c>>>1,d=e[p];d!==null&&!nt(d)&&(s?d<=t:d<t)?a=p+1:c=p}return c}return Gs(e,t,He,s)}function Gs(e,t,s,a){var c=0,p=e==null?0:e.length;if(p===0)return 0;t=s(t);for(var d=t!==t,h=t===null,y=nt(t),E=t===i;c<p;){var S=pr((c+p)/2),I=s(e[S]),C=I!==i,U=I===null,G=I===I,X=nt(I);if(d)var V=a||G;else E?V=G&&(a||C):h?V=G&&C&&(a||!U):y?V=G&&C&&!U&&(a||!X):U||X?V=!1:V=a?I<=t:I<t;V?c=S+1:p=S}return $e(p,Kr)}function Zo(e,t){for(var s=-1,a=e.length,c=0,p=[];++s<a;){var d=e[s],h=t?t(d):d;if(!s||!At(h,y)){var y=h;p[c++]=d===0?0:d}}return p}function eu(e){return typeof e=="number"?e:nt(e)?Wn:+e}function tt(e){if(typeof e=="string")return e;if(Q(e))return Ee(e,tt)+"";if(nt(e))return Lo?Lo.call(e):"";var t=e+"";return t=="0"&&1/e==-Rt?"-0":t}function pn(e,t,s){var a=-1,c=Zi,p=e.length,d=!0,h=[],y=h;if(s)d=!1,c=vs;else if(p>=u){var E=t?null:Ld(e);if(E)return tr(E);d=!1,c=xi,y=new Fn}else y=t?[]:h;e:for(;++a<p;){var S=e[a],I=t?t(S):S;if(S=s||S!==0?S:0,d&&I===I){for(var C=y.length;C--;)if(y[C]===I)continue e;t&&y.push(I),h.push(S)}else c(y,I,s)||(y!==h&&y.push(I),h.push(S))}return h}function Vs(e,t){return t=dn(t,e),e=Nu(e,t),e==null||delete e[Dt(pt(t))]}function tu(e,t,s,a){return Ri(e,t,s(Pn(e,t)),a)}function Tr(e,t,s,a){for(var c=e.length,p=a?c:-1;(a?p--:++p<c)&&t(e[p],p,e););return s?ft(e,a?0:p,a?p+1:c):ft(e,a?p+1:0,a?c:p)}function nu(e,t){var s=e;return s instanceof te&&(s=s.value()),_s(t,function(a,c){return c.func.apply(c.thisArg,un([a],c.args))},s)}function qs(e,t,s){var a=e.length;if(a<2)return a?pn(e[0]):[];for(var c=-1,p=_(a);++c<a;)for(var d=e[c],h=-1;++h<a;)h!=c&&(p[c]=bi(p[c]||d,e[h],t,s));return pn(Me(p,1),t,s)}function iu(e,t,s){for(var a=-1,c=e.length,p=t.length,d={};++a<c;){var h=a<p?t[a]:i;s(d,e[a],h)}return d}function Js(e){return be(e)?e:[]}function zs(e){return typeof e=="function"?e:He}function dn(e,t){return Q(e)?e:na(e,t)?[e]:Lu(le(e))}var wd=K;function hn(e,t,s){var a=e.length;return s=s===i?a:s,!t&&s>=a?e:ft(e,t,s)}var ru=cp||function(e){return Ue.clearTimeout(e)};function su(e,t){if(t)return e.slice();var s=e.length,a=Io?Io(s):new e.constructor(s);return e.copy(a),a}function Qs(e){var t=new e.constructor(e.byteLength);return new or(t).set(new or(e)),t}function Ed(e,t){var s=t?Qs(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Sd(e){var t=new e.constructor(e.source,ja.exec(e));return t.lastIndex=e.lastIndex,t}function Ad(e){return Ai?ye(Ai.call(e)):{}}function au(e,t){var s=t?Qs(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function ou(e,t){if(e!==t){var s=e!==i,a=e===null,c=e===e,p=nt(e),d=t!==i,h=t===null,y=t===t,E=nt(t);if(!h&&!E&&!p&&e>t||p&&d&&y&&!h&&!E||a&&d&&y||!s&&y||!c)return 1;if(!a&&!p&&!E&&e<t||E&&s&&c&&!a&&!p||h&&s&&c||!d&&c||!y)return-1}return 0}function Id(e,t,s){for(var a=-1,c=e.criteria,p=t.criteria,d=c.length,h=s.length;++a<d;){var y=ou(c[a],p[a]);if(y){if(a>=h)return y;var E=s[a];return y*(E=="desc"?-1:1)}}return e.index-t.index}function uu(e,t,s,a){for(var c=-1,p=e.length,d=s.length,h=-1,y=t.length,E=Fe(p-d,0),S=_(y+E),I=!a;++h<y;)S[h]=t[h];for(;++c<d;)(I||c<p)&&(S[s[c]]=e[c]);for(;E--;)S[h++]=e[c++];return S}function cu(e,t,s,a){for(var c=-1,p=e.length,d=-1,h=s.length,y=-1,E=t.length,S=Fe(p-h,0),I=_(S+E),C=!a;++c<S;)I[c]=e[c];for(var U=c;++y<E;)I[U+y]=t[y];for(;++d<h;)(C||c<p)&&(I[U+s[d]]=e[c++]);return I}function Je(e,t){var s=-1,a=e.length;for(t||(t=_(a));++s<a;)t[s]=e[s];return t}function Ft(e,t,s,a){var c=!s;s||(s={});for(var p=-1,d=t.length;++p<d;){var h=t[p],y=a?a(s[h],e[h],h,s,e):i;y===i&&(y=e[h]),c?jt(s,h,y):Ii(s,h,y)}return s}function bd(e,t){return Ft(e,ta(e),t)}function Nd(e,t){return Ft(e,wu(e),t)}function wr(e,t){return function(s,a){var c=Q(s)?Ff:Yp,p=t?t():{};return c(s,e,j(a,2),p)}}function ni(e){return K(function(t,s){var a=-1,c=s.length,p=c>1?s[c-1]:i,d=c>2?s[2]:i;for(p=e.length>3&&typeof p=="function"?(c--,p):i,d&&Ge(s[0],s[1],d)&&(p=c<3?i:p,c=1),t=ye(t);++a<c;){var h=s[a];h&&e(t,h,a,p)}return t})}function lu(e,t){return function(s,a){if(s==null)return s;if(!ze(s))return e(s,a);for(var c=s.length,p=t?c:-1,d=ye(s);(t?p--:++p<c)&&a(d[p],p,d)!==!1;);return s}}function fu(e){return function(t,s,a){for(var c=-1,p=ye(t),d=a(t),h=d.length;h--;){var y=d[e?h:++c];if(s(p[y],y,p)===!1)break}return t}}function Od(e,t,s){var a=t&ae,c=Ci(e);function p(){var d=this&&this!==Ue&&this instanceof p?c:e;return d.apply(a?s:this,arguments)}return p}function pu(e){return function(t){t=le(t);var s=Hn(t)?Et(t):i,a=s?s[0]:t.charAt(0),c=s?hn(s,1).join(""):t.slice(1);return a[e]()+c}}function ii(e){return function(t){return _s(lc(cc(t).replace(_f,"")),e,"")}}function Ci(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var s=ti(e.prototype),a=e.apply(s,t);return Ae(a)?a:s}}function Rd(e,t,s){var a=Ci(e);function c(){for(var p=arguments.length,d=_(p),h=p,y=ri(c);h--;)d[h]=arguments[h];var E=p<3&&d[0]!==y&&d[p-1]!==y?[]:cn(d,y);if(p-=E.length,p<s)return yu(e,t,Er,c.placeholder,i,d,E,i,i,s-p);var S=this&&this!==Ue&&this instanceof c?a:e;return Ze(S,this,d)}return c}function du(e){return function(t,s,a){var c=ye(t);if(!ze(t)){var p=j(s,3);t=Pe(t),s=function(h){return p(c[h],h,c)}}var d=e(t,s,a);return d>-1?c[p?t[d]:d]:i}}function hu(e){return Gt(function(t){var s=t.length,a=s,c=ct.prototype.thru;for(e&&t.reverse();a--;){var p=t[a];if(typeof p!="function")throw new ut(g);if(c&&!d&&br(p)=="wrapper")var d=new ct([],!0)}for(a=d?a:s;++a<s;){p=t[a];var h=br(p),y=h=="wrapper"?Zs(p):i;y&&ia(y[0])&&y[1]==(ce|xe|ee|qe)&&!y[4].length&&y[9]==1?d=d[br(y[0])].apply(d,y[3]):d=p.length==1&&ia(p)?d[h]():d.thru(p)}return function(){var E=arguments,S=E[0];if(d&&E.length==1&&Q(S))return d.plant(S).value();for(var I=0,C=s?t[I].apply(this,E):S;++I<s;)C=t[I].call(this,C);return C}})}function Er(e,t,s,a,c,p,d,h,y,E){var S=t&ce,I=t&ae,C=t&me,U=t&(xe|L),G=t&x,X=C?i:Ci(e);function V(){for(var Z=arguments.length,ie=_(Z),it=Z;it--;)ie[it]=arguments[it];if(U)var Ve=ri(V),rt=Wf(ie,Ve);if(a&&(ie=uu(ie,a,c,U)),p&&(ie=cu(ie,p,d,U)),Z-=rt,U&&Z<E){var Ne=cn(ie,Ve);return yu(e,t,Er,V.placeholder,s,ie,Ne,h,y,E-Z)}var It=I?s:this,zt=C?It[e]:e;return Z=ie.length,h?ie=Yd(ie,h):G&&Z>1&&ie.reverse(),S&&y<Z&&(ie.length=y),this&&this!==Ue&&this instanceof V&&(zt=X||Ci(zt)),zt.apply(It,ie)}return V}function gu(e,t){return function(s,a){return rd(s,e,t(a),{})}}function Sr(e,t){return function(s,a){var c;if(s===i&&a===i)return t;if(s!==i&&(c=s),a!==i){if(c===i)return a;typeof s=="string"||typeof a=="string"?(s=tt(s),a=tt(a)):(s=eu(s),a=eu(a)),c=e(s,a)}return c}}function Hs(e){return Gt(function(t){return t=Ee(t,et(j())),K(function(s){var a=this;return e(t,function(c){return Ze(c,a,s)})})})}function Ar(e,t){t=t===i?" ":tt(t);var s=t.length;if(s<2)return s?Ws(t,e):t;var a=Ws(t,fr(e/Yn(t)));return Hn(t)?hn(Et(a),0,e).join(""):a.slice(0,e)}function Cd(e,t,s,a){var c=t&ae,p=Ci(e);function d(){for(var h=-1,y=arguments.length,E=-1,S=a.length,I=_(S+y),C=this&&this!==Ue&&this instanceof d?p:e;++E<S;)I[E]=a[E];for(;y--;)I[E++]=arguments[++h];return Ze(C,c?s:this,I)}return d}function mu(e){return function(t,s,a){return a&&typeof a!="number"&&Ge(t,s,a)&&(s=a=i),t=Jt(t),s===i?(s=t,t=0):s=Jt(s),a=a===i?t<s?1:-1:Jt(a),md(t,s,a,e)}}function Ir(e){return function(t,s){return typeof t=="string"&&typeof s=="string"||(t=dt(t),s=dt(s)),e(t,s)}}function yu(e,t,s,a,c,p,d,h,y,E){var S=t&xe,I=S?d:i,C=S?i:d,U=S?p:i,G=S?i:p;t|=S?ee:H,t&=~(S?H:ee),t&Ye||(t&=-4);var X=[e,t,c,U,I,G,C,h,y,E],V=s.apply(i,X);return ia(e)&&Ou(V,X),V.placeholder=a,Ru(V,e,t)}function Ys(e){var t=Le[e];return function(s,a){if(s=dt(s),a=a==null?0:$e(Y(a),292),a&&Ro(s)){var c=(le(s)+"e").split("e"),p=t(c[0]+"e"+(+c[1]+a));return c=(le(p)+"e").split("e"),+(c[0]+"e"+(+c[1]-a))}return t(s)}}var Ld=Zn&&1/tr(new Zn([,-0]))[1]==Rt?function(e){return new Zn(e)}:va;function vu(e){return function(t){var s=Be(t);return s==Xe?Is(t):s==Ke?Hf(t):jf(t,e(t))}}function Wt(e,t,s,a,c,p,d,h){var y=t&me;if(!y&&typeof e!="function")throw new ut(g);var E=a?a.length:0;if(E||(t&=-97,a=c=i),d=d===i?d:Fe(Y(d),0),h=h===i?h:Y(h),E-=c?c.length:0,t&H){var S=a,I=c;a=c=i}var C=y?i:Zs(e),U=[e,t,s,a,c,S,I,p,d,h];if(C&&zd(U,C),e=U[0],t=U[1],s=U[2],a=U[3],c=U[4],h=U[9]=U[9]===i?y?0:e.length:Fe(U[9]-E,0),!h&&t&(xe|L)&&(t&=-25),!t||t==ae)var G=Od(e,t,s);else t==xe||t==L?G=Rd(e,t,h):(t==ee||t==(ae|ee))&&!c.length?G=Cd(e,t,s,a):G=Er.apply(i,U);var X=C?Ko:Ou;return Ru(X(G,U),e,t)}function _u(e,t,s,a){return e===i||At(e,Kn[s])&&!pe.call(a,s)?t:e}function xu(e,t,s,a,c,p){return Ae(e)&&Ae(t)&&(p.set(t,e),_r(e,t,i,xu,p),p.delete(t)),e}function Fd(e){return Di(e)?i:e}function Tu(e,t,s,a,c,p){var d=s&$,h=e.length,y=t.length;if(h!=y&&!(d&&y>h))return!1;var E=p.get(e),S=p.get(t);if(E&&S)return E==t&&S==e;var I=-1,C=!0,U=s&he?new Fn:i;for(p.set(e,t),p.set(t,e);++I<h;){var G=e[I],X=t[I];if(a)var V=d?a(X,G,I,t,e,p):a(G,X,I,e,t,p);if(V!==i){if(V)continue;C=!1;break}if(U){if(!xs(t,function(Z,ie){if(!xi(U,ie)&&(G===Z||c(G,Z,s,a,p)))return U.push(ie)})){C=!1;break}}else if(!(G===X||c(G,X,s,a,p))){C=!1;break}}return p.delete(e),p.delete(t),C}function Dd(e,t,s,a,c,p,d){switch(s){case an:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Nn:return!(e.byteLength!=t.byteLength||!p(new or(e),new or(t)));case Sn:case An:case In:return At(+e,+t);case Vn:return e.name==t.name&&e.message==t.message;case rn:case bn:return e==t+"";case Xe:var h=Is;case Ke:var y=a&$;if(h||(h=tr),e.size!=t.size&&!y)return!1;var E=d.get(e);if(E)return E==t;a|=he,d.set(e,t);var S=Tu(h(e),h(t),a,c,p,d);return d.delete(e),S;case Jn:if(Ai)return Ai.call(e)==Ai.call(t)}return!1}function Pd(e,t,s,a,c,p){var d=s&$,h=Xs(e),y=h.length,E=Xs(t),S=E.length;if(y!=S&&!d)return!1;for(var I=y;I--;){var C=h[I];if(!(d?C in t:pe.call(t,C)))return!1}var U=p.get(e),G=p.get(t);if(U&&G)return U==t&&G==e;var X=!0;p.set(e,t),p.set(t,e);for(var V=d;++I<y;){C=h[I];var Z=e[C],ie=t[C];if(a)var it=d?a(ie,Z,C,t,e,p):a(Z,ie,C,e,t,p);if(!(it===i?Z===ie||c(Z,ie,s,a,p):it)){X=!1;break}V||(V=C=="constructor")}if(X&&!V){var Ve=e.constructor,rt=t.constructor;Ve!=rt&&"constructor"in e&&"constructor"in t&&!(typeof Ve=="function"&&Ve instanceof Ve&&typeof rt=="function"&&rt instanceof rt)&&(X=!1)}return p.delete(e),p.delete(t),X}function Gt(e){return sa(bu(e,i,ku),e+"")}function Xs(e){return jo(e,Pe,ta)}function Ks(e){return jo(e,Qe,wu)}var Zs=dr?function(e){return dr.get(e)}:va;function br(e){for(var t=e.name+"",s=ei[t],a=pe.call(ei,t)?s.length:0;a--;){var c=s[a],p=c.func;if(p==null||p==e)return c.name}return t}function ri(e){var t=pe.call(l,"placeholder")?l:e;return t.placeholder}function j(){var e=l.iteratee||ma;return e=e===ma?Vo:e,arguments.length?e(arguments[0],arguments[1]):e}function Nr(e,t){var s=e.__data__;return Gd(t)?s[typeof t=="string"?"string":"hash"]:s.map}function ea(e){for(var t=Pe(e),s=t.length;s--;){var a=t[s],c=e[a];t[s]=[a,c,Au(c)]}return t}function kn(e,t){var s=Jf(e,t);return Go(s)?s:i}function kd(e){var t=pe.call(e,Cn),s=e[Cn];try{e[Cn]=i;var a=!0}catch{}var c=sr.call(e);return a&&(t?e[Cn]=s:delete e[Cn]),c}var ta=Ns?function(e){return e==null?[]:(e=ye(e),on(Ns(e),function(t){return No.call(e,t)}))}:_a,wu=Ns?function(e){for(var t=[];e;)un(t,ta(e)),e=ur(e);return t}:_a,Be=We;(Os&&Be(new Os(new ArrayBuffer(1)))!=an||wi&&Be(new wi)!=Xe||Rs&&Be(Rs.resolve())!=vi||Zn&&Be(new Zn)!=Ke||Ei&&Be(new Ei)!=sn)&&(Be=function(e){var t=We(e),s=t==wt?e.constructor:i,a=s?Un(s):"";if(a)switch(a){case vp:return an;case _p:return Xe;case xp:return vi;case Tp:return Ke;case wp:return sn}return t});function Ud(e,t,s){for(var a=-1,c=s.length;++a<c;){var p=s[a],d=p.size;switch(p.type){case"drop":e+=d;break;case"dropRight":t-=d;break;case"take":t=$e(t,e+d);break;case"takeRight":e=Fe(e,t-d);break}}return{start:e,end:t}}function Md(e){var t=e.match(Gl);return t?t[1].split(Vl):[]}function Eu(e,t,s){t=dn(t,e);for(var a=-1,c=t.length,p=!1;++a<c;){var d=Dt(t[a]);if(!(p=e!=null&&s(e,d)))break;e=e[d]}return p||++a!=c?p:(c=e==null?0:e.length,!!c&&Pr(c)&&Vt(d,c)&&(Q(e)||Mn(e)))}function $d(e){var t=e.length,s=new e.constructor(t);return t&&typeof e[0]=="string"&&pe.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function Su(e){return typeof e.constructor=="function"&&!Li(e)?ti(ur(e)):{}}function Bd(e,t,s){var a=e.constructor;switch(t){case Nn:return Qs(e);case Sn:case An:return new a(+e);case an:return Ed(e,s);case W:case Ce:case Ct:case Hi:case On:case _i:case as:case os:case us:return au(e,s);case Xe:return new a;case In:case bn:return new a(e);case rn:return Sd(e);case Ke:return new a;case Jn:return Ad(e)}}function jd(e,t){var s=t.length;if(!s)return e;var a=s-1;return t[a]=(s>1?"& ":"")+t[a],t=t.join(s>2?", ":" "),e.replace(Wl,`{
|
|
208
|
+
*/var X0=Yn.exports,hu;function Q0(){return hu||(hu=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,ce=1,Le=2,de=1,Ue=2,Ct=4,Te=8,F=16,X=32,z=64,ae=128,Fe=256,re=512,Gt=30,Ge="...",ht=800,Tt=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",ae],["bind",de],["bindKey",Ue],["curry",Te],["curryRight",F],["flip",re],["partial",X],["partialRight",z],["rearg",Fe]],Ft="[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]",Me="[object Map]",zt="[object Number]",ii="[object Null]",tt="[object Object]",Rn="[object Promise]",nr="[object Proxy]",It="[object RegExp]",Ne="[object Set]",Jt="[object String]",fn="[object Symbol]",si="[object Undefined]",Rt="[object WeakMap]",ai="[object WeakSet]",Yt="[object ArrayBuffer]",Pt="[object DataView]",O="[object Float32Array]",ge="[object Float64Array]",ot="[object Int8Array]",rr="[object Int16Array]",Zt="[object Int32Array]",Pn="[object Uint8Array]",oi="[object Uint8ClampedArray]",ui="[object Uint16Array]",ci="[object Uint32Array]",bu=/\b__p \+= '';/g,Cu=/\b(__p \+=) '' \+/g,Tu=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Is=/&(?:amp|lt|gt|quot|#39);/g,Rs=/[&<>"']/g,Fu=RegExp(Is.source),Iu=RegExp(Rs.source),Ru=/<%-([\s\S]+?)%>/g,Pu=/<%([\s\S]+?)%>/g,Ps=/<%=([\s\S]+?)%>/g,Ou=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lu=/^\w*$/,Uu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,li=/[\\^$.*+?()[\]{}|]/g,Mu=RegExp(li.source),fi=/^\s+/,Nu=/\s/,Du=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Wu=/\{\n\/\* \[wrapped with (.+)\] \*/,$u=/,? & /,Bu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ku=/[()=,{}\[\]\/\s]/,qu=/\\(\\)?/g,ju=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Os=/\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",Ls=Xu+Qu+Vu,Us="\\u2700-\\u27bf",Ms="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",Ns="A-Z\\xc0-\\xd6\\xd8-\\xde",Ds="\\ufe0e\\ufe0f",Ws=ec+tc+nc+rc,hi="['’]",ic="["+sr+"]",$s="["+Ws+"]",ar="["+Ls+"]",Bs="\\d+",sc="["+Us+"]",ks="["+Ms+"]",qs="[^"+sr+Ws+Bs+Us+Ms+Ns+"]",pi="\\ud83c[\\udffb-\\udfff]",ac="(?:"+ar+"|"+pi+")",js="[^"+sr+"]",di="(?:\\ud83c[\\udde6-\\uddff]){2}",gi="[\\ud800-\\udbff][\\udc00-\\udfff]",hn="["+Ns+"]",Gs="\\u200d",Hs="(?:"+ks+"|"+qs+")",oc="(?:"+hn+"|"+qs+")",Ks="(?:"+hi+"(?:d|ll|m|re|s|t|ve))?",zs="(?:"+hi+"(?:D|LL|M|RE|S|T|VE))?",Js=ac+"?",Ys="["+Ds+"]?",uc="(?:"+Gs+"(?:"+[js,di,gi].join("|")+")"+Ys+Js+")*",cc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Zs=Ys+Js+uc,fc="(?:"+[sc,di,gi].join("|")+")"+Zs,hc="(?:"+[js+ar+"?",ar,di,gi,ic].join("|")+")",pc=RegExp(hi,"g"),dc=RegExp(ar,"g"),mi=RegExp(pi+"(?="+pi+")|"+hc+Zs,"g"),gc=RegExp([hn+"?"+ks+"+"+Ks+"(?="+[$s,hn,"$"].join("|")+")",oc+"+"+zs+"(?="+[$s,hn+Hs,"$"].join("|")+")",hn+"?"+Hs+"+"+Ks,hn+"+"+zs,lc,cc,Bs,fc].join("|"),"g"),mc=RegExp("["+Gs+sr+Ls+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"],yc=-1,oe={};oe[O]=oe[ge]=oe[ot]=oe[rr]=oe[Zt]=oe[Pn]=oe[oi]=oe[ui]=oe[ci]=!0,oe[Ft]=oe[un]=oe[Yt]=oe[Ht]=oe[Pt]=oe[Kt]=oe[cn]=oe[ln]=oe[Me]=oe[zt]=oe[tt]=oe[It]=oe[Ne]=oe[Jt]=oe[Rt]=!1;var ie={};ie[Ft]=ie[un]=ie[Yt]=ie[Pt]=ie[Ht]=ie[Kt]=ie[O]=ie[ge]=ie[ot]=ie[rr]=ie[Zt]=ie[Me]=ie[zt]=ie[tt]=ie[It]=ie[Ne]=ie[Jt]=ie[fn]=ie[Pn]=ie[oi]=ie[ui]=ie[ci]=!0,ie[cn]=ie[ln]=ie[Rt]=!1;var wc={À:"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"},Ec=parseFloat,bc=parseInt,Xs=typeof qt=="object"&&qt&&qt.Object===Object&&qt,Cc=typeof self=="object"&&self&&self.Object===Object&&self,ye=Xs||Cc||Function("return this")(),vi=a&&!a.nodeType&&a,Xt=vi&&!0&&c&&!c.nodeType&&c,Qs=Xt&&Xt.exports===vi,_i=Qs&&Xs.process,Ke=function(){try{var p=Xt&&Xt.require&&Xt.require("util").types;return p||_i&&_i.binding&&_i.binding("util")}catch{}}(),Vs=Ke&&Ke.isArrayBuffer,ea=Ke&&Ke.isDate,ta=Ke&&Ke.isMap,na=Ke&&Ke.isRegExp,ra=Ke&&Ke.isSet,ia=Ke&&Ke.isTypedArray;function De(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 M=-1,Z=p==null?0:p.length;++M<Z;){var me=p[M];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 sa(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 Ot(p,v){for(var m=-1,C=p==null?0:p.length,M=0,Z=[];++m<C;){var me=p[m];v(me,m,p)&&(Z[M++]=me)}return Z}function or(p,v){var m=p==null?0:p.length;return!!m&&pn(p,v,0)>-1}function yi(p,v,m){for(var C=-1,M=p==null?0:p.length;++C<M;)if(m(v,p[C]))return!0;return!1}function ue(p,v){for(var m=-1,C=p==null?0:p.length,M=Array(C);++m<C;)M[m]=v(p[m],m,p);return M}function Lt(p,v){for(var m=-1,C=v.length,M=p.length;++m<C;)p[M+m]=v[m];return p}function wi(p,v,m,C){var M=-1,Z=p==null?0:p.length;for(C&&Z&&(m=p[++M]);++M<Z;)m=v(m,p[M],M,p);return m}function Ic(p,v,m,C){var M=p==null?0:p.length;for(C&&M&&(m=p[--M]);M--;)m=v(m,p[M],M,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 aa(p,v,m){var C;return m(p,function(M,Z,me){if(v(M,Z,me))return C=Z,!1}),C}function ur(p,v,m,C){for(var M=p.length,Z=m+(C?1:-1);C?Z--:++Z<M;)if(v(p[Z],Z,p))return Z;return-1}function pn(p,v,m){return v===v?Gc(p,v,m):ur(p,oa,m)}function Lc(p,v,m,C){for(var M=m-1,Z=p.length;++M<Z;)if(C(p[M],v))return M;return-1}function oa(p){return p!==p}function ua(p,v){var m=p==null?0:p.length;return m?Ei(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 ca(p,v,m,C,M){return M(p,function(Z,me,ne){m=C?(C=!1,Z):v(m,Z,me,ne)}),m}function Uc(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,M=p.length;++C<M;){var Z=v(p[C]);Z!==i&&(m=m===i?Z:m+Z)}return m}function bi(p,v){for(var m=-1,C=Array(p);++m<p;)C[m]=v(m);return C}function Mc(p,v){return ue(v,function(m){return[m,p[m]]})}function la(p){return p&&p.slice(0,da(p)+1).replace(fi,"")}function We(p){return function(v){return p(v)}}function Ci(p,v){return ue(v,function(m){return p[m]})}function On(p,v){return p.has(v)}function fa(p,v){for(var m=-1,C=p.length;++m<C&&pn(v,p[m],0)>-1;);return m}function ha(p,v){for(var m=p.length;m--&&pn(v,p[m],0)>-1;);return m}function Nc(p,v){for(var m=p.length,C=0;m--;)p[m]===v&&++C;return C}var Dc=Ai(wc),Wc=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,M){m[++v]=[M,C]}),m}function pa(p,v){return function(m){return p(v(m))}}function Ut(p,v){for(var m=-1,C=p.length,M=0,Z=[];++m<C;){var me=p[m];(me===v||me===J)&&(p[m]=J,Z[M++]=m)}return Z}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,M=p.length;++C<M;)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 da(p){for(var v=p.length;v--&&Nu.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,M=v.Error,Z=v.Function,me=v.Math,ne=v.Object,Fi=v.RegExp,Xc=v.String,Je=v.TypeError,lr=m.prototype,Qc=Z.prototype,vn=ne.prototype,fr=v["__core-js_shared__"],hr=Qc.toString,V=vn.hasOwnProperty,Vc=0,ga=function(){var e=/[^.]+$/.exec(fr&&fr.keys&&fr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),pr=vn.toString,el=hr.call(ne),tl=ye._,nl=Fi("^"+hr.call(V).replace(li,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dr=Qs?v.Buffer:i,Mt=v.Symbol,gr=v.Uint8Array,ma=dr?dr.allocUnsafe:i,mr=pa(ne.getPrototypeOf,ne),va=ne.create,_a=vn.propertyIsEnumerable,vr=lr.splice,ya=Mt?Mt.isConcatSpreadable:i,Ln=Mt?Mt.iterator:i,Qt=Mt?Mt.toStringTag:i,_r=function(){try{var e=rn(ne,"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,yr=me.ceil,wr=me.floor,Ii=ne.getOwnPropertySymbols,al=dr?dr.isBuffer:i,wa=v.isFinite,ol=lr.join,ul=pa(ne.keys,ne),ve=me.max,xe=me.min,cl=C.now,ll=v.parseInt,xa=me.random,fl=lr.reverse,Ri=rn(v,"DataView"),Un=rn(v,"Map"),Pi=rn(v,"Promise"),_n=rn(v,"Set"),Mn=rn(v,"WeakMap"),Nn=rn(ne,"create"),xr=Mn&&new Mn,yn={},hl=sn(Ri),pl=sn(Un),dl=sn(Pi),gl=sn(_n),ml=sn(Mn),Sr=Mt?Mt.prototype:i,Dn=Sr?Sr.valueOf:i,Sa=Sr?Sr.toString:i;function o(e){if(fe(e)&&!N(e)&&!(e instanceof j)){if(e instanceof Ye)return e;if(V.call(e,"__wrapped__"))return Eo(e)}return new Ye(e)}var wn=function(){function e(){}return function(t){if(!le(t))return{};if(va)return va(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:Ps,variable:"",imports:{_:o}},o.prototype=Ar.prototype,o.prototype.constructor=o,Ye.prototype=wn(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 yl(){var e=this.__wrapped__.value(),t=this.__dir__,n=N(e),r=t<0,s=n?e.length:0,u=Of(0,s,this.__views__),l=u.start,h=u.end,d=h-l,y=r?h:l-1,w=this.__iteratees__,x=w.length,b=0,T=xe(d,this.__takeCount__);if(!n||!r&&s==d&&T==d)return Ka(e,this.__actions__);var L=[];e:for(;d--&&b<T;){y+=t;for(var $=-1,U=e[y];++$<x;){var q=w[$],H=q.iteratee,ke=q.type,Ce=H(U);if(ke==Vn)U=Ce;else if(!Ce){if(ke==Qn)continue e;break e}}L[b++]=U}return L}j.prototype=wn(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 wl(){this.__data__=Nn?Nn(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(Nn){var n=t[e];return n===I?i:n}return V.call(t,e)?t[e]:i}function Al(e){var t=this.__data__;return Nn?t[e]!==i:V.call(t,e)}function El(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Nn&&t===i?I:t,this}Vt.prototype.clear=wl,Vt.prototype.delete=xl,Vt.prototype.get=Sl,Vt.prototype.has=Al,Vt.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 bl(){this.__data__=[],this.size=0}function Cl(e){var t=this.__data__,n=Er(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=Er(t,e);return n<0?i:t[n][1]}function Fl(e){return Er(this.__data__,e)>-1}function Il(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=bl,pt.prototype.delete=Cl,pt.prototype.get=Tl,pt.prototype.has=Fl,pt.prototype.set=Il;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 Rl(){this.size=0,this.__data__={hash:new Vt,map:new(Un||pt),string:new Vt}}function Pl(e){var t=Nr(this,e).delete(e);return this.size-=t?1:0,t}function Ol(e){return Nr(this,e).get(e)}function Ll(e){return Nr(this,e).has(e)}function Ul(e,t){var n=Nr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}dt.prototype.clear=Rl,dt.prototype.delete=Pl,dt.prototype.get=Ol,dt.prototype.has=Ll,dt.prototype.set=Ul;function en(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new dt;++t<n;)this.add(e[t])}function Ml(e){return this.__data__.set(e,I),this}function Nl(e){return this.__data__.has(e)}en.prototype.add=en.prototype.push=Ml,en.prototype.has=Nl;function rt(e){var t=this.__data__=new pt(e);this.size=t.size}function Dl(){this.__data__=new pt,this.size=0}function Wl(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 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=Wl,rt.prototype.get=$l,rt.prototype.has=Bl,rt.prototype.set=kl;function Aa(e,t){var n=N(e),r=!n&&an(e),s=!n&&!r&&Bt(e),u=!n&&!r&&!s&&En(e),l=n||r||s||u,h=l?bi(e.length,Xc):[],d=h.length;for(var y in e)(t||V.call(e,y))&&!(l&&(y=="length"||s&&(y=="offset"||y=="parent")||u&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||_t(y,d)))&&h.push(y);return h}function Ea(e){var t=e.length;return t?e[qi(0,t-1)]:i}function ql(e,t){return Dr(Ie(e),tn(t,0,e.length))}function jl(e){return Dr(Ie(e))}function Oi(e,t,n){(n!==i&&!it(e[t],n)||n===i&&!(t in e))&>(e,t,n)}function Wn(e,t,n){var r=e[t];(!(V.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 Gl(e,t,n,r){return Nt(e,function(s,u,l){t(r,s,n(s),l)}),r}function ba(e,t){return e&&ct(t,_e(t),e)}function Hl(e,t){return e&&ct(t,Pe(t),e)}function gt(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,y=t&k;if(n&&(l=s?n(e,r,s,u):n(e)),l!==i)return l;if(!le(e))return e;var w=N(e);if(w){if(l=Uf(e),!h)return Ie(e,l)}else{var x=Se(e),b=x==ln||x==tr;if(Bt(e))return Ya(e,h);if(x==tt||x==Ft||b&&!s){if(l=d||b?{}:go(e),!h)return d?Af(e,Hl(l,e)):Sf(e,ba(l,e))}else{if(!ie[x])return s?e:{};l=Mf(e,x,h)}}u||(u=new rt);var T=u.get(e);if(T)return T;u.set(e,l),Go(e)?e.forEach(function(U){l.add(Ze(U,t,n,U,e,u))}):qo(e)&&e.forEach(function(U,q){l.set(q,Ze(U,t,n,q,e,u))});var L=y?d?Vi:Qi:d?Pe:_e,$=w?i:L(e);return ze($||e,function(U,q){$&&(q=U,U=e[q]),Wn(l,q,Ze(U,t,n,q,e,u))}),l}function Kl(e){var t=_e(e);return function(n){return Ca(n,e,t)}}function Ca(e,t,n){var r=n.length;if(e==null)return!r;for(e=ne(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 Ta(e,t,n){if(typeof e!="function")throw new Je(S);return Hn(function(){e.apply(i,n)},t)}function $n(e,t,n,r){var s=-1,u=or,l=!0,h=e.length,d=[],y=t.length;if(!h)return d;n&&(t=ue(t,We(n))),r?(u=yi,l=!1):t.length>=g&&(u=On,l=!1,t=new en(t));e:for(;++s<h;){var w=e[s],x=n==null?w:n(w);if(w=r||w!==0?w:0,l&&x===x){for(var b=y;b--;)if(t[b]===x)continue e;d.push(w)}else u(t,x,r)||d.push(w)}return d}var Nt=eo(ut),Fa=eo(Mi,!0);function zl(e,t){var n=!0;return Nt(e,function(r,s,u){return n=!!t(r,s,u),n}),n}function br(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=W(n),n<0&&(n=-n>s?0:s+n),r=r===i||r>s?s:W(r),r<0&&(r+=s),r=n>r?0:Ko(r);n<r;)e[n++]=t;return e}function Ia(e,t){var n=[];return Nt(e,function(r,s,u){t(r,s,u)&&n.push(r)}),n}function we(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?we(h,t-1,n,r,s):Lt(s,h):r||(s[s.length]=h)}return s}var Ui=to(),Ra=to(!0);function ut(e,t){return e&&Ui(e,t,_e)}function Mi(e,t){return e&&Ra(e,t,_e)}function Cr(e,t){return Ot(t,function(n){return yt(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 Pa(e,t,n){var r=t(e);return N(e)?r:Lt(r,n(e))}function Ee(e){return e==null?e===i?si:ii:Qt&&Qt in ne(e)?Pf(e):Gf(e)}function Ni(e,t){return e>t}function Yl(e,t){return e!=null&&V.call(e,t)}function Zl(e,t){return e!=null&&t in ne(e)}function Xl(e,t,n){return e>=xe(t,n)&&e<ve(t,n)}function Di(e,t,n){for(var r=n?yi:or,s=e[0].length,u=e.length,l=u,h=m(u),d=1/0,y=[];l--;){var w=e[l];l&&t&&(w=ue(w,We(t))),d=xe(w.length,d),h[l]=!n&&(t||s>=120&&w.length>=120)?new en(l&&w):i}w=e[0];var x=-1,b=h[0];e:for(;++x<s&&y.length<d;){var T=w[x],L=t?t(T):T;if(T=n||T!==0?T:0,!(b?On(b,L):r(y,L,n))){for(l=u;--l;){var $=h[l];if(!($?On($,L):r(e[l],L,n)))continue e}b&&b.push(L),y.push(T)}}return y}function Ql(e,t,n,r){return ut(e,function(s,u,l){t(r,n(s),u,l)}),r}function Bn(e,t,n){t=Wt(t,e),e=yo(e,t);var r=e==null?e:e[lt(Qe(t))];return r==null?i:De(r,e,n)}function Oa(e){return fe(e)&&Ee(e)==Ft}function Vl(e){return fe(e)&&Ee(e)==Yt}function ef(e){return fe(e)&&Ee(e)==Kt}function kn(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,kn,s)}function tf(e,t,n,r,s,u){var l=N(e),h=N(t),d=l?un:Se(e),y=h?un:Se(t);d=d==Ft?tt:d,y=y==Ft?tt:y;var w=d==tt,x=y==tt,b=d==y;if(b&&Bt(e)){if(!Bt(t))return!1;l=!0,w=!1}if(b&&!w)return u||(u=new rt),l||En(e)?fo(e,t,n,r,s,u):If(e,t,d,n,r,s,u);if(!(n&ce)){var T=w&&V.call(e,"__wrapped__"),L=x&&V.call(t,"__wrapped__");if(T||L){var $=T?e.value():e,U=L?t.value():t;return u||(u=new rt),s($,U,n,r,u)}}return b?(u||(u=new rt),Rf(e,t,n,r,s,u)):!1}function nf(e){return fe(e)&&Se(e)==Me}function Wi(e,t,n,r){var s=n.length,u=s,l=!r;if(e==null)return!u;for(e=ne(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],y=e[d],w=h[1];if(l&&h[2]){if(y===i&&!(d in e))return!1}else{var x=new rt;if(r)var b=r(y,w,d,e,t,x);if(!(b===i?kn(w,y,ce|Le,r,x):b))return!1}}return!0}function La(e){if(!le(e)||$f(e))return!1;var t=yt(e)?nl:Ku;return t.test(sn(e))}function rf(e){return fe(e)&&Ee(e)==It}function sf(e){return fe(e)&&Se(e)==Ne}function af(e){return fe(e)&&jr(e.length)&&!!oe[Ee(e)]}function Ua(e){return typeof e=="function"?e:e==null?Oe:typeof e=="object"?N(e)?Da(e[0],e[1]):Na(e):ru(e)}function $i(e){if(!Gn(e))return ul(e);var t=[];for(var n in ne(e))V.call(e,n)&&n!="constructor"&&t.push(n);return t}function of(e){if(!le(e))return jf(e);var t=Gn(e),n=[];for(var r in e)r=="constructor"&&(t||!V.call(e,r))||n.push(r);return n}function Bi(e,t){return e<t}function Ma(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 Na(e){var t=ts(e);return t.length==1&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||Wi(n,e,t)}}function Da(e,t){return rs(e)&&mo(t)?vo(lt(e),t):function(n){var r=ps(n,e);return r===i&&r===t?ds(n,e):kn(t,r,ce|Le)}}function Tr(e,t,n,r,s){e!==t&&Ui(t,function(u,l){if(s||(s=new rt),le(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),y=l.get(d);if(y){Oi(e,n,y);return}var w=u?u(h,d,n+"",e,t,l):i,x=w===i;if(x){var b=N(d),T=!b&&Bt(d),L=!b&&!T&&En(d);w=d,b||T||L?N(h)?w=h:he(h)?w=Ie(h):T?(x=!1,w=Ya(d,!0)):L?(x=!1,w=Za(d,!0)):w=[]:Kn(d)||an(d)?(w=h,an(h)?w=zo(h):(!le(h)||yt(h))&&(w=go(d))):x=!1}x&&(l.set(d,w),s(w,d,r,u,l),l.delete(d)),Oi(e,n,w)}function Wa(e,t){var n=e.length;if(n)return t+=t<0?n:0,_t(t,n)?e[t]:i}function $a(e,t,n){t.length?t=ue(t,function(u){return N(u)?function(l){return nn(l,u.length===1?u[0]:u)}:u}):t=[Oe];var r=-1;t=ue(t,We(R()));var s=Ma(e,function(u,l,h){var d=ue(t,function(y){return y(u)});return{criteria:d,index:++r,value:u}});return Uc(s,function(u,l){return xf(u,l,n)})}function cf(e,t){return Ba(e,t,function(n,r){return ds(e,r)})}function Ba(e,t,n){for(var r=-1,s=t.length,u={};++r<s;){var l=t[r],h=nn(e,l);n(h,l)&&qn(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=ue(e,We(n)));++u<l;)for(var d=0,y=t[u],w=n?n(y):y;(d=s(h,w,d,r))>-1;)h!==e&&vr.call(h,d,1),vr.call(e,d,1);return e}function ka(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)?vr.call(e,s,1):Hi(e,s)}}return e}function qi(e,t){return e+wr(xa()*(t-e+1))}function ff(e,t,n,r){for(var s=-1,u=ve(yr((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=wr(t/2),t&&(e+=e);while(t);return n}function B(e,t){return as(_o(e,t,Oe),e+"")}function hf(e){return Ea(bn(e))}function pf(e,t){var n=bn(e);return Dr(n,tn(t,0,n.length))}function qn(e,t,n,r){if(!le(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]),y=n;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(s!=l){var w=h[d];y=r?r(w,d,h):i,y===i&&(y=le(w)?w:_t(t[s+1])?[]:{})}Wn(h,d,y),h=h[d]}return e}var qa=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 Dr(bn(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),y=t===i;s<u;){var w=wr((s+u)/2),x=n(e[w]),b=x!==i,T=x===null,L=x===x,$=Be(x);if(l)var U=r||L;else y?U=L&&(r||b):h?U=L&&b&&(r||!T):d?U=L&&b&&!T&&(r||!$):T||$?U=!1:U=r?x<=t:x<t;U?s=w+1:u=w}return xe(u,Vr)}function ja(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 Ga(e){return typeof e=="number"?e:Be(e)?on:+e}function $e(e){if(typeof e=="string")return e;if(N(e))return ue(e,$e)+"";if(Be(e))return Sa?Sa.call(e):"";var t=e+"";return t=="0"&&1/e==-at?"-0":t}function Dt(e,t,n){var r=-1,s=or,u=e.length,l=!0,h=[],d=h;if(n)l=!1,s=yi;else if(u>=g){var y=t?null:Tf(e);if(y)return cr(y);l=!1,s=On,d=new en}else d=t?[]:h;e:for(;++r<u;){var w=e[r],x=t?t(w):w;if(w=n||w!==0?w:0,l&&x===x){for(var b=d.length;b--;)if(d[b]===x)continue e;t&&d.push(x),h.push(w)}else s(d,x,n)||(d!==h&&d.push(x),h.push(w))}return h}function Hi(e,t){return t=Wt(t,e),e=yo(e,t),e==null||delete e[lt(Qe(t))]}function Ha(e,t,n,r){return qn(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 Ka(e,t){var n=e;return n instanceof j&&(n=n.value()),wi(t,function(r,s){return s.func.apply(s.thisArg,Lt([r],s.args))},n)}function Ki(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]=$n(u[s]||l,e[h],t,n));return Dt(we(u,1),t,n)}function za(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 N(e)?e:rs(e,t)?[e]:Ao(Q(e))}var vf=B;function $t(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:Xe(e,t,n)}var Ja=rl||function(e){return ye.clearTimeout(e)};function Ya(e,t){if(t)return e.slice();var n=e.length,r=ma?ma(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 yf(e){var t=new e.constructor(e.source,Os.exec(e));return t.lastIndex=e.lastIndex,t}function wf(e){return Dn?ne(Dn.call(e)):{}}function Za(e,t){var n=t?Yi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Xa(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,y=Be(t);if(!h&&!y&&!u&&e>t||u&&l&&d&&!h&&!y||r&&l&&d||!n&&d||!s)return 1;if(!r&&!u&&!y&&e<t||y&&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=Xa(s[r],u[r]);if(d){if(r>=h)return d;var y=n[r];return d*(y=="desc"?-1:1)}}return e.index-t.index}function Qa(e,t,n,r){for(var s=-1,u=e.length,l=n.length,h=-1,d=t.length,y=ve(u-l,0),w=m(d+y),x=!r;++h<d;)w[h]=t[h];for(;++s<l;)(x||s<u)&&(w[n[s]]=e[s]);for(;y--;)w[h++]=e[s++];return w}function Va(e,t,n,r){for(var s=-1,u=e.length,l=-1,h=n.length,d=-1,y=t.length,w=ve(u-h,0),x=m(w+y),b=!r;++s<w;)x[s]=e[s];for(var T=s;++d<y;)x[T+d]=t[d];for(;++l<h;)(b||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?gt(n,h,d):Wn(n,h,d)}return n}function Sf(e,t){return ct(e,ns(e),t)}function Af(e,t){return ct(e,ho(e),t)}function Rr(e,t){return function(n,r){var s=N(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&&be(n[0],n[1],l)&&(u=s<3?i:u,s=1),t=ne(t);++r<s;){var h=n[r];h&&e(t,h,r,u)}return t})}function eo(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=ne(n);(t?u--:++u<s)&&r(l[u],u,l)!==!1;);return n}}function to(e){return function(t,n,r){for(var s=-1,u=ne(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&de,s=jn(e);function u(){var l=this&&this!==ye&&this instanceof u?s:e;return l.apply(r?n:this,arguments)}return u}function no(e){return function(t){t=Q(t);var n=dn(t)?nt(t):i,r=n?n[0]:t.charAt(0),s=n?$t(n,1).join(""):t.slice(1);return r[e]()+s}}function Sn(e){return function(t){return wi(tu(eu(t).replace(pc,"")),e,"")}}function jn(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=wn(e.prototype),r=e.apply(n,t);return le(r)?r:n}}function bf(e,t,n){var r=jn(e);function s(){for(var u=arguments.length,l=m(u),h=u,d=An(s);h--;)l[h]=arguments[h];var y=u<3&&l[0]!==d&&l[u-1]!==d?[]:Ut(l,d);if(u-=y.length,u<n)return oo(e,t,Pr,s.placeholder,i,l,y,i,i,n-u);var w=this&&this!==ye&&this instanceof s?r:e;return De(w,this,l)}return s}function ro(e){return function(t,n,r){var s=ne(t);if(!Re(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 io(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&&Mr(u)=="wrapper")var l=new Ye([],!0)}for(r=l?r:n;++r<n;){u=t[r];var h=Mr(u),d=h=="wrapper"?es(u):i;d&&is(d[0])&&d[1]==(ae|Te|X|Fe)&&!d[4].length&&d[9]==1?l=l[Mr(d[0])].apply(l,d[3]):l=u.length==1&&is(u)?l[h]():l.thru(u)}return function(){var y=arguments,w=y[0];if(l&&y.length==1&&N(w))return l.plant(w).value();for(var x=0,b=n?t[x].apply(this,y):w;++x<n;)b=t[x].call(this,b);return b}})}function Pr(e,t,n,r,s,u,l,h,d,y){var w=t&ae,x=t&de,b=t&Ue,T=t&(Te|F),L=t&re,$=b?i:jn(e);function U(){for(var q=arguments.length,H=m(q),ke=q;ke--;)H[ke]=arguments[ke];if(T)var Ce=An(U),qe=Nc(H,Ce);if(r&&(H=Qa(H,r,s,T)),u&&(H=Va(H,u,l,T)),q-=qe,T&&q<y){var pe=Ut(H,Ce);return oo(e,t,Pr,U.placeholder,n,H,pe,h,d,y-q)}var st=x?n:this,xt=b?st[e]:e;return q=H.length,h?H=Hf(H,h):L&&q>1&&H.reverse(),w&&d<q&&(H.length=d),this&&this!==ye&&this instanceof U&&(xt=$||jn(xt)),xt.apply(st,H)}return U}function so(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=Ga(n),r=Ga(r)),s=e(n,r)}return s}}function Zi(e){return vt(function(t){return t=ue(t,We(R())),B(function(n){var r=this;return e(t,function(s){return De(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,yr(e/gn(t)));return dn(t)?$t(nt(r),0,e).join(""):r.slice(0,e)}function Cf(e,t,n,r){var s=t&de,u=jn(e);function l(){for(var h=-1,d=arguments.length,y=-1,w=r.length,x=m(w+d),b=this&&this!==ye&&this instanceof l?u:e;++y<w;)x[y]=r[y];for(;d--;)x[y++]=arguments[++h];return De(b,s?n:this,x)}return l}function ao(e){return function(t,n,r){return r&&typeof r!="number"&&be(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 Ur(e){return function(t,n){return typeof t=="string"&&typeof n=="string"||(t=Ve(t),n=Ve(n)),e(t,n)}}function oo(e,t,n,r,s,u,l,h,d,y){var w=t&Te,x=w?l:i,b=w?i:l,T=w?u:i,L=w?i:u;t|=w?X:z,t&=~(w?z:X),t&Ct||(t&=-4);var $=[e,t,s,T,x,L,b,h,d,y],U=n.apply(i,$);return is(e)&&wo(U,$),U.placeholder=r,xo(U,e,t)}function Xi(e){var t=me[e];return function(n,r){if(n=Ve(n),r=r==null?0:xe(W(r),292),r&&wa(n)){var s=(Q(n)+"e").split("e"),u=t(s[0]+"e"+(+s[1]+r));return s=(Q(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)}:ys;function uo(e){return function(t){var n=Se(t);return n==Me?Ti(t):n==Ne?jc(t):Mc(t,e(t))}}function mt(e,t,n,r,s,u,l,h){var d=t&Ue;if(!d&&typeof e!="function")throw new Je(S);var y=r?r.length:0;if(y||(t&=-97,r=s=i),l=l===i?l:ve(W(l),0),h=h===i?h:W(h),y-=s?s.length:0,t&z){var w=r,x=s;r=s=i}var b=d?i:es(e),T=[e,t,n,r,s,w,x,u,l,h];if(b&&qf(T,b),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]-y,0),!h&&t&(Te|F)&&(t&=-25),!t||t==de)var L=Ef(e,t,n);else t==Te||t==F?L=bf(e,t,h):(t==X||t==(de|X))&&!s.length?L=Cf(e,t,n,r):L=Pr.apply(i,T);var $=b?qa:wo;return xo($(L,T),e,t)}function co(e,t,n,r){return e===i||it(e,vn[n])&&!V.call(r,n)?t:e}function lo(e,t,n,r,s,u){return le(e)&&le(t)&&(u.set(t,e),Tr(e,t,i,lo,u),u.delete(t)),e}function Ff(e){return Kn(e)?i:e}function fo(e,t,n,r,s,u){var l=n&ce,h=e.length,d=t.length;if(h!=d&&!(l&&d>h))return!1;var y=u.get(e),w=u.get(t);if(y&&w)return y==t&&w==e;var x=-1,b=!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 U=l?r($,L,x,t,e,u):r(L,$,x,e,t,u);if(U!==i){if(U)continue;b=!1;break}if(T){if(!xi(t,function(q,H){if(!On(T,H)&&(L===q||s(L,q,n,r,u)))return T.push(H)})){b=!1;break}}else if(!(L===$||s(L,$,n,r,u))){b=!1;break}}return u.delete(e),u.delete(t),b}function If(e,t,n,r,s,u,l){switch(n){case Pt: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 It:case Jt:return e==t+"";case Me:var h=Ti;case Ne:var d=r&ce;if(h||(h=cr),e.size!=t.size&&!d)return!1;var y=l.get(e);if(y)return y==t;r|=Le,l.set(e,t);var w=fo(h(e),h(t),r,s,u,l);return l.delete(e),w;case fn:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}function Rf(e,t,n,r,s,u){var l=n&ce,h=Qi(e),d=h.length,y=Qi(t),w=y.length;if(d!=w&&!l)return!1;for(var x=d;x--;){var b=h[x];if(!(l?b in t:V.call(t,b)))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 U=l;++x<d;){b=h[x];var q=e[b],H=t[b];if(r)var ke=l?r(H,q,b,t,e,u):r(q,H,b,e,t,u);if(!(ke===i?q===H||s(q,H,n,r,u):ke)){$=!1;break}U||(U=b=="constructor")}if($&&!U){var Ce=e.constructor,qe=t.constructor;Ce!=qe&&"constructor"in e&&"constructor"in t&&!(typeof Ce=="function"&&Ce instanceof Ce&&typeof qe=="function"&&qe instanceof qe)&&($=!1)}return u.delete(e),u.delete(t),$}function vt(e){return as(_o(e,i,To),e+"")}function Qi(e){return Pa(e,_e,ns)}function Vi(e){return Pa(e,Pe,ho)}var es=xr?function(e){return xr.get(e)}:ys;function Mr(e){for(var t=e.name+"",n=yn[t],r=V.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 An(e){var t=V.call(o,"placeholder")?o:e;return t.placeholder}function R(){var e=o.iteratee||vs;return e=e===vs?Ua:e,arguments.length?e(arguments[0],arguments[1]):e}function Nr(e,t){var n=e.__data__;return Wf(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ts(e){for(var t=_e(e),n=t.length;n--;){var r=t[n],s=e[r];t[n]=[r,s,mo(s)]}return t}function rn(e,t){var n=Bc(e,t);return La(n)?n:i}function Pf(e){var t=V.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=ne(e),Ot(Ii(e),function(t){return _a.call(e,t)}))}:ws,ho=Ii?function(e){for(var t=[];e;)Lt(t,ns(e)),e=mr(e);return t}:ws,Se=Ee;(Ri&&Se(new Ri(new ArrayBuffer(1)))!=Pt||Un&&Se(new Un)!=Me||Pi&&Se(Pi.resolve())!=Rn||_n&&Se(new _n)!=Ne||Mn&&Se(new Mn)!=Rt)&&(Se=function(e){var t=Ee(e),n=t==tt?e.constructor:i,r=n?sn(n):"";if(r)switch(r){case hl:return Pt;case pl:return Me;case dl:return Rn;case gl:return Ne;case ml:return Rt}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=xe(t,e+l);break;case"takeRight":e=ve(e,t-l);break}}return{start:e,end:t}}function Lf(e){var t=e.match(Wu);return t?t[1].split($u):[]}function po(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)&&_t(l,s)&&(N(e)||an(e)))}function Uf(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&V.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function go(e){return typeof e.constructor=="function"&&!Gn(e)?wn(mr(e)):{}}function Mf(e,t,n){var r=e.constructor;switch(t){case Yt:return Yi(e);case Ht:case Kt:return new r(+e);case Pt:return _f(e,n);case O:case ge:case ot:case rr:case Zt:case Pn:case oi:case ui:case ci:return Za(e,n);case Me:return new r;case zt:case Jt:return new r(e);case It:return yf(e);case Ne:return new r;case fn:return wf(e)}}function Nf(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,`{
|
|
382
209
|
/* [wrapped with `+t+`] */
|
|
383
|
-
`)}function Wd(e){return Q(e)||Mn(e)||!!(Oo&&e&&e[Oo])}function Vt(e,t){var s=typeof e;return t=t??Tt,!!t&&(s=="number"||s!="symbol"&&Zl.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e,t,s){if(!Ae(s))return!1;var a=typeof t;return(a=="number"?ze(s)&&Vt(t,s.length):a=="string"&&t in s)?At(s[t],e):!1}function na(e,t){if(Q(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||nt(e)?!0:Ml.test(e)||!Ul.test(e)||t!=null&&e in ye(t)}function Gd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ia(e){var t=br(e),s=l[t];if(typeof s!="function"||!(t in te.prototype))return!1;if(e===s)return!0;var a=Zs(s);return!!a&&e===a[0]}function Vd(e){return!!Ao&&Ao in e}var qd=ir?qt:xa;function Li(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||Kn;return e===s}function Au(e){return e===e&&!Ae(e)}function Iu(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==i||e in ye(s))}}function Jd(e){var t=Fr(e,function(a){return s.size===b&&s.clear(),a}),s=t.cache;return t}function zd(e,t){var s=e[1],a=t[1],c=s|a,p=c<(ae|me|ce),d=a==ce&&s==xe||a==ce&&s==qe&&e[7].length<=t[8]||a==(ce|qe)&&t[7].length<=t[8]&&s==xe;if(!(p||d))return e;a&ae&&(e[2]=t[2],c|=s&ae?0:Ye);var h=t[3];if(h){var y=e[3];e[3]=y?uu(y,h,t[4]):h,e[4]=y?cn(e[3],O):t[4]}return h=t[5],h&&(y=e[5],e[5]=y?cu(y,h,t[6]):h,e[6]=y?cn(e[5],O):t[6]),h=t[7],h&&(e[7]=h),a&ce&&(e[8]=e[8]==null?t[8]:$e(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}function Qd(e){var t=[];if(e!=null)for(var s in ye(e))t.push(s);return t}function Hd(e){return sr.call(e)}function bu(e,t,s){return t=Fe(t===i?e.length-1:t,0),function(){for(var a=arguments,c=-1,p=Fe(a.length-t,0),d=_(p);++c<p;)d[c]=a[t+c];c=-1;for(var h=_(t+1);++c<t;)h[c]=a[c];return h[t]=s(d),Ze(e,this,h)}}function Nu(e,t){return t.length<2?e:Pn(e,ft(t,0,-1))}function Yd(e,t){for(var s=e.length,a=$e(t.length,s),c=Je(e);a--;){var p=t[a];e[a]=Vt(p,s)?c[p]:i}return e}function ra(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Ou=Cu(Ko),Fi=fp||function(e,t){return Ue.setTimeout(e,t)},sa=Cu(_d);function Ru(e,t,s){var a=t+"";return sa(e,jd(a,Xd(Md(a),s)))}function Cu(e){var t=0,s=0;return function(){var a=gp(),c=tn-(a-s);if(s=a,c>0){if(++t>=xt)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Or(e,t){var s=-1,a=e.length,c=a-1;for(t=t===i?a:t;++s<t;){var p=js(s,c),d=e[p];e[p]=e[s],e[s]=d}return e.length=t,e}var Lu=Jd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace($l,function(s,a,c,p){t.push(c?p.replace(zl,"$1"):a||s)}),t});function Dt(e){if(typeof e=="string"||nt(e))return e;var t=e+"";return t=="0"&&1/e==-Rt?"-0":t}function Un(e){if(e!=null){try{return rr.call(e)}catch{}try{return e+""}catch{}}return""}function Xd(e,t){return ot(es,function(s){var a="_."+s[0];t&s[1]&&!Zi(e,a)&&e.push(a)}),e.sort()}function Fu(e){if(e instanceof te)return e.clone();var t=new ct(e.__wrapped__,e.__chain__);return t.__actions__=Je(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Kd(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Fe(Y(t),0);var a=e==null?0:e.length;if(!a||t<1)return[];for(var c=0,p=0,d=_(fr(a/t));c<a;)d[p++]=ft(e,c,c+=t);return d}function Zd(e){for(var t=-1,s=e==null?0:e.length,a=0,c=[];++t<s;){var p=e[t];p&&(c[a++]=p)}return c}function eh(){var e=arguments.length;if(!e)return[];for(var t=_(e-1),s=arguments[0],a=e;a--;)t[a-1]=arguments[a];return un(Q(s)?Je(s):[s],Me(t,1))}var th=K(function(e,t){return be(e)?bi(e,Me(t,1,be,!0)):[]}),nh=K(function(e,t){var s=pt(t);return be(s)&&(s=i),be(e)?bi(e,Me(t,1,be,!0),j(s,2)):[]}),ih=K(function(e,t){var s=pt(t);return be(s)&&(s=i),be(e)?bi(e,Me(t,1,be,!0),i,s):[]});function rh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),ft(e,t<0?0:t,a)):[]}function sh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,0,t<0?0:t)):[]}function ah(e,t){return e&&e.length?Tr(e,j(t,3),!0,!0):[]}function oh(e,t){return e&&e.length?Tr(e,j(t,3),!0):[]}function uh(e,t,s,a){var c=e==null?0:e.length;return c?(s&&typeof s!="number"&&Ge(e,t,s)&&(s=0,a=c),ed(e,t,s,a)):[]}function Du(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=s==null?0:Y(s);return c<0&&(c=Fe(a+c,0)),er(e,j(t,3),c)}function Pu(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=a-1;return s!==i&&(c=Y(s),c=s<0?Fe(a+c,0):$e(c,a-1)),er(e,j(t,3),c,!0)}function ku(e){var t=e==null?0:e.length;return t?Me(e,1):[]}function ch(e){var t=e==null?0:e.length;return t?Me(e,Rt):[]}function lh(e,t){var s=e==null?0:e.length;return s?(t=t===i?1:Y(t),Me(e,t)):[]}function fh(e){for(var t=-1,s=e==null?0:e.length,a={};++t<s;){var c=e[t];a[c[0]]=c[1]}return a}function Uu(e){return e&&e.length?e[0]:i}function ph(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=s==null?0:Y(s);return c<0&&(c=Fe(a+c,0)),Qn(e,t,c)}function dh(e){var t=e==null?0:e.length;return t?ft(e,0,-1):[]}var hh=K(function(e){var t=Ee(e,Js);return t.length&&t[0]===e[0]?ks(t):[]}),gh=K(function(e){var t=pt(e),s=Ee(e,Js);return t===pt(s)?t=i:s.pop(),s.length&&s[0]===e[0]?ks(s,j(t,2)):[]}),mh=K(function(e){var t=pt(e),s=Ee(e,Js);return t=typeof t=="function"?t:i,t&&s.pop(),s.length&&s[0]===e[0]?ks(s,i,t):[]});function yh(e,t){return e==null?"":dp.call(e,t)}function pt(e){var t=e==null?0:e.length;return t?e[t-1]:i}function vh(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=a;return s!==i&&(c=Y(s),c=c<0?Fe(a+c,0):$e(c,a-1)),t===t?Xf(e,t,c):er(e,yo,c,!0)}function _h(e,t){return e&&e.length?Qo(e,Y(t)):i}var xh=K(Mu);function Mu(e,t){return e&&e.length&&t&&t.length?Bs(e,t):e}function Th(e,t,s){return e&&e.length&&t&&t.length?Bs(e,t,j(s,2)):e}function wh(e,t,s){return e&&e.length&&t&&t.length?Bs(e,t,i,s):e}var Eh=Gt(function(e,t){var s=e==null?0:e.length,a=Ls(e,t);return Xo(e,Ee(t,function(c){return Vt(c,s)?+c:c}).sort(ou)),a});function Sh(e,t){var s=[];if(!(e&&e.length))return s;var a=-1,c=[],p=e.length;for(t=j(t,3);++a<p;){var d=e[a];t(d,a,e)&&(s.push(d),c.push(a))}return Xo(e,c),s}function aa(e){return e==null?e:yp.call(e)}function Ah(e,t,s){var a=e==null?0:e.length;return a?(s&&typeof s!="number"&&Ge(e,t,s)?(t=0,s=a):(t=t==null?0:Y(t),s=s===i?a:Y(s)),ft(e,t,s)):[]}function Ih(e,t){return xr(e,t)}function bh(e,t,s){return Gs(e,t,j(s,2))}function Nh(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t);if(a<s&&At(e[a],t))return a}return-1}function Oh(e,t){return xr(e,t,!0)}function Rh(e,t,s){return Gs(e,t,j(s,2),!0)}function Ch(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t,!0)-1;if(At(e[a],t))return a}return-1}function Lh(e){return e&&e.length?Zo(e):[]}function Fh(e,t){return e&&e.length?Zo(e,j(t,2)):[]}function Dh(e){var t=e==null?0:e.length;return t?ft(e,1,t):[]}function Ph(e,t,s){return e&&e.length?(t=s||t===i?1:Y(t),ft(e,0,t<0?0:t)):[]}function kh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,t<0?0:t,a)):[]}function Uh(e,t){return e&&e.length?Tr(e,j(t,3),!1,!0):[]}function Mh(e,t){return e&&e.length?Tr(e,j(t,3)):[]}var $h=K(function(e){return pn(Me(e,1,be,!0))}),Bh=K(function(e){var t=pt(e);return be(t)&&(t=i),pn(Me(e,1,be,!0),j(t,2))}),jh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,pn(Me(e,1,be,!0),i,t)});function Wh(e){return e&&e.length?pn(e):[]}function Gh(e,t){return e&&e.length?pn(e,j(t,2)):[]}function Vh(e,t){return t=typeof t=="function"?t:i,e&&e.length?pn(e,i,t):[]}function oa(e){if(!(e&&e.length))return[];var t=0;return e=on(e,function(s){if(be(s))return t=Fe(s.length,t),!0}),Ss(t,function(s){return Ee(e,Ts(s))})}function $u(e,t){if(!(e&&e.length))return[];var s=oa(e);return t==null?s:Ee(s,function(a){return Ze(t,i,a)})}var qh=K(function(e,t){return be(e)?bi(e,t):[]}),Jh=K(function(e){return qs(on(e,be))}),zh=K(function(e){var t=pt(e);return be(t)&&(t=i),qs(on(e,be),j(t,2))}),Qh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,qs(on(e,be),i,t)}),Hh=K(oa);function Yh(e,t){return iu(e||[],t||[],Ii)}function Xh(e,t){return iu(e||[],t||[],Ri)}var Kh=K(function(e){var t=e.length,s=t>1?e[t-1]:i;return s=typeof s=="function"?(e.pop(),s):i,$u(e,s)});function Bu(e){var t=l(e);return t.__chain__=!0,t}function Zh(e,t){return t(e),e}function Rr(e,t){return t(e)}var eg=Gt(function(e){var t=e.length,s=t?e[0]:0,a=this.__wrapped__,c=function(p){return Ls(p,e)};return t>1||this.__actions__.length||!(a instanceof te)||!Vt(s)?this.thru(c):(a=a.slice(s,+s+(t?1:0)),a.__actions__.push({func:Rr,args:[c],thisArg:i}),new ct(a,this.__chain__).thru(function(p){return t&&!p.length&&p.push(i),p}))});function tg(){return Bu(this)}function ng(){return new ct(this.value(),this.__chain__)}function ig(){this.__values__===i&&(this.__values__=ec(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function rg(){return this}function sg(e){for(var t,s=this;s instanceof gr;){var a=Fu(s);a.__index__=0,a.__values__=i,t?c.__wrapped__=a:t=a;var c=a;s=s.__wrapped__}return c.__wrapped__=e,t}function ag(){var e=this.__wrapped__;if(e instanceof te){var t=e;return this.__actions__.length&&(t=new te(this)),t=t.reverse(),t.__actions__.push({func:Rr,args:[aa],thisArg:i}),new ct(t,this.__chain__)}return this.thru(aa)}function og(){return nu(this.__wrapped__,this.__actions__)}var ug=wr(function(e,t,s){pe.call(e,s)?++e[s]:jt(e,s,1)});function cg(e,t,s){var a=Q(e)?go:Zp;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}function lg(e,t){var s=Q(e)?on:$o;return s(e,j(t,3))}var fg=du(Du),pg=du(Pu);function dg(e,t){return Me(Cr(e,t),1)}function hg(e,t){return Me(Cr(e,t),Rt)}function gg(e,t,s){return s=s===i?1:Y(s),Me(Cr(e,t),s)}function ju(e,t){var s=Q(e)?ot:fn;return s(e,j(t,3))}function Wu(e,t){var s=Q(e)?Df:Mo;return s(e,j(t,3))}var mg=wr(function(e,t,s){pe.call(e,s)?e[s].push(t):jt(e,s,[t])});function yg(e,t,s,a){e=ze(e)?e:ai(e),s=s&&!a?Y(s):0;var c=e.length;return s<0&&(s=Fe(c+s,0)),kr(e)?s<=c&&e.indexOf(t,s)>-1:!!c&&Qn(e,t,s)>-1}var vg=K(function(e,t,s){var a=-1,c=typeof t=="function",p=ze(e)?_(e.length):[];return fn(e,function(d){p[++a]=c?Ze(t,d,s):Ni(d,t,s)}),p}),_g=wr(function(e,t,s){jt(e,s,t)});function Cr(e,t){var s=Q(e)?Ee:qo;return s(e,j(t,3))}function xg(e,t,s,a){return e==null?[]:(Q(t)||(t=t==null?[]:[t]),s=a?i:s,Q(s)||(s=s==null?[]:[s]),Ho(e,t,s))}var Tg=wr(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function wg(e,t,s){var a=Q(e)?_s:_o,c=arguments.length<3;return a(e,j(t,4),s,c,fn)}function Eg(e,t,s){var a=Q(e)?Pf:_o,c=arguments.length<3;return a(e,j(t,4),s,c,Mo)}function Sg(e,t){var s=Q(e)?on:$o;return s(e,Dr(j(t,3)))}function Ag(e){var t=Q(e)?Do:yd;return t(e)}function Ig(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Y(t);var a=Q(e)?Qp:vd;return a(e,t)}function bg(e){var t=Q(e)?Hp:xd;return t(e)}function Ng(e){if(e==null)return 0;if(ze(e))return kr(e)?Yn(e):e.length;var t=Be(e);return t==Xe||t==Ke?e.size:Ms(e).length}function Og(e,t,s){var a=Q(e)?xs:Td;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}var Rg=K(function(e,t){if(e==null)return[];var s=t.length;return s>1&&Ge(e,t[0],t[1])?t=[]:s>2&&Ge(t[0],t[1],t[2])&&(t=[t[0]]),Ho(e,Me(t,1),[])}),Lr=lp||function(){return Ue.Date.now()};function Cg(e,t){if(typeof t!="function")throw new ut(g);return e=Y(e),function(){if(--e<1)return t.apply(this,arguments)}}function Gu(e,t,s){return t=s?i:t,t=e&&t==null?e.length:t,Wt(e,ce,i,i,i,i,t)}function Vu(e,t){var s;if(typeof t!="function")throw new ut(g);return e=Y(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=i),s}}var ua=K(function(e,t,s){var a=ae;if(s.length){var c=cn(s,ri(ua));a|=ee}return Wt(e,a,t,s,c)}),qu=K(function(e,t,s){var a=ae|me;if(s.length){var c=cn(s,ri(qu));a|=ee}return Wt(t,a,e,s,c)});function Ju(e,t,s){t=s?i:t;var a=Wt(e,xe,i,i,i,i,i,t);return a.placeholder=Ju.placeholder,a}function zu(e,t,s){t=s?i:t;var a=Wt(e,L,i,i,i,i,i,t);return a.placeholder=zu.placeholder,a}function Qu(e,t,s){var a,c,p,d,h,y,E=0,S=!1,I=!1,C=!0;if(typeof e!="function")throw new ut(g);t=dt(t)||0,Ae(s)&&(S=!!s.leading,I="maxWait"in s,p=I?Fe(dt(s.maxWait)||0,t):p,C="trailing"in s?!!s.trailing:C);function U(Ne){var It=a,zt=c;return a=c=i,E=Ne,d=e.apply(zt,It),d}function G(Ne){return E=Ne,h=Fi(Z,t),S?U(Ne):d}function X(Ne){var It=Ne-y,zt=Ne-E,dc=t-It;return I?$e(dc,p-zt):dc}function V(Ne){var It=Ne-y,zt=Ne-E;return y===i||It>=t||It<0||I&&zt>=p}function Z(){var Ne=Lr();if(V(Ne))return ie(Ne);h=Fi(Z,X(Ne))}function ie(Ne){return h=i,C&&a?U(Ne):(a=c=i,d)}function it(){h!==i&&ru(h),E=0,a=y=c=h=i}function Ve(){return h===i?d:ie(Lr())}function rt(){var Ne=Lr(),It=V(Ne);if(a=arguments,c=this,y=Ne,It){if(h===i)return G(y);if(I)return ru(h),h=Fi(Z,t),U(y)}return h===i&&(h=Fi(Z,t)),d}return rt.cancel=it,rt.flush=Ve,rt}var Lg=K(function(e,t){return Uo(e,1,t)}),Fg=K(function(e,t,s){return Uo(e,dt(t)||0,s)});function Dg(e){return Wt(e,x)}function Fr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new ut(g);var s=function(){var a=arguments,c=t?t.apply(this,a):a[0],p=s.cache;if(p.has(c))return p.get(c);var d=e.apply(this,a);return s.cache=p.set(c,d)||p,d};return s.cache=new(Fr.Cache||Bt),s}Fr.Cache=Bt;function Dr(e){if(typeof e!="function")throw new ut(g);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Pg(e){return Vu(2,e)}var kg=wd(function(e,t){t=t.length==1&&Q(t[0])?Ee(t[0],et(j())):Ee(Me(t,1),et(j()));var s=t.length;return K(function(a){for(var c=-1,p=$e(a.length,s);++c<p;)a[c]=t[c].call(this,a[c]);return Ze(e,this,a)})}),ca=K(function(e,t){var s=cn(t,ri(ca));return Wt(e,ee,i,t,s)}),Hu=K(function(e,t){var s=cn(t,ri(Hu));return Wt(e,H,i,t,s)}),Ug=Gt(function(e,t){return Wt(e,qe,i,i,i,t)});function Mg(e,t){if(typeof e!="function")throw new ut(g);return t=t===i?t:Y(t),K(e,t)}function $g(e,t){if(typeof e!="function")throw new ut(g);return t=t==null?0:Fe(Y(t),0),K(function(s){var a=s[t],c=hn(s,0,t);return a&&un(c,a),Ze(e,this,c)})}function Bg(e,t,s){var a=!0,c=!0;if(typeof e!="function")throw new ut(g);return Ae(s)&&(a="leading"in s?!!s.leading:a,c="trailing"in s?!!s.trailing:c),Qu(e,t,{leading:a,maxWait:t,trailing:c})}function jg(e){return Gu(e,1)}function Wg(e,t){return ca(zs(t),e)}function Gg(){if(!arguments.length)return[];var e=arguments[0];return Q(e)?e:[e]}function Vg(e){return lt(e,M)}function qg(e,t){return t=typeof t=="function"?t:i,lt(e,M,t)}function Jg(e){return lt(e,D|M)}function zg(e,t){return t=typeof t=="function"?t:i,lt(e,D|M,t)}function Qg(e,t){return t==null||ko(e,t,Pe(t))}function At(e,t){return e===t||e!==e&&t!==t}var Hg=Ir(Ps),Yg=Ir(function(e,t){return e>=t}),Mn=Wo(function(){return arguments}())?Wo:function(e){return Ie(e)&&pe.call(e,"callee")&&!No.call(e,"callee")},Q=_.isArray,Xg=uo?et(uo):sd;function ze(e){return e!=null&&Pr(e.length)&&!qt(e)}function be(e){return Ie(e)&&ze(e)}function Kg(e){return e===!0||e===!1||Ie(e)&&We(e)==Sn}var gn=pp||xa,Zg=co?et(co):ad;function em(e){return Ie(e)&&e.nodeType===1&&!Di(e)}function tm(e){if(e==null)return!0;if(ze(e)&&(Q(e)||typeof e=="string"||typeof e.splice=="function"||gn(e)||si(e)||Mn(e)))return!e.length;var t=Be(e);if(t==Xe||t==Ke)return!e.size;if(Li(e))return!Ms(e).length;for(var s in e)if(pe.call(e,s))return!1;return!0}function nm(e,t){return Oi(e,t)}function im(e,t,s){s=typeof s=="function"?s:i;var a=s?s(e,t):i;return a===i?Oi(e,t,i,s):!!a}function la(e){if(!Ie(e))return!1;var t=We(e);return t==Vn||t==ns||typeof e.message=="string"&&typeof e.name=="string"&&!Di(e)}function rm(e){return typeof e=="number"&&Ro(e)}function qt(e){if(!Ae(e))return!1;var t=We(e);return t==qn||t==zi||t==ts||t==Qi}function Yu(e){return typeof e=="number"&&e==Y(e)}function Pr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Tt}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ie(e){return e!=null&&typeof e=="object"}var Xu=lo?et(lo):ud;function sm(e,t){return e===t||Us(e,t,ea(t))}function am(e,t,s){return s=typeof s=="function"?s:i,Us(e,t,ea(t),s)}function om(e){return Ku(e)&&e!=+e}function um(e){if(qd(e))throw new z(f);return Go(e)}function cm(e){return e===null}function lm(e){return e==null}function Ku(e){return typeof e=="number"||Ie(e)&&We(e)==In}function Di(e){if(!Ie(e)||We(e)!=wt)return!1;var t=ur(e);if(t===null)return!0;var s=pe.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&rr.call(s)==ap}var fa=fo?et(fo):cd;function fm(e){return Yu(e)&&e>=-Tt&&e<=Tt}var Zu=po?et(po):ld;function kr(e){return typeof e=="string"||!Q(e)&&Ie(e)&&We(e)==bn}function nt(e){return typeof e=="symbol"||Ie(e)&&We(e)==Jn}var si=ho?et(ho):fd;function pm(e){return e===i}function dm(e){return Ie(e)&&Be(e)==sn}function hm(e){return Ie(e)&&We(e)==ss}var gm=Ir($s),mm=Ir(function(e,t){return e<=t});function ec(e){if(!e)return[];if(ze(e))return kr(e)?Et(e):Je(e);if(Ti&&e[Ti])return Qf(e[Ti]());var t=Be(e),s=t==Xe?Is:t==Ke?tr:ai;return s(e)}function Jt(e){if(!e)return e===0?e:0;if(e=dt(e),e===Rt||e===-Rt){var t=e<0?-1:1;return t*Xr}return e===e?e:0}function Y(e){var t=Jt(e),s=t%1;return t===t?s?t-s:t:0}function tc(e){return e?Dn(Y(e),0,st):0}function dt(e){if(typeof e=="number")return e;if(nt(e))return Wn;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=xo(e);var s=Yl.test(e);return s||Kl.test(e)?Cf(e.slice(2),s?2:8):Hl.test(e)?Wn:+e}function nc(e){return Ft(e,Qe(e))}function ym(e){return e?Dn(Y(e),-Tt,Tt):e===0?e:0}function le(e){return e==null?"":tt(e)}var vm=ni(function(e,t){if(Li(t)||ze(t)){Ft(t,Pe(t),e);return}for(var s in t)pe.call(t,s)&&Ii(e,s,t[s])}),ic=ni(function(e,t){Ft(t,Qe(t),e)}),Ur=ni(function(e,t,s,a){Ft(t,Qe(t),e,a)}),_m=ni(function(e,t,s,a){Ft(t,Pe(t),e,a)}),xm=Gt(Ls);function Tm(e,t){var s=ti(e);return t==null?s:Po(s,t)}var wm=K(function(e,t){e=ye(e);var s=-1,a=t.length,c=a>2?t[2]:i;for(c&&Ge(t[0],t[1],c)&&(a=1);++s<a;)for(var p=t[s],d=Qe(p),h=-1,y=d.length;++h<y;){var E=d[h],S=e[E];(S===i||At(S,Kn[E])&&!pe.call(e,E))&&(e[E]=p[E])}return e}),Em=K(function(e){return e.push(i,xu),Ze(rc,i,e)});function Sm(e,t){return mo(e,j(t,3),Lt)}function Am(e,t){return mo(e,j(t,3),Ds)}function Im(e,t){return e==null?e:Fs(e,j(t,3),Qe)}function bm(e,t){return e==null?e:Bo(e,j(t,3),Qe)}function Nm(e,t){return e&&Lt(e,j(t,3))}function Om(e,t){return e&&Ds(e,j(t,3))}function Rm(e){return e==null?[]:vr(e,Pe(e))}function Cm(e){return e==null?[]:vr(e,Qe(e))}function pa(e,t,s){var a=e==null?i:Pn(e,t);return a===i?s:a}function Lm(e,t){return e!=null&&Eu(e,t,td)}function da(e,t){return e!=null&&Eu(e,t,nd)}var Fm=gu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=sr.call(t)),e[t]=s},ga(He)),Dm=gu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=sr.call(t)),pe.call(e,t)?e[t].push(s):e[t]=[s]},j),Pm=K(Ni);function Pe(e){return ze(e)?Fo(e):Ms(e)}function Qe(e){return ze(e)?Fo(e,!0):pd(e)}function km(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){jt(s,t(a,c,p),a)}),s}function Um(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){jt(s,c,t(a,c,p))}),s}var Mm=ni(function(e,t,s){_r(e,t,s)}),rc=ni(function(e,t,s,a){_r(e,t,s,a)}),$m=Gt(function(e,t){var s={};if(e==null)return s;var a=!1;t=Ee(t,function(p){return p=dn(p,e),a||(a=p.length>1),p}),Ft(e,Ks(e),s),a&&(s=lt(s,D|P|M,Fd));for(var c=t.length;c--;)Vs(s,t[c]);return s});function Bm(e,t){return sc(e,Dr(j(t)))}var jm=Gt(function(e,t){return e==null?{}:hd(e,t)});function sc(e,t){if(e==null)return{};var s=Ee(Ks(e),function(a){return[a]});return t=j(t),Yo(e,s,function(a,c){return t(a,c[0])})}function Wm(e,t,s){t=dn(t,e);var a=-1,c=t.length;for(c||(c=1,e=i);++a<c;){var p=e==null?i:e[Dt(t[a])];p===i&&(a=c,p=s),e=qt(p)?p.call(e):p}return e}function Gm(e,t,s){return e==null?e:Ri(e,t,s)}function Vm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:Ri(e,t,s,a)}var ac=vu(Pe),oc=vu(Qe);function qm(e,t,s){var a=Q(e),c=a||gn(e)||si(e);if(t=j(t,4),s==null){var p=e&&e.constructor;c?s=a?new p:[]:Ae(e)?s=qt(p)?ti(ur(e)):{}:s={}}return(c?ot:Lt)(e,function(d,h,y){return t(s,d,h,y)}),s}function Jm(e,t){return e==null?!0:Vs(e,t)}function zm(e,t,s){return e==null?e:tu(e,t,zs(s))}function Qm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:tu(e,t,zs(s),a)}function ai(e){return e==null?[]:As(e,Pe(e))}function Hm(e){return e==null?[]:As(e,Qe(e))}function Ym(e,t,s){return s===i&&(s=t,t=i),s!==i&&(s=dt(s),s=s===s?s:0),t!==i&&(t=dt(t),t=t===t?t:0),Dn(dt(e),t,s)}function Xm(e,t,s){return t=Jt(t),s===i?(s=t,t=0):s=Jt(s),e=dt(e),id(e,t,s)}function Km(e,t,s){if(s&&typeof s!="boolean"&&Ge(e,t,s)&&(t=s=i),s===i&&(typeof t=="boolean"?(s=t,t=i):typeof e=="boolean"&&(s=e,e=i)),e===i&&t===i?(e=0,t=1):(e=Jt(e),t===i?(t=e,e=0):t=Jt(t)),e>t){var a=e;e=t,t=a}if(s||e%1||t%1){var c=Co();return $e(e+c*(t-e+Rf("1e-"+((c+"").length-1))),t)}return js(e,t)}var Zm=ii(function(e,t,s){return t=t.toLowerCase(),e+(s?uc(t):t)});function uc(e){return ha(le(e).toLowerCase())}function cc(e){return e=le(e),e&&e.replace(ef,Gf).replace(xf,"")}function e0(e,t,s){e=le(e),t=tt(t);var a=e.length;s=s===i?a:Dn(Y(s),0,a);var c=s;return s-=t.length,s>=0&&e.slice(s,c)==t}function t0(e){return e=le(e),e&&Dl.test(e)?e.replace($a,Vf):e}function n0(e){return e=le(e),e&&Bl.test(e)?e.replace(cs,"\\$&"):e}var i0=ii(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),r0=ii(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),s0=pu("toLowerCase");function a0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;if(!t||a>=t)return e;var c=(t-a)/2;return Ar(pr(c),s)+e+Ar(fr(c),s)}function o0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;return t&&a<t?e+Ar(t-a,s):e}function u0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;return t&&a<t?Ar(t-a,s)+e:e}function c0(e,t,s){return s||t==null?t=0:t&&(t=+t),mp(le(e).replace(ls,""),t||0)}function l0(e,t,s){return(s?Ge(e,t,s):t===i)?t=1:t=Y(t),Ws(le(e),t)}function f0(){var e=arguments,t=le(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var p0=ii(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});function d0(e,t,s){return s&&typeof s!="number"&&Ge(e,t,s)&&(t=s=i),s=s===i?st:s>>>0,s?(e=le(e),e&&(typeof t=="string"||t!=null&&!fa(t))&&(t=tt(t),!t&&Hn(e))?hn(Et(e),0,s):e.split(t,s)):[]}var h0=ii(function(e,t,s){return e+(s?" ":"")+ha(t)});function g0(e,t,s){return e=le(e),s=s==null?0:Dn(Y(s),0,e.length),t=tt(t),e.slice(s,s+t.length)==t}function m0(e,t,s){var a=l.templateSettings;s&&Ge(e,t,s)&&(t=i),e=le(e),t=Ur({},t,a,_u);var c=Ur({},t.imports,a.imports,_u),p=Pe(c),d=As(c,p),h,y,E=0,S=t.interpolate||Yi,I="__p += '",C=bs((t.escape||Yi).source+"|"+S.source+"|"+(S===Ba?Ql:Yi).source+"|"+(t.evaluate||Yi).source+"|$","g"),U="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Af+"]")+`
|
|
384
|
-
`;e.replace(
|
|
385
|
-
__e(`+
|
|
386
|
-
'`),
|
|
387
|
-
`+
|
|
388
|
-
__p += '`),
|
|
389
|
-
((__t = (`+
|
|
390
|
-
'`),
|
|
391
|
-
`;var
|
|
392
|
-
`+
|
|
210
|
+
`)}function Df(e){return N(e)||an(e)||!!(ya&&e&&e[ya])}function _t(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 be(e,t,n){if(!le(n))return!1;var r=typeof t;return(r=="number"?Re(n)&&_t(t,n.length):r=="string"&&t in n)?it(n[t],e):!1}function rs(e,t){if(N(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 ne(t)}function Wf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function is(e){var t=Mr(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!!ga&&ga in e}var Bf=fr?yt:xs;function Gn(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||vn;return e===n}function mo(e){return e===e&&!le(e)}function vo(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==i||e in ne(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|Ue|ae),l=r==ae&&n==Te||r==ae&&n==Fe&&e[7].length<=t[8]||r==(ae|Fe)&&t[7].length<=t[8]&&n==Te;if(!(u||l))return e;r&de&&(e[2]=t[2],s|=n&de?0:Ct);var h=t[3];if(h){var d=e[3];e[3]=d?Qa(d,h,t[4]):h,e[4]=d?Ut(e[3],J):t[4]}return h=t[5],h&&(d=e[5],e[5]=d?Va(d,h,t[6]):h,e[6]=d?Ut(e[5],J):t[6]),h=t[7],h&&(e[7]=h),r&ae&&(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 jf(e){var t=[];if(e!=null)for(var n in ne(e))t.push(n);return t}function Gf(e){return pr.call(e)}function _o(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),De(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=xe(t.length,n),s=Ie(e);r--;){var u=t[r];e[r]=_t(u,n)?s[u]:i}return e}function ss(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var wo=So(qa),Hn=sl||function(e,t){return ye.setTimeout(e,t)},as=So(df);function xo(e,t,n){var r=t+"";return as(e,Nf(r,Kf(Lf(r),n)))}function So(e){var t=0,n=0;return function(){var r=cl(),s=Tt-(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 Ao=kf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Uu,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?be(e,t,n):t===i)?t=1:t=ve(W(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 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 Lt(N(n)?Ie(n):[n],we(t,1))}var Zf=B(function(e,t){return he(e)?$n(e,we(t,1,he,!0)):[]}),Xf=B(function(e,t){var n=Qe(t);return he(n)&&(n=i),he(e)?$n(e,we(t,1,he,!0),R(n,2)):[]}),Qf=B(function(e,t){var n=Qe(t);return he(n)&&(n=i),he(e)?$n(e,we(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:W(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:W(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"&&be(e,t,n)&&(n=0,r=s),Jl(e,t,n,r)):[]}function bo(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=n==null?0:W(n);return s<0&&(s=ve(r+s,0)),ur(e,R(t,3),s)}function Co(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=r-1;return n!==i&&(s=W(n),s=n<0?ve(r+s,0):xe(s,r-1)),ur(e,R(t,3),s,!0)}function To(e){var t=e==null?0:e.length;return t?we(e,1):[]}function ih(e){var t=e==null?0:e.length;return t?we(e,at):[]}function sh(e,t){var n=e==null?0:e.length;return n?(t=t===i?1:W(t),we(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 Fo(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:W(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=ue(e,zi);return t.length&&t[0]===e[0]?Di(t):[]}),lh=B(function(e){var t=Qe(e),n=ue(e,zi);return t===Qe(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Di(n,R(t,2)):[]}),fh=B(function(e){var t=Qe(e),n=ue(e,zi);return t=typeof t=="function"?t:i,t&&n.pop(),n.length&&n[0]===e[0]?Di(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=W(n),s=s<0?ve(r+s,0):xe(s,r-1)),t===t?Hc(e,t,s):ur(e,oa,s,!0)}function dh(e,t){return e&&e.length?Wa(e,W(t)):i}var gh=B(Io);function Io(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=vt(function(e,t){var n=e==null?0:e.length,r=Li(e,t);return ka(e,ue(t,function(s){return _t(s,n)?+s:s}).sort(Xa)),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 ka(e,s),n}function os(e){return e==null?e:fl.call(e)}function wh(e,t,n){var r=e==null?0:e.length;return r?(n&&typeof n!="number"&&be(e,t,n)?(t=0,n=r):(t=t==null?0:W(t),n=n===i?r:W(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 Eh(e,t){return Fr(e,t,!0)}function bh(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?ja(e):[]}function Fh(e,t){return e&&e.length?ja(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:W(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:W(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 Uh=B(function(e){return Dt(we(e,1,he,!0))}),Mh=B(function(e){var t=Qe(e);return he(t)&&(t=i),Dt(we(e,1,he,!0),R(t,2))}),Nh=B(function(e){var t=Qe(e);return t=typeof t=="function"?t:i,Dt(we(e,1,he,!0),i,t)});function Dh(e){return e&&e.length?Dt(e):[]}function Wh(e,t){return e&&e.length?Dt(e,R(t,2)):[]}function $h(e,t){return t=typeof t=="function"?t:i,e&&e.length?Dt(e,i,t):[]}function us(e){if(!(e&&e.length))return[];var t=0;return e=Ot(e,function(n){if(he(n))return t=ve(n.length,t),!0}),bi(t,function(n){return ue(e,Si(n))})}function Ro(e,t){if(!(e&&e.length))return[];var n=us(e);return t==null?n:ue(n,function(r){return De(t,i,r)})}var Bh=B(function(e,t){return he(e)?$n(e,t):[]}),kh=B(function(e){return Ki(Ot(e,he))}),qh=B(function(e){var t=Qe(e);return he(t)&&(t=i),Ki(Ot(e,he),R(t,2))}),jh=B(function(e){var t=Qe(e);return t=typeof t=="function"?t:i,Ki(Ot(e,he),i,t)}),Gh=B(us);function Hh(e,t){return za(e||[],t||[],Wn)}function Kh(e,t){return za(e||[],t||[],qn)}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,Ro(e,n)});function Po(e){var t=o(e);return t.__chain__=!0,t}function Jh(e,t){return t(e),e}function Wr(e,t){return t(e)}var Yh=vt(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)||!_t(n)?this.thru(s):(r=r.slice(n,+n+(t?1:0)),r.__actions__.push({func:Wr,args:[s],thisArg:i}),new Ye(r,this.__chain__).thru(function(u){return t&&!u.length&&u.push(i),u}))});function Zh(){return Po(this)}function Xh(){return new Ye(this.value(),this.__chain__)}function Qh(){this.__values__===i&&(this.__values__=Ho(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:Wr,args:[os],thisArg:i}),new Ye(t,this.__chain__)}return this.thru(os)}function np(){return Ka(this.__wrapped__,this.__actions__)}var rp=Rr(function(e,t,n){V.call(e,n)?++e[n]:gt(e,n,1)});function ip(e,t,n){var r=N(e)?sa:zl;return n&&be(e,t,n)&&(t=i),r(e,R(t,3))}function sp(e,t){var n=N(e)?Ot:Ia;return n(e,R(t,3))}var ap=ro(bo),op=ro(Co);function up(e,t){return we($r(e,t),1)}function cp(e,t){return we($r(e,t),at)}function lp(e,t,n){return n=n===i?1:W(n),we($r(e,t),n)}function Oo(e,t){var n=N(e)?ze:Nt;return n(e,R(t,3))}function Lo(e,t){var n=N(e)?Fc:Fa;return n(e,R(t,3))}var fp=Rr(function(e,t,n){V.call(e,n)?e[n].push(t):gt(e,n,[t])});function hp(e,t,n,r){e=Re(e)?e:bn(e),n=n&&!r?W(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?De(t,l,n):Bn(l,t,n)}),u}),dp=Rr(function(e,t,n){gt(e,n,t)});function $r(e,t){var n=N(e)?ue:Ma;return n(e,R(t,3))}function gp(e,t,n,r){return e==null?[]:(N(t)||(t=t==null?[]:[t]),n=r?i:n,N(n)||(n=n==null?[]:[n]),$a(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=N(e)?wi:ca,s=arguments.length<3;return r(e,R(t,4),n,s,Nt)}function _p(e,t,n){var r=N(e)?Ic:ca,s=arguments.length<3;return r(e,R(t,4),n,s,Fa)}function yp(e,t){var n=N(e)?Ot:Ia;return n(e,qr(R(t,3)))}function wp(e){var t=N(e)?Ea:hf;return t(e)}function xp(e,t,n){(n?be(e,t,n):t===i)?t=1:t=W(t);var r=N(e)?ql:pf;return r(e,t)}function Sp(e){var t=N(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=Se(e);return t==Me||t==Ne?e.size:$i(e).length}function Ep(e,t,n){var r=N(e)?xi:mf;return n&&be(e,t,n)&&(t=i),r(e,R(t,3))}var bp=B(function(e,t){if(e==null)return[];var n=t.length;return n>1&&be(e,t[0],t[1])?t=[]:n>2&&be(t[0],t[1],t[2])&&(t=[t[0]]),$a(e,we(t,1),[])}),Br=il||function(){return ye.Date.now()};function Cp(e,t){if(typeof t!="function")throw new Je(S);return e=W(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,ae,i,i,i,i,t)}function Mo(e,t){var n;if(typeof t!="function")throw new Je(S);return e=W(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=Ut(n,An(cs));r|=X}return mt(e,r,t,n,s)}),No=B(function(e,t,n){var r=de|Ue;if(n.length){var s=Ut(n,An(No));r|=X}return mt(t,r,e,n,s)});function Do(e,t,n){t=n?i:t;var r=mt(e,Te,i,i,i,i,i,t);return r.placeholder=Do.placeholder,r}function Wo(e,t,n){t=n?i:t;var r=mt(e,F,i,i,i,i,i,t);return r.placeholder=Wo.placeholder,r}function $o(e,t,n){var r,s,u,l,h,d,y=0,w=!1,x=!1,b=!0;if(typeof e!="function")throw new Je(S);t=Ve(t)||0,le(n)&&(w=!!n.leading,x="maxWait"in n,u=x?ve(Ve(n.maxWait)||0,t):u,b="trailing"in n?!!n.trailing:b);function T(pe){var st=r,xt=s;return r=s=i,y=pe,l=e.apply(xt,st),l}function L(pe){return y=pe,h=Hn(q,t),w?T(pe):l}function $(pe){var st=pe-d,xt=pe-y,iu=t-st;return x?xe(iu,u-xt):iu}function U(pe){var st=pe-d,xt=pe-y;return d===i||st>=t||st<0||x&&xt>=u}function q(){var pe=Br();if(U(pe))return H(pe);h=Hn(q,$(pe))}function H(pe){return h=i,b&&r?T(pe):(r=s=i,l)}function ke(){h!==i&&Ja(h),y=0,r=d=s=h=i}function Ce(){return h===i?l:H(Br())}function qe(){var pe=Br(),st=U(pe);if(r=arguments,s=this,d=pe,st){if(h===i)return L(d);if(x)return Ja(h),h=Hn(q,t),T(d)}return h===i&&(h=Hn(q,t)),l}return qe.cancel=ke,qe.flush=Ce,qe}var Tp=B(function(e,t){return Ta(e,1,t)}),Fp=B(function(e,t,n){return Ta(e,Ve(t)||0,n)});function Ip(e){return mt(e,re)}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||dt),n}kr.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 Rp(e){return Mo(2,e)}var Pp=vf(function(e,t){t=t.length==1&&N(t[0])?ue(t[0],We(R())):ue(we(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 De(e,this,r)})}),ls=B(function(e,t){var n=Ut(t,An(ls));return mt(e,X,i,t,n)}),Bo=B(function(e,t){var n=Ut(t,An(Bo));return mt(e,z,i,t,n)}),Op=vt(function(e,t){return mt(e,Fe,i,i,i,t)});function Lp(e,t){if(typeof e!="function")throw new Je(S);return t=t===i?t:W(t),B(e,t)}function Up(e,t){if(typeof e!="function")throw new Je(S);return t=t==null?0:ve(W(t),0),B(function(n){var r=n[t],s=$t(n,0,t);return r&&Lt(s,r),De(e,this,s)})}function Mp(e,t,n){var r=!0,s=!0;if(typeof e!="function")throw new Je(S);return le(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),$o(e,t,{leading:r,maxWait:t,trailing:s})}function Np(e){return Uo(e,1)}function Dp(e,t){return ls(Ji(t),e)}function Wp(){if(!arguments.length)return[];var e=arguments[0];return N(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||Ca(e,t,_e(t))}function it(e,t){return e===t||e!==e&&t!==t}var Gp=Ur(Ni),Hp=Ur(function(e,t){return e>=t}),an=Oa(function(){return arguments}())?Oa:function(e){return fe(e)&&V.call(e,"callee")&&!_a.call(e,"callee")},N=m.isArray,Kp=Vs?We(Vs):Vl;function Re(e){return e!=null&&jr(e.length)&&!yt(e)}function he(e){return fe(e)&&Re(e)}function zp(e){return e===!0||e===!1||fe(e)&&Ee(e)==Ht}var Bt=al||xs,Jp=ea?We(ea):ef;function Yp(e){return fe(e)&&e.nodeType===1&&!Kn(e)}function Zp(e){if(e==null)return!0;if(Re(e)&&(N(e)||typeof e=="string"||typeof e.splice=="function"||Bt(e)||En(e)||an(e)))return!e.length;var t=Se(e);if(t==Me||t==Ne)return!e.size;if(Gn(e))return!$i(e).length;for(var n in e)if(V.call(e,n))return!1;return!0}function Xp(e,t){return kn(e,t)}function Qp(e,t,n){n=typeof n=="function"?n:i;var r=n?n(e,t):i;return r===i?kn(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"&&!Kn(e)}function Vp(e){return typeof e=="number"&&wa(e)}function yt(e){if(!le(e))return!1;var t=Ee(e);return t==ln||t==tr||t==ni||t==nr}function ko(e){return typeof e=="number"&&e==W(e)}function jr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=et}function le(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function fe(e){return e!=null&&typeof e=="object"}var qo=ta?We(ta):nf;function ed(e,t){return e===t||Wi(e,t,ts(t))}function td(e,t,n){return n=typeof n=="function"?n:i,Wi(e,t,ts(t),n)}function nd(e){return jo(e)&&e!=+e}function rd(e){if(Bf(e))throw new M(_);return La(e)}function id(e){return e===null}function sd(e){return e==null}function jo(e){return typeof e=="number"||fe(e)&&Ee(e)==zt}function Kn(e){if(!fe(e)||Ee(e)!=tt)return!1;var t=mr(e);if(t===null)return!0;var n=V.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&hr.call(n)==el}var hs=na?We(na):rf;function ad(e){return ko(e)&&e>=-et&&e<=et}var Go=ra?We(ra):sf;function Gr(e){return typeof e=="string"||!N(e)&&fe(e)&&Ee(e)==Jt}function Be(e){return typeof e=="symbol"||fe(e)&&Ee(e)==fn}var En=ia?We(ia):af;function od(e){return e===i}function ud(e){return fe(e)&&Se(e)==Rt}function cd(e){return fe(e)&&Ee(e)==ai}var ld=Ur(Bi),fd=Ur(function(e,t){return e<=t});function Ho(e){if(!e)return[];if(Re(e))return Gr(e)?nt(e):Ie(e);if(Ln&&e[Ln])return qc(e[Ln]());var t=Se(e),n=t==Me?Ti:t==Ne?cr:bn;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 W(e){var t=wt(e),n=t%1;return t===t?n?t-n:t:0}function Ko(e){return e?tn(W(e),0,He):0}function Ve(e){if(typeof e=="number")return e;if(Be(e))return on;if(le(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=le(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=la(e);var n=Hu.test(e);return n||zu.test(e)?bc(e.slice(2),n?2:8):Gu.test(e)?on:+e}function zo(e){return ct(e,Pe(e))}function hd(e){return e?tn(W(e),-et,et):e===0?e:0}function Q(e){return e==null?"":$e(e)}var pd=xn(function(e,t){if(Gn(t)||Re(t)){ct(t,_e(t),e);return}for(var n in t)V.call(t,n)&&Wn(e,n,t[n])}),Jo=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,_e(t),e,r)}),gd=vt(Li);function md(e,t){var n=wn(e);return t==null?n:ba(n,t)}var vd=B(function(e,t){e=ne(e);var n=-1,r=t.length,s=r>2?t[2]:i;for(s&&be(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 y=l[h],w=e[y];(w===i||it(w,vn[y])&&!V.call(e,y))&&(e[y]=u[y])}return e}),_d=B(function(e){return e.push(i,lo),De(Yo,i,e)});function yd(e,t){return aa(e,R(t,3),ut)}function wd(e,t){return aa(e,R(t,3),Mi)}function xd(e,t){return e==null?e:Ui(e,R(t,3),Pe)}function Sd(e,t){return e==null?e:Ra(e,R(t,3),Pe)}function Ad(e,t){return e&&ut(e,R(t,3))}function Ed(e,t){return e&&Mi(e,R(t,3))}function bd(e){return e==null?[]:Cr(e,_e(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&&po(e,t,Yl)}function ds(e,t){return e!=null&&po(e,t,Zl)}var Fd=so(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=pr.call(t)),e[t]=n},ms(Oe)),Id=so(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=pr.call(t)),V.call(e,t)?e[t].push(n):e[t]=[n]},R),Rd=B(Bn);function _e(e){return Re(e)?Aa(e):$i(e)}function Pe(e){return Re(e)?Aa(e,!0):of(e)}function Pd(e,t){var n={};return t=R(t,3),ut(e,function(r,s,u){gt(n,t(r,s,u),r)}),n}function Od(e,t){var n={};return t=R(t,3),ut(e,function(r,s,u){gt(n,s,t(r,s,u))}),n}var Ld=xn(function(e,t,n){Tr(e,t,n)}),Yo=xn(function(e,t,n,r){Tr(e,t,n,r)}),Ud=vt(function(e,t){var n={};if(e==null)return n;var r=!1;t=ue(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 Md(e,t){return Zo(e,qr(R(t)))}var Nd=vt(function(e,t){return e==null?{}:cf(e,t)});function Zo(e,t){if(e==null)return{};var n=ue(Vi(e),function(r){return[r]});return t=R(t),Ba(e,n,function(r,s){return t(r,s[0])})}function Dd(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=yt(u)?u.call(e):u}return e}function Wd(e,t,n){return e==null?e:qn(e,t,n)}function $d(e,t,n,r){return r=typeof r=="function"?r:i,e==null?e:qn(e,t,n,r)}var Xo=uo(_e),Qo=uo(Pe);function Bd(e,t,n){var r=N(e),s=r||Bt(e)||En(e);if(t=R(t,4),n==null){var u=e&&e.constructor;s?n=r?new u:[]:le(e)?n=yt(u)?wn(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:Ha(e,t,Ji(n))}function jd(e,t,n,r){return r=typeof r=="function"?r:i,e==null?e:Ha(e,t,Ji(n),r)}function bn(e){return e==null?[]:Ci(e,_e(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"&&be(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=xa();return xe(e+s*(t-e+Ec("1e-"+((s+"").length-1))),t)}return qi(e,t)}var Jd=Sn(function(e,t,n){return t=t.toLowerCase(),e+(n?Vo(t):t)});function Vo(e){return gs(Q(e).toLowerCase())}function eu(e){return e=Q(e),e&&e.replace(Yu,Dc).replace(dc,"")}function Yd(e,t,n){e=Q(e),t=$e(t);var r=e.length;n=n===i?r:tn(W(n),0,r);var s=n;return n-=t.length,n>=0&&e.slice(n,s)==t}function Zd(e){return e=Q(e),e&&Iu.test(e)?e.replace(Rs,Wc):e}function Xd(e){return e=Q(e),e&&Mu.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=no("toLowerCase");function tg(e,t,n){e=Q(e),t=W(t);var r=t?gn(e):0;if(!t||r>=t)return e;var s=(t-r)/2;return Lr(wr(s),n)+e+Lr(yr(s),n)}function ng(e,t,n){e=Q(e),t=W(t);var r=t?gn(e):0;return t&&r<t?e+Lr(t-r,n):e}function rg(e,t,n){e=Q(e),t=W(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(Q(e).replace(fi,""),t||0)}function sg(e,t,n){return(n?be(e,t,n):t===i)?t=1:t=W(t),ji(Q(e),t)}function ag(){var e=arguments,t=Q(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"&&be(e,t,n)&&(t=n=i),n=n===i?He:n>>>0,n?(e=Q(e),e&&(typeof t=="string"||t!=null&&!hs(t))&&(t=$e(t),!t&&dn(e))?$t(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=Q(e),n=n==null?0:tn(W(n),0,e.length),t=$e(t),e.slice(n,n+t.length)==t}function fg(e,t,n){var r=o.templateSettings;n&&be(e,t,n)&&(t=i),e=Q(e),t=Hr({},t,r,co);var s=Hr({},t.imports,r.imports,co),u=_e(s),l=Ci(s,u),h,d,y=0,w=t.interpolate||ir,x="__p += '",b=Fi((t.escape||ir).source+"|"+w.source+"|"+(w===Ps?ju:ir).source+"|"+(t.evaluate||ir).source+"|$","g"),T="//# sourceURL="+(V.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yc+"]")+`
|
|
211
|
+
`;e.replace(b,function(U,q,H,ke,Ce,qe){return H||(H=ke),x+=e.slice(y,qe).replace(Zu,$c),q&&(h=!0,x+=`' +
|
|
212
|
+
__e(`+q+`) +
|
|
213
|
+
'`),Ce&&(d=!0,x+=`';
|
|
214
|
+
`+Ce+`;
|
|
215
|
+
__p += '`),H&&(x+=`' +
|
|
216
|
+
((__t = (`+H+`)) == null ? '' : __t) +
|
|
217
|
+
'`),y=qe+U.length,U}),x+=`';
|
|
218
|
+
`;var L=V.call(t,"variable")&&t.variable;if(!L)x=`with (obj) {
|
|
219
|
+
`+x+`
|
|
393
220
|
}
|
|
394
|
-
`;else if(
|
|
395
|
-
`+(
|
|
396
|
-
`)+"var __t, __p = ''"+(h?", __e = _.escape":"")+(
|
|
221
|
+
`;else if(ku.test(L))throw new M(A);x=(d?x.replace(bu,""):x).replace(Cu,"$1").replace(Tu,"$1;"),x="function("+(L||"obj")+`) {
|
|
222
|
+
`+(L?"":`obj || (obj = {});
|
|
223
|
+
`)+"var __t, __p = ''"+(h?", __e = _.escape":"")+(d?`, __j = Array.prototype.join;
|
|
397
224
|
function print() { __p += __j.call(arguments, '') }
|
|
398
225
|
`:`;
|
|
399
|
-
`)+
|
|
400
|
-
}`;var X=fc(function(){return oe(p,U+"return "+I).apply(i,d)});if(X.source=I,la(X))throw X;return X}function y0(e){return le(e).toLowerCase()}function v0(e){return le(e).toUpperCase()}function _0(e,t,s){if(e=le(e),e&&(s||t===i))return xo(e);if(!e||!(t=tt(t)))return e;var a=Et(e),c=Et(t),p=To(a,c),d=wo(a,c)+1;return hn(a,p,d).join("")}function x0(e,t,s){if(e=le(e),e&&(s||t===i))return e.slice(0,So(e)+1);if(!e||!(t=tt(t)))return e;var a=Et(e),c=wo(a,Et(t))+1;return hn(a,0,c).join("")}function T0(e,t,s){if(e=le(e),e&&(s||t===i))return e.replace(ls,"");if(!e||!(t=tt(t)))return e;var a=Et(e),c=To(a,Et(t));return hn(a,c).join("")}function w0(e,t){var s=q,a=Se;if(Ae(t)){var c="separator"in t?t.separator:c;s="length"in t?Y(t.length):s,a="omission"in t?tt(t.omission):a}e=le(e);var p=e.length;if(Hn(e)){var d=Et(e);p=d.length}if(s>=p)return e;var h=s-Yn(a);if(h<1)return a;var y=d?hn(d,0,h).join(""):e.slice(0,h);if(c===i)return y+a;if(d&&(h+=y.length-h),fa(c)){if(e.slice(h).search(c)){var E,S=y;for(c.global||(c=bs(c.source,le(ja.exec(c))+"g")),c.lastIndex=0;E=c.exec(S);)var I=E.index;y=y.slice(0,I===i?h:I)}}else if(e.indexOf(tt(c),h)!=h){var C=y.lastIndexOf(c);C>-1&&(y=y.slice(0,C))}return y+a}function E0(e){return e=le(e),e&&Fl.test(e)?e.replace(Ma,Kf):e}var S0=ii(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),ha=pu("toUpperCase");function lc(e,t,s){return e=le(e),t=s?i:t,t===i?zf(e)?tp(e):Mf(e):e.match(t)||[]}var fc=K(function(e,t){try{return Ze(e,i,t)}catch(s){return la(s)?s:new z(s)}}),A0=Gt(function(e,t){return ot(t,function(s){s=Dt(s),jt(e,s,ua(e[s],e))}),e});function I0(e){var t=e==null?0:e.length,s=j();return e=t?Ee(e,function(a){if(typeof a[1]!="function")throw new ut(g);return[s(a[0]),a[1]]}):[],K(function(a){for(var c=-1;++c<t;){var p=e[c];if(Ze(p[0],this,a))return Ze(p[1],this,a)}})}function b0(e){return Kp(lt(e,D))}function ga(e){return function(){return e}}function N0(e,t){return e==null||e!==e?t:e}var O0=hu(),R0=hu(!0);function He(e){return e}function ma(e){return Vo(typeof e=="function"?e:lt(e,D))}function C0(e){return Jo(lt(e,D))}function L0(e,t){return zo(e,lt(t,D))}var F0=K(function(e,t){return function(s){return Ni(s,e,t)}}),D0=K(function(e,t){return function(s){return Ni(e,s,t)}});function ya(e,t,s){var a=Pe(t),c=vr(t,a);s==null&&!(Ae(t)&&(c.length||!a.length))&&(s=t,t=e,e=this,c=vr(t,Pe(t)));var p=!(Ae(s)&&"chain"in s)||!!s.chain,d=qt(e);return ot(c,function(h){var y=t[h];e[h]=y,d&&(e.prototype[h]=function(){var E=this.__chain__;if(p||E){var S=e(this.__wrapped__),I=S.__actions__=Je(this.__actions__);return I.push({func:y,args:arguments,thisArg:e}),S.__chain__=E,S}return y.apply(e,un([this.value()],arguments))})}),e}function P0(){return Ue._===this&&(Ue._=op),this}function va(){}function k0(e){return e=Y(e),K(function(t){return Qo(t,e)})}var U0=Hs(Ee),M0=Hs(go),$0=Hs(xs);function pc(e){return na(e)?Ts(Dt(e)):gd(e)}function B0(e){return function(t){return e==null?i:Pn(e,t)}}var j0=mu(),W0=mu(!0);function _a(){return[]}function xa(){return!1}function G0(){return{}}function V0(){return""}function q0(){return!0}function J0(e,t){if(e=Y(e),e<1||e>Tt)return[];var s=st,a=$e(e,st);t=j(t),e-=st;for(var c=Ss(a,t);++s<e;)t(s);return c}function z0(e){return Q(e)?Ee(e,Dt):nt(e)?[e]:Je(Lu(le(e)))}function Q0(e){var t=++sp;return le(e)+t}var H0=Sr(function(e,t){return e+t},0),Y0=Ys("ceil"),X0=Sr(function(e,t){return e/t},1),K0=Ys("floor");function Z0(e){return e&&e.length?yr(e,He,Ps):i}function ey(e,t){return e&&e.length?yr(e,j(t,2),Ps):i}function ty(e){return vo(e,He)}function ny(e,t){return vo(e,j(t,2))}function iy(e){return e&&e.length?yr(e,He,$s):i}function ry(e,t){return e&&e.length?yr(e,j(t,2),$s):i}var sy=Sr(function(e,t){return e*t},1),ay=Ys("round"),oy=Sr(function(e,t){return e-t},0);function uy(e){return e&&e.length?Es(e,He):0}function cy(e,t){return e&&e.length?Es(e,j(t,2)):0}return l.after=Cg,l.ary=Gu,l.assign=vm,l.assignIn=ic,l.assignInWith=Ur,l.assignWith=_m,l.at=xm,l.before=Vu,l.bind=ua,l.bindAll=A0,l.bindKey=qu,l.castArray=Gg,l.chain=Bu,l.chunk=Kd,l.compact=Zd,l.concat=eh,l.cond=I0,l.conforms=b0,l.constant=ga,l.countBy=ug,l.create=Tm,l.curry=Ju,l.curryRight=zu,l.debounce=Qu,l.defaults=wm,l.defaultsDeep=Em,l.defer=Lg,l.delay=Fg,l.difference=th,l.differenceBy=nh,l.differenceWith=ih,l.drop=rh,l.dropRight=sh,l.dropRightWhile=ah,l.dropWhile=oh,l.fill=uh,l.filter=lg,l.flatMap=dg,l.flatMapDeep=hg,l.flatMapDepth=gg,l.flatten=ku,l.flattenDeep=ch,l.flattenDepth=lh,l.flip=Dg,l.flow=O0,l.flowRight=R0,l.fromPairs=fh,l.functions=Rm,l.functionsIn=Cm,l.groupBy=mg,l.initial=dh,l.intersection=hh,l.intersectionBy=gh,l.intersectionWith=mh,l.invert=Fm,l.invertBy=Dm,l.invokeMap=vg,l.iteratee=ma,l.keyBy=_g,l.keys=Pe,l.keysIn=Qe,l.map=Cr,l.mapKeys=km,l.mapValues=Um,l.matches=C0,l.matchesProperty=L0,l.memoize=Fr,l.merge=Mm,l.mergeWith=rc,l.method=F0,l.methodOf=D0,l.mixin=ya,l.negate=Dr,l.nthArg=k0,l.omit=$m,l.omitBy=Bm,l.once=Pg,l.orderBy=xg,l.over=U0,l.overArgs=kg,l.overEvery=M0,l.overSome=$0,l.partial=ca,l.partialRight=Hu,l.partition=Tg,l.pick=jm,l.pickBy=sc,l.property=pc,l.propertyOf=B0,l.pull=xh,l.pullAll=Mu,l.pullAllBy=Th,l.pullAllWith=wh,l.pullAt=Eh,l.range=j0,l.rangeRight=W0,l.rearg=Ug,l.reject=Sg,l.remove=Sh,l.rest=Mg,l.reverse=aa,l.sampleSize=Ig,l.set=Gm,l.setWith=Vm,l.shuffle=bg,l.slice=Ah,l.sortBy=Rg,l.sortedUniq=Lh,l.sortedUniqBy=Fh,l.split=d0,l.spread=$g,l.tail=Dh,l.take=Ph,l.takeRight=kh,l.takeRightWhile=Uh,l.takeWhile=Mh,l.tap=Zh,l.throttle=Bg,l.thru=Rr,l.toArray=ec,l.toPairs=ac,l.toPairsIn=oc,l.toPath=z0,l.toPlainObject=nc,l.transform=qm,l.unary=jg,l.union=$h,l.unionBy=Bh,l.unionWith=jh,l.uniq=Wh,l.uniqBy=Gh,l.uniqWith=Vh,l.unset=Jm,l.unzip=oa,l.unzipWith=$u,l.update=zm,l.updateWith=Qm,l.values=ai,l.valuesIn=Hm,l.without=qh,l.words=lc,l.wrap=Wg,l.xor=Jh,l.xorBy=zh,l.xorWith=Qh,l.zip=Hh,l.zipObject=Yh,l.zipObjectDeep=Xh,l.zipWith=Kh,l.entries=ac,l.entriesIn=oc,l.extend=ic,l.extendWith=Ur,ya(l,l),l.add=H0,l.attempt=fc,l.camelCase=Zm,l.capitalize=uc,l.ceil=Y0,l.clamp=Ym,l.clone=Vg,l.cloneDeep=Jg,l.cloneDeepWith=zg,l.cloneWith=qg,l.conformsTo=Qg,l.deburr=cc,l.defaultTo=N0,l.divide=X0,l.endsWith=e0,l.eq=At,l.escape=t0,l.escapeRegExp=n0,l.every=cg,l.find=fg,l.findIndex=Du,l.findKey=Sm,l.findLast=pg,l.findLastIndex=Pu,l.findLastKey=Am,l.floor=K0,l.forEach=ju,l.forEachRight=Wu,l.forIn=Im,l.forInRight=bm,l.forOwn=Nm,l.forOwnRight=Om,l.get=pa,l.gt=Hg,l.gte=Yg,l.has=Lm,l.hasIn=da,l.head=Uu,l.identity=He,l.includes=yg,l.indexOf=ph,l.inRange=Xm,l.invoke=Pm,l.isArguments=Mn,l.isArray=Q,l.isArrayBuffer=Xg,l.isArrayLike=ze,l.isArrayLikeObject=be,l.isBoolean=Kg,l.isBuffer=gn,l.isDate=Zg,l.isElement=em,l.isEmpty=tm,l.isEqual=nm,l.isEqualWith=im,l.isError=la,l.isFinite=rm,l.isFunction=qt,l.isInteger=Yu,l.isLength=Pr,l.isMap=Xu,l.isMatch=sm,l.isMatchWith=am,l.isNaN=om,l.isNative=um,l.isNil=lm,l.isNull=cm,l.isNumber=Ku,l.isObject=Ae,l.isObjectLike=Ie,l.isPlainObject=Di,l.isRegExp=fa,l.isSafeInteger=fm,l.isSet=Zu,l.isString=kr,l.isSymbol=nt,l.isTypedArray=si,l.isUndefined=pm,l.isWeakMap=dm,l.isWeakSet=hm,l.join=yh,l.kebabCase=i0,l.last=pt,l.lastIndexOf=vh,l.lowerCase=r0,l.lowerFirst=s0,l.lt=gm,l.lte=mm,l.max=Z0,l.maxBy=ey,l.mean=ty,l.meanBy=ny,l.min=iy,l.minBy=ry,l.stubArray=_a,l.stubFalse=xa,l.stubObject=G0,l.stubString=V0,l.stubTrue=q0,l.multiply=sy,l.nth=_h,l.noConflict=P0,l.noop=va,l.now=Lr,l.pad=a0,l.padEnd=o0,l.padStart=u0,l.parseInt=c0,l.random=Km,l.reduce=wg,l.reduceRight=Eg,l.repeat=l0,l.replace=f0,l.result=Wm,l.round=ay,l.runInContext=m,l.sample=Ag,l.size=Ng,l.snakeCase=p0,l.some=Og,l.sortedIndex=Ih,l.sortedIndexBy=bh,l.sortedIndexOf=Nh,l.sortedLastIndex=Oh,l.sortedLastIndexBy=Rh,l.sortedLastIndexOf=Ch,l.startCase=h0,l.startsWith=g0,l.subtract=oy,l.sum=uy,l.sumBy=cy,l.template=m0,l.times=J0,l.toFinite=Jt,l.toInteger=Y,l.toLength=tc,l.toLower=y0,l.toNumber=dt,l.toSafeInteger=ym,l.toString=le,l.toUpper=v0,l.trim=_0,l.trimEnd=x0,l.trimStart=T0,l.truncate=w0,l.unescape=E0,l.uniqueId=Q0,l.upperCase=S0,l.upperFirst=ha,l.each=ju,l.eachRight=Wu,l.first=Uu,ya(l,function(){var e={};return Lt(l,function(t,s){pe.call(l.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),l.VERSION=o,ot(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),ot(["drop","take"],function(e,t){te.prototype[e]=function(s){s=s===i?1:Fe(Y(s),0);var a=this.__filtered__&&!t?new te(this):this.clone();return a.__filtered__?a.__takeCount__=$e(s,a.__takeCount__):a.__views__.push({size:$e(s,st),type:e+(a.__dir__<0?"Right":"")}),a},te.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),ot(["filter","map","takeWhile"],function(e,t){var s=t+1,a=s==Vi||s==Ji;te.prototype[e]=function(c){var p=this.clone();return p.__iteratees__.push({iteratee:j(c,3),type:s}),p.__filtered__=p.__filtered__||a,p}}),ot(["head","last"],function(e,t){var s="take"+(t?"Right":"");te.prototype[e]=function(){return this[s](1).value()[0]}}),ot(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");te.prototype[e]=function(){return this.__filtered__?new te(this):this[s](1)}}),te.prototype.compact=function(){return this.filter(He)},te.prototype.find=function(e){return this.filter(e).head()},te.prototype.findLast=function(e){return this.reverse().find(e)},te.prototype.invokeMap=K(function(e,t){return typeof e=="function"?new te(this):this.map(function(s){return Ni(s,e,t)})}),te.prototype.reject=function(e){return this.filter(Dr(j(e)))},te.prototype.slice=function(e,t){e=Y(e);var s=this;return s.__filtered__&&(e>0||t<0)?new te(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==i&&(t=Y(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},te.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},te.prototype.toArray=function(){return this.take(st)},Lt(te.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),c=l[a?"take"+(t=="last"?"Right":""):t],p=a||/^find/.test(t);c&&(l.prototype[t]=function(){var d=this.__wrapped__,h=a?[1]:arguments,y=d instanceof te,E=h[0],S=y||Q(d),I=function(Z){var ie=c.apply(l,un([Z],h));return a&&C?ie[0]:ie};S&&s&&typeof E=="function"&&E.length!=1&&(y=S=!1);var C=this.__chain__,U=!!this.__actions__.length,G=p&&!C,X=y&&!U;if(!p&&S){d=X?d:new te(this);var V=e.apply(d,h);return V.__actions__.push({func:Rr,args:[I],thisArg:i}),new ct(V,C)}return G&&X?e.apply(this,h):(V=this.thru(I),G?a?V.value()[0]:V.value():V)})}),ot(["pop","push","shift","sort","splice","unshift"],function(e){var t=nr[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var c=arguments;if(a&&!this.__chain__){var p=this.value();return t.apply(Q(p)?p:[],c)}return this[s](function(d){return t.apply(Q(d)?d:[],c)})}}),Lt(te.prototype,function(e,t){var s=l[t];if(s){var a=s.name+"";pe.call(ei,a)||(ei[a]=[]),ei[a].push({name:t,func:s})}}),ei[Er(i,me).name]=[{name:"wrapper",func:i}],te.prototype.clone=Ep,te.prototype.reverse=Sp,te.prototype.value=Ap,l.prototype.at=eg,l.prototype.chain=tg,l.prototype.commit=ng,l.prototype.next=ig,l.prototype.plant=sg,l.prototype.reverse=ag,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=og,l.prototype.first=l.prototype.head,Ti&&(l.prototype[Ti]=rg),l},Xn=np();Rn?((Rn.exports=Xn)._=Xn,ms._=Xn):Ue._=Xn}).call(Tx)}($i,$i.exports)),$i.exports}var Ex=wx();const Ia=n=>{const r=Ex.startCase(n).toLowerCase();return r.charAt(0).toUpperCase()+r.slice(1)},Sx=({data:n})=>`import { defineObject } from 'twenty-sdk';
|
|
226
|
+
`)+x+`return __p
|
|
227
|
+
}`;var $=nu(function(){return Z(u,T+"return "+x).apply(i,l)});if($.source=x,fs($))throw $;return $}function hg(e){return Q(e).toLowerCase()}function pg(e){return Q(e).toUpperCase()}function dg(e,t,n){if(e=Q(e),e&&(n||t===i))return la(e);if(!e||!(t=$e(t)))return e;var r=nt(e),s=nt(t),u=fa(r,s),l=ha(r,s)+1;return $t(r,u,l).join("")}function gg(e,t,n){if(e=Q(e),e&&(n||t===i))return e.slice(0,da(e)+1);if(!e||!(t=$e(t)))return e;var r=nt(e),s=ha(r,nt(t))+1;return $t(r,0,s).join("")}function mg(e,t,n){if(e=Q(e),e&&(n||t===i))return e.replace(fi,"");if(!e||!(t=$e(t)))return e;var r=nt(e),s=fa(r,nt(t));return $t(r,s).join("")}function vg(e,t){var n=Gt,r=Ge;if(le(t)){var s="separator"in t?t.separator:s;n="length"in t?W(t.length):n,r="omission"in t?$e(t.omission):r}e=Q(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?$t(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 y,w=d;for(s.global||(s=Fi(s.source,Q(Os.exec(s))+"g")),s.lastIndex=0;y=s.exec(w);)var x=y.index;d=d.slice(0,x===i?h:x)}}else if(e.indexOf($e(s),h)!=h){var b=d.lastIndexOf(s);b>-1&&(d=d.slice(0,b))}return d+r}function _g(e){return e=Q(e),e&&Fu.test(e)?e.replace(Is,Kc):e}var yg=Sn(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),gs=no("toUpperCase");function tu(e,t,n){return e=Q(e),t=n?i:t,t===i?kc(e)?Yc(e):Oc(e):e.match(t)||[]}var nu=B(function(e,t){try{return De(e,i,t)}catch(n){return fs(n)?n:new M(n)}}),wg=vt(function(e,t){return ze(t,function(n){n=lt(n),gt(e,n,cs(e[n],e))}),e});function xg(e){var t=e==null?0:e.length,n=R();return e=t?ue(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(De(u[0],this,r))return De(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 Eg=io(),bg=io(!0);function Oe(e){return e}function vs(e){return Ua(typeof e=="function"?e:Ze(e,G))}function Cg(e){return Na(Ze(e,G))}function Tg(e,t){return Da(e,Ze(t,G))}var Fg=B(function(e,t){return function(n){return Bn(n,e,t)}}),Ig=B(function(e,t){return function(n){return Bn(e,n,t)}});function _s(e,t,n){var r=_e(t),s=Cr(t,r);n==null&&!(le(t)&&(s.length||!r.length))&&(n=t,t=e,e=this,s=Cr(t,_e(t)));var u=!(le(n)&&"chain"in n)||!!n.chain,l=yt(e);return ze(s,function(h){var d=t[h];e[h]=d,l&&(e.prototype[h]=function(){var y=this.__chain__;if(u||y){var w=e(this.__wrapped__),x=w.__actions__=Ie(this.__actions__);return x.push({func:d,args:arguments,thisArg:e}),w.__chain__=y,w}return d.apply(e,Lt([this.value()],arguments))})}),e}function Rg(){return ye._===this&&(ye._=tl),this}function ys(){}function Pg(e){return e=W(e),B(function(t){return Wa(t,e)})}var Og=Zi(ue),Lg=Zi(sa),Ug=Zi(xi);function ru(e){return rs(e)?Si(lt(e)):lf(e)}function Mg(e){return function(t){return e==null?i:nn(e,t)}}var Ng=ao(),Dg=ao(!0);function ws(){return[]}function xs(){return!1}function Wg(){return{}}function $g(){return""}function Bg(){return!0}function kg(e,t){if(e=W(e),e<1||e>et)return[];var n=He,r=xe(e,He);t=R(t),e-=He;for(var s=bi(r,t);++n<e;)t(n);return s}function qg(e){return N(e)?ue(e,lt):Be(e)?[e]:Ie(Ao(Q(e)))}function jg(e){var t=++Vc;return Q(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?br(e,Oe,Ni):i}function Yg(e,t){return e&&e.length?br(e,R(t,2),Ni):i}function Zg(e){return ua(e,Oe)}function Xg(e,t){return ua(e,R(t,2))}function Qg(e){return e&&e.length?br(e,Oe,Bi):i}function Vg(e,t){return e&&e.length?br(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?Ei(e,Oe):0}function im(e,t){return e&&e.length?Ei(e,R(t,2)):0}return o.after=Cp,o.ary=Uo,o.assign=pd,o.assignIn=Jo,o.assignInWith=Hr,o.assignWith=dd,o.at=gd,o.before=Mo,o.bind=cs,o.bindAll=wg,o.bindKey=No,o.castArray=Wp,o.chain=Po,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=Wo,o.debounce=$o,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=To,o.flattenDeep=ih,o.flattenDepth=sh,o.flip=Ip,o.flow=Eg,o.flowRight=bg,o.fromPairs=ah,o.functions=bd,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=_e,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=Yo,o.method=Fg,o.methodOf=Ig,o.mixin=_s,o.negate=qr,o.nthArg=Pg,o.omit=Ud,o.omitBy=Md,o.once=Rp,o.orderBy=gp,o.over=Og,o.overArgs=Pp,o.overEvery=Lg,o.overSome=Ug,o.partial=ls,o.partialRight=Bo,o.partition=mp,o.pick=Nd,o.pickBy=Zo,o.property=ru,o.propertyOf=Mg,o.pull=gh,o.pullAll=Io,o.pullAllBy=mh,o.pullAllWith=vh,o.pullAt=_h,o.range=Ng,o.rangeRight=Dg,o.rearg=Op,o.reject=yp,o.remove=yh,o.rest=Lp,o.reverse=os,o.sampleSize=xp,o.set=Wd,o.setWith=$d,o.shuffle=Sp,o.slice=wh,o.sortBy=bp,o.sortedUniq=Th,o.sortedUniqBy=Fh,o.split=ug,o.spread=Up,o.tail=Ih,o.take=Rh,o.takeRight=Ph,o.takeRightWhile=Oh,o.takeWhile=Lh,o.tap=Jh,o.throttle=Mp,o.thru=Wr,o.toArray=Ho,o.toPairs=Xo,o.toPairsIn=Qo,o.toPath=qg,o.toPlainObject=zo,o.transform=Bd,o.unary=Np,o.union=Uh,o.unionBy=Mh,o.unionWith=Nh,o.uniq=Dh,o.uniqBy=Wh,o.uniqWith=$h,o.unset=kd,o.unzip=us,o.unzipWith=Ro,o.update=qd,o.updateWith=jd,o.values=bn,o.valuesIn=Gd,o.without=Bh,o.words=tu,o.wrap=Dp,o.xor=kh,o.xorBy=qh,o.xorWith=jh,o.zip=Gh,o.zipObject=Hh,o.zipObjectDeep=Kh,o.zipWith=zh,o.entries=Xo,o.entriesIn=Qo,o.extend=Jo,o.extendWith=Hr,_s(o,o),o.add=Gg,o.attempt=nu,o.camelCase=Jd,o.capitalize=Vo,o.ceil=Hg,o.clamp=Hd,o.clone=$p,o.cloneDeep=kp,o.cloneDeepWith=qp,o.cloneWith=Bp,o.conformsTo=jp,o.deburr=eu,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=bo,o.findKey=yd,o.findLast=op,o.findLastIndex=Co,o.findLastKey=wd,o.floor=zg,o.forEach=Oo,o.forEachRight=Lo,o.forIn=xd,o.forInRight=Sd,o.forOwn=Ad,o.forOwnRight=Ed,o.get=ps,o.gt=Gp,o.gte=Hp,o.has=Td,o.hasIn=ds,o.head=Fo,o.identity=Oe,o.includes=hp,o.indexOf=oh,o.inRange=Kd,o.invoke=Rd,o.isArguments=an,o.isArray=N,o.isArrayBuffer=Kp,o.isArrayLike=Re,o.isArrayLikeObject=he,o.isBoolean=zp,o.isBuffer=Bt,o.isDate=Jp,o.isElement=Yp,o.isEmpty=Zp,o.isEqual=Xp,o.isEqualWith=Qp,o.isError=fs,o.isFinite=Vp,o.isFunction=yt,o.isInteger=ko,o.isLength=jr,o.isMap=qo,o.isMatch=ed,o.isMatchWith=td,o.isNaN=nd,o.isNative=rd,o.isNil=sd,o.isNull=id,o.isNumber=jo,o.isObject=le,o.isObjectLike=fe,o.isPlainObject=Kn,o.isRegExp=hs,o.isSafeInteger=ad,o.isSet=Go,o.isString=Gr,o.isSymbol=Be,o.isTypedArray=En,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=ws,o.stubFalse=xs,o.stubObject=Wg,o.stubString=$g,o.stubTrue=Bg,o.multiply=em,o.nth=dh,o.noConflict=Rg,o.noop=ys,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=Dd,o.round=tm,o.runInContext=p,o.sample=wp,o.size=Ap,o.snakeCase=og,o.some=Ep,o.sortedIndex=xh,o.sortedIndexBy=Sh,o.sortedIndexOf=Ah,o.sortedLastIndex=Eh,o.sortedLastIndexBy=bh,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=W,o.toLength=Ko,o.toLower=hg,o.toNumber=Ve,o.toSafeInteger=hd,o.toString=Q,o.toUpper=pg,o.trim=dg,o.trimEnd=gg,o.trimStart=mg,o.truncate=vg,o.unescape=_g,o.uniqueId=jg,o.upperCase=yg,o.upperFirst=gs,o.each=Oo,o.eachRight=Lo,o.first=Fo,_s(o,function(){var e={};return ut(o,function(t,n){V.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(W(n),0);var r=this.__filtered__&&!t?new j(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},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 Bn(n,e,t)})}),j.prototype.reject=function(e){return this.filter(qr(R(e)))},j.prototype.slice=function(e,t){e=W(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=W(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,y=h[0],w=d||N(l),x=function(q){var H=s.apply(o,Lt([q],h));return r&&b?H[0]:H};w&&n&&typeof y=="function"&&y.length!=1&&(d=w=!1);var b=this.__chain__,T=!!this.__actions__.length,L=u&&!b,$=d&&!T;if(!u&&w){l=$?l:new j(this);var U=e.apply(l,h);return U.__actions__.push({func:Wr,args:[x],thisArg:i}),new Ye(U,b)}return L&&$?e.apply(this,h):(U=this.thru(x),L?r?U.value()[0]:U.value():U)})}),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(N(u)?u:[],s)}return this[n](function(l){return t.apply(N(l)?l:[],s)})}}),ut(j.prototype,function(e,t){var n=o[t];if(n){var r=n.name+"";V.call(yn,r)||(yn[r]=[]),yn[r].push({name:t,func:n})}}),yn[Pr(i,Ue).name]=[{name:"wrapper",func:i}],j.prototype.clone=vl,j.prototype.reverse=_l,j.prototype.value=yl,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,Ln&&(o.prototype[Ln]=Vh),o},mn=Zc();Xt?((Xt.exports=mn)._=mn,vi._=mn):ye._=mn}).call(X0)}(Yn,Yn.exports)),Yn.exports}var V0=Q0();const Cs=c=>{const a=V0.startCase(c).toLowerCase();return a.charAt(0).toUpperCase()+a.slice(1)},ev=({data:c})=>`import { defineObject } from 'twenty-sdk';
|
|
401
228
|
|
|
402
229
|
export default defineObject({
|
|
403
|
-
universalIdentifier: '${
|
|
404
|
-
nameSingular: '${
|
|
405
|
-
namePlural: '${
|
|
406
|
-
labelSingular: '${
|
|
407
|
-
labelPlural: '${
|
|
230
|
+
universalIdentifier: '${Zn.v4()}',
|
|
231
|
+
nameSingular: '${c.nameSingular}',
|
|
232
|
+
namePlural: '${c.namePlural}',
|
|
233
|
+
labelSingular: '${c.labelSingular}',
|
|
234
|
+
labelPlural: '${c.labelPlural}',
|
|
408
235
|
icon: 'IconBox',
|
|
409
236
|
fields: [
|
|
410
237
|
// Add your fields here using defineField helper
|
|
@@ -417,28 +244,28 @@ export default defineObject({
|
|
|
417
244
|
// },
|
|
418
245
|
],
|
|
419
246
|
});
|
|
420
|
-
`,
|
|
247
|
+
`,tv=({name:c,universalIdentifier:a=Zn.v4()})=>{const i=Fn(c);return`import { defineRole } from 'twenty-sdk';
|
|
421
248
|
|
|
422
249
|
export const ${i.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER =
|
|
423
|
-
'${
|
|
250
|
+
'${a}';
|
|
424
251
|
|
|
425
252
|
export default defineRole({
|
|
426
253
|
universalIdentifier: ${i.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER,
|
|
427
|
-
label: '${
|
|
254
|
+
label: '${c}',
|
|
428
255
|
description: 'Add a description for your role',
|
|
429
256
|
canReadAllObjectRecords: true,
|
|
430
257
|
canUpdateAllObjectRecords: true,
|
|
431
258
|
canSoftDeleteAllObjectRecords: true,
|
|
432
259
|
canDestroyAllObjectRecords: false,
|
|
433
260
|
});
|
|
434
|
-
`},
|
|
435
|
-
description: '${
|
|
261
|
+
`},nv=({data:c})=>{const a=Zn.v4(),i=c.description?`
|
|
262
|
+
description: '${c.description}',`:"";return`import { defineField, FieldType } from 'twenty-sdk';
|
|
436
263
|
|
|
437
264
|
export default defineField({
|
|
438
|
-
universalIdentifier: '${
|
|
439
|
-
name: '${
|
|
440
|
-
label: '${
|
|
441
|
-
type: FieldMetadataType.${
|
|
442
|
-
objectUniversalIdentifier: '${
|
|
265
|
+
universalIdentifier: '${a}',
|
|
266
|
+
name: '${c.name}',
|
|
267
|
+
label: '${c.label}',
|
|
268
|
+
type: FieldMetadataType.${c.type},
|
|
269
|
+
objectUniversalIdentifier: '${c.objectUniversalIdentifier}',${i}
|
|
443
270
|
});
|
|
444
|
-
`},
|
|
271
|
+
`},rv="src";class iv{async execute(a,i){try{const f=a??await this.getEntity(),g=this.getFolderName(f),_=i?se.join(Et,i):se.join(Et,rv,g);await ee.ensureDir(_);const{name:S,file:A}=await this.getEntityData(f),I=se.join(_,this.getFileName(S,f));if(await ee.pathExists(I)){const{overwrite:P}=await this.handleFileExist();if(!P)return}await ee.writeFile(I,A),console.log(E.default.green(`✓ Created ${g}:`),E.default.cyan(se.relative(Et,I)))}catch(f){console.error(E.default.red("Add new entity failed:"),f instanceof Error?f.message:f),process.exit(1)}}async getEntityData(a){switch(a){case Y.SyncableEntity.Object:{const i=await this.getObjectData(),f=i.nameSingular,g=ev({data:i});return{name:f,file:g}}case Y.SyncableEntity.Field:{const i=await this.getFieldData(),f=i.name,g=nv({data:i});return{name:f,file:g}}case Y.SyncableEntity.LogicFunction:{const i=await this.getEntityName(a),f=Z0({name:i});return{name:i,file:f}}case Y.SyncableEntity.FrontComponent:{const i=await this.getEntityName(a),f=Y0({name:i});return{name:i,file:f}}case Y.SyncableEntity.Role:{const i=await this.getEntityName(a),f=tv({name:i});return{name:i,file:f}}default:je.assertUnreachable(a)}}async getEntity(){const{entity:a}=await At.default.prompt([{type:"select",name:"entity",message:"What entity do you want to create?",default:"",choices:Object.values(Y.SyncableEntity)}]);return a}async handleFileExist(){return await At.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 At.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 At.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(ft.FieldMetadataType),default:ft.FieldMetadataType.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 At.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 Y.SyncableEntity.FrontComponent:return`${Fn(a)}.tsx`;default:return`${Fn(a)}.ts`}}}const sv=c=>{const a=new $0,i=new B0,f=new k0,g=new q0,_=new H0;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 U0,A=new W0,I=new iv,P=new D0,J=new G0,G=new j0;c.command("app:dev [appPath]").description("Watch and sync local application changes").action(async K=>{await S.execute({appPath:zn(K)})}),c.command("app:uninstall [appPath]").description("Uninstall application from Twenty").option("-y, --yes","Skip confirmation prompt").action(async(K,k)=>{try{const ce=await A.execute({appPath:zn(K),askForConfirmation:!k?.yes});process.exit(ce.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(Y.SyncableEntity).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(zn(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:zn(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(E.default.red("Error: Either --functionName (-n) or --functionUniversalIdentifier (-u) is required.")),process.exit(1)),await G.execute({...k,payload:k?.payload??"{}",appPath:zn(K)})})},av="0.5.1",ov={version:av};bm.inspect.defaultOptions.depth=10;const In=new mu.Command;In.name("twenty").description("CLI for Twenty application development").version(ov.version);In.option("--workspace <name>","Use a specific workspace configuration (overrides the default set by auth:switch)");In.hook("preAction",async c=>{let i=(c.optsWithGlobals?c.optsWithGlobals():c.opts()).workspace;i||(i=await new Ae().getDefaultWorkspace()),Ae.setActiveWorkspace(i),console.log(E.default.gray(`👩💻 Workspace - ${Ae.getActiveWorkspace()}`))});sv(In);In.exitOverride();try{In.parse()}catch(c){c instanceof mu.CommanderError&&process.exit(c.exitCode),c instanceof Error&&(console.error(E.default.red("Error:"),c.message),process.exit(1))}
|